Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Package:     SiPixelPhase1GeometryDebug
0004 // Class  :     SiPixelPhase1GeometryDebug
0005 //
0006 
0007 // Original Author: Marcel Schneider
0008 
0009 #include "DQM/SiPixelPhase1Common/interface/SiPixelPhase1Base.h"
0010 #include "FWCore/Framework/interface/MakerMacros.h"
0011 
0012 // This small plugin plots out varois geometry quantities against each other.
0013 // This is useful to see where a specific module or ROC ends up in a 2D map.
0014 class SiPixelPhase1GeometryDebug : public SiPixelPhase1Base {
0015   enum { DETID, LADBLD, ROC, FED };
0016 
0017 public:
0018   explicit SiPixelPhase1GeometryDebug(const edm::ParameterSet& conf) : SiPixelPhase1Base(conf) {}
0019 
0020   void analyze(const edm::Event& iEvent, const edm::EventSetup&) override {
0021     auto& all = geometryInterface.allModules();
0022     GeometryInterface::Column ladder = geometryInterface.intern("PXLadder");
0023     GeometryInterface::Column blade = geometryInterface.intern("PXBlade");
0024     GeometryInterface::Column roc = geometryInterface.intern("ROC");
0025     GeometryInterface::Column fed = geometryInterface.intern("FED");
0026 
0027     for (auto iq : all) {
0028       auto rocno = geometryInterface.extract(roc, iq);
0029       auto fedno = geometryInterface.extract(fed, iq);
0030       auto detid = iq.sourceModule.rawId();
0031 
0032       auto ladbld = geometryInterface.extract(ladder, iq);
0033       if (ladbld.second == GeometryInterface::UNDEFINED)
0034         ladbld = geometryInterface.extract(blade, iq);
0035 
0036       histo[DETID].fill((float)detid, iq.sourceModule, &iEvent, iq.col, iq.row);
0037       histo[LADBLD].fill((float)ladbld.second, iq.sourceModule, &iEvent, iq.col, iq.row);
0038       histo[ROC].fill((float)rocno.second, iq.sourceModule, &iEvent, iq.col, iq.row);
0039       histo[FED].fill((float)fedno.second, iq.sourceModule, &iEvent, iq.col, iq.row);
0040     }
0041   }
0042 };
0043 
0044 DEFINE_FWK_MODULE(SiPixelPhase1GeometryDebug);