Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:34

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