16 #include "CbmTofDigiExp.h"
19 #include "CbmTofHit.h"
25 #include "FairLogger.h"
26 #include "FairRootManager.h"
27 #include "FairRunAna.h"
28 #include "FairRuntimeDb.h"
31 #include "Riostream.h"
32 #include "TClonesArray.h"
49 : FairTask(
"HadronAnalysis")
63 , fTofDigiMatchColl(NULL)
67 cout <<
"CbmTofTests: Task started " << endl;
73 : FairTask(name, verbose)
87 , fTofDigiMatchColl(NULL)
114 LOG(info) <<
" CbmTofAnaTestbeam => Get the digi parameters for tof";
117 FairRunAna* ana = FairRunAna::Instance();
118 FairRuntimeDb* rtdb = ana->GetRuntimeDb();
128 LOG(debug) <<
" CbmTofAnaTestbeam => New event";
136 cout <<
"-I- CbmTofAnaTestbeam::Exec : "
137 <<
"event " <<
fEvents <<
" processed." << endl;
144 cout <<
"CbmTofAnaTestbeam::Finish up with " <<
fEvents <<
" analyzed events "
155 FairRootManager* fManager = FairRootManager::Instance();
157 fTofDigisColl = (TClonesArray*) fManager->GetObject(
"CbmTofDigiExp");
160 fTofDigisColl = (TClonesArray*) fManager->GetObject(
"CbmTofDigi");
163 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not get the "
164 "TofDigi TClonesArray!!!";
168 fTofHitsColl = (TClonesArray*) fManager->GetObject(
"TofHit");
170 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not get the "
171 "TofHit TClonesArray!!!";
177 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not get the "
178 "Match TClonesArray!!!";
188 Bool_t isSimulation = kFALSE;
189 LOG(info) <<
"CbmTofAnaTestbeam::InitParameters - Geometry, Mapping, ... ";
191 FairRun* ana = FairRun::Instance();
192 FairRuntimeDb* rtdb = ana->GetRuntimeDb();
195 if (
k14a > iGeoVersion) {}
199 LOG(error) <<
"CbmTofAnaTestbeam::InitParameters => Could not obtain the "
206 LOG(error) <<
"CbmTofAnaTestbeam::InitParameters => Could not obtain the "
249 Int_t iNbTofDigis, iNbTofHits;
256 Double_t dTotalDataSize = 0;
258 CbmTofDigiExp* pDigi;
259 for (Int_t iDigInd = 0; iDigInd < iNbTofDigis; iDigInd++) {
262 Int_t iSmType = pDigi->GetType();
263 Int_t iSm = pDigi->GetSm();
264 Int_t iRpc = pDigi->GetRpc();
265 Int_t iCh = pDigi->GetChannel();
284 Int_t iNbMixedHits = 0;
285 for (Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
291 Double_t dX = pTofHit->
GetX();
292 Double_t dY = pTofHit->
GetY();
293 Double_t dZ = pTofHit->
GetZ();
308 TDirectory* oldir = gDirectory;
309 TFile* fHist =
new TFile(
"./tofTests.hst.root",
"RECREATE");
322 gDirectory->cd(oldir->GetPath());