Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-06-18 02:12:45

0001 // Package:    Phase2OTValidateRecHitBase
0002 // Class:      Phase2OTValidateRecHitBase
0003 //
0004 /**\class Phase2OTValidateRecHitBase Phase2OTValidateRecHitBase.cc 
0005  Description:  Standalone  Plugin for Phase2 RecHit validation
0006 */
0007 //
0008 // Author: Suvankar Roy Chowdhury
0009 // Date: March 2021
0010 //
0011 // system include files
0012 // STL includes
0013 #include <memory>
0014 #include <map>
0015 #include <vector>
0016 #include <algorithm>
0017 
0018 // system include files
0019 #include "DataFormats/Common/interface/Handle.h"
0020 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0021 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h"
0022 #include "FWCore/Framework/interface/ESHandle.h"
0023 #include "FWCore/Framework/interface/Event.h"
0024 #include "FWCore/Framework/interface/Frameworkfwd.h"
0025 #include "FWCore/Framework/interface/MakerMacros.h"
0026 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0027 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0028 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0029 
0030 #include "FWCore/ServiceRegistry/interface/Service.h"
0031 #include "FWCore/Utilities/interface/InputTag.h"
0032 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0033 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0034 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0035 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
0036 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
0037 
0038 //DQM
0039 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0040 #include "DQMServices/Core/interface/DQMStore.h"
0041 #include "DQMServices/Core/interface/MonitorElement.h"
0042 #include "DataFormats/TrackerRecHit2D/interface/Phase2TrackerRecHit1D.h"
0043 
0044 class Phase2OTValidateRecHitBase : public DQMEDAnalyzer {
0045 public:
0046   explicit Phase2OTValidateRecHitBase(const edm::ParameterSet&);
0047   ~Phase2OTValidateRecHitBase() override;
0048   void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override;
0049   void dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) override;
0050   void fillOTRecHitHistos(const PSimHit* simhitClosest,
0051                           const Phase2TrackerRecHit1D* rechit,
0052                           const std::map<unsigned int, SimTrack>& selectedSimTrackMap,
0053                           std::map<std::string, unsigned int>& nrechitLayerMapP_primary,
0054                           std::map<std::string, unsigned int>& nrechitLayerMapS_primary);
0055 
0056   static void fillPSetDescription(edm::ParameterSetDescription& desc);
0057   void bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, std::string& subdir);
0058 
0059 protected:
0060   edm::ParameterSet config_;
0061   std::string geomType_;
0062   const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_;
0063   const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_;
0064   const TrackerGeometry* tkGeom_ = nullptr;
0065   const TrackerTopology* tTopo_ = nullptr;
0066 
0067   struct RecHitME {
0068     // use TH1D instead of TH1F to avoid stauration at 2^31
0069     // above this increments with +1 don't work for float, need double
0070     MonitorElement* deltaX_P = nullptr;
0071     MonitorElement* deltaX_S = nullptr;
0072     MonitorElement* deltaY_P = nullptr;
0073     MonitorElement* deltaY_S = nullptr;
0074     MonitorElement* pullX_P = nullptr;
0075     MonitorElement* pullX_S = nullptr;
0076     MonitorElement* pullY_P = nullptr;
0077     MonitorElement* pullY_S = nullptr;
0078     MonitorElement* deltaX_eta_P = nullptr;
0079     MonitorElement* deltaX_eta_S = nullptr;
0080     MonitorElement* deltaY_eta_P = nullptr;
0081     MonitorElement* deltaY_eta_S = nullptr;
0082     MonitorElement* deltaX_phi_P = nullptr;
0083     MonitorElement* deltaX_phi_S = nullptr;
0084     MonitorElement* deltaY_phi_P = nullptr;
0085     MonitorElement* deltaY_phi_S = nullptr;
0086     MonitorElement* pullX_eta_P = nullptr;
0087     MonitorElement* pullX_eta_S = nullptr;
0088     MonitorElement* pullY_eta_P = nullptr;
0089     MonitorElement* pullY_eta_S = nullptr;
0090     //For rechits matched to simhits from highPT tracks
0091     MonitorElement* pullX_primary_P;
0092     MonitorElement* pullX_primary_S;
0093     MonitorElement* pullY_primary_P;
0094     MonitorElement* pullY_primary_S;
0095     MonitorElement* deltaX_primary_P;
0096     MonitorElement* deltaX_primary_S;
0097     MonitorElement* deltaY_primary_P;
0098     MonitorElement* deltaY_primary_S;
0099     MonitorElement* numberRecHitsprimary_P;
0100     MonitorElement* numberRecHitsprimary_S;
0101   };
0102   std::map<std::string, RecHitME> layerMEs_;
0103 };