42 const map<string,BPHDecayMomentum::Component>& daugMap ):
50 const map<string,BPHDecayMomentum::Component>& daugMap,
51 const map<string,BPHRecoConstCandPtr> compMap ):
67 while ( n-- )
delete dList[
n];
106 const reco::Candidate*>::const_iterator iter =
clonesMap.find( daug );
107 return ( iter !=
clonesMap.end() ? iter->second : 0 );
118 const string&
name )
const {
122 if ( pos != string::npos )
return getComp( name.substr( 0, pos ) )
123 ->
getDaug( name.substr( pos + 1 ) );
126 return ( iter !=
dMap.end() ? iter->second : 0 );
135 return ( iter !=
cMap.end() ? iter->second : 0 );
139 const vector<BPHDecayMomentum::Component>&
149 if (
dMap.find( name ) !=
dMap.end() ) {
151 <<
"BPHDecayMomentum::add: "
152 <<
"Decay product already inserted with name " << name
157 if ( mass > 0.0 ) dnew->
setMass( mass );
158 nList.push_back( name );
159 dList.push_back( dnew );
169 nComp.push_back( name );
170 cList.push_back( comp );
172 clonesMap.insert( comp->clonesMap.begin(), comp->clonesMap.end() );
184 int n = daugMap.size();
195 map<string,Component>::const_iterator iter = daugMap.
begin();
196 map<string,Component>::const_iterator iend = daugMap.end();
197 while ( iter != iend ) {
198 const pair<string,Component>&
entry = *iter++;
206 const string& name =
nList[i++] = entry.first;
211 if ( mass > 0 ) dnew->
setMass( mass );
224 map<string,BPHRecoConstCandPtr>::const_iterator iter =
cMap.begin();
225 map<string,BPHRecoConstCandPtr>::const_iterator iend =
cMap.end();
226 while ( iter != iend ) {
227 const pair<string,BPHRecoConstCandPtr>&
entry = *iter++;
231 clonesMap.insert( comp->clonesMap.begin(), comp->clonesMap.end() );
238 const vector<const reco::Candidate*> dl )
const {
249 ad.insert( ad.end(),
dList.begin(),
dList.end() );
251 while ( n-- )
cList[
n]->fillDaug( ad );
Analysis-level particle class.
const reco::Candidate * cand
virtual void sumMomentum(const std::vector< const reco::Candidate * > dl) const
BPHGenericPtr< const BPHRecoCandidate >::type BPHRecoConstCandPtr
virtual void setNotUpdated() const
virtual void computeMomentum() const
virtual ~BPHDecayMomentum()
virtual const std::vector< const reco::Candidate * > & daughters() const
std::vector< const reco::Candidate * > dList
std::vector< BPHRecoConstCandPtr > cList
std::map< std::string, BPHRecoConstCandPtr > cMap
const std::vector< Component > & componentList() const
std::vector< Component > compList
std::vector< const reco::Candidate * > dFull
virtual void addP(const std::string &name, const reco::Candidate *daug, double mass=-1.0)
virtual void fillDaug(std::vector< const reco::Candidate * > &ad) const
virtual const reco::Candidate * originalReco(const reco::Candidate *daug) const
get the original particle from the clone
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
virtual Candidate * clone() const =0
returns a clone of the Candidate object
void clearDaughters()
clear daughters
virtual const pat::CompositeCandidate & composite() const
get a composite by the simple sum of simple particles
void clonesList(const std::map< std::string, Component > &daugMap)
std::map< std::string, const reco::Candidate * > dMap
std::map< const reco::Candidate *, const reco::Candidate * > clonesMap
pat::CompositeCandidate compCand
virtual BPHRecoConstCandPtr getComp(const std::string &name) const
virtual const std::vector< BPHRecoConstCandPtr > & daughComp() const
virtual const std::vector< const reco::Candidate * > & daughFull() const
const_iterator begin() const
first daughter const_iterator
virtual const std::vector< std::string > & compNames() const
std::vector< std::string > nList
void set(reco::Candidate &c) const
set up a candidate
virtual const std::vector< std::string > & daugNames() const
virtual const reco::Candidate * getDaug(const std::string &name) const
std::vector< std::string > nComp
virtual void setMass(double m)=0
set particle mass