CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/TauAnalysis/MCEmbeddingTools/interface/ParticleReplacerClass.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    Replacer
00004 // Class:      Replacer
00005 //
00013 //
00014 // Original Author:  Manuel Zeise
00015 //
00016 //
00017 
00018 
00019 // system include files
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 #include "HepMC/IO_HEPEVT.h"
00034 #include "HepMC/GenParticle.h"
00035 #include "HepMC/GenVertex.h"
00036 #include "HepMC/PythiaWrapper.h"
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(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 
00079         //      0       fullEvent       (incl. all other particles)
00080         //      1       taus only       (create an event only with the two decaying taus)
00081         unsigned int replacementMode_;
00082         std::string generatorMode_;
00083         bool noInitialisation_;
00084 
00085         // this variable defines the type of decay to simulate
00086         // 0 - mumu->mumu (i.e. no transformation)
00087         // 1 - mumu->tautau (default value)
00088         unsigned int transformationMode_;
00089         
00090         int motherParticleID_;
00091         bool useExternalGenerators_ ;
00092         bool useTauola_ ;
00093         bool useTauolaPolarization_ ;
00094         
00095         //gen::TauolaInterface* tauola_;
00096         gen::TauolaInterface tauola_;
00097 
00098         bool printEvent_;
00099 
00100         struct MinVisPtCut { enum { ELEC, MU, HAD, TAU } type_; unsigned int index_; double pt_; };
00101         std::vector<std::vector<MinVisPtCut> > minVisPtCuts_;
00102 //      double minVisibleTransverseMomentum_;
00103         
00104         double targetParticleMass_;
00105         int targetParticlePdgID_;
00106         
00107         TTree * outTree;
00108         int attempts;
00109         int maxNumberOfAttempts_;
00110 };
00111 
00112