20#include "CbmTofDigiExp.h"
29#include "FairRootManager.h"
30#include "FairRunAna.h"
31#include "FairRuntimeDb.h"
35#include "TClonesArray.h"
54 : FairTask(
"HadronAnalysis")
68 , fTofDigiMatchColl(NULL)
73 cout <<
"CbmTofTests: Task started " << endl;
79 : FairTask(name, verbose)
93 , fTofDigiMatchColl(NULL)
125 LOG(info) <<
" CbmTofAnaTestbeam => Get the digi parameters for tof";
128 FairRunAna* ana = FairRunAna::Instance();
129 FairRuntimeDb* rtdb = ana->GetRuntimeDb();
140 LOG(debug) <<
" CbmTofAnaTestbeam => New event";
148 cout <<
"-I- CbmTofAnaTestbeam::Exec : "
149 <<
"event " <<
fEvents <<
" processed." << endl;
157 cout <<
"CbmTofAnaTestbeam::Finish up with " <<
fEvents <<
" analyzed events " << endl;
168 FairRootManager* fManager = FairRootManager::Instance();
170 fTofDigisColl = (TClonesArray*) fManager->GetObject(
"CbmTofDigiExp");
175 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not get the "
176 "TofDigi TClonesArray!!!";
180 fTofHitsColl = (TClonesArray*) fManager->GetObject(
"TofHit");
182 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not get the "
183 "TofHit TClonesArray!!!";
189 LOG(error) <<
"CbmTofAnaTestbeam::RegisterInputs => Could not get the "
190 "Match TClonesArray!!!";
201 Bool_t isSimulation = kFALSE;
202 LOG(info) <<
"CbmTofAnaTestbeam::InitParameters - Geometry, Mapping, ... ";
204 FairRun* ana = FairRun::Instance();
205 FairRuntimeDb* rtdb = ana->GetRuntimeDb();
208 if (
k14a > iGeoVersion) {}
212 LOG(error) <<
"CbmTofAnaTestbeam::InitParameters => Could not obtain the "
219 LOG(error) <<
"CbmTofAnaTestbeam::InitParameters => Could not obtain the "
240 TDirectory* oldir = gDirectory;
246 gDirectory->cd(oldir->GetPath());
261 Int_t iNbTofDigis, iNbTofHits;
268 Double_t dTotalDataSize = 0;
270 CbmTofDigiExp* pDigi;
271 for (Int_t iDigInd = 0; iDigInd < iNbTofDigis; iDigInd++) {
274 Int_t iSmType = pDigi->GetType();
275 Int_t iSm = pDigi->GetSm();
276 Int_t iRpc = pDigi->GetRpc();
277 Int_t iCh = pDigi->GetChannel();
296 Int_t iNbMixedHits = 0;
297 for (Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
303 Double_t dX = pTofHit->
GetX();
304 Double_t dY = pTofHit->
GetY();
305 Double_t dZ = pTofHit->
GetZ();
321 TFile* oldFile = gFile;
322 TDirectory* oldDir = gDirectory;
325 TFile*
fHist =
new TFile(
"./tofTests.hst.root",
"RECREATE");
TClonesArray * fTofHitsColl
ClassImp(CbmTofAnaTestbeam)
TClonesArray * fTofDigisColl
virtual void SetParContainers()
Inherited from FairTask.
CbmTofGeoHandler * fGeoHandler
TClonesArray * fTofDigiMatchColl
CbmTofDigiBdfPar * fDigiBdfPar
virtual ~CbmTofAnaTestbeam()
TClonesArray * fTofHitsColl
virtual void Exec(Option_t *option)
Bool_t InitParameters()
Initialize other parameters not included in parameter classes.
virtual InitStatus Init()
Parameters class for the CBM ToF digitizer using beam data distributions.
Bool_t UseExpandedDigi() const
Int_t Init(Bool_t isSimulation=kFALSE)