CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SuperClusterToCandidate.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_SuperClusterToCandidate_h
2 #define RecoAlgos_SuperClusterToCandidate_h
9 
10 namespace converter {
16  : MassiveCandidateConverter(cfg, iC) {}
18  const reco::SuperCluster& sc = *scRef;
19  math::XYZPoint v(0, 0, 0); // this should be taken from something else...
20  math::XYZVector p = sc.energy() * (sc.position() - v).unit();
21  double t = sqrt(massSqr_ + p.mag2());
22  c.setCharge(0);
23  c.setVertex(v);
24  c.setP4(reco::Candidate::LorentzVector(p.x(), p.y(), p.z(), t));
25  c.setSuperCluster(scRef);
27  }
28  };
29 
30  namespace helper {
31  template <>
32  struct CandConverter<reco::SuperCluster> {
34  };
35  } // namespace helper
36 } // namespace converter
37 
38 #endif
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:154
const edm::EventSetup & c
tuple cfg
Definition: looper.py:296
void setSuperCluster(const reco::SuperClusterRef &r)
set reference to superCluster
void setVertex(const Point &vertex) override
set vertex
void setCharge(Charge q) final
set electric charge
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
void convert(reco::SuperClusterRef scRef, reco::RecoEcalCandidate &c) const
T sqrt(T t)
Definition: SSEVec.h:19
reco::SuperClusterCollection Components
double energy() const
cluster energy
Definition: CaloCluster.h:149
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
SuperClusterToCandidate(const edm::ParameterSet &cfg, edm::ConsumesCollector iC)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
void setPdgId(int pdgId) final
void setP4(const LorentzVector &p4) final
set 4-momentum
int pdgId() const
PDG id.
Definition: PdtEntry.cc:5
Basic3DVector unit() const