Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-03 02:53:27

0001 #ifndef PFISOREADERDEMO_H
0002 #define PFISOREADERDEMO_H
0003 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0004 #include "FWCore/Framework/interface/Frameworkfwd.h"
0005 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
0006 #include "DataFormats/EgammaCandidates/interface/PhotonFwd.h"
0007 #include "DataFormats/RecoCandidate/interface/IsoDeposit.h"
0008 #include "CommonTools/UtilAlgos/interface/TFileService.h"
0009 #include "FWCore/ServiceRegistry/interface/Service.h"
0010 #include <iostream>
0011 #include <string>
0012 #include <map>
0013 
0014 #include "TH2F.h"
0015 
0016 class PFIsoReaderDemo : public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns> {
0017 public:
0018   explicit PFIsoReaderDemo(const edm::ParameterSet&);
0019   ~PFIsoReaderDemo() override;
0020   void beginRun(edm::Run const&, edm::EventSetup const&) override;
0021   void analyze(const edm::Event& iEvent, const edm::EventSetup& c) override;
0022   void endRun(edm::Run const&, edm::EventSetup const&) override {}
0023 
0024   typedef std::vector<edm::Handle<edm::ValueMap<reco::IsoDeposit> > > IsoDepositMaps;
0025   typedef std::vector<edm::Handle<edm::ValueMap<double> > > IsoDepositVals;
0026 
0027 private:
0028   bool printPhotons_;
0029   bool printElectrons_;
0030 
0031   void plotIsoDeposits(const IsoDepositMaps& depmap, const reco::GsfElectronRef& ref, double&, double&, double&);
0032 
0033   //This analyzer produces a file with a tree so we need,
0034   edm::Service<TFileService> fileservice_;
0035 
0036   edm::InputTag inputTagGsfElectrons_;
0037   edm::EDGetTokenT<reco::GsfElectronCollection> tokenGsfElectrons_;
0038   edm::InputTag inputTagPhotons_;
0039   edm::EDGetTokenT<reco::PhotonCollection> tokenPhotons_;
0040   //   edm::InputTag inputTagPFCandidateMap_;
0041   //   std::vector<edm::InputTag> inputTagIsoDepElectrons_;
0042   std::vector<edm::EDGetTokenT<edm::ValueMap<reco::IsoDeposit> > > tokensIsoDepElectrons_;
0043   //   std::vector<edm::InputTag> inputTagIsoDepPhotons_;
0044   std::vector<edm::EDGetTokenT<edm::ValueMap<reco::IsoDeposit> > > tokensIsoDepPhotons_;
0045   //  std::vector<edm::InputTag> inputTagIsoValElectronsNoPFId_;
0046   //   std::vector<edm::InputTag> inputTagIsoValElectronsPFId_;
0047   std::vector<edm::EDGetTokenT<edm::ValueMap<double> > > tokensIsoValElectronsPFId_;
0048   //   std::vector<edm::InputTag> inputTagIsoValPhotonsPFId_;
0049   std::vector<edm::EDGetTokenT<edm::ValueMap<double> > > tokensIsoValPhotonsPFId_;
0050 
0051   // Control histos
0052   TH1F* chargedBarrelElectrons_;
0053   TH1F* photonBarrelElectrons_;
0054   TH1F* neutralBarrelElectrons_;
0055 
0056   TH1F* chargedEndcapsElectrons_;
0057   TH1F* photonEndcapsElectrons_;
0058   TH1F* neutralEndcapsElectrons_;
0059 
0060   TH1F* sumBarrelElectrons_;
0061   TH1F* sumEndcapsElectrons_;
0062 
0063   TH1F* chargedBarrelPhotons_;
0064   TH1F* photonBarrelPhotons_;
0065   TH1F* neutralBarrelPhotons_;
0066 
0067   TH1F* chargedEndcapsPhotons_;
0068   TH1F* photonEndcapsPhotons_;
0069   TH1F* neutralEndcapsPhotons_;
0070 
0071   TH1F* sumBarrelPhotons_;
0072   TH1F* sumEndcapsPhotons_;
0073 };
0074 #endif