CMS 3D CMS Logo

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

#include <L1TriggerConfig/DTTPGConfigProducers/interface/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 ()(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 >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- 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

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

16 {
17 
18  setWhatProduced(this);
19 
20  //get and store parameter set
21  m_ps = ps;
22  m_manager = new DTConfigManager();
24 
25  // set debug
26  edm::ParameterSet conf_ps = 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);
40  m_manager->setUseAcceptParam(useBtiAcceptParam); // CB Are these needed here???
41 }
void setLutFromDB(bool lutFromDB)
Set lut from DB flag.
T getParameter(std::string const &) const
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)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
DTConfigTrivialProducer::~DTConfigTrivialProducer ( )
override

destructor

Definition at line 44 of file DTConfigTrivialProducer.cc.

References gather_cfg::cout, and m_debug.

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

Member Function Documentation

void DTConfigTrivialProducer::buildManager ( )
private

Build Config Manager.

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

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

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

Referenced by buildManager().

211 {
212 
213  int counts = m_ps.getParameter<int>("bxOffset");
214  float fine = m_ps.getParameter<double>("finePhase");
215 
216  if (m_debug)
217  cout << "DTConfigTrivialProducer::buildPedestals()" << endl;
218 
219  //DTTPGParameters tpgParams;
220  for (int iwh=-2;iwh<=2;++iwh){
221  for (int ist=1;ist<=4;++ist){
222  for (int ise=1;ise<=14;++ise){
223  if (ise>12 && ist!=4) continue;
224 
225  DTChamberId chId(iwh,ist,ise);
226  m_tpgParams->set(chId,counts,fine,DTTimeUnits::ns);
227  }
228  }
229  }
230 
231  DTConfigPedestals tpgPedestals;
232  tpgPedestals.setUseT0(false);
233  tpgPedestals.setES(m_tpgParams);
234 
235  return tpgPedestals;
236 
237 }
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 240 of file DTConfigTrivialProducer.cc.

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

Referenced by buildManager().

241 {
242  int iwh = chambid.wheel();
243  std::ostringstream os;
244  os << "wh";
245  if (iwh < 0) {
246  os << 'm' << -iwh;
247  } else {
248  os << iwh;
249  }
250  os << "st" << chambid.station() << "se" << chambid.sector();
251  return os.str();
252 }
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 58 of file DTConfigTrivialProducer.cc.

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

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

Member Data Documentation

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

Definition at line 65 of file DTConfigTrivialProducer.h.

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

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

Definition at line 66 of file DTConfigTrivialProducer.h.

Referenced by buildTrivialPedestals(), and DTConfigTrivialProducer().