JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
MELACandidate.h
Go to the documentation of this file.
1 #ifndef MELACANDIDATE_H
2 #define MELACANDIDATE_H
3 
4 #include "MELAParticle.h"
6 
7 class MELACandidate : public MELAParticle{
8 public:
10  MELACandidate(int id_, bool associatedByHighestPt_=false);
11  MELACandidate(int id_, TLorentzVector p4_, bool associatedByHighestPt_=false);
12  MELACandidate(const MELACandidate& particle_);
13  MELACandidate& operator=(const MELACandidate& particle_);
16  void swap(MELACandidate& particle_);
17 
18  // Member functions
19 
20  MELAParticle* getSortedDaughter(int index)const;
21  MELAParticle* getSortedV(int index)const;
22  MELAParticle* getAssociatedLepton(int index)const;
23  MELAParticle* getAssociatedNeutrino(int index)const;
24  MELAParticle* getAssociatedPhoton(int index)const;
25  MELAParticle* getAssociatedJet(int index)const;
26  MELATopCandidate_t* getAssociatedTop(int index)const;
27 
28  std::vector<MELAParticle*>& getSortedDaughters();
29  std::vector<MELAParticle*>& getSortedVs();
30  std::vector<MELAParticle*>& getAssociatedLeptons();
31  std::vector<MELAParticle*>& getAssociatedNeutrinos();
32  std::vector<MELAParticle*>& getAssociatedPhotons();
33  std::vector<MELAParticle*>& getAssociatedJets();
34  std::vector<MELATopCandidate_t*>& getAssociatedTops();
35 
36  const std::vector<MELAParticle*>& getSortedDaughters()const;
37  const std::vector<MELAParticle*>& getSortedVs()const;
38  const std::vector<MELAParticle*>& getAssociatedLeptons()const;
39  const std::vector<MELAParticle*>& getAssociatedNeutrinos()const;
40  const std::vector<MELAParticle*>& getAssociatedPhotons()const;
41  const std::vector<MELAParticle*>& getAssociatedJets()const;
42  const std::vector<MELATopCandidate_t*>& getAssociatedTops()const;
43 
44  std::vector<MELAParticle*> getAssociatedSortedVs();
45  std::vector<MELAParticle*> getAssociatedSortedVs()const;
46 
47  void getRelatedParticles(std::vector<MELAParticle*>& particles) const;
48  void getDaughterParticles(std::vector<MELAParticle*>& particles) const;
49 
50  TLorentzVector getAlternativeVMomentum(int index)const;
51 
52  virtual std::vector<int> getDaughterIds()const;
53  std::vector<int> getAssociatedParticleIds()const;
54 
56 
57  int getNAssociatedLeptons()const{ return associatedLeptons.size(); }
58  int getNAssociatedNeutrinos()const{ return associatedNeutrinos.size(); }
59  int getNAssociatedPhotons()const{ return associatedPhotons.size(); }
60  int getNAssociatedJets()const{ return associatedJets.size(); }
61  int getNAssociatedTops()const{ return associatedTops.size(); }
62  int getNSortedVs()const{ return sortedVs.size(); }
63 
64  void addAssociatedLepton(MELAParticle* myParticle);
65  void addAssociatedNeutrino(MELAParticle* myParticle);
66  void addAssociatedPhoton(MELAParticle* myParticle);
67  void addAssociatedJet(MELAParticle* myParticle);
68  void addAssociatedTop(MELATopCandidate_t* myParticle);
69 
70  void addSortedV(MELAParticle* myParticle){ sortedVs.push_back(myParticle); }
71  void addAssociatedVs();
72 
73  void resetVs();
74  void recreateVs();
75 
76  void sortDaughters();
78  bool testShallowCopy();
79 
80  bool daughtersInterfere()const;
82  void setAddAssociatedByHighestPt(bool associatedByHighestPt_);
83  void setShallowCopy(bool flag);
84 
85  static void addUnordered(MELAParticle* myParticle, std::vector<MELAParticle*>& particleArray);
86  static void addUnordered(MELAThreeBodyDecayCandidate* myParticle, std::vector<MELAThreeBodyDecayCandidate*>& particleArray);
87  static void addByHighestPt(MELAParticle* myParticle, std::vector<MELAParticle*>& particleArray);
88  static void addByHighestPt(MELAThreeBodyDecayCandidate* myParticle, std::vector<MELAThreeBodyDecayCandidate*>& particleArray);
89 
90 protected:
94 
95  std::vector<MELAParticle*> associatedLeptons;
96  std::vector<MELAParticle*> associatedNeutrinos;
97  std::vector<MELAParticle*> associatedPhotons;
98  std::vector<MELAParticle*> associatedJets;
99  std::vector<MELATopCandidate_t*> associatedTops;
100 
101  std::vector<MELAParticle*> sortedDaughters;
102  std::vector<MELAParticle*> sortedVs;
103 
104  void sortDaughtersInitial();
105  void sortDaughtersByBestZ1();
106  void createSortedVs();
107  bool checkDaughtership(MELAParticle const* myParticle)const;
108  void createAssociatedVs(std::vector<MELAParticle*>& particleArray);
109 
110  void addAssociatedParticleToArray(MELAParticle* myParticle, std::vector<MELAParticle*>& particleArray);
111  void addAssociatedParticleToArray(MELAThreeBodyDecayCandidate* myParticle, std::vector<MELAThreeBodyDecayCandidate*>& particleArray);
112 
113 };
114 
115 
116 
117 #endif
MELACandidate::getAssociatedTop
MELATopCandidate_t * getAssociatedTop(int index) const
Definition: MELACandidate.cc:172
MELACandidate::daughtersInterfere
bool daughtersInterfere() const
Definition: MELACandidate.cc:590
MELACandidate::getSortedVs
std::vector< MELAParticle * > & getSortedVs()
Definition: MELACandidate.cc:178
MELACandidate::setAddAssociatedByHighestPt
void setAddAssociatedByHighestPt(bool associatedByHighestPt_)
Definition: MELACandidate.cc:113
MELACandidate::addAssociatedJet
void addAssociatedJet(MELAParticle *myParticle)
Definition: MELACandidate.cc:616
MELACandidate::isShallowCopy
bool isShallowCopy
Definition: MELACandidate.h:92
MELACandidate::resetVs
void resetVs()
Definition: MELACandidate.cc:98
MELACandidate::selfDecayMode
TVar::CandidateDecayMode selfDecayMode
Definition: MELACandidate.h:93
MELACandidate::operator=
MELACandidate & operator=(const MELACandidate &particle_)
Definition: MELACandidate.cc:46
MELACandidate::associatedByHighestPt
bool associatedByHighestPt
Definition: MELACandidate.h:91
MELACandidate::getAssociatedNeutrino
MELAParticle * getAssociatedNeutrino(int index) const
Definition: MELACandidate.cc:160
MELACandidate::createAssociatedVs
void createAssociatedVs(std::vector< MELAParticle * > &particleArray)
Definition: MELACandidate.cc:643
MELACandidate::getSortedV
MELAParticle * getSortedV(int index) const
Definition: MELACandidate.cc:152
MELACandidate::getNAssociatedJets
int getNAssociatedJets() const
Definition: MELACandidate.h:60
MELACandidate::addAssociatedNeutrino
void addAssociatedNeutrino(MELAParticle *myParticle)
Definition: MELACandidate.cc:609
MELACandidate::getNAssociatedPhotons
int getNAssociatedPhotons() const
Definition: MELACandidate.h:59
MELACandidate::swap
void swap(MELACandidate &particle_)
Definition: MELACandidate.cc:84
TVar::CandidateDecayMode
CandidateDecayMode
Definition: TVar.hh:37
MELACandidate::getNAssociatedTops
int getNAssociatedTops() const
Definition: MELACandidate.h:61
MELACandidate::associatedNeutrinos
std::vector< MELAParticle * > associatedNeutrinos
Definition: MELACandidate.h:96
MELACandidate::addAssociatedVs
void addAssociatedVs()
Definition: MELACandidate.cc:639
MELACandidate::getAssociatedPhoton
MELAParticle * getAssociatedPhoton(int index) const
Definition: MELACandidate.cc:164
MELACandidate::getDaughterIds
virtual std::vector< int > getDaughterIds() const
Definition: MELACandidate.cc:128
MELACandidate::addAssociatedPhoton
void addAssociatedPhoton(MELAParticle *myParticle)
Definition: MELACandidate.cc:613
MELACandidate::getRelatedParticles
void getRelatedParticles(std::vector< MELAParticle * > &particles) const
Definition: MELACandidate.cc:699
MELACandidate::associatedTops
std::vector< MELATopCandidate_t * > associatedTops
Definition: MELACandidate.h:99
MELACandidate::shallowCopy
MELACandidate * shallowCopy()
Definition: MELACandidate.cc:61
MELACandidate::~MELACandidate
~MELACandidate()
Definition: MELACandidate.cc:51
MELACandidate::recreateVs
void recreateVs()
Definition: MELACandidate.cc:105
MELACandidate::getAssociatedPhotons
std::vector< MELAParticle * > & getAssociatedPhotons()
Definition: MELACandidate.cc:181
MELACandidate::associatedJets
std::vector< MELAParticle * > associatedJets
Definition: MELACandidate.h:98
MELACandidate::sortedDaughters
std::vector< MELAParticle * > sortedDaughters
Definition: MELACandidate.h:101
MELACandidate::associatedPhotons
std::vector< MELAParticle * > associatedPhotons
Definition: MELACandidate.h:97
MELACandidate::getAssociatedSortedVs
std::vector< MELAParticle * > getAssociatedSortedVs()
Definition: MELACandidate.cc:193
MELACandidate::addSortedV
void addSortedV(MELAParticle *myParticle)
Definition: MELACandidate.h:70
MELACandidate::getAlternativeVMomentum
TLorentzVector getAlternativeVMomentum(int index) const
Definition: MELACandidate.cc:547
MELACandidate::getSortedDaughter
MELAParticle * getSortedDaughter(int index) const
Definition: MELACandidate.cc:148
MELACandidate::getAssociatedLepton
MELAParticle * getAssociatedLepton(int index) const
Definition: MELACandidate.cc:156
MELACandidate::MELACandidate
MELACandidate()
Definition: MELACandidate.cc:12
MELACandidate::getAssociatedNeutrinos
std::vector< MELAParticle * > & getAssociatedNeutrinos()
Definition: MELACandidate.cc:180
MELACandidate::getAssociatedLeptons
std::vector< MELAParticle * > & getAssociatedLeptons()
Definition: MELACandidate.cc:179
MELACandidate::setDecayMode
void setDecayMode(TVar::CandidateDecayMode flag)
Definition: MELACandidate.cc:112
MELAThreeBodyDecayCandidate.h
MELACandidate::checkDaughtership
bool checkDaughtership(MELAParticle const *myParticle) const
Definition: MELACandidate.cc:602
MELACandidate::addUnordered
static void addUnordered(MELAParticle *myParticle, std::vector< MELAParticle * > &particleArray)
Definition: MELACandidate.cc:719
MELAParticle
Definition: MELAParticle.h:13
MELACandidate::getDaughterParticles
void getDaughterParticles(std::vector< MELAParticle * > &particles) const
Definition: MELACandidate.cc:708
MELACandidate::sortedVs
std::vector< MELAParticle * > sortedVs
Definition: MELACandidate.h:102
MELACandidate::addAssociatedTop
void addAssociatedTop(MELATopCandidate_t *myParticle)
Definition: MELACandidate.cc:619
MELACandidate::addAssociatedLepton
void addAssociatedLepton(MELAParticle *myParticle)
Definition: MELACandidate.cc:606
MELACandidate::testShallowCopy
bool testShallowCopy()
Definition: MELACandidate.cc:115
MELACandidate::getNAssociatedNeutrinos
int getNAssociatedNeutrinos() const
Definition: MELACandidate.h:58
MELACandidate::getAssociatedJet
MELAParticle * getAssociatedJet(int index) const
Definition: MELACandidate.cc:168
MELACandidate::getAssociatedTops
std::vector< MELATopCandidate_t * > & getAssociatedTops()
Definition: MELACandidate.cc:183
MELAParticle.h
MELACandidate::addByHighestPt
static void addByHighestPt(MELAParticle *myParticle, std::vector< MELAParticle * > &particleArray)
Definition: MELACandidate.cc:727
MELACandidate::addAssociatedParticleToArray
void addAssociatedParticleToArray(MELAParticle *myParticle, std::vector< MELAParticle * > &particleArray)
Definition: MELACandidate.cc:622
MELACandidate::associatedLeptons
std::vector< MELAParticle * > associatedLeptons
Definition: MELACandidate.h:95
MELACandidate::getNSortedVs
int getNSortedVs() const
Definition: MELACandidate.h:62
MELACandidate::sortDaughtersByBestZ1
void sortDaughtersByBestZ1()
Definition: MELACandidate.cc:324
MELACandidate::getAssociatedJets
std::vector< MELAParticle * > & getAssociatedJets()
Definition: MELACandidate.cc:182
MELACandidate::getSortedDaughters
std::vector< MELAParticle * > & getSortedDaughters()
Definition: MELACandidate.cc:177
MELACandidate::sortDaughters
void sortDaughters()
Definition: MELACandidate.cc:117
MELACandidate
Definition: MELACandidate.h:7
MELACandidate::createSortedVs
void createSortedVs()
Definition: MELACandidate.cc:487
MELAThreeBodyDecayCandidate
Definition: MELAThreeBodyDecayCandidate.h:7
MELACandidate::testPreSelectedDaughters
void testPreSelectedDaughters()
Definition: MELACandidate.cc:690
MELACandidate::getDecayMode
TVar::CandidateDecayMode getDecayMode() const
Definition: MELACandidate.h:55
MELACandidate::getNAssociatedLeptons
int getNAssociatedLeptons() const
Definition: MELACandidate.h:57
MELACandidate::getAssociatedParticleIds
std::vector< int > getAssociatedParticleIds() const
Definition: MELACandidate.cc:135
MELACandidate::setShallowCopy
void setShallowCopy(bool flag)
Definition: MELACandidate.cc:114
MELACandidate::sortDaughtersInitial
void sortDaughtersInitial()
Definition: MELACandidate.cc:218