Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-13 03:16:24

0001 #ifndef BDHadronTrackMonitoringAnalyzer_H
0002 #define BDHadronTrackMonitoringAnalyzer_H
0003 
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "FWCore/Framework/interface/Frameworkfwd.h"
0006 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008 #include "FWCore/Utilities/interface/EDGetToken.h"
0009 #include "FWCore/Utilities/interface/InputTag.h"
0010 
0011 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0012 #include "DQMServices/Core/interface/DQMStore.h"
0013 
0014 #include "DataFormats/BTauReco/interface/TrackIPTagInfo.h"
0015 #include "DataFormats/PatCandidates/interface/Jet.h"
0016 #include "DataFormats/PatCandidates/interface/PackedCandidate.h"
0017 #include "DataFormats/TrackReco/interface/Track.h"
0018 #include "DataFormats/VertexReco/interface/Vertex.h"
0019 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
0020 
0021 #include "SimTracker/TrackHistory/interface/TrackCategories.h"
0022 #include "SimTracker/TrackHistory/interface/TrackClassifier.h"
0023 #include "SimTracker/TrackerHitAssociation/interface/ClusterTPAssociation.h"
0024 
0025 #include "FWCore/Framework/interface/MakerMacros.h"
0026 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0027 #include "FWCore/ServiceRegistry/interface/Service.h"
0028 
0029 #include "DQMOffline/RecoB/interface/Tools.h"
0030 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0031 #include "RecoVertex/VertexPrimitives/interface/ConvertToFromReco.h"
0032 #include "TrackingTools/IPTools/interface/IPTools.h"
0033 #include "TrackingTools/Records/interface/TransientTrackRecord.h"
0034 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0035 #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
0036 
0037 #include <fstream>
0038 #include <iostream>
0039 
0040 /** \class BDHadronTrackMonitoringAnalyzer
0041  *
0042  *  Top level steering routine for B + D hadron track monitoring tool from
0043  * RECODEBUG samples.
0044  *
0045  */
0046 
0047 class BDHadronTrackMonitoringAnalyzer : public DQMEDAnalyzer {
0048 public:
0049   explicit BDHadronTrackMonitoringAnalyzer(const edm::ParameterSet &pSet);
0050 
0051   ~BDHadronTrackMonitoringAnalyzer() override;
0052 
0053   void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override;
0054   void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0055 
0056   enum HistoryClasses { BCWeakDecay = 0, BWeakDecay = 1, CWeakDecay = 2, PU = 3, Other = 4, Fake = 5 };
0057   static const std::vector<std::string> TrkHistCat;
0058 
0059 private:
0060   // cut values
0061   double distJetAxis_;
0062   double decayLength_;
0063   double minJetPt_;
0064   double maxJetEta_;
0065 
0066   // strings
0067   std::string ipTagInfos_;
0068 
0069   // InputTags
0070   edm::InputTag PatJetSrc_;
0071   edm::InputTag TrackSrc_;
0072   edm::InputTag PVSrc_;
0073   edm::InputTag ClusterTPMapSrc_;
0074 
0075   // Tokens
0076   edm::EDGetTokenT<pat::JetCollection> PatJetCollectionTag_;
0077   edm::EDGetTokenT<reco::TrackCollection> TrackCollectionTag_;
0078   edm::EDGetTokenT<reco::VertexCollection> PrimaryVertexColl_;
0079   edm::EDGetTokenT<ClusterTPAssociation> clusterTPMapToken_;
0080   edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> ttrackToken_;
0081   // TrackClassifier
0082   TrackClassifier classifier_;
0083 
0084   // Histograms
0085   // b jets
0086   MonitorElement *nTrkAll_bjet;  // total number of selected tracks (or TrackingParticles)
0087   MonitorElement *nTrk_bjet[6];  // total number of selected tracks (or TrackingParticles)
0088                                  // in each TrackHistory category
0089   // c jets
0090   MonitorElement *nTrkAll_cjet;  // total number of selected tracks (or TrackingParticles)
0091   MonitorElement *nTrk_cjet[6];  // total number of selected tracks (or TrackingParticles)
0092                                  // in each TrackHistory category
0093   // dusg jets
0094   MonitorElement *nTrkAll_dusgjet;  // total number of selected tracks (or TrackingParticles)
0095   MonitorElement *nTrk_dusgjet[6];  // total number of selected tracks (or
0096                                     // TrackingParticles) in each TrackHistory category
0097 
0098   // track properties for all flavours combined
0099   MonitorElement *TrkPt_alljets[6],
0100       *TrkTruthPt_alljets[5];  // Pt of selected tracks (or TrackingParticles)
0101   MonitorElement *TrkEta_alljets[6],
0102       *TrkTruthEta_alljets[5];  // Eta of selected tracks (or TrackingParticles)
0103   MonitorElement *TrkPhi_alljets[6],
0104       *TrkTruthPhi_alljets[5];  // Phi of selected tracks (or TrackingParticles)
0105   MonitorElement *TrkDxy_alljets[6],
0106       *TrkTruthDxy_alljets[5];  // Transverse IP of selected tracks (or
0107                                 // TrackingParticles)
0108   MonitorElement *TrkDz_alljets[6],
0109       *TrkTruthDz_alljets[5];  // Longitudinal IP of selected tracks (or
0110                                // TrackingParticles)
0111   MonitorElement *TrkHitAll_alljets[6],
0112       *TrkTruthHitAll_alljets[5];  // total number Tracker hits of selected
0113                                    // tracks (or TrackingParticles)
0114   MonitorElement *TrkHitStrip_alljets[6],
0115       *TrkTruthHitStrip_alljets[5];  // number of strip hits of of selected
0116                                      // tracks (or TrackingParticles)
0117   MonitorElement *TrkHitPixel_alljets[6],
0118       *TrkTruthHitPixel_alljets[5];  // number of pixel hits of selected tracks
0119                                      // (or TrackingParticles)
0120 };
0121 
0122 #endif