CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/Validation/EventGenerator/interface/TauValidation.h

Go to the documentation of this file.
00001 #ifndef TauValidation_H
00002 #define TauValidation_H
00003 
00004 /*class TauValidation
00005  *  
00006  *  Class to fill Event Generator dqm monitor elements; works on HepMCProduct
00007  *
00008  *  $Date: 2013/02/20 12:02:32 $
00009  *  $Revision: 1.18 $
00010  *
00011  */
00012 
00013 // framework & common header files
00014 #include "FWCore/Framework/interface/EDAnalyzer.h"
00015 #include "FWCore/Framework/interface/Event.h"
00016 #include "FWCore/Framework/interface/EventSetup.h"
00017 #include "FWCore/Framework/interface/Run.h"
00018 
00019 #include "DataFormats/Common/interface/Handle.h"
00020 #include "FWCore/Framework/interface/ESHandle.h"
00021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00022 #include "FWCore/Utilities/interface/InputTag.h"
00023 
00024 //DQM services
00025 #include "DQMServices/Core/interface/DQMStore.h"
00026 #include "FWCore/ServiceRegistry/interface/Service.h"
00027 #include "DQMServices/Core/interface/MonitorElement.h"
00028 
00029 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
00030 
00031 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
00032 #include "TLorentzVector.h"
00033 
00034 #include "Validation/EventGenerator/interface/WeightManager.h"
00035 
00036 class TauValidation : public edm::EDAnalyzer
00037 {
00038     public:
00039         // tau decays
00040         enum  {undetermined,
00041                electron,
00042                muon,
00043                pi,
00044                rho,
00045                a1,
00046                K,
00047                Kstar,
00048                pi1pi0,
00049                pinpi0,
00050                tripi,
00051                tripinpi0,
00052                stable};
00053         // tau mother particles 
00054         enum  {other,
00055                B,
00056                D,
00057                gamma,
00058                Z,
00059                W,
00060                HSM,
00061                H0,
00062                A0,
00063                Hpm};
00064 
00065     public:
00066         explicit TauValidation(const edm::ParameterSet&);
00067         virtual ~TauValidation();
00068         virtual void beginJob();
00069         virtual void endJob();  
00070         virtual void analyze(const edm::Event&, const edm::EventSetup&);
00071         virtual void beginRun(const edm::Run&, const edm::EventSetup&);
00072         virtual void endRun(const edm::Run&, const edm::EventSetup&);
00073 
00074     private:
00075         int tauMother(const HepMC::GenParticle*, double weight);
00076         int tauProngs(const HepMC::GenParticle*, double weight);
00077         int tauDecayChannel(const HepMC::GenParticle*, double weight=0.0);
00078         int findMother(const HepMC::GenParticle*);
00079         bool isLastTauinChain(const HepMC::GenParticle* tau);
00080         void rtau(const HepMC::GenParticle*,int,int, double weight);
00081         void spinEffects(const HepMC::GenParticle*,int,int,std::vector<HepMC::GenParticle*> &part,double weight);
00082         void spinEffectsZ(const HepMC::GenParticle* boson, double weight);
00083         double leadingPionMomentum(const HepMC::GenParticle*, double weight);
00084         double visibleTauEnergy(const HepMC::GenParticle*);
00085         TLorentzVector leadingPionP4(const HepMC::GenParticle*);
00086         TLorentzVector motherP4(const HepMC::GenParticle*);
00087         void photons(const HepMC::GenParticle*, double weight);
00088         void findTauList(const HepMC::GenParticle* tau,std::vector<const HepMC::GenParticle*> &TauList);
00089         void findFSRandBrem(const HepMC::GenParticle* p, bool doBrem, std::vector<const HepMC::GenParticle*> &ListofFSR,
00090                            std::vector<const HepMC::GenParticle*> &ListofBrem);
00091         void FindPhotosFSR(const HepMC::GenParticle* p,std::vector<const HepMC::GenParticle*> &ListofFSR,double &BosonScale);
00092         const HepMC::GenParticle* GetMother(const HepMC::GenParticle* tau);
00093         const std::vector<HepMC::GenParticle*> GetMothers(const HepMC::GenParticle* boson);
00094         double Zstoa(double zs);
00095 
00096         WeightManager _wmanager;
00097 
00098         edm::InputTag hepmcCollection_;
00099 
00100         double tauEtCut;
00101 
00103         edm::ESHandle<HepPDT::ParticleDataTable> fPDGTable ;
00104   
00106         DQMStore *dbe;
00107 
00108         MonitorElement *nTaus, *nPrimeTaus;
00109         MonitorElement *TauPt, *TauEta, *TauPhi, *TauProngs, *TauDecayChannels, *TauMothers, 
00110           *TauRtauW, *TauRtauHpm,
00111           *TauSpinEffectsW_X, *TauSpinEffectsW_UpsilonRho, *TauSpinEffectsW_UpsilonA1,*TauSpinEffectsW_eX,*TauSpinEffectsW_muX,
00112           *TauSpinEffectsHpm_X, *TauSpinEffectsHpm_UpsilonRho, *TauSpinEffectsHpm_UpsilonA1,*TauSpinEffectsHpm_eX,*TauSpinEffectsHpm_muX, 
00113           *TauSpinEffectsZ_MVis, *TauSpinEffectsZ_Zs, *TauSpinEffectsZ_Xf, *TauSpinEffectsZ_Xb, 
00114           *TauSpinEffectsZ_eX, *TauSpinEffectsZ_muX, *TauSpinEffectsZ_X, *TauSpinEffectsH_X,
00115           *TauSpinEffectsH_MVis, *TauSpinEffectsH_Zs, *TauSpinEffectsH_Xf, *TauSpinEffectsH_Xb,
00116           *TauSpinEffectsH_eX, *TauSpinEffectsH_muX,
00117           *TauBremPhotonsN,*TauBremPhotonsPt,*TauBremPhotonsPtSum,*TauFSRPhotonsN,*TauFSRPhotonsPt,*TauFSRPhotonsPtSum;
00118         unsigned int NJAKID;
00119         MonitorElement *JAKID;
00120         std::vector<std::vector<MonitorElement *> > JAKInvMass;
00121 
00122         int zsbins;
00123         double zsmin,zsmax;
00124 };
00125 
00126 #endif
00127