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  // Note this does not preserve the Z polarization!!!
82  bool rfMirror_; // mirror the muon momentum vectors at the plane defined by the Z axis and the proton axis
83  // This preserves the Z polarization from what we have seen so far.
84 
86  // keep track if TAUOLA interface has already been initialized.
87  // Needed to avoid multiple initializations of TAUOLA interface,
88  // which makes TAUOLA crash.
89  static bool tauola_isInitialized_;
90 
93 
95 
97 
98  struct MinVisPtCut
99  {
100  enum { kELEC, kMU, kHAD, kTAU };
101  int type_;
102  unsigned index_;
103  double threshold_;
104  void print(std::ostream& stream) const
105  {
106  std::string type_string = "";
107  if ( type_ == kELEC ) type_string = "elec";
108  else if ( type_ == kMU ) type_string = "mu";
109  else if ( type_ == kHAD ) type_string = "had";
110  else if ( type_ == kTAU ) type_string = "tau";
111  stream << type_string << " #" << index_ << ": threshold = " << threshold_ << std::endl;
112  }
113  };
115  {
117  std::vector<MinVisPtCut> cuts_;
118  void print(std::ostream& stream) const
119  {
120  stream << "<MinVisPtCutCombination::print>:" << std::endl;
121  stream << " cut = " << cut_string_ << std::endl;
122  stream << "elements:" << std::endl;
123  for ( std::vector<MinVisPtCut>::const_iterator cut = cuts_.begin();
124  cut != cuts_.end(); ++cut ) {
125  cut->print(stream);
126  }
127  }
128  };
129  std::vector<MinVisPtCutCombination> minVisPtCuts_;
130 
135 
137 
138 };
139 
140 #endif
141 
142 
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:43