CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTConfigTrivialProducer Class Reference

#include <DTConfigTrivialProducer.h>

Inheritance diagram for DTConfigTrivialProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 DTConfigTrivialProducer (const edm::ParameterSet &)
 Constructor. More...
 
std::unique_ptr< DTConfigManagerproduce (const DTConfigManagerRcd &)
 ES produce method. More...
 
 ~DTConfigTrivialProducer () override
 destructor More...
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Member Functions

void buildManager ()
 Build Config Manager. More...
 
DTConfigPedestals buildTrivialPedestals ()
 Build Config Pedestals. More...
 
std::string mapEntryName (const DTChamberId &chambid) const
 

Private Attributes

bool m_debug
 
DTConfigManagerm_manager
 
edm::ParameterSet m_ps
 
DTTPGParametersm_tpgParams
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

L1TriggerConfig/DTTPGConfigProducers/interface/DTConfigTrivialProducer.h

Description: A Producer for the DT config available via EventSetup

Implementation: <Notes on="" implementation>="">

Definition at line 41 of file DTConfigTrivialProducer.h.

Constructor & Destructor Documentation

DTConfigTrivialProducer::DTConfigTrivialProducer ( const edm::ParameterSet ps)

Constructor.

Definition at line 15 of file DTConfigTrivialProducer.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), m_debug, m_manager, m_ps, m_tpgParams, DTConfigManager::setDTTPGDebug(), DTConfigManager::setLutFromDB(), DTConfigManager::setUseAcceptParam(), and edm::ESProducer::setWhatProduced().

15  {
16 
17  setWhatProduced(this);
18 
19  // get and store parameter set
20  m_ps = ps;
21  m_manager = new DTConfigManager();
23 
24  // set debug
25  edm::ParameterSet conf_ps =
26  m_ps.getParameter<edm::ParameterSet>("DTTPGParameters");
27  m_debug = conf_ps.getUntrackedParameter<bool>("Debug");
28 
29  if (m_debug)
30  cout << "DTConfigTrivialProducer::DTConfigTrivialProducer()" << endl;
31 
32  m_manager->setDTTPGDebug(m_debug);
33 
34  // DB specific requests
35  bool tracoLutsFromDB = m_ps.getParameter<bool>("TracoLutsFromDB");
36  bool useBtiAcceptParam = m_ps.getParameter<bool>("UseBtiAcceptParam");
37 
38  // set specific DB requests
39  m_manager->setLutFromDB(tracoLutsFromDB);
41  useBtiAcceptParam); // CB Are these needed here???
42 }
void setLutFromDB(bool lutFromDB)
Set lut from DB flag.
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
T getUntrackedParameter(std::string const &, T const &) const
void setDTTPGDebug(bool debug)
SetGlobalDebug flag.
void setUseAcceptParam(bool acceptparam)
Set the use of Bti acceptance parameters (LL,LH,CL,CH,RL,RH)
DTConfigTrivialProducer::~DTConfigTrivialProducer ( )
override

destructor

Definition at line 44 of file DTConfigTrivialProducer.cc.

References gather_cfg::cout, and m_debug.

44  {
45 
46  if (m_debug)
47  cout << "DTConfigTrivialProducer::~DTConfigTrivialProducer()" << endl;
48 }

Member Function Documentation

void DTConfigTrivialProducer::buildManager ( )
private

Build Config Manager.

Definition at line 71 of file DTConfigTrivialProducer.cc.

References buildTrivialPedestals(), gather_cfg::cout, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), m_debug, m_manager, m_ps, mapEntryName(), DTChamberId::sector(), DTConfigManager::setDTConfigBti(), DTConfigManager::setDTConfigLUTs(), DTConfigManager::setDTConfigPedestals(), DTConfigManager::setDTConfigSectColl(), DTConfigManager::setDTConfigTraco(), DTConfigManager::setDTConfigTrigUnit(), DTConfigManager::setDTConfigTSPhi(), DTConfigManager::setDTConfigTSTheta(), DTConfigManager::setLutFromDB(), DTChamberId::station(), and DTChamberId::wheel().

Referenced by produce().

71  {
72 
73  if (m_debug)
74  cout << "DTConfigTrivialProducer::buildManager()" << endl;
75 
76  // create config classes&C.
77  edm::ParameterSet conf_ps =
78  m_ps.getParameter<edm::ParameterSet>("DTTPGParameters");
79  edm::ParameterSet conf_map =
81  DTConfigSectColl sectcollconf(
82  conf_ps.getParameter<edm::ParameterSet>("SectCollParameters"));
83  edm::ParameterSet tups =
84  conf_ps.getParameter<edm::ParameterSet>("TUParameters");
85  DTConfigBti bticonf(tups.getParameter<edm::ParameterSet>("BtiParameters"));
86  DTConfigTraco tracoconf(
87  tups.getParameter<edm::ParameterSet>("TracoParameters"));
88  DTConfigLUTs lutconf(tups.getParameter<edm::ParameterSet>("LutParameters"));
89  DTConfigTSTheta tsthetaconf(
90  tups.getParameter<edm::ParameterSet>("TSThetaParameters"));
91  DTConfigTSPhi tsphiconf(
92  tups.getParameter<edm::ParameterSet>("TSPhiParameters"));
93  DTConfigTrigUnit trigunitconf(tups);
94 
95  for (int iwh = -2; iwh <= 2; ++iwh) {
96  for (int ist = 1; ist <= 4; ++ist) {
97  for (int ise = 1; ise <= 12; ++ise) {
98  DTChamberId chambid(iwh, ist, ise);
99  vector<int> nmap = conf_map.getUntrackedParameter<vector<int>>(
100  mapEntryName(chambid).c_str());
101 
102  if (m_debug) {
103  std::cout << " Filling configuration for chamber : wh "
104  << chambid.wheel() << ", st " << chambid.station()
105  << ", se " << chambid.sector() << endl;
106  }
107 
108  // fill the bti map
109  for (int isl = 1; isl <= 3; isl++) {
110  int ncell = nmap[isl - 1];
111  // std::cout << ncell <<" , ";
112  for (int ibti = 0; ibti < ncell; ibti++) {
113  m_manager->setDTConfigBti(DTBtiId(chambid, isl, ibti + 1), bticonf);
114  if (m_debug)
115  std::cout << "Filling BTI config for chamber : wh "
116  << chambid.wheel() << ", st " << chambid.station()
117  << ", se " << chambid.sector() << "... sl " << isl
118  << ", bti " << ibti + 1 << endl;
119  }
120  }
121 
122  // fill the traco map
123  int ntraco = nmap[3];
124  // std::cout << ntraco << " }" << std::endl;
125  for (int itraco = 0; itraco < ntraco; itraco++) {
126  m_manager->setDTConfigTraco(DTTracoId(chambid, itraco + 1),
127  tracoconf);
128  if (m_debug)
129  std::cout << "Filling TRACO config for chamber : wh "
130  << chambid.wheel() << ", st " << chambid.station()
131  << ", se " << chambid.sector() << ", traco " << itraco + 1
132  << endl;
133  }
134 
135  // fill TS & TrigUnit
136  m_manager->setDTConfigTSTheta(chambid, tsthetaconf);
137  m_manager->setDTConfigTSPhi(chambid, tsphiconf);
138  m_manager->setDTConfigTrigUnit(chambid, trigunitconf);
139 
140  // fill LUTs
141  m_manager->setDTConfigLUTs(chambid, lutconf);
143  false); // 110204 SV to be sure to compute luts from geometry
144  }
145  }
146  }
147 
148  for (int iwh = -2; iwh <= 2; ++iwh) {
149  for (int ise = 13; ise <= 14; ++ise) {
150  int ist = 4;
151  DTChamberId chambid(iwh, ist, ise);
152  vector<int> nmap = conf_map.getUntrackedParameter<vector<int>>(
153  mapEntryName(chambid).c_str());
154 
155  if (m_debug) {
156  std::cout << " Filling configuration for chamber : wh "
157  << chambid.wheel() << ", st " << chambid.station() << ", se "
158  << chambid.sector() << endl;
159  }
160 
161  // fill the bti map
162  for (int isl = 1; isl <= 3; isl++) {
163  int ncell = nmap[isl - 1];
164  // std::cout << ncell <<" , ";
165  for (int ibti = 0; ibti < ncell; ibti++) {
166  m_manager->setDTConfigBti(DTBtiId(chambid, isl, ibti + 1), bticonf);
167  if (m_debug)
168  std::cout << "Filling BTI config for chamber : wh "
169  << chambid.wheel() << ", st " << chambid.station()
170  << ", se " << chambid.sector() << "... sl " << isl
171  << ", bti " << ibti + 1 << endl;
172  }
173  }
174 
175  // fill the traco map
176  int ntraco = nmap[3];
177  // std::cout << ntraco << " }" << std::endl;
178  for (int itraco = 0; itraco < ntraco; itraco++) {
179  m_manager->setDTConfigTraco(DTTracoId(chambid, itraco + 1), tracoconf);
180  if (m_debug)
181  std::cout << "Filling TRACO config for chamber : wh "
182  << chambid.wheel() << ", st " << chambid.station()
183  << ", se " << chambid.sector() << ", traco " << itraco + 1
184  << endl;
185  }
186 
187  // fill TS & TrigUnit
188  m_manager->setDTConfigTSTheta(chambid, tsthetaconf);
189  m_manager->setDTConfigTSPhi(chambid, tsphiconf);
190  m_manager->setDTConfigTrigUnit(chambid, trigunitconf);
191 
192  // fill LUTs
193  m_manager->setDTConfigLUTs(chambid, lutconf);
195  false); // 110204 SV to be sure to compute luts from geometry
196  }
197  }
198 
199  // loop on Sector Collectors
200  for (int wh = -2; wh <= 2; wh++)
201  for (int se = 1; se <= 12; se++)
202  m_manager->setDTConfigSectColl(DTSectCollId(wh, se), sectcollconf);
203 
204  // fake collection of pedestals
206 }
void setLutFromDB(bool lutFromDB)
Set lut from DB flag.
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void setDTConfigTSTheta(DTChamberId chambid, DTConfigTSTheta conf)
Set DTConfigTSTheta for desired chip.
std::string mapEntryName(const DTChamberId &chambid) const
void setDTConfigTraco(DTTracoId, DTConfigTraco)
Set DTConfigTraco for desired chip.
DTConfigPedestals buildTrivialPedestals()
Build Config Pedestals.
void setDTConfigBti(DTBtiId, DTConfigBti)
Set DTConfigBti for desired chip.
void setDTConfigTSPhi(DTChamberId chambid, DTConfigTSPhi conf)
Set DTConfigTSPhi for desired chip.
void setDTConfigLUTs(DTChamberId chambid, DTConfigLUTs conf)
Set DTConfigLUTs for desired chamber.
void setDTConfigPedestals(DTConfigPedestals pedestals)
Set DTConfigPedestals configuration.
void setDTConfigSectColl(DTSectCollId sectcollid, DTConfigSectColl conf)
Set DTConfigSectColl for desired chip.
void setDTConfigTrigUnit(DTChamberId chambid, DTConfigTrigUnit conf)
Set DTConfigTrigUnit for desired chamber.
DTConfigPedestals DTConfigTrivialProducer::buildTrivialPedestals ( )
private

Build Config Pedestals.

Definition at line 208 of file DTConfigTrivialProducer.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), m_debug, m_ps, m_tpgParams, DTTimeUnits::ns, DTTPGParameters::set(), DTConfigPedestals::setES(), DTConfigPedestals::setUseT0(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by buildManager().

208  {
209 
210  int counts = m_ps.getParameter<int>("bxOffset");
211  float fine = m_ps.getParameter<double>("finePhase");
212 
213  if (m_debug)
214  cout << "DTConfigTrivialProducer::buildPedestals()" << endl;
215 
216  // DTTPGParameters tpgParams;
217  for (int iwh = -2; iwh <= 2; ++iwh) {
218  for (int ist = 1; ist <= 4; ++ist) {
219  for (int ise = 1; ise <= 14; ++ise) {
220  if (ise > 12 && ist != 4)
221  continue;
222 
223  DTChamberId chId(iwh, ist, ise);
224  m_tpgParams->set(chId, counts, fine, DTTimeUnits::ns);
225  }
226  }
227  }
228 
229  DTConfigPedestals tpgPedestals;
230  tpgPedestals.setUseT0(false);
231  tpgPedestals.setES(m_tpgParams);
232 
233  return tpgPedestals;
234 }
T getParameter(std::string const &) const
int set(int wheelId, int stationId, int sectorId, int nc, float ph, DTTimeUnits::type unit)
void setES(DTTPGParameters const *tpgParams, DTT0 const *t0Params=nullptr)
Set parameters from ES.
void setUseT0(bool useT0)
Set t0i subtraction.
std::string DTConfigTrivialProducer::mapEntryName ( const DTChamberId chambid) const
private

Definition at line 237 of file DTConfigTrivialProducer.cc.

References DTChamberId::sector(), DTChamberId::station(), and DTChamberId::wheel().

Referenced by buildManager().

237  {
238  int iwh = chambid.wheel();
239  std::ostringstream os;
240  os << "wh";
241  if (iwh < 0) {
242  os << 'm' << -iwh;
243  } else {
244  os << iwh;
245  }
246  os << "st" << chambid.station() << "se" << chambid.sector();
247  return os.str();
248 }
int sector() const
Definition: DTChamberId.h:61
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
std::unique_ptr< DTConfigManager > DTConfigTrivialProducer::produce ( const DTConfigManagerRcd iRecord)

ES produce method.

Definition at line 55 of file DTConfigTrivialProducer.cc.

References buildManager(), gather_cfg::cout, m_debug, and m_manager.

55  {
56 
57  if (m_debug)
58  cout << "DTConfigTrivialProducer::produce()" << endl;
59 
60  using namespace edm::es;
61  buildManager();
62 
63  // m_manager->getDTConfigPedestals()->print();
64 
65  std::unique_ptr<DTConfigManager> dtConfig =
66  std::unique_ptr<DTConfigManager>(m_manager);
67 
68  return dtConfig;
69 }
void buildManager()
Build Config Manager.

Member Data Documentation

bool DTConfigTrivialProducer::m_debug
private
DTConfigManager* DTConfigTrivialProducer::m_manager
private

Definition at line 63 of file DTConfigTrivialProducer.h.

Referenced by buildManager(), DTConfigTrivialProducer(), and produce().

edm::ParameterSet DTConfigTrivialProducer::m_ps
private
DTTPGParameters* DTConfigTrivialProducer::m_tpgParams
private

Definition at line 64 of file DTConfigTrivialProducer.h.

Referenced by buildTrivialPedestals(), and DTConfigTrivialProducer().