Go to the documentation of this file.
24 #include "FairLogger.h"
25 #include "FairRootManager.h"
27 #include "TClonesArray.h"
46 FairRootManager* ioman = FairRootManager::Instance();
48 Fatal(
"CbmRichRingFinderIdeal::Init",
"RootManager is NULL!");
53 if (mcManager ==
nullptr)
54 LOG(fatal) <<
"CbmRichRingFinderIdeal::Init() NULL MCDataManager.";
59 Fatal(
"CbmRichHitProducer::Init",
"No RichDigi array!");
62 Fatal(
"CbmRichHitProducer::Init",
"No RichMatchDigi array!");
67 LOG(fatal) <<
"CbmRichRingFinderIdeal::Init No MCTrack!";
72 LOG(fatal) <<
"CbmRichRingFinderIdeal::Init No RichPoint!";
77 LOG(fatal) <<
"CbmRichRingFinderIdeal::Init No MCEventList!";
83 TClonesArray* ringArray) {
84 if (NULL == hitArray) {
85 cout <<
"-E- CbmRichRingFinderIdeal::DoFind, RichHit array missing!"
90 if (NULL == ringArray) {
91 cout <<
"-E- CbmRichRingFinderIdeal::DoFind, Ring array missing!" << endl;
96 map<pair<Int_t, Int_t>, Int_t> hitMap;
97 Int_t nofRichHits = hitArray->GetEntriesFast();
98 for (Int_t iHit = 0; iHit < nofRichHits; iHit++) {
100 if (NULL == richHit)
continue;
102 vector<pair<Int_t, Int_t>> motherIds =
105 for (UInt_t
i = 0;
i < motherIds.size();
i++) {
106 hitMap[motherIds[
i]]++;
111 map<pair<Int_t, Int_t>, Int_t> ringMap;
114 for (Int_t iE = 0; iE < nofEvents; iE++) {
120 for (Int_t iT = 0; iT < nofMcTracks; iT++) {
123 if (NULL == mcTrack)
continue;
124 pair<Int_t, Int_t> val = std::make_pair(eventId, iT);
125 if (hitMap[val] <= 0)
continue;
127 ringMap[val] = nofRings++;
132 for (Int_t iHit = 0; iHit < nofRichHits; iHit++) {
134 if (NULL == richHit)
continue;
137 vector<pair<Int_t, Int_t>> motherIds =
141 for (UInt_t
i = 0;
i < motherIds.size();
i++) {
142 if (ringMap.find(motherIds[
i]) == ringMap.end())
continue;
143 Int_t ringIndex = ringMap[motherIds[
i]];
145 if (NULL == ring)
continue;
151 LOG(info) <<
"-I- CbmRichRingFinderIdeal nofRings:" << nofRings;
158 if (richHit == NULL)
return -1;
159 Int_t digiIndex = richHit->
GetRefId();
160 if (digiIndex < 0)
return -1;
163 if (NULL == digiMatch)
return -1;
const CbmLink & GetMatchedLink() const
CbmMCDataObject * GetObject(const char *name)
CbmDigiManager * fDigiMan
Int_t GetFileIdByIndex(UInt_t index)
File number by index @value File number for event at given index in list.
CbmMCDataArray * fMcTracks
Int_t GetEventIdForRichHit(const CbmRichHit *richHit)
CbmRichRingFinderIdeal()
Default constructor.
Int_t Size(Int_t fileNumber, Int_t eventNumber)
InitStatus Init()
Initialisation.
virtual int DoFind(TClonesArray *hitArray, TClonesArray *projArray, TClonesArray *ringArray)
CbmMCDataArray * InitBranch(const char *name)
FairTask for matching RECO data to MC.
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
static CbmDigiManager * Instance()
Static instance.
static Bool_t IsMatchPresent(ECbmModuleId systemId)
Presence of a digi match branch.
virtual void Init()
Inherited from CbmRichRingFinder.
std::size_t GetNofEvents() const
Number of events in the list @value Number of events.
virtual ~CbmRichRingFinderIdeal()
Destructor.
TObject * Get(const CbmLink *lnk)
static std::vector< std::pair< Int_t, Int_t > > GetMcTrackMotherIdsForRichHit(CbmDigiManager *digiMan, const CbmRichHit *hit, CbmMCDataArray *richPoints, CbmMCDataArray *mcTracks, Int_t eventNumber)
Return McTrack Ids for RICH hit C++11 efficient way to return vector.
const CbmMatch * GetMatch(ECbmModuleId systemId, UInt_t index) const
Get a match object.
CbmMCDataArray * fRichPoints
@ kRich
Ring-Imaging Cherenkov Detector.
Container class for MC events with number, file and start time.
CbmDigiManager * fDigiMan
Task class creating and managing CbmMCDataArray objects.
Int_t GetEventIdByIndex(UInt_t index)
Event number by index @value Event number for event at given index in list.
Ideal ring finder in the RICH detector. It uses MC information to attach RICH hits to rings.
CbmMCEventList * fEventList