CMS 3D CMS Logo

EmbeddingLHEProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: test/EmbeddingLHEProducer
4 // Class: EmbeddingLHEProducer
5 //
13 //
14 // Original Author: Stefan Wayand
15 // Created: Wed, 13 Jan 2016 08:15:01 GMT
16 //
17 //
18 
19 // system include files
20 #include "TLorentzVector.h"
21 #include <algorithm>
22 #include <fstream>
23 #include <iostream>
24 #include <iterator>
25 #include <memory>
26 #include <string>
27 
28 // user include files
31 
35 
37 
42 
48 
52 
53 #include "CLHEP/Random/RandExponential.h"
58 
59 namespace CLHEP {
60  class HepRandomEngine;
61 }
62 
63 class EmbeddingLHEProducer : public edm::one::EDProducer<edm::BeginRunProducer, edm::EndRunProducer> {
64 public:
65  explicit EmbeddingLHEProducer(const edm::ParameterSet &);
66  ~EmbeddingLHEProducer() override;
67 
68  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
69 
70 private:
71  void beginJob() override;
72  void produce(edm::Event &, const edm::EventSetup &) override;
73  void endJob() override;
74 
75  void beginRunProduce(edm::Run &run, edm::EventSetup const &es) override;
76  void endRunProduce(edm::Run &, edm::EventSetup const &) override;
77 
78  void fill_lhe_from_mumu(TLorentzVector &positiveLepton,
79  TLorentzVector &negativeLepton,
80  lhef::HEPEUP &outlhe,
81  CLHEP::HepRandomEngine *engine);
82  void fill_lhe_with_particle(lhef::HEPEUP &outlhe, TLorentzVector &particle, int pdgid, double spin, double ctau);
83 
84  void transform_mumu_to_tautau(TLorentzVector &positiveLepton, TLorentzVector &negativeLepton);
86  void assign_4vector(TLorentzVector &Lepton, const pat::Muon *muon, std::string FSRmode);
87  void mirror(TLorentzVector &positiveLepton, TLorentzVector &negativeLepton);
88  void InitialRecoCorrection(TLorentzVector &positiveLepton, TLorentzVector &negativeLepton);
89  void rotate180(TLorentzVector &positiveLepton, TLorentzVector &negativeLepton);
90 
92 
97  static constexpr double tauMass_ = 1.77682;
98  static constexpr double muonMass_ = 0.1057;
99  static constexpr double elMass_ = 0.00051;
100  const int embeddingParticles[3]{11, 13, 15};
101 
102  std::ofstream file;
104 
105  // instead of reconstruted 4vectors of muons generated are taken to study FSR. Possible modes:
106  // afterFSR - muons without FSR photons taken into account
107  // beforeFSR - muons with FSR photons taken into account
109 };
110 
111 //
112 // constructors and destructor
113 //
115  // register your products
116  produces<LHEEventProduct>();
117  produces<LHERunInfoProduct, edm::Transition::BeginRun>();
118  produces<math::XYZTLorentzVectorD>("vertexPosition");
119 
120  muonsCollection_ = consumes<edm::View<pat::Muon>>(iConfig.getParameter<edm::InputTag>("src"));
121  vertexCollection_ = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertices"));
122  particleToEmbed_ = iConfig.getParameter<int>("particleToEmbed");
123  mirror_ = iConfig.getParameter<bool>("mirror");
124  InitialRecoCorrection_ = iConfig.getParameter<bool>("InitialRecoCorrection");
125  rotate180_ = iConfig.getParameter<bool>("rotate180");
126  studyFSRmode_ = iConfig.getUntrackedParameter<std::string>("studyFSRmode", "");
127 
128  write_lheout = false;
129  std::string lhe_ouputfile = iConfig.getUntrackedParameter<std::string>("lhe_outputfilename", "");
130  if (!lhe_ouputfile.empty()) {
131  write_lheout = true;
132  file.open(lhe_ouputfile, std::fstream::out | std::fstream::trunc);
133  }
134 
135  // check if particle can be embedded
136  if (std::find(std::begin(embeddingParticles), std::end(embeddingParticles), particleToEmbed_) ==
137  std::end(embeddingParticles)) {
138  throw cms::Exception("Configuration") << "The given particle to embed is not in the list of allowed particles.";
139  }
140 
142  if (!rng.isAvailable()) {
143  throw cms::Exception("Configuration") << "The EmbeddingLHEProducer requires the RandomNumberGeneratorService\n"
144  "which is not present in the configuration file. \n"
145  "You must add the service\n"
146  "in the configuration file or remove the modules that require it.";
147  }
148 }
149 
151 
152 //
153 // member functions
154 //
155 
156 // ------------ method called to produce the data ------------
158  using namespace edm;
159 
161  CLHEP::HepRandomEngine *engine = &rng->getEngine(iEvent.streamID());
162 
164  iEvent.getByToken(muonsCollection_, muonHandle);
165  edm::View<pat::Muon> coll_muons = *muonHandle;
166 
167  Handle<std::vector<reco::Vertex>> coll_vertices;
168  iEvent.getByToken(vertexCollection_, coll_vertices);
169 
170  TLorentzVector positiveLepton, negativeLepton;
171  bool mu_plus_found = false;
172  bool mu_minus_found = false;
173  lhef::HEPEUP hepeup;
174  hepeup.IDPRUP = 0;
175  hepeup.XWGTUP = 1;
176  hepeup.SCALUP = -1;
177  hepeup.AQEDUP = -1;
178  hepeup.AQCDUP = -1;
179  // Assuming Pt-Order
180  for (edm::View<pat::Muon>::const_iterator muon = coll_muons.begin(); muon != coll_muons.end(); ++muon) {
181  if (muon->charge() == 1 && !mu_plus_found) {
182  assign_4vector(positiveLepton, &(*muon), studyFSRmode_);
183  mu_plus_found = true;
184  } else if (muon->charge() == -1 && !mu_minus_found) {
185  assign_4vector(negativeLepton, &(*muon), studyFSRmode_);
186  mu_minus_found = true;
187  } else if (mu_minus_found && mu_plus_found)
188  break;
189  }
191  positiveLepton,
192  negativeLepton); // corrects Z mass peak to take into account smearing happening due to first muon reconstruction in the selection step
193  mirror(positiveLepton, negativeLepton); // if no mirror, function does nothing.
194  rotate180(positiveLepton, negativeLepton); // if no rotate180, function does nothing
195  transform_mumu_to_tautau(positiveLepton, negativeLepton); // if MuonEmbedding, function does nothing.
196  fill_lhe_from_mumu(positiveLepton, negativeLepton, hepeup, engine);
197 
198  double originalXWGTUP_ = 1.;
199  std::unique_ptr<LHEEventProduct> product(new LHEEventProduct(hepeup, originalXWGTUP_));
200 
201  if (write_lheout)
202  std::copy(product->begin(), product->end(), std::ostream_iterator<std::string>(file));
203 
204  iEvent.put(std::move(product));
205  // Saving vertex position
206  std::unique_ptr<math::XYZTLorentzVectorD> vertex_position(
207  new math::XYZTLorentzVectorD(coll_vertices->at(0).x(), coll_vertices->at(0).y(), coll_vertices->at(0).z(), 0.0));
208  iEvent.put(std::move(vertex_position), "vertexPosition");
209 }
210 
211 // ------------ method called once each job just before starting event loop ------------
213 
214 // ------------ method called once each job just after ending the event loop ------------
216 
217 // ------------ method called when starting to processes a run ------------
218 
220  // fill HEPRUP common block and store in edm::Run
221  lhef::HEPRUP heprup;
222 
223  // set number of processes: 1 for Z to tau tau
224  heprup.resize(1);
225 
226  // master switch for event weight iterpretation (same as in officially produced DYJets LHE files)
227  heprup.IDWTUP = 3;
228 
229  // Information for first process (Z to tau tau), for now only placeholder:
230  heprup.XSECUP[0] = 1.;
231  heprup.XERRUP[0] = 0;
232  heprup.XMAXUP[0] = 1;
233  heprup.LPRUP[0] = 1;
234 
235  std::unique_ptr<LHERunInfoProduct> runInfo(new LHERunInfoProduct(heprup));
236  runInfo->addHeader(give_slha());
237 
238  if (write_lheout)
239  std::copy(runInfo->begin(), runInfo->end(), std::ostream_iterator<std::string>(file));
240  run.put(std::move(runInfo));
241 }
242 
244  if (write_lheout) {
246  file.close();
247  }
248 }
249 
250 void EmbeddingLHEProducer::fill_lhe_from_mumu(TLorentzVector &positiveLepton,
251  TLorentzVector &negativeLepton,
252  lhef::HEPEUP &outlhe,
253  CLHEP::HepRandomEngine *engine) {
254  TLorentzVector Z = positiveLepton + negativeLepton;
255  int leptonPDGID = particleToEmbed_;
256 
257  static constexpr double tau_ctau0 = 8.71100e-02; // mm (for Pythia)
258  double tau_ctau_p = tau_ctau0 * CLHEP::RandExponential::shoot(engine);
259  double tau_ctau_n = tau_ctau0 * CLHEP::RandExponential::shoot(engine);
260 
261  fill_lhe_with_particle(outlhe, Z, 23, 9.0, 0);
262  fill_lhe_with_particle(outlhe, positiveLepton, -leptonPDGID, 1.0, tau_ctau_p);
263  fill_lhe_with_particle(outlhe, negativeLepton, leptonPDGID, -1.0, tau_ctau_n);
264 
265  return;
266 }
267 
269  lhef::HEPEUP &outlhe, TLorentzVector &particle, int pdgid, double spin, double ctau) {
270  // Pay attention to different index conventions:
271  // 'particleindex' follows usual C++ index conventions starting at 0 for a list.
272  // 'motherindex' follows the LHE index conventions: 0 is for 'not defined', so the listing starts at 1.
273  // That means: LHE index 1 == C++ index 0.
274  int particleindex = outlhe.NUP;
275  outlhe.resize(outlhe.NUP + 1);
276 
277  outlhe.PUP[particleindex][0] = particle.Px();
278  outlhe.PUP[particleindex][1] = particle.Py();
279  outlhe.PUP[particleindex][2] = particle.Pz();
280  outlhe.PUP[particleindex][3] = particle.E();
281  outlhe.PUP[particleindex][4] = particle.M();
282  outlhe.IDUP[particleindex] = pdgid;
283  outlhe.SPINUP[particleindex] = spin;
284  outlhe.VTIMUP[particleindex] = ctau;
285 
286  outlhe.ICOLUP[particleindex].first = 0;
287  outlhe.ICOLUP[particleindex].second = 0;
288 
289  if (std::abs(pdgid) == 23) {
290  outlhe.MOTHUP[particleindex].first = 0; // No Mother
291  outlhe.MOTHUP[particleindex].second = 0;
292  outlhe.ISTUP[particleindex] = 2; // status
293  }
294 
295  if (std::find(std::begin(embeddingParticles), std::end(embeddingParticles), std::abs(pdgid)) !=
296  std::end(embeddingParticles)) {
297  outlhe.MOTHUP[particleindex].first = 1; // Mother is the Z (first partile)
298  outlhe.MOTHUP[particleindex].second = 1; // Mother is the Z (first partile)
299 
300  outlhe.ISTUP[particleindex] = 1; // status
301  }
302 
303  return;
304 }
305 
306 void EmbeddingLHEProducer::transform_mumu_to_tautau(TLorentzVector &positiveLepton, TLorentzVector &negativeLepton) {
307  // No corrections applied for muon embedding
308  double lep_mass;
309  if (particleToEmbed_ == 11) {
310  lep_mass = elMass_;
311  } else if (particleToEmbed_ == 15) {
312  lep_mass = tauMass_;
313  } else {
314  return;
315  }
316 
317  TLorentzVector Z = positiveLepton + negativeLepton;
318 
319  TVector3 boost_from_Z_to_LAB = Z.BoostVector();
320  TVector3 boost_from_LAB_to_Z = -Z.BoostVector();
321  // Boosting the two leptons to Z restframe, then both are back to back. This means, same 3-momentum squared
322  positiveLepton.Boost(boost_from_LAB_to_Z);
323  negativeLepton.Boost(boost_from_LAB_to_Z);
324 
325  // Energy of tau = 0.5*Z-mass
326  double lep_mass_squared = lep_mass * lep_mass;
327  double lep_energy_squared = 0.25 * Z.M2();
328  double lep_3momentum_squared = lep_energy_squared - lep_mass_squared;
329  if (lep_3momentum_squared < 0) {
330  edm::LogWarning("TauEmbedding") << "3-Momentum squared is negative";
331  return;
332  }
333 
334  // Computing scale, applying it on the 3-momenta and building new 4 momenta of the taus
335  double scale = std::sqrt(lep_3momentum_squared / positiveLepton.Vect().Mag2());
336  positiveLepton.SetPxPyPzE(scale * positiveLepton.Px(),
337  scale * positiveLepton.Py(),
338  scale * positiveLepton.Pz(),
339  std::sqrt(lep_energy_squared));
340  negativeLepton.SetPxPyPzE(scale * negativeLepton.Px(),
341  scale * negativeLepton.Py(),
342  scale * negativeLepton.Pz(),
343  std::sqrt(lep_energy_squared));
344 
345  // Boosting the new taus back to LAB frame
346  positiveLepton.Boost(boost_from_Z_to_LAB);
347  negativeLepton.Boost(boost_from_Z_to_LAB);
348 
349  return;
350 }
351 
352 void EmbeddingLHEProducer::assign_4vector(TLorentzVector &Lepton, const pat::Muon *muon, std::string FSRmode) {
353  if ("afterFSR" == FSRmode && muon->genParticle() != nullptr) {
354  const reco::GenParticle *afterFSRMuon = muon->genParticle();
355  Lepton.SetPxPyPzE(
356  afterFSRMuon->p4().px(), afterFSRMuon->p4().py(), afterFSRMuon->p4().pz(), afterFSRMuon->p4().e());
357  } else if ("beforeFSR" == FSRmode && muon->genParticle() != nullptr) {
358  const reco::Candidate *beforeFSRMuon = find_original_muon(muon->genParticle());
359  Lepton.SetPxPyPzE(
360  beforeFSRMuon->p4().px(), beforeFSRMuon->p4().py(), beforeFSRMuon->p4().pz(), beforeFSRMuon->p4().e());
361  } else {
362  Lepton.SetPxPyPzE(muon->p4().px(), muon->p4().py(), muon->p4().pz(), muon->p4().e());
363  }
364  return;
365 }
366 
368  if (muon->mother(0) == nullptr)
369  return muon;
370  if (muon->pdgId() == muon->mother(0)->pdgId())
371  return find_original_muon(muon->mother(0));
372  else
373  return muon;
374 }
375 
376 void EmbeddingLHEProducer::rotate180(TLorentzVector &positiveLepton, TLorentzVector &negativeLepton) {
377  if (!rotate180_)
378  return;
379  edm::LogInfo("TauEmbedding") << "Applying 180<C2><B0> rotation";
380  // By construction, the 3-momenta of mu-, mu+ and Z are in one plane.
381  // That means, one vector for perpendicular projection can be used for both leptons.
382  TLorentzVector Z = positiveLepton + negativeLepton;
383 
384  edm::LogInfo("TauEmbedding") << "MuMinus before. Pt: " << negativeLepton.Pt() << " Eta: " << negativeLepton.Eta()
385  << " Phi: " << negativeLepton.Phi() << " Mass: " << negativeLepton.M();
386 
387  TVector3 Z3 = Z.Vect();
388  TVector3 positiveLepton3 = positiveLepton.Vect();
389  TVector3 negativeLepton3 = negativeLepton.Vect();
390 
391  TVector3 p3_perp = positiveLepton3 - positiveLepton3.Dot(Z3) / Z3.Dot(Z3) * Z3;
392  p3_perp = p3_perp.Unit();
393 
394  positiveLepton3 -= 2 * positiveLepton3.Dot(p3_perp) * p3_perp;
395  negativeLepton3 -= 2 * negativeLepton3.Dot(p3_perp) * p3_perp;
396 
397  positiveLepton.SetVect(positiveLepton3);
398  negativeLepton.SetVect(negativeLepton3);
399 
400  edm::LogInfo("TauEmbedding") << "MuMinus after. Pt: " << negativeLepton.Pt() << " Eta: " << negativeLepton.Eta()
401  << " Phi: " << negativeLepton.Phi() << " Mass: " << negativeLepton.M();
402 
403  return;
404 }
405 
406 void EmbeddingLHEProducer::InitialRecoCorrection(TLorentzVector &positiveLepton, TLorentzVector &negativeLepton) {
408  return;
409  edm::LogInfo("TauEmbedding") << "Applying initial reconstruction correction";
410  TLorentzVector Z = positiveLepton + negativeLepton;
411  edm::LogInfo("TauEmbedding") << "MuMinus before. Pt: " << negativeLepton.Pt() << " Mass: " << negativeLepton.M();
412  float diLeptonMass = (positiveLepton + negativeLepton).M();
413  if (diLeptonMass > 60. && diLeptonMass < 122.) {
414  static constexpr float zmass = 91.1876;
415  float correction_deviation =
416  5.; // to ensure only a correction that drops corresponding to a Gaussian with mean zmass and std. dev. 5 GeV
417  double EmbeddingCorrection =
418  1.138; // value derived by function fitting to fold embedded mass spectrum back to original selection when using mu -> mu embedding
419  EmbeddingCorrection /=
420  (EmbeddingCorrection -
421  (EmbeddingCorrection - 1.) * exp(-pow((diLeptonMass - zmass), 2.) / (2. * pow(correction_deviation, 2.))));
422  EmbeddingCorrection = ((diLeptonMass + (EmbeddingCorrection - 1.) * zmass) / (diLeptonMass * EmbeddingCorrection));
423  double correctedpositiveLeptonEnergy =
424  std::sqrt((pow(muonMass_, 2) / pow(EmbeddingCorrection, 2)) + pow(positiveLepton.Px(), 2) +
425  pow(positiveLepton.Py(), 2) + pow(positiveLepton.Pz(), 2));
426  double correctednegativeLeptonEnergy =
427  std::sqrt((pow(muonMass_, 2) / pow(EmbeddingCorrection, 2)) + pow(negativeLepton.Px(), 2) +
428  pow(negativeLepton.Py(), 2) + pow(negativeLepton.Pz(), 2));
429  positiveLepton.SetE(correctedpositiveLeptonEnergy);
430  negativeLepton.SetE(correctednegativeLeptonEnergy);
431  positiveLepton *= EmbeddingCorrection;
432  negativeLepton *= EmbeddingCorrection;
433  edm::LogInfo("TauEmbedding") << "MuMinus after. Pt: " << negativeLepton.Pt() << " Mass: " << negativeLepton.M();
434  }
435  return;
436 }
437 
438 void EmbeddingLHEProducer::mirror(TLorentzVector &positiveLepton, TLorentzVector &negativeLepton) {
439  if (!mirror_)
440  return;
441  edm::LogInfo("TauEmbedding") << "Applying mirroring";
442  TLorentzVector Z = positiveLepton + negativeLepton;
443 
444  edm::LogInfo("TauEmbedding") << "MuMinus before. Pt: " << negativeLepton.Pt() << " Eta: " << negativeLepton.Eta()
445  << " Phi: " << negativeLepton.Phi() << " Mass: " << negativeLepton.M();
446 
447  TVector3 Z3 = Z.Vect();
448  TVector3 positiveLepton3 = positiveLepton.Vect();
449  TVector3 negativeLepton3 = negativeLepton.Vect();
450 
451  TVector3 beam(0., 0., 1.);
452  TVector3 perpToZandBeam = Z3.Cross(beam).Unit();
453 
454  positiveLepton3 -= 2 * positiveLepton3.Dot(perpToZandBeam) * perpToZandBeam;
455  negativeLepton3 -= 2 * negativeLepton3.Dot(perpToZandBeam) * perpToZandBeam;
456 
457  positiveLepton.SetVect(positiveLepton3);
458  negativeLepton.SetVect(negativeLepton3);
459 
460  edm::LogInfo("TauEmbedding") << "MuMinus after. Pt: " << negativeLepton.Pt() << " Eta: " << negativeLepton.Eta()
461  << " Phi: " << negativeLepton.Phi() << " Mass: " << negativeLepton.M();
462 
463  return;
464 }
465 
467  LHERunInfoProduct::Header slhah("slha");
468 
469  slhah.addLine("######################################################################\n");
470  slhah.addLine("## PARAM_CARD AUTOMATICALY GENERATED BY MG5 FOLLOWING UFO MODEL ####\n");
471  slhah.addLine("######################################################################\n");
472  slhah.addLine("## ##\n");
473  slhah.addLine("## Width set on Auto will be computed following the information ##\n");
474  slhah.addLine("## present in the decay.py files of the model. ##\n");
475  slhah.addLine("## See arXiv:1402.1178 for more details. ##\n");
476  slhah.addLine("## ##\n");
477  slhah.addLine("######################################################################\n");
478  slhah.addLine("\n");
479  slhah.addLine("###################################\n");
480  slhah.addLine("## INFORMATION FOR MASS\n");
481  slhah.addLine("###################################\n");
482  slhah.addLine("Block mass \n");
483  slhah.addLine(" 6 1.730000e+02 # MT \n");
484  slhah.addLine(" 15 1.777000e+00 # MTA \n");
485  slhah.addLine(" 23 9.118800e+01 # MZ \n");
486  slhah.addLine(" 25 1.250000e+02 # MH \n");
487  slhah.addLine("## Dependent parameters, given by model restrictions.\n");
488  slhah.addLine("## Those values should be edited following the \n");
489  slhah.addLine("## analytical expression. MG5 ignores those values \n");
490  slhah.addLine("## but they are important for interfacing the output of MG5\n");
491  slhah.addLine("## to external program such as Pythia.\n");
492  slhah.addLine(" 1 0.000000 # d : 0.0 \n");
493  slhah.addLine(" 2 0.000000 # u : 0.0 \n");
494  slhah.addLine(" 3 0.000000 # s : 0.0 \n");
495  slhah.addLine(" 4 0.000000 # c : 0.0 \n");
496  slhah.addLine(" 5 0.000000 # b : 0.0 \n");
497  slhah.addLine(" 11 0.000000 # e- : 0.0 \n");
498  slhah.addLine(" 12 0.000000 # ve : 0.0 \n");
499  slhah.addLine(" 13 0.000000 # mu- : 0.0 \n");
500  slhah.addLine(" 14 0.000000 # vm : 0.0 \n");
501  slhah.addLine(" 16 0.000000 # vt : 0.0 \n");
502  slhah.addLine(" 21 0.000000 # g : 0.0 \n");
503  slhah.addLine(" 22 0.000000 # a : 0.0 \n");
504  slhah.addLine(
505  " 24 80.419002 # w+ : cmath.sqrt(MZ__exp__2/2. + cmath.sqrt(MZ__exp__4/4. - "
506  "(aEW*cmath.pi*MZ__exp__2)/(Gf*sqrt__2))) \n");
507  slhah.addLine("\n");
508  slhah.addLine("###################################\n");
509  slhah.addLine("## INFORMATION FOR SMINPUTS\n");
510  slhah.addLine("###################################\n");
511  slhah.addLine("Block sminputs \n");
512  slhah.addLine(" 1 1.325070e+02 # aEWM1 \n");
513  slhah.addLine(" 2 1.166390e-05 # Gf \n");
514  slhah.addLine(" 3 1.180000e-01 # aS \n");
515  slhah.addLine("\n");
516  slhah.addLine("###################################\n");
517  slhah.addLine("## INFORMATION FOR WOLFENSTEIN\n");
518  slhah.addLine("###################################\n");
519  slhah.addLine("Block wolfenstein \n");
520  slhah.addLine(" 1 2.253000e-01 # lamWS \n");
521  slhah.addLine(" 2 8.080000e-01 # AWS \n");
522  slhah.addLine(" 3 1.320000e-01 # rhoWS \n");
523  slhah.addLine(" 4 3.410000e-01 # etaWS \n");
524  slhah.addLine("\n");
525  slhah.addLine("###################################\n");
526  slhah.addLine("## INFORMATION FOR YUKAWA\n");
527  slhah.addLine("###################################\n");
528  slhah.addLine("Block yukawa \n");
529  slhah.addLine(" 6 1.730000e+02 # ymt \n");
530  slhah.addLine(" 15 1.777000e+00 # ymtau \n");
531  slhah.addLine("\n");
532  slhah.addLine("###################################\n");
533  slhah.addLine("## INFORMATION FOR DECAY\n");
534  slhah.addLine("###################################\n");
535  slhah.addLine("DECAY 6 1.491500e+00 # WT \n");
536  slhah.addLine("DECAY 15 2.270000e-12 # WTau \n");
537  slhah.addLine("DECAY 23 2.441404e+00 # WZ \n");
538  slhah.addLine("DECAY 24 2.047600e+00 # WW \n");
539  slhah.addLine("DECAY 25 6.382339e-03 # WH \n");
540  slhah.addLine("## Dependent parameters, given by model restrictions.\n");
541  slhah.addLine("## Those values should be edited following the \n");
542  slhah.addLine("## analytical expression. MG5 ignores those values \n");
543  slhah.addLine("## but they are important for interfacing the output of MG5\n");
544  slhah.addLine("## to external program such as Pythia.\n");
545  slhah.addLine("DECAY 1 0.000000 # d : 0.0 \n");
546  slhah.addLine("DECAY 2 0.000000 # u : 0.0 \n");
547  slhah.addLine("DECAY 3 0.000000 # s : 0.0 \n");
548  slhah.addLine("DECAY 4 0.000000 # c : 0.0 \n");
549  slhah.addLine("DECAY 5 0.000000 # b : 0.0 \n");
550  slhah.addLine("DECAY 11 0.000000 # e- : 0.0 \n");
551  slhah.addLine("DECAY 12 0.000000 # ve : 0.0 \n");
552  slhah.addLine("DECAY 13 0.000000 # mu- : 0.0 \n");
553  slhah.addLine("DECAY 14 0.000000 # vm : 0.0 \n");
554  slhah.addLine("DECAY 16 0.000000 # vt : 0.0 \n");
555  slhah.addLine("DECAY 21 0.000000 # g : 0.0 \n");
556  slhah.addLine("DECAY 22 0.000000 # a : 0.0\n");
557 
558  return slhah;
559 }
560 
561 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
563  // The following says we do not know what parameters are allowed so do no validation
564  // Please change this to state exactly what you do use, even if it is no parameters
566  desc.setUnknown();
567  descriptions.addDefault(desc);
568 }
569 
570 // define this as a plug-in
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void resize(int nrup)
Definition: LesHouches.h:44
void mirror(TLorentzVector &positiveLepton, TLorentzVector &negativeLepton)
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
void InitialRecoCorrection(TLorentzVector &positiveLepton, TLorentzVector &negativeLepton)
std::vector< std::pair< int, int > > ICOLUP
Definition: LesHouches.h:240
std::vector< double > VTIMUP
Definition: LesHouches.h:252
void transform_mumu_to_tautau(TLorentzVector &positiveLepton, TLorentzVector &negativeLepton)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
const LorentzVector & p4() const final
four-momentum Lorentz vector
void fill_lhe_with_particle(lhef::HEPEUP &outlhe, TLorentzVector &particle, int pdgid, double spin, double ctau)
void beginRunProduce(edm::Run &run, edm::EventSetup const &es) override
T getUntrackedParameter(std::string const &, T const &) const
LHERunInfoProduct::Header give_slha()
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int iEvent
Definition: GenABIO.cc:224
void addDefault(ParameterSetDescription const &psetDescription)
void resize(int nup)
Definition: LesHouches.h:161
void assign_4vector(TLorentzVector &Lepton, const pat::Muon *muon, std::string FSRmode)
T sqrt(T t)
Definition: SSEVec.h:23
std::vector< FiveVector > PUP
Definition: LesHouches.h:246
std::vector< double > SPINUP
Definition: LesHouches.h:259
void addLine(const std::string &line)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static constexpr double tauMass_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::vector< int > ISTUP
Definition: LesHouches.h:228
void endRunProduce(edm::Run &, edm::EventSetup const &) override
std::vector< std::pair< int, int > > MOTHUP
Definition: LesHouches.h:234
std::vector< int > IDUP
Definition: LesHouches.h:223
std::vector< double > XERRUP
Definition: LesHouches.h:118
Log< level::Info, false > LogInfo
std::vector< double > XMAXUP
Definition: LesHouches.h:123
double AQCDUP
Definition: LesHouches.h:218
static constexpr double elMass_
void rotate180(TLorentzVector &positiveLepton, TLorentzVector &negativeLepton)
edm::EDGetTokenT< edm::View< pat::Muon > > muonsCollection_
void produce(edm::Event &, const edm::EventSetup &) override
const reco::Candidate * find_original_muon(const reco::Candidate *muon)
HLT enums.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:88
edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
static const std::string & endOfFile()
double AQEDUP
Definition: LesHouches.h:213
bool isAvailable() const
Definition: Service.h:40
void fill_lhe_from_mumu(TLorentzVector &positiveLepton, TLorentzVector &negativeLepton, lhef::HEPEUP &outlhe, CLHEP::HepRandomEngine *engine)
Definition: Lepton.py:1
const_iterator begin() const
std::vector< double > XSECUP
Definition: LesHouches.h:112
Log< level::Warning, false > LogWarning
double XWGTUP
Definition: LesHouches.h:194
Analysis-level muon class.
Definition: Muon.h:51
const_iterator end() const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
def move(src, dest)
Definition: eostools.py:511
static constexpr double muonMass_
Definition: Run.h:45
EmbeddingLHEProducer(const edm::ParameterSet &)
std::vector< int > LPRUP
Definition: LesHouches.h:128
double SCALUP
Definition: LesHouches.h:208
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector