CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HGCalTopologyBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CaloEventSetup
4 // Class: HGCalTopologyBuilder
5 //
13 //
14 // Original Author: Sunanda Banerjee
15 //
16 //
17 
18 
19 // system include files
20 #include <memory>
21 #include "boost/shared_ptr.hpp"
22 
23 // user include files
26 
35 
36 //#define DebugLog
37 
38 //
39 // class decleration
40 //
41 
43 
44 public:
47 
48  typedef boost::shared_ptr< HGCalTopology > ReturnType;
49 
51 
52 private:
53  // ----------member data ---------------------------
55  bool halfType_;
57 };
58 
59 
61 
62  name_ = iConfig.getUntrackedParameter<std::string>("Name");
63  int type = iConfig.getUntrackedParameter<int>("Type");
64  halfType_ = iConfig.getUntrackedParameter<bool>("HalfType");
65  if (type == 0) {
66  subdet_ = HGCEE;
67  } else if (type == 1) {
68  subdet_ = HGCHEF;
69  } else if (type == 2) {
70  subdet_ = HGCHEB;
71  } else {
72  subdet_ = HGCHET;
73  }
74 #ifdef DebugLog
75  std::cout <<"constructing HGCalTopology for " << name_ << std::endl;
76 #endif
77  setWhatProduced(this, name_);
78 }
79 
80 
82 
83 
84 //
85 // member functions
86 //
87 
88 // ------------ method called to produce the data ------------
91 
93  iRecord.get(name_, pHGDC) ;
94  const HGCalDDDConstants & hgdc = (*pHGDC);
95 
96  ReturnType ct ( new HGCalTopology(hgdc, subdet_, halfType_) ) ;
97 #ifdef DebugLog
98  std::cout << "Create HGCalTopology(hgdc,subdet,type)" << std::endl;
99 #endif
100  return ct ;
101 }
102 
type
Definition: HCALResponse.h:21
T getUntrackedParameter(std::string const &, T const &) const
boost::shared_ptr< HGCalTopology > ReturnType
ReturnType produce(const IdealGeometryRecord &)
ForwardSubdetector subdet_
ForwardSubdetector
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
void get(HolderT &iHolder) const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
HGCalTopologyBuilder(const edm::ParameterSet &iP)
tuple cout
Definition: gather_cfg.py:121