1 #include "ERNeuRadViewer.h" 8 #include "TDirectory.h" 11 #include "FairRootManager.h" 12 #include "FairRunAna.h" 13 #include "FairRuntimeDb.h" 14 #include "FairEventHeader.h" 16 #include "ERNeuRadPixelSignal.h" 20 : fNeuRadPixelSignals(NULL),
21 FairTask(
"ER NeuRad Viewer")
29 FairTask(
"ER NeuRad Viewer", verbose)
41 void ERNeuRadViewer::SetParContainers()
44 FairRunAna* run = FairRunAna::Instance();
45 if ( ! run ) Fatal(
"SetParContainers",
"No analysis run");
47 FairRuntimeDb* rtdb = run->GetRuntimeDb();
48 if ( ! rtdb ) Fatal(
"SetParContainers",
"No runtime database");
56 FairRootManager* ioman = FairRootManager::Instance();
57 if ( ! ioman ) Fatal(
"Init",
"No FairRootManager");
60 if ( !
fNeuRadPixelSignals) Fatal(
"ERNeuRadViewer::Init",
"No NeuRadPixelSignal Collection in input file");
62 fFile = FairRunAna::Instance()->GetOutputFile();
71 dirTitle.Form(
"Event%d",FairRunAna::Instance()->GetEventHeader()->GetMCEntryNumber());
72 TDirectory* dir = fFile->mkdir(dirTitle.Data());
75 TDirectory* front = dir->mkdir(
"front");
76 TDirectory* back = dir->mkdir(
"back");
80 TArrayF* result = signal->ResultSignal();
81 Int_t count = (Int_t)(signal->FinishTime()-signal->StartTime())/signal->dT();
82 Float_t* times =
new Float_t[count];
83 for (Int_t i = 0; i < count; i++){
84 times[i] = signal->StartTime() + signal->dT()*i;
86 TGraph* gr =
new TGraph(count,times,result->GetArray());
88 title.Form(
"PMT Signal, side %d,%d fiber, %d module, %d pe, %d", signal->Side(),
89 signal->PixelNb(), signal->ModuleNb(), signal->PECount(),
90 FairRunAna::Instance()->GetEventHeader()->GetMCEntryNumber());
92 if (signal->Side() == 0)
TClonesArray * fNeuRadPixelSignals
virtual InitStatus Init()
virtual void Exec(Option_t *opt)