CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

void buildManager ()
 
 DTConfigTrivialProducer (const edm::ParameterSet &)
 
std::auto_ptr< DTConfigManagerproduce (const DTConfigManagerRcd &)
 
 ~DTConfigTrivialProducer ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 

Private Member Functions

std::string mapEntryName (const DTChamberId &chambid) const
 

Private Attributes

DTConfigManagerm_manager
 
edm::ParameterSet m_ps
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- Protected Member Functions inherited from edm::ESProducer
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::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 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 42 of file DTConfigTrivialProducer.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file DTConfigTrivialProducer.cc.

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

25 {
26 
27  //the following line is needed to tell the framework what
28  // data is being produced
29  setWhatProduced(this);
30 
31  //now do what ever other initialization is needed
32 
33  //get and store parameter set
34  m_ps = ps;
35  m_manager = new DTConfigManager();
36 
37  // set debug
38  edm::ParameterSet conf_ps = m_ps.getParameter<edm::ParameterSet>("DTTPGParameters");
39  bool dttpgdebug = conf_ps.getUntrackedParameter<bool>("Debug");
40  m_manager->setDTTPGDebug(dttpgdebug);
41 
42  // DB specific requests
43  bool tracoLutsFromDB = m_ps.getParameter< bool >("TracoLutsFromDB");
44  bool useBtiAcceptParam = m_ps.getParameter< bool >("UseBtiAcceptParam");
45 
46  // set specific DB requests
47  m_manager->setLutFromDB(tracoLutsFromDB);
48  m_manager->setUseAcceptParam(useBtiAcceptParam);
49 }
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 ( )

Definition at line 52 of file DTConfigTrivialProducer.cc.

53 {
54 
55  // do anything here that needs to be done at destruction time
56  // (e.g. close files, deallocate resources etc.)
57 
58 }

Member Function Documentation

void DTConfigTrivialProducer::buildManager ( )

Definition at line 76 of file DTConfigTrivialProducer.cc.

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

Referenced by produce().

77 {
78 
79  //create config classes&C.
80  edm::ParameterSet conf_ps = m_ps.getParameter<edm::ParameterSet>("DTTPGParameters");
82  bool dttpgdebug = conf_ps.getUntrackedParameter<bool>("Debug");
83  DTConfigSectColl sectcollconf(conf_ps.getParameter<edm::ParameterSet>("SectCollParameters"));
84  edm::ParameterSet tups = conf_ps.getParameter<edm::ParameterSet>("TUParameters");
85  DTConfigBti bticonf(tups.getParameter<edm::ParameterSet>("BtiParameters"));
86  DTConfigTraco tracoconf(tups.getParameter<edm::ParameterSet>("TracoParameters"));
87  DTConfigLUTs lutconf(tups.getParameter<edm::ParameterSet>("LutParameters"));
88  DTConfigTSTheta tsthetaconf(tups.getParameter<edm::ParameterSet>("TSThetaParameters"));
89  DTConfigTSPhi tsphiconf(tups.getParameter<edm::ParameterSet>("TSPhiParameters"));
90  DTConfigTrigUnit trigunitconf(tups);
91 
92  for (int iwh=-2;iwh<=2;++iwh){
93  for (int ist=1;ist<=4;++ist){
94  for (int ise=1;ise<=12;++ise){
95  DTChamberId chambid(iwh,ist,ise);
96  vector<int> nmap = conf_map.getUntrackedParameter<vector<int> >(mapEntryName(chambid).c_str());
97 // std::cout << " untracked vint32 wh" << chambid.wheel()
98 // << "st" << chambid.station()
99 // << "se" << chambid.sector() << " = { ";
100  if(dttpgdebug)
101  {
102  std::cout << " Filling configuration for chamber : wh " << chambid.wheel() <<
103  ", st " << chambid.station() <<
104  ", se " << chambid.sector() << endl;
105  }
106 
107  //fill the bti map
108  for (int isl=1;isl<=3;isl++){
109  int ncell = nmap[isl-1];
110  // std::cout << ncell <<" , ";
111  for (int ibti=0;ibti<ncell;ibti++)
112  {
113  m_manager->setDTConfigBti(DTBtiId(chambid,isl,ibti+1),bticonf);
114  if(dttpgdebug)
115  std::cout << "Filling BTI config for chamber : wh " << chambid.wheel() <<
116  ", st " << chambid.station() <<
117  ", se " << chambid.sector() <<
118  "... sl " << isl <<
119  ", bti " << ibti+1 << endl;
120  }
121  }
122 
123  // fill the traco map
124  int ntraco = nmap[3];
125  //std::cout << ntraco << " }" << std::endl;
126  for (int itraco=0;itraco<ntraco;itraco++)
127  {
128  m_manager->setDTConfigTraco(DTTracoId(chambid,itraco+1),tracoconf);
129  if(dttpgdebug)
130  std::cout << "Filling TRACO config for chamber : wh " << chambid.wheel() <<
131  ", st " << chambid.station() <<
132  ", se " << chambid.sector() <<
133  ", traco " << itraco+1 << endl;
134  }
135 
136  // fill TS & TrigUnit
137  m_manager->setDTConfigTSTheta(chambid,tsthetaconf);
138  m_manager->setDTConfigTSPhi(chambid,tsphiconf);
139  m_manager->setDTConfigTrigUnit(chambid,trigunitconf);
140 
141  // fill LUTs
142  m_manager->setDTConfigLUTs(chambid,lutconf);
143 
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> >(mapEntryName(chambid).c_str());
153 // std::cout << " untracked vint32 wh" << chambid.wheel()
154 // << "st" << chambid.station()
155 // << "se" << chambid.sector() << " = { ";
156  if(dttpgdebug)
157  {
158  std::cout << " Filling configuration for chamber : wh " << chambid.wheel() <<
159  ", st " << chambid.station() <<
160  ", se " << chambid.sector() << endl;
161  }
162 
163  //fill the bti map
164  for (int isl=1;isl<=3;isl++){
165  int ncell = nmap[isl-1];
166 // std::cout << ncell <<" , ";
167  for (int ibti=0;ibti<ncell;ibti++)
168  {
169  m_manager->setDTConfigBti(DTBtiId(chambid,isl,ibti+1),bticonf);
170  if(dttpgdebug)
171  std::cout << "Filling BTI config for chamber : wh " << chambid.wheel() <<
172  ", st " << chambid.station() <<
173  ", se " << chambid.sector() <<
174  "... sl " << isl <<
175  ", bti " << ibti+1 << endl;
176  }
177  }
178 
179  // fill the traco map
180  int ntraco = nmap[3];
181 // std::cout << ntraco << " }" << std::endl;
182  for (int itraco=0;itraco<ntraco;itraco++)
183  {
184  m_manager->setDTConfigTraco(DTTracoId(chambid,itraco+1),tracoconf);
185  if(dttpgdebug)
186  std::cout << "Filling TRACO config for chamber : wh " << chambid.wheel() <<
187  ", st " << chambid.station() <<
188  ", se " << chambid.sector() <<
189  ", traco " << itraco+1 << endl;
190  }
191 
192  // fill TS & TrigUnit
193  m_manager->setDTConfigTSTheta(chambid,tsthetaconf);
194  m_manager->setDTConfigTSPhi(chambid,tsphiconf);
195  m_manager->setDTConfigTrigUnit(chambid,trigunitconf);
196 
197  // fill LUTs
198  m_manager->setDTConfigLUTs(chambid,lutconf);
199 
200  }
201  }
202 
203  //loop on Sector Collectors
204  for (int wh=-2;wh<=2;wh++)
205  for (int se=1;se<=12;se++)
206  m_manager->setDTConfigSectColl(DTSectCollId(wh,se),sectcollconf);
207 
208 }
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.
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 setDTConfigSectColl(DTSectCollId sectcollid, DTConfigSectColl conf)
Set DTConfigSectColl for desired chip.
tuple cout
Definition: gather_cfg.py:41
void setDTConfigTrigUnit(DTChamberId chambid, DTConfigTrigUnit conf)
Set DTConfigTrigUnit for desired chamber.
std::string DTConfigTrivialProducer::mapEntryName ( const DTChamberId chambid) const
private

Definition at line 211 of file DTConfigTrivialProducer.cc.

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

Referenced by buildManager().

212 {
213  int iwh = chambid.wheel();
214  std::ostringstream os;
215  os << "wh";
216  if (iwh < 0) {
217  os << 'm' << -iwh;
218  } else {
219  os << iwh;
220  }
221  os << "st" << chambid.station() << "se" << chambid.sector();
222  return os.str();
223 }
int sector() const
Definition: DTChamberId.h:63
int station() const
Return the station number.
Definition: DTChamberId.h:53
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
std::auto_ptr< DTConfigManager > DTConfigTrivialProducer::produce ( const DTConfigManagerRcd iRecord)

Definition at line 65 of file DTConfigTrivialProducer.cc.

References buildManager(), and m_manager.

66 {
67  using namespace edm::es;
68 
69  buildManager();
70 
71  std::auto_ptr<DTConfigManager> dtConfig = std::auto_ptr<DTConfigManager>( m_manager );
72 
73  return dtConfig ;
74 }

Member Data Documentation

DTConfigManager* DTConfigTrivialProducer::m_manager
private

Definition at line 55 of file DTConfigTrivialProducer.h.

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

edm::ParameterSet DTConfigTrivialProducer::m_ps
private

Definition at line 54 of file DTConfigTrivialProducer.h.

Referenced by buildManager(), and DTConfigTrivialProducer().