CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: L1RPCConeDefinitionProducer.cc,v 1.5 2009/03/20 15:25:15 michals Exp $
17 //
18 //
19 
20 
21 // system include files
22 #include <memory>
23 #include "boost/shared_ptr.hpp"
24 
25 // user include files
28 
30 
31 
34 
35 //
36 // class decleration
37 //
38 
40  public:
43 
44  typedef boost::shared_ptr<L1RPCConeDefinition> ReturnType;
45 
47  private:
48  // ----------member data ---------------------------
51  int m_rollBeg;
52  int m_rollEnd;
55 
56  //L1RPCConeDefinition::TLPSizesInTowers m_LPSizesInTowers;
58 
59  //L1RPCConeDefinition::TRingsToTowers m_RingsToTowers;
61 
62  //L1RPCConeDefinition::TRingsToLP m_RingsToLP;
64 };
65 
66 //
67 // constants, enums and typedefs
68 //
69 
70 //
71 // static data member definitions
72 //
73 
74 //
75 // constructors and destructor
76 //
78  m_towerBeg(iConfig.getParameter<int>("towerBeg")),
79  m_towerEnd(iConfig.getParameter<int>("towerEnd")),
80  m_rollBeg(iConfig.getParameter<int>("rollBeg")),
81  m_rollEnd(iConfig.getParameter<int>("rollEnd")),
82  m_hwPlaneBeg(iConfig.getParameter<int>("hwPlaneBeg")),
83  m_hwPlaneEnd(iConfig.getParameter<int>("hwPlaneEnd"))
84 {
85  //the following line is needed to tell the framework what
86  // data is being produced
87  setWhatProduced(this);
88 
89  for (int t = m_towerBeg; t <= m_towerEnd; ++t){
90 
91  std::stringstream name;
92  name << "lpSizeTower" << t;
93 
94 
95  std::vector<int> newSizes =
96  iConfig.getParameter<std::vector<int> >(name.str().c_str());
97 
98  for (unsigned int lp = 0; lp < newSizes.size();++lp){
99 // L1RPCConeDefinition::TLPSize lps(t, lp, newSizes[lp]);
101  lps.m_tower=t;
102  lps.m_LP=lp;
103  lps.m_size=newSizes[lp];
104  m_LPSizeVec.push_back(lps);
105  }
106 
107 
108 
109  }
110 
111 
112 
113  //now do what ever other initialization is needed
114 
115  // hw planes numbered from 0 to 5
116  // rolls from 0 to 17 (etaPartition)
117  //
118  // rollConnLP_[roll]_[hwPlane-1]
119  // rollConnLP_5_3 = cms.vint32(6, 0, 0),
120  // ----- roll 5, hwPlane 4 (3+1) is logplane 6 (OK)
121  //
122  // rollConnT_[roll]_[hwPlane-1]
123  // rollConnT_5_3 = cms.vint32(4, -1, -1),
124  // ----- roll 5, hwPlane 4 (3+1) contirubtes to tower 4 (OK)
125 
126  for (int roll = m_rollBeg; roll <= m_rollEnd; ++roll){
127  //L1RPCConeDefinition::THWplaneToTower newHwPlToTower;
128  //L1RPCConeDefinition::THWplaneToLP newHWplaneToLP;
129  for (int hwpl = m_hwPlaneBeg; hwpl <= m_hwPlaneEnd; ++hwpl){
130  std::stringstream name;
131  name << "rollConnLP_" << roll << "_" << hwpl;
132 
133  std::vector<int> hwPl2LPVec = iConfig.getParameter<std::vector<int> >(name.str().c_str());
134  //newHWplaneToLP.push_back(newListLP);
135  for (unsigned int i = 0;i < hwPl2LPVec.size();++i){
136 
137  if (hwPl2LPVec[i]>=0)
138  {
139 // L1RPCConeDefinition::TRingToLP lp(roll, hwpl, hwPl2LPVec[i],i);
141  lp.m_etaPart=roll;
142  lp.m_hwPlane=hwpl;
143  lp.m_LP=hwPl2LPVec[i];
144  lp.m_index=i;
145  m_ringToLPVec.push_back(lp);
146  }
147  }
148 
149 
150  std::stringstream name1;
151  name1 << "rollConnT_" << roll << "_" << hwpl;
152 
153  /*L1RPCConeDefinition::TLPList newListT =
154  iConfig.getParameter<std::vector<int> >(name1.str().c_str());
155  newHwPlToTower.push_back(newListT);*/
156  std::vector<int> hwPl2TowerVec = iConfig.getParameter<std::vector<int> >(name1.str().c_str());
157 
158  for (unsigned int i = 0;i < hwPl2TowerVec.size();++i){
159 
160  if (hwPl2TowerVec[i]>=0)
161  {
162 // L1RPCConeDefinition::TRingToTower rt(roll, hwpl, hwPl2TowerVec[i],i);
164  rt.m_etaPart=roll;
165  rt.m_hwPlane=hwpl;
166  rt.m_tower=hwPl2TowerVec[i];
167  rt.m_index=i;
168  m_ringToTowerVec.push_back(rt);
169  }
170  }
171 
172 
173  }
174  //m_RingsToTowers.push_back(newHwPlToTower);
175 
176  //m_RingsToLP.push_back(newHWplaneToLP);
177  }
178 }
179 
180 
182 
183 
184 
185 //
186 // member functions
187 //
188 
189 // ------------ method called to produce the data ------------
192 {
193  using namespace edm::es;
194  boost::shared_ptr<L1RPCConeDefinition> pL1RPCConeDefinition(new L1RPCConeDefinition);
195 
196  pL1RPCConeDefinition->setFirstTower(m_towerBeg);
197  pL1RPCConeDefinition->setLastTower(m_towerEnd);
198 
199  pL1RPCConeDefinition->setLPSizeVec(m_LPSizeVec);
200  pL1RPCConeDefinition->setRingToLPVec(m_ringToLPVec);
201  pL1RPCConeDefinition->setRingToTowerVec(m_ringToTowerVec);
202 
203 
204  return pL1RPCConeDefinition ;
205 }
206 
207 //define this as a plug-in
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< TRingToTower > TRingToTowerVec
std::vector< TRingToLP > TRingToLPVec
std::vector< TLPSize > TLPSizeVec
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
L1RPCConeDefinition::TRingToLPVec m_ringToLPVec
L1RPCConeDefinition::TRingToTowerVec m_ringToTowerVec
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:56
L1RPCConeDefinitionProducer(const edm::ParameterSet &)
boost::shared_ptr< L1RPCConeDefinition > ReturnType
ReturnType produce(const L1RPCConeDefinitionRcd &)
L1RPCConeDefinition::TLPSizeVec m_LPSizeVec