4 #include "TLorentzVector.h" 9 bool operator()(TLorentzVector
const &
a, TLorentzVector
const &
b) {
10 if (a.Pt() == b.Pt() ) {
11 return a.Pt() < b.Pt();
13 return a.Pt() > b.Pt() ;
25 minPhotonPt =iConfig.
getParameter<
double>(
"minPhotonPt");
27 minPhotonEta =iConfig.
getParameter<
double>(
"minPhotonEta");
28 minLeptonEta =iConfig.
getParameter<
double>(
"minLeptonEta");
31 minDileptonMass =iConfig.
getParameter<
double>(
"minDileptonMass");
49 vector<TLorentzVector>
Lepton; Lepton.clear();
50 vector<TLorentzVector>
Photon; Photon.clear();
51 vector<float> Charge; Charge.clear();
53 for ( HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
54 p != myGenEvent->particles_end(); ++
p )
56 if ((*p)->status() == 1 && (
abs((*p)->pdg_id()) == 11 ||
abs((*p)->pdg_id()) == 13 ||
abs((*p)->pdg_id()) == 15)) {
57 TLorentzVector LeptP((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz(), (*p)->momentum().e());
59 Lepton.push_back(LeptP);
63 if (
abs((*p)->pdg_id()) == 22 && (*p)->status() == 1) {
64 TLorentzVector PhotP((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz(), (*p)->momentum().e());
65 if (PhotP.Pt() > minPhotonPt) {
66 Photon.push_back(PhotP);
83 std::stable_sort(Photon.begin(), Photon.end(),
orderByPt());
84 std::stable_sort(Lepton.begin(), Lepton.end(),
orderByPt());
98 !Photon.empty() && Lepton.size() > 1 &&
99 Photon[0].Pt() > minPhotonPt &&
102 Photon[0].Eta() > minPhotonEta &&
103 Lepton[0].Eta() > minLeptonEta &&
104 Lepton[1].Eta() > minLeptonEta &&
108 (Lepton[0]+Lepton[1]).M() > minDileptonMass &&
109 (Lepton[0]+Lepton[1]+Photon[0]).M() > minZgMass
T getParameter(std::string const &) const
bool operator()(TLorentzVector const &a, TLorentzVector const &b)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool filter(edm::Event &, const edm::EventSetup &) override
~ZgammaMassFilter() override
Abs< T >::type abs(const T &t)
const HepMC::GenEvent * GetEvent() const
bool accepted(std::vector< std::string_view > const &, std::string_view)
ZgammaMassFilter(const edm::ParameterSet &)