Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef Validation_SiTrackerPhase2_Phase2ITValidateRecHitBase_h
0002 #define Validation_SiTrackerPhase2_Phase2ITValidateRecHitBase_h
0003 
0004 /**\class Phase2ITValidateRecHitBase  
0005  Description:  Base Class for Phase2 Validation
0006 */
0007 //
0008 // Author: Marco Musich
0009 // Date: May 2021
0010 //
0011 
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/ServiceRegistry/interface/Service.h"
0029 #include "FWCore/Utilities/interface/InputTag.h"
0030 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0031 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0032 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0033 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
0034 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
0035 
0036 //DQM
0037 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0038 #include "DQMServices/Core/interface/DQMStore.h"
0039 #include "DQMServices/Core/interface/MonitorElement.h"
0040 
0041 class Phase2ITValidateRecHitBase : public DQMEDAnalyzer {
0042 public:
0043   explicit Phase2ITValidateRecHitBase(const edm::ParameterSet&);
0044   ~Phase2ITValidateRecHitBase() override;
0045   void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override;
0046   void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;
0047   static void fillPSetDescription(edm::ParameterSetDescription& desc);
0048 
0049 protected:
0050   void bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, std::string& subdir);
0051   void fillRechitHistos(const PSimHit* simhitClosest,
0052                         const SiPixelRecHit* rechit,
0053                         const std::map<unsigned int, SimTrack>& selectedSimTrackMap,
0054                         std::map<std::string, unsigned int>& nrechitLayerMap_primary);
0055 
0056   edm::ParameterSet config_;
0057   const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_;
0058   const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_;
0059   const TrackerGeometry* tkGeom_ = nullptr;
0060   const TrackerTopology* tTopo_ = nullptr;
0061 
0062   struct RecHitME {
0063     MonitorElement* deltaX = nullptr;
0064     MonitorElement* deltaY = nullptr;
0065     MonitorElement* pullX = nullptr;
0066     MonitorElement* pullY = nullptr;
0067     MonitorElement* deltaX_eta = nullptr;
0068     MonitorElement* deltaX_phi = nullptr;
0069     MonitorElement* deltaY_eta = nullptr;
0070     MonitorElement* deltaY_phi = nullptr;
0071     MonitorElement* deltaX_clsizex = nullptr;
0072     MonitorElement* deltaX_clsizey = nullptr;
0073     MonitorElement* deltaY_clsizex = nullptr;
0074     MonitorElement* deltaY_clsizey = nullptr;
0075     MonitorElement* deltaYvsdeltaX = nullptr;
0076     MonitorElement* pullX_eta = nullptr;
0077     MonitorElement* pullY_eta = nullptr;
0078     //For rechits matched to primary simhits
0079     MonitorElement* numberRecHitsprimary = nullptr;
0080     MonitorElement* pullX_primary;
0081     MonitorElement* pullY_primary;
0082     MonitorElement* deltaX_primary;
0083     MonitorElement* deltaY_primary;
0084   };
0085   std::map<std::string, RecHitME> layerMEs_;
0086 };
0087 
0088 #endif