Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:20

0001 #ifndef HeavyFlavorAnalysis_RecoDecay_TestBPHRecoDecay_h
0002 #define HeavyFlavorAnalysis_RecoDecay_TestBPHRecoDecay_h
0003 
0004 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHAnalyzerTokenWrapper.h"
0005 
0006 #include "FWCore/Framework/interface/Event.h"
0007 #include "FWCore/Framework/interface/EventSetup.h"
0008 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0009 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
0010 
0011 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHTrackReference.h"
0012 #include "DataFormats/PatCandidates/interface/Muon.h"
0013 #include "DataFormats/TrackReco/interface/Track.h"
0014 #include "DataFormats/PatCandidates/interface/GenericParticle.h"
0015 #include "DataFormats/PatCandidates/interface/CompositeCandidate.h"
0016 
0017 #include <string>
0018 #include <iostream>
0019 #include <fstream>
0020 
0021 class TH1F;
0022 class BPHRecoCandidate;
0023 
0024 class TestBPHRecoDecay : public BPHAnalyzerWrapper<BPHModuleWrapper::one_analyzer> {
0025 public:
0026   explicit TestBPHRecoDecay(const edm::ParameterSet& ps);
0027   ~TestBPHRecoDecay() override;
0028 
0029   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0030 
0031   void beginJob() override;
0032   void analyze(const edm::Event& ev, const edm::EventSetup& es) override;
0033   void endJob() override;
0034 
0035 private:
0036   std::string patMuonLabel;
0037   std::string ccCandsLabel;
0038   std::string pfCandsLabel;
0039   std::string pcCandsLabel;
0040   std::string gpCandsLabel;
0041 
0042   // token wrappers to allow running both on "old" and "new" CMSSW versions
0043   BPHTokenWrapper<pat::MuonCollection> patMuonToken;
0044   BPHTokenWrapper<std::vector<pat::CompositeCandidate>> ccCandsToken;
0045   BPHTokenWrapper<std::vector<reco::PFCandidate>> pfCandsToken;
0046   BPHTokenWrapper<std::vector<BPHTrackReference::candidate>> pcCandsToken;
0047   BPHTokenWrapper<std::vector<pat::GenericParticle>> gpCandsToken;
0048 
0049   bool usePM;
0050   bool useCC;
0051   bool usePF;
0052   bool usePC;
0053   bool useGP;
0054 
0055   std::string outDump;
0056   std::string outHist;
0057 
0058   std::ostream* fPtr;
0059 
0060   std::map<std::string, TH1F*> histoMap;
0061 
0062   void dumpRecoCand(const std::string& name, const BPHRecoCandidate* cand);
0063   void fillHisto(const std::string& name, const BPHRecoCandidate* cand);
0064   void fillHisto(const std::string& name, float x);
0065 
0066   void createHisto(const std::string& name, int nbin, float hmin, float hmax);
0067 };
0068 
0069 #endif