Imperial Analysis
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CompositeCandidate.hh
Go to the documentation of this file.
1 #ifndef ICHiggsTauTau_CompositeCandidate_hh
2 #define ICHiggsTauTau_CompositeCandidate_hh
3 #include <map>
4 #include <string>
5 #include <numeric>
6 #include <functional>
7 #include "Math/Vector4D.h"
8 #include "Math/Vector4Dfwd.h"
10 #include "Math/VectorUtil.h"
11 
12 namespace ic {
13 
28 class CompositeCandidate : public Candidate {
29  public:
31  virtual ~CompositeCandidate();
32  virtual void Print() const;
33 
34  typedef std::vector<Candidate*>::const_iterator const_iterator;
35 
43  void AddCandidate(std::string name, Candidate* cand);
44 
47  inline Candidate* at(std::size_t const& index) const {
48  return cand_vec_.at(index);
49  }
50 
53  inline Candidate* at(std::string const& label) const {
54  return cand_map_.at(label);
55  }
56 
58  inline const_iterator begin() const { return cand_vec_.begin(); }
59 
61  inline const_iterator end() const { return cand_vec_.end(); }
62 
64  inline std::vector<Candidate*> const& AsVector() const { return cand_vec_; }
65 
69  Candidate* GetCandidate(std::string name) const;
70 
74  Candidate* At(unsigned index) const;
75 
79  double PtOf(std::string name) const;
80 
89  double ScalarPtSum() const;
90 
95  double DeltaR(std::string name1, std::string name2) const;
96 
101  double DeltaPhi(std::string name1, std::string name2) const;
102 
103  private:
104  std::map<std::string, Candidate*> cand_map_;
105  std::vector<Candidate*> cand_vec_;
106 
107  bool Verify(std::string const& name) const;
108 };
109 }
110 #endif
Candidate * GetCandidate(std::string name) const
double DeltaR(std::string name1, std::string name2) const
virtual void Print() const
const_iterator end() const
Return a const_iterator to the end of the internal vector
double DeltaPhi(std::string name1, std::string name2) const
Candidate * at(std::string const &label) const
Return a Candidate* using a label key. Will throw if a Candidate with label does not exist...
Stores a four-momentum, charge and identifier, and is the base class for most other physics objects...
Definition: Candidate.hh:13
Candidate * At(unsigned index) const
std::vector< Candidate * >::const_iterator const_iterator
Definition: CaloJet.hh:9
double PtOf(std::string name) const
std::vector< Candidate * > const & AsVector() const
Return a copy of the internal vector
void AddCandidate(std::string name, Candidate *cand)
Add a new Candidate.
Candidate * at(std::size_t const &index) const
Return a Candidate* using a vector index. Will throw if index is out of range.
A candidate built by adding the four-momenta of other candidates.
const_iterator begin() const
Return a const_iterator to the start of the internal vector