Go to the documentation of this file.
12 #include "FairLogger.h"
13 #include "TClonesArray.h"
22 : FairTask(
"CbmRichMCbmHitProducer")
25 , fHitError(0.6 /
sqrt(12.))
28 fMappingFile(
"mRICH_Mapping_vert_20190318_elView.geo") {}
31 FairRootManager* manager = FairRootManager::Instance();
38 FairRootManager* manager = FairRootManager::Instance();
40 fCbmEvents =
dynamic_cast<TClonesArray*
>(manager->GetObject(
"CbmEvent"));
42 LOG(info) <<
": CbmEvent NOT found \n \n \n";
44 LOG(info) <<
": CbmEvent found \n \n \n";
50 Fatal(
"CbmRichMCbmHitProducer::Init",
"No RichDigi array!");
52 fRichHits =
new TClonesArray(
"CbmRichHit");
54 "RichHit",
"RICH",
fRichHits, IsOutputBranchPersistent(
"RichHit"));
65 if (!file.is_open()) {
67 <<
"<CbmRichMCbmHitProducer::InitMapping>: Unable to open mapping file:"
73 while (getline(file, line)) {
75 istringstream iss(line);
76 vector<std::string> results(istream_iterator<string> {iss},
77 std::istream_iterator<string>());
78 if (results.size() != 8)
continue;
81 data.
fTrbId = stoi(results[0],
nullptr, 16);
83 data.
fX = stod(results[6]);
84 data.
fY = stod(results[7]);
102 LOG(info) <<
"CbmRichMCbmHitProducer Event (or TimeSlice) " <<
fEventNum;
110 for (Int_t iUnit = 0; iUnit < nUnits; iUnit++) {
120 LOG(info) <<
"CbmRichMCbmHitProducer CbmEvent mode. CbmEvent # "
121 <<
event->GetNumber();
126 for (Int_t iDigi = 0; iDigi < nofDigis; iDigi++) {
130 LOG(info) <<
"nofDigis: " << nofDigis <<
"\t\t "
143 if (digi ==
nullptr)
return;
151 if (data !=
nullptr) {
152 posPoint.SetXYZ(data->
fX, data->
fY, data->
fZ);
154 LOG(info) <<
"CbmRichMCbmHitProducer: No Node for 0x" << std::hex
156 <<
" found. Using ASCII File! ";
163 posPoint.SetXYZ(dataAscii.
fX, dataAscii.
fY, dataAscii.
fZ);
180 Int_t nofHits =
fRichHits->GetEntriesFast();
216 Double_t
x =
pos.X();
217 Double_t
y =
pos.Y();
227 if (
x >= -6.25 &&
x <= -1.05) {
229 if (
y >= 8 &&
y <= 15.9) { inside =
true; }
230 }
else if (
x > -1.05 &&
x <= 4.25) {
232 if (
y >= 8 &&
y <= 13.2) { inside =
true; }
239 Double_t
x =
pos.X();
240 Double_t
y =
pos.Y();
250 if (
x >= -16.85 &&
x <= 4.25) {
252 if (
y >= -23.8 &&
y <= 23.8) { inside =
true; }
259 Double_t
x =
pos.X();
260 Double_t
y =
pos.Y();
271 if (
y > 13.5)
return false;
272 if (
y > 8.0 &&
x < 12.5)
return false;
CbmRichMCbmHitProducer()
Default constructor.
friend F32vec4 sqrt(const F32vec4 &a)
InitStatus Init()
Initialisation.
std::map< Int_t, CbmRichMCbmMappingData > fRichMapping
virtual void Finish()
Inherited from FairTask.
void SetAddress(Int_t address)
virtual void Exec(Option_t *option)
Inherited from FairTask.
static Int_t GetNofDigis(ECbmModuleId systemId)
virtual InitStatus Init()
Inherited from FairTask.
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
static CbmDigiManager * Instance()
Static instance.
void SetRefId(Int_t refId)
void AddHit(CbmEvent *event, TVector3 &posHit, const CbmRichDigi *digi, Int_t index, Int_t PmtId)
Add hit to the output array (and) CbmEvent if it is not NULL.
void ProcessData(CbmEvent *event)
virtual void SetParContainers()
Inherited from FairTask.
const Digi * Get(Int_t index) const
Get a digi object.
bool RestrictToAcc(TVector3 &pos)
@ kRich
Ring-Imaging Cherenkov Detector.
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
CbmDigiManager * fDigiMan
bool RestrictToAerogelAccDec2019(TVector3 &pos)
bool isInToT(const double ToT)
TClonesArray * fCbmEvents
void SetTime(Double_t time)
virtual ~CbmRichMCbmHitProducer()
Destructor.
void SetPosition(const TVector3 &pos)
Sets position of the hit.
Class characterising one event by a collection of links (indices) to data objects,...
static CbmRichDigiMapManager & GetInstance()
void ProcessDigi(CbmEvent *event, Int_t digiIndex)
void SetToT(Double_t tot)
bool RestrictToFullAcc(TVector3 &pos)
virtual void SetPmtId(Int_t det)
CbmRichPixelData * GetPixelDataByAddress(Int_t address)
bool fRestrictToAerogelAccDec2019