Go to the documentation of this file.00001
00002
00003
00004
00005
00013
00014
00015
00016
00017
00018
00019
00020 #include "TauAnalysis/MCEmbeddingTools/interface/ParticleReplacerBase.h"
00021
00022 #include <stack>
00023 #include <queue>
00024
00025 #include "Math/LorentzVector.h"
00026 #include "Math/VectorUtil.h"
00027 #include "DataFormats/Math/interface/deltaR.h"
00028
00029 #include "DataFormats/Candidate/interface/Particle.h"
00030 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include "GeneratorInterface/Pythia6Interface/interface/Pythia6Service.h"
00040 #include "GeneratorInterface/ExternalDecays/interface/TauolaInterface.h"
00041 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00042
00043 #include "FWCore/Framework/interface/Event.h"
00044
00045 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
00046 #include "HepPDT/ParticleDataTable.hh"
00047
00048 #include "DataFormats/MuonReco/interface/Muon.h"
00049
00050 #include "CommonTools/UtilAlgos/interface/TFileService.h"
00051 #include "FWCore/ServiceRegistry/interface/Service.h"
00052 #include "TTree.h"
00053
00054 #include<string>
00055
00056 class ParticleReplacerClass : public ParticleReplacerBase
00057 {
00058 public:
00059 explicit ParticleReplacerClass(const edm::ParameterSet&, bool);
00060 ~ParticleReplacerClass();
00061
00062 virtual std::auto_ptr<HepMC::GenEvent> produce(const reco::MuonCollection& muons, const reco::Vertex *pvtx=0, const HepMC::GenEvent *genEvt=0);
00063 virtual void beginRun(const edm::Run& iRun,const edm::EventSetup& iSetup);
00064 virtual void endJob();
00065
00066 private:
00067 void transformMuMu2TauTau(reco::Particle * muon1, reco::Particle * muon2);
00068 void transformMuMu2TauNu(reco::Particle * muon1, reco::Particle * muon2);
00069
00070 HepMC::GenEvent * processEventWithTauola(HepMC::GenEvent * evt);
00071 HepMC::GenEvent * processEventWithPythia(HepMC::GenEvent * evt);
00072
00073 bool testEvent(HepMC::GenEvent * evt);
00074
00075 void cleanEvent(HepMC::GenEvent * evt, HepMC::GenVertex * vtx);
00076 void repairBarcodes(HepMC::GenEvent * evt);
00077
00078 std::string generatorMode_;
00079 bool noInitialisation_;
00080
00081
00082
00083
00084 unsigned int transformationMode_;
00085
00086 int motherParticleID_;
00087 bool useExternalGenerators_ ;
00088 bool useTauola_ ;
00089 bool useTauolaPolarization_ ;
00090
00091 gen::TauolaInterface* tauola_;
00092
00093 bool printEvent_;
00094
00095 struct MinVisPtCut { enum { ELEC, MU, HAD, TAU } type_; unsigned int index_; double pt_; };
00096 std::vector<std::vector<MinVisPtCut> > minVisPtCuts_;
00097
00098
00099 double targetParticleMass_;
00100 int targetParticlePdgID_;
00101
00102 TTree * outTree;
00103 int attempts;
00104 int maxNumberOfAttempts_;
00105 };
00106
00107