CMS 3D CMS Logo

L1RPCConeDefinitionProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1RPCConeDefinitionProducer
4 // Class: L1RPCConeDefinitionProducer
5 //
13 //
14 // Original Author: Tomasz Maciej Frueboes
15 // Created: Mon Feb 23 12:09:06 CET 2009
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 
22 // user include files
25 
27 
30 
31 //
32 // class decleration
33 //
34 
36 public:
39 
40  using ReturnType = std::unique_ptr<L1RPCConeDefinition>;
41 
43 
44 private:
45  // ----------member data ---------------------------
48  int m_rollBeg;
49  int m_rollEnd;
52 
53  //L1RPCConeDefinition::TLPSizesInTowers m_LPSizesInTowers;
55 
56  //L1RPCConeDefinition::TRingsToTowers m_RingsToTowers;
58 
59  //L1RPCConeDefinition::TRingsToLP m_RingsToLP;
61 };
62 
63 //
64 // constants, enums and typedefs
65 //
66 
67 //
68 // static data member definitions
69 //
70 
71 //
72 // constructors and destructor
73 //
75  : m_towerBeg(iConfig.getParameter<int>("towerBeg")),
76  m_towerEnd(iConfig.getParameter<int>("towerEnd")),
77  m_rollBeg(iConfig.getParameter<int>("rollBeg")),
78  m_rollEnd(iConfig.getParameter<int>("rollEnd")),
79  m_hwPlaneBeg(iConfig.getParameter<int>("hwPlaneBeg")),
80  m_hwPlaneEnd(iConfig.getParameter<int>("hwPlaneEnd")) {
81  //the following line is needed to tell the framework what
82  // data is being produced
83  setWhatProduced(this);
84 
85  for (int t = m_towerBeg; t <= m_towerEnd; ++t) {
86  std::stringstream name;
87  name << "lpSizeTower" << t;
88 
89  std::vector<int> newSizes = iConfig.getParameter<std::vector<int> >(name.str().c_str());
90 
91  for (unsigned int lp = 0; lp < newSizes.size(); ++lp) {
92  // L1RPCConeDefinition::TLPSize lps(t, lp, newSizes[lp]);
94  lps.m_tower = t;
95  lps.m_LP = lp;
96  lps.m_size = newSizes[lp];
97  m_LPSizeVec.push_back(lps);
98  }
99  }
100 
101  //now do what ever other initialization is needed
102 
103  // hw planes numbered from 0 to 5
104  // rolls from 0 to 17 (etaPartition)
105  //
106  // rollConnLP_[roll]_[hwPlane-1]
107  // rollConnLP_5_3 = cms.vint32(6, 0, 0),
108  // ----- roll 5, hwPlane 4 (3+1) is logplane 6 (OK)
109  //
110  // rollConnT_[roll]_[hwPlane-1]
111  // rollConnT_5_3 = cms.vint32(4, -1, -1),
112  // ----- roll 5, hwPlane 4 (3+1) contirubtes to tower 4 (OK)
113 
114  for (int roll = m_rollBeg; roll <= m_rollEnd; ++roll) {
115  //L1RPCConeDefinition::THWplaneToTower newHwPlToTower;
116  //L1RPCConeDefinition::THWplaneToLP newHWplaneToLP;
117  for (int hwpl = m_hwPlaneBeg; hwpl <= m_hwPlaneEnd; ++hwpl) {
118  std::stringstream name;
119  name << "rollConnLP_" << roll << "_" << hwpl;
120 
121  std::vector<int> hwPl2LPVec = iConfig.getParameter<std::vector<int> >(name.str().c_str());
122  //newHWplaneToLP.push_back(newListLP);
123  for (unsigned int i = 0; i < hwPl2LPVec.size(); ++i) {
124  if (hwPl2LPVec[i] >= 0) {
125  // L1RPCConeDefinition::TRingToLP lp(roll, hwpl, hwPl2LPVec[i],i);
127  lp.m_etaPart = roll;
128  lp.m_hwPlane = hwpl;
129  lp.m_LP = hwPl2LPVec[i];
130  lp.m_index = i;
131  m_ringToLPVec.push_back(lp);
132  }
133  }
134 
135  std::stringstream name1;
136  name1 << "rollConnT_" << roll << "_" << hwpl;
137 
138  /*L1RPCConeDefinition::TLPList newListT =
139  iConfig.getParameter<std::vector<int> >(name1.str().c_str());
140  newHwPlToTower.push_back(newListT);*/
141  std::vector<int> hwPl2TowerVec = iConfig.getParameter<std::vector<int> >(name1.str().c_str());
142 
143  for (unsigned int i = 0; i < hwPl2TowerVec.size(); ++i) {
144  if (hwPl2TowerVec[i] >= 0) {
145  // L1RPCConeDefinition::TRingToTower rt(roll, hwpl, hwPl2TowerVec[i],i);
147  rt.m_etaPart = roll;
148  rt.m_hwPlane = hwpl;
149  rt.m_tower = hwPl2TowerVec[i];
150  rt.m_index = i;
151  m_ringToTowerVec.push_back(rt);
152  }
153  }
154  }
155  //m_RingsToTowers.push_back(newHwPlToTower);
156 
157  //m_RingsToLP.push_back(newHWplaneToLP);
158  }
159 }
160 
162 
163 //
164 // member functions
165 //
166 
167 // ------------ method called to produce the data ------------
169  auto pL1RPCConeDefinition = std::make_unique<L1RPCConeDefinition>();
170 
171  pL1RPCConeDefinition->setFirstTower(m_towerBeg);
172  pL1RPCConeDefinition->setLastTower(m_towerEnd);
173 
174  pL1RPCConeDefinition->setLPSizeVec(m_LPSizeVec);
175  pL1RPCConeDefinition->setRingToLPVec(m_ringToLPVec);
176  pL1RPCConeDefinition->setRingToTowerVec(m_ringToTowerVec);
177 
178  return pL1RPCConeDefinition;
179 }
180 
181 //define this as a plug-in
L1RPCConeDefinitionProducer
Definition: L1RPCConeDefinitionProducer.cc:35
L1RPCConeDefinition::TRingToLP::m_LP
signed char m_LP
Definition: L1RPCConeDefinition.h:55
mps_fire.i
i
Definition: mps_fire.py:355
L1RPCConeDefinition::TRingToLP
Definition: L1RPCConeDefinition.h:50
L1RPCConeDefinitionProducer::m_towerEnd
int m_towerEnd
Definition: L1RPCConeDefinitionProducer.cc:47
ESHandle.h
L1RPCConeDefinition::TLPSize::m_size
unsigned char m_size
Definition: L1RPCConeDefinition.h:18
L1RPCConeDefinitionProducer::ReturnType
std::unique_ptr< L1RPCConeDefinition > ReturnType
Definition: L1RPCConeDefinitionProducer.cc:40
hcal_runs.rt
rt
Definition: hcal_runs.py:76
L1RPCConeDefinition::TRingToTowerVec
std::vector< TRingToTower > TRingToTowerVec
Definition: L1RPCConeDefinition.h:40
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
ESProducer.h
L1RPCConeDefinitionProducer::m_rollEnd
int m_rollEnd
Definition: L1RPCConeDefinitionProducer.cc:49
L1RPCConeDefinition::TLPSize::m_tower
signed char m_tower
Definition: L1RPCConeDefinition.h:16
L1RPCConeDefinition::TLPSize
Definition: L1RPCConeDefinition.h:13
L1RPCConeDefinition::TRingToTower
Definition: L1RPCConeDefinition.h:30
L1RPCConeDefinitionRcd.h
L1RPCConeDefinitionProducer::m_ringToTowerVec
L1RPCConeDefinition::TRingToTowerVec m_ringToTowerVec
Definition: L1RPCConeDefinitionProducer.cc:57
L1RPCConeDefinitionProducer::produce
ReturnType produce(const L1RPCConeDefinitionRcd &)
Definition: L1RPCConeDefinitionProducer.cc:168
L1RPCConeDefinitionProducer::m_ringToLPVec
L1RPCConeDefinition::TRingToLPVec m_ringToLPVec
Definition: L1RPCConeDefinitionProducer.cc:60
OrderedSet.t
t
Definition: OrderedSet.py:90
L1RPCConeDefinitionProducer::L1RPCConeDefinitionProducer
L1RPCConeDefinitionProducer(const edm::ParameterSet &)
Definition: L1RPCConeDefinitionProducer.cc:74
edm::ParameterSet
Definition: ParameterSet.h:36
L1RPCConeDefinitionProducer::m_hwPlaneEnd
int m_hwPlaneEnd
Definition: L1RPCConeDefinitionProducer.cc:51
L1RPCConeDefinition::TRingToLP::m_etaPart
signed char m_etaPart
Definition: L1RPCConeDefinition.h:53
createfilelist.int
int
Definition: createfilelist.py:10
L1RPCConeDefinition::TRingToLP::m_index
unsigned char m_index
Definition: L1RPCConeDefinition.h:56
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
L1RPCConeDefinitionRcd
Definition: L1RPCConeDefinitionRcd.h:16
ModuleFactory.h
L1RPCConeDefinition::TRingToLPVec
std::vector< TRingToLP > TRingToLPVec
Definition: L1RPCConeDefinition.h:60
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
L1RPCConeDefinition::TRingToLP::m_hwPlane
signed char m_hwPlane
Definition: L1RPCConeDefinition.h:54
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ESProducer
Definition: ESProducer.h:101
L1RPCConeDefinitionProducer::m_LPSizeVec
L1RPCConeDefinition::TLPSizeVec m_LPSizeVec
Definition: L1RPCConeDefinitionProducer.cc:54
L1RPCConeDefinitionProducer::m_rollBeg
int m_rollBeg
Definition: L1RPCConeDefinitionProducer.cc:48
L1RPCConeDefinitionProducer::m_hwPlaneBeg
int m_hwPlaneBeg
Definition: L1RPCConeDefinitionProducer.cc:50
L1RPCConeDefinitionProducer::~L1RPCConeDefinitionProducer
~L1RPCConeDefinitionProducer() override
Definition: L1RPCConeDefinitionProducer.cc:161
L1RPCConeDefinition::TLPSizeVec
std::vector< TLPSize > TLPSizeVec
Definition: L1RPCConeDefinition.h:22
L1RPCConeDefinition.h
L1RPCConeDefinitionProducer::m_towerBeg
int m_towerBeg
Definition: L1RPCConeDefinitionProducer.cc:46
L1RPCConeDefinition::TLPSize::m_LP
signed char m_LP
Definition: L1RPCConeDefinition.h:17