22#include <FairRootManager.h>
25#include <TClonesArray.h>
26#include <TStopwatch.h>
38 FairRootManager* manager = FairRootManager::Instance();
46 FairRootManager* manager = FairRootManager::Instance();
48 fCbmEvents =
dynamic_cast<TClonesArray*
>(manager->GetObject(
"CbmEvent"));
50 LOG(info) <<
": CbmEvent NOT found \n \n \n";
53 LOG(info) <<
": CbmEvent found \n \n \n";
59 LOG(fatal) <<
"CbmRichHitProducer::Init: No RichDigi array!";
62 fRichHits =
new TClonesArray(
"CbmRichHit");
63 manager->Register(
"RichHit",
"RICH",
fRichHits, IsOutputBranchPersistent(
"RichHit"));
88 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
98 logOut << setw(20) << left << GetName() <<
" [";
99 logOut << fixed << setw(8) << setprecision(1) << right << timer.RealTime() * 1000. <<
" ms] ";
100 logOut <<
"TS " <<
fNofTs;
101 if (
fCbmEvents) logOut <<
", events " << nEvents;
102 logOut <<
", digis " << nDigisUsed <<
" / " << nDigisAll <<
", hits " << nHits;
103 LOG(info) << logOut.str();
109 fTime += timer.RealTime();
117 LOG(debug) << GetName() <<
": Event mode. Event # " <<
event->GetNumber() <<
", digis: " << nofDigis;
118 for (Int_t iDigi = 0; iDigi < nofDigis; iDigi++) {
140 posPoint.SetXYZ(data->
fX, data->
fY, data->
fZ);
150 Int_t nofHits =
fRichHits->GetEntriesFast();
167 std::cout << std::endl;
168 LOG(info) <<
"=====================================";
169 LOG(info) << GetName() <<
": Run summary";
170 LOG(info) <<
"Time slices : " <<
fNofTs;
171 LOG(info) <<
"Digis / TS : " << fixed << setprecision(2) << Double_t(
fNofDigisAll) / Double_t(
fNofTs);
172 LOG(info) <<
"Used digis / TS : " << fixed << setprecision(2) << Double_t(
fNofDigisUsed) / Double_t(
fNofTs);
173 LOG(info) <<
"Time / TS : " << fixed << setprecision(2) << 1000. *
fTime / Double_t(
fNofTs) <<
" ms";
176 LOG(info) <<
"Events / TS : " << fixed << setprecision(2) <<
fNofEvents / (Double_t)
fNofTs;
178 LOG(info) <<
"Digis / Ev : " << fixed << setprecision(2) << Double_t(
fNofDigisAll) / Double_t(
fNofEvents);
179 LOG(info) <<
"Used digis / Ev : " << fixed << setprecision(2) << Double_t(
fNofDigisUsed) / Double_t(
fNofEvents);
180 LOG(info) <<
"Time / Ev : " << fixed << setprecision(2) << 1000. *
fTime / Double_t(
fNofEvents) <<
" ms";
183 LOG(info) <<
"=====================================\n";
ClassImp(CbmConverterManager)
@ kRich
Ring-Imaging Cherenkov Detector.
Class for producing RICH hits directly from MCPoints.
static Int_t GetNofDigis(ECbmModuleId systemId)
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
InitStatus Init()
Initialisation.
const Digi * Get(Int_t index) const
Get a digi object.
static CbmDigiManager * Instance()
Static instance.
Class characterising one event by a collection of links (indices) to data objects,...
void SetRefId(int32_t refId)
void SetTime(double time)
void SetPosition(const TVector3 &pos)
Sets position of the hit.
static CbmRichDigiMapManager & GetInstance()
Return Instance of CbmRichGeoManager.
CbmRichPixelData * GetPixelDataByAddress(Int_t address)
Return CbmRichDataPixel by digi address.
int32_t GetAddress() const
void RotatePoint(TVector3 *inPos, TVector3 *outPos, Bool_t noTilting=false)
static CbmRichGeoManager & GetInstance()
Class for producing RICH hits directly from MCPoints.
CbmRichHitProducer()
Default constructor.
void AddHit(CbmEvent *event, TVector3 &posHit, Double_t time, Int_t index)
Add hit to the output array (and) CbmEvent if it is not NULL.
virtual ~CbmRichHitProducer()
Destructor.
virtual void SetParContainers()
Inherited from FairTask.
CbmDigiManager * fDigiMan
virtual InitStatus Init()
Inherited from FairTask.
void ProcessDigi(CbmEvent *event, Int_t digiIndex)
TClonesArray * fCbmEvents
virtual void Exec(Option_t *option)
Inherited from FairTask.
virtual void Finish()
Inherited from FairTask.
Int_t ProcessData(CbmEvent *event)