Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:12:09

0001 #ifndef Phase2TrackerMonitorDigi_h
0002 #define Phase2TrackerMonitorDigi_h
0003 
0004 #include "FWCore/Framework/interface/ESHandle.h"
0005 #include "FWCore/Framework/interface/Frameworkfwd.h"
0006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0007 #include "FWCore/Framework/interface/Event.h"
0008 #include "DataFormats/DetId/interface/DetId.h"
0009 #include "DataFormats/Common/interface/DetSetVector.h"
0010 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0011 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0012 
0013 class MonitorElement;
0014 class PixelDigi;
0015 class Phase2TrackerDigi;
0016 class TrackerGeometry;
0017 class TrackerDigiGeometryRecord;
0018 class TrackerTopologyRcd;
0019 
0020 class Phase2TrackerMonitorDigi : public DQMEDAnalyzer {
0021 public:
0022   explicit Phase2TrackerMonitorDigi(const edm::ParameterSet&);
0023   ~Phase2TrackerMonitorDigi() override;
0024   void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override;
0025   void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override;
0026   void dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) override;
0027   std::string getHistoId(uint32_t det_id, bool flag);
0028 
0029   struct DigiMEs {
0030     MonitorElement* NumberOfDigisPerDet;
0031     MonitorElement* DigiOccupancyP;
0032     MonitorElement* DigiOccupancyS;
0033     MonitorElement* ChargeXYMap;
0034     MonitorElement* PositionOfDigisP;
0035     MonitorElement* PositionOfDigisS;
0036     MonitorElement* ChargeOfDigis;
0037     MonitorElement* ChargeOfDigisVsWidth;
0038     MonitorElement* TotalNumberOfDigisPerLayer;
0039     MonitorElement* NumberOfHitDetectorsPerLayer;
0040     MonitorElement* NumberOfClustersPerDet;
0041     MonitorElement* ClusterWidth;
0042     MonitorElement* ClusterPositionP;
0043     MonitorElement* ClusterPositionS;
0044     MonitorElement* FractionOfOvTBits;
0045     MonitorElement* FractionOfOvTBitsVsEta;
0046     MonitorElement* EtaOccupancyProfP;
0047     MonitorElement* EtaOccupancyProfS;
0048     unsigned int nDigiPerLayer;
0049     unsigned int nHitDetsPerLayer;
0050   };
0051 
0052   struct Ph2DigiCluster {
0053     int charge;
0054     int position;
0055     int width;
0056     int column;
0057   };
0058 
0059   MonitorElement* XYPositionMap;
0060   MonitorElement* RZPositionMap;
0061   MonitorElement* XYOccupancyMap;
0062   MonitorElement* RZOccupancyMap;
0063 
0064 private:
0065   void bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id);
0066   void fillITPixelDigiHistos(const edm::Handle<edm::DetSetVector<PixelDigi>> handle);
0067   void fillOTDigiHistos(const edm::Handle<edm::DetSetVector<Phase2TrackerDigi>> handle);
0068   void fillDigiClusters(DigiMEs& mes, std::vector<Ph2DigiCluster>& digi_clusters);
0069 
0070   edm::ParameterSet config_;
0071   std::map<std::string, DigiMEs> layerMEs;
0072   bool pixelFlag_;
0073   bool clsFlag_;
0074   std::string geomType_;
0075   edm::InputTag otDigiSrc_;
0076   edm::InputTag itPixelDigiSrc_;
0077   const edm::EDGetTokenT<edm::DetSetVector<Phase2TrackerDigi>> otDigiToken_;
0078   const edm::EDGetTokenT<edm::DetSetVector<PixelDigi>> itPixelDigiToken_;
0079   const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_;
0080   const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_;
0081   const TrackerGeometry* tkGeom_ = nullptr;
0082   const TrackerTopology* tTopo_ = nullptr;
0083 };
0084 #endif