CMS 3D CMS Logo

NamedCompositeCandidate.h
Go to the documentation of this file.
1 #ifndef Candidate_NamedCompositeCandidate_H
2 #define Candidate_NamedCompositeCandidate_H
4 #include <memory>
16 #include <string>
17 #include <map>
18 
19 namespace reco {
20 
22  public:
23  typedef std::vector<std::string> role_collection;
24 
31  const role_collection& roles,
32  Charge q,
33  const LorentzVector& p4,
34  const Point& vtx = Point(0, 0, 0),
35  int pdgId = 0,
36  int status = 0,
37  bool integerCharge = true)
38  : CompositeCandidate(q, p4, vtx, pdgId, status, integerCharge), name_(name), roles_(roles) {}
41 
43  ~NamedCompositeCandidate() override;
45  NamedCompositeCandidate* clone() const override;
46  // get name
47  std::string name() const { return name_; }
48  // set name
49  void setName(std::string n) { name_ = n; }
50  // get roles
52  // set roles
54  roles_.clear();
55  roles_ = roles;
56  }
57  // Get candidate based on role
58  Candidate* daughter(const std::string& s) override;
59  const Candidate* daughter(const std::string& s) const override;
60  // Get candidate based on index
62  const Candidate* daughter(size_type i) const override { return CompositeCandidate::daughter(i); }
63  // Add daughters
64  void addDaughter(const Candidate&, const std::string& s);
65  void addDaughter(std::unique_ptr<Candidate>, const std::string& s);
66  // Clear daughters and roles
68  void clearRoles() { roles_.clear(); }
69  // Apply the roles to the objects
70  void applyRoles();
71 
72  private:
75  };
76 
77 } // namespace reco
78 
79 #endif
NamedCompositeCandidateFwd.h
reco::NamedCompositeCandidate::name
std::string name() const
Definition: NamedCompositeCandidate.h:47
reco::CompositeCandidate::role_collection
std::vector< std::string > role_collection
Definition: CompositeCandidate.h:25
mps_fire.i
i
Definition: mps_fire.py:355
CompositeCandidate.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
reco::LeafCandidate::Point
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:27
reco::NamedCompositeCandidate::role_collection
std::vector< std::string > role_collection
Definition: NamedCompositeCandidate.h:23
reco::LeafCandidate::status
int status() const final
status word
Definition: LeafCandidate.h:180
reco::NamedCompositeCandidate::clone
NamedCompositeCandidate * clone() const override
returns a clone of the candidate
Definition: NamedCompositeCandidate.cc:28
data-class-funcs.q
q
Definition: data-class-funcs.py:169
reco::Candidate::Charge
int Charge
electric charge type
Definition: Candidate.h:34
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::NamedCompositeCandidate::addDaughter
void addDaughter(const Candidate &, const std::string &s)
Definition: NamedCompositeCandidate.cc:86
alignCSCRings.s
s
Definition: alignCSCRings.py:92
reco::NamedCompositeCandidate::NamedCompositeCandidate
NamedCompositeCandidate(std::string name="")
default constructor
Definition: NamedCompositeCandidate.h:26
reco::NamedCompositeCandidate
Definition: NamedCompositeCandidate.h:21
reco::NamedCompositeCandidate::~NamedCompositeCandidate
~NamedCompositeCandidate() override
destructor
Definition: NamedCompositeCandidate.cc:23
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
reco::NamedCompositeCandidate::applyRoles
void applyRoles()
Definition: NamedCompositeCandidate.cc:30
reco::NamedCompositeCandidate::name_
std::string name_
Definition: NamedCompositeCandidate.h:73
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
reco::NamedCompositeCandidate::NamedCompositeCandidate
NamedCompositeCandidate(std::string name, const role_collection &roles, Charge q, const LorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
constructor from values
Definition: NamedCompositeCandidate.h:30
reco::NamedCompositeCandidate::setRoles
void setRoles(const NamedCompositeCandidate::role_collection &roles)
Definition: NamedCompositeCandidate.h:53
reco::LeafCandidate::pdgId
int pdgId() const final
PDG identifier.
Definition: LeafCandidate.h:176
reco::NamedCompositeCandidate::daughter
Candidate * daughter(size_type i) override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1
Definition: NamedCompositeCandidate.h:61
reco::NamedCompositeCandidate::roles
const NamedCompositeCandidate::role_collection & roles() const
Definition: NamedCompositeCandidate.h:51
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
reco::NamedCompositeCandidate::daughter
const Candidate * daughter(size_type i) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode)
Definition: NamedCompositeCandidate.h:62
reco::NamedCompositeCandidate::roles_
role_collection roles_
Definition: NamedCompositeCandidate.h:74
reco::Candidate
Definition: Candidate.h:27
reco::CompositeCandidate::clearDaughters
void clearDaughters()
clear daughters
Definition: CompositeCandidate.h:71
reco::NamedCompositeCandidate::clearDaughters
void clearDaughters()
Definition: NamedCompositeCandidate.h:67
reco::LeafCandidate::p
double p() const final
magnitude of momentum vector
Definition: LeafCandidate.h:123
reco::NamedCompositeCandidate::clearRoles
void clearRoles()
Definition: NamedCompositeCandidate.h:68
reco::NamedCompositeCandidate::daughter
Candidate * daughter(const std::string &s) override
return daughter with a specified role name
Definition: NamedCompositeCandidate.cc:50
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
reco::NamedCompositeCandidate::NamedCompositeCandidate
NamedCompositeCandidate(std::string name, const role_collection &roles)
Definition: NamedCompositeCandidate.h:27
reco::CompositeCandidate::daughter
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode)
Definition: CompositeCandidate.cc:30
reco::Candidate::size_type
size_t size_type
Definition: Candidate.h:29
reco::CompositeCandidate
Definition: CompositeCandidate.h:21
reco::NamedCompositeCandidate::setName
void setName(std::string n)
Definition: NamedCompositeCandidate.h:49