CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloGeometryBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CaloGeometryBuilder
4 // Class: CaloGeometryBuilder
5 //
13 //
14 // Original Author: Jeremiah Mans
15 // Created: Mon Oct 3 11:35:27 CDT 2005
16 // $Id: CaloGeometryBuilder.cc,v 1.15 2009/01/29 22:31:19 heltsley Exp $
17 //
18 //
19 
20 
21 // user include files
35 //
36 // member functions
37 //
39 {
40  //the following line is needed to tell the framework what
41  // data is being produced
42  setWhatProduced( this,
44 
45  //now do what ever other initialization is needed
46 
47  theCaloList = iConfig.getParameter< std::vector<std::string> >("SelectedCalos");
48  if ( theCaloList.size() == 0 ) throw cms::Exception("Configuration")
49  << "No calorimeter specified for geometry, aborting";
50 }
51 
52 // ------------ method called to produce the data ------------
53 
56 {
57 // std::cout<<"*****************************entering geometry builder***********"<<std::endl;
58 
60 
61  ReturnType pCalo ( new CaloGeometry() ) ;
62 
63  // loop on selected calorimeters
64 
65  for ( std::vector<std::string>::const_iterator ite ( theCaloList.begin() ) ;
66  ite != theCaloList.end(); ++ite )
67  {
68  // look for HCAL parts
69  // assume 'HCAL' for all of HCAL.
70  if ( (*ite) == HcalGeometry::producerTag() )
71  {
72  edm::LogInfo("CaloGeometryBuilder") << "Building HCAL reconstruction geometry";
73 
74  iRecord.getRecord< HcalGeometryRecord >().get( HcalGeometry::producerTag(), pG );
75  pCalo->setSubdetGeometry( DetId::Hcal, HcalBarrel , pG.product() );
76  pCalo->setSubdetGeometry( DetId::Hcal, HcalEndcap , pG.product() );
77  pCalo->setSubdetGeometry( DetId::Hcal, HcalOuter , pG.product() );
78  pCalo->setSubdetGeometry( DetId::Hcal, HcalForward, pG.product() );
79  }
80  else if ( (*ite) == ZdcGeometry::producerTag() )
81  {
82  edm::LogInfo("CaloGeometryBuilder") << "Building ZDC reconstruction geometry";
83  iRecord.getRecord< ZDCGeometryRecord >().get( ZdcGeometry::producerTag(), pG );
84  pCalo->setSubdetGeometry( DetId::Calo, HcalZDCDetId::SubdetectorId,pG.product());
85  }
86  else if ( (*ite) == CastorGeometry::producerTag() )
87  {
88  edm::LogInfo("CaloGeometryBuilder") << "Building CASTOR reconstruction geometry";
90  pCalo->setSubdetGeometry( DetId::Calo, HcalCastorDetId::SubdetectorId,pG.product());
91  }
92  // look for Ecal Barrel
93  else if ( (*ite) == EcalBarrelGeometry::producerTag() )
94  {
95 // std::cout<< "Building EcalBarrel reconstruction geometry"<<std::endl;
96  edm::LogInfo("CaloGeometryBuilder") << "Building EcalBarrel reconstruction geometry";
98  pCalo->setSubdetGeometry(DetId::Ecal,EcalBarrel,pG.product());
99  }
100  // look for Ecal Endcap
101  else if ( (*ite) == EcalEndcapGeometry::producerTag() )
102  {
103  edm::LogInfo("CaloGeometryBuilder") << "Building EcalEndcap reconstruction geometry";
105  pCalo->setSubdetGeometry(DetId::Ecal,EcalEndcap,pG.product());
106  }
107  // look for Ecal Preshower
108  else if ( (*ite) == EcalPreshowerGeometry::producerTag() )
109  {
110  edm::LogInfo("CaloGeometryBuilder") << "Building EcalPreshower reconstruction geometry";
112  pCalo->setSubdetGeometry(DetId::Ecal,EcalPreshower,pG.product());
113  }
114  // look for TOWER parts
115  else if ( (*ite) == CaloTowerGeometry::producerTag() )
116  {
117  edm::LogInfo("CaloGeometryBuilder") << "Building TOWER reconstruction geometry";
119  pCalo->setSubdetGeometry(DetId::Calo,1,pG.product());
120  }
121  else
122  {
123  edm::LogWarning("CaloGeometryBuilder")
124  << "Reconstrcution geometry requested for a not implemented sub-detector: "
125  << (*ite);
126  }
127  }
128  return pCalo ;
129 }
T getParameter(std::string const &) const
static std::string producerTag()
Definition: ZdcGeometry.h:46
static std::string producerTag()
Definition: HcalGeometry.h:59
static std::string producerTag()
CaloGeometryBuilder(const edm::ParameterSet &iConfig)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
static std::string producerTag()
static std::string producerTag()
std::vector< std::string > theCaloList
boost::shared_ptr< CaloGeometry > ReturnType
static const int SubdetectorId
static std::string producerTag()
static const int SubdetectorId
Definition: HcalZDCDetId.h:22
T const * product() const
Definition: ESHandle.h:62
static std::string producerTag()
ReturnType produceAligned(const CaloGeometryRecord &iRecord)