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 namespace reco {
23  class Conversion {
24  public:
25  enum ConversionAlgorithm { undefined = 0, ecalSeeded = 1, trackerOnly = 2, mixed = 3, pflow = 4, algoSize = 5 };
26 
37  };
38 
39  static const std::string algoNames[];
40 
41  // Default constructor
42  Conversion();
43 
46  const std::vector<math::XYZPointF>& trackPositionAtEcal,
47  const reco::Vertex& convVtx,
48  const std::vector<reco::CaloClusterPtr>& matchingBC,
49  const float DCA,
50  const std::vector<math::XYZPointF>& innPoint,
51  const std::vector<math::XYZVectorF>& trackPin,
52  const std::vector<math::XYZVectorF>& trackPout,
53  const std::vector<uint8_t>& nHitsBeforeVtx,
54  const std::vector<Measurement1DFloat>& dlClosestHitToVtx,
55  uint8_t nSharedHits,
56  const float mva,
58 
60  const std::vector<reco::TrackRef>& tr,
61  const std::vector<math::XYZPointF>& trackPositionAtEcal,
62  const reco::Vertex& convVtx,
63  const std::vector<reco::CaloClusterPtr>& matchingBC,
64  const float DCA,
65  const std::vector<math::XYZPointF>& innPoint,
66  const std::vector<math::XYZVectorF>& trackPin,
67  const std::vector<math::XYZVectorF>& trackPout,
68  const float mva,
70 
72  const std::vector<reco::TrackRef>& tr,
73  const reco::Vertex& convVtx,
75 
78  const reco::Vertex& convVtx,
80 
82  Conversion* clone() const;
86  std::vector<edm::RefToBase<reco::Track> > const& tracks() const;
90  bool isConverted() const;
92  unsigned int nTracks() const { return tracks().size(); }
94  double MVAout() const { return theMVAout_; }
96  std::vector<float> const oneLegMVA() { return theOneLegMVA_; }
98  double pairInvariantMass() const;
100  double pairCotThetaSeparation() const;
110  double EoverP() const;
114  double EoverPrefittedTracks() const;
115  // Dist of minimum approach between tracks
116  double distOfMinimumApproach() const { return theMinDistOfApproach_; }
117  // deltaPhi tracks at innermost point
118  double dPhiTracksAtVtx() const;
119  // deltaPhi tracks at ECAl
120  double dPhiTracksAtEcal() const;
121  // deltaEta tracks at ECAl
122  double dEtaTracksAtEcal() const;
123 
124  //impact parameter and decay length computed with respect to given beamspot or vertex
125  //computed from refittedPairMomentum
126 
127  //transverse impact parameter
128  double dxy(const math::XYZPoint& myBeamSpot = math::XYZPoint()) const;
129  //longitudinal impact parameter
130  double dz(const math::XYZPoint& myBeamSpot = math::XYZPoint()) const;
131  //transverse decay length
132  double lxy(const math::XYZPoint& myBeamSpot = math::XYZPoint()) const;
133  //longitudinal decay length
134  double lz(const math::XYZPoint& myBeamSpot = math::XYZPoint()) const;
135  //z position of intersection with beamspot in rz plane (possible tilt of beamspot is neglected)
136  double zOfPrimaryVertexFromTracks(const math::XYZPoint& myBeamSpot = math::XYZPoint()) const {
137  return dz(myBeamSpot) + myBeamSpot.z();
138  }
139 
142  const std::vector<math::XYZPointF>& ecalImpactPosition() const { return thePositionAtEcal_; }
143  // pair of BC matching a posteriori the tracks
144  const std::vector<reco::CaloClusterPtr>& bcMatchingWithTracks() const { return theMatchingBCs_; }
146  std::vector<double> tracksSigned_d0() const;
148  const std::vector<math::XYZPointF>& tracksInnerPosition() const { return theTrackInnerPosition_; }
150  const std::vector<math::XYZVectorF>& tracksPout() const { return theTrackPout_; }
152  const std::vector<math::XYZVectorF>& tracksPin() const { return theTrackPin_; }
154  const std::vector<uint8_t>& nHitsBeforeVtx() const { return nHitsBeforeVtx_; }
156  const std::vector<Measurement1DFloat>& dlClosestHitToVtx() const { return dlClosestHitToVtx_; }
158  uint8_t nSharedHits() const { return nSharedHits_; }
159 
161  void setMVAout(const float& mva) { theMVAout_ = mva; }
163  void setOneLegMVA(const std::vector<float>& mva) { theOneLegMVA_ = mva; }
164  // Set the ptr to the Super cluster if not set in the constructor
167  void setConversionAlgorithm(const ConversionAlgorithm a, bool set = true) {
168  if (set)
169  algorithm_ = a;
170  else
172  }
173  ConversionAlgorithm algo() const;
174  std::string algoName() const;
177 
178  bool quality(ConversionQuality q) const { return (qualityMask_ & (1 << q)) >> q; }
179  void setQuality(ConversionQuality q, bool b);
180 
181  private:
185  std::vector<edm::RefToBase<reco::Track> > trackToBaseRefs_;
187  std::vector<math::XYZPointF> thePositionAtEcal_;
191  std::vector<reco::CaloClusterPtr> theMatchingBCs_;
193  std::vector<math::XYZPointF> theTrackInnerPosition_;
195  std::vector<math::XYZVectorF> theTrackPin_;
197  std::vector<math::XYZVectorF> theTrackPout_;
199  std::vector<uint8_t> nHitsBeforeVtx_;
201  std::vector<Measurement1DFloat> dlClosestHitToVtx_;
203  std::vector<float> theOneLegMVA_;
207  float theMVAout_;
208  uint16_t qualityMask_;
210  uint8_t nSharedHits_;
212  uint8_t algorithm_;
213  };
214 
216 
218  switch (algorithm_) {
219  case undefined:
220  return "undefined";
221  case ecalSeeded:
222  return "ecalSeeded";
223  case trackerOnly:
224  return "trackerOnly";
225  case mixed:
226  return "mixed";
227  case pflow:
228  return "pflow";
229  }
230  return "undefined";
231  }
232 
234  if (int(a) < int(algoSize) && int(a) > 0)
235  return algoNames[int(a)];
236  return "undefined";
237  }
238 
240  if (b) //regular OR if setting value to true
241  qualityMask_ |= (1 << q);
242  else // doing "half-XOR" if unsetting value
243  qualityMask_ &= (~(1 << q));
244  }
245 
246 } // namespace reco
247 
248 #endif
reco::Conversion::dPhiTracksAtVtx
double dPhiTracksAtVtx() const
Definition: Conversion.cc:255
reco::Conversion::mixed
Definition: Conversion.h:25
reco::Conversion::pairCotThetaSeparation
double pairCotThetaSeparation() const
Delta cot(Theta) where Theta is the angle in the (y,z) plane between the two tracks....
Definition: Conversion.cc:179
reco::Conversion::algoNames
static const std::string algoNames[]
Definition: Conversion.h:39
reco::Conversion::setQuality
void setQuality(ConversionQuality q, bool b)
Definition: Conversion.h:239
reco::Conversion
Definition: Conversion.h:23
reco::Conversion::MVAout
double MVAout() const
get the value of the TMVA output
Definition: Conversion.h:94
reco::Conversion::nHitsBeforeVtx_
std::vector< uint8_t > nHitsBeforeVtx_
number of hits before the vertex on each trackerOnly
Definition: Conversion.h:199
reco::Conversion::generalTracksOnly
Definition: Conversion.h:28
reco::Conversion::tracksPin
const std::vector< math::XYZVectorF > & tracksPin() const
Vector of track momentum measured at the innermost hit.
Definition: Conversion.h:152
reco::Conversion::trackerOnly
Definition: Conversion.h:25
reco::Conversion::nTracks
unsigned int nTracks() const
Number of tracks= 0,1,2.
Definition: Conversion.h:92
reco::Conversion::tracks
std::vector< edm::RefToBase< reco::Track > > const & tracks() const
vector of track to base references
Definition: Conversion.cc:150
reco::Conversion::dz
double dz(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.cc:324
reco::Conversion::theTrackInnerPosition_
std::vector< math::XYZPointF > theTrackInnerPosition_
P_in of tracks.
Definition: Conversion.h:193
reco::Conversion::ecalSeeded
Definition: Conversion.h:25
reco::Conversion::gsfTracksOpenOnly
Definition: Conversion.h:32
math::XYZTLorentzVectorF
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > XYZTLorentzVectorF
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:22
reco::Conversion::algorithm_
uint8_t algorithm_
conversion algorithm/provenance
Definition: Conversion.h:212
reco::Conversion::dPhiTracksAtEcal
double dPhiTracksAtEcal() const
Definition: Conversion.cc:270
reco::Conversion::lz
double lz(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.cc:350
reco::Conversion::pairInvariantMass
double pairInvariantMass() const
if nTracks=2 returns the pair invariant mass. Original tracks are used here
Definition: Conversion.cc:159
reco::Conversion::zOfPrimaryVertexFromTracks
double zOfPrimaryVertexFromTracks(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.h:136
reco::Conversion::dlClosestHitToVtx
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:156
reco::Conversion::tracksSigned_d0
std::vector< double > tracksSigned_d0() const
signed transverse impact parameter for each track
Definition: Conversion.cc:245
reco::Conversion::trackToBaseRefs_
std::vector< edm::RefToBase< reco::Track > > trackToBaseRefs_
vector Track RefToBase
Definition: Conversion.h:185
Measurement1DFloat.h
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
reco::Conversion::thePositionAtEcal_
std::vector< math::XYZPointF > thePositionAtEcal_
position at the ECAl surface of the track extrapolation
Definition: Conversion.h:187
beam_dqm_sourceclient-live_cfg.mva
mva
Definition: beam_dqm_sourceclient-live_cfg.py:132
reco::Conversion::theMatchingBCs_
std::vector< reco::CaloClusterPtr > theMatchingBCs_
Clusters mathing the tracks (these are not the seeds)
Definition: Conversion.h:191
reco::Conversion::theTrackPout_
std::vector< math::XYZVectorF > theTrackPout_
P_out of tracks.
Definition: Conversion.h:197
reco::Conversion::refittedPair4Momentum
math::XYZTLorentzVectorF refittedPair4Momentum() const
Conversion track pair 4-momentum from the tracks refitted with vertex constraint.
Definition: Conversion.cc:198
reco::Conversion::undefined
Definition: Conversion.h:25
reco::Conversion::theMVAout_
float theMVAout_
TMVA output.
Definition: Conversion.h:207
reco::Conversion::lxy
double lxy(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.cc:337
reco::Conversion::setMVAout
void setMVAout(const float &mva)
set the value of the TMVA output
Definition: Conversion.h:161
reco::Conversion::dlClosestHitToVtx_
std::vector< Measurement1DFloat > dlClosestHitToVtx_
signed decay length and uncertainty from nearest hit on track to conversion vertex
Definition: Conversion.h:201
reco::Conversion::refittedPairMomentum
math::XYZVectorF refittedPairMomentum() const
Conversion tracks momentum from the tracks refitted with vertex constraint.
Definition: Conversion.cc:206
reco::Conversion::arbitratedMerged
Definition: Conversion.h:30
reco::Conversion::pairMomentum
math::XYZVectorF pairMomentum() const
Conversion tracks momentum from the tracks inner momentum.
Definition: Conversion.cc:191
TrackFwd.h
reco::Conversion::qualityMask_
uint16_t qualityMask_
Definition: Conversion.h:208
reco::Conversion::nHitsBeforeVtx
const std::vector< uint8_t > & nHitsBeforeVtx() const
Vector of the number of hits before the vertex along each track trajector.
Definition: Conversion.h:154
reco::Conversion::arbitratedEcalSeeded
Definition: Conversion.h:29
edm::PtrVector< CaloCluster >
reco::Conversion::bcMatchingWithTracks
const std::vector< reco::CaloClusterPtr > & bcMatchingWithTracks() const
Definition: Conversion.h:144
reco::Conversion::caloCluster_
reco::CaloClusterPtrVector caloCluster_
vector pointer to a/multiple seed CaloCluster(s)
Definition: Conversion.h:183
reco::Conversion::ecalMatched1Track
Definition: Conversion.h:35
reco::Conversion::setMatchingSuperCluster
void setMatchingSuperCluster(const reco::CaloClusterPtrVector &sc)
Definition: Conversion.h:165
CaloClusterFwd.h
b
double b
Definition: hdecay.h:118
reco::Conversion::caloCluster
reco::CaloClusterPtrVector caloCluster() const
Pointer to CaloCluster (foe Egamma Conversions it points to a SuperCluster)
Definition: Conversion.h:84
reco::Conversion::isConverted
bool isConverted() const
Bool flagging objects having track size >0.
Definition: Conversion.cc:152
reco::Conversion::Conversion
Conversion()
Definition: Conversion.cc:121
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
a
double a
Definition: hdecay.h:119
reco::Conversion::quality
bool quality(ConversionQuality q) const
Definition: Conversion.h:178
reco::Conversion::theTrackPin_
std::vector< math::XYZVectorF > theTrackPin_
P_in of tracks.
Definition: Conversion.h:195
reco::Conversion::conversionVertex
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
Definition: Conversion.h:88
pflow
Definition: TrackFromParentImporter.h:10
reco::Conversion::ecalImpactPosition
const std::vector< math::XYZPointF > & ecalImpactPosition() const
Definition: Conversion.h:142
reco::Conversion::dxy
double dxy(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.cc:313
reco::Conversion::theMinDistOfApproach_
float theMinDistOfApproach_
Distance of min approach of the two tracks.
Definition: Conversion.h:205
reco::Conversion::highPurity
Definition: Conversion.h:33
createfilelist.int
int
Definition: createfilelist.py:10
reco::Conversion::distOfMinimumApproach
double distOfMinimumApproach() const
Definition: Conversion.h:116
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
reco::Conversion::highEfficiency
Definition: Conversion.h:34
reco::Conversion::setOneLegMVA
void setOneLegMVA(const std::vector< float > &mva)
set the MVS output from PF for one leg conversions
Definition: Conversion.h:163
reco::Conversion::clone
Conversion * clone() const
returns a clone of the candidate
Definition: Conversion.cc:148
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
reco::Conversion::EoverP
double EoverP() const
Definition: Conversion.cc:213
reco::Conversion::theConversionVertex_
reco::Vertex theConversionVertex_
Fitted Kalman conversion vertex.
Definition: Conversion.h:189
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
reco::Conversion::ConversionAlgorithm
ConversionAlgorithm
Definition: Conversion.h:25
reco::Conversion::nSharedHits
uint8_t nSharedHits() const
number of shared hits btw the two track
Definition: Conversion.h:158
reco::Conversion::oneLegMVA
const std::vector< float > oneLegMVA()
get the MVS output from PF for one leg conversions
Definition: Conversion.h:96
reco::Conversion::algoByName
static ConversionAlgorithm algoByName(const std::string &name)
Definition: Conversion.cc:139
reco::Conversion::EoverPrefittedTracks
double EoverPrefittedTracks() const
Definition: Conversion.cc:229
Vertex.h
math::XYZVectorF
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:16
reco::Conversion::arbitratedMergedEcalGeneral
Definition: Conversion.h:31
Point3D.h
GlobalVector.h
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::RefToBase< reco::Track >
reco::Conversion::setConversionAlgorithm
void setConversionAlgorithm(const ConversionAlgorithm a, bool set=true)
Conversion Track algorithm/provenance.
Definition: Conversion.h:167
reco::Conversion::algoSize
Definition: Conversion.h:25
reco::Conversion::algo
ConversionAlgorithm algo() const
Definition: Conversion.h:215
reco::Conversion::nSharedHits_
uint8_t nSharedHits_
number of shared hits between tracks
Definition: Conversion.h:210
reco::Conversion::dEtaTracksAtEcal
double dEtaTracksAtEcal() const
Definition: Conversion.cc:303
GlobalPoint.h
reco::Conversion::ConversionQuality
ConversionQuality
Definition: Conversion.h:27
reco::Conversion::tracksPout
const std::vector< math::XYZVectorF > & tracksPout() const
Vector of track momentum measured at the outermost hit.
Definition: Conversion.h:150
reco::Vertex
Definition: Vertex.h:35
reco::Conversion::ecalMatched2Track
Definition: Conversion.h:36
reco::Conversion::pflow
Definition: Conversion.h:25
CaloCluster.h
reco::Conversion::theOneLegMVA_
std::vector< float > theOneLegMVA_
vectors of TMVA outputs from pflow for one leg conversions
Definition: Conversion.h:203
reco::Conversion::tracksInnerPosition
const std::vector< math::XYZPointF > & tracksInnerPosition() const
Vector containing the position of the innermost hit of each track.
Definition: Conversion.h:148
reco::Conversion::algoName
std::string algoName() const
Definition: Conversion.h:217