Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef HeavyFlavorAnalysis_SpecificDecay_BPHHistoSpecificDecay_h
0002 #define HeavyFlavorAnalysis_SpecificDecay_BPHHistoSpecificDecay_h
0003 
0004 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHAnalyzerTokenWrapper.h"
0005 #include "DataFormats/PatCandidates/interface/CompositeCandidate.h"
0006 #include "DataFormats/Common/interface/TriggerResults.h"
0007 
0008 #include "FWCore/Framework/interface/Event.h"
0009 #include "FWCore/Framework/interface/EventSetup.h"
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 #include "DataFormats/Common/interface/Ref.h"
0012 
0013 #include "FWCore/ServiceRegistry/interface/Service.h"
0014 #include "CommonTools/UtilAlgos/interface/TFileService.h"
0015 
0016 #include <string>
0017 
0018 class TH1F;
0019 class TTree;
0020 class TBranch;
0021 class TVector3;
0022 
0023 namespace reco {
0024   class Candidate;
0025   class Vertex;
0026 }  // namespace reco
0027 
0028 class BPHHistoSpecificDecay : public BPHAnalyzerWrapper<BPHModuleWrapper::one_analyzer> {
0029 public:
0030   explicit BPHHistoSpecificDecay(const edm::ParameterSet& ps);
0031   ~BPHHistoSpecificDecay() override;
0032 
0033   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0034 
0035   void beginJob() override;
0036   void analyze(const edm::Event& ev, const edm::EventSetup& es) override;
0037   void endJob() override;
0038 
0039   class CandidateSelect {
0040   public:
0041     virtual ~CandidateSelect() = default;
0042     virtual bool accept(const pat::CompositeCandidate& cand, const reco::Vertex* pv = nullptr) const = 0;
0043   };
0044 
0045 private:
0046   std::string trigResultsLabel;
0047   std::string oniaCandsLabel;
0048   std::string sdCandsLabel;
0049   std::string ssCandsLabel;
0050   std::string buCandsLabel;
0051   std::string bdCandsLabel;
0052   std::string bsCandsLabel;
0053   std::string k0CandsLabel;
0054   std::string l0CandsLabel;
0055   std::string b0CandsLabel;
0056   std::string lbCandsLabel;
0057   std::string bcCandsLabel;
0058   std::string x3872CandsLabel;
0059   BPHTokenWrapper<edm::TriggerResults> trigResultsToken;
0060   BPHTokenWrapper<std::vector<pat::CompositeCandidate> > oniaCandsToken;
0061   BPHTokenWrapper<std::vector<pat::CompositeCandidate> > sdCandsToken;
0062   BPHTokenWrapper<std::vector<pat::CompositeCandidate> > ssCandsToken;
0063   BPHTokenWrapper<std::vector<pat::CompositeCandidate> > buCandsToken;
0064   BPHTokenWrapper<std::vector<pat::CompositeCandidate> > bdCandsToken;
0065   BPHTokenWrapper<std::vector<pat::CompositeCandidate> > bsCandsToken;
0066   BPHTokenWrapper<std::vector<pat::CompositeCandidate> > k0CandsToken;
0067   BPHTokenWrapper<std::vector<pat::CompositeCandidate> > l0CandsToken;
0068   BPHTokenWrapper<std::vector<pat::CompositeCandidate> > b0CandsToken;
0069   BPHTokenWrapper<std::vector<pat::CompositeCandidate> > lbCandsToken;
0070   BPHTokenWrapper<std::vector<pat::CompositeCandidate> > bcCandsToken;
0071   BPHTokenWrapper<std::vector<pat::CompositeCandidate> > x3872CandsToken;
0072   bool useTrig;
0073   bool useOnia;
0074   bool useSd;
0075   bool useSs;
0076   bool useBu;
0077   bool useBd;
0078   bool useBs;
0079   bool useK0;
0080   bool useL0;
0081   bool useB0;
0082   bool useLb;
0083   bool useBc;
0084   bool useX3872;
0085 
0086   edm::Service<TFileService> fs;
0087   std::map<std::string, TH1F*> histoMap;
0088   TTree* tree;
0089   unsigned int runNumber;
0090   unsigned int lumiSection;
0091   unsigned int eventNumber;
0092   std::string* recoName;
0093   float recoMass;
0094   float recoTime;
0095   float recoErrT;
0096   TBranch* b_runNumber;
0097   TBranch* b_lumiSection;
0098   TBranch* b_eventNumber;
0099   TBranch* b_recoName;
0100   TBranch* b_recoMass;
0101   TBranch* b_recoTime;
0102   TBranch* b_recoErrT;
0103 
0104   CandidateSelect* phiIBasicSelect;
0105   CandidateSelect* jPsiIBasicSelect;
0106   CandidateSelect* psi2IBasicSelect;
0107   CandidateSelect* upsIBasicSelect;
0108   CandidateSelect* phiBBasicSelect;
0109   CandidateSelect* jPsiBBasicSelect;
0110   CandidateSelect* psi2BBasicSelect;
0111   CandidateSelect* upsBBasicSelect;
0112   CandidateSelect* oniaVertexSelect;
0113   CandidateSelect* oniaDaughterSelect;
0114 
0115   CandidateSelect* npJPsiBasicSelect;
0116   CandidateSelect* npJPsiDaughterSelect;
0117 
0118   CandidateSelect* buIBasicSelect;
0119   CandidateSelect* buIJPsiBasicSelect;
0120   CandidateSelect* buIVertexSelect;
0121   CandidateSelect* buIJPsiDaughterSelect;
0122   CandidateSelect* buDBasicSelect;
0123   CandidateSelect* buDJPsiBasicSelect;
0124   CandidateSelect* buDVertexSelect;
0125   CandidateSelect* buDJPsiDaughterSelect;
0126 
0127   CandidateSelect* bdIBasicSelect;
0128   CandidateSelect* bdIJPsiBasicSelect;
0129   CandidateSelect* bdIKx0BasicSelect;
0130   CandidateSelect* bdIVertexSelect;
0131   CandidateSelect* bdIJPsiDaughterSelect;
0132   CandidateSelect* bdDBasicSelect;
0133   CandidateSelect* bdDJPsiBasicSelect;
0134   CandidateSelect* bdDKx0BasicSelect;
0135   CandidateSelect* bdDVertexSelect;
0136   CandidateSelect* bdDJPsiDaughterSelect;
0137 
0138   CandidateSelect* bsIBasicSelect;
0139   CandidateSelect* bsIJPsiBasicSelect;
0140   CandidateSelect* bsIPhiBasicSelect;
0141   CandidateSelect* bsIVertexSelect;
0142   CandidateSelect* bsIJPsiDaughterSelect;
0143   CandidateSelect* bsDBasicSelect;
0144   CandidateSelect* bsDJPsiBasicSelect;
0145   CandidateSelect* bsDPhiBasicSelect;
0146   CandidateSelect* bsDVertexSelect;
0147   CandidateSelect* bsDJPsiDaughterSelect;
0148 
0149   CandidateSelect* b0IBasicSelect;
0150   CandidateSelect* b0IJPsiBasicSelect;
0151   CandidateSelect* b0IK0sBasicSelect;
0152   CandidateSelect* b0IVertexSelect;
0153   CandidateSelect* b0IJPsiDaughterSelect;
0154   CandidateSelect* b0DBasicSelect;
0155   CandidateSelect* b0DJPsiBasicSelect;
0156   CandidateSelect* b0DK0sBasicSelect;
0157   CandidateSelect* b0DVertexSelect;
0158   CandidateSelect* b0DJPsiDaughterSelect;
0159 
0160   CandidateSelect* lbIBasicSelect;
0161   CandidateSelect* lbIJPsiBasicSelect;
0162   CandidateSelect* lbILambda0BasicSelect;
0163   CandidateSelect* lbIVertexSelect;
0164   CandidateSelect* lbIJPsiDaughterSelect;
0165   CandidateSelect* lbDBasicSelect;
0166   CandidateSelect* lbDJPsiBasicSelect;
0167   CandidateSelect* lbDLambda0BasicSelect;
0168   CandidateSelect* lbDVertexSelect;
0169   CandidateSelect* lbDJPsiDaughterSelect;
0170 
0171   CandidateSelect* bcIBasicSelect;
0172   CandidateSelect* bcIJPsiBasicSelect;
0173   CandidateSelect* bcIJPsiVertexSelect;
0174   CandidateSelect* bcIVertexSelect;
0175   CandidateSelect* bcIJPsiDaughterSelect;
0176   CandidateSelect* bcDBasicSelect;
0177   CandidateSelect* bcDJPsiBasicSelect;
0178   CandidateSelect* bcDJPsiVertexSelect;
0179   CandidateSelect* bcDVertexSelect;
0180   CandidateSelect* bcDJPsiDaughterSelect;
0181 
0182   CandidateSelect* x3872IBasicSelect;
0183   CandidateSelect* x3872IJPsiBasicSelect;
0184   CandidateSelect* x3872IJPsiVertexSelect;
0185   CandidateSelect* x3872IVertexSelect;
0186   CandidateSelect* x3872IJPsiDaughterSelect;
0187   CandidateSelect* x3872DBasicSelect;
0188   CandidateSelect* x3872DJPsiBasicSelect;
0189   CandidateSelect* x3872DJPsiVertexSelect;
0190   CandidateSelect* x3872DVertexSelect;
0191   CandidateSelect* x3872DJPsiDaughterSelect;
0192 
0193   double buIKPtMin;
0194   double buDKPtMin;
0195   double bcIPiPtMin;
0196   double bcDPiPtMin;
0197   double x3872IPiPtMin;
0198   double x3872DPiPtMin;
0199   double bcJPsiDcaMax;
0200   double x3872JPsiDcaMax;
0201 
0202   void fillHisto(const std::string& name, const pat::CompositeCandidate& cand, char svType);
0203   void fillHisto(const std::string& name, float x);
0204   void createHisto(const std::string& name, int nbin, float hmin, float hmax);
0205 };
0206 
0207 #endif