CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DIPLumiProducer Class Reference

#include <RecoLuminosity/LumiProducer/src/DIPLumiProducer.cc>

Inheritance diagram for DIPLumiProducer:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef std::shared_ptr< DIPLumiDetailReturnDetailType
 
typedef std::shared_ptr< DIPLumiSummaryReturnSummaryType
 
- 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
 

Public Member Functions

 DIPLumiProducer (const edm::ParameterSet &)
 
ReturnDetailType produceDetail (const DIPLuminosityRcd &)
 
ReturnSummaryType produceSummary (const DIPLuminosityRcd &)
 
 ~DIPLumiProducer ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- 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)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

Protected Member Functions

virtual void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
 
- 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::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())
 
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 &)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Private Member Functions

void filldetailcache (unsigned int runnumber, unsigned int startlsnum)
 
void fillsummarycache (unsigned int runnumber, unsigned int startlsnum)
 
unsigned int maxavailableLSforRun (coral::ISchema &schema, const std::string &tablename, unsigned int runnumber)
 

Private Attributes

unsigned int m_cachesize
 
std::string m_connectStr
 
std::map< unsigned int, std::shared_ptr< DIPLumiDetail > > m_detailcache
 
unsigned int m_detailcachedrun
 
std::shared_ptr< DIPLumiDetailm_detailresult
 
bool m_isNullRun
 
const edm::IOVSyncValuem_pcurrentTime
 
std::map< unsigned int, std::shared_ptr< DIPLumiSummary > > m_summarycache
 
unsigned int m_summarycachedrun
 
std::shared_ptr< DIPLumiSummarym_summaryresult
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

HF Luminosity numbers from DIP. Only exist if stable beam. No data available for other beam status

Description: A essource/esproducer for lumi values from DIP via runtime logger DB

Definition at line 22 of file DIPLumiProducer.h.

Member Typedef Documentation

Definition at line 27 of file DIPLumiProducer.h.

Definition at line 25 of file DIPLumiProducer.h.

Constructor & Destructor Documentation

DIPLumiProducer::DIPLumiProducer ( const edm::ParameterSet iConfig)

Definition at line 63 of file DIPLumiProducer.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), m_cachesize, m_connectStr, produceDetail(), produceSummary(), edm::ESProducer::setWhatProduced(), and AlCaHLTBitMon_QueryRunRegistry::string.

66  findingRecord<DIPLuminosityRcd>();
67  m_connectStr=iConfig.getParameter<std::string>("connect");
68  m_cachesize=iConfig.getUntrackedParameter<unsigned int>("ncacheEntries",3);
69 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
unsigned int m_detailcachedrun
std::string m_connectStr
ReturnDetailType produceDetail(const DIPLuminosityRcd &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
unsigned int m_summarycachedrun
unsigned int m_cachesize
ReturnSummaryType produceSummary(const DIPLuminosityRcd &)
DIPLumiProducer::~DIPLumiProducer ( )

Definition at line 347 of file DIPLumiProducer.cc.

References DEFINE_FWK_EVENTSETUP_SOURCE.

347 {}

Member Function Documentation

void DIPLumiProducer::filldetailcache ( unsigned int  runnumber,
unsigned int  startlsnum 
)
private

Definition at line 269 of file DIPLumiProducer.cc.

References lumi::service::DBService::connectReadOnly(), lumi::service::DBService::disconnect(), Exception, edm::Service< T >::isAvailable(), m_cachesize, m_connectStr, m_detailcache, m_detailcachedrun, m_summarycachedrun, maxavailableLSforRun(), cond::runnumber, dataDML::schema, dataDML::session, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produceDetail().

269  {
270  m_detailcache.clear();
272  //
273  //queries once per cache refill
274  //
275  //select lumisection,bunch,bunchlumi from cms_runtime_logger.bunch_lumi_sections where lumisection>=:lsmin and lumisection<:lsmax and runnumber=:runnumber ;
276  //
278  if( !mydbservice.isAvailable() ){
279  throw cms::Exception("Non existing service lumi::service::DBService");
280  }
281  coral::ISessionProxy* session=mydbservice->connectReadOnly(m_connectStr);
282  coral::ITypeConverter& tconverter=session->typeConverter();
283  tconverter.setCppTypeForSqlType(std::string("float"),std::string("FLOAT(63)"));
284  tconverter.setCppTypeForSqlType(std::string("unsigned int"),std::string("NUMBER(10)"));
285  unsigned int lsmin=1;
286  unsigned int lsmax=currentlsnum;
287  try{
288  session->transaction().start(true);
289  coral::ISchema& schema=session->nominalSchema();
290  unsigned int maxavailableLS=maxavailableLSforRun(schema,std::string("BUNCH_LUMI_SECTIONS"),m_summarycachedrun);
291  if(maxavailableLS!=0 &&maxavailableLS<currentlsnum ){
292  lsmax=maxavailableLS;
293  }else if(maxavailableLS==0){
294  //this run not existing (yet)
295  session->transaction().commit();
296  mydbservice->disconnect(session);
297  return;
298  }
299  if(m_cachesize!=0){
300  lsmin=(lsmax-m_cachesize)>0 ? (lsmax-m_cachesize+1) : 1;
301  }
302  coral::AttributeList lumidetailBindVariables;
303  lumidetailBindVariables.extend("lsmin",typeid(unsigned int));
304  lumidetailBindVariables.extend("lsmax",typeid(unsigned int));
305  lumidetailBindVariables.extend("runnumber",typeid(unsigned int));
306  lumidetailBindVariables["runnumber"].data<unsigned int>()=m_detailcachedrun;
307  lumidetailBindVariables["lsmin"].data<unsigned int>()=lsmin;
308  lumidetailBindVariables["lsmax"].data<unsigned int>()=lsmax;
309  std::string conditionStr("RUNNUMBER=:runnumber AND LUMISECTION>=:lsmin AND LUMISECTION<=:lsmax AND BUNCHLUMI>0 ");
310  coral::AttributeList lumidetailOutput;
311  lumidetailOutput.extend("LUMISECTION",typeid(unsigned int));
312  lumidetailOutput.extend("BUNCH",typeid(unsigned int));
313  lumidetailOutput.extend("BUNCHLUMI",typeid(float));
314  coral::IQuery* lumidetailQuery=schema.newQuery();
315  lumidetailQuery->addToTableList(std::string("BUNCH_LUMI_SECTIONS"));
316  lumidetailQuery->addToOutputList("LUMISECTION");
317  lumidetailQuery->addToOutputList("BUNCH");
318  lumidetailQuery->addToOutputList("BUNCHLUMI");
319  lumidetailQuery->setCondition(conditionStr,lumidetailBindVariables);
320  lumidetailQuery->defineOutput(lumidetailOutput);
321  coral::ICursor& lumidetailcursor=lumidetailQuery->execute();
322  while( lumidetailcursor.next() ){
323  const coral::AttributeList& row=lumidetailcursor.currentRow();
324  unsigned int lsnum=row["LUMISECTION"].data<unsigned int>();
325  if(m_detailcache.find(lsnum)==m_detailcache.end()){
326  m_detailcache.insert(std::make_pair(lsnum,std::make_shared<DIPLumiDetail>()));
327  m_detailcache[lsnum]->setOrigin(m_detailcachedrun,lsnum);
328  }
329  if(!row["BUNCH"].isNull()){
330  unsigned int bxidx=row["BUNCH"].data<unsigned int>();
331  float bxlumi=0.0;
332  if(!row["BUNCHLUMI"].isNull()){
333  bxlumi=row["BUNCHLUMI"].data<float>();//Hz/ub
334  }
335  m_detailcache[lsnum]->fillbxdata(bxidx,bxlumi);
336  }
337  }
338  delete lumidetailQuery;
339  session->transaction().commit();
340  }catch(const coral::Exception& er){
341  session->transaction().rollback();
342  mydbservice->disconnect(session);
343  throw cms::Exception("DatabaseError ")<<er.what();
344  }
345  mydbservice->disconnect(session);
346 }
unsigned int m_detailcachedrun
std::string m_connectStr
bool isAvailable() const
Definition: Service.h:46
void disconnect(coral::ISessionProxy *session)
Definition: DBService.cc:27
unsigned int m_summarycachedrun
unsigned int m_cachesize
unsigned int maxavailableLSforRun(coral::ISchema &schema, const std::string &tablename, unsigned int runnumber)
coral::ISessionProxy * connectReadOnly(const std::string &connectstring)
Definition: DBService.cc:23
std::map< unsigned int, std::shared_ptr< DIPLumiDetail > > m_detailcache
void DIPLumiProducer::fillsummarycache ( unsigned int  runnumber,
unsigned int  startlsnum 
)
private

Definition at line 146 of file DIPLumiProducer.cc.

References lumi::service::DBService::connectReadOnly(), lumi::service::DBService::disconnect(), Exception, edm::Service< T >::isAvailable(), m_cachesize, m_connectStr, m_summarycache, m_summarycachedrun, maxavailableLSforRun(), cond::runnumber, dataDML::schema, dataDML::session, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produceSummary().

146  {
147  m_summarycache.clear();
149  //
150  // queries once per cache refill
151  //
152  // select max(lumi_sections) as maxavailable from cms_runtime_logger.lumi_sections where runnumber=:runnumber;
153  //
154  // if maxavailable<currentls: get lsmax=maxavailable ; else: get lsmax=currentls
155  // lsmin=lsmax-cachesize
156  // select runnumber,lumisection,instlumi,delivlumi,livelumi from cms_runtime_logger.lumi_sections where lumisection>=:lsmin and lumisection<=:lsmax and runnumber=:runnumber;
157  //
159  if( !mydbservice.isAvailable() ){
160  throw cms::Exception("Non existing service lumi::service::DBService");
161  }
162  coral::ISessionProxy* session=mydbservice->connectReadOnly(m_connectStr);
163  coral::ITypeConverter& tconverter=session->typeConverter();
164  tconverter.setCppTypeForSqlType(std::string("float"),std::string("FLOAT(63)"));
165  tconverter.setCppTypeForSqlType(std::string("unsigned int"),std::string("NUMBER(10)"));
166  tconverter.setCppTypeForSqlType(std::string("unsigned short"),std::string("NUMBER(1)"));
167  unsigned int lsmin=1;
168  unsigned int lsmax=currentlsnum;
169  try{
170  session->transaction().start(true);
171  coral::ISchema& schema=session->nominalSchema();
172  unsigned int maxavailableLS=maxavailableLSforRun(schema,std::string("LUMI_SECTIONS"),m_summarycachedrun);
173  if(maxavailableLS!=0 && maxavailableLS<currentlsnum){
174  lsmax=maxavailableLS;
175  }else if(maxavailableLS==0){
176  //this run not existing (yet)
177  session->transaction().commit();
178  mydbservice->disconnect(session);
179  return;
180  }
181  if(m_cachesize!=0){
182  lsmin=(lsmax-m_cachesize)>0 ? (lsmax-m_cachesize+1) : 1;
183  }
184  //std::cout<<"lsmin "<<lsmin<<" lsmax "<<lsmax<<std::endl;
185  coral::AttributeList lumisummaryBindVariables;
186  lumisummaryBindVariables.extend("lsmin",typeid(unsigned int));
187  lumisummaryBindVariables.extend("lsmax",typeid(unsigned int));
188  lumisummaryBindVariables.extend("runnumber",typeid(unsigned int));
189  lumisummaryBindVariables["runnumber"].data<unsigned int>()=m_summarycachedrun;
190  lumisummaryBindVariables["lsmin"].data<unsigned int>()=lsmin;
191  lumisummaryBindVariables["lsmax"].data<unsigned int>()=lsmax;
192  std::string conditionStr("RUNNUMBER=:runnumber AND LUMISECTION>=:lsmin AND LUMISECTION<=:lsmax");
193  coral::AttributeList lumisummaryOutput;
194  lumisummaryOutput.extend("LUMISECTION",typeid(unsigned int));
195  lumisummaryOutput.extend("INSTLUMI",typeid(float));
196  lumisummaryOutput.extend("DELIVLUMISECTION",typeid(float));
197  lumisummaryOutput.extend("LIVELUMISECTION",typeid(float));
198  lumisummaryOutput.extend("CMS_ACTIVE",typeid(unsigned short));
199  coral::IQuery* lumisummaryQuery=schema.newQuery();
200  lumisummaryQuery->addToTableList(std::string("LUMI_SECTIONS"));
201  lumisummaryQuery->addToOutputList("LUMISECTION");
202  lumisummaryQuery->addToOutputList("INSTLUMI");
203  lumisummaryQuery->addToOutputList("DELIVLUMISECTION");
204  lumisummaryQuery->addToOutputList("LIVELUMISECTION");
205  lumisummaryQuery->addToOutputList("CMS_ACTIVE");
206  lumisummaryQuery->setCondition(conditionStr,lumisummaryBindVariables);
207  lumisummaryQuery->defineOutput(lumisummaryOutput);
208  coral::ICursor& lumisummarycursor=lumisummaryQuery->execute();
209  while( lumisummarycursor.next() ){
210  const coral::AttributeList& row=lumisummarycursor.currentRow();
211  unsigned int lsnum=row["LUMISECTION"].data<unsigned int>();
212  float instlumi=0.0;
213  if(!row["INSTLUMI"].isNull()){
214  instlumi=row["INSTLUMI"].data<float>();//Hz/ub
215  }
216  float intgdellumi=0.0;
217  if(!row["DELIVLUMISECTION"].isNull()){
218  intgdellumi=row["DELIVLUMISECTION"].data<float>()*1000.0;//convert to /ub
219  }
220  float intgreclumi=0.0;
221  if(!row["LIVELUMISECTION"].isNull()){
222  intgreclumi=row["LIVELUMISECTION"].data<float>()*1000.0;//convert to /ub
223  }
224  unsigned short cmsalive=0;
225  if(!row["CMS_ACTIVE"].isNull()){
226  cmsalive=row["CMS_ACTIVE"].data<unsigned short>();
227  }
228  auto tmpls = std::make_shared<DIPLumiSummary>(instlumi,intgdellumi,intgreclumi,cmsalive);
229  tmpls->setOrigin(m_summarycachedrun,lsnum);
230  //std::cout<<"filling "<<lsnum<<std::endl;
231  m_summarycache.insert(std::make_pair(lsnum,tmpls));
232  }
233  delete lumisummaryQuery;
234  session->transaction().commit();
235  }catch(const coral::Exception& er){
236  session->transaction().rollback();
237  mydbservice->disconnect(session);
238  throw cms::Exception("DatabaseError ")<<er.what();
239  }
240  mydbservice->disconnect(session);
241 }
std::string m_connectStr
bool isAvailable() const
Definition: Service.h:46
void disconnect(coral::ISessionProxy *session)
Definition: DBService.cc:27
std::map< unsigned int, std::shared_ptr< DIPLumiSummary > > m_summarycache
unsigned int m_summarycachedrun
unsigned int m_cachesize
unsigned int maxavailableLSforRun(coral::ISchema &schema, const std::string &tablename, unsigned int runnumber)
coral::ISessionProxy * connectReadOnly(const std::string &connectstring)
Definition: DBService.cc:23
unsigned int DIPLumiProducer::maxavailableLSforRun ( coral::ISchema &  schema,
const std::string &  tablename,
unsigned int  runnumber 
)
private

select max(lumisection) as maxavailable from cms_runtime_logger.lumi_sections where runnumber=:runnumber;

Definition at line 243 of file DIPLumiProducer.cc.

References mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by filldetailcache(), and fillsummarycache().

243  {
247  unsigned int result=0;
248  coral::AttributeList bindVariables;
249  bindVariables.extend("runnumber",typeid(unsigned int));
250  bindVariables["runnumber"].data<unsigned int>()=runnumber;
251  std::string conditionStr("RUNNUMBER=:runnumber");
252  coral::AttributeList MyOutput;
253  MyOutput.extend("maxavailablels",typeid(unsigned int));
254  coral::IQuery* myQuery=schema.newQuery();
255  myQuery->addToTableList(tablename);
256  myQuery->addToOutputList("max(LUMISECTION)","maxavailablels");
257  myQuery->setCondition(conditionStr,bindVariables);
258  myQuery->defineOutput(MyOutput);
259  coral::ICursor& mycursor=myQuery->execute();
260  while( mycursor.next() ){
261  const coral::AttributeList& row=mycursor.currentRow();
262  if(!row["maxavailablels"].isNull()){
263  result=row["maxavailablels"].data<unsigned int>();
264  }
265  }
266  return result;
267 }
DIPLumiProducer::ReturnDetailType DIPLumiProducer::produceDetail ( const DIPLuminosityRcd )

Definition at line 104 of file DIPLumiProducer.cc.

References edm::IOVSyncValue::eventID(), filldetailcache(), edm::IOVSyncValue::luminosityBlockNumber(), m_detailcache, m_detailcachedrun, m_detailresult, m_pcurrentTime, genParticles_cff::map, edm::EventID::run(), and findQualityFiles::v.

Referenced by DIPLumiProducer().

105 {
106  unsigned int currentrun=m_pcurrentTime->eventID().run();
107  unsigned int currentls=m_pcurrentTime->luminosityBlockNumber();
108  if(currentls==0||currentls==4294967295){
109  return std::make_shared<DIPLumiDetail>();
110  }
111  if(m_detailcachedrun!=currentrun){//i'm in a new run
112  filldetailcache(currentrun,currentls);//starting ls
113  }else{ //i'm in an known run
114  if(m_detailcache.find(currentls)==m_detailcache.end()){//i'm in a unknown ls
115  filldetailcache(currentrun,currentls);//cache all ls>=currentls
116  }
117  }
118  if(m_detailcache.empty()){
119  return std::make_shared<DIPLumiDetail>();
120  }
121  if(m_detailcache.find(currentls)==m_detailcache.end()){
122  std::vector<unsigned int> v;
123  for(std::map<unsigned int,std::shared_ptr<DIPLumiDetail> >::iterator it=m_detailcache.begin();it!=m_detailcache.end();++it){
124  v.push_back(it->first);
125  }
126  m_detailresult=m_detailcache[v.back()];
127  }else{
128  m_detailresult=m_detailcache[currentls];
129  }
130  if(m_detailresult.get()==0){
131  return std::make_shared<DIPLumiDetail>();
132  }
133  return m_detailresult;
134 }
RunNumber_t run() const
Definition: EventID.h:39
unsigned int m_detailcachedrun
const EventID & eventID() const
Definition: IOVSyncValue.h:42
LuminosityBlockNumber_t luminosityBlockNumber() const
Definition: IOVSyncValue.h:43
std::shared_ptr< DIPLumiDetail > m_detailresult
void filldetailcache(unsigned int runnumber, unsigned int startlsnum)
const edm::IOVSyncValue * m_pcurrentTime
std::map< unsigned int, std::shared_ptr< DIPLumiDetail > > m_detailcache
DIPLumiProducer::ReturnSummaryType DIPLumiProducer::produceSummary ( const DIPLuminosityRcd )

Definition at line 72 of file DIPLumiProducer.cc.

References edm::IOVSyncValue::eventID(), fillsummarycache(), edm::IOVSyncValue::luminosityBlockNumber(), m_pcurrentTime, m_summarycache, m_summarycachedrun, m_summaryresult, genParticles_cff::map, edm::EventID::run(), and findQualityFiles::v.

Referenced by DIPLumiProducer().

73 {
74  unsigned int currentrun=m_pcurrentTime->eventID().run();
75  unsigned int currentls=m_pcurrentTime->luminosityBlockNumber();
76  if(currentls==0||currentls==4294967295){
77  return std::make_shared<DIPLumiSummary>();
78  }
79  if(m_summarycachedrun!=currentrun){//i'm in a new run
80  fillsummarycache(currentrun,currentls);//starting ls
81  }else{ //i'm in an old run
82  if(m_summarycache.find(currentls)==m_summarycache.end()){//i'm not cached
83  fillsummarycache(currentrun,currentls);//
84  }
85  }
86  if(m_summarycache.empty()){
87  return std::make_shared<DIPLumiSummary>();
88  }
89  if(m_summarycache.find(currentls)==m_summarycache.end()){
90  std::vector<unsigned int> v;
91  for(std::map<unsigned int,std::shared_ptr<DIPLumiSummary> >::iterator it=m_summarycache.begin();it!=m_summarycache.end();++it){
92  v.push_back(it->first);
93  }
95  }else{
97  }
98  if(m_summaryresult.get()==0){
99  return std::make_shared<DIPLumiSummary>();
100  }
101  return m_summaryresult;
102 }
RunNumber_t run() const
Definition: EventID.h:39
const EventID & eventID() const
Definition: IOVSyncValue.h:42
std::shared_ptr< DIPLumiSummary > m_summaryresult
LuminosityBlockNumber_t luminosityBlockNumber() const
Definition: IOVSyncValue.h:43
std::map< unsigned int, std::shared_ptr< DIPLumiSummary > > m_summarycache
unsigned int m_summarycachedrun
const edm::IOVSyncValue * m_pcurrentTime
void fillsummarycache(unsigned int runnumber, unsigned int startlsnum)
void DIPLumiProducer::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey iKey,
const edm::IOVSyncValue iTime,
edm::ValidityInterval oValidity 
)
protectedvirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 137 of file DIPLumiProducer.cc.

References m_pcurrentTime, edm::ValidityInterval::setFirst(), and edm::ValidityInterval::setLast().

139  {
140  m_pcurrentTime=&iTime;
141  oValidity.setFirst(iTime);
142  oValidity.setLast(iTime);
143 }
void setFirst(const IOVSyncValue &iTime)
void setLast(const IOVSyncValue &iTime)
const edm::IOVSyncValue * m_pcurrentTime

Member Data Documentation

unsigned int DIPLumiProducer::m_cachesize
private

Definition at line 44 of file DIPLumiProducer.h.

Referenced by DIPLumiProducer(), filldetailcache(), and fillsummarycache().

std::string DIPLumiProducer::m_connectStr
private

Definition at line 38 of file DIPLumiProducer.h.

Referenced by DIPLumiProducer(), filldetailcache(), and fillsummarycache().

std::map< unsigned int,std::shared_ptr<DIPLumiDetail> > DIPLumiProducer::m_detailcache
private

Definition at line 40 of file DIPLumiProducer.h.

Referenced by filldetailcache(), and produceDetail().

unsigned int DIPLumiProducer::m_detailcachedrun
private

Definition at line 43 of file DIPLumiProducer.h.

Referenced by filldetailcache(), and produceDetail().

std::shared_ptr<DIPLumiDetail> DIPLumiProducer::m_detailresult
private

Definition at line 46 of file DIPLumiProducer.h.

Referenced by produceDetail().

bool DIPLumiProducer::m_isNullRun
private

Definition at line 41 of file DIPLumiProducer.h.

const edm::IOVSyncValue* DIPLumiProducer::m_pcurrentTime
private

Definition at line 47 of file DIPLumiProducer.h.

Referenced by produceDetail(), produceSummary(), and setIntervalFor().

std::map< unsigned int,std::shared_ptr<DIPLumiSummary> > DIPLumiProducer::m_summarycache
private

Definition at line 39 of file DIPLumiProducer.h.

Referenced by fillsummarycache(), and produceSummary().

unsigned int DIPLumiProducer::m_summarycachedrun
private

Definition at line 42 of file DIPLumiProducer.h.

Referenced by filldetailcache(), fillsummarycache(), and produceSummary().

std::shared_ptr<DIPLumiSummary> DIPLumiProducer::m_summaryresult
private

Definition at line 45 of file DIPLumiProducer.h.

Referenced by produceSummary().