Go to the documentation of this file.00001 #ifndef Validation_EventGenerator_HepMCValidationHelper
00002 #define Validation_EventGenerator_HepMCValidationHelper
00003
00004 #include <HepMC/GenEvent.h>
00005 #include <vector>
00006 #include "TLorentzVector.h"
00007
00008 namespace HepMCValidationHelper {
00009 template <class T> inline bool GreaterByE (const T& a1, const T& a2) {return a1.E() > a2.E();}
00010
00011
00012 inline bool sortByPt(const HepMC::GenParticle* a , const HepMC::GenParticle* b) {return a->momentum().perp() > b->momentum().perp(); }
00013
00014
00015 inline bool sortByE(const HepMC::GenParticle* a , const HepMC::GenParticle* b) {return a->momentum().e() > b->momentum().e(); }
00016
00017
00018 inline bool sortByRapidity(const HepMC::GenParticle* a , const HepMC::GenParticle* b) {
00019 const HepMC::FourVector& amom = a->momentum();
00020 const HepMC::FourVector& bmom = b->momentum();
00021 double rapa = 0.5 * std::log( (amom.e() + amom.z()) / (amom.e() - amom.z()) );
00022 double rapb = 0.5 * std::log( (bmom.e() + bmom.z()) / (bmom.e() - bmom.z()) );
00023 return rapa > rapb;
00024 }
00025
00026
00027 inline bool sortByPseudoRapidity(const HepMC::GenParticle* a , const HepMC::GenParticle* b) {return a->momentum().eta() > b->momentum().eta(); }
00028
00029 void findDescendents(const HepMC::GenParticle* a, std::vector<const HepMC::GenParticle*>& descendents);
00030
00031
00032 void allStatus1(const HepMC::GenEvent* all, std::vector<const HepMC::GenParticle*>& status1);
00033
00034
00035 void allStatus2(const HepMC::GenEvent* all, std::vector<const HepMC::GenParticle*>& status2);
00036
00037
00038 void allStatus3(const HepMC::GenEvent* all, std::vector<const HepMC::GenParticle*>& status3);
00039
00040
00041
00042 void findFSRPhotons(const std::vector<const HepMC::GenParticle*>& leptons,
00043 const std::vector<const HepMC::GenParticle*>& all,
00044 double deltaR,
00045 std::vector<const HepMC::GenParticle*>& photons);
00046
00047
00048
00049
00050 void findFSRPhotons(const std::vector<const HepMC::GenParticle*>& leptons,
00051 const HepMC::GenEvent* all,
00052 double deltaR,
00053 std::vector<const HepMC::GenParticle*>& photons);
00054
00055
00056 bool isChargedLepton(const HepMC::GenParticle* part);
00057
00058
00059 bool isNeutrino(const HepMC::GenParticle* part );
00060
00061
00062 bool isTau(const HepMC::GenParticle* part);
00063
00064
00065
00066
00067 void removeIsolatedLeptons(const HepMC::GenEvent* all, double deltaR, double sumPt, std::vector<const HepMC::GenParticle*>& pruned);
00068
00069
00070 void allStatus1(const HepMC::GenEvent* all, std::vector<const HepMC::GenParticle*>& status1);
00071
00072
00073 void allVisibleParticles(const HepMC::GenEvent* all, std::vector<const HepMC::GenParticle*>& visible);
00074
00075
00076 TLorentzVector genMet(const HepMC::GenEvent* all, double etamin = -9999., double etamax = 9999.);
00077
00078 }
00079
00080 #endif