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>
30  combine(const std::vector<reco::CandidatePtrVector> &, string_coll const &) const;
32  std::unique_ptr<reco::NamedCompositeCandidateCollection>
34  string_coll const &) const;
36  std::unique_ptr<reco::NamedCompositeCandidateCollection>
38  const reco::CandidatePtrVector &,
39  string_coll const &) const;
41  std::unique_ptr<reco::NamedCompositeCandidateCollection>
43  const reco::CandidatePtrVector &,
44  const reco::CandidatePtrVector &,
45  string_coll const &) const;
47  std::unique_ptr<reco::NamedCompositeCandidateCollection>
49  const reco::CandidatePtrVector &,
50  const reco::CandidatePtrVector &,
51  const reco::CandidatePtrVector &,
52  string_coll const &) const;
53 
54 private:
56  bool preselect(const reco::Candidate &, const reco::Candidate &) const;
59  const reco::CandidatePtr &,
60  const reco::CandidatePtr &,
62  std::string ) const;
64  typedef std::vector<std::pair<std::pair<reco::CandidatePtr, size_t>,
65  std::vector<reco::CandidatePtrVector>::const_iterator> > CandStack;
66  typedef std::vector<int> ChargeStack;
68  void combine(size_t collectionIndex, CandStack &, ChargeStack &,
69  string_coll const & names,
70  std::vector<reco::CandidatePtrVector>::const_iterator begin,
71  std::vector<reco::CandidatePtrVector>::const_iterator end,
72  std::unique_ptr<reco::NamedCompositeCandidateCollection> & comps
73  ) const;
75  virtual bool select(const reco::Candidate &) const = 0;
77  virtual bool selectPair(const reco::Candidate & c1, const reco::Candidate & c2) const = 0;
79  virtual void setup(reco::NamedCompositeCandidate &) const = 0;
81  virtual void addDaughter(reco::NamedCompositeCandidate & cmp, const reco::CandidatePtr & c, std::string name) const = 0;
87  std::vector<int> dauCharge_;
92 };
93 
94 #endif
NamedCandCombinerBase(std::string name)
default construct
const std::string names[nVars_]
virtual void setup(reco::NamedCompositeCandidate &) const =0
set kinematics to reconstructed composite
std::vector< int > ChargeStack
virtual bool select(const reco::Candidate &) const =0
select a candidate
std::vector< std::pair< std::pair< reco::CandidatePtr, size_t >, std::vector< reco::CandidatePtrVector >::const_iterator > > CandStack
temporary candidate stack
#define end
Definition: vmac.h:39
OverlapChecker overlap_
utility to check candidate daughters overlap
virtual bool selectPair(const reco::Candidate &c1, const reco::Candidate &c2) const =0
select a candidate pair
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
def checkOverlap(process)
#define begin
Definition: vmac.h:32
std::unique_ptr< reco::NamedCompositeCandidateCollection > combine(const std::vector< reco::CandidatePtrVector > &, string_coll const &) const
return all selected candidate pairs
std::vector< std::string > string_coll
virtual void addDaughter(reco::NamedCompositeCandidate &cmp, const reco::CandidatePtr &c, std::string name) const =0
add candidate daughter
virtual ~NamedCandCombinerBase()
destructor