CbmRoot
CbmRichReconstruction.cxx
Go to the documentation of this file.
1 
9 #include "CbmRichRing.h"
10 
11 #include "CbmRichProjectionProducerAnalytical.h"
13 //#include "prototype/CbmRichProtProjectionProducer.h"
14 
20 
21 #include "CbmL1RichENNRingFinder.h"
22 #include "CbmRichRingFinderHough.h"
23 #include "CbmRichRingFinderIdeal.h"
24 //#include "CbmL1RichENNRingFinderParallel.h"
25 //#include "prototype/CbmRichProtRingFinderHough.h"
26 
27 #include "CbmRichRingFitterCOP.h"
32 #include "CbmRichRingFitterTAU.h"
33 
35 
36 #include "CbmGlobalTrack.h"
37 #include "CbmRichConverter.h"
38 #include "FairHit.h"
39 #include "FairLogger.h"
40 #include "FairRootManager.h"
41 #include "TClonesArray.h"
42 
43 #include <iostream>
44 
45 using std::cout;
46 using std::endl;
47 
49  : FairTask("CbmRichReconstruction")
50  , fRichHits(NULL)
51  , fRichRings(NULL)
52  , fRichProjections(NULL)
53  , fRichTrackParamZ(NULL)
54  , fGlobalTracks(NULL)
55  ,
56 
57  fRingFinder(NULL)
58  , fRingFitter(NULL)
59  , fTrackExtrapolation(NULL)
60  , fProjectionProducer(NULL)
61  , fRingTrackAssign(NULL)
62  ,
63 
64  fRunExtrapolation(true)
65  , fRunProjection(true)
66  , fRunFinder(true)
67  , fRunFitter(true)
68  , fRunTrackAssign(true)
69  ,
70 
71  fUseHTAnnSelect(true)
72  ,
73 
74  fExtrapolationName("littrack")
75  , fProjectionName("analytical")
76  , fFinderName("hough")
77  , fFitterName("ellipse_tau")
78  , fTrackAssignName("closest_distance")
79  ,
80 
81  fZTrackExtrapolation(260.) {}
82 
84  if (NULL != fRingFinder) delete fRingFinder;
85  if (NULL != fRingFitter) delete fRingFitter;
86  if (NULL != fTrackExtrapolation) delete fTrackExtrapolation;
87  if (NULL != fProjectionProducer) delete fProjectionProducer;
88 }
89 
90 InitStatus CbmRichReconstruction::Init() {
91  FairRootManager* ioman = FairRootManager::Instance();
92  if (NULL == ioman) {
93  Fatal("CbmRichReconstruction::Init", "RootManager not instantised!");
94  }
95 
97  fRichTrackParamZ = new TClonesArray("FairTrackParam", 100);
98  ioman->Register("RichTrackParamZ",
99  "RICH",
101  IsOutputBranchPersistent("RichTrackParamZ"));
102 
103  fGlobalTracks = (TClonesArray*) ioman->GetObject("GlobalTrack");
104  if (NULL == fGlobalTracks) {
105  Fatal("CbmRichReconstruction::Init", "No GlobalTrack array!");
106  }
107 
108  fRichProjections = new TClonesArray("FairTrackParam");
109  ioman->Register("RichProjection",
110  "RICH",
112  IsOutputBranchPersistent("RichProjection"));
113  }
114 
115  fRichHits = (TClonesArray*) ioman->GetObject("RichHit");
116  if (NULL == fRichHits) {
117  Fatal("CbmRichReconstruction::Init", "No RichHit array!");
118  }
119 
120  fRichRings = new TClonesArray("CbmRichRing", 100);
121  ioman->Register(
122  "RichRing", "RICH", fRichRings, IsOutputBranchPersistent("RichRing"));
123 
126  if (fRunFinder) InitFinder();
127  if (fRunFitter) InitFitter();
129 
130  return kSUCCESS;
131 }
132 
133 void CbmRichReconstruction::Exec(Option_t* /*opt*/) {
134  LOG(info) << "CbmRichReconstruction Exec";
137  if (fRunFinder) RunFinder();
138  if (fRunFitter) RunFitter();
140 }
141 
143  if (fExtrapolationName == "ideal") {
145  } else if (fExtrapolationName == "mirror_ideal") {
147  } else if (fExtrapolationName == "kf" || fExtrapolationName == "KF") {
149  } else if (fExtrapolationName == "lit" || fExtrapolationName == "littrack") {
151  } else {
152  LOG(fatal) << fExtrapolationName
153  << " is not correct name for extrapolation algorithm.";
154  }
156 }
157 
159  if (fProjectionName == "analytical") {
161  } else if (fProjectionName == "TGeo" || fProjectionName == "tgeo") {
163  } else {
164  LOG(fatal) << fFinderName
165  << " is not correct name for projection producer algorithm.";
166  }
168 }
169 
171  if (fFinderName == "hough") {
173  static_cast<CbmRichRingFinderHough*>(fRingFinder)
174  ->SetUseAnnSelect(fUseHTAnnSelect);
175  } else if (fFinderName == "ideal") {
177  } else if (fFinderName == "enn") {
179  } else if ((fFinderName == "enn_parallel")) {
180  // fRingFinder = new CbmL1RichENNRingFinderParallel(0);
181  // } else if (fFinderName == "hough_prototype") {
182  // fRingFinder = new CbmRichProtRingFinderHough();
183  } else {
184  LOG(fatal) << fFinderName
185  << " is not correct name for ring finder algorithm.";
186  }
187 
188  fRingFinder->Init();
189 }
190 
192  if (fFitterName == "circle_cop") {
194  } else if (fFitterName == "circle_simple") {
196  } else if (fFitterName == "circle_tau") {
198  } else if (fFitterName == "circle_robust_cop") {
200  } else if (fFitterName == "ellipse_tau") {
202  } else if (fFitterName == "ellipse_minuit") {
204  } else {
205  LOG(fatal) << fFitterName
206  << " is not correct name for ring fitter algorithm.";
207  }
209 }
210 
212  if (fTrackAssignName == "closest_distance") {
214  } else {
215  LOG(fatal) << fTrackAssignName
216  << " is not correct name for ring-track assignment algorithm.";
217  }
219 }
220 
222  if (fRichTrackParamZ == NULL) LOG(info) << "fRichTrackParamZ == NULL";
223  fRichTrackParamZ->Delete();
226 }
227 
230 }
231 
233  fRichRings->Delete();
235 }
236 
238  int nofRings = fRichRings->GetEntriesFast();
239  for (int iRing = 0; iRing < nofRings; iRing++) {
240  CbmRichRing* ring = (CbmRichRing*) fRichRings->At(iRing);
241  if (NULL == ring) continue;
242  CbmRichRingLight ringL;
243 
245  fRingFitter->DoFit(&ringL);
247  }
248 }
249 
252 }
253 
255 
CbmRichProjectionProducerBase::DoProjection
virtual void DoProjection(TClonesArray *richProj)=0
CbmRichTrackExtrapolationIdeal.h
This is the implementation of the TrackExtrapolation from MC points. It reads the STS track array,...
CbmRichRingFinder::DoFind
virtual Int_t DoFind(TClonesArray *rHitArray, TClonesArray *rProjArray, TClonesArray *rRingArray)=0
CbmRichProjectionProducerBase::Init
virtual void Init()
Initialization in case one needs to initialize some TCloneArrays.
Definition: alignment/CbmRichProjectionProducerBase.h:45
CbmRichReconstruction::fRichProjections
TClonesArray * fRichProjections
Definition: alignment/CbmRichReconstruction.h:87
CbmRichReconstruction
Main class for running event reconstruction in the RICH detector.
Definition: alignment/CbmRichReconstruction.h:34
CbmRichReconstruction::RunFinder
void RunFinder()
Definition: alignment/CbmRichReconstruction.cxx:233
CbmRichRingFitterEllipseTau
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
Definition: CbmRichRingFitterEllipseTau.h:35
CbmRichReconstruction::fRingFitter
CbmRichRingFitterBase * fRingFitter
Definition: alignment/CbmRichReconstruction.h:92
CbmRichTrackExtrapolationLittrack
"TrackExtrapolation" from STS tracks based on Littrack. It reads the track array form STS and extrapo...
Definition: CbmRichTrackExtrapolationLittrack.h:33
CbmRichRingFitterEllipseTau.h
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
CbmRichRingFinder::Init
virtual void Init()
Definition: CbmRichRingFinder.h:46
CbmRichReconstruction::fRunExtrapolation
bool fRunExtrapolation
Definition: alignment/CbmRichReconstruction.h:101
CbmRichReconstruction::fProjectionProducer
CbmRichProjectionProducerBase * fProjectionProducer
Definition: alignment/CbmRichReconstruction.h:96
CbmRichReconstruction::fUseHTAnnSelect
bool fUseHTAnnSelect
Definition: CbmRichReconstruction.h:112
CbmL1RichENNRingFinder
Definition: CbmL1RichENNRingFinder.h:31
CbmRichReconstruction::fRingTrackAssign
CbmRichRingTrackAssignBase * fRingTrackAssign
Definition: alignment/CbmRichReconstruction.h:98
CbmRichProjectionProducerAnalytical
Project track by straight line from imaginary plane to the mirror and reflect it to the photodetector...
Definition: alignment/CbmRichProjectionProducerAnalytical.h:35
CbmRichReconstruction::~CbmRichReconstruction
virtual ~CbmRichReconstruction()
Destructor.
Definition: alignment/CbmRichReconstruction.cxx:83
CbmRichReconstruction::fFitterName
string fFitterName
Definition: alignment/CbmRichReconstruction.h:111
CbmRichReconstruction::Finish
virtual void Finish()
Inherited from FairTask.
Definition: alignment/CbmRichReconstruction.cxx:255
CbmGlobalTrack.h
CbmRichReconstruction::CbmRichReconstruction
CbmRichReconstruction()
Default constructor.
Definition: alignment/CbmRichReconstruction.cxx:48
CbmRichConverter::CopyParamsToRing
static void CopyParamsToRing(const CbmRichRingLight *ring1, CbmRichRing *ring2)
Copy parameters from CbmRichRingLight to CbmRichRing.
Definition: CbmRichConverter.h:76
CbmRichRing
Definition: CbmRichRing.h:17
CbmRichRing.h
CbmRichRingFitterCircle
Implementation of a ring fitting algorithm with equation of a circle. Algorithm from F77 subroutine o...
Definition: CbmRichRingFitterCircle.h:25
CbmRichTrackExtrapolationMirrorIdeal
This is the implementation of the TrackExtrapolation from MC points - operating on points in the RICH...
Definition: CbmRichTrackExtrapolationMirrorIdeal.h:36
CbmRichReconstruction::fProjectionName
string fProjectionName
Definition: alignment/CbmRichReconstruction.h:109
CbmRichReconstruction::fZTrackExtrapolation
Double_t fZTrackExtrapolation
Definition: alignment/CbmRichReconstruction.h:117
CbmRichReconstruction::fRunTrackAssign
bool fRunTrackAssign
Definition: alignment/CbmRichReconstruction.h:105
CbmRichRingFitterBase::DoFit
virtual void DoFit(CbmRichRingLight *ring)=0
Abstract method DoFit. To be implemented in the concrete class. Perform a fit to the hits attached to...
CbmRichReconstruction::InitTrackAssign
void InitTrackAssign()
Definition: alignment/CbmRichReconstruction.cxx:212
CbmRichReconstruction::Init
virtual InitStatus Init()
Inherited from FairTask.
Definition: alignment/CbmRichReconstruction.cxx:90
CbmRichRingFitterCOP
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
Definition: CbmRichRingFitterCOP.h:28
CbmRichRingFinderHough
Main class for ring finder based on Hough Transform implementation.
Definition: CbmRichRingFinderHough.h:34
CbmRichTrackExtrapolationIdeal
"TrackExtrapolation" from MC points. It reads the PointArray with ImPlanePoints from MC and selects t...
Definition: CbmRichTrackExtrapolationIdeal.h:28
CbmRichReconstruction::fRunFitter
bool fRunFitter
Definition: alignment/CbmRichReconstruction.h:104
CbmRichRingFitterEllipseMinuit.h
This is the implementation of ellipse fitting using MINUIT.
CbmRichReconstruction::InitExtrapolation
void InitExtrapolation()
Definition: alignment/CbmRichReconstruction.cxx:142
CbmRichRingTrackAssignClosestD.h
Ring-Track Assignment according to the closest distance criterion.
CbmRichReconstruction::InitFitter
void InitFitter()
Definition: alignment/CbmRichReconstruction.cxx:192
CbmRichReconstruction::fRunProjection
bool fRunProjection
Definition: alignment/CbmRichReconstruction.h:102
CbmRichReconstruction::RunTrackAssign
void RunTrackAssign()
Definition: alignment/CbmRichReconstruction.cxx:251
CbmRichRingFinderHough.h
Main class for ring finder based on Hough Transform implementation.
CbmRichTrackExtrapolationBase::DoExtrapolation
virtual void DoExtrapolation(TClonesArray *globalTracks, TClonesArray *extrapolatedTrackParams, double z)=0
Read the global track array, extrapolate track to a given z-Plane in RICH detector and fill output ar...
CbmRichReconstruction::fFinderName
string fFinderName
Definition: alignment/CbmRichReconstruction.h:110
CbmRichRingFitterRobustCOP.h
Here the ring is fitted with the RobustCOP algorithm from A. Ayriyan/G. Ososkov.
CbmRichTrackExtrapolationKF.h
"TrackExtrapolation" from STS tracks (Kalman Fitter) It reads the track array form STS and extrapolat...
CbmRichConverter.h
Convert internal data classes to cbmroot common data classes.
CbmRichReconstruction::RunFitter
void RunFitter()
Definition: alignment/CbmRichReconstruction.cxx:238
CbmRichReconstruction::Exec
virtual void Exec(Option_t *opt)
Inherited from FairTask.
Definition: alignment/CbmRichReconstruction.cxx:133
CbmRichReconstruction::fExtrapolationName
string fExtrapolationName
Definition: alignment/CbmRichReconstruction.h:108
CbmRichTrackExtrapolationMirrorIdeal.h
This is the implementation of the TrackExtrapolation from MC points - operating on points in the RICH...
CbmRichReconstruction::RunProjection
void RunProjection()
Definition: alignment/CbmRichReconstruction.cxx:229
CbmRichReconstruction.h
Main class for running event reconstruction in the RICH detector.
CbmRichReconstruction::fTrackAssignName
string fTrackAssignName
Definition: alignment/CbmRichReconstruction.h:112
CbmRichRingFitterCircle.h
Implementation of a ring fitting algorithm with equation of a circle. Algorithm from F77 subroutine o...
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmRichTrackExtrapolationKF
"TrackExtrapolation" from STS tracks (Kalman Fitter) It reads the track array form STS and extrapolat...
Definition: CbmRichTrackExtrapolationKF.h:29
CbmL1RichENNRingFinder.h
CbmRichRingFitterCOP.h
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
CbmRichProjectionProducerTGeo
Project track by straight line from imaginary plane to the mirror and reflect it to the photodetector...
Definition: CbmRichProjectionProducerTGeo.h:34
CbmRichRingTrackAssignBase::DoAssign
virtual void DoAssign(TClonesArray *rings, TClonesArray *richProj)=0
CbmRichRingFinderIdeal
Definition: CbmRichRingFinderIdeal.h:24
CbmRichConverter::Init
static void Init()
Initialize array of RICH hits.
Definition: CbmRichConverter.h:93
CbmRichReconstruction::InitProjection
void InitProjection()
Definition: alignment/CbmRichReconstruction.cxx:158
CbmRichReconstruction::InitFinder
void InitFinder()
Definition: alignment/CbmRichReconstruction.cxx:173
CbmRichTrackExtrapolationBase.h
This is interface for concrete extrapolation algorithms to RICH.
CbmRichTrackExtrapolationBase::Init
virtual void Init()
Initialization in case one needs to initialize some TClonearrays.
Definition: CbmRichTrackExtrapolationBase.h:30
CbmRichReconstruction::RunExtrapolation
void RunExtrapolation()
Definition: alignment/CbmRichReconstruction.cxx:222
CbmRichRingFitterEllipseMinuit
This is the implementation of ellipse fitting using MINUIT.
Definition: CbmRichRingFitterEllipseMinuit.h:62
CbmRichRingTrackAssignClosestD
Ring-Track Assignment according to the closest distance criterion.
Definition: CbmRichRingTrackAssignClosestD.h:31
CbmRichRingTrackAssignBase::Init
virtual void Init()
Initialization in case one needs to initialize some TCloneArrays.
Definition: CbmRichRingTrackAssignBase.h:38
CbmRichRingFinderIdeal.h
Ideal ring finder in the RICH detector. It uses MC information to attach RICH hits to rings.
CbmRichReconstruction::fRichHits
TClonesArray * fRichHits
Definition: alignment/CbmRichReconstruction.h:85
CbmRichReconstruction::fRichRings
TClonesArray * fRichRings
Definition: alignment/CbmRichReconstruction.h:86
CbmRichConverter::CopyHitsToRingLight
static void CopyHitsToRingLight(const CbmRichRing *ring1, CbmRichRingLight *ring2)
Copy hits from CbmRichRing to CbmRichRingLight.
Definition: CbmRichConverter.h:41
CbmRichRingFitterRobustCOP
Here the ring is fitted with the RobustCOP algorithm from A. Ayriyan/G. Ososkov.
Definition: CbmRichRingFitterRobustCOP.h:22
CbmRichProjectionProducerTGeo.h
Project track by straight line from imaginary plane to the mirror and reflect it to the photodetector...
CbmRichTrackExtrapolationLittrack.h
"TrackExtrapolation" from STS tracks based on Littrack. It reads the track array form STS and extrapo...
CbmRichReconstruction::fTrackExtrapolation
CbmRichTrackExtrapolationBase * fTrackExtrapolation
Definition: alignment/CbmRichReconstruction.h:94
CbmRichReconstruction::fRichTrackParamZ
TClonesArray * fRichTrackParamZ
Definition: alignment/CbmRichReconstruction.h:88
CbmRichRingLight
Definition: CbmRichRingLight.h:39
CbmRichRingFitterTAU
Here the ring is fitted with the TAU algorithm from A. Ayriyan/ G. Ososkov.
Definition: CbmRichRingFitterTAU.h:24
CbmRichReconstruction::fGlobalTracks
TClonesArray * fGlobalTracks
Definition: alignment/CbmRichReconstruction.h:89
CbmRichReconstruction::fRunFinder
bool fRunFinder
Definition: alignment/CbmRichReconstruction.h:103
CbmRichRingFitterTAU.h
Here the ring is fitted with the TAU algorithm from A. Ayriyan/ G. Ososkov.
CbmRichReconstruction::fRingFinder
CbmRichRingFinder * fRingFinder
Definition: alignment/CbmRichReconstruction.h:91