CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Conversion.h
Go to the documentation of this file.
1 #ifndef EgammaCandidates_Conversion_h
2 #define EgammaCandidates_Conversion_h
3 
13 #include <bitset>
22 
23 
24 namespace reco {
25  class Conversion {
26  public:
27 
31  mixed=3,
32  pflow=4,
33  algoSize=5};
34 
43 
44  static const std::string algoNames[];
45 
46  // Default constructor
47  Conversion();
48 
50  const std::vector<edm::RefToBase<reco::Track> > tr,
51  const std::vector<math::XYZPointF> trackPositionAtEcal ,
52  const reco::Vertex & convVtx,
53  const std::vector<reco::CaloClusterPtr> & matchingBC,
54  const float DCA,
55  const std::vector<math::XYZPointF> & innPoint,
56  const std::vector<math::XYZVectorF> & trackPin ,
57  const std::vector<math::XYZVectorF> & trackPout,
58  const std::vector<uint8_t> nHitsBeforeVtx,
59  const std::vector<Measurement1DFloat> & dlClosestHitToVtx,
60  uint8_t nSharedHits,
61  const float mva,
63 
64 
66  const std::vector<reco::TrackRef> tr,
67  const std::vector<math::XYZPointF> trackPositionAtEcal ,
68  const reco::Vertex & convVtx,
69  const std::vector<reco::CaloClusterPtr> & matchingBC,
70  const float DCA,
71  const std::vector<math::XYZPointF> & innPoint,
72  const std::vector<math::XYZVectorF> & trackPin ,
73  const std::vector<math::XYZVectorF> & trackPout,
74  const float mva,
76 
77 
78 
79 
81  const std::vector<reco::TrackRef> tr,
82  const reco::Vertex & convVtx,
84 
86  const std::vector<edm::RefToBase<reco::Track> > tr,
87  const reco::Vertex & convVtx,
89 
90 
91 
93  virtual ~Conversion();
95  Conversion * clone() const;
99  std::vector<edm::RefToBase<reco::Track> > tracks() const ;
103  bool isConverted() const;
105  unsigned int nTracks() const {return tracks().size(); }
107  double MVAout() const { return theMVAout_;}
109  std::vector<float> const oneLegMVA() {return theOneLegMVA_;}
111  double pairInvariantMass() const;
113  double pairCotThetaSeparation() const;
123  double EoverP() const;
127  double EoverPrefittedTracks() const;
128  // Dist of minimum approach between tracks
130  // deltaPhi tracks at innermost point
131  double dPhiTracksAtVtx() const;
132  // deltaPhi tracks at ECAl
133  double dPhiTracksAtEcal() const;
134  // deltaEta tracks at ECAl
135  double dEtaTracksAtEcal() const;
136 
137  //impact parameter and decay length computed with respect to given beamspot or vertex
138  //computed from refittedPairMomentum
139 
140  //transverse impact parameter
141  double dxy(const math::XYZPoint& myBeamSpot = math::XYZPoint()) const;
142  //longitudinal impact parameter
143  double dz(const math::XYZPoint& myBeamSpot = math::XYZPoint()) const;
144  //transverse decay length
145  double lxy(const math::XYZPoint& myBeamSpot = math::XYZPoint()) const;
146  //longitudinal decay length
147  double lz(const math::XYZPoint& myBeamSpot = math::XYZPoint()) const;
148  //z position of intersection with beamspot in rz plane (possible tilt of beamspot is neglected)
149  double zOfPrimaryVertexFromTracks(const math::XYZPoint& myBeamSpot = math::XYZPoint()) const { return dz(myBeamSpot) + myBeamSpot.z(); }
150 
153  const std::vector<math::XYZPointF> & ecalImpactPosition() const {return thePositionAtEcal_;}
154  // pair of BC matching a posteriori the tracks
155  const std::vector<reco::CaloClusterPtr>& bcMatchingWithTracks() const { return theMatchingBCs_;}
157  std::vector<double> tracksSigned_d0() const ;
159  const std::vector<math::XYZPointF>& tracksInnerPosition() const {return theTrackInnerPosition_;}
161  const std::vector<math::XYZVectorF>& tracksPout() const {return theTrackPout_;}
163  const std::vector<math::XYZVectorF>& tracksPin() const {return theTrackPin_;}
165  const std::vector<uint8_t> &nHitsBeforeVtx() const { return nHitsBeforeVtx_; }
167  const std::vector<Measurement1DFloat> &dlClosestHitToVtx() const { return dlClosestHitToVtx_; }
169  uint8_t nSharedHits() const { return nSharedHits_; }
170 
171 
173  void setMVAout(const float& mva) { theMVAout_=mva;}
175  void setOneLegMVA(const std::vector<float>& mva) { theOneLegMVA_=mva;}
176  // Set the ptr to the Super cluster if not set in the constructor
180  ConversionAlgorithm algo() const ;
181  std::string algoName() const;
182  static std::string algoName(ConversionAlgorithm );
183  static ConversionAlgorithm algoByName(const std::string &name);
184 
185  bool quality(ConversionQuality q) const { return (qualityMask_ & (1<<q))>>q; }
186  void setQuality(ConversionQuality q, bool b);
187 
188 
189 
190  private:
191 
195  std::vector<reco::TrackRef> tracks_;
197  mutable std::vector<edm::RefToBase<reco::Track> > trackToBaseRefs_;
199  std::vector<math::XYZPointF> thePositionAtEcal_;
203  std::vector<reco::CaloClusterPtr> theMatchingBCs_;
207  std::vector<math::XYZPointF> theTrackInnerPosition_;
209  std::vector<math::XYZVectorF> theTrackPin_;
211  std::vector<math::XYZVectorF> theTrackPout_;
213  std::vector<uint8_t> nHitsBeforeVtx_;
215  std::vector<Measurement1DFloat> dlClosestHitToVtx_;
217  uint8_t nSharedHits_;
219  float theMVAout_;
221  std::vector<float> theOneLegMVA_;
223  uint8_t algorithm_;
224  uint16_t qualityMask_;
225 
226 
227  };
228 
231  }
232 
233 
234  inline std::string Conversion::algoName() const{
235 
236  switch(algorithm_)
237  {
238  case undefined: return "undefined";
239  case ecalSeeded: return "ecalSeeded";
240  case trackerOnly: return "trackerOnly";
241  case mixed: return "mixed";
242  case pflow: return "pflow";
243 
244  }
245  return "undefined";
246  }
247 
249  if(int(a) < int(algoSize) && int(a)>0) return algoNames[int(a)];
250  return "undefined";
251  }
252 
254  if (b)//regular OR if setting value to true
255  qualityMask_ |= (1<<q) ;
256  else // doing "half-XOR" if unsetting value
257  qualityMask_ &= (~(1<<q));
258 
259  }
260 
261 }
262 
263 #endif
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
Definition: Conversion.h:101
static const std::string algoNames[]
Definition: Conversion.h:44
std::vector< math::XYZVectorF > theTrackPout_
P_out of tracks.
Definition: Conversion.h:211
ConversionAlgorithm algo() const
Definition: Conversion.h:229
bool quality(ConversionQuality q) const
Definition: Conversion.h:185
void setQuality(ConversionQuality q, bool b)
Definition: Conversion.h:253
double EoverP() const
Definition: Conversion.cc:273
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:167
reco::CaloClusterPtrVector caloCluster_
vector pointer to a/multiple seed CaloCluster(s)
Definition: Conversion.h:193
double zOfPrimaryVertexFromTracks(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.h:149
double distOfMinimumApproach() const
Definition: Conversion.h:129
std::vector< double > tracksSigned_d0() const
signed transverse impact parameter for each track
Definition: Conversion.cc:317
double lxy(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.cc:407
static ConversionAlgorithm algoByName(const std::string &name)
Definition: Conversion.cc:167
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:223
void setConversionAlgorithm(const ConversionAlgorithm a, bool set=true)
Conversion Track algorithm/provenance.
Definition: Conversion.h:179
double pairInvariantMass() const
if nTracks=2 returns the pair invariant mass. Original tracks are used here
Definition: Conversion.cc:204
math::XYZVectorF refittedPairMomentum() const
Conversion tracks momentum from the tracks refitted with vertex constraint.
Definition: Conversion.cc:262
uint8_t nSharedHits_
number of shared hits between tracks
Definition: Conversion.h:217
double EoverPrefittedTracks() const
Definition: Conversion.cc:295
std::vector< edm::RefToBase< reco::Track > > tracks() const
vector of track to base references
Definition: Conversion.cc:180
const std::vector< math::XYZVectorF > & tracksPout() const
Vector of track momentum measured at the outermost hit.
Definition: Conversion.h:161
double MVAout() const
get the value of the TMVA output
Definition: Conversion.h:107
virtual ~Conversion()
destructor
Definition: Conversion.cc:162
uint16_t qualityMask_
Definition: Conversion.h:224
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:18
const std::vector< reco::CaloClusterPtr > & bcMatchingWithTracks() const
Definition: Conversion.h:155
std::vector< float > theOneLegMVA_
vectors of TMVA outputs from pflow for one leg conversions
Definition: Conversion.h:221
std::string algoName() const
Definition: Conversion.h:234
std::vector< math::XYZPointF > theTrackInnerPosition_
P_in of tracks.
Definition: Conversion.h:207
std::vector< float > const oneLegMVA()
get the MVS output from PF for one leg conversions
Definition: Conversion.h:109
unsigned int nTracks() const
Number of tracks= 0,1,2.
Definition: Conversion.h:105
Conversion * clone() const
returns a clone of the candidate
Definition: Conversion.cc:175
math::XYZTLorentzVectorF refittedPair4Momentum() const
Conversion track pair 4-momentum from the tracks refitted with vertex constraint. ...
Definition: Conversion.cc:249
const std::vector< math::XYZVectorF > & tracksPin() const
Vector of track momentum measured at the innermost hit.
Definition: Conversion.h:163
uint8_t algorithm_
conversion algorithm/provenance
Definition: Conversion.h:223
const std::vector< math::XYZPointF > & tracksInnerPosition() const
Vector containing the position of the innermost hit of each track.
Definition: Conversion.h:159
math::XYZVectorF pairMomentum() const
Conversion tracks momentum from the tracks inner momentum.
Definition: Conversion.cc:237
const std::vector< math::XYZPointF > & ecalImpactPosition() const
Definition: Conversion.h:153
uint8_t nSharedHits() const
number of shared hits btw the two track
Definition: Conversion.h:169
double dEtaTracksAtEcal() const
Definition: Conversion.cc:366
double dz(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.cc:395
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
std::vector< math::XYZVectorF > theTrackPin_
P_in of tracks.
Definition: Conversion.h:209
float theMVAout_
TMVA output.
Definition: Conversion.h:219
double b
Definition: hdecay.h:120
std::vector< reco::CaloClusterPtr > theMatchingBCs_
Clusters mathing the tracks (these are not the seeds)
Definition: Conversion.h:203
double lz(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.cc:421
void setMVAout(const float &mva)
set the value of the TMVA output
Definition: Conversion.h:173
std::vector< reco::TrackRef > tracks_
vector of Track references
Definition: Conversion.h:195
float theMinDistOfApproach_
Distance of min approach of the two tracks.
Definition: Conversion.h:205
std::vector< math::XYZPointF > thePositionAtEcal_
position at the ECAl surface of the track extrapolation
Definition: Conversion.h:199
void setOneLegMVA(const std::vector< float > &mva)
set the MVS output from PF for one leg conversions
Definition: Conversion.h:175
double a
Definition: hdecay.h:121
std::vector< edm::RefToBase< reco::Track > > trackToBaseRefs_
vector Track RefToBase
Definition: Conversion.h:197
const std::vector< uint8_t > & nHitsBeforeVtx() const
Vector of the number of hits before the vertex along each track trajector.
Definition: Conversion.h:165
std::vector< Measurement1DFloat > dlClosestHitToVtx_
signed decay length and uncertainty from nearest hit on track to conversion vertex ...
Definition: Conversion.h:215
double dPhiTracksAtEcal() const
Definition: Conversion.cc:341
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > XYZTLorentzVectorF
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:23
reco::Vertex theConversionVertex_
Fitted Kalman conversion vertex.
Definition: Conversion.h:201
bool isConverted() const
Bool flagging objects having track size &gt;0.
Definition: Conversion.cc:196
std::vector< uint8_t > nHitsBeforeVtx_
number of hits before the vertex on each trackerOnly
Definition: Conversion.h:213
reco::CaloClusterPtrVector caloCluster() const
Pointer to CaloCluster (foe Egamma Conversions it points to a SuperCluster)
Definition: Conversion.h:97
void setMatchingSuperCluster(const reco::CaloClusterPtrVector &sc)
Definition: Conversion.h:177
double dPhiTracksAtVtx() const
Definition: Conversion.cc:328
double dxy(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.cc:383
void set(const std::string &name, int value)
set the flag, with a run-time name