CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TICLCandidate.h
Go to the documentation of this file.
1 #ifndef DataFormats_HGCalReco_TICLCandidate_h
2 #define DataFormats_HGCalReco_TICLCandidate_h
3 
10 
11 // A TICLCandidate is a lightweight physics object made from one or multiple Tracksters.
12 
14 public:
16 
18  : LeafCandidate(q, p4), time_(0.f), timeError_(-1.f), rawEnergy_(0.f), idProbabilities_{} {}
19 
21 
23  : LeafCandidate(),
24  time_(trackster->time()),
25  timeError_(trackster->timeError()),
26  rawEnergy_(0.f),
27  tracksters_({trackster}),
29 
30  inline float time() const { return time_; }
31  inline float timeError() const { return timeError_; }
32 
33  void setTime(float time) { time_ = time; };
34  void setTimeError(float timeError) { timeError_ = timeError; }
35 
36  inline const edm::Ptr<reco::Track> trackPtr() const { return trackPtr_; }
38 
39  inline float rawEnergy() const { return rawEnergy_; }
41 
42  inline const std::vector<edm::Ptr<ticl::Trackster> > tracksters() const { return tracksters_; };
43 
45  void addTrackster(const edm::Ptr<ticl::Trackster>& trackster) {
46  tracksters_.push_back(trackster);
47  time_ = trackster->time();
48  timeError_ = trackster->timeError();
49  }
50  // convenience method to return the ID probability for a certain particle type
51  inline float id_probability(ParticleType type) const {
52  // probabilities are stored in the same order as defined in the ParticleType enum
53  return idProbabilities_[(int)type];
54  }
55 
56  void setIdProbabilities(const std::array<float, 8>& idProbs) { idProbabilities_ = idProbs; }
57 
58 private:
59  float time_;
60  float timeError_;
62 
63  float rawEnergy_;
64 
65  // vector of Ptr so Tracksters can come from different collections
66  // and there can be derived classes
67  std::vector<edm::Ptr<ticl::Trackster> > tracksters_;
68 
69  // Since it contains multiple tracksters, duplicate the probability interface
70  std::array<float, 8> idProbabilities_;
71 };
72 #endif
void setIdProbabilities(const std::array< float, 8 > &idProbs)
Definition: TICLCandidate.h:56
int Charge
electric charge type
Definition: Candidate.h:34
void setTracksters(const std::vector< edm::Ptr< ticl::Trackster > > &tracksters)
Definition: TICLCandidate.h:44
float rawEnergy() const
Definition: TICLCandidate.h:39
std::vector< edm::Ptr< ticl::Trackster > > tracksters_
Definition: TICLCandidate.h:67
void setTimeError(float timeError)
Definition: TICLCandidate.h:34
edm::Ptr< reco::Track > trackPtr_
Definition: TICLCandidate.h:61
const LorentzVector & p4() const final
four-momentum Lorentz vector
float id_probability(ParticleType type) const
Definition: TICLCandidate.h:51
const std::vector< edm::Ptr< ticl::Trackster > > tracksters() const
Definition: TICLCandidate.h:42
void setRawEnergy(float rawEnergy)
Definition: TICLCandidate.h:40
std::array< float, 8 > idProbabilities_
Definition: TICLCandidate.h:70
ticl::Trackster::ParticleType ParticleType
Definition: TICLCandidate.h:15
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
const edm::Ptr< reco::Track > trackPtr() const
Definition: TICLCandidate.h:36
void addTrackster(const edm::Ptr< ticl::Trackster > &trackster)
Definition: TICLCandidate.h:45
TICLCandidate(Charge q, const LorentzVector &p4)
Definition: TICLCandidate.h:17
void setTrackPtr(const edm::Ptr< reco::Track > &trackPtr)
Definition: TICLCandidate.h:37
TICLCandidate(const edm::Ptr< ticl::Trackster > &trackster)
Definition: TICLCandidate.h:22