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 ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
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

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &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 EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

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::DTConfigTrivialProducer ( const edm::ParameterSet ps)

Constructor.

Definition at line 15 of file DTConfigTrivialProducer.cc.

15  {
16  setWhatProduced(this);
17 
18  // get and store parameter set
19  m_ps = ps;
20  m_manager = new DTConfigManager();
22 
23  // set debug
24  edm::ParameterSet conf_ps = m_ps.getParameter<edm::ParameterSet>("DTTPGParameters");
25  m_debug = conf_ps.getUntrackedParameter<bool>("Debug");
26 
27  if (m_debug)
28  cout << "DTConfigTrivialProducer::DTConfigTrivialProducer()" << endl;
29 
31 
32  // DB specific requests
33  bool tracoLutsFromDB = m_ps.getParameter<bool>("TracoLutsFromDB");
34  bool useBtiAcceptParam = m_ps.getParameter<bool>("UseBtiAcceptParam");
35 
36  // set specific DB requests
37  m_manager->setLutFromDB(tracoLutsFromDB);
38  m_manager->setUseAcceptParam(useBtiAcceptParam); // CB Are these needed here???
39 }

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

◆ ~DTConfigTrivialProducer()

DTConfigTrivialProducer::~DTConfigTrivialProducer ( )
override

destructor

Definition at line 41 of file DTConfigTrivialProducer.cc.

41  {
42  if (m_debug)
43  cout << "DTConfigTrivialProducer::~DTConfigTrivialProducer()" << endl;
44 }

References gather_cfg::cout, and m_debug.

Member Function Documentation

◆ buildManager()

void DTConfigTrivialProducer::buildManager ( )
private

Build Config Manager.

Definition at line 64 of file DTConfigTrivialProducer.cc.

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

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().

◆ buildTrivialPedestals()

DTConfigPedestals DTConfigTrivialProducer::buildTrivialPedestals ( )
private

Build Config Pedestals.

Definition at line 178 of file DTConfigTrivialProducer.cc.

178  {
179  int counts = m_ps.getParameter<int>("bxOffset");
180  float fine = m_ps.getParameter<double>("finePhase");
181 
182  if (m_debug)
183  cout << "DTConfigTrivialProducer::buildPedestals()" << endl;
184 
185  // DTTPGParameters tpgParams;
186  for (int iwh = -2; iwh <= 2; ++iwh) {
187  for (int ist = 1; ist <= 4; ++ist) {
188  for (int ise = 1; ise <= 14; ++ise) {
189  if (ise > 12 && ist != 4)
190  continue;
191 
192  DTChamberId chId(iwh, ist, ise);
193  m_tpgParams->set(chId, counts, fine, DTTimeUnits::ns);
194  }
195  }
196  }
197 
198  DTConfigPedestals tpgPedestals;
199  tpgPedestals.setUseT0(false);
200  tpgPedestals.setES(m_tpgParams);
201 
202  return tpgPedestals;
203 }

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

Referenced by buildManager().

◆ mapEntryName()

std::string DTConfigTrivialProducer::mapEntryName ( const DTChamberId chambid) const
private

Definition at line 205 of file DTConfigTrivialProducer.cc.

205  {
206  int iwh = chambid.wheel();
207  std::ostringstream os;
208  os << "wh";
209  if (iwh < 0) {
210  os << 'm' << -iwh;
211  } else {
212  os << iwh;
213  }
214  os << "st" << chambid.station() << "se" << chambid.sector();
215  return os.str();
216 }

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

Referenced by buildManager().

◆ produce()

std::unique_ptr< DTConfigManager > DTConfigTrivialProducer::produce ( const DTConfigManagerRcd iRecord)

ES produce method.

Definition at line 50 of file DTConfigTrivialProducer.cc.

50  {
51  if (m_debug)
52  cout << "DTConfigTrivialProducer::produce()" << endl;
53 
54  using namespace edm::es;
55  buildManager();
56 
57  // m_manager->getDTConfigPedestals()->print();
58 
59  std::unique_ptr<DTConfigManager> dtConfig = std::unique_ptr<DTConfigManager>(m_manager);
60 
61  return dtConfig;
62 }

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

Member Data Documentation

◆ m_debug

bool DTConfigTrivialProducer::m_debug
private

◆ m_manager

DTConfigManager* DTConfigTrivialProducer::m_manager
private

Definition at line 63 of file DTConfigTrivialProducer.h.

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

◆ m_ps

edm::ParameterSet DTConfigTrivialProducer::m_ps
private

◆ m_tpgParams

DTTPGParameters* DTConfigTrivialProducer::m_tpgParams
private

Definition at line 64 of file DTConfigTrivialProducer.h.

Referenced by buildTrivialPedestals(), and DTConfigTrivialProducer().

DTTPGParameters::set
int set(int wheelId, int stationId, int sectorId, int nc, float ph, DTTimeUnits::type unit)
Definition: DTTPGParameters.cc:123
DTTracoId
Definition: DTTracoId.h:34
DTConfigSectColl
Definition: DTConfigSectColl.h:37
DTConfigTraco
Definition: DTConfigTraco.h:37
DTConfigManager::setDTConfigLUTs
void setDTConfigLUTs(DTChamberId chambid, DTConfigLUTs conf)
Set DTConfigLUTs for desired chamber.
Definition: DTConfigManager.h:129
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DTConfigTrivialProducer::m_ps
edm::ParameterSet m_ps
Definition: DTConfigTrivialProducer.h:62
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
DTConfigManager::setDTConfigPedestals
void setDTConfigPedestals(DTConfigPedestals pedestals)
Set DTConfigPedestals configuration.
Definition: DTConfigManager.h:135
DTConfigBti
Definition: DTConfigBti.h:36
DTConfigTrivialProducer::buildManager
void buildManager()
Build Config Manager.
Definition: DTConfigTrivialProducer.cc:64
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DTConfigTrivialProducer::buildTrivialPedestals
DTConfigPedestals buildTrivialPedestals()
Build Config Pedestals.
Definition: DTConfigTrivialProducer.cc:178
DTConfigPedestals::setES
void setES(DTTPGParameters const *tpgParams, DTT0 const *t0Params=nullptr)
Set parameters from ES.
Definition: DTConfigPedestals.cc:49
DTConfigTrivialProducer::m_tpgParams
DTTPGParameters * m_tpgParams
Definition: DTConfigTrivialProducer.h:64
DTConfigManager::setDTConfigTSTheta
void setDTConfigTSTheta(DTChamberId chambid, DTConfigTSTheta conf)
Set DTConfigTSTheta for desired chip.
Definition: DTConfigManager.h:120
DTConfigManager::setDTConfigTSPhi
void setDTConfigTSPhi(DTChamberId chambid, DTConfigTSPhi conf)
Set DTConfigTSPhi for desired chip.
Definition: DTConfigManager.h:123
DTConfigManager::setDTConfigTrigUnit
void setDTConfigTrigUnit(DTChamberId chambid, DTConfigTrigUnit conf)
Set DTConfigTrigUnit for desired chamber.
Definition: DTConfigManager.h:126
DTConfigTrigUnit
Definition: DTConfigTrigUnit.h:36
DTConfigManager::setDTTPGDebug
void setDTTPGDebug(bool debug)
SetGlobalDebug flag.
Definition: DTConfigManager.h:138
DTConfigManager::setUseAcceptParam
void setUseAcceptParam(bool acceptparam)
Set the use of Bti acceptance parameters (LL,LH,CL,CH,RL,RH)
Definition: DTConfigManager.h:144
DTConfigPedestals::setUseT0
void setUseT0(bool useT0)
Set t0i subtraction.
Definition: DTConfigPedestals.h:51
DTTimeUnits::ns
Definition: DTTimeUnits.h:32
DTSectCollId
Definition: DTSectCollId.h:18
DTConfigManager::setDTConfigTraco
void setDTConfigTraco(DTTracoId, DTConfigTraco)
Set DTConfigTraco for desired chip.
Definition: DTConfigManager.cc:183
DTConfigManager::setDTConfigBti
void setDTConfigBti(DTBtiId, DTConfigBti)
Set DTConfigBti for desired chip.
Definition: DTConfigManager.cc:178
DTConfigManager::setLutFromDB
void setLutFromDB(bool lutFromDB)
Set lut from DB flag.
Definition: DTConfigManager.h:141
edm::ParameterSet
Definition: ParameterSet.h:36
DTConfigTrivialProducer::mapEntryName
std::string mapEntryName(const DTChamberId &chambid) const
Definition: DTConfigTrivialProducer.cc:205
DTConfigTrivialProducer::m_manager
DTConfigManager * m_manager
Definition: DTConfigTrivialProducer.h:63
DTBtiId
Definition: DTBtiId.h:32
DTConfigManager::setDTConfigSectColl
void setDTConfigSectColl(DTSectCollId sectcollid, DTConfigSectColl conf)
Set DTConfigSectColl for desired chip.
Definition: DTConfigManager.h:132
DTConfigTSPhi
Definition: DTConfigTSPhi.h:36
DTConfigManager
Definition: DTConfigManager.h:49
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
DTConfigPedestals
Definition: DTConfigPedestals.h:36
DTChamberId::sector
int sector() const
Definition: DTChamberId.h:49
DTConfigTSTheta
Definition: DTConfigTSTheta.h:35
L1DTConfigParams_cff.DTTPGParameters
DTTPGParameters
Definition: L1DTConfigParams_cff.py:12
dqmiodumpmetadata.counts
counts
Definition: dqmiodumpmetadata.py:25
edm::es
Definition: es_Label.h:33
DTChamberId
Definition: DTChamberId.h:14
DTConfigLUTs
Definition: DTConfigLUTs.h:36
DTConfigTrivialProducer::m_debug
bool m_debug
Definition: DTConfigTrivialProducer.h:61
DTChamberId::wheel
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
DTChamberId::station
int station() const
Return the station number.
Definition: DTChamberId.h:42