CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/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: 2011/12/29 10:53:10 $
00009  *  $Revision: 1.9 $
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                gamma,
00056                Z,
00057                W,
00058                HSM,
00059                H0,
00060                A0,
00061                Hpm};
00062 
00063     public:
00064         explicit TauValidation(const edm::ParameterSet&);
00065         virtual ~TauValidation();
00066         virtual void beginJob();
00067         virtual void endJob();  
00068         virtual void analyze(const edm::Event&, const edm::EventSetup&);
00069         virtual void beginRun(const edm::Run&, const edm::EventSetup&);
00070         virtual void endRun(const edm::Run&, const edm::EventSetup&);
00071 
00072     private:
00073         int tauMother(const HepMC::GenParticle*, double weight);
00074         int tauProngs(const HepMC::GenParticle*, double weight);
00075         int tauDecayChannel(const HepMC::GenParticle*, double weight);
00076         int findMother(const HepMC::GenParticle*);
00077         int findTauDecayChannel(const HepMC::GenParticle*);
00078         void rtau(const HepMC::GenParticle*,int,int, double weight);
00079         void spinEffects(const HepMC::GenParticle*,int,int, double weight);
00080         void spinEffectsZ(const HepMC::GenParticle*, double weight);
00081         double leadingPionMomentum(const HepMC::GenParticle*, double weight);
00082         double visibleTauEnergy(const HepMC::GenParticle*);
00083         TLorentzVector leadingPionP4(const HepMC::GenParticle*);
00084         TLorentzVector motherP4(const HepMC::GenParticle*);
00085         void photons(const HepMC::GenParticle*, double weight);
00086 
00087         WeightManager _wmanager;
00088 
00089         edm::InputTag hepmcCollection_;
00090 
00091         double tauEtCut;
00092 
00094         edm::ESHandle<HepPDT::ParticleDataTable> fPDGTable ;
00095   
00097         DQMStore *dbe;
00098 
00099         MonitorElement *nEvt;
00100         MonitorElement *TauPt, *TauEta, *TauPhi, *TauProngs, *TauDecayChannels, *TauMothers, 
00101                        *TauRtauW, *TauRtauHpm,
00102                        *TauSpinEffectsW, *TauSpinEffectsHpm, *TauSpinEffectsZ,
00103                        *TauPhotonsN,*TauPhotonsPt;
00104 };
00105 
00106 #endif
00107