File indexing completed on 2023-03-17 11:27:17
0001 #ifndef TauValidation_H
0002 #define TauValidation_H
0003
0004
0005 #include "FWCore/Framework/interface/Event.h"
0006 #include "FWCore/Framework/interface/EventSetup.h"
0007 #include "FWCore/Framework/interface/Run.h"
0008
0009 #include "DataFormats/Common/interface/Handle.h"
0010 #include "FWCore/Framework/interface/ESHandle.h"
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 #include "FWCore/Utilities/interface/InputTag.h"
0013
0014
0015 #include "DQMServices/Core/interface/DQMStore.h"
0016 #include "FWCore/ServiceRegistry/interface/Service.h"
0017 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0018
0019 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
0020 #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
0021
0022 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
0023 #include "TLorentzVector.h"
0024
0025 class TauValidation : public DQMEDAnalyzer {
0026 public:
0027
0028 enum { undetermined, electron, muon, pi, rho, a1, K, Kstar, pi1pi0, pinpi0, tripi, tripinpi0, stable };
0029
0030 enum { other, B, D, gamma, Z, W, HSM, H0, A0, Hpm };
0031
0032 public:
0033 explicit TauValidation(const edm::ParameterSet &);
0034 ~TauValidation() override;
0035 void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override;
0036 void dqmBeginRun(const edm::Run &r, const edm::EventSetup &c) override;
0037 void analyze(edm::Event const &, edm::EventSetup const &) override;
0038
0039 private:
0040
0041
0042 int tauMother(const reco::GenParticle *, double weight);
0043 int tauProngs(const reco::GenParticle *, double weight);
0044 int tauDecayChannel(const reco::GenParticle *tau, int jak_id, unsigned int TauBitMask, double weight);
0045 int findMother(const reco::GenParticle *);
0046 bool isLastTauinChain(const reco::GenParticle *tau);
0047 void spinEffectsWHpm(const reco::GenParticle *, int, int, std::vector<const reco::GenParticle *> &part, double weight);
0048 void spinEffectsZH(const reco::GenParticle *boson, double weight);
0049 double leadingPionMomentum(const reco::GenParticle *, double weight);
0050 double visibleTauEnergy(const reco::GenParticle *);
0051 TLorentzVector leadingPionP4(const reco::GenParticle *);
0052 TLorentzVector motherP4(const reco::GenParticle *);
0053 void photons(const reco::GenParticle *, double weight);
0054 void findTauList(const reco::GenParticle *tau, std::vector<const reco::GenParticle *> &TauList);
0055 void findFSRandBrem(const reco::GenParticle *p,
0056 bool doBrem,
0057 std::vector<const reco::GenParticle *> &ListofFSR,
0058 std::vector<const reco::GenParticle *> &ListofBrem);
0059 void FindPhotosFSR(const reco::GenParticle *p, std::vector<const reco::GenParticle *> &ListofFSR, double &BosonScale);
0060 const reco::GenParticle *GetMother(const reco::GenParticle *tau);
0061 const std::vector<const reco::GenParticle *> GetMothers(const reco::GenParticle *boson);
0062 double Zstoa(double zs);
0063 void countParticles(const reco::GenParticle *p,
0064 int &allCount,
0065 int &eCount,
0066 int &muCount,
0067 int &pi0Count,
0068 int &piCount,
0069 int &rhoCount,
0070 int &a1Count,
0071 int &KCount,
0072 int &KstarCount);
0073
0074 edm::InputTag genparticleCollection_;
0075
0076
0077 edm::ESHandle<HepPDT::ParticleDataTable> fPDGTable;
0078 edm::ESGetToken<HepPDT::ParticleDataTable, edm::DefaultRecord> fPDGTableToken;
0079
0080 MonitorElement *nTaus, *nPrimeTaus;
0081 MonitorElement *TauPt, *TauEta, *TauPhi, *TauProngs, *TauDecayChannels, *TauMothers, *TauSpinEffectsW_X,
0082 *TauSpinEffectsW_UpsilonRho, *TauSpinEffectsW_UpsilonA1, *TauSpinEffectsW_eX, *TauSpinEffectsW_muX,
0083 *TauSpinEffectsHpm_X, *TauSpinEffectsHpm_UpsilonRho, *TauSpinEffectsHpm_UpsilonA1, *TauSpinEffectsHpm_eX,
0084 *TauSpinEffectsHpm_muX, *TauSpinEffectsZ_MVis, *TauSpinEffectsZ_Zs, *TauSpinEffectsZ_Xf, *TauSpinEffectsZ_Xb,
0085 *TauSpinEffectsZ_X50to75, *TauSpinEffectsZ_X75to88, *TauSpinEffectsZ_X88to100, *TauSpinEffectsZ_X100to120,
0086 *TauSpinEffectsZ_X120UP, *TauSpinEffectsZ_eX, *TauSpinEffectsZ_muX, *TauSpinEffectsZ_X, *TauSpinEffectsH_X,
0087 *TauSpinEffectsH_MVis, *TauSpinEffectsH_Zs, *TauSpinEffectsH_Xf, *TauSpinEffectsH_Xb, *TauSpinEffectsH_eX,
0088 *TauSpinEffectsH_muX, *TauSpinEffectsH_rhorhoAcoplanarityplus, *TauSpinEffectsH_rhorhoAcoplanarityminus,
0089 *TauBremPhotonsN, *TauBremPhotonsPt, *TauBremPhotonsPtSum, *TauFSRPhotonsN, *TauFSRPhotonsPt, *TauFSRPhotonsPtSum,
0090 *TauSpinEffectsH_pipiAcoplanarity, *TauSpinEffectsH_pipiAcollinearity, *TauSpinEffectsH_pipiAcollinearityzoom,
0091 *DecayLength, *LifeTime;
0092
0093 unsigned int NMODEID;
0094 MonitorElement *MODEID;
0095 std::vector<std::vector<MonitorElement *> > MODEInvMass;
0096
0097 int zsbins;
0098 double zsmin, zsmax;
0099
0100 edm::EDGetTokenT<reco::GenParticleCollection> genparticleCollectionToken_;
0101 };
0102
0103 #endif