14#include "CbmRichProjectionProducerAnalytical.h"
42#include "FairRootManager.h"
43#include "TClonesArray.h"
44#include "TStopwatch.h"
53using std::setprecision;
69 FairRootManager* manager = FairRootManager::Instance();
70 if (
nullptr == manager) LOG(fatal) <<
"CbmRichReconstruction::Init(): FairRootManager is nullptr.";
72 fCbmEvents =
dynamic_cast<TClonesArray*
>(manager->GetObject(
"CbmEvent"));
74 LOG(info) << GetName() <<
"::Init() CbmEvent NOT found \n";
77 LOG(info) << GetName() <<
"::Init() CbmEvent found";
82 manager->Register(
"RichTrackParamZ",
"RICH",
fRichTrackParamZ, IsOutputBranchPersistent(
"RichTrackParamZ"));
84 fGlobalTracks =
static_cast<TClonesArray*
>(manager->GetObject(
"GlobalTrack"));
85 if (
fGlobalTracks ==
nullptr) LOG(fatal) <<
"CbmRichReconstruction::Init(): No GlobalTrack array.";
89 if (!
fRunExtrapolation) LOG(fatal) <<
"CbmRichReconstruction::Init(): fRunExtrapolation must be true.";
91 manager->Register(
"RichProjection",
"RICH",
fRichProjections, IsOutputBranchPersistent(
"RichProjection"));
94 fRichHits =
static_cast<TClonesArray*
>(manager->GetObject(
"RichHit"));
95 if (
fRichHits ==
nullptr) LOG(fatal) <<
"CbmRichReconstruction::Init(): No RichHit array.";
97 fRichRings =
new TClonesArray(
"CbmRichRing", 100);
98 manager->Register(
"RichRing",
"RICH",
fRichRings, IsOutputBranchPersistent(
"RichRing"));
102 double offset = 205.7331;
107 <<
" The value of fZTrackExtrapolation is not correct. It must be in the range [200, 300] cm."
108 <<
" Probably the RICH geometry is not correct or it is not supported.";
126 Int_t nGlobalTracks{0};
140 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
149 std::stringstream logOut;
150 logOut << setw(20) << left << GetName() <<
"[";
151 logOut << fixed << setw(8) << setprecision(1) << right << timer.RealTime() * 1000. <<
" ms] ";
152 logOut <<
"TS " <<
fNofTs;
153 if (
fCbmEvents) logOut <<
", events " << nEvents;
154 logOut <<
", hits " <<
fRichHits->GetEntriesFast();
155 logOut <<
", rings " <<
fRichRings->GetEntriesFast();
156 if (
fRichProjections) logOut <<
", trackProj " << nTrackProj <<
" / " << nGlobalTracks;
157 LOG(info) << logOut.str();
217 LOG(fatal) <<
fExtrapolationName <<
" is not correct name for extrapolation algorithm.";
231 LOG(fatal) <<
fFinderName <<
" is not correct name for projection producer algorithm.";
257 LOG(fatal) <<
fFinderName <<
" is not correct name for ring finder algorithm.";
284 LOG(fatal) <<
fFitterName <<
" is not correct name for ring fitter algorithm.";
295 LOG(fatal) <<
fTrackAssignName <<
" is not correct name for ring-track assignment algorithm.";
302 if (
fRichTrackParamZ ==
nullptr) LOG(info) <<
"fRichTrackParamZ == nullptr";
319 if (nofRings <= 0)
return;
320 for (Int_t iR0 = 0; iR0 < nofRings; iR0++) {
323 if (
nullptr == ring)
continue;
339 std::cout << std::endl;
340 LOG(info) <<
"=====================================";
341 LOG(info) << GetName() <<
": Run summary";
342 LOG(info) <<
"Time slices : " <<
fNofTs;
343 LOG(info) <<
"Hits / TS : " << fixed << setprecision(2) <<
fTotalNofHits / Double_t(
fNofTs);
347 LOG(info) <<
"Time / TS : " << fixed << setprecision(2) << 1000. *
fCalcTime[0] / Double_t(
fNofTs) <<
" ms";
350 LOG(info) <<
"Events / TS : " << fixed << setprecision(2) <<
fNofEvents / Double_t(
fNofTs);
356 LOG(info) <<
"Time / ev : " << fixed << setprecision(2) << 1000. *
fCalcTime[0] / Double_t(
fNofEvents)
361 LOG(info) <<
"TrackProj / GTr : " << fixed << setprecision(2)
366 LOG(info) <<
"===== Time by task (real time) ======";
368 LOG(info) <<
"TrackExtrapolation / " << eventOrTsStr << fixed << setprecision(2) << setw(9) << right
369 << 1000. *
fCalcTime[1] / eventOrTsValue <<
" ms [" << setw(5) << right
372 LOG(info) <<
"TrackProjection / " << eventOrTsStr << fixed << setprecision(2) << setw(9) << right
373 << 1000. *
fCalcTime[2] / eventOrTsValue <<
" ms [" << setw(5) << right
376 LOG(info) <<
"RingFinder / " << eventOrTsStr << fixed << setprecision(2) << setw(9) << right
377 << 1000. *
fCalcTime[3] / eventOrTsValue <<
" ms [" << setw(5) << right
380 LOG(info) <<
"RingFitter / " << eventOrTsStr << fixed << setprecision(2) << setw(9) << right
381 << 1000. *
fCalcTime[4] / eventOrTsValue <<
" ms [" << setw(5) << right
384 LOG(info) <<
"RingTrackAssign / " << eventOrTsStr << fixed << setprecision(2) << setw(9) << right
385 << 1000. *
fCalcTime[5] / eventOrTsValue <<
" ms [" << setw(5) << right
388 LOG(info) <<
"=====================================\n";
ClassImp(CbmConverterManager)
Convert internal data classes to cbmroot common data classes.
Project track by straight line from imaginary plane to the mirror and reflect it to the photodetector...
Main class for running event reconstruction in the RICH detector.
Main class for ring finder based on Hough Transform implementation.
Ideal ring finder in the RICH detector. It uses MC information to attach RICH hits to rings.
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
Implementation of a ring fitting algorithm with equation of a circle. Algorithm from F77 subroutine o...
This is the implementation of ellipse fitting using MINUIT.
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
Here the ring is fitted with the RobustCOP algorithm from A. Ayriyan/G. Ososkov.
Here the ring is fitted with the TAU algorithm from A. Ayriyan/ G. Ososkov.
Ring-Track Assignment according to the closest distance criterion.
Class characterising one event by a collection of links (indices) to data objects,...
static void CopyParamsToRing(const CbmRichRingLight *ring1, CbmRichRing *ring2)
Copy parameters from CbmRichRingLight to CbmRichRing.
static void Init()
Initialize array of RICH hits.
static void CopyHitsToRingLight(const CbmRichRing *ring1, CbmRichRingLight *ring2)
Copy hits from CbmRichRing to CbmRichRingLight.
static CbmRichGeoManager & GetInstance()
Project track by straight line from imaginary plane to the mirror and reflect it to the photodetector...
int GetSuccessfullProj() const
virtual void Init()
Initialization in case one needs to initialize some TCloneArrays.
virtual void DoProjection(TClonesArray *richProj)=0
Project track by straight line from imaginary plane to the mirror and reflect it to the photodetector...
Main class for running event reconstruction in the RICH detector.
std::array< Double_t, 6 > fCalcTime
virtual InitStatus Init()
Inherited from FairTask.
TClonesArray * fRichTrackParamZ
CbmRichRingTrackAssignBase * fRingTrackAssign
CbmRichRingFitterBase * fRingFitter
CbmRichRingFinder * fRingFinder
CbmRichTrackExtrapolationBase * fTrackExtrapolation
TClonesArray * fRichRings
string fExtrapolationName
CbmRichReconstruction()
Default constructor.
TClonesArray * fCbmEvents
Double_t fZTrackExtrapolation
TClonesArray * fGlobalTracks
TClonesArray * fRichProjections
void ProcessData(CbmEvent *event)
virtual void Exec(Option_t *opt)
Inherited from FairTask.
virtual void Finish()
Inherited from FairTask.
CbmRichProjectionProducerBase * fProjectionProducer
Int_t fTotalNofGlobalTracks
virtual ~CbmRichReconstruction()
Destructor.
Main class for ring finder based on Hough Transform implementation.
virtual Int_t DoFind(CbmEvent *event, TClonesArray *rHitArray, TClonesArray *rProjArray, TClonesArray *rRingArray)=0
virtual void DoFit(CbmRichRingLight *ring)=0
Abstract method DoFit. To be implemented in the concrete class. Perform a fit to the hits attached to...
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
Implementation of a ring fitting algorithm with equation of a circle. Algorithm from F77 subroutine o...
This is the implementation of ellipse fitting using MINUIT.
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
Here the ring is fitted with the RobustCOP algorithm from A. Ayriyan/G. Ososkov.
Here the ring is fitted with the TAU algorithm from A. Ayriyan/ G. Ososkov.
virtual void Init()
Initialization in case one needs to initialize some TCloneArrays.
virtual void DoAssign(CbmEvent *event, TClonesArray *rings, TClonesArray *richProj)=0
Ring-Track Assignment according to the closest distance criterion.