Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-24 02:12:59

0001 // system include files
0002 #include <memory>
0003 
0004 // user include files
0005 #include "FWCore/Framework/interface/Event.h"
0006 #include "FWCore/Framework/interface/EventSetup.h"
0007 #include "FWCore/Framework/interface/Frameworkfwd.h"
0008 #include "FWCore/Framework/interface/MakerMacros.h"
0009 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0010 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 #include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h"
0013 #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h"
0014 
0015 using namespace std;
0016 
0017 class TrackerRecoGeometryAnalyzer : public edm::one::EDAnalyzer<> {
0018 public:
0019   TrackerRecoGeometryAnalyzer(const edm::ParameterSet&);
0020   ~TrackerRecoGeometryAnalyzer() = default;
0021 
0022   void analyze(edm::Event const& iEvent, edm::EventSetup const&) override;
0023 
0024 private:
0025   const edm::ESGetToken<GeometricSearchTracker, TrackerRecoGeometryRecord> theGSTToken_;
0026 };
0027 
0028 TrackerRecoGeometryAnalyzer::TrackerRecoGeometryAnalyzer(const edm::ParameterSet& iConfig)
0029     : theGSTToken_(esConsumes()) {}
0030 
0031 void TrackerRecoGeometryAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0032   using namespace edm;
0033 
0034   //
0035   // get the GeometricSearchDet
0036   //
0037   const GeometricSearchTracker* track = &iSetup.getData(theGSTToken_);
0038 
0039   //---- testing access to barrelLayers ----
0040   vector<const BarrelDetLayer*> theBarrelLayers = track->barrelLayers();
0041   edm::LogInfo("TrackerRecoGeometryAnalyzer") << "number of BarrelLayers: " << theBarrelLayers.size();
0042 
0043   for (unsigned int i = 0; i < 3; i++) {
0044     const BarrelDetLayer* theLayer = theBarrelLayers[i];
0045     edm::LogInfo("TrackerRecoGeometryAnalyzer")
0046         << "theLayer[" << i << "]->position().perp(): " << theLayer->components().front()->surface().position().perp();
0047   }
0048 }
0049 
0050 DEFINE_FWK_MODULE(TrackerRecoGeometryAnalyzer);