CMS 3D CMS Logo

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