Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:34:43

0001 #ifndef Alignment_TrackerAlignment_TrackerGeometryAnalyzer_h
0002 #define Alignment_TrackerAlignment_TrackerGeometryAnalyzer_h
0003 
0004 // Original Author:  Max Stark
0005 //         Created:  Thu, 14 Jan 2016 11:35:07 CET
0006 
0007 // system includes
0008 #include <set>
0009 #include <iostream>
0010 #include <sstream>
0011 
0012 // core framework functionality
0013 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0014 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0015 #include "FWCore/Framework/interface/ESHandle.h"
0016 #include "FWCore/Framework/interface/MakerMacros.h"
0017 
0018 // topology and geometry
0019 #include "CondFormats/GeometryObjects/interface/PTrackerParameters.h"
0020 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0021 #include "Geometry/Records/interface/IdealGeometryRecord.h"
0022 #include "Geometry/Records/interface/PTrackerAdditionalParametersPerDetRcd.h"
0023 #include "Geometry/Records/interface/PTrackerParametersRcd.h"
0024 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0025 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeomBuilderFromGeometricDet.h"
0026 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0027 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
0028 
0029 // alignment
0030 #include "Alignment/CommonAlignment/interface/AlignableObjectId.h"
0031 
0032 class Alignable;
0033 
0034 class TrackerGeometryAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
0035   //========================== PUBLIC METHODS =================================
0036 public:  //===================================================================
0037   TrackerGeometryAnalyzer(const edm::ParameterSet&);
0038   virtual ~TrackerGeometryAnalyzer() {}
0039 
0040   virtual void beginRun(const edm::Run&, const edm::EventSetup&) override;
0041   virtual void analyze(const edm::Event&, const edm::EventSetup&) override {}
0042   virtual void endRun(const edm::Run&, const edm::EventSetup&) override {}
0043 
0044   //========================= PRIVATE METHODS =================================
0045 private:  //==================================================================
0046   void setTrackerTopology(const edm::EventSetup&);
0047   void setTrackerGeometry(const edm::EventSetup&);
0048 
0049   void analyzeTrackerAlignables();
0050   void analyzeAlignableDetUnits(Alignable*);
0051   void analyzeCompositeAlignables(Alignable*);
0052   int countCompositeAlignables(Alignable*);
0053   void printAlignableStructure(Alignable*, std::ostringstream&, int indent);
0054 
0055   void analyzeTrackerGeometry();
0056   void analyzeTrackerGeometryVersion(std::ostringstream&);
0057   void analyzePXBDetUnit(DetId& detId, std::ostringstream&);
0058   void analyzePXB();
0059   void analyzePXEDetUnit(DetId& detId, std::ostringstream&);
0060   void analyzePXE();
0061   void analyzeTIBDetUnit(DetId& detId, std::ostringstream&);
0062   void analyzeTIB();
0063   void analyzeTIDDetUnit(DetId& detId, std::ostringstream&);
0064   void analyzeTID();
0065   void analyzeTOBDetUnit(DetId& detId, std::ostringstream&);
0066   void analyzeTOB();
0067   void analyzeTECDetUnit(DetId& detId, std::ostringstream&);
0068   void analyzeTEC();
0069 
0070   //========================== PRIVATE DATA ===================================
0071   //===========================================================================
0072 
0073   // ESTokens
0074   const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_;
0075   const edm::ESGetToken<GeometricDet, IdealGeometryRecord> geomDetToken_;
0076   const edm::ESGetToken<PTrackerParameters, PTrackerParametersRcd> ptpToken_;
0077   const edm::ESGetToken<PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd> ptapToken_;
0078 
0079   // config-file parameters
0080   const bool analyzeAlignables_;
0081   const bool printTrackerStructure_;
0082   const int maxPrintDepth_;
0083   const bool analyzeGeometry_;
0084   const bool analyzePXB_;
0085   const bool analyzePXE_;
0086   const bool analyzeTIB_;
0087   const bool analyzeTID_;
0088   const bool analyzeTOB_;
0089   const bool analyzeTEC_;
0090 
0091   // topology and geometry
0092   const TrackerTopology* trackerTopology;
0093   const TrackerGeometry* trackerGeometry;
0094 
0095   // alignable object ID provider
0096   AlignableObjectId alignableObjectId_;
0097 
0098   // counter for detUnits
0099   int numPXBDetUnits = 0;
0100   int numPXEDetUnits = 0;
0101   int numTIBDetUnits = 0;
0102   int numTIDDetUnits = 0;
0103   int numTOBDetUnits = 0;
0104   int numTECDetUnits = 0;
0105 
0106   // PixelBarrel counters
0107   std::set<unsigned int> pxbLayerIDs;
0108   std::set<unsigned int> pxbLadderIDs;
0109   std::set<unsigned int> pxbModuleIDs;
0110 
0111   // PixelEndcap counters
0112   std::set<unsigned int> pxeSideIDs;
0113   std::set<unsigned int> pxeDiskIDs;
0114   std::set<unsigned int> pxeBladeIDs;
0115   std::set<unsigned int> pxePanelIDs;
0116   std::set<unsigned int> pxeModuleIDs;
0117 
0118   // TIB counters
0119   std::set<unsigned int> tibSideIDs;
0120   std::set<unsigned int> tibLayerIDs;
0121   std::set<unsigned int> tibStringIDs;
0122   std::set<unsigned int> tibModuleIDs;
0123 
0124   // TID counters
0125   std::set<unsigned int> tidSideIDs;
0126   std::set<unsigned int> tidWheelIDs;
0127   std::set<unsigned int> tidRingIDs;
0128   std::set<unsigned int> tidModuleIDs;
0129 
0130   // TOB counters
0131   std::set<unsigned int> tobLayerIDs;
0132   std::set<unsigned int> tobSideIDs;
0133   std::set<unsigned int> tobRodIDs;
0134   std::set<unsigned int> tobModuleIDs;
0135 
0136   // TEC counters
0137   std::set<unsigned int> tecSideIDs;
0138   std::set<unsigned int> tecWheelIDs;
0139   std::set<unsigned int> tecPetalIDs;
0140   std::set<unsigned int> tecRingIDs;
0141   std::set<unsigned int> tecModuleIDs;
0142 };
0143 
0144 // define this as a plug-in
0145 DEFINE_FWK_MODULE(TrackerGeometryAnalyzer);
0146 
0147 #endif /* Alignment_TrackerAlignment_TrackerGeometryAnalyzer_h */