18 #include "FairLogger.h"
19 #include "FairRootManager.h"
20 #include "FairRunOnline.h"
22 #include "TClonesArray.h"
25 #include "THttpServer.h"
31 using std::setprecision;
55 FairRootManager* ioman = FairRootManager::Instance();
64 fT0DigiVec = ioman->InitObjectAs<std::vector<CbmTofDigi>
const*>(
"T0Digi");
66 fT0DigiArr =
dynamic_cast<TClonesArray*
>(ioman->GetObject(
"T0Digi"));
67 if (!
fT0DigiArr) { LOG(fatal) <<
"No TClonesArray with T0 digis found."; }
71 LOG(info) <<
"No TClonesArray with STS digis found.";
75 LOG(info) <<
"No TClonesArray with MUCH digis found.";
79 LOG(info) <<
"No TClonesArray with TOF digis found.";
82 fEvents =
static_cast<TClonesArray*
>(ioman->GetObject(
"CbmEvent"));
83 if (!
fEvents) { LOG(fatal) <<
"No TClonesArray with events found."; }
95 new TH1F(
"fEventSize",
"Event Size; # Digis; Counts", 1000, -0.5, 999.5);
97 "fEventLength",
"Event Length; time [ns]; Counts", 1000, -0.5, 999.5);
99 "Events per time slice; # Events; Counts",
104 "Number of T0 digis in Event; # digis; Counts",
109 "Number of Sts digis in Event; # digis; Counts",
114 "Number of Much digis in Event; # digis; Counts",
119 "Number of Tof digis in Event; # digis; Counts",
124 new TH1F(
"fT0DeltaT",
125 "Time diff between first and last T0 digi;dt [ns]; Counts",
130 new TH1F(
"fStsDeltaT",
131 "Time diff between first and last Sts digi;dt [ns]; Counts",
136 new TH1F(
"fMuchDeltaT",
137 "Time diff between first and last Much digi;dt [ns]; Counts",
142 new TH1F(
"fTofDeltaT",
143 "Time diff between first and last Tof digi;dt [ns]; Counts",
149 "Nr. of events as fct. of TS",
157 "Length of events as fct. of TS",
167 LOG_IF(info,
fNrTs % 1000 == 0) <<
"Analysing TS " <<
fNrTs;
169 Int_t nrEvents =
fEvents->GetEntriesFast();
174 Int_t nrT0Digis = -1;
183 LOG(debug) <<
"Events: " << nrEvents;
184 LOG(debug) <<
"T0Digis: " << nrT0Digis;
185 LOG(debug) <<
"StsDigis: " << nrStsDigis;
186 LOG(debug) <<
"MuchDigis: " << nrMuchDigis;
187 LOG(debug) <<
"TofDigis: " << nrTofDigis;
190 for (Int_t iEvent = 0; iEvent < nrEvents; iEvent++) {
193 fEventLength->Fill(event->GetEndTime() -
event->GetStartTime());
205 GetTimeDiff<CbmStsDigi>(
207 GetTimeDiff<CbmMuchBeamTimeDigi>(
209 GetTimeDiff<CbmTofDigi>(
218 Double_t startTime {1.e18};
219 Double_t stopTime {0.};
220 Int_t nDigis =
event->GetNofData(dataType);
222 for (Int_t iDigi = 0; iDigi < nDigis; iDigi++) {
223 UInt_t index =
event->GetIndex(dataType, iDigi);
226 if (digi->GetTime() < startTime) startTime = digi->GetTime();
227 if (digi->GetTime() > stopTime) stopTime = digi->GetTime();
229 deltaT->Fill(stopTime - startTime);
234 Double_t startTime {1.e18};
235 Double_t stopTime {0.};
238 for (Int_t iDigi = 0; iDigi < nDigis; iDigi++) {
250 deltaT->Fill(stopTime - startTime);
256 TFile* outfile = TFile::Open(
"test2.root",
"RECREATE");