Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-04-07 01:19:35

0001 // -*- C++ -*-
0002 //
0003 // Package:    Geometry/TrackerGeometryBuilder
0004 // Class:      PixelTopologyMapTest
0005 //
0006 /**\class PixelTopologyMapTest PixelTopologyMapTest.cc Geometry/TrackerGeometryBuilder/test/PixelTopologyMapTest.cc
0007 
0008  Description: [one line class summary]
0009 
0010  Implementation:
0011      [Notes on implementation]
0012 */
0013 //
0014 // Original Author:  Marco Musich
0015 //         Created:  Wed, 31 Mar 2021 11:01:16 GMT
0016 //
0017 //
0018 
0019 // system include files
0020 #include <memory>
0021 
0022 // user include files
0023 #include "FWCore/Framework/interface/Frameworkfwd.h"
0024 #include "FWCore/Framework/interface/global/EDAnalyzer.h"
0025 
0026 #include "FWCore/Framework/interface/Event.h"
0027 #include "FWCore/Framework/interface/MakerMacros.h"
0028 
0029 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0030 #include "FWCore/Utilities/interface/InputTag.h"
0031 
0032 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0033 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0034 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0035 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0036 #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h"
0037 #include "Geometry/TrackerGeometryBuilder/interface/PixelTopologyMap.h"
0038 
0039 //
0040 // class declaration
0041 //
0042 
0043 class PixelTopologyMapTest : public edm::global::EDAnalyzer<> {
0044 public:
0045   explicit PixelTopologyMapTest(const edm::ParameterSet&);
0046   ~PixelTopologyMapTest() override = default;
0047 
0048   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0049 
0050 private:
0051   void analyze(edm::StreamID, edm::Event const& iEvent, edm::EventSetup const& iSetup) const override;
0052 
0053   // ----------member data ---------------------------
0054   const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomEsToken_;
0055   const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_;
0056 };
0057 
0058 //
0059 // constructors and destructor
0060 //
0061 PixelTopologyMapTest::PixelTopologyMapTest(const edm::ParameterSet& iConfig)
0062     : geomEsToken_(esConsumes()), topoToken_(esConsumes()) {}
0063 
0064 //
0065 // member functions
0066 //
0067 
0068 // ------------ method called for each event  ------------
0069 void PixelTopologyMapTest::analyze(edm::StreamID, edm::Event const& iEvent, edm::EventSetup const& iSetup) const {
0070   using namespace edm;
0071 
0072   // get the Tracker geometry from event setup
0073   const TrackerGeometry* pDD = &iSetup.getData(geomEsToken_);
0074   const TrackerTopology* tTopo = &iSetup.getData(topoToken_);
0075 
0076   if ((pDD->isThere(GeomDetEnumerators::P2PXB)) || (pDD->isThere(GeomDetEnumerators::P2PXEC))) {
0077     edm::LogPrint("PixelTopologyMapTest") << "===== Testing Phase-2 Pixel Tracker geometry =====" << std::endl;
0078   } else if ((pDD->isThere(GeomDetEnumerators::P1PXB)) || (pDD->isThere(GeomDetEnumerators::P1PXEC))) {
0079     edm::LogPrint("PixelTopologyMapTest") << "===== Testing Phase-1 Pixel Tracker geometry =====" << std::endl;
0080   } else {
0081     edm::LogPrint("PixelTopologyMapTest") << "===== Testing Phase-0 Pixel Tracker geometry =====" << std::endl;
0082   }
0083 
0084   PixelTopologyMap PTMap = PixelTopologyMap(pDD, tTopo);
0085   edm::LogPrint("PixelTopologyMapTest") << PTMap << std::endl;
0086 }
0087 
0088 // ------------ method fills 'descriptions' with the allowed parameters for the module  ------------
0089 void PixelTopologyMapTest::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0090   edm::ParameterSetDescription desc;
0091   descriptions.addDefault(desc);
0092 }
0093 
0094 //define this as a plug-in
0095 DEFINE_FWK_MODULE(PixelTopologyMapTest);