CbmRoot
Loading...
Searching...
No Matches
alignment/CbmRichReconstruction.cxx
Go to the documentation of this file.
1/* Copyright (C) 2012-2020 Justus-Liebig-Universitaet Giessen, Giessen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Semen Lebedev, Jordan Bendarouach [committer] */
4
13
16#include "CbmRichRing.h"
17//#include "prototype/CbmRichProtProjectionProducer.h"
18
28//#include "prototype/CbmRichProtRingFinderHough.h"
29
30#include "CbmGlobalTrack.h"
31#include "CbmRichConverter.h"
39#include "FairHit.h"
40#include "FairRootManager.h"
41#include "TClonesArray.h"
42
43#include <Logger.h>
44
45#include <iostream>
46
47using std::cout;
48using std::endl;
49
51 : FairTask("CbmRichReconstruction")
52 , fRichHits(NULL)
53 , fRichRings(NULL)
54 , fRichProjections(NULL)
55 , fRichTrackParamZ(NULL)
56 , fGlobalTracks(NULL)
57 ,
58
59 fRingFinder(NULL)
60 , fRingFitter(NULL)
61 , fTrackExtrapolation(NULL)
62 , fProjectionProducer(NULL)
63 , fRingTrackAssign(NULL)
64 ,
65
66 fRunExtrapolation(true)
67 , fRunProjection(true)
68 , fRunFinder(true)
69 , fRunFitter(true)
70 , fRunTrackAssign(true)
71 ,
72
73 fExtrapolationName("littrack")
74 , fProjectionName("analytical")
75 , fFinderName("hough")
76 , fFitterName("ellipse_tau")
77 , fTrackAssignName("closest_distance")
78 ,
79
80 fPathToMirrorMisalignmentCorrectionParameterFile("")
81 ,
82
83 fZTrackExtrapolation(260.)
84{
85}
86
88{
89 if (NULL != fRingFinder) delete fRingFinder;
90 if (NULL != fRingFitter) delete fRingFitter;
91 if (NULL != fTrackExtrapolation) delete fTrackExtrapolation;
92 if (NULL != fProjectionProducer) delete fProjectionProducer;
93}
94
96{
97 FairRootManager* ioman = FairRootManager::Instance();
98 if (NULL == ioman) {
99 Fatal("CbmRichReconstruction::Init", "RootManager not instantised!");
100 }
101
103 fRichTrackParamZ = new TClonesArray("FairTrackParam", 100);
104 ioman->Register("RichTrackParamZ", "RICH", fRichTrackParamZ, IsOutputBranchPersistent("RichTrackParamZ"));
105
106 fGlobalTracks = (TClonesArray*) ioman->GetObject("GlobalTrack");
107 if (NULL == fGlobalTracks) {
108 Fatal("CbmRichReconstruction::Init", "No GlobalTrack array!");
109 }
110
111 fRichProjections = new TClonesArray("FairTrackParam");
112 ioman->Register("RichProjection", "RICH", fRichProjections, 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("RichRing", "RICH", fRichRings, IsOutputBranchPersistent("RichRing"));
122
125 if (fRunFinder) InitFinder();
126 if (fRunFitter) InitFitter();
128
129 return kSUCCESS;
130}
131
132void CbmRichReconstruction::Exec(Option_t* /*opt*/)
133{
134 LOG(info) << "CbmRichReconstruction Exec";
137 if (fRunFinder) RunFinder();
138 if (fRunFitter) RunFitter();
140}
141
143{
144 if (fExtrapolationName == "ideal") {
146 }
147 else if (fExtrapolationName == "mirror_ideal") {
149 }
150 else if (fExtrapolationName == "kf" || fExtrapolationName == "KF") {
152 }
153 else if (fExtrapolationName == "lit" || fExtrapolationName == "littrack") {
155 }
156 else {
157 LOG(fatal) << fExtrapolationName << " is not correct name for extrapolation algorithm.";
158 }
160}
161
163{
164 if (fProjectionName == "analytical") {
166 }
167 else if (fProjectionName == "TGeo" || fProjectionName == "tgeo") {
169 }
170 else {
171 LOG(fatal) << fFinderName << " is not correct name for projection producer algorithm.";
172 }
173
176}
177
179{
180 if (fFinderName == "hough") {
182 }
183 else if (fFinderName == "ideal") {
185 }
186 else if (fFinderName == "enn") {
188 }
189 else if ((fFinderName == "enn_parallel")) {
191 }
192 /*
193 else if (fFinderName == "hough_prototype") {
194 fRingFinder = new CbmRichProtRingFinderHough();
195 }*/
196 else {
197 LOG(fatal) << fFinderName << " is not correct name for ring finder algorithm.";
198 }
199
200 fRingFinder->Init();
201}
202
204{
205 if (fFitterName == "circle_cop") {
207 }
208 else if (fFitterName == "circle_simple") {
210 }
211 else if (fFitterName == "circle_tau") {
213 }
214 else if (fFitterName == "circle_robust_cop") {
216 }
217 else if (fFitterName == "ellipse_tau") {
219 }
220 else if (fFitterName == "ellipse_minuit") {
222 }
223 else {
224 LOG(fatal) << fFitterName << " is not correct name for ring fitter algorithm.";
225 }
227}
228
230{
231 if (fTrackAssignName == "closest_distance") {
233 }
234 else {
235 LOG(fatal) << fTrackAssignName << " is not correct name for ring-track assignment algorithm.";
236 }
238}
239
241{
242 if (fRichTrackParamZ == NULL) LOG(info) << "fRichTrackParamZ == NULL";
243 fRichTrackParamZ->Delete();
245}
246
248
254
256{
257 int nofRings = fRichRings->GetEntriesFast();
258 for (int iRing = 0; iRing < nofRings; iRing++) {
259 CbmRichRing* ring = (CbmRichRing*) fRichRings->At(iRing);
260 if (NULL == ring) continue;
261 CbmRichRingLight ringL;
262
264 fRingFitter->DoFit(&ringL);
266 }
267}
268
270
272
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 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.
This is interface for concrete extrapolation algorithms to RICH.
This is the implementation of the TrackExtrapolation from MC points. It reads the STS track array,...
"TrackExtrapolation" from STS tracks (Kalman Fitter) It reads the track array form STS and extrapolat...
"TrackExtrapolation" from STS tracks based on Littrack. It reads the track array form STS and extrapo...
This is the implementation of the TrackExtrapolation from MC points - operating on points in the RICH...
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.
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.
Project track by straight line from imaginary plane to the mirror and reflect it to the photodetector...
virtual void SetMirrorCorrectionParameterFile(const string &s)
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.
virtual InitStatus Init()
Inherited from FairTask.
CbmRichRingTrackAssignBase * fRingTrackAssign
CbmRichTrackExtrapolationBase * fTrackExtrapolation
virtual void Exec(Option_t *opt)
Inherited from FairTask.
virtual void Finish()
Inherited from FairTask.
CbmRichProjectionProducerBase * fProjectionProducer
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 Init()
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.
virtual void Init()
Initialization in case one needs to initialize some TClonearrays.
virtual void DoExtrapolation(CbmEvent *event, 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...
"TrackExtrapolation" from MC points. It reads the PointArray with ImPlanePoints from MC and selects t...
"TrackExtrapolation" from STS tracks (Kalman Fitter) It reads the track array form STS and extrapolat...
"TrackExtrapolation" from STS tracks based on Littrack. It reads the track array form STS and extrapo...
This is the implementation of the TrackExtrapolation from MC points - operating on points in the RICH...