CbmRoot
CbmRichGeoOpt.h
Go to the documentation of this file.
1 #
10 #ifndef CBM_RICH_GEO_OPT
11 #define CBM_RICH_GEO_OPT
12 
13 #include "CbmRichPoint.h"
14 #include "FairTask.h"
15 #include <fstream>
16 #include <sstream>
17 
18 class TVector3;
19 class TH1;
20 class TH2;
21 class TH1D;
22 class TH2D;
23 class TH3D;
24 class TClonesArray;
25 class CbmRichRing;
26 class CbmRichRingLight;
27 
28 class TCanvas;
29 
30 #include "TVector3.h"
31 #include <map>
32 #include <vector>
33 
34 using namespace std;
35 
44 class CbmRichGeoOpt : public FairTask {
45 
46 public:
50  CbmRichGeoOpt();
51 
55  virtual ~CbmRichGeoOpt();
56 
60  virtual InitStatus Init();
61 
65  virtual void Exec(Option_t* option);
66 
70  virtual void Finish();
71 
72 
73 private:
74  TClonesArray* fRichPoints;
75  TClonesArray* fMcTracks;
76  TClonesArray* fRefPoints;
77  TClonesArray* fRichHits;
78  TClonesArray* fRichRings;
79  TClonesArray* fRichRingMatches;
80 
81  Int_t fEventNum;
83  Int_t
84  fMinNofHits; // Min number of hits in ring for detector acceptance calculation.
85 
89  //TVector3 NormToXYPlane;
90  //TVector3 XYPlane_P0;TVector3 XYPlane_P1;TVector3 XYPlane_P2;
91  //double RotAngleX;
92  //double RotAngleY;
93 
94  //Parameters to be read from a parameters file
95  vector<TVector3> PMTPlanePoints;
96  TVector3 PMTPlaneCenter;
99  TVector3 MirrorCenter;
100  //TVector3 ReadMirrorCenter;
101  double RotX;
102  double RotY;
103  TVector3 PMT_r1;
104  TVector3 PMT_r2;
105  TVector3 PMT_norm;
109  TVector3 MirrPosition; //double MirrPosX; double MirrPosY; double MirrPosZ;
110 
112  vector<TVector3> SensPlanePoints;
113  TVector3 Sens_r1;
114  TVector3 Sens_r2;
115  TVector3 Sens_norm;
116 
117  //double PMTPlaneXatThird; double PMTPlaneYatThird;
118 
122  void FillMcHist();
123 
127  void InitHistograms();
128 
132  void WriteHistograms();
133 
137  CbmRichPoint* GetPMTPoint(int TrackIdOfSensPlane);
138 
139 
143  void HitsAndPointsWithRef();
147  void HitsAndPoints();
151  void RingParameters();
152 
156  void FillPointsAtPMT();
157 
161  void FillPointsAtPMTSensPlane();
162 
166  float GetDistanceMirrorCenterToPMTPoint(TVector3 PMTpoint);
170  float GetIntersectionPointsLS(TVector3 MirrCenter,
171  TVector3 G_P1,
172  TVector3 G_P2,
173  float R);
174 
178  bool CheckPointLiesOnSphere(TVector3 Point);
179 
183  bool CheckPointLiesOnPlane(TVector3 Point, TVector3 p0, TVector3 n);
187  bool CheckLineIntersectsSphere(TVector3 Point);
188 
192  bool CheckLineIntersectsPlane(TVector3 Point);
193 
198  // void GetPlaneCenter(float RotMir, float RotX, float RotY);
199 
204  void GetPMTRotAngels();
205 
210 
211 
218 
221  TH1D* H_MomPrim;
222  TH1D* H_PtPrim;
223  TH2D* H_MomPt;
230 
231  TH1D* H_MomRing;
235 
236 
239 
240 
241  TH2D* H_Hits_XY; // distribution of X and Y position of hits
243  ;
247 
248  TH2D* H_PointsIn_XY; // distribution of X and Y position of points
253 
254  TH2D*
255  H_PointsOut_XY; // distribution of X and Y position of points (tilting pmt plane)
256  TH1D* H_NofPhotonsPerEv; // Number of photons per hit
257  TH1D* H_NofPhotonsPerHit; // Number of photons per hit
258  TH1D* H_NofPhotonsSmallerThan30; // Number of photons per hit
259  TH1D* H_DiffXhit;
260  TH1D* H_DiffYhit;
261 
264  TH1D* H_Alpha;
265 
273  //H_Alpha_UpLeft_RighttHalf
280 
281 
284  TH1D* H_NofRings;
286 
291  TH1D* H_Radius;
292  TH1D* H_aAxis;
293  TH1D* H_bAxis;
294 
295  TH1D* H_boa;
301 
302 
303  TH1D* H_dR;
304  TH1D* H_dR_aa;
310 
313 
320 
327 
332 
333 
334  ClassDef(CbmRichGeoOpt, 1)
335 };
336 
337 #endif
CbmRichGeoOpt::H_Alpha_UpLeft_RegularTheta
TH1D * H_Alpha_UpLeft_RegularTheta
Definition: CbmRichGeoOpt.h:268
CbmRichPoint.h
CbmRichGeoOpt::PMT_r2
TVector3 PMT_r2
Definition: CbmRichGeoOpt.h:104
CbmRichGeoOpt::H_RingCenter_Baxis
TH3D * H_RingCenter_Baxis
Definition: CbmRichGeoOpt.h:312
CbmRichGeoOpt::H_DistancePMTtoMirr
TH1D * H_DistancePMTtoMirr
Definition: CbmRichGeoOpt.h:220
CbmRichGeoOpt::H_dR_RightHalf
TH1D * H_dR_RightHalf
Definition: CbmRichGeoOpt.h:307
CbmRichGeoOpt::H_dR_aa
TH1D * H_dR_aa
Definition: CbmRichGeoOpt.h:304
CbmRichGeoOpt::H_RingCenter_boa
TH3D * H_RingCenter_boa
Definition: CbmRichGeoOpt.h:314
CbmRichGeoOpt::H_Mom_Theta_Rec
TH2D * H_Mom_Theta_Rec
Definition: CbmRichGeoOpt.h:226
CbmRichGeoOpt::H_PointsOut_XY
TH2D * H_PointsOut_XY
Definition: CbmRichGeoOpt.h:255
CbmRichGeoOpt::H_bAxis
TH1D * H_bAxis
Definition: CbmRichGeoOpt.h:293
CbmRichGeoOpt::H_dFocalPoint_Rho
TH1D * H_dFocalPoint_Rho
Definition: CbmRichGeoOpt.h:263
CbmRichGeoOpt::H_PointsIn_XY
TH2D * H_PointsIn_XY
Definition: CbmRichGeoOpt.h:248
CbmRichGeoOpt::H_DiffXhit
TH1D * H_DiffXhit
Definition: CbmRichGeoOpt.h:259
CbmRichGeoOpt::H_RingCenter_Aaxis
TH3D * H_RingCenter_Aaxis
Definition: CbmRichGeoOpt.h:311
CbmRichGeoOpt::Sens_norm
TVector3 Sens_norm
Definition: CbmRichGeoOpt.h:115
CbmRichGeoOpt::H_Alpha_XYposAtDet_RegularTheta
TH3D * H_Alpha_XYposAtDet_RegularTheta
Definition: CbmRichGeoOpt.h:275
CbmRichGeoOpt::H_NofHitsAll
TH1D * H_NofHitsAll
Definition: CbmRichGeoOpt.h:283
CbmRichGeoOpt::H_Mom_Theta_Acc
TH2D * H_Mom_Theta_Acc
Definition: CbmRichGeoOpt.h:228
CbmRichGeoOpt::H_Alpha_UpLeft_II
TH1D * H_Alpha_UpLeft_II
Definition: CbmRichGeoOpt.h:267
CbmRichGeoOpt::H_acc_mom_el_RegularTheta
TH1D * H_acc_mom_el_RegularTheta
Definition: CbmRichGeoOpt.h:238
CbmRichGeoOpt::H_Alpha_UpLeft_Left2Thirds
TH1D * H_Alpha_UpLeft_Left2Thirds
Definition: CbmRichGeoOpt.h:272
CbmRichGeoOpt::RotX
double RotX
Definition: CbmRichGeoOpt.h:101
CbmRichGeoOpt::H_Radius
TH1D * H_Radius
Definition: CbmRichGeoOpt.h:291
CbmRichRing
Definition: CbmRichRing.h:17
CbmRichGeoOpt::H_aAxis
TH1D * H_aAxis
Definition: CbmRichGeoOpt.h:292
CbmRichGeoOpt::H_RingCenterX
TH1D * H_RingCenterX
Definition: CbmRichGeoOpt.h:288
CbmRichGeoOpt::fMinNofHits
Int_t fMinNofHits
Definition: CbmRichGeoOpt.h:84
CbmRichGeoOpt::Sens_r2
TVector3 Sens_r2
Definition: CbmRichGeoOpt.h:114
CbmRichGeoOpt
Optimization of the RICH geometry.
Definition: CbmRichGeoOpt.h:44
CbmRichGeoOpt::H_Alpha_XYposAtDet_Left2Thirds
TH3D * H_Alpha_XYposAtDet_Left2Thirds
Definition: CbmRichGeoOpt.h:279
CbmRichGeoOpt::H_MomPrim_RegularTheta
TH1D * H_MomPrim_RegularTheta
Definition: CbmRichGeoOpt.h:237
CbmRichGeoOpt::MirrPosition
TVector3 MirrPosition
Definition: CbmRichGeoOpt.h:109
CbmRichGeoOpt::H_Hits_XY
TH2D * H_Hits_XY
Definition: CbmRichGeoOpt.h:241
CbmRichGeoOpt::fMcTracks
TClonesArray * fMcTracks
Definition: CbmRichGeoOpt.h:75
CbmRichGeoOpt::SensPlanePoints
vector< TVector3 > SensPlanePoints
Definition: CbmRichGeoOpt.h:112
CbmRichGeoOpt::PMTPlaneCenterY
double PMTPlaneCenterY
Definition: CbmRichGeoOpt.h:107
CbmRichGeoOpt::H_NofRings_NofHits
TH2D * H_NofRings_NofHits
Definition: CbmRichGeoOpt.h:285
CbmRichGeoOpt::H_Hits_XY_LeftHalf
TH2D * H_Hits_XY_LeftHalf
Definition: CbmRichGeoOpt.h:242
CbmRichGeoOpt::H_RingCenter_dR_LeftHalf
TH3D * H_RingCenter_dR_LeftHalf
Definition: CbmRichGeoOpt.h:323
CbmRichGeoOpt::H_boa
TH1D * H_boa
Definition: CbmRichGeoOpt.h:295
CbmRichGeoOpt::PMTPointsFilled
Int_t PMTPointsFilled
Definition: CbmRichGeoOpt.h:82
CbmRichGeoOpt::PMTPlaneThirdX
double PMTPlaneThirdX
Definition: CbmRichGeoOpt.h:108
CbmRichGeoOpt::nTotalPhorons
Int_t nTotalPhorons
Definition: CbmRichGeoOpt.h:88
CbmRichGeoOpt::H_boa_Left2Thirds
TH1D * H_boa_Left2Thirds
Definition: CbmRichGeoOpt.h:300
CbmRichGeoOpt::H_Hits_XY_RightThird
TH2D * H_Hits_XY_RightThird
Definition: CbmRichGeoOpt.h:246
CbmRichGeoOpt::H_acc_mom_el
TH1D * H_acc_mom_el
Definition: CbmRichGeoOpt.h:232
CbmRichGeoOpt::H_boa_LeftHalf
TH1D * H_boa_LeftHalf
Definition: CbmRichGeoOpt.h:297
CbmRichGeoOpt::H_RingCenter
TH2D * H_RingCenter
Definition: CbmRichGeoOpt.h:290
CbmRichGeoOpt::H_Alpha_XYposAtDet_RightThird
TH3D * H_Alpha_XYposAtDet_RightThird
Definition: CbmRichGeoOpt.h:278
CbmRichGeoOpt::H_dR_RightThird
TH1D * H_dR_RightThird
Definition: CbmRichGeoOpt.h:308
CbmRichGeoOpt::H_RingCenter_boa_RightHalf
TH3D * H_RingCenter_boa_RightHalf
Definition: CbmRichGeoOpt.h:317
CbmRichGeoOpt::H_RingCenter_boa_LeftHalf
TH3D * H_RingCenter_boa_LeftHalf
Definition: CbmRichGeoOpt.h:316
CbmRichGeoOpt::ReadPMTPlaneCenterOrig
TVector3 ReadPMTPlaneCenterOrig
Definition: CbmRichGeoOpt.h:98
CbmRichGeoOpt::H_RingCenter_dR
TH3D * H_RingCenter_dR
Definition: CbmRichGeoOpt.h:321
CbmRichGeoOpt::MirrorCenter
TVector3 MirrorCenter
Definition: CbmRichGeoOpt.h:99
CbmRichGeoOpt::H_RingCenter_dR_RightThird
TH3D * H_RingCenter_dR_RightThird
Definition: CbmRichGeoOpt.h:325
CbmRichGeoOpt::operator=
CbmRichGeoOpt & operator=(const CbmRichGeoOpt &)
Assignment operator.
CbmRichGeoOpt::H_dR_RegularTheta
TH1D * H_dR_RegularTheta
Definition: CbmRichGeoOpt.h:305
CbmRichGeoOpt::Sens_r1
TVector3 Sens_r1
Definition: CbmRichGeoOpt.h:113
Point
Definition: CbmGlobalTrackingTof.cxx:90
CbmRichGeoOpt::H_boa_RightThird
TH1D * H_boa_RightThird
Definition: CbmRichGeoOpt.h:299
CbmRichGeoOpt::PMTPlaneCenterX
double PMTPlaneCenterX
Definition: CbmRichGeoOpt.h:106
CbmRichGeoOpt::PMTPlaneCenter
TVector3 PMTPlaneCenter
Definition: CbmRichGeoOpt.h:96
CbmRichGeoOpt::PMTPlanePoints
vector< TVector3 > PMTPlanePoints
Definition: CbmRichGeoOpt.h:95
CbmRichGeoOpt::H_RingCenter_boa_RegularTheta
TH3D * H_RingCenter_boa_RegularTheta
Definition: CbmRichGeoOpt.h:315
CbmRichGeoOpt::H_Alpha_UpLeft_LeftHalf
TH1D * H_Alpha_UpLeft_LeftHalf
Definition: CbmRichGeoOpt.h:269
CbmRichGeoOpt::H_RingCenterY
TH1D * H_RingCenterY
Definition: CbmRichGeoOpt.h:289
CbmRichGeoOpt::fRichHits
TClonesArray * fRichHits
Definition: CbmRichGeoOpt.h:77
CbmRichGeoOpt::H_Mom_Theta_MC
TH2D * H_Mom_Theta_MC
Definition: CbmRichGeoOpt.h:224
CbmRichGeoOpt::ReadPMTPlaneCenter
TVector3 ReadPMTPlaneCenter
Definition: CbmRichGeoOpt.h:97
CbmRichGeoOpt::H_Hits_XY_Left2Thirds
TH2D * H_Hits_XY_Left2Thirds
Definition: CbmRichGeoOpt.h:245
CbmRichGeoOpt::H_Alpha_UpLeft
TH1D * H_Alpha_UpLeft
Definition: CbmRichGeoOpt.h:266
CbmRichGeoOpt::H_Alpha_XYposAtDet
TH3D * H_Alpha_XYposAtDet
Definition: CbmRichGeoOpt.h:274
CbmRichGeoOpt::H_dFocalPoint_Delta
TH1D * H_dFocalPoint_Delta
Definition: CbmRichGeoOpt.h:262
CbmRichGeoOpt::RotY
double RotY
Definition: CbmRichGeoOpt.h:102
CbmRichGeoOpt::H_RingCenter_boa_Left2Thirds
TH3D * H_RingCenter_boa_Left2Thirds
Definition: CbmRichGeoOpt.h:319
CbmRichGeoOpt::H_Hits_XY_RightHalf
TH2D * H_Hits_XY_RightHalf
Definition: CbmRichGeoOpt.h:243
CbmRichGeoOpt::H_PointsIn_XY_RightHalf
TH2D * H_PointsIn_XY_RightHalf
Definition: CbmRichGeoOpt.h:250
CbmRichGeoOpt::H_RingCenter_dR_RightHalf
TH3D * H_RingCenter_dR_RightHalf
Definition: CbmRichGeoOpt.h:324
CbmRichGeoOpt::H_PointsIn_XY_RightThird
TH2D * H_PointsIn_XY_RightThird
Definition: CbmRichGeoOpt.h:252
CbmRichGeoOpt::H_PtPrim
TH1D * H_PtPrim
Definition: CbmRichGeoOpt.h:222
CbmRichGeoOpt::H_boa_RightHalf
TH1D * H_boa_RightHalf
Definition: CbmRichGeoOpt.h:298
CbmRichGeoOpt::H_Pt_Theta_Rec
TH2D * H_Pt_Theta_Rec
Definition: CbmRichGeoOpt.h:227
CbmRichGeoOpt::H_RingCenter_dR_Left2Thirds
TH3D * H_RingCenter_dR_Left2Thirds
Definition: CbmRichGeoOpt.h:326
CbmRichGeoOpt::PMT_norm
TVector3 PMT_norm
Definition: CbmRichGeoOpt.h:105
CbmRichGeoOpt::H_PointsIn_XY_Left2Thirds
TH2D * H_PointsIn_XY_Left2Thirds
Definition: CbmRichGeoOpt.h:251
CbmRichGeoOpt::H_MomPrim
TH1D * H_MomPrim
Definition: CbmRichGeoOpt.h:221
CbmRichGeoOpt::CbmRichGeoOpt
CbmRichGeoOpt(const CbmRichGeoOpt &)
Copy constructor.
CbmRichGeoOpt::H_Pt_Theta_MC
TH2D * H_Pt_Theta_MC
Definition: CbmRichGeoOpt.h:225
CbmRichGeoOpt::H_dR_Left2Thirds
TH1D * H_dR_Left2Thirds
Definition: CbmRichGeoOpt.h:309
CbmRichGeoOpt::H_Alpha_UpLeft_RightHalf
TH1D * H_Alpha_UpLeft_RightHalf
Definition: CbmRichGeoOpt.h:270
CbmRichGeoOpt::H_dR
TH1D * H_dR
Definition: CbmRichGeoOpt.h:303
CbmRichGeoOpt::H_dR_LeftHalf
TH1D * H_dR_LeftHalf
Definition: CbmRichGeoOpt.h:306
CbmRichGeoOpt::H_RingCenter_dR_RegularTheta
TH3D * H_RingCenter_dR_RegularTheta
Definition: CbmRichGeoOpt.h:322
CbmRichGeoOpt::fRefPoints
TClonesArray * fRefPoints
Definition: CbmRichGeoOpt.h:76
CbmRichGeoOpt::H_MomPt
TH2D * H_MomPt
Definition: CbmRichGeoOpt.h:223
CbmRichGeoOpt::H_Pt_Theta_Acc
TH2D * H_Pt_Theta_Acc
Definition: CbmRichGeoOpt.h:229
CbmRichGeoOpt::H_acc_pty_el
TH2D * H_acc_pty_el
Definition: CbmRichGeoOpt.h:233
CbmRichGeoOpt::PMT_r1
TVector3 PMT_r1
Definition: CbmRichGeoOpt.h:103
CbmRichGeoOpt::H_NofRings
TH1D * H_NofRings
Definition: CbmRichGeoOpt.h:284
CbmRichGeoOpt::fRichRingMatches
TClonesArray * fRichRingMatches
Definition: CbmRichGeoOpt.h:79
CbmRichGeoOpt::nPhotonsNotOnPlane
Int_t nPhotonsNotOnPlane
Definition: CbmRichGeoOpt.h:86
CbmRichGeoOpt::H_Alpha_UpLeft_RightThird
TH1D * H_Alpha_UpLeft_RightThird
Definition: CbmRichGeoOpt.h:271
CbmRichGeoOpt::H_NofPhotonsPerEv
TH1D * H_NofPhotonsPerEv
Definition: CbmRichGeoOpt.h:256
CbmRichGeoOpt::H_Mom_XY_Theta25
TH3D * H_Mom_XY_Theta25
Definition: CbmRichGeoOpt.h:234
CbmRichGeoOpt::H_PointsIn_XY_LeftHalf
TH2D * H_PointsIn_XY_LeftHalf
Definition: CbmRichGeoOpt.h:249
CbmRichGeoOpt::fRichRings
TClonesArray * fRichRings
Definition: CbmRichGeoOpt.h:78
CbmRichGeoOpt::H_Alpha_XYposAtDet_RightHalf
TH3D * H_Alpha_XYposAtDet_RightHalf
Definition: CbmRichGeoOpt.h:277
CbmRichGeoOpt::H_Theta_TwoVectors
TH1D * H_Theta_TwoVectors
Definition: CbmRichGeoOpt.h:217
CbmRichPoint
Definition: CbmRichPoint.h:24
CbmRichGeoOpt::H_Diff_LineRefPMT_MomAtPMT
TH1D * H_Diff_LineRefPMT_MomAtPMT
histograms.
Definition: CbmRichGeoOpt.h:216
CbmRichGeoOpt::H_Alpha_XYposAtDet_LeftHalf
TH3D * H_Alpha_XYposAtDet_LeftHalf
Definition: CbmRichGeoOpt.h:276
CbmRichGeoOpt::H_DiffYhit
TH1D * H_DiffYhit
Definition: CbmRichGeoOpt.h:260
CbmRichGeoOpt::nPhotonsNotOnSphere
Int_t nPhotonsNotOnSphere
Definition: CbmRichGeoOpt.h:87
CbmRichRingLight
Definition: CbmRichRingLight.h:39
CbmRichGeoOpt::H_RingCenter_boa_RightThird
TH3D * H_RingCenter_boa_RightThird
Definition: CbmRichGeoOpt.h:318
CbmRichGeoOpt::H_MomRing
TH1D * H_MomRing
Definition: CbmRichGeoOpt.h:231
CbmRichGeoOpt::H_boa_RegularTheta
TH1D * H_boa_RegularTheta
Definition: CbmRichGeoOpt.h:296
CbmRichGeoOpt::fEventNum
Int_t fEventNum
Definition: CbmRichGeoOpt.h:81
CbmRichGeoOpt::fRichPoints
TClonesArray * fRichPoints
Definition: CbmRichGeoOpt.h:74
CbmRichGeoOpt::H_DistancePMTtoMirrCenter
TH1D * H_DistancePMTtoMirrCenter
Definition: CbmRichGeoOpt.h:219
CbmRichGeoOpt::SensPointsFilled
Int_t SensPointsFilled
Definition: CbmRichGeoOpt.h:111
CbmRichGeoOpt::H_NofPhotonsPerHit
TH1D * H_NofPhotonsPerHit
Definition: CbmRichGeoOpt.h:257
CbmRichGeoOpt::H_NofPhotonsSmallerThan30
TH1D * H_NofPhotonsSmallerThan30
Definition: CbmRichGeoOpt.h:258
CbmRichGeoOpt::H_Alpha
TH1D * H_Alpha
Definition: CbmRichGeoOpt.h:264