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::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

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
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () 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::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
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 TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
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::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
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.

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

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 }
void setLutFromDB(bool lutFromDB)
Set lut from DB flag.
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void setDTTPGDebug(bool debug)
SetGlobalDebug flag.
void setUseAcceptParam(bool acceptparam)
Set the use of Bti acceptance parameters (LL,LH,CL,CH,RL,RH)
T getUntrackedParameter(std::string const &, T const &) const

◆ ~DTConfigTrivialProducer()

DTConfigTrivialProducer::~DTConfigTrivialProducer ( )
override

destructor

Definition at line 41 of file DTConfigTrivialProducer.cc.

References gather_cfg::cout, and m_debug.

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

Member Function Documentation

◆ buildManager()

void DTConfigTrivialProducer::buildManager ( )
private

Build Config Manager.

Definition at line 64 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().

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 }
void setLutFromDB(bool lutFromDB)
Set lut from DB flag.
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void setDTConfigTSTheta(DTChamberId chambid, DTConfigTSTheta conf)
Set DTConfigTSTheta for desired chip.
void setDTConfigTraco(DTTracoId, DTConfigTraco)
Set DTConfigTraco for desired chip.
T getUntrackedParameter(std::string const &, T const &) const
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.
std::string mapEntryName(const DTChamberId &chambid) const
void setDTConfigTrigUnit(DTChamberId chambid, DTConfigTrigUnit conf)
Set DTConfigTrigUnit for desired chamber.

◆ buildTrivialPedestals()

DTConfigPedestals DTConfigTrivialProducer::buildTrivialPedestals ( )
private

Build Config Pedestals.

Definition at line 178 of file DTConfigTrivialProducer.cc.

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

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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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.

◆ mapEntryName()

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

Definition at line 205 of file DTConfigTrivialProducer.cc.

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

Referenced by buildManager().

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 }
int station() const
Return the station number.
Definition: DTChamberId.h:45
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:42
int sector() const
Definition: DTChamberId.h:52

◆ produce()

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

ES produce method.

Definition at line 50 of file DTConfigTrivialProducer.cc.

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

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 }
void buildManager()
Build Config 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().