CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PackedGenParticle.cc
Go to the documentation of this file.
4 
5 
6 
7 void pat::PackedGenParticle::pack(bool unpackAfterwards) {
9  packedEta_ = int16_t(p4_.Eta()/6.0f*std::numeric_limits<int16_t>::max());
10  packedPhi_ = int16_t(p4_.Phi()/3.2f*std::numeric_limits<int16_t>::max());
12  if (unpackAfterwards) unpack(); // force the values to match with the packed ones
13 }
14 
15 
18  int16_t(packedEta_)*6.0f/std::numeric_limits<int16_t>::max(),
19  int16_t(packedPhi_)*3.2f/std::numeric_limits<int16_t>::max(),
21  p4c_ = p4_;
22  unpacked_ = true;
23 }
24 
26 
27 
28 float pat::PackedGenParticle::dxy(const Point &p) const {
29  unpack();
30  return -(vertex_.X()-p.X()) * std::sin(float(p4_.Phi())) + (vertex_.Y()-p.Y()) * std::cos(float(p4_.Phi()));
31 }
32 float pat::PackedGenParticle::dz(const Point &p) const {
33  unpack();
34  return (vertex_.Z()-p.X()) - ((vertex_.X()-p.X()) * std::cos(float(p4_.Phi())) + (vertex_.Y()-p.Y()) * std::sin(float(p4_.Phi()))) * p4_.Pz()/p4_.Pt();
35 }
36 
37 
39 
42 }
43 
46 }
47 
49  return iterator( new iterator_imp_specific );
50 }
51 
53  return iterator( new iterator_imp_specific );
54 }
55 
57  throw cms::Exception("Invalid Reference")
58  << "this Candidate has no master clone reference."
59  << "Can't call masterClone() method.\n";
60 }
61 
63  return false;
64 }
65 
67  return false;
68 }
69 
70 
72  throw cms::Exception("Invalid Reference")
73  << "this Candidate has no master clone ptr."
74  << "Can't call masterClonePtr() method.\n";
75 }
76 
78  return 0;
79 }
80 
82  return 0;
83 }
84 
86  return p4() == o.p4() && vertex() == o.vertex() && charge() == o.charge();
87 // return p4() == o.p4() && charge() == o.charge();
88 }
89 
91  return 0;
92 }
93 
95  return mother_.get();
96 }
97 
100  << "This Candidate type does not implement daughter(std::string). "
101  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
102 }
103 
106  << "This Candidate type does not implement daughter(std::string). "
107  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
108 }
109 
110 
111 
113  return 0;
114 }
115 
117  return 0;
118 }
119 
121  return 0;
122 }
123 
125  return 0;
126 }
127 
130  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
131 }
132 
135  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
136 }
137 
138 bool pat::PackedGenParticle::isElectron() const { return false; }
139 
140 bool pat::PackedGenParticle::isMuon() const { return false; }
141 
142 bool pat::PackedGenParticle::isGlobalMuon() const { return false; }
143 
144 bool pat::PackedGenParticle::isStandAloneMuon() const { return false; }
145 
146 bool pat::PackedGenParticle::isTrackerMuon() const { return false; }
147 
148 bool pat::PackedGenParticle::isCaloMuon() const { return false; }
149 
150 bool pat::PackedGenParticle::isPhoton() const { return false; }
151 
152 bool pat::PackedGenParticle::isConvertedPhoton() const { return false; }
153 
154 bool pat::PackedGenParticle::isJet() const { return false; }
155 
156 bool pat::PackedGenParticle::longLived() const {return false;}
157 
158 bool pat::PackedGenParticle::massConstraint() const {return false;}
159 
160 
161 
162 
int i
Definition: DBlmapReader.cc:9
virtual void fillVertexCovariance(CovarianceMatrix &v) const
fill SMatrix
CovarianceMatrix vertexCovariance() const
return SMatrix
virtual size_t numberOfMothers() const
number of mothers
size_t size_type
Definition: Candidate.h:34
virtual double vertexNdof() const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
virtual bool isTrackerMuon() const
virtual bool isJet() const
virtual ~PackedGenParticle()
destructor
virtual const reco::Candidate * daughter(size_type) const
return daughter at a given position (throws an exception)
virtual bool isElectron() const
get a component
virtual bool isPhoton() const
static float float16to32(uint16_t h)
Definition: libminifloat.h:10
double charge(const std::vector< uint8_t > &Ampls)
PolarLorentzVector p4_
the four vector
void pack(bool unpackAfterwards=true)
virtual double vertexNormalizedChi2() const
chi-squared divided by n.d.o.f.
const T & max(const T &a, const T &b)
virtual bool isMuon() const
virtual bool longLived() const
is long lived?
double p4[4]
Definition: TauolaWrapper.h:92
static uint16_t float32to16(float x)
Definition: libminifloat.h:15
virtual const reco::CandidateBaseRef & masterClone() const
virtual double vertexChi2() const
chi-squares
virtual size_t numberOfDaughters() const
number of daughters
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
virtual bool isStandAloneMuon() const
int j
Definition: DBlmapReader.cc:9
virtual const reco::CandidatePtr & masterClonePtr() const
virtual const_iterator end() const
last daughter const_iterator
double f[11][100]
virtual const Point & vertex() const =0
vertex position
virtual int charge() const =0
electric charge
virtual bool hasMasterClonePtr() const
virtual bool overlap(const reco::Candidate &) const
check overlap with another Candidate
virtual bool hasMasterClone() const
virtual bool isCaloMuon() const
virtual bool isGlobalMuon() const
virtual const reco::Candidate * mother(size_type) const
return mother at a given position (throws an exception)
virtual bool isConvertedPhoton() const
virtual const_iterator begin() const
first daughter const_iterator
T get() const
get a component
Definition: Candidate.h:219
math::XYZPoint Point
point in the space
Definition: Candidate.h:45
virtual bool massConstraint() const
do mass constraint?
virtual float dz() const
dz with respect to the PV ref
virtual float dxy() const
dxy with respect to the PV ref
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:43