22 #ifndef _TrackedWatchers
32 #ifndef ROOT_TGeoMatrix
33 #include "TGeoMatrix.h"
36 #ifndef Gw_AgataGeometryTransformer
46 Bool_t ok = Watcher::GetFromTrigger(trigger,
"data:tracked", fFrame);
59 Double_t px, py, pz, dx, dy, dz;
63 Double_t x = hit->
GetX() - px;
64 Double_t y = hit->
GetY() - py;
65 Double_t z = hit->
GetZ() + fZOffset - pz;
67 Double_t dd = x*x + y*y + z*z;
69 Double_t cosTheta = (x*dx + y*dy + z*dz)/::sqrt(dd);
79 Coinc2D::Coinc2D(
const char *name,
const char *title, TDirectory *sp_dir, TDirectory *tag_dir):
83 fTrackedEnergyDopler(0x0),
93 fTrackedEnergy = MakeTH1<TH1F>(
"TrackedEnergy",
"Tracked Energy",6000,0,6000);
95 fTrackedEnergyDopler = MakeTH1<TH1F>(
"TrackedEnergyDopler",
"Tracked Energy with Doppler correction",6000,0,6000);
96 TagOn(fTrackedEnergyDopler);
98 fFold = MakeTH1<TH1F>(
"Fold",
"Fold distributions",10,0,10);
101 fGxG = MakeTH2<TH2F>(
"GxG",
"Gamma Gamma matrix",2000,0,1000,2000,0,1000);
102 fGxG_DC = MakeTH2<TH2F>(
"GxG_DC",
"Gamma Gamma matrix with Doppler Correction",2000,0,1000,2000,0,1000);
104 fPos3D = MakeTH3<TH3F>(
"Pos3D",
"Positions of Tracked Gamma-rays ;x;y;z",200,-200,200,200,-200,200,200,-400,0);
116 if ( opt.Contains(
"") ) {
117 c->Divide(1,2,0.001,0.001);
120 TPad *pad =
new TPad(
"GxG_FOLD",
"Pad for Fold distribution",0.7,0.6,1,1);
138 printf(
"Coinc2D::::Exec is called \n");
142 GetCstDataPointer<GammaTrackedInterface>(
fFrame);
152 for (UShort_t i = 0u; i < fold; i++) {
160 Double_t e1 = gamma1->
GetE();
163 if ( vertex->GetBeta() > 0.001 )
166 for (UShort_t j = i+1u; j < fold; j++) {
171 Double_t e2 = gamma2->
GetE();
175 if ( vertex->GetBeta() > 0.001 ) {
187 Float_t EveTrack::fgMetric = 10.;
194 AgataEventDisplay::Instance()->SetTrackStyle(
"Cone");
196 fMeanRadius = MakeTH1<TH1F>(
"MeanRadius",
"Mean radius of the tracks (cm)", 500, -1, 34);
197 fFold = MakeTH1<TH1I>(
"Fold",
"Number of Tracks per event", 22, -1, 20) ;
198 fHitEnergy = MakeTH1<TH1F>(
"HitEnergy",
"Energy of hits", 1000,-1,1000.) ;
199 fTrackEnergy = MakeTH1<TH1F>(
"TrackEnergy",
"Energy of tracks", 2000,0.,2000.) ;
209 TTask::SetActive(active);
210 AgataEventDisplay::Instance()->Reset();
215 c->Divide(2,2,0.001,0.001);
227 fTrackEnergy->Draw();
232 AgataEventDisplay::SetDefaultAgataPath(agataPathFile);
233 AgataEventDisplay::Instance()->BuildDefaultGeometry(
false,
false);
234 AgataEventDisplay::Instance()->ShowDisplay();
247 printf(
"EveTrack::::Exec is called \n");
263 TTask::SetActive(
false);
270 std::cout <<
"Fold " << fold <<
std::endl;
272 for (UShort_t i = 0u; i < fold; ++i) {
276 fTrackEnergy->Fill(gamma->
GetE());
283 for (Int_t j = 0; j < gamma->
GetNbHits(); ++j) {
287 Float_t radius = TMath::Sqrt(gammaHit->
GetX()*gammaHit->
GetX() + gammaHit->
GetY()*gammaHit->
GetY() +
289 fMeanRadius->Fill(radius/fgMetric);
290 fHitEnergy->Fill(gammaHit->
GetE());
292 std::cout <<
"TrackHit Pos " << gammaHit->
GetX()/fgMetric <<
" " << gammaHit->
GetY()/fgMetric
296 shit->
SetX(gammaHit->
GetX()/fgMetric);
297 shit->
SetY(gammaHit->
GetY()/fgMetric);
298 shit->
SetZ(gammaHit->
GetZ()/fgMetric);
AgataEventContainer class that contains agata event to be displayed.
virtual Bool_t IsValid() const
true if it is a valid pointer
virtual void GetDirection(Double_t &, Double_t &, Double_t &, Double_t=0.0) const =0
get the direction of the source (last argument is used in case the position depends on time) ...
virtual void SetE(Float_t e)
virtual VertexInterface * GetVertex()
Get the vertex data interface.
virtual Double_t DoDopplerCorrection(const TrackedHit *hit, VertexInterface *vertex)
Do Doppler taking into account additionnal offset of the agat position (see SetAgataOffset) ...
printf("******************************************************************** \n")
virtual Double_t GetY() const
EveTrack(const char *name, const char *title, TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0)
StdHit * NewHit()
Add a new hit to the track (filling mode). The Stack is emptied by calling Reset. ...
virtual void GetPosition(Double_t &, Double_t &, Double_t &, Double_t=0.0) const =0
get the position of the source (last argument is used in case the position depends on time) ...
AgataEventDisplay a class to work on a specific event display.
virtual Double_t GetE() const
virtual void DoCanvas(TCanvas *c, Option_t *)
To be overwritten by real implementation if a canvas is produced.
virtual void SetZ(Float_t z)
The tracking algorithm produces a stack of TrackedHits.
TH1F * fTrackedEnergyDopler
virtual Bool_t SetTrigger(ADF::DFTrigger *=0x0)
Set the trigger attached to this watcher.
virtual TrackedHit * GetGamma(UShort_t) const =0
To get the current number of gammas in the stack.
void FillTracks(Option_t *type="Agata")
virtual void ShowEve(const Char_t *agataPathFile)
show eve event display
virtual void SetY(Float_t y)
virtual void SetX(Float_t x)
Setter position & energy.
virtual Double_t GetBeta(Double_t=0.0) const =0
get recoil velocity
virtual void SetE(Float_t e)
virtual void Exec(Option_t *option="")
watch the current frame
void SetLastExecStatus(Short_t s=0)
reset last status. 0 means no error, 0 < means error, > 0 means ok with conditions ...
virtual ~Coinc2D()
******************************************************************************************/// ...
virtual void SetY(Float_t y)
virtual void SetZ(Float_t z)
virtual void DopplerCorrection(Hit *)=0
header file for AgataKeyFactory.cpp
virtual void SetX(Float_t x)
Setter position & energy.
It is a hit associated to a list of Hits.
TrackHit * NewTrackHit(Option_t *type="Agata")
add current track hit (added to current track hit list)
virtual void SetAgataOffset(Double_t offset=0.0)
set the agata offset in case it is not @ the optimal position
virtual Double_t GetX() const
virtual UShort_t GetNbHits() const =0
It returns the number of hits for this tracked particle.
void TagOn(TObject *)
Add this histogram to the list of tagged histograms.
virtual Double_t GetGamma(Double_t=0.0) const
Base class for a trigger on a data flow.
TH1F * fTrackedEnergyDopler
ADF::LogMessage & endl(ADF::LogMessage &log)
virtual void DoCanvas(TCanvas *c, Option_t *)
To be overwritten by real implementation if a canvas is produced.
virtual Double_t GetZ() const
virtual UShort_t GetNbGamma() const =0
To get the current number of gammas in the stack.
void SetActive(Bool_t active=true)
Toggle active task.
Coinc2D(const char *name, const char *title, TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0)
*/
virtual Hit * GetHit(UInt_t i=0) const =0
Get Hit number i of the track (already added with NewHit !!)
Base Watcher working for any kind of Trackek Frame (Frame interface) and.
Int_t GetNofEvents() const
get Number of events
virtual void Exec(Option_t *option="")
watch the current frame
static VertexBuilder * theCurrentVertexBuilder()
to get the current VertexWatcher (for other watchers) i.e. the last one registered.