CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/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/02/17 14:46:42 $
00009  *  $Revision: 1.8 $
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 class TauValidation : public edm::EDAnalyzer
00035 {
00036     public:
00037         // tau decays
00038         enum  {undetermined,
00039                electron,
00040                muon,
00041                pi,
00042                rho,
00043                a1,
00044                K,
00045                Kstar,
00046                pi1pi0,
00047                pinpi0,
00048                tripi,
00049 //               tripinpi0,
00050                stable};
00051         // tau mother particles 
00052         enum  {other,
00053                gamma,
00054                Z,
00055                W,
00056                HSM,
00057                H0,
00058                A0,
00059                Hpm};
00060 
00061     public:
00062         explicit TauValidation(const edm::ParameterSet&);
00063         virtual ~TauValidation();
00064         virtual void beginJob();
00065         virtual void endJob();  
00066         virtual void analyze(const edm::Event&, const edm::EventSetup&);
00067         virtual void beginRun(const edm::Run&, const edm::EventSetup&);
00068         virtual void endRun(const edm::Run&, const edm::EventSetup&);
00069 
00070     private:
00071         int tauMother(const HepMC::GenParticle*);
00072         int tauProngs(const HepMC::GenParticle*);
00073         int tauDecayChannel(const HepMC::GenParticle*);
00074         int findMother(const HepMC::GenParticle*);
00075         int findTauDecayChannel(const HepMC::GenParticle*);
00076         void rtau(const HepMC::GenParticle*,int,int);
00077         void spinEffects(const HepMC::GenParticle*,int,int);
00078         void spinEffectsZ(const HepMC::GenParticle*);
00079         double leadingPionMomentum(const HepMC::GenParticle*);
00080         double visibleTauEnergy(const HepMC::GenParticle*);
00081         TLorentzVector leadingPionP4(const HepMC::GenParticle*);
00082         TLorentzVector motherP4(const HepMC::GenParticle*);
00083         void photons(const HepMC::GenParticle*);
00084 
00085         edm::InputTag hepmcCollection_;
00086 
00087         double tauEtCut;
00088 
00090         edm::ESHandle<HepPDT::ParticleDataTable> fPDGTable ;
00091   
00093         DQMStore *dbe;
00094 
00095         MonitorElement *nEvt;
00096         MonitorElement *TauPt, *TauEta, *TauPhi, *TauProngs, *TauDecayChannels, *TauMothers, 
00097                        *TauRtauW, *TauRtauHpm,
00098                        *TauSpinEffectsW, *TauSpinEffectsHpm, *TauSpinEffectsZ,
00099                        *TauPhotonsN,*TauPhotonsPt;
00100 };
00101 
00102 #endif
00103