CMS 3D CMS Logo

NamedCandCombinerBase.h
Go to the documentation of this file.
1 #ifndef CommonTools_CandUtils_CandCombinerBase_h
2 #define CommonTools_CandUtils_CandCombinerBase_h
3 
10 #include <vector>
11 #include <string>
12 
14 public:
15  typedef std::vector<std::string> string_coll;
21  NamedCandCombinerBase(std::string name, int, int, int);
23  NamedCandCombinerBase(std::string name, int, int, int, int);
25  NamedCandCombinerBase(std::string name, bool checkCharge, bool checkOverlap, const std::vector<int> &);
27  virtual ~NamedCandCombinerBase();
29  std::unique_ptr<reco::NamedCompositeCandidateCollection> combine(const std::vector<reco::CandidatePtrVector> &,
30  string_coll const &) const;
32  std::unique_ptr<reco::NamedCompositeCandidateCollection> combine(const reco::CandidatePtrVector &,
33  string_coll const &) const;
35  std::unique_ptr<reco::NamedCompositeCandidateCollection> combine(const reco::CandidatePtrVector &,
37  string_coll const &) const;
39  std::unique_ptr<reco::NamedCompositeCandidateCollection> combine(const reco::CandidatePtrVector &,
42  string_coll const &) const;
44  std::unique_ptr<reco::NamedCompositeCandidateCollection> combine(const reco::CandidatePtrVector &,
48  string_coll const &) const;
49 
50 private:
52  bool preselect(const reco::Candidate &, const reco::Candidate &) const;
55  const reco::CandidatePtr &,
56  const reco::CandidatePtr &,
58  std::string) const;
60  typedef std::vector<
61  std::pair<std::pair<reco::CandidatePtr, size_t>, std::vector<reco::CandidatePtrVector>::const_iterator> >
63  typedef std::vector<int> ChargeStack;
65  void combine(size_t collectionIndex,
66  CandStack &,
67  ChargeStack &,
68  string_coll const &names,
69  std::vector<reco::CandidatePtrVector>::const_iterator begin,
70  std::vector<reco::CandidatePtrVector>::const_iterator end,
71  std::unique_ptr<reco::NamedCompositeCandidateCollection> &comps) const;
73  virtual bool select(const reco::Candidate &) const = 0;
75  virtual bool selectPair(const reco::Candidate &c1, const reco::Candidate &c2) const = 0;
77  virtual void setup(reco::NamedCompositeCandidate &) const = 0;
85  std::vector<int> dauCharge_;
90 };
91 
92 #endif
NamedCandCombinerBase(std::string name)
default construct
virtual void setup(reco::NamedCompositeCandidate &) const =0
set kinematics to reconstructed composite
const std::string names[nVars_]
std::vector< int > ChargeStack
OverlapChecker overlap_
utility to check candidate daughters overlap
virtual void addDaughter(reco::NamedCompositeCandidate &cmp, const reco::CandidatePtr &c, std::string name) const =0
add candidate daughter
bool preselect(const reco::Candidate &, const reco::Candidate &) const
verify that the two candidate don&#39;t overlap and check charge
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::vector< std::pair< std::pair< reco::CandidatePtr, size_t >, std::vector< reco::CandidatePtrVector >::const_iterator > > CandStack
temporary candidate stack
virtual bool select(const reco::Candidate &) const =0
select a candidate
def checkOverlap(process)
virtual bool selectPair(const reco::Candidate &c1, const reco::Candidate &c2) const =0
select a candidate pair
std::vector< std::string > string_coll
std::unique_ptr< reco::NamedCompositeCandidateCollection > combine(const std::vector< reco::CandidatePtrVector > &, string_coll const &) const
return all selected candidate pairs
virtual ~NamedCandCombinerBase()
destructor