Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:08:27

0001 #ifndef DQM_SiPixelPhase1Summary_SiPixelBarycenter_h
0002 #define DQM_SiPixelPhase1Summary_SiPixelBarycenter_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     SiPixelPhase1Summary
0006 // Class  :     SiPixelBarycenter
0007 //
0008 /**
0009 
0010  Description: Barycenter plot generation for the Phase 1 pixel
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Danilo Meuser
0018 //         Created:  26th May 2021
0019 //
0020 
0021 // user include files
0022 #include "FWCore/Framework/interface/MakerMacros.h"
0023 
0024 #include "DQMServices/Core/interface/DQMStore.h"
0025 #include "DQMServices/Core/interface/DQMEDHarvester.h"
0026 
0027 #include "FWCore/Framework/interface/EventSetup.h"
0028 #include "FWCore/Framework/interface/LuminosityBlock.h"
0029 
0030 #include "CondFormats/AlignmentRecord/interface/TrackerAlignmentRcd.h"
0031 #include "CondFormats/AlignmentRecord/interface/GlobalPositionRcd.h"
0032 #include "CondFormats/Alignment/interface/Alignments.h"
0033 
0034 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0035 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0036 
0037 class SiPixelBarycenter : public DQMEDHarvester {
0038 public:
0039   explicit SiPixelBarycenter(const edm::ParameterSet& conf);
0040   ~SiPixelBarycenter() override = default;
0041 
0042 protected:
0043   void beginRun(edm::Run const& run, edm::EventSetup const& eSetup) override;
0044 
0045   void dqmEndRun(DQMStore::IBooker& iBooker,
0046                  DQMStore::IGetter& iGetter,
0047                  edm::Run const& iRun,
0048                  edm::EventSetup const& c) override;
0049   void dqmEndJob(DQMStore::IBooker& iBooker, DQMStore::IGetter& iGetter) override;
0050 
0051 private:
0052   const edm::ESGetToken<Alignments, TrackerAlignmentRcd> alignmentToken_;
0053   const edm::ESGetToken<Alignments, GlobalPositionRcd> gprToken_;
0054   const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> trackerTopologyToken_;
0055 
0056   std::map<std::string, MonitorElement*> barycenters_;
0057 
0058   const std::array<std::string, 9> subdetectors_ = {
0059       {"BPIX", "FPIX_zm", "FPIX_zp", "BPIX_xp", "BPIX_xm", "FPIX_zp_xp", "FPIX_zm_xp", "FPIX_zp_xm", "FPIX_zm_xm"}};
0060 
0061   //book the barycenter histograms
0062   void bookBarycenterHistograms(DQMStore::IBooker& iBooker);
0063 
0064   //fill the barycenter histograms
0065   void fillBarycenterHistograms(DQMStore::IBooker& iBooker,
0066                                 DQMStore::IGetter& iGetter,
0067                                 const std::vector<AlignTransform>& input,
0068                                 const std::vector<AlignTransform>& GPR,
0069                                 const TrackerTopology& tTopo);
0070 };
0071 
0072 #endif