61 GetTree()->Branch(
"EventNumber", &fEventNumber,
"evnumber/i");
62 GetTree()->Branch(
"TimeStamp", &fTimestamp,
"timestamp/l");
69 printf(
"ADKeyTree::Exec is called \n");
72 if ( fFrame == 0x0 || !fFrame->
IsValid() )
101 GetTree()->Branch(
"nbTrack",&nbTrack,
"nbTrack/I");
102 GetTree()->Branch(
"trackE", trackE,
"trackE[nbTrack]/F");
103 GetTree()->Branch(
"trackEDC", trackEDC,
"trackEDC[nbTrack]/F");
104 GetTree()->Branch(
"trackX1",trackX1,
"trackX1[nbTrack]/F");
105 GetTree()->Branch(
"trackY1",trackY1,
"trackY1[nbTrack]/F");
106 GetTree()->Branch(
"trackZ1",trackZ1,
"trackZ1[nbTrack]/F");
107 GetTree()->Branch(
"trackX2",trackX2,
"trackX2[nbTrack]/F");
108 GetTree()->Branch(
"trackY2",trackY2,
"trackY2[nbTrack]/F");
109 GetTree()->Branch(
"trackZ2",trackZ2,
"trackZ2[nbTrack]/F");
110 GetTree()->Branch(
"trackXS",trackXS,
"trackXS[nbTrack]/F");
111 GetTree()->Branch(
"trackYS",trackYS,
"trackYS[nbTrack]/F");
112 GetTree()->Branch(
"trackZS",trackZS,
"trackZS[nbTrack]/F");
113 GetTree()->Branch(
"cosTheta",cosTheta,
"cosTheta[nbTrack]/F");
114 GetTree()->Branch(
"trackT", trackT,
"trackT[nbTrack]/F");
115 GetTree()->Branch(
"trackCrystalID",trackCrystalID,
"trackCrystalID[nbTrack]/I");
119 #ifdef CHECK_COMMISSIONING_GANIL
120 GetTree()->Branch(
"Eg",Eg,
"Eg[45]/F");
121 GetTree()->Branch(
"Eg1",Eg1,
"Eg1[45]/F");
122 GetTree()->Branch(
"EgA",EgA,
"EgA[45]/F");
130 #include "TVector3.h"
148 Double_t px, py, pz, dx, dy, dz;
149 vertex->
GetPosition (px, py, pz); vertex->GetDirection(dx, dy, dz);
151 #ifdef CHECK_COMMISSIONING_GANIL
152 for (UShort_t i = 0u; i < MaxG; i++)
153 Eg[i] = Eg1[i] = EgA[i] = 0.;
158 for (UShort_t i = 0u; i < nbTrack; i++) {
163 Double_t x = gamma1->
GetX() - px;
164 Double_t y = gamma1->
GetY() - py;
170 Double_t dd = x*x + y*y + z*z;
172 cosTheta[i] = (x*dx + y*dy + z*dz)/::sqrt(dd);
179 trackE[i] = gamma1->
GetE();
180 trackCrystalID[i] = gamma1->
GetID();
188 trackT[i] = hit1->
GetT();
189 trackCrystalID[i] = hit1->
GetID(1);
191 #ifdef CHECK_COMMISSIONING_GANIL
198 Double_t Beta = vertex->GetBeta();
199 Double_t Gamma = vertex->GetGamma();
201 Double_t YV = -1.*dx;
203 Vecg.SetXYZ(trackYS[i],-1.*trackXS[i],trackZS[i]);
205 Double_t Theta = Vecg.Theta();
206 Double_t Phi = Vecg.Phi();
217 Eg[i] = Eg1[i] * (Gamma)*(1.0 - (Beta)*CosAlpha);
218 EgA[i] = acos(CosAlpha) * TMath::RadToDeg();
221 trackX1[i] = gamma1->
GetX();
222 trackY1[i] = gamma1->
GetY();
223 trackZ1[i] = gamma1->
GetZ();
226 if ( gamma1->
GetHit(1) ) {
232 trackX2[i] = gamma1->
GetX();
233 trackY2[i] = gamma1->
GetY();
234 trackZ2[i] = gamma1->
GetZ();
279 if ( fVertexBuilder == 0x0 )
280 std::cout <<
"Should not be NULL " <<
std::endl;
283 if ( gSystem->AccessPathName(
"CrystalPositionLookUpTable") ) {
284 if ( gSystem->AccessPathName(
"CrystalPositionLookUpTable.dat") ) {
285 fLog <<
error <<
" CrystalPositionLookUpTable required " <<
nline;
288 fLog <<
info <<
" Ge positions extracted from CrystalPositionLookUpTable.dat " <<
nline;
293 fLog <<
info <<
" Ge positions extracted from CrystalPositionLookUpTable.dat " <<
nline;
302 fIdSpectra = MakeTH1<TH1F>(
"hit_ID_spectra",
"Spectra of the ID ",100,0,100);
303 fSumSpectra = MakeTH1<TH1F>(
"SumSpectra",
"Sum of all core energy ",4096,0,4096);
304 fhitAgata = MakeTH3<TH3F>(
"hitDW",
"Tracking from TaDSSD to WallD ;x;y;z",100,-200.,200.,100,-200.,200.,200,-4000.,4000.);
315 GetTree()->Branch(
"nbHits",&nbHits,
"nbHits/I");
316 GetTree()->Branch(
"ESum",&ESum,
"ESum/F");
317 GetTree()->Branch(
"hitE",hitE,
"hitE[nbHits]/F");
318 GetTree()->Branch(
"hitX",hitX,
"hitX[nbHits]/F");
319 GetTree()->Branch(
"hitY",hitY,
"hitY[nbHits]/F");
320 GetTree()->Branch(
"hitZ",hitZ,
"hitZ[nbHits]/F");
321 GetTree()->Branch(
"hitGX",hitGX,
"hitGX[nbHits]/F");
322 GetTree()->Branch(
"hitGY",hitGY,
"hitGY[nbHits]/F");
323 GetTree()->Branch(
"hitGZ",hitGZ,
"hitGZ[nbHits]/F");
324 GetTree()->Branch(
"hitId",hitId,
"hitId[nbHits]/I");
325 GetTree()->Branch(
"hitSg",hitSg,
"hitSg[nbHits]/I");
327 GetTree()->Branch(
"nbCores",&nbCores,
"nbCores/I");
328 GetTree()->Branch(
"coreId",coreId,
"coreId[nbCores]/I");
329 GetTree()->Branch(
"coreE0",coreE0,
"coreE0[nbCores]/F");
330 GetTree()->Branch(
"coreE1",coreE1,
"coreE1[nbCores]/F");
331 GetTree()->Branch(
"coreT0",coreT0,
"coreT0[nbCores]/F");
332 GetTree()->Branch(
"coreT1",coreT1,
"coreT1[nbCores]/F");
333 GetTree()->Branch(
"coreDE0",coreDE0,
"coreDE0[nbCores]/F");
334 GetTree()->Branch(
"coreDE1",coreDE1,
"coreDE1[nbCores]/F");
335 GetTree()->Branch(
"velDop",velDop,
"velDop[nbCores]/F");
336 GetTree()->Branch(
"hit_per_cryst",hit_per_cryst,
"hit_per_cryst[nbCores]/I");
352 for(
int i=0; i<MaxCore ; i++) {
366 Double_t max_e0 = 0.0; Double_t xLocal, yLocal, zLocal, xGlobal, yGlobal, zGlobal, xt,yt,zt;
TrackedHitImp<EHit,EHit> gamma; Int_t nb_hits = 0;
381 nbHits = nbCores = 0;
389 fIdSpectra->Fill(data->
GetUID());
390 fSumSpectra->Fill(data->
GetE());
394 coreId[nbCores] = data->
GetUID();
395 coreE0[nbCores] = data->
GetE();
396 coreE1[nbCores] = data->
GetE(1u);
397 coreT0[nbCores] = data->
GetT();
398 coreT1[nbCores] = data->
GetT(1u);
399 hit_per_cryst[nbCores] = nb_hits;
400 velDop[nbCores] = beta0;
404 for (Int_t j = 0; j < nb_hits; ++j) {
408 hitE[nbHits] = pHit->
GetE();
409 ESum += hitE[nbHits];
410 hitX[nbHits] = pHit->
GetX();
411 hitY[nbHits] = pHit->
GetY();
412 hitZ[nbHits] = pHit->
GetZ();
413 hitId[nbHits] = data->
GetUID() ;
414 hitSg[nbHits] = pHit->
GetID();
417 pHit->
GetXYZ(xLocal, yLocal, zLocal);
422 hitGX[nbHits]= xGlobal;
423 hitGY[nbHits]= yGlobal;
424 hitGZ[nbHits]= zGlobal;
425 fhitAgata->Fill(xGlobal,yGlobal, zGlobal);
431 pHit->
GetXYZ(xLocal, yLocal, zLocal);
435 if ( vertex &&beta0>0 && beta0<1) {
437 fhitAgata->Fill(xt,yt,zt);
440 if ( pHit->
GetE() > max_e0 ) {
444 gamma.
SetXYZ(xGlobal, yGlobal, zGlobal);
445 max_e0 = pHit->
GetE();
451 Double_t edc0 = -1, edc1 = -1;
453 gamma.
SetE(coreE0[nbCores]);
455 gamma.
SetE(coreE1[nbCores]);
458 coreDE0[nbCores] = edc0;
459 coreDE1[nbCores] = edc1;
461 if ( nbHits == 500 ) {
463 fLog <<
error <<
" Number of Hits to hit in ! " << nbHits <<
nline;
464 nbHits = nbCores = 0;
478 Double_t px, py, pz, dx, dy, dz;
485 Double_t x = hit->
GetX() - px;
486 Double_t y = hit->
GetY() - py;
487 Double_t z = hit->
GetZ() - pz;
489 Double_t dd = x*x + y*y + z*z;
491 Double_t cosTheta = (x*dx + y*dy + z*dz)/::sqrt(dd);
492 e = VertexInterface::DopplerCorrection(e,beta,gamma,cosTheta);
535 if ( fp == 0x0 || !fp->
IsValid() )
569 GetTree()->Branch(
"number_of_hits",&number_of_hits,
"number_of_hits/I");
570 GetTree()->Branch(
"hitE",hitE,
"hitE[number_of_hits]/F");
571 GetTree()->Branch(
"hitX",hitX,
"hitX[number_of_hits]/F");
572 GetTree()->Branch(
"hitY",hitY,
"hitY[number_of_hits]/F");
573 GetTree()->Branch(
"hitZ",hitZ,
"hitZ[number_of_hits]/F");
574 GetTree()->Branch(
"hitSg",hitSg,
"hitSg[number_of_hits]/I");
575 GetTree()->Branch(
"coreE0",&coreE0,
"coreE0/F");
576 GetTree()->Branch(
"coreE1",&coreE1,
"coreE1/F");
577 GetTree()->Branch(
"coreT0",&coreT0,
"coreT0/F");
578 GetTree()->Branch(
"coreT1",&coreT1,
"coreT1/F");
596 coreE0 = data->
GetE(0u);
597 coreE1 = data->
GetE(1u);
598 coreT0 = data->
GetT(0u);
599 coreT1 = data->
GetT(1u);
601 for( UShort_t i=0u; i < number_of_hits; i++ )
637 memset(CoreTraces, 0,
kNCC*
sizeof(Float_t)*kNSamples);
639 for(
int atseg = 0; atseg <
kNSG; atseg++) {
641 SegBaselines[atseg] = 0;
643 for(
int atcore = 0; atcore <
kNCC; atcore++) {
645 CoreBaselines[atcore] = 0;
660 GetTree()->Branch(
"CoreTraces", CoreTraces, Form(
"CoreTraces[%d]/F",
kNCC*kNSamples));
662 GetTree()->Branch(
"SegBaselines", SegBaselines, Form(
"SegBaselines[%d]/D",
kNSG));
663 GetTree()->Branch(
"SegE", SegE, Form(
"SegE[%d]/D",
kNSG));
665 GetTree()->Branch(
"CoreBaselines", CoreBaselines, Form(
"CoreBaselines[%d]/D",
kNCC));
666 GetTree()->Branch(
"CoreE", CoreE, Form(
"CoreE[%d]/D",
kNCC));
687 for (Int_t i = 0; i <
kNCC; i++ )
696 for (Int_t i = 0; i <
kNSG; i++ )
724 for(
int i=0 ; i<h->GetNbinsX() ; i++)
726 g->SetPoint(i,h->GetBinLowEdge(i+1),h->GetBinCenter(i+1));
738 int size = 3 + 3 + ((TString)GetName()).Length() + 5 + ((TString)GetTitle()).Length() + 3 + 3;
739 for(
int i=0; i<
size ; i++) std::cout<<
"*";
741 std::cout<<
"*** "<<GetName()<<
" --- "<<GetTitle()<<
" ***"<<
std::endl;
742 for(
int i=0; i<
size ; i++) std::cout<<
"*";
virtual Double_t GetE() const
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 VertexInterface * GetVertex()
Get the vertex data interface.
virtual UShort_t GetNbHits() const =0
To know the number of Hits currently on the stack.
virtual Key * GetKey()=0
To get the Key associated to this frame.
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 Frame * GetFrame() const
ADCrystalTree(const char *name, const char *title, TTree *tree=0x0)
UInt_t GetNbFramePSA()
number of PSA Frames extracted from the current event
virtual Double_t GetY() const
virtual void Exec(Option_t *option="")
watch the current frame
virtual void SetBranches()
virtual GeCore * GetCore(UShort_t)=0
to get each core
virtual void SetBranches()
virtual void Exec(Option_t *option="")
watch the current frame
LogMessage & error(LogMessage &)
ULong64_t fTimestamp
Current timestamp.
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) ...
virtual UShort_t Get(UShort_t, UInt_t) const =0
Method to get the value for a particular bin of the signal.
std::vector< Double_t > fFromSignal
Some characteritics extracted from the signal.
ADCoincTree(const char *name, const char *title, TTree *tree=0x0)
virtual Double_t GetE(UInt_t=0u) const =0
to get the energy associated to the core
virtual GeSegment * GetSegment(UShort_t)=0
to get individual segment
virtual Signal * GetSignal()
virtual Double_t GetE() const
virtual Int_t GetUID() const =0
to get the crystal ID
virtual void Exec(Option_t *option="")
watch the current frame
virtual SharedFP * GetInputSharedFP(UInt_t which=0u)=0
to get back the Shared pointer that define this trigger
The tracking algorithm produces a stack of TrackedHits.
virtual TrackedHit * GetGamma(UShort_t) const =0
To get the current number of gammas in the stack.
virtual void Print(Option_t *option="") const
void FillSpectraByUser()
Filling the spectra.
virtual void Exec(Option_t *option="")
watch the current frame
virtual Double_t GetT(UInt_t=0u) const =0
to get the time associated to the core
LogMessage & nline(LogMessage &)
virtual void SetBranches()
virtual Double_t GetX() const
Data produced fro a Crystal.
virtual Double_t GetE() const
void FillSpectraByUser()
Filling the spectra.
AgataGeometryTransformer * fTrans
used to transform local to global [since otherwise done in tracking]
virtual ULong64_t GetTimeStamp() const =0
To set the timestamp.
virtual Double_t GetBeta(Double_t=0.0) const =0
get recoil velocity
Base class for a Watcher.
ADHitTree(const char *name, const char *title, TTree *tree=0x0)
ULong64_t fTimestamp
Current timestamp.
virtual Int_t GetID(Int_t=0) const
virtual UInt_t GetNbInputFrame() const =0
number of input frames that define this trigger
ULong64_t fTimestamp
Current timestamp.
virtual void Exec(Option_t *option="")
change for that signal baseline, threshold and overshoot
void SetLastExecStatus(Short_t s=0)
reset last status. 0 means no error, 0 < means error, > 0 means ok with conditions ...
virtual Double_t GetT() const
LogMessage & info(LogMessage &)
manipulator to modify the LogMessage
Base class for a Watcher that fill a TTree or some branches of a TTree.
virtual UInt_t GetEventNumber() const =0
To get the event number encoded.
virtual void SetBranches()
virtual void SetBranches()
add branches to the ttree.
virtual Frame * GetInputFrame(UInt_t which=0u)=0
to get back the frames that define this trigger
virtual Double_t GetZ() const
Base Watcher working for any event:data.
ADPSAHitTree(const char *name, const char *title, TTree *tree=0x0)
virtual Double_t DoDopplerCorrection(const TrackedHit *hit, VertexInterface *vertex)
Do Doppler taking into account additionnal offset of the agata position (see SetAgataOffset) ...
virtual void SetXYZ(Double_t x, Double_t y, Double_t z)
virtual void SetE(Double_t e)
It is a hit associated to a list of Hits.
virtual Double_t GetX() const
PSAInterface * GetDataPSA(UInt_t which)
To get one by one the PSA Frames in one event (It fills fFramePSA). Read has beed called ! ...
virtual Double_t GetGamma(Double_t=0.0) const
void ConvertInGraph(TH1 *h, TGraph *g)
virtual Int_t GetID(Int_t which_id=0) const
get crystal/segment id. if which_id > 0, get crystal ID.
virtual void FillTree()
Fill the tree if it is the owner of the tree.
virtual void Exec(Option_t *option="")
watch the current frame
Base class for a trigger on a data flow.
ADF::LogMessage & endl(ADF::LogMessage &log)
ADKeyTree(const char *name, const char *title, TTree *tree=0x0)
ADTrackTree(const char *name, const char *title, TTree *tree=0x0)
static const int kNSamples
virtual Double_t GetZ() const
virtual UShort_t GetNbGamma() const =0
To get the current number of gammas in the stack.
void FillSpectraByUser()
Filling the spectra.
virtual void Print(Option_t *option="") const
SharedFP * fFrame
main frame i.e. event:data:psa
Concrete implementation of a tracked Hit.
virtual ADF::DFTrigger * GetTrigger() const
To know the trigger in which the frame to be watched is embedded.
*********************************** EventPSAWatcher Class **************************************/// ...
virtual Double_t GetY() const
virtual Hit * GetHit(UShort_t)=0
To get back a particular Hit (already on the stack !)
virtual Bool_t SetTrigger(ADF::DFTrigger *=0x0)
set the trigger on the main Frame whatever it is
Base Watcher working for any kind of Frame (Frame interface)
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.
virtual void GetXYZ(Double_t &x, Double_t &y, Double_t &z) const
virtual void SetBranches()
virtual void Exec(Option_t *option="")
watch the current frame
TTree * GetTree()
to get the current Tree
static VertexBuilder * theCurrentVertexBuilder()
to get the current VertexWatcher (for other watchers) i.e. the last one registered.