Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-07 05:50:32

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