CMS 3D CMS Logo

Conversion.h
Go to the documentation of this file.
1 #ifndef EgammaCandidates_Conversion_h
2 #define EgammaCandidates_Conversion_h
3 
12 #include <bitset>
21 
22 
23 namespace reco {
24  class Conversion {
25  public:
26 
30  mixed=3,
31  pflow=4,
32  algoSize=5};
33 
42 
43  static const std::string algoNames[];
44 
45  // Default constructor
46  Conversion();
47 
49  const std::vector<edm::RefToBase<reco::Track> >& tr,
50  const std::vector<math::XYZPointF>& trackPositionAtEcal ,
51  const reco::Vertex & convVtx,
52  const std::vector<reco::CaloClusterPtr> & matchingBC,
53  const float DCA,
54  const std::vector<math::XYZPointF> & innPoint,
55  const std::vector<math::XYZVectorF> & trackPin ,
56  const std::vector<math::XYZVectorF> & trackPout,
57  const std::vector<uint8_t>& nHitsBeforeVtx,
58  const std::vector<Measurement1DFloat> & dlClosestHitToVtx,
59  uint8_t nSharedHits,
60  const float mva,
62 
63 
65  const std::vector<reco::TrackRef>& tr,
66  const std::vector<math::XYZPointF>& trackPositionAtEcal ,
67  const reco::Vertex & convVtx,
68  const std::vector<reco::CaloClusterPtr> & matchingBC,
69  const float DCA,
70  const std::vector<math::XYZPointF> & innPoint,
71  const std::vector<math::XYZVectorF> & trackPin ,
72  const std::vector<math::XYZVectorF> & trackPout,
73  const float mva,
75 
76 
77 
78 
80  const std::vector<reco::TrackRef>& tr,
81  const reco::Vertex & convVtx,
83 
85  const std::vector<edm::RefToBase<reco::Track> >& tr,
86  const reco::Vertex & convVtx,
88 
89 
91  Conversion * clone() const;
95  std::vector<edm::RefToBase<reco::Track> > const& tracks() const ;
97  const reco::Vertex & conversionVertex() const { return theConversionVertex_ ; }
99  bool isConverted() const;
101  unsigned int nTracks() const {return tracks().size(); }
103  double MVAout() const { return theMVAout_;}
105  std::vector<float> const oneLegMVA() {return theOneLegMVA_;}
107  double pairInvariantMass() const;
109  double pairCotThetaSeparation() const;
119  double EoverP() const;
123  double EoverPrefittedTracks() const;
124  // Dist of minimum approach between tracks
126  // deltaPhi tracks at innermost point
127  double dPhiTracksAtVtx() const;
128  // deltaPhi tracks at ECAl
129  double dPhiTracksAtEcal() const;
130  // deltaEta tracks at ECAl
131  double dEtaTracksAtEcal() const;
132 
133  //impact parameter and decay length computed with respect to given beamspot or vertex
134  //computed from refittedPairMomentum
135 
136  //transverse impact parameter
137  double dxy(const math::XYZPoint& myBeamSpot = math::XYZPoint()) const;
138  //longitudinal impact parameter
139  double dz(const math::XYZPoint& myBeamSpot = math::XYZPoint()) const;
140  //transverse decay length
141  double lxy(const math::XYZPoint& myBeamSpot = math::XYZPoint()) const;
142  //longitudinal decay length
143  double lz(const math::XYZPoint& myBeamSpot = math::XYZPoint()) const;
144  //z position of intersection with beamspot in rz plane (possible tilt of beamspot is neglected)
145  double zOfPrimaryVertexFromTracks(const math::XYZPoint& myBeamSpot = math::XYZPoint()) const { return dz(myBeamSpot) + myBeamSpot.z(); }
146 
149  const std::vector<math::XYZPointF> & ecalImpactPosition() const {return thePositionAtEcal_;}
150  // pair of BC matching a posteriori the tracks
151  const std::vector<reco::CaloClusterPtr>& bcMatchingWithTracks() const { return theMatchingBCs_;}
153  std::vector<double> tracksSigned_d0() const ;
155  const std::vector<math::XYZPointF>& tracksInnerPosition() const {return theTrackInnerPosition_;}
157  const std::vector<math::XYZVectorF>& tracksPout() const {return theTrackPout_;}
159  const std::vector<math::XYZVectorF>& tracksPin() const {return theTrackPin_;}
161  const std::vector<uint8_t> &nHitsBeforeVtx() const { return nHitsBeforeVtx_; }
163  const std::vector<Measurement1DFloat> &dlClosestHitToVtx() const { return dlClosestHitToVtx_; }
165  uint8_t nSharedHits() const { return nSharedHits_; }
166 
167 
169  void setMVAout(const float& mva) { theMVAout_=mva;}
171  void setOneLegMVA(const std::vector<float>& mva) { theOneLegMVA_=mva;}
172  // Set the ptr to the Super cluster if not set in the constructor
175  void setConversionAlgorithm(const ConversionAlgorithm a, bool set=true) { if (set) algorithm_=a; else algorithm_=undefined;}
176  ConversionAlgorithm algo() const ;
177  std::string algoName() const;
180 
181  bool quality(ConversionQuality q) const { return (qualityMask_ & (1<<q))>>q; }
182  void setQuality(ConversionQuality q, bool b);
183 
184 
185 
186  private:
187 
191  std::vector<edm::RefToBase<reco::Track> > trackToBaseRefs_;
193  std::vector<math::XYZPointF> thePositionAtEcal_;
197  std::vector<reco::CaloClusterPtr> theMatchingBCs_;
199  std::vector<math::XYZPointF> theTrackInnerPosition_;
201  std::vector<math::XYZVectorF> theTrackPin_;
203  std::vector<math::XYZVectorF> theTrackPout_;
205  std::vector<uint8_t> nHitsBeforeVtx_;
207  std::vector<Measurement1DFloat> dlClosestHitToVtx_;
209  std::vector<float> theOneLegMVA_;
213  float theMVAout_;
214  uint16_t qualityMask_;
216  uint8_t nSharedHits_;
218  uint8_t algorithm_;
219 
220 
221  };
222 
225  }
226 
227 
229 
230  switch(algorithm_)
231  {
232  case undefined: return "undefined";
233  case ecalSeeded: return "ecalSeeded";
234  case trackerOnly: return "trackerOnly";
235  case mixed: return "mixed";
236  case pflow: return "pflow";
237 
238  }
239  return "undefined";
240  }
241 
243  if(int(a) < int(algoSize) && int(a)>0) return algoNames[int(a)];
244  return "undefined";
245  }
246 
248  if (b)//regular OR if setting value to true
249  qualityMask_ |= (1<<q) ;
250  else // doing "half-XOR" if unsetting value
251  qualityMask_ &= (~(1<<q));
252 
253  }
254 
255 }
256 
257 #endif
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
Definition: Conversion.h:97
static const std::string algoNames[]
Definition: Conversion.h:43
std::vector< math::XYZVectorF > theTrackPout_
P_out of tracks.
Definition: Conversion.h:203
ConversionAlgorithm algo() const
Definition: Conversion.h:223
bool quality(ConversionQuality q) const
Definition: Conversion.h:181
void setQuality(ConversionQuality q, bool b)
Definition: Conversion.h:247
double EoverP() const
Definition: Conversion.cc:259
const std::vector< Measurement1DFloat > & dlClosestHitToVtx() const
Vector of signed decay length with uncertainty from nearest hit on track to the conversion vtx positi...
Definition: Conversion.h:163
reco::CaloClusterPtrVector caloCluster_
vector pointer to a/multiple seed CaloCluster(s)
Definition: Conversion.h:189
double zOfPrimaryVertexFromTracks(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.h:145
double distOfMinimumApproach() const
Definition: Conversion.h:125
std::vector< double > tracksSigned_d0() const
signed transverse impact parameter for each track
Definition: Conversion.cc:303
double lxy(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.cc:392
static ConversionAlgorithm algoByName(const std::string &name)
Definition: Conversion.cc:163
double pairCotThetaSeparation() const
Delta cot(Theta) where Theta is the angle in the (y,z) plane between the two tracks. Original tracks are used.
Definition: Conversion.cc:209
void setConversionAlgorithm(const ConversionAlgorithm a, bool set=true)
Conversion Track algorithm/provenance.
Definition: Conversion.h:175
double pairInvariantMass() const
if nTracks=2 returns the pair invariant mass. Original tracks are used here
Definition: Conversion.cc:190
math::XYZVectorF refittedPairMomentum() const
Conversion tracks momentum from the tracks refitted with vertex constraint.
Definition: Conversion.cc:248
uint8_t nSharedHits_
number of shared hits between tracks
Definition: Conversion.h:216
double EoverPrefittedTracks() const
Definition: Conversion.cc:281
const std::vector< math::XYZVectorF > & tracksPout() const
Vector of track momentum measured at the outermost hit.
Definition: Conversion.h:157
double MVAout() const
get the value of the TMVA output
Definition: Conversion.h:103
uint16_t qualityMask_
Definition: Conversion.h:214
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:17
const std::vector< reco::CaloClusterPtr > & bcMatchingWithTracks() const
Definition: Conversion.h:151
std::vector< float > theOneLegMVA_
vectors of TMVA outputs from pflow for one leg conversions
Definition: Conversion.h:209
std::string algoName() const
Definition: Conversion.h:228
std::vector< math::XYZPointF > theTrackInnerPosition_
P_in of tracks.
Definition: Conversion.h:199
std::vector< float > const oneLegMVA()
get the MVS output from PF for one leg conversions
Definition: Conversion.h:105
unsigned int nTracks() const
Number of tracks= 0,1,2.
Definition: Conversion.h:101
Conversion * clone() const
returns a clone of the candidate
Definition: Conversion.cc:171
math::XYZTLorentzVectorF refittedPair4Momentum() const
Conversion track pair 4-momentum from the tracks refitted with vertex constraint. ...
Definition: Conversion.cc:235
const std::vector< math::XYZVectorF > & tracksPin() const
Vector of track momentum measured at the innermost hit.
Definition: Conversion.h:159
uint8_t algorithm_
conversion algorithm/provenance
Definition: Conversion.h:218
const std::vector< math::XYZPointF > & tracksInnerPosition() const
Vector containing the position of the innermost hit of each track.
Definition: Conversion.h:155
math::XYZVectorF pairMomentum() const
Conversion tracks momentum from the tracks inner momentum.
Definition: Conversion.cc:223
const std::vector< math::XYZPointF > & ecalImpactPosition() const
Definition: Conversion.h:149
uint8_t nSharedHits() const
number of shared hits btw the two track
Definition: Conversion.h:165
double dEtaTracksAtEcal() const
Definition: Conversion.cc:351
double dz(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.cc:380
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::vector< math::XYZVectorF > theTrackPin_
P_in of tracks.
Definition: Conversion.h:201
float theMVAout_
TMVA output.
Definition: Conversion.h:213
double b
Definition: hdecay.h:120
std::vector< reco::CaloClusterPtr > theMatchingBCs_
Clusters mathing the tracks (these are not the seeds)
Definition: Conversion.h:197
double lz(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.cc:406
void setMVAout(const float &mva)
set the value of the TMVA output
Definition: Conversion.h:169
float theMinDistOfApproach_
Distance of min approach of the two tracks.
Definition: Conversion.h:211
std::vector< math::XYZPointF > thePositionAtEcal_
position at the ECAl surface of the track extrapolation
Definition: Conversion.h:193
fixed size matrix
void setOneLegMVA(const std::vector< float > &mva)
set the MVS output from PF for one leg conversions
Definition: Conversion.h:171
double a
Definition: hdecay.h:121
std::vector< edm::RefToBase< reco::Track > > trackToBaseRefs_
vector Track RefToBase
Definition: Conversion.h:191
const std::vector< uint8_t > & nHitsBeforeVtx() const
Vector of the number of hits before the vertex along each track trajector.
Definition: Conversion.h:161
std::vector< Measurement1DFloat > dlClosestHitToVtx_
signed decay length and uncertainty from nearest hit on track to conversion vertex ...
Definition: Conversion.h:207
double dPhiTracksAtEcal() const
Definition: Conversion.cc:326
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > XYZTLorentzVectorF
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:22
reco::Vertex theConversionVertex_
Fitted Kalman conversion vertex.
Definition: Conversion.h:195
bool isConverted() const
Bool flagging objects having track size >0.
Definition: Conversion.cc:182
std::vector< uint8_t > nHitsBeforeVtx_
number of hits before the vertex on each trackerOnly
Definition: Conversion.h:205
reco::CaloClusterPtrVector caloCluster() const
Pointer to CaloCluster (foe Egamma Conversions it points to a SuperCluster)
Definition: Conversion.h:93
void setMatchingSuperCluster(const reco::CaloClusterPtrVector &sc)
Definition: Conversion.h:173
double dPhiTracksAtVtx() const
Definition: Conversion.cc:313
std::vector< edm::RefToBase< reco::Track > > const & tracks() const
vector of track to base references
Definition: Conversion.cc:176
double dxy(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.cc:368