CMS 3D CMS Logo

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 
22 // user include files
25 
34 
35 //#define DebugLog
36 
37 //
38 // class decleration
39 //
40 
42 
43 public:
46 
47  typedef std::shared_ptr< HGCalTopology > ReturnType;
48 
49  ReturnType produce(const IdealGeometryRecord&);
50 
51 private:
52  // ----------member data ---------------------------
54  bool halfType_;
56 };
57 
58 
60 
61  name_ = iConfig.getUntrackedParameter<std::string>("Name");
62  int type = iConfig.getUntrackedParameter<int>("Type");
63  halfType_ = iConfig.getUntrackedParameter<bool>("HalfType");
64  if (type == 0) {
65  subdet_ = HGCEE;
66  } else if (type == 1) {
67  subdet_ = HGCHEF;
68  } else if (type == 2) {
69  subdet_ = HGCHEB;
70  } else {
71  subdet_ = HGCHET;
72  }
73 #ifdef DebugLog
74  std::cout <<"constructing HGCalTopology for " << name_ << std::endl;
75 #endif
76  setWhatProduced(this, name_);
77 }
78 
79 
81 
82 
83 //
84 // member functions
85 //
86 
87 // ------------ method called to produce the data ------------
90 
92  iRecord.get(name_, pHGDC) ;
93  const HGCalDDDConstants & hgdc = (*pHGDC);
94 
95  ReturnType ct ( new HGCalTopology(hgdc, subdet_, halfType_) ) ;
96 #ifdef DebugLog
97  std::cout << "Create HGCalTopology(hgdc,subdet,type)" << std::endl;
98 #endif
99  return ct ;
100 }
101 
type
Definition: HCALResponse.h:21
T getUntrackedParameter(std::string const &, T const &) const
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)
std::shared_ptr< HGCalTopology > ReturnType