CbmRoot
CbmRichPMTMapping.h
Go to the documentation of this file.
1 #ifndef CBMRICHPMTMAPPING_H
2 #define CBMRICHPMTMAPPING_H
3 
4 
5 #include "CbmHistManager.h"
6 #include "CbmRichPoint.h"
7 #include "CbmRichRecGeoPar.h"
8 #include "CbmRichRing.h"
9 #include "CbmRichRingFitterCOP.h"
11 #include "CbmRichRingLight.h"
12 #include "FairTask.h"
13 #include "TString.h"
14 #include <map>
15 #include <vector>
16 
17 using namespace std;
18 
19 class TClonesArray;
20 class TH1D;
21 class TH2D;
22 
23 
24 class CbmRichPMTMapping : public FairTask {
25 private:
26  static const int kMAX_NOF_HITS = 100; // Maximum number of hits in ring
27 
28 public:
29  /*
30  * Constructor.
31  */
33 
34  /*
35  * Destructor.
36  */
37  virtual ~CbmRichPMTMapping();
38 
42  virtual InitStatus Init();
43 
47  virtual void Exec(Option_t* option);
48 
52  virtual void Finish();
53 
54  /*
55  * Histogram initialization.
56  */
57  void InitHist();
58 
59  /*
60  * Fill the PMT plane with hits, ONLY for event with SEVERAL particles.
61  */
62  void MatchFinder();
63 
64  /*
65  *
66  */
67  void FillPMTMap(const Char_t* mirr_path, CbmRichPoint* pPoint);
68 
69  /*
70  *
71  */
72  void
73  FillPMTMapEllipse(const Char_t* mirr_path, Float_t CenterX, Float_t CenterY);
74 
75  /*
76  * From incoming track on the mirrors, do reflection of its trajectory and extrapolation of its intersection on the PMT plane.
77  */
78  void ProjectionProducer();
79 
80  void ProjectionProducer2();
81 
82  /*
83  * Giving as inputs empty sphere center coordinates, empty radius and mirror ID, returns sphere center coordinates and inner radius calculated from
84  * translation matrices of volumes containing the mirror.
85  */
86  void CalculateSphereParameters(const Char_t* mirrID,
87  Double_t& sphereX,
88  Double_t& sphereY,
89  Double_t& sphereZ,
90  Double_t& sphereR);
91 
92  void CalculateSphereParameters2(const Char_t* mirrID,
93  Double_t& sphereX,
94  Double_t& sphereY,
95  Double_t& sphereZ,
96  Double_t& sphereR);
97 
98  /*
99  * Get pmt normal from 3 different points on the plane.
100  */
101  void GetPmtNormal(Int_t NofPMTPoints,
102  Double_t& normalX,
103  Double_t& normalY,
104  Double_t& normalZ,
105  Double_t& normalCste);
106 
107  void RotateAndCopyHitsToRingLight(const CbmRichRing* ring1,
108  CbmRichRingLight* ring2);
109 
110  /*
111  * Draw histograms.
112  */
113  void DrawHist();
114 
115  /*
116  * Draw histograms from root file.
117  */
118  void DrawHistFromFile(TString fileName);
119 
120  /*
121  * Set output directory for images.
122  */
123  void SetOutputDir(TString dir) { fOutputDir = dir; }
124 
125  /*
126  * Set run title. It is also a part of the file name of image files.
127  */
128  void SetRunTitle(TString title) { fRunTitle = title; }
129 
130  /*
131  * Set to TRUE if you want to draw histograms.
132  */
133  void SetDrawHist(Bool_t b) { fDrawHist = b; }
134 
135 
136 private:
137  TClonesArray* fRichHits; // Array of RICH hits
138  TClonesArray* fRichRings; // Array of found RICH rings
139  TClonesArray* fRichMirrorPoints;
140  TClonesArray* fRichProjections;
141  TClonesArray* fRichMCPoints;
142  TClonesArray* fMCTracks;
143  TClonesArray* fRichRingMatches;
144  TClonesArray* fRichRefPlanePoints;
145  TClonesArray* fRichPoints;
146  TClonesArray* fGlobalTracks;
149 
150  UInt_t fEventNum; // Event counter
152  UInt_t fMirrCounter;
153  Bool_t fDrawHist;
155  Double_t fArray[3];
156 
157  std::map<string, string> fPathsMap;
158  std::map<string, string> fPathsMapEllipse;
159 
160  TString fOutputDir; // Output directory to store figures
161  TString fRunTitle; // Title of the run
162 
165 
168 
170 };
171 
172 #endif
CbmRichPoint.h
CbmRichPMTMapping::fRichRefPlanePoints
TClonesArray * fRichRefPlanePoints
Definition: CbmRichPMTMapping.h:144
CbmRichPMTMapping::ClassDef
ClassDef(CbmRichPMTMapping, 1)
CbmRichPMTMapping::fMirrCounter
UInt_t fMirrCounter
Definition: CbmRichPMTMapping.h:152
CbmRichRingFitterEllipseTau
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
Definition: CbmRichRingFitterEllipseTau.h:35
CbmRichPMTMapping::fPathsMapEllipse
std::map< string, string > fPathsMapEllipse
Definition: CbmRichPMTMapping.h:158
CbmRichRingFitterEllipseTau.h
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
CbmRichPMTMapping::fRichHits
TClonesArray * fRichHits
Definition: CbmRichPMTMapping.h:137
CbmRichPMTMapping
Definition: CbmRichPMTMapping.h:24
CbmRichPMTMapping::fTauFit
CbmRichRingFitterEllipseTau * fTauFit
Definition: CbmRichPMTMapping.h:164
CbmRichRecGeoPar.h
RICH geometry parameters for the reconstruction. This class is used for convinient storing of the bas...
CbmRichPMTMapping::operator=
CbmRichPMTMapping operator=(const CbmRichPMTMapping &)
CbmRichPMTMapping::fRichPoints
TClonesArray * fRichPoints
Definition: CbmRichPMTMapping.h:145
CbmRichRing
Definition: CbmRichRing.h:17
CbmRichRing.h
CbmRichPMTMapping::SetOutputDir
void SetOutputDir(TString dir)
Definition: CbmRichPMTMapping.h:123
CbmRichPMTMapping::fRichProjections
TClonesArray * fRichProjections
Definition: CbmRichPMTMapping.h:140
CbmRichPMTMapping::fCopFit
CbmRichRingFitterCOP * fCopFit
Definition: CbmRichPMTMapping.h:163
CbmHistManager.h
Histogram manager.
CbmRichRingFitterCOP
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
Definition: CbmRichRingFitterCOP.h:28
CbmRichPMTMapping::CbmRichPMTMapping
CbmRichPMTMapping(const CbmRichPMTMapping &)
CbmRichPMTMapping::fGP
CbmRichRecGeoPar fGP
Definition: CbmRichPMTMapping.h:148
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
CbmRichPMTMapping::fRunTitle
TString fRunTitle
Definition: CbmRichPMTMapping.h:161
CbmRichPMTMapping::fRichRings
TClonesArray * fRichRings
Definition: CbmRichPMTMapping.h:138
CbmRichRecGeoPar
PMT parameters for the RICH geometry.
Definition: CbmRichRecGeoPar.h:87
CbmRichPMTMapping::fPathsMap
std::map< string, string > fPathsMap
Definition: CbmRichPMTMapping.h:157
CbmRichPMTMapping::fOutputDir
TString fOutputDir
Definition: CbmRichPMTMapping.h:160
CbmRichPMTMapping::fRichMCPoints
TClonesArray * fRichMCPoints
Definition: CbmRichPMTMapping.h:141
CbmRichPMTMapping::SetDrawHist
void SetDrawHist(Bool_t b)
Definition: CbmRichPMTMapping.h:133
CbmRichRingLight.h
CbmRichPMTMapping::fMCTracks
TClonesArray * fMCTracks
Definition: CbmRichPMTMapping.h:142
CbmRichRingFitterCOP.h
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
CbmRichPMTMapping::fGlobalTracks
TClonesArray * fGlobalTracks
Definition: CbmRichPMTMapping.h:146
CbmRichPMTMapping::fRichRingMatches
TClonesArray * fRichRingMatches
Definition: CbmRichPMTMapping.h:143
CbmRichPMTMapping::fRichMirrorPoints
TClonesArray * fRichMirrorPoints
Definition: CbmRichPMTMapping.h:139
CbmRichPMTMapping::fIsMirrorUpperHalf
Bool_t fIsMirrorUpperHalf
Definition: CbmRichPMTMapping.h:154
CbmRichPMTMapping::SetRunTitle
void SetRunTitle(TString title)
Definition: CbmRichPMTMapping.h:128
CbmRichPMTMapping::fCounterMapping
UInt_t fCounterMapping
Definition: CbmRichPMTMapping.h:151
CbmRichPMTMapping::fDrawHist
Bool_t fDrawHist
Definition: CbmRichPMTMapping.h:153
CbmRichPoint
Definition: CbmRichPoint.h:24
CbmRichPMTMapping::fHM
CbmHistManager * fHM
Definition: CbmRichPMTMapping.h:147
CbmRichPMTMapping::fEventNum
UInt_t fEventNum
Definition: CbmRichPMTMapping.h:150
CbmRichRingLight
Definition: CbmRichRingLight.h:39