GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GANIL/PSAWatchers.C
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2010 by Olivier Stezowski *
3  * stezow(AT)ipnl.in2p3.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
21 #include "PSAWatchers.h"
22 
23 #include "TH3.h"
24 #include "TH2.h"
25 #include "TH1.h"
26 #include "TCanvas.h"
27 #include "TPad.h"
28 #include "Hits.h"
29 #include "TPaveStats.h"
30 #include "TLegend.h"
31 #include "CrystalWatchers.h"
32 #include "TPaveText.h"
33 #include "TStyle.h"
34 
35 #include "LoupeOnPad.h"
36 
37 using namespace ADF;
38 
40 {
41  return Watcher::GetFromTrigger(trigger, "data:psa", fFrame);
42 }
43 
44 Float_t PSACrystal3D::fgMetric = 10.;
45 Float_t PSACrystal3D::fRadius = 5. ;
46 Float_t PSACrystal3D::fDepht = 10.;
47 Int_t PSACrystal3D::fNBinX = 50;
48 Int_t PSACrystal3D::fNBinZ = 50;
49 Float_t PSACrystal3D::fDefaultECutMin = 0.;
50 Float_t PSACrystal3D::fDefaultECutMax = 100000000.;
51 
52 
53 PSACrystal3D::PSACrystal3D( const char * name, const char * title, TDirectory *sp_dir, TDirectory *tag_dir):
54  PSAWatcher(name,title,sp_dir,tag_dir),
55  fH3DHitPosition(0x0),
56  fE0(0x0),
57  fE1(0x0),
58  fT0(0x0),
59  fT1(0x0),
60  fTE0(0x0),
61  fTE1(0x0),
62  fEnergySeg(0x0),
63  fNbHits(0x0),
64  fCurrentECutMin(fDefaultECutMin),
65  fCurrentECutMax(fDefaultECutMax)
66 {
67  fH3DHitPosition = MakeTH3<TH3F>("H3DHitPosition", "Distribution of Hits in the crystal; x (cm); y (cm); z (cm)",
68  fNBinX, -fRadius, fRadius,
69  fNBinX, -fRadius, fRadius,
70  fNBinZ, 0, fDepht );
71  fE0 = MakeTH1<TH1F>("ECore0", "Core energy 0, (high gain)",6000, 0, 6000);
72  fE1 = MakeTH1<TH1F>("ECore1", "Core energy 1, (low gain) ",1000, 0, 10000);
73  fE1->SetLineColor(kRed);
74  fT0 = MakeTH1<TH1F>("TCore0", "Core time 0",300, 0, 100);
75  fT1 = MakeTH1<TH1F>("TCore1", "Core time 1",300, 0, 100);
76  fT1->SetLineColor(kRed);
77  fTE0 = MakeTH2<TH2F>("TECore0", "Time energy 0",600,0,6000,300, 0, 100);
78  fTE1 = MakeTH2<TH2F>("TECore1", "Time energy 1",600, 0,6000,300, 0, 100);
79 
80  fEnergySeg = MakeTH1<TH1F>("ESum", "Sum of segment",6000, 0, 6000);
81  fNbHits = MakeTH1<TH1F>("NbHits", "Nb hits in crystal",20, 0, 20);
82 }
83 
85 {
86  ;
87 }
88 
89 
90 void PSACrystal3D::DoCanvas(TCanvas * c, Option_t *o)
91 {
92  TString option = o;
93  if ( option == "3D" ) {
94  fH3DHitPosition->Draw(o);
95  }
96  else {
97  c->Divide(3,2);
98  c->cd(1);
99  fE0->Draw();
100  c->cd(2);
101  fE1->Draw();
102  c->cd(3);
103  fEnergySeg->Draw();
104  c->cd(4);
105  fT0->Draw();
106  fT1->Draw("same");
107  c->cd(5);
108  fTE0->Draw("col");
109  c->cd(6);
110  fTE1->Draw("col");
111  }
112 }
113 
114 void PSACrystal3D::Exec(Option_t * /*option*/)
115 {
116  // be sure the frame has been set properly
117  if ( fFrame == 0x0 || !fFrame->IsValid() )
118  { SetLastExecStatus(-1); return; }
119 
120  const PSAInterface *data = GetCstDataPointer<PSAInterface>(fFrame);
121 
122  Double_t e = 0.;
123  for( UShort_t i=0u; i < data->GetNbHits(); i++ ) {
124  e += data->GetHit(i)->GetE();
125  if( data->GetHit(i)->GetE() >= fCurrentECutMin && data->GetHit(i)->GetE() <= fCurrentECutMax )
126  fH3DHitPosition->Fill(data->GetHit(i)->GetX()/fgMetric,
127  data->GetHit(i)->GetY()/fgMetric,
128  data->GetHit(i)->GetZ()/fgMetric);
129  }
130  fNbHits->Fill(data->GetNbHits());
131  fE0->Fill(data->GetE(0u));
132  fE1->Fill(data->GetE(1u));
133  fT0->Fill(data->GetT(0));
134  fT1->Fill(data->GetT(1));
135  fTE0->Fill(data->GetE(0u),data->GetT(0));
136  fTE1->Fill(data->GetE(1u),data->GetT(1));
137  fEnergySeg->Fill(e);
138 }
139 
140 void PSACrystal3D::SetEnergyCut( Float_t EcutMin,Float_t EcutMax ){
141  if( EcutMax < EcutMin ) {
142  std::cerr << "ERROR: PSACrystal3D::SetEnergyCut( Float_t EcutMin,Float_t EcutMax)"
143  << std::endl
144  << "ECutMin greater than ECutMax, the cut has not been changed : "
145  << "ECutMin = " << fCurrentECutMin
146  << " EcutMax = " << fCurrentECutMax << std::endl;
147  return;
148  }
149 
150  if( EcutMin != fCurrentECutMin && EcutMax != fCurrentECutMax ) {
151  fCurrentECutMin = EcutMin;
152  fCurrentECutMax = EcutMax;
153  fH3DHitPosition->Reset();
154  TString newtitle = Form("Distribution of Hits in the crystal E #in [%lf,%lf]; x (cm); y (cm); z (cm)",
155  EcutMin,
156  EcutMax);
157  fH3DHitPosition->SetTitle(newtitle.Data());
158  }
159 }
160 
161 void PSACrystal3D::SetCurrentECutMin( Float_t EcutMin )
162 {
163  fCurrentECutMin = EcutMin;
164 }
165 void PSACrystal3D::SetCurrentECutMax( Float_t EcutMax )
166 {
167  fCurrentECutMax = EcutMax;
168 }
170 {
171  return(fCurrentECutMin);
172 }
174 {
175  return(fCurrentECutMax);
176 }
177 
178 
180 
181 Float_t PSACrystal::fgMetric = 10.;
182 Float_t PSACrystal::fRadius = 5. ;
183 Float_t PSACrystal::fDepht = 10.;
184 Int_t PSACrystal::fNBinX = 50;
185 Int_t PSACrystal::fNBinZ = 50;
186 Float_t PSACrystal::fDefaultECutMin = 0.;
187 Float_t PSACrystal::fDefaultECutMax = 100000000.;
188 
189 PSACrystal::PSACrystal( const char * name, const char * title, TDirectory *sp_dir, TDirectory *tag_dir):
190  PSAWatcher(name,title,sp_dir,tag_dir),
191  CanvasVisu(name,title),
192  fH3DHitPosition(0x0),
193  fE0(0x0),
194  fE1(0x0),
195  fT0(0x0),
196  fT1(0x0),
197  fTE0(0x0),
198  fTE1(0x0),
199  fEnergySeg(0x0),
200  fNbHits(0x0),
201  fCurrentECutMin(fDefaultECutMin),
202  fCurrentECutMax(fDefaultECutMax),
203  fSpectra( new TObjArray(CrystalInterface::kNbSegments) ),
204  fNevts(0),
205  fCrystalID(0)
206 {
207  fH3DHitPosition = MakeTH3<TH3F>("H3DHitPosition", "Distribution of Hits in the crystal; x (cm); y (cm); z (cm)",
210  fNBinZ, 0, fDepht );
211  fE0 = MakeTH1<TH1F>("ECore_HG", "Core energy 0, (high gain)",6000, 0, 6000);
212  fE1 = MakeTH1<TH1F>("ECore_LG", "Core energy 1, (low gain) ",6000, 0, 6000);
213  for (Int_t i = 0; i < CrystalInterface::kNbSegments; i++ ) {
214  PadPos HistPosition = fHistPositionList[i];
215  TString Name = (TString)"PSA_" + "CrystalName" + "_Seg_" + HistPosition.SegName + "_Specta";
216  TH1F *h = MakeTH1<TH1F>(Name.Data(),Name.Data(), 6000,0,6000);
217  h->GetXaxis()->SetTitle("Energy (keV)");
218  h->GetYaxis()->SetTitle("Counts");
219  fSpectra->AddAt(h,i);
220  }
221  fT0 = MakeTH1<TH1F>("TCore_HG", "Core time 0 (high gain)",1000, 0, 100);
222  fT1 = MakeTH1<TH1F>("TCore_LG", "Core time 1 (low gain)",1000, 0, 100);
223  fTE0 = MakeTH2<TH2F>("TECore_HG", "Time energy 0 (high gain)",6000,0,6000,1000, 0, 100);
224  fTE1 = MakeTH2<TH2F>("TECore_LG", "Time ebergy 1 (low gain)",6000, 0,6000,1000, 0, 100);
225 
226  fEnergySeg = MakeTH1<TH1F>("ESum", "Sum energy of segments",6000, 0, 6000);
227  fNbHits = MakeTH1<TH1F>("NbHits", "Nb hits in crystal",20, 0, 20);
228 
229  for(int i=0 ; i<6 ; i++)
230  {
231  fHitsSlices[i] = MakeTH2<TH2F>(Form("2DHits_%d",i), Form("2DHits_%d",i),fNBinX,-fRadius,fRadius,fNBinX, -fRadius, fRadius);
232  fHitsSlices[i]->GetXaxis()->SetTitle("X (cm)");
233  fHitsSlices[i]->GetYaxis()->SetTitle("Y (cm)");
234  }
235 }
236 
238 {
239 
240 }
241 
243 {
244  return Watcher::GetFromTrigger(trigger, "data:psa", fFrame);
245 }
246 
247 void PSACrystal::Exec(Option_t * /*option*/)
248 {
249  // be sure the frame has been set properly
250  if ( fFrame == 0x0 || !fFrame->IsValid() )
251  { SetLastExecStatus(-1); return; }
252 
253  fNevts++;
254 
255  const PSAInterface *data = GetCstDataPointer<PSAInterface>(fFrame);
256 
257  if(fCrystalID == 0) fCrystalID = data->GetUID();
258 
259  Double_t SumSeg = 0.;
260  int SegID=0;
261  double ESeg=0.;
262 
263  for( UShort_t i=0u; i < data->GetNbHits(); i++ )
264  {
265  SumSeg += data->GetHit(i)->GetE();
266  ESeg = data->GetHit(i)->GetE();
267  SegID = data->GetHit(i)->GetID(0);
268 
269  ((TH1*)(fSpectra->At(SegID)))->Fill(ESeg);
270 
271  if( data->GetHit(i)->GetE() >= fCurrentECutMin && data->GetHit(i)->GetE() <= fCurrentECutMax )
272  {
273  fH3DHitPosition->Fill(data->GetHit(i)->GetX()/fgMetric, data->GetHit(i)->GetY()/fgMetric, data->GetHit(i)->GetZ()/fgMetric);
274 
275  int slice = data->GetHit(i)->GetID(0)%6;
276 
277  fHitsSlices[slice]->Fill(data->GetHit(i)->GetX()/fgMetric, data->GetHit(i)->GetY()/fgMetric);
278  }
279 
280  }
281  fNbHits->Fill(data->GetNbHits());
282  fE0->Fill(data->GetE(0u));
283  fE1->Fill(data->GetE(1u));
284  fT0->Fill(data->GetT(0));
285  fT1->Fill(data->GetT(1));
286  fTE0->Fill(data->GetE(0u),data->GetT(0));
287  fTE1->Fill(data->GetE(1u),data->GetT(1));
288  fEnergySeg->Fill(SumSeg);
289 }
290 
291 void PSACrystal::SetEnergyCut( Float_t EcutMin,Float_t EcutMax ){
292  if( EcutMax < EcutMin ) {
293  std::cerr << "ERROR: PSACrystal3D::SetEnergyCut( Float_t EcutMin,Float_t EcutMax)"
294  << std::endl
295  << "ECutMin greater than ECutMax, the cut has not been changed : "
296  << "ECutMin = " << fCurrentECutMin
297  << " EcutMax = " << fCurrentECutMax << std::endl;
298  return;
299  }
300 
301  if( EcutMin != fCurrentECutMin && EcutMax != fCurrentECutMax ) {
302  fCurrentECutMin = EcutMin;
303  fCurrentECutMax = EcutMax;
304  fH3DHitPosition->Reset();
305  TString newtitle = Form("Distribution of Hits in the crystal E #in [%lf,%lf]; x (cm); y (cm); z (cm)",
306  EcutMin,
307  EcutMax);
308  fH3DHitPosition->SetTitle(newtitle.Data());
309  }
310 }
311 
312 void PSACrystal::SetCurrentECutMin( Float_t EcutMin )
313 {
314  fCurrentECutMin = EcutMin;
315 }
316 void PSACrystal::SetCurrentECutMax( Float_t EcutMax )
317 {
318  fCurrentECutMax = EcutMax;
319 }
321 {
322  return(fCurrentECutMin);
323 }
325 {
326  return(fCurrentECutMax);
327 }
328 
329 void PSACrystal::ShowSpectraMap(const char *option)
330 {
331  TString opt = (TString)option;
332  TCanvas *c = 0x0;
333 
334  const PSAInterface *data = GetCstDataPointer<PSAInterface>(fFrame);
335  TString CrystalName = GetCrystalNameFromID(data->GetUID());
336 
337  opt.ToLower();
338 
339  if(opt == "same") c = (TCanvas*)gPad->GetCanvas();
340  else
341  {
342  TString Name = "PSA_Spectra_" + CrystalName;
343  TString Title = "Mapping of the spectra for crystal " + CrystalName + "at the post psa level";
344 
345  c = CanvasVisu::BuildSegmentedCanvas(Name,Title);
346  }
347  if(c == 0x0) return;
348 
349  c->cd();
350 
351  for(int i=0 ; i<CrystalInterface::kNbSegments ; i++)
352  {
353  PadPos HistPosition = fHistPositionList[i];
354 
355  TPad *pad = (TPad*)c->cd(HistPosition.PadNmbr);
356 
357  TH1 *h = 0x0;
358 
359  TPaveText *p = (TPaveText*)pad->GetListOfPrimitives()->FindObject("InfoPad");
360 
361  h = (TH1*)fSpectra->At(i);
362 
363  TString NameTitle = (TString)"Psa_" + CrystalName + "_Seg_" + HistPosition.SegName + "_Specta";
364 
365  h->SetNameTitle(NameTitle,NameTitle);
366 
367  int col = 0;
368  for(int k=0 ; k<pad->GetListOfPrimitives()->GetSize() ; k++)
369  {
370  if(pad->GetListOfPrimitives()->At(k)->InheritsFrom("TH1"))col++;
371  }
372  h->SetLineColor(GetColor(col));
373  h->SetFillColor(0);
374  h->SetStats(0);
375  h->Draw(opt);
376  if(col==0) h->GetXaxis()->SetRangeUser(1,h->GetXaxis()->GetXmax());
377 
378  if(p)p->Draw();
379 
380  pad->Modified();
381  pad->Update();
382  }
383  for(int i=0 ; i<CrystalInterface::kNbCores ; i++)
384  {
385  PadPos HistPosition = fHistPositionList[CrystalInterface::kNbSegments+i];
386 
387  TPad *pad = (TPad*)c->cd(HistPosition.PadNmbr);
388 
389  TH1 *h = 0x0;
390 
391  TPaveText *p = (TPaveText*)pad->GetListOfPrimitives()->FindObject("InfoPad");
392 
393  if(i==0) h = fE0;
394  else h = fE1;
395 
396  TString NameTitle = (TString)"Psa_" + CrystalName + "_Seg_" + HistPosition.SegName + "_Specta";
397 
398  h->SetNameTitle(NameTitle,NameTitle);
399 
400  int col = 0;
401  for(int k=0 ; k<pad->GetListOfPrimitives()->GetSize() ; k++)
402  {
403  if(pad->GetListOfPrimitives()->At(k)->InheritsFrom("TH1"))col++;
404  }
405  h->SetLineColor(GetColor(col));
406  h->SetFillColor(0);
407  h->SetStats(0);
408  h->Draw(opt);
409  if(col==0) h->GetXaxis()->SetRangeUser(1,h->GetXaxis()->GetXmax());
410 
411  if(p)p->Draw();
412 
413  pad->Modified();
414  pad->Update();
415  }
416 
417  if(!opt.Contains("same"))
418  {
419  new LoupeOnPad(c);
420  SetLoupe(false);
421  }
422 }
423 
425 {
426  const PSAInterface *data = GetCstDataPointer<PSAInterface>(fFrame);
427  TString CrystalName = GetCrystalNameFromID(data->GetUID());
428 
429  TString Name = "PSA_3DHits" + CrystalName;
430  TString Title = "PSA 3D Hits for crystal " + CrystalName;
431 
432  TCanvas *canvas = CanvasVisu::NewCanvas(Name,Title);
433 
434  gStyle->SetOptTitle(0);
435 
436  canvas->Divide(3,1,0.001,0.001);
437  canvas->cd(1)->Divide(1,3,0.001,0.001);
438  for(int i=0 ; i<3 ; i++)
439  {
440  canvas->cd(1)->cd(3-i);
441  fHitsSlices[i]->Draw("col");
442  }
443 
444  canvas->cd(2)->Divide(1,3,0.001,0.001);
445  for(int i=3 ; i<6 ; i++)
446  {
447  canvas->cd(2)->cd(3-(i-3));
448  fHitsSlices[i]->Draw("col");
449  }
450 
451  canvas->cd(3);
452 
453  fH3DHitPosition->Draw("");
454 
455 }
456 
458 {
459  const PSAInterface *data = GetCstDataPointer<PSAInterface>(fFrame);
460  TString CrystalName = GetCrystalNameFromID(data->GetUID());
461 
462  TString Name = "PSA_CoreVsSumSeg" + CrystalName;
463  TString Title = "PSA Core versus sum segments spectra " + CrystalName;
464 
465  TCanvas *c = CanvasVisu::NewCanvas(Name,Title);
466 
467  c->Divide(1,2,0.001,0.001);
468 
469  double topmarg = 0.0657599;
470  double rightmarg = 0.00726832;
471  double leftmarg = 0.0490612;
472  double bottommarg = 0.114119;
473 
474  TH1 *h[2] = {fNbHits,fEnergySeg};
475  TString titles[2] = {"Fold","Energy (keV)"};
476 
477  for(int i=0 ; i<2 ; i++)
478  {
479  c->cd(i+1);
480 
481  gPad->SetRightMargin(rightmarg);
482  gPad->SetTopMargin(topmarg);
483  gPad->SetLeftMargin(leftmarg);
484  gPad->SetBottomMargin(bottommarg);
485 
486  TH1 *htemp = h[i];
487 
488  htemp->SetLineColor(GetColor(0));
489  htemp->Draw();
490 
491  htemp->GetXaxis()->SetTitle(titles[i]);
492  htemp->GetXaxis()->SetTitleSize(0.06);
493  htemp->GetXaxis()->SetLabelSize(0.06);
494  htemp->GetXaxis()->SetTitleOffset(0.91);
495 
496  htemp->GetYaxis()->SetTitle("Counts");
497  htemp->GetYaxis()->SetTitleSize(0.06);
498  htemp->GetYaxis()->SetLabelSize(0.06);
499  htemp->GetYaxis()->SetTitleOffset(0.45);
500 
501  if(i==1)
502  {
503  htemp->SetBit(TH1::kNoTitle);
504  fE0->SetLineColor(GetColor(1));
505  fE0->Draw("same");
506  fE1->SetLineColor(GetColor(2));
507  fE1->Draw("same");
508  }
509 
510  gPad->Modified();
511  gPad->Update();
512 
513  TPaveStats *st = (TPaveStats*)htemp->FindObject("stats");
514  if(st)
515  {
516  st->SetX2NDC(1-rightmarg);
517  st->SetY2NDC(1-topmarg);
518  }
519 
520  TPaveText *txt = (TPaveText*)gPad->FindObject("title");
521  if(txt)
522  {
523  double width = txt->GetY2NDC()-txt->GetY1NDC();
524  txt->SetY2NDC(1-topmarg);
525  txt->SetY1NDC(txt->GetY2NDC()-width);
526  }
527 
528  if(i==1)
529  {
530  TLegend *leg = new TLegend(st->GetX1NDC(),st->GetY1NDC()-(st->GetY2NDC()-st->GetY1NDC()),st->GetX2NDC(),st->GetY1NDC(),"","NDC");
531  leg->AddEntry(fEnergySeg,fEnergySeg->GetTitle(),"l");
532  leg->AddEntry(fE0,fE0->GetTitle(),"l");
533  leg->AddEntry(fE1,fE1->GetTitle(),"l");
534  leg->Draw();
535  }
536  }
537 }
538 
540 {
541  const PSAInterface *data = GetCstDataPointer<PSAInterface>(fFrame);
542  TString CrystalName = GetCrystalNameFromID(data->GetUID());
543 
544  TString Name = "PSA_TimeVsE" + CrystalName;
545  TString Title = "PSA time versus energy of the core" + CrystalName;
546 
547  TCanvas *c = CanvasVisu::NewCanvas(Name,Title);
548 
549  c->Divide(2,2,0.001,0.001);
550 
551  double topmarg = 0.0560089;
552  double rightmarg = 0.0234869;
553  double leftmarg = 0.0747608;
554  double bottommarg = 0.104442;
555 
556  TH1 *h[4] = {fT0,fT1,fTE0,fTE1};
557 
558  for(int i=0 ; i<4 ; i++)
559  {
560  c->cd(i+1);
561 
562  gPad->SetRightMargin(rightmarg);
563  gPad->SetTopMargin(topmarg);
564  gPad->SetLeftMargin(leftmarg);
565  gPad->SetBottomMargin(bottommarg);
566 
567  TH1 *htemp = h[i];
568 
569  htemp->SetLineColor(GetColor(0));
570 
571  if(i<2)htemp->Draw();
572  else
573  {
574  htemp->Draw("col");
575  gPad->SetLogz();
576  }
577 
578  if(i<2) htemp->GetXaxis()->SetTitle("Time (ns)");
579  else htemp->GetXaxis()->SetTitle("Energy (keV)");
580  htemp->GetXaxis()->SetTitleSize(0.05);
581  htemp->GetXaxis()->SetLabelSize(0.05);
582 
583 
584  if(i<2) htemp->GetYaxis()->SetTitle("Counts");
585  else htemp->GetYaxis()->SetTitle("Time (ns)");
586  htemp->GetYaxis()->SetTitleSize(0.05);
587  htemp->GetYaxis()->SetLabelSize(0.05);
588  htemp->GetYaxis()->SetTitleOffset(0.8);
589 
590  htemp->SetBit(TH1::kNoTitle);
591 
592  gPad->Modified();
593  gPad->Update();
594 
595  TPaveStats *st = (TPaveStats*)htemp->FindObject("stats");
596  if(st)
597  {
598  st->SetX2NDC(1-rightmarg);
599  st->SetY2NDC(1-topmarg);
600  }
601  }
602 }
603 
604 void PSACrystal::Print(const char * /*option*/ ) const
605 {
606  std::cout<<std::endl;
607  int size = 3 + 3 + ((TString)GetName()).Length() + 5 + ((TString)GetTitle()).Length() + 3 + 3;
608  for(int i=0; i<size ; i++) std::cout<<"*";
609  std::cout<<std::endl;
610  std::cout<<"*** "<<GetName()<<" --- "<<GetTitle()<<" ***"<<std::endl;
611  for(int i=0; i<size ; i++) std::cout<<"*";
612  std::cout<<std::endl;
613 
614  std::cout<<"Number of treated events : "<<fNevts<<std::endl;
615  std::cout<<"Crystal ID : "<<fCrystalID<<std::endl;
616 }
617 
618 
622 
623 
624 
void Exec(Option_t *)
virtual Bool_t IsValid() const
true if it is a valid pointer
Definition: Frame.h:616
virtual UShort_t GetNbHits() const =0
To know the number of Hits currently on the stack.
void SetCurrentECutMin(Float_t EcutMin)
virtual Double_t GetY() const
Definition: Hits.h:57
ClassImp(PSAWatcher)
TString GetCrystalNameFromID(int ID)
Definition: CanvasVisu.C:636
Float_t GetCurrentECutMax() const
static Float_t fRadius
Float_t GetCurrentECutMax() const
static Int_t fNBinZ
void SetCurrentECutMin(Float_t EcutMin)
vector< PadPos > fHistPositionList
Definition: CanvasVisu.h:44
virtual Double_t GetE(UInt_t=0u) const =0
to get the energy associated to the core
void ShowCoreVsSumSeg()
virtual Double_t GetE() const
Definition: Hits.h:67
virtual Int_t GetUID() const =0
to get the crystal ID
Float_t fCurrentECutMin
static Float_t fDepht
TObjArray * fSpectra
virtual void Print(const char *option="") const
void SetCurrentECutMax(Float_t EcutMax)
SharedFP * fFrame
TCanvas * NewCanvas(TString cname, TString ctitle)
Definition: CanvasVisu.C:102
virtual Double_t GetT(UInt_t=0u) const =0
to get the time associated to the core
Data produced fro a Crystal.
Definition: CrystalFrame.h:106
virtual void DoCanvas(TCanvas *c, Option_t *)
To be overwritten by real implementation if a canvas is produced.
header file for Hits.cpp
Bool_t SetTrigger(ADF::DFTrigger *trigger)
Set the frame to be watched from the trigger.
To get a 3D map of hits in a particular crystal.
virtual Int_t GetID(Int_t=0) const
Definition: Hits.h:111
void SetLastExecStatus(Short_t s=0)
reset last status. 0 means no error, 0 < means error, > 0 means ok with conditions ...
Definition: Watchers.h:294
PSACrystal3D(const char *name, const char *title, TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0)
LoupOnPad, a class to Loupe on a Pad in a Canvas with many pads in it.
Definition: LoupeOnPad.h:76
TCanvas * BuildSegmentedCanvas(TString CanvasName, TString CanvasTitle)
Definition: CanvasVisu.C:125
Color_t GetColor(int i)
Definition: CanvasVisu.h:49
virtual Double_t GetX() const
Definition: Hits.h:55
virtual void Exec(Option_t *option="")
static Float_t fDefaultECutMin
Base class for a trigger on a data flow.
Definition: Trigger.h:155
ADF::LogMessage & endl(ADF::LogMessage &log)
void SetCurrentECutMax(Float_t EcutMax)
void SetEnergyCut(Float_t EcutMin, Float_t EcutMax)
to apply cut on the hits
virtual Double_t GetZ() const
Definition: Hits.h:59
Float_t GetCurrentECutMin() const
TH3F * fH3DHitPosition
Float_t fCurrentECutMax
virtual Bool_t SetTrigger(ADF::DFTrigger *=0x0)
Set the frame to be watched from the trigger.
const Int_t size
Definition: BenchIO.C:24
virtual Hit * GetHit(UShort_t)=0
To get back a particular Hit (already on the stack !)
TH2F * fHitsSlices[6]
static Int_t fNBinX
PSACrystal(const char *name="PSACrystal", const char *title="Display the psa values for one crystal at the producer level", TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0)
static Float_t fDefaultECutMax
virtual void ShowSpectraMap(const char *option="")
virtual ~PSACrystal3D()
Base Watcher working for any kind of Frame (Frame interface)
static Float_t fgMetric
PSA watcher class.
virtual ~PSACrystal()
virtual void SetLoupe(bool loupeon=true)
void SetEnergyCut(Float_t EcutMin, Float_t EcutMax)
to apply cut on the hits
Float_t GetCurrentECutMin() const