test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Conv4HitsReco.h
Go to the documentation of this file.
1 #ifndef Conv4HitsReco_h
2 #define Conv4HitsReco_h
3 
4 #include <iostream>
5 #include <iomanip>
6 #include <math.h>
7 
8 #include <TVector3.h>
9 
11 public :
12 
13  //Needed for construction
14  TVector3 vV;
15  TVector3 hit4;
16  TVector3 hit3;
17  TVector3 hit2;
18  TVector3 hit1;
19 
20  //Important quantities
21  TVector3 v3minus4;
22  TVector3 v1minus2;
23  TVector3 vN;
24  TVector3 vP;
25  TVector3 vPminusN;
26  TVector3 vPminusV;
27  TVector3 vNminusV;
28  TVector3 unitVn;
29  TVector3 unitVp;
30  double pn;
31  double pPN;
32  double nPN;
33  double PN;
34  double PN2;
35  double pNV;
36  double nNV;
37  double _eta;
38  double _pi;
39  double _eta2;
40  double _pi2;
41  TVector3 vMMaxLimit;
42  TVector3 vQMaxLimit;
43  double qMaxLimit;
44  double mMaxLimit;
45  double qMinLimit;
46  double mMinLimit;
47  TVector3 plusCenter;
48  TVector3 minusCenter;
49  TVector3 convVtx;
50  double plusRadius;
51  double minusRadius;
52 
56  double ptLegMinCut;
57  double ptLegMaxCut;
58  double ptPhotMaxCut;
59 
60  std::string qFromM_print(double m);
61  double qFromM(double); //For debugging purposes
62 
63  //Elements of the linearized system matrix
64  double Tq, Tm, T0;
65  double Oq, Om, O0;
66  int ComputeMaxLimits();
67  int ComputeMinLimits();
68  int GuessStartingValues(double&, double&);
69  int mqFindByIteration(double&, double&);
70  TVector3 GetIntersection(TVector3&, TVector3&, TVector3&, TVector3&);
71  TVector3 GetPlusCenter(double &);
72  TVector3 GetMinusCenter(double &);
73  void SetPtLegMinCut(double val){ptLegMinCut = val;};
74  void SetPtLegMaxCut(double val){ptLegMaxCut = val;};
75  void SetPtPhotMaxCut(double val){ptPhotMaxCut = val;};
76  void SetLinSystCoeff(double, double);
77  void Set(double);
80  void SetMaxVtxDistance(int val){maxVtxDistance = val;};
81  double GetDq();
82  double GetDm();
83  double GetPtFromParamAndHitPair(double &, double &);
84  double GetPtPlusFromParam(double &);
85  double GetPtMinusFromParam(double &);
86  TVector3 GetConvVertexFromParams(double &, double &);
87  int IsNotValidForPtLimit(double, double, double, double);
88  int IsNotValidForVtxPosition(double&);
89 
90  int ConversionCandidate(TVector3&, double&, double&);
91  void Dump();
92 
93  Conv4HitsReco(TVector3 &, TVector3 &, TVector3 &, TVector3 &, TVector3 &);
95 
96 };
97 
98 #endif
99 
100 #ifdef Conv4HitsReco_cxx
101 Conv4HitsReco::Conv4HitsReco(TVector3 & vPhotVertex, TVector3 & h1, TVector3 & h2, TVector3 & h3, TVector3 & h4)
102 {
103 
104  vV = vPhotVertex;
105  hit4 = h4;
106  hit3 = h3;
107  hit2 = h2;
108  hit1 = h1;
109 
110  //Let's stay in the transverse plane...
111  vV.SetZ(0.);
112  hit4.SetZ(0.);
113  hit3.SetZ(0.);
114  hit2.SetZ(0.);
115  hit1.SetZ(0.);
116 
117  //Filling important quantities
118  vN.SetXYZ(0.5*hit4.X()+0.5*hit3.X(),0.5*hit4.Y()+0.5*hit3.Y(),0.5*hit4.Z()+0.5*hit3.Z());
119  vP.SetXYZ(0.5*hit2.X()+0.5*hit1.X(),0.5*hit2.Y()+0.5*hit1.Y(),0.5*hit2.Z()+0.5*hit1.Z());
120  vPminusN=vP-vN;
121  vPminusV=vP-vV;
122  vNminusV=vN-vV;
125  unitVn=v3minus4.Orthogonal().Unit();
126  unitVp=v1minus2.Orthogonal().Unit();
127  pPN = unitVp*vPminusN;
128  nPN = unitVn*vPminusN;
129  pNV = unitVp*vNminusV;
130  nNV = unitVn*vNminusV;
131  pn = unitVp*unitVn;
132  PN = vPminusN.Mag();
133  PN2 = vPminusN.Mag2();
134 
135  _eta=0.5*(hit3-hit4).Mag();
136  _pi=0.5*(hit1-hit2).Mag();
137  _eta2=_eta*_eta;
138  _pi2=_pi*_pi;
139 
140  //Default values for parameters
143  SetPtLegMinCut(0.2);
144  SetPtLegMaxCut(20.);
145  SetPtPhotMaxCut(30.);
146  SetMaxVtxDistance(20.);
147 
148 }
149 
151 
152  // std::cout << " Bye..." << std::endl;
153 
154 }
155 
156 #endif // #ifdef Conv4HitsReco_h
TVector3 GetMinusCenter(double &)
int IsNotValidForPtLimit(double, double, double, double)
double minusRadius
Definition: Conv4HitsReco.h:51
TVector3 unitVp
Definition: Conv4HitsReco.h:29
TVector3 vNminusV
Definition: Conv4HitsReco.h:27
TVector3 vMMaxLimit
Definition: Conv4HitsReco.h:41
void SetPtLegMinCut(double val)
Definition: Conv4HitsReco.h:73
TVector3 hit3
Definition: Conv4HitsReco.h:16
double ptLegMaxCut
Definition: Conv4HitsReco.h:57
double GetPtMinusFromParam(double &)
double GetDm()
double mMaxLimit
Definition: Conv4HitsReco.h:44
double GetPtPlusFromParam(double &)
int GuessStartingValues(double &, double &)
void SetIterationStopRelThreshold(double val)
Definition: Conv4HitsReco.h:78
int ComputeMinLimits()
double GetPtFromParamAndHitPair(double &, double &)
double qMaxLimit
Definition: Conv4HitsReco.h:43
TVector3 hit2
Definition: Conv4HitsReco.h:17
int IsNotValidForVtxPosition(double &)
double plusRadius
Definition: Conv4HitsReco.h:50
void SetPtPhotMaxCut(double val)
Definition: Conv4HitsReco.h:75
double GetDq()
Conv4HitsReco(TVector3 &, TVector3 &, TVector3 &, TVector3 &, TVector3 &)
TVector3 GetIntersection(TVector3 &, TVector3 &, TVector3 &, TVector3 &)
TVector3 hit4
Definition: Conv4HitsReco.h:15
TVector3 vPminusV
Definition: Conv4HitsReco.h:26
int maxNumberOfIterations
Definition: Conv4HitsReco.h:54
TVector3 hit1
Definition: Conv4HitsReco.h:18
int mqFindByIteration(double &, double &)
TVector3 vPminusN
Definition: Conv4HitsReco.h:25
TVector3 vQMaxLimit
Definition: Conv4HitsReco.h:42
TVector3 minusCenter
Definition: Conv4HitsReco.h:48
int ComputeMaxLimits()
TVector3 convVtx
Definition: Conv4HitsReco.h:49
double mMinLimit
Definition: Conv4HitsReco.h:46
void SetMaxVtxDistance(int val)
Definition: Conv4HitsReco.h:80
void SetLinSystCoeff(double, double)
double ptLegMinCut
Definition: Conv4HitsReco.h:56
TVector3 GetConvVertexFromParams(double &, double &)
TVector3 plusCenter
Definition: Conv4HitsReco.h:47
int ConversionCandidate(TVector3 &, double &, double &)
double ptPhotMaxCut
Definition: Conv4HitsReco.h:58
void Set(double)
double qFromM(double)
TVector3 v1minus2
Definition: Conv4HitsReco.h:22
TVector3 GetPlusCenter(double &)
TVector3 unitVn
Definition: Conv4HitsReco.h:28
double qMinLimit
Definition: Conv4HitsReco.h:45
void SetPtLegMaxCut(double val)
Definition: Conv4HitsReco.h:74
double maxVtxDistance
Definition: Conv4HitsReco.h:55
TVector3 v3minus4
Definition: Conv4HitsReco.h:21
double iterationStopRelThreshold
Definition: Conv4HitsReco.h:53
std::string qFromM_print(double m)
void SetMaxNumberOfIterations(int val)
Definition: Conv4HitsReco.h:79