10 #include "TLorentzVector.h"
12 #include "CLHEP/Units/defs.h"
13 #include "CLHEP/Units/PhysicalConstants.h"
20 : wmanager_(iPSet, consumesCollector()),
21 hepmcCollection_(iPSet.getParameter<
edm::
InputTag>(
"hepmcCollection")),
22 _flavor(iPSet.getParameter<
int>(
"decaysTo")),
23 _name(iPSet.getParameter<
std::
string>(
"name")) {
39 nEvt =
dqm.book1dHisto(
"nEvt",
"n analyzed Events", 1, 0., 1.,
"bin",
"Number of Events");
42 Zmass =
dqm.book1dHisto(
"Zmass",
"inv. Mass Z", 70, 0, 140,
"M_{Z} (GeV)",
"Number of Events");
43 ZmassPeak =
dqm.book1dHisto(
"ZmassPeak",
"inv. Mass Z", 80, 80, 100,
"M_{Z} (GeV)",
"Number of Events");
44 Zpt =
dqm.book1dHisto(
"Zpt",
"Z pt", 100, 0, 200,
"P_{t}^{Z} (GeV)",
"Number of Events");
46 dqm.book1dHisto(
"ZptLog",
"log(Z pt)", 100, 0., 5.,
"log_{10}(P_{t}^{Z}) (log_{10}(GeV))",
"Number of Events");
47 Zrap =
dqm.book1dHisto(
"Zrap",
"Z y", 100, -5, 5,
"Y_{Z}",
"Number of Events");
48 Zdaughters =
dqm.book1dHisto(
"Zdaughters",
"Z daughters", 60, -30, 30,
"Z daughters (PDG ID)",
"Number of Events");
50 dilep_mass =
dqm.book1dHisto(
"dilep_mass",
"inv. Mass dilepton", 70, 0, 140,
"M_{ll} (GeV)",
"Number of Events");
52 dqm.book1dHisto(
"dilep_massPeak",
"inv. Mass dilepton", 80, 80, 100,
"M_{ll} (GeV)",
"Number of Events");
53 dilep_pt =
dqm.book1dHisto(
"dilep_pt",
"dilepton pt", 100, 0, 200,
"P_{t}^{ll} (GeV)",
"Number of Events");
55 "dilep_ptLog",
"log(dilepton pt)", 100, 0., 5.,
"log_{10}(P_{t}^{ll}) (log_{10}(GeV))",
"Number of Events");
56 dilep_rap =
dqm.book1dHisto(
"dilep_rap",
"dilepton y", 100, -5, 5,
"Y_{ll}",
"Number of Events");
59 "photon energy in Z rest frame",
63 "E_{#gamma}^{Z rest-frame} (GeV)",
66 "cos_theta_gamma_lepton in Z rest frame",
70 "cos(#theta_{#gamma-lepton}^{Z rest-frame})",
73 leadpt =
dqm.book1dHisto(
"leadpt",
"leading lepton pt", 200, 0., 200.,
"P_{t}^{1st-lepton}",
"Number of Events");
74 secpt =
dqm.book1dHisto(
"secpt",
"second lepton pt", 200, 0., 200.,
"P_{t}^{2nd-lepton}",
"Number of Events");
75 leadeta =
dqm.book1dHisto(
"leadeta",
"leading lepton eta", 100, -5., 5.,
"#eta^{1st-lepton}",
"Number of Events");
76 seceta =
dqm.book1dHisto(
"seceta",
"second lepton eta", 100, -5., 5.,
"#eta^{2nd-lepton}",
"Number of Events");
97 std::vector<const HepMC::GenParticle*> allproducts;
108 for (HepMC::GenEvent::particle_const_iterator iter = myGenEvent->particles_begin();
109 iter != myGenEvent->particles_end();
112 if ((*iter)->status() == 3 &&
std::abs((*iter)->pdg_id()) == 15)
115 if ((*iter)->status() == requiredstatus) {
117 allproducts.push_back(*iter);
122 if (allproducts.size() < 2)
129 std::vector<const HepMC::GenParticle*>
products;
130 products.push_back(allproducts.front());
132 double charge1 = PData1->charge();
133 for (
unsigned int i = 1;
i < allproducts.size(); ++
i) {
135 double charge2 = PData2->charge();
136 if (charge1 * charge2 < 0)
159 TLorentzVector dilepton_mom =
lep1 +
lep2;
160 TLorentzVector dilepton_andphoton_mom = dilepton_mom;
163 if (dilepton_mom.M() < 60.)
167 std::vector<const HepMC::GenParticle*> fsrphotons;
173 std::vector<TLorentzVector> gammasMomenta;
174 for (
unsigned int ipho = 0; ipho < fsrphotons.size(); ++ipho) {
175 TLorentzVector phomom(fsrphotons[ipho]->momentum().
x(),
176 fsrphotons[ipho]->momentum().
y(),
177 fsrphotons[ipho]->momentum().
z(),
178 fsrphotons[ipho]->momentum().
t());
179 dilepton_andphoton_mom += phomom;
181 gammasMomenta.push_back(phomom);
204 TVector3
boost = dilepton_andphoton_mom.BoostVector();
208 for (
unsigned int ipho = 0; ipho < gammasMomenta.size(); ++ipho) {
209 gammasMomenta[ipho].Boost(
boost);
211 std::sort(gammasMomenta.begin(), gammasMomenta.end(), HepMCValidationHelper::GreaterByE<TLorentzVector>);
214 if (!gammasMomenta.empty() && dilepton_andphoton_mom.M() > 50.) {
216 double dphi =
lep1.DeltaR(gammasMomenta.front()) <
lep2.DeltaR(gammasMomenta.front())
217 ?
lep1.DeltaPhi(gammasMomenta.front())
218 :
lep2.DeltaPhi(gammasMomenta.front());