Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-18 00:39:59

0001 #ifndef GEOMETRY_FWTGEORECO_GEOMETRY_ES_PRODUCER_H
0002 #define GEOMETRY_FWTGEORECO_GEOMETRY_ES_PRODUCER_H
0003 
0004 #include <memory>
0005 
0006 #include "FWCore/Framework/interface/ESProducer.h"
0007 #include "FWCore/Utilities/interface/ESGetToken.h"
0008 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0009 
0010 namespace edm {
0011   class ParameterSet;
0012 }
0013 
0014 class CaloGeometry;
0015 class CaloGeometryRecord;
0016 class GlobalTrackingGeometry;
0017 class GlobalTrackingGeometryRecord;
0018 class TrackerGeometry;
0019 class TrackerTopology;
0020 class TrackerTopologyRcd;
0021 class FWTGeoRecoGeometry;
0022 class FWTGeoRecoGeometryRecord;
0023 
0024 class TGeoManager;
0025 class TGeoShape;
0026 class TGeoVolume;
0027 class TGeoMaterial;
0028 class TGeoMedium;
0029 class GeomDet;
0030 class CaloCellGeometry;
0031 class FWTGeoRecoGeometryESProducer : public edm::ESProducer {
0032   enum ERecoDet {
0033     kDummy,
0034     kSiPixel,
0035     kSiStrip,
0036     kMuonDT,
0037     kMuonRPC,
0038     kMuonCSC,
0039     kMuonGEM,
0040     kMuonME0,
0041     kECal,
0042     kHCal,
0043     kCaloTower,
0044     kHGCE,
0045     kHGCH
0046   };
0047 
0048 public:
0049   FWTGeoRecoGeometryESProducer(const edm::ParameterSet&);
0050   ~FWTGeoRecoGeometryESProducer(void) override;
0051 
0052   std::unique_ptr<FWTGeoRecoGeometry> produce(const FWTGeoRecoGeometryRecord&);
0053 
0054 private:
0055   FWTGeoRecoGeometryESProducer(const FWTGeoRecoGeometryESProducer&);
0056   const FWTGeoRecoGeometryESProducer& operator=(const FWTGeoRecoGeometryESProducer&);
0057 
0058   TGeoManager* createManager(int level);
0059   TGeoShape* createShape(const GeomDet* det);
0060   TGeoVolume* createVolume(const std::string& name, const GeomDet* det, ERecoDet = kDummy);
0061   // TGeoMaterial*     createMaterial( const std::string& name );
0062 
0063   TGeoVolume* GetDaughter(TGeoVolume* mother, const char* prefix, ERecoDet cidx, int id);
0064   TGeoVolume* GetDaughter(TGeoVolume* mother, const char* prefix, ERecoDet cidx);
0065   TGeoVolume* GetTopHolder(const char* prefix, ERecoDet cidx);
0066 
0067   TGeoMedium* GetMedium(ERecoDet);
0068 
0069   void addPixelBarrelGeometry();
0070   void addPixelForwardGeometry();
0071   void addTIBGeometry();
0072   void addTOBGeometry();
0073   void addTIDGeometry();
0074   void addTECGeometry();
0075   void addCSCGeometry();
0076   void addDTGeometry();
0077   void addRPCGeometry();
0078   void addGEMGeometry();
0079   void addME0Geometry();
0080   void addEcalCaloGeometry();
0081   void addHcalCaloGeometryBarrel();
0082   void addHcalCaloGeometryEndcap();
0083   void addHcalCaloGeometryOuter();
0084   void addHcalCaloGeometryForward();
0085   void addCaloTowerGeometry();
0086 
0087   std::map<std::string, TGeoShape*> m_nameToShape;
0088   std::map<TGeoShape*, TGeoVolume*> m_shapeToVolume;
0089   std::map<ERecoDet, TGeoMedium*> m_recoMedium;
0090 
0091   edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> m_trackingGeomToken;
0092   edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> m_trackerTopologyToken;
0093   edm::ESGetToken<CaloGeometry, CaloGeometryRecord> m_caloGeomToken;
0094 
0095   const GlobalTrackingGeometry* m_trackingGeom = nullptr;
0096   const CaloGeometry* m_caloGeom = nullptr;
0097   const TrackerGeometry* m_trackerGeom = nullptr;
0098   const TrackerTopology* m_trackerTopology = nullptr;
0099 
0100   TGeoMedium* m_dummyMedium = nullptr;
0101 
0102   bool m_tracker;
0103   bool m_muon;
0104   bool m_gem;
0105   bool m_calo;
0106 };
0107 
0108 #endif  // GEOMETRY_FWTGEORECO_GEOMETRY_ES_PRODUCER_H