test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ParticleReplacerZtautau.h
Go to the documentation of this file.
1 #ifndef TauAnalysis_MCEmbeddingTools_ParticleReplacerZtautau_h
2 #define TauAnalysis_MCEmbeddingTools_ParticleReplacerZtautau_h
3 
26 
33 
35 
36 #include <TTree.h>
37 
38 #include<string>
39 
41 {
42  public:
45 
47 
48  virtual std::auto_ptr<HepMC::GenEvent> produce(const std::vector<reco::Particle>&, const reco::Vertex* = 0, const HepMC::GenEvent* = 0, MCParticleReplacer* = 0);
49  virtual void beginRun(edm::Run&, const edm::EventSetup&);
50  virtual void beginJob();
51  virtual void endJob();
52 
53  private:
54  void transformMuMu2LepLep(CLHEP::HepRandomEngine& randomEngine, reco::Particle*, reco::Particle*);
56 
57  HepMC::GenEvent* processEventWithTauola(HepMC::GenEvent*);
58  HepMC::GenEvent* processEventWithPythia(HepMC::GenEvent*);
59 
60  bool testEvent(HepMC::GenEvent*);
61 
62  void cleanEvent(HepMC::GenEvent*, HepMC::GenVertex*);
63 
65  double beamEnergy_; // proton beam energy in GeV
66 
67  // this variable defines the type of decay to simulate
68  // 0 - mumu -> mumu
69  // 1 - mumu -> tautau (default value)
70  // 2 - mumu -> ee
71  // 3 - mumu -> taunu
72  // 4 - munu -> taunu
73  unsigned int transformationMode_;
74 
77  bool useTauola_;
79  double rfRotationAngle_; // angle of rotation around Z-direction of embedded leptons wrt. reconstructed muons
80  // (used to "place" simulated leptons in a detector region different from reconstructed muons,
81  // while preserving Z/W-boson momentum and spin effects)
82 
84  // keep track if TAUOLA interface has already been initialized.
85  // Needed to avoid multiple initializations of TAUOLA interface,
86  // which makes TAUOLA crash.
87  static bool tauola_isInitialized_;
88 
91 
93 
95 
96  struct MinVisPtCut
97  {
98  enum { kELEC, kMU, kHAD, kTAU };
99  int type_;
100  unsigned index_;
101  double threshold_;
102  void print(std::ostream& stream) const
103  {
104  std::string type_string = "";
105  if ( type_ == kELEC ) type_string = "elec";
106  else if ( type_ == kMU ) type_string = "mu";
107  else if ( type_ == kHAD ) type_string = "had";
108  else if ( type_ == kTAU ) type_string = "tau";
109  stream << type_string << " #" << index_ << ": threshold = " << threshold_ << std::endl;
110  }
111  };
113  {
115  std::vector<MinVisPtCut> cuts_;
116  void print(std::ostream& stream) const
117  {
118  stream << "<MinVisPtCutCombination::print>:" << std::endl;
119  stream << " cut = " << cut_string_ << std::endl;
120  stream << "elements:" << std::endl;
121  for ( std::vector<MinVisPtCut>::const_iterator cut = cuts_.begin();
122  cut != cuts_.end(); ++cut ) {
123  cut->print(stream);
124  }
125  }
126  };
127  std::vector<MinVisPtCutCombination> minVisPtCuts_;
128 
133 
135 
136 };
137 
138 #endif
139 
140 
CLHEP::HepRandomEngine * randomEngine
Definition: Dummies.cc:7
virtual void beginRun(edm::Run &, const edm::EventSetup &)
void print(std::ostream &stream) const
std::vector< MinVisPtCutCombination > minVisPtCuts_
virtual std::auto_ptr< HepMC::GenEvent > produce(const std::vector< reco::Particle > &, const reco::Vertex *=0, const HepMC::GenEvent *=0, MCParticleReplacer *=0)
virtual void declareExtraProducts(MCParticleReplacer *)
void transformMuMu2LepLep(CLHEP::HepRandomEngine &randomEngine, reco::Particle *, reco::Particle *)
HepMC::GenEvent * processEventWithPythia(HepMC::GenEvent *)
void cleanEvent(HepMC::GenEvent *, HepMC::GenVertex *)
void transformMuMu2TauNu(reco::Particle *, reco::Particle *)
HepMC::GenEvent * processEventWithTauola(HepMC::GenEvent *)
gen::TauolaInterfaceBase * tauola_
bool testEvent(HepMC::GenEvent *)
ParticleReplacerZtautau(const edm::ParameterSet &)
GenMuonRadiationAlgorithm * muonRadiationAlgo_
Definition: Run.h:41