CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ParticleReplacerClass.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Replacer
4 // Class: Replacer
5 //
13 //
14 // Original Author: Manuel Zeise
15 //
16 //
17 
18 
19 // system include files
21 
22 #include <stack>
23 #include <queue>
24 
25 #include "Math/LorentzVector.h"
26 #include "Math/VectorUtil.h"
28 
31 
32 /*
33 #include "HepMC/IO_HEPEVT.h"
34 #include "HepMC/GenParticle.h"
35 #include "HepMC/GenVertex.h"
36 #include "HepMC/PythiaWrapper.h"
37 */
41 
43 
45 #include "HepPDT/ParticleDataTable.hh"
46 
48 
51 #include "TTree.h"
52 
53 #include<string>
54 
55 
57 {
58 public:
59  explicit ParticleReplacerClass(const edm::ParameterSet&, bool);
61 
62  virtual std::auto_ptr<HepMC::GenEvent> produce(const reco::MuonCollection& muons, const reco::Vertex *pvtx=0, const HepMC::GenEvent *genEvt=0);
63  virtual void beginRun(edm::Run& iRun,const edm::EventSetup& iSetup);
64  virtual void endJob();
65 
66 private:
67  void transformMuMu2TauTau(reco::Particle * muon1, reco::Particle * muon2);
68  void transformMuMu2TauNu(reco::Particle * muon1, reco::Particle * muon2);
69 
70  HepMC::GenEvent * processEventWithTauola(HepMC::GenEvent * evt);
71  HepMC::GenEvent * processEventWithPythia(HepMC::GenEvent * evt);
72 
73  bool testEvent(HepMC::GenEvent * evt);
74 
75  void cleanEvent(HepMC::GenEvent * evt, HepMC::GenVertex * vtx);
76  void repairBarcodes(HepMC::GenEvent * evt);
77 
79  // 0 fullEvent (incl. all other particles)
80  // 1 taus only (create an event only with the two decaying taus)
81  unsigned int replacementMode_;
82  std::string generatorMode_;
84 
85  // this variable defines the type of decay to simulate
86  // 0 - mumu->mumu (i.e. no transformation)
87  // 1 - mumu->tautau (default value)
88  unsigned int transformationMode_;
89 
92  bool useTauola_ ;
94 
96 
98 
99  struct MinVisPtCut { enum { ELEC, MU, HAD, TAU } type_; unsigned int index_; double pt_; };
100  std::vector<std::vector<MinVisPtCut> > minVisPtCuts_;
101 // double minVisibleTransverseMomentum_;
102 
105 
106  TTree * outTree;
107  int attempts;
109 };
110 
111 
HepMC::GenEvent * processEventWithPythia(HepMC::GenEvent *evt)
void repairBarcodes(HepMC::GenEvent *evt)
enum ParticleReplacerClass::MinVisPtCut::@449 type_
ParticleReplacerClass(const edm::ParameterSet &, bool)
bool testEvent(HepMC::GenEvent *evt)
unsigned int replacementMode_
replace mode:
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
gen::TauolaInterfaceBase * tauola_
void cleanEvent(HepMC::GenEvent *evt, HepMC::GenVertex *vtx)
void transformMuMu2TauNu(reco::Particle *muon1, reco::Particle *muon2)
transform a muon pair into tau nu (as coming from a W boson)
tuple muons
Definition: patZpeak.py:38
virtual void beginRun(edm::Run &iRun, const edm::EventSetup &iSetup)
void transformMuMu2TauTau(reco::Particle *muon1, reco::Particle *muon2)
transform a muon pair into a tau pair
virtual std::auto_ptr< HepMC::GenEvent > produce(const reco::MuonCollection &muons, const reco::Vertex *pvtx=0, const HepMC::GenEvent *genEvt=0)
HepMC::GenEvent * processEventWithTauola(HepMC::GenEvent *evt)
std::vector< std::vector< MinVisPtCut > > minVisPtCuts_
Definition: Run.h:33