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  if(mother_.isNonnull()) return 1;
83  return 0;
84 }
85 
87  return p4() == o.p4() && vertex() == o.vertex() && charge() == o.charge();
88 // return p4() == o.p4() && charge() == o.charge();
89 }
90 
92  return 0;
93 }
94 
96  return mother_.get();
97 }
98 
101  << "This Candidate type does not implement daughter(std::string). "
102  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
103 }
104 
107  << "This Candidate type does not implement daughter(std::string). "
108  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
109 }
110 
111 
112 
114  return 0;
115 }
116 
118  return 0;
119 }
120 
122  return 0;
123 }
124 
126  return 0;
127 }
128 
131  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
132 }
133 
136  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
137 }
138 
139 bool pat::PackedGenParticle::isElectron() const { return false; }
140 
141 bool pat::PackedGenParticle::isMuon() const { return false; }
142 
143 bool pat::PackedGenParticle::isGlobalMuon() const { return false; }
144 
145 bool pat::PackedGenParticle::isStandAloneMuon() const { return false; }
146 
147 bool pat::PackedGenParticle::isTrackerMuon() const { return false; }
148 
149 bool pat::PackedGenParticle::isCaloMuon() const { return false; }
150 
151 bool pat::PackedGenParticle::isPhoton() const { return false; }
152 
153 bool pat::PackedGenParticle::isConvertedPhoton() const { return false; }
154 
155 bool pat::PackedGenParticle::isJet() const { return false; }
156 
157 bool pat::PackedGenParticle::longLived() const {return false;}
158 
159 bool pat::PackedGenParticle::massConstraint() const {return false;}
160 
161 
162 
163 
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
PolarLorentzVector p4_
the four vector
void pack(bool unpackAfterwards=true)
virtual double vertexNormalizedChi2() const
chi-squared divided by n.d.o.f.
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