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 
31 
33 
34 #include <TTree.h>
35 
36 #include<string>
37 
39 {
40  public:
43 
45 
46  virtual std::auto_ptr<HepMC::GenEvent> produce(const std::vector<reco::Particle>&, const reco::Vertex* = 0, const HepMC::GenEvent* = 0, MCParticleReplacer* = 0);
47  virtual void beginRun(edm::Run&, const edm::EventSetup&);
48  virtual void beginJob();
49  virtual void endJob();
50 
51  private:
54 
55  HepMC::GenEvent* processEventWithTauola(HepMC::GenEvent*);
56  HepMC::GenEvent* processEventWithPythia(HepMC::GenEvent*);
57 
58  bool testEvent(HepMC::GenEvent*);
59 
60  void cleanEvent(HepMC::GenEvent*, HepMC::GenVertex*);
61 
63  double beamEnergy_; // proton beam energy in GeV
64 
65  // this variable defines the type of decay to simulate
66  // 0 - mumu -> mumu
67  // 1 - mumu -> tautau (default value)
68  // 2 - mumu -> ee
69  // 3 - mumu -> taunu
70  // 4 - munu -> taunu
71  unsigned int transformationMode_;
72 
75  bool useTauola_;
77  double rfRotationAngle_; // angle of rotation around Z-direction of embedded leptons wrt. reconstructed muons
78  // (used to "place" simulated leptons in a detector region different from reconstructed muons,
79  // while preserving Z/W-boson momentum and spin effects)
80 
82  // keep track if TAUOLA interface has already been initialized.
83  // Needed to avoid multiple initializations of TAUOLA interface,
84  // which makes TAUOLA crash.
85  static bool tauola_isInitialized_;
86 
89 
91 
93 
94  struct MinVisPtCut
95  {
96  enum { kELEC, kMU, kHAD, kTAU };
97  int type_;
98  unsigned index_;
99  double threshold_;
100  void print(std::ostream& stream) const
101  {
102  std::string type_string = "";
103  if ( type_ == kELEC ) type_string = "elec";
104  else if ( type_ == kMU ) type_string = "mu";
105  else if ( type_ == kHAD ) type_string = "had";
106  else if ( type_ == kTAU ) type_string = "tau";
107  stream << type_string << " #" << index_ << ": threshold = " << threshold_ << std::endl;
108  }
109  };
111  {
113  std::vector<MinVisPtCut> cuts_;
114  void print(std::ostream& stream) const
115  {
116  stream << "<MinVisPtCutCombination::print>:" << std::endl;
117  stream << " cut = " << cut_string_ << std::endl;
118  stream << "elements:" << std::endl;
119  for ( std::vector<MinVisPtCut>::const_iterator cut = cuts_.begin();
120  cut != cuts_.end(); ++cut ) {
121  cut->print(stream);
122  }
123  }
124  };
125  std::vector<MinVisPtCutCombination> minVisPtCuts_;
126 
131 
133 };
134 
135 #endif
136 
137 
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 *)
HepMC::GenEvent * processEventWithPythia(HepMC::GenEvent *)
void cleanEvent(HepMC::GenEvent *, HepMC::GenVertex *)
void transformMuMu2TauNu(reco::Particle *, reco::Particle *)
HepMC::GenEvent * processEventWithTauola(HepMC::GenEvent *)
bool testEvent(HepMC::GenEvent *)
ParticleReplacerZtautau(const edm::ParameterSet &)
void transformMuMu2LepLep(reco::Particle *, reco::Particle *)
gen::TauolaInterface * tauola_
GenMuonRadiationAlgorithm * muonRadiationAlgo_
Definition: Run.h:41