#include <NamedCandCombinerBase.h>
Public Types | |
typedef std::vector< std::string > | string_coll |
typedef std::vector< std::string > | string_coll |
Public Member Functions | |
std::auto_ptr < reco::NamedCompositeCandidateCollection > | combine (const std::vector< reco::CandidatePtrVector > &, string_coll const &) const |
return all selected candidate pairs | |
std::auto_ptr < reco::NamedCompositeCandidateCollection > | combine (const reco::CandidatePtrVector &, const reco::CandidatePtrVector &, const reco::CandidatePtrVector &, const reco::CandidatePtrVector &, string_coll const &) const |
return all selected candidate pairs | |
std::auto_ptr < reco::NamedCompositeCandidateCollection > | combine (const reco::CandidatePtrVector &, const reco::CandidatePtrVector &, const reco::CandidatePtrVector &, string_coll const &) const |
return all selected candidate pairs | |
std::auto_ptr < reco::NamedCompositeCandidateCollection > | combine (const reco::CandidatePtrVector &, string_coll const &) const |
return all selected candidate pairs | |
std::auto_ptr < reco::NamedCompositeCandidateCollection > | combine (const reco::CandidatePtrVector &, const reco::CandidatePtrVector &, string_coll const &) const |
return all selected candidate pairs | |
std::auto_ptr < reco::NamedCompositeCandidateCollection > | combine (const std::vector< reco::CandidatePtrVector > &, string_coll const &) const |
return all selected candidate pairs | |
std::auto_ptr < reco::NamedCompositeCandidateCollection > | combine (const reco::CandidatePtrVector &, string_coll const &) const |
return all selected candidate pairs | |
std::auto_ptr < reco::NamedCompositeCandidateCollection > | combine (const reco::CandidatePtrVector &, const reco::CandidatePtrVector &, const reco::CandidatePtrVector &, string_coll const &) const |
return all selected candidate pairs | |
std::auto_ptr < reco::NamedCompositeCandidateCollection > | combine (const reco::CandidatePtrVector &, const reco::CandidatePtrVector &, string_coll const &) const |
return all selected candidate pairs | |
std::auto_ptr < reco::NamedCompositeCandidateCollection > | combine (const reco::CandidatePtrVector &, const reco::CandidatePtrVector &, const reco::CandidatePtrVector &, const reco::CandidatePtrVector &, string_coll const &) const |
return all selected candidate pairs | |
NamedCandCombinerBase (std::string name, int, int) | |
construct from two charge values | |
NamedCandCombinerBase (std::string name, int, int, int) | |
construct from three charge values | |
NamedCandCombinerBase (std::string name, bool checkCharge, const std::vector< int > &) | |
constructor from a selector, specifying optionally to check for charge | |
NamedCandCombinerBase (std::string name, int, int) | |
construct from two charge values | |
NamedCandCombinerBase (std::string name, int, int, int, int) | |
construct from four charge values | |
NamedCandCombinerBase (std::string name, bool checkCharge, bool checkOverlap, const std::vector< int > &) | |
constructor from a selector, specifying optionally to check for charge | |
NamedCandCombinerBase (std::string name, int, int, int) | |
construct from three charge values | |
NamedCandCombinerBase (std::string name) | |
default construct | |
NamedCandCombinerBase (std::string name, int, int, int, int) | |
construct from four charge values | |
NamedCandCombinerBase (std::string name) | |
default construct | |
virtual | ~NamedCandCombinerBase () |
destructor | |
virtual | ~NamedCandCombinerBase () |
destructor | |
Private Types | |
typedef std::vector< std::pair < std::pair < reco::CandidatePtr, size_t > , std::vector < reco::CandidatePtrVector > ::const_iterator > > | CandStack |
temporary candidate stack | |
typedef std::vector< std::pair < std::pair < reco::CandidatePtr, size_t > , std::vector < reco::CandidatePtrVector > ::const_iterator > > | CandStack |
temporary candidate stack | |
typedef std::vector< int > | ChargeStack |
typedef std::vector< int > | ChargeStack |
Private Member Functions | |
virtual void | addDaughter (reco::NamedCompositeCandidate &cmp, const reco::CandidatePtr &c, std::string name) const =0 |
add candidate daughter | |
virtual void | addDaughter (reco::NamedCompositeCandidate &cmp, const reco::CandidatePtr &c, std::string name) const =0 |
add candidate daughter | |
void | combine (reco::NamedCompositeCandidate &, const reco::CandidatePtr &, const reco::CandidatePtr &, std::string, std::string) const |
returns a composite candidate combined from two daughters | |
void | combine (size_t collectionIndex, CandStack &, ChargeStack &, string_coll const &names, std::vector< reco::CandidatePtrVector >::const_iterator begin, std::vector< reco::CandidatePtrVector >::const_iterator end, std::auto_ptr< reco::NamedCompositeCandidateCollection > &comps) const |
returns a composite candidate combined from two daughters | |
void | combine (size_t collectionIndex, CandStack &, ChargeStack &, string_coll const &names, std::vector< reco::CandidatePtrVector >::const_iterator begin, std::vector< reco::CandidatePtrVector >::const_iterator end, std::auto_ptr< reco::NamedCompositeCandidateCollection > &comps) const |
returns a composite candidate combined from two daughters | |
void | combine (reco::NamedCompositeCandidate &, const reco::CandidatePtr &, const reco::CandidatePtr &, std::string, std::string) const |
returns a composite candidate combined from two daughters | |
bool | preselect (const reco::Candidate &, const reco::Candidate &) const |
verify that the two candidate don't overlap and check charge | |
bool | preselect (const reco::Candidate &, const reco::Candidate &) const |
verify that the two candidate don't overlap and check charge | |
virtual bool | select (const reco::Candidate &) const =0 |
select a candidate | |
virtual bool | select (const reco::Candidate &) const =0 |
select a candidate | |
virtual bool | selectPair (const reco::Candidate &c1, const reco::Candidate &c2) const =0 |
select a candidate pair | |
virtual bool | selectPair (const reco::Candidate &c1, const reco::Candidate &c2) const =0 |
select a candidate pair | |
virtual void | setup (reco::NamedCompositeCandidate &) const =0 |
set kinematics to reconstructed composite | |
virtual void | setup (reco::NamedCompositeCandidate &) const =0 |
set kinematics to reconstructed composite | |
Private Attributes | |
bool | checkCharge_ |
flag to specify the checking of electric charge | |
bool | checkOverlap_ |
flag to specify the checking of overlaps | |
std::vector< int > | dauCharge_ |
electric charges of the daughters | |
std::string | name_ |
Name. | |
OverlapChecker | overlap_ |
utility to check candidate daughters overlap |
Definition at line 13 of file NamedCandCombinerBase.h.
typedef std::vector<std::pair<std::pair<reco::CandidatePtr, size_t>, std::vector<reco::CandidatePtrVector>::const_iterator> > NamedCandCombinerBase::CandStack [private] |
temporary candidate stack
Definition at line 65 of file NamedCandCombinerBase.h.
typedef std::vector<std::pair<std::pair<reco::CandidatePtr, size_t>, std::vector<reco::CandidatePtrVector>::const_iterator> > NamedCandCombinerBase::CandStack [private] |
temporary candidate stack
Definition at line 65 of file NamedCandCombinerBase.h.
typedef std::vector<int> NamedCandCombinerBase::ChargeStack [private] |
Definition at line 66 of file NamedCandCombinerBase.h.
typedef std::vector<int> NamedCandCombinerBase::ChargeStack [private] |
Definition at line 66 of file NamedCandCombinerBase.h.
typedef std::vector<std::string> NamedCandCombinerBase::string_coll |
Definition at line 15 of file NamedCandCombinerBase.h.
typedef std::vector<std::string> NamedCandCombinerBase::string_coll |
Definition at line 15 of file NamedCandCombinerBase.h.
NamedCandCombinerBase::NamedCandCombinerBase | ( | std::string | name | ) |
default construct
Definition at line 6 of file NamedCandCombinerBase.cc.
: checkCharge_(false), checkOverlap_(true), dauCharge_(), overlap_(), name_(name) { }
NamedCandCombinerBase::NamedCandCombinerBase | ( | std::string | name, |
int | q1, | ||
int | q2 | ||
) |
construct from two charge values
Definition at line 10 of file NamedCandCombinerBase.cc.
References dauCharge_, q1, and q2.
: checkCharge_(true), checkOverlap_(true), dauCharge_(2), overlap_(), name_(name) { dauCharge_[0] = q1; dauCharge_[1] = q2; }
NamedCandCombinerBase::NamedCandCombinerBase | ( | std::string | name, |
int | q1, | ||
int | q2, | ||
int | q3 | ||
) |
construct from three charge values
Definition at line 16 of file NamedCandCombinerBase.cc.
References dauCharge_, q1, and q2.
: checkCharge_(true), checkOverlap_(true), dauCharge_(3), overlap_(), name_(name) { dauCharge_[0] = q1; dauCharge_[1] = q2; dauCharge_[2] = q3; }
NamedCandCombinerBase::NamedCandCombinerBase | ( | std::string | name, |
int | q1, | ||
int | q2, | ||
int | q3, | ||
int | q4 | ||
) |
construct from four charge values
Definition at line 23 of file NamedCandCombinerBase.cc.
References dauCharge_, q1, and q2.
: checkCharge_(true), checkOverlap_(true), dauCharge_(4), overlap_(), name_(name) { dauCharge_[0] = q1; dauCharge_[1] = q2; dauCharge_[2] = q3; dauCharge_[3] = q4; }
NamedCandCombinerBase::NamedCandCombinerBase | ( | std::string | name, |
bool | checkCharge, | ||
bool | checkOverlap, | ||
const std::vector< int > & | |||
) |
constructor from a selector, specifying optionally to check for charge
NamedCandCombinerBase::~NamedCandCombinerBase | ( | ) | [virtual] |
NamedCandCombinerBase::NamedCandCombinerBase | ( | std::string | name | ) |
default construct
NamedCandCombinerBase::NamedCandCombinerBase | ( | std::string | name, |
int | , | ||
int | |||
) |
construct from two charge values
NamedCandCombinerBase::NamedCandCombinerBase | ( | std::string | name, |
int | , | ||
int | , | ||
int | |||
) |
construct from three charge values
NamedCandCombinerBase::NamedCandCombinerBase | ( | std::string | name, |
int | , | ||
int | , | ||
int | , | ||
int | |||
) |
construct from four charge values
NamedCandCombinerBase::NamedCandCombinerBase | ( | std::string | name, |
bool | checkCharge, | ||
const std::vector< int > & | |||
) |
constructor from a selector, specifying optionally to check for charge
virtual NamedCandCombinerBase::~NamedCandCombinerBase | ( | ) | [virtual] |
destructor
virtual void NamedCandCombinerBase::addDaughter | ( | reco::NamedCompositeCandidate & | cmp, |
const reco::CandidatePtr & | c, | ||
std::string | name | ||
) | const [private, pure virtual] |
add candidate daughter
Implemented in NamedCandCombiner< Selector, PairSelector, Cloner, Setup >, and NamedCandCombiner< Selector, PairSelector, Cloner, Setup >.
Referenced by combine().
virtual void NamedCandCombinerBase::addDaughter | ( | reco::NamedCompositeCandidate & | cmp, |
const reco::CandidatePtr & | c, | ||
std::string | name | ||
) | const [private, pure virtual] |
add candidate daughter
Implemented in NamedCandCombiner< Selector, PairSelector, Cloner, Setup >, and NamedCandCombiner< Selector, PairSelector, Cloner, Setup >.
auto_ptr< NamedCompositeCandidateCollection > NamedCandCombinerBase::combine | ( | const reco::CandidatePtrVector & | src, |
string_coll const & | names | ||
) | const |
return all selected candidate pairs
Definition at line 110 of file NamedCandCombinerBase.cc.
References trackerHits::c, checkCharge_, combine(), edm::errors::Configuration, dauCharge_, n, preselect(), select(), and edm::PtrVectorBase::size().
{ if(checkCharge_ && dauCharge_.size() != 2) throw edm::Exception(edm::errors::Configuration) << "NamedCandCombiner: trying to combine 2 collections" << " but configured to check against " << dauCharge_.size() << " charges."; if ( names.size() < 2 ) throw edm::Exception(edm::errors::Configuration) << "NamedCandCombiner: need to add 2 names, but size is " << names.size(); auto_ptr<NamedCompositeCandidateCollection> comps(new NamedCompositeCandidateCollection); const int n = src.size(); for(int i1 = 0; i1 < n; ++i1) { const Candidate & c1 = *(src[i1]); for(int i2 = i1 + 1; i2 < n; ++i2) { const Candidate & c2 = *(src[i2]); if(preselect(c1, c2)) { NamedCompositeCandidate c; combine(c, src[i1], src[i2], names[0], names[1]); if(select(c)) comps->push_back(c); } } } return comps; }
auto_ptr< NamedCompositeCandidateCollection > NamedCandCombinerBase::combine | ( | const reco::CandidatePtrVector & | src1, |
const reco::CandidatePtrVector & | src2, | ||
const reco::CandidatePtrVector & | src3, | ||
string_coll const & | names | ||
) | const |
return all selected candidate pairs
Definition at line 147 of file NamedCandCombinerBase.cc.
References combine(), and align_tpl::src.
void NamedCandCombinerBase::combine | ( | size_t | collectionIndex, |
CandStack & | , | ||
ChargeStack & | , | ||
string_coll const & | names, | ||
std::vector< reco::CandidatePtrVector >::const_iterator | begin, | ||
std::vector< reco::CandidatePtrVector >::const_iterator | end, | ||
std::auto_ptr< reco::NamedCompositeCandidateCollection > & | comps | ||
) | const [private] |
returns a composite candidate combined from two daughters
std::auto_ptr<reco::NamedCompositeCandidateCollection> NamedCandCombinerBase::combine | ( | const reco::CandidatePtrVector & | , |
const reco::CandidatePtrVector & | , | ||
const reco::CandidatePtrVector & | , | ||
string_coll const & | |||
) | const |
return all selected candidate pairs
std::auto_ptr<reco::NamedCompositeCandidateCollection> NamedCandCombinerBase::combine | ( | const reco::CandidatePtrVector & | , |
const reco::CandidatePtrVector & | , | ||
const reco::CandidatePtrVector & | , | ||
const reco::CandidatePtrVector & | , | ||
string_coll const & | |||
) | const |
return all selected candidate pairs
void NamedCandCombinerBase::combine | ( | reco::NamedCompositeCandidate & | , |
const reco::CandidatePtr & | , | ||
const reco::CandidatePtr & | , | ||
std::string | , | ||
std::string | |||
) | const [private] |
returns a composite candidate combined from two daughters
auto_ptr< NamedCompositeCandidateCollection > NamedCandCombinerBase::combine | ( | const reco::CandidatePtrVector & | src1, |
const reco::CandidatePtrVector & | src2, | ||
const reco::CandidatePtrVector & | src3, | ||
const reco::CandidatePtrVector & | src4, | ||
string_coll const & | names | ||
) | const |
return all selected candidate pairs
Definition at line 157 of file NamedCandCombinerBase.cc.
References combine(), and align_tpl::src.
void NamedCandCombinerBase::combine | ( | size_t | collectionIndex, |
CandStack & | , | ||
ChargeStack & | , | ||
string_coll const & | names, | ||
std::vector< reco::CandidatePtrVector >::const_iterator | begin, | ||
std::vector< reco::CandidatePtrVector >::const_iterator | end, | ||
std::auto_ptr< reco::NamedCompositeCandidateCollection > & | comps | ||
) | const [private] |
returns a composite candidate combined from two daughters
std::auto_ptr<reco::NamedCompositeCandidateCollection> NamedCandCombinerBase::combine | ( | const reco::CandidatePtrVector & | , |
const reco::CandidatePtrVector & | , | ||
string_coll const & | |||
) | const |
return all selected candidate pairs
std::auto_ptr<reco::NamedCompositeCandidateCollection> NamedCandCombinerBase::combine | ( | const reco::CandidatePtrVector & | , |
string_coll const & | |||
) | const |
return all selected candidate pairs
std::auto_ptr<reco::NamedCompositeCandidateCollection> NamedCandCombinerBase::combine | ( | const std::vector< reco::CandidatePtrVector > & | , |
string_coll const & | |||
) | const |
return all selected candidate pairs
std::auto_ptr<reco::NamedCompositeCandidateCollection> NamedCandCombinerBase::combine | ( | const std::vector< reco::CandidatePtrVector > & | , |
string_coll const & | |||
) | const |
return all selected candidate pairs
Referenced by combine().
auto_ptr< NamedCompositeCandidateCollection > NamedCandCombinerBase::combine | ( | const reco::CandidatePtrVector & | src1, |
const reco::CandidatePtrVector & | src2, | ||
string_coll const & | names | ||
) | const |
return all selected candidate pairs
Definition at line 139 of file NamedCandCombinerBase.cc.
References combine(), and align_tpl::src.
void NamedCandCombinerBase::combine | ( | reco::NamedCompositeCandidate & | cmp, |
const reco::CandidatePtr & | c1, | ||
const reco::CandidatePtr & | c2, | ||
std::string | n1, | ||
std::string | n2 | ||
) | const [private] |
returns a composite candidate combined from two daughters
Definition at line 48 of file NamedCandCombinerBase.cc.
References addDaughter(), and setup().
{ addDaughter(cmp, c1, n1); addDaughter(cmp, c2, n2); setup(cmp); }
bool NamedCandCombinerBase::preselect | ( | const reco::Candidate & | , |
const reco::Candidate & | |||
) | const [private] |
verify that the two candidate don't overlap and check charge
bool NamedCandCombinerBase::preselect | ( | const reco::Candidate & | c1, |
const reco::Candidate & | c2 | ||
) | const [private] |
verify that the two candidate don't overlap and check charge
Definition at line 38 of file NamedCandCombinerBase.cc.
References reco::Candidate::charge(), checkCharge_, checkOverlap_, dauCharge_, overlap_, q1, q2, and selectPair().
Referenced by combine().
{ if (checkCharge_) { int dq1 = dauCharge_[0], dq2 = dauCharge_[1], q1 = c1.charge(), q2 = c2.charge(); bool matchCharge = (q1 == dq1 && q2 == dq2) || (q1 == -dq1 && q2 == -dq2); if (!matchCharge) return false; } if (checkOverlap_ && overlap_(c1, c2)) return false; return selectPair(c1, c2); }
virtual bool NamedCandCombinerBase::select | ( | const reco::Candidate & | ) | const [private, pure virtual] |
select a candidate
Implemented in NamedCandCombiner< Selector, PairSelector, Cloner, Setup >, and NamedCandCombiner< Selector, PairSelector, Cloner, Setup >.
Referenced by combine().
virtual bool NamedCandCombinerBase::select | ( | const reco::Candidate & | ) | const [private, pure virtual] |
select a candidate
Implemented in NamedCandCombiner< Selector, PairSelector, Cloner, Setup >, and NamedCandCombiner< Selector, PairSelector, Cloner, Setup >.
virtual bool NamedCandCombinerBase::selectPair | ( | const reco::Candidate & | c1, |
const reco::Candidate & | c2 | ||
) | const [private, pure virtual] |
select a candidate pair
Implemented in NamedCandCombiner< Selector, PairSelector, Cloner, Setup >, and NamedCandCombiner< Selector, PairSelector, Cloner, Setup >.
Referenced by preselect().
virtual bool NamedCandCombinerBase::selectPair | ( | const reco::Candidate & | c1, |
const reco::Candidate & | c2 | ||
) | const [private, pure virtual] |
select a candidate pair
Implemented in NamedCandCombiner< Selector, PairSelector, Cloner, Setup >, and NamedCandCombiner< Selector, PairSelector, Cloner, Setup >.
virtual void NamedCandCombinerBase::setup | ( | reco::NamedCompositeCandidate & | ) | const [private, pure virtual] |
set kinematics to reconstructed composite
Implemented in NamedCandCombiner< Selector, PairSelector, Cloner, Setup >, and NamedCandCombiner< Selector, PairSelector, Cloner, Setup >.
virtual void NamedCandCombinerBase::setup | ( | reco::NamedCompositeCandidate & | ) | const [private, pure virtual] |
set kinematics to reconstructed composite
Implemented in NamedCandCombiner< Selector, PairSelector, Cloner, Setup >, and NamedCandCombiner< Selector, PairSelector, Cloner, Setup >.
Referenced by combine().
bool NamedCandCombinerBase::checkCharge_ [private] |
flag to specify the checking of electric charge
Definition at line 83 of file NamedCandCombinerBase.h.
Referenced by combine(), and preselect().
bool NamedCandCombinerBase::checkOverlap_ [private] |
flag to specify the checking of overlaps
Definition at line 85 of file NamedCandCombinerBase.h.
Referenced by preselect().
std::vector< int > NamedCandCombinerBase::dauCharge_ [private] |
electric charges of the daughters
Definition at line 87 of file NamedCandCombinerBase.h.
Referenced by combine(), NamedCandCombinerBase(), and preselect().
std::string NamedCandCombinerBase::name_ [private] |
Name.
Reimplemented in NamedCandCombiner< Selector, PairSelector, Cloner, Setup >.
Definition at line 91 of file NamedCandCombinerBase.h.
utility to check candidate daughters overlap
Definition at line 89 of file NamedCandCombinerBase.h.
Referenced by preselect().