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

void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
 
- 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())
 
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 &)
 
- 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 ( )
override

Definition at line 341 of file DIPLumiProducer.cc.

References DEFINE_FWK_EVENTSETUP_SOURCE.

341 {}

Member Function Documentation

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

Definition at line 266 of file DIPLumiProducer.cc.

References lumi::service::DBService::connectReadOnly(), 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().

266  {
267  m_detailcache.clear();
269  //
270  //queries once per cache refill
271  //
272  //select lumisection,bunch,bunchlumi from cms_runtime_logger.bunch_lumi_sections where lumisection>=:lsmin and lumisection<:lsmax and runnumber=:runnumber ;
273  //
275  if( !mydbservice.isAvailable() ){
276  throw cms::Exception("Non existing service lumi::service::DBService");
277  }
278  auto session=mydbservice->connectReadOnly(m_connectStr);
279  coral::ITypeConverter& tconverter=session->typeConverter();
280  tconverter.setCppTypeForSqlType(std::string("float"),std::string("FLOAT(63)"));
281  tconverter.setCppTypeForSqlType(std::string("unsigned int"),std::string("NUMBER(10)"));
282  unsigned int lsmin=1;
283  unsigned int lsmax=currentlsnum;
284  try{
285  session->transaction().start(true);
286  coral::ISchema& schema=session->nominalSchema();
287  unsigned int maxavailableLS=maxavailableLSforRun(schema,std::string("BUNCH_LUMI_SECTIONS"),m_summarycachedrun);
288  if(maxavailableLS!=0 &&maxavailableLS<currentlsnum ){
289  lsmax=maxavailableLS;
290  }else if(maxavailableLS==0){
291  //this run not existing (yet)
292  session->transaction().commit();
293  return;
294  }
295  if(m_cachesize!=0){
296  lsmin=(lsmax-m_cachesize)>0 ? (lsmax-m_cachesize+1) : 1;
297  }
298  coral::AttributeList lumidetailBindVariables;
299  lumidetailBindVariables.extend("lsmin",typeid(unsigned int));
300  lumidetailBindVariables.extend("lsmax",typeid(unsigned int));
301  lumidetailBindVariables.extend("runnumber",typeid(unsigned int));
302  lumidetailBindVariables["runnumber"].data<unsigned int>()=m_detailcachedrun;
303  lumidetailBindVariables["lsmin"].data<unsigned int>()=lsmin;
304  lumidetailBindVariables["lsmax"].data<unsigned int>()=lsmax;
305  std::string conditionStr("RUNNUMBER=:runnumber AND LUMISECTION>=:lsmin AND LUMISECTION<=:lsmax AND BUNCHLUMI>0 ");
306  coral::AttributeList lumidetailOutput;
307  lumidetailOutput.extend("LUMISECTION",typeid(unsigned int));
308  lumidetailOutput.extend("BUNCH",typeid(unsigned int));
309  lumidetailOutput.extend("BUNCHLUMI",typeid(float));
310  coral::IQuery* lumidetailQuery=schema.newQuery();
311  lumidetailQuery->addToTableList(std::string("BUNCH_LUMI_SECTIONS"));
312  lumidetailQuery->addToOutputList("LUMISECTION");
313  lumidetailQuery->addToOutputList("BUNCH");
314  lumidetailQuery->addToOutputList("BUNCHLUMI");
315  lumidetailQuery->setCondition(conditionStr,lumidetailBindVariables);
316  lumidetailQuery->defineOutput(lumidetailOutput);
317  coral::ICursor& lumidetailcursor=lumidetailQuery->execute();
318  while( lumidetailcursor.next() ){
319  const coral::AttributeList& row=lumidetailcursor.currentRow();
320  unsigned int lsnum=row["LUMISECTION"].data<unsigned int>();
321  if(m_detailcache.find(lsnum)==m_detailcache.end()){
322  m_detailcache.insert(std::make_pair(lsnum,std::make_shared<DIPLumiDetail>()));
323  m_detailcache[lsnum]->setOrigin(m_detailcachedrun,lsnum);
324  }
325  if(!row["BUNCH"].isNull()){
326  unsigned int bxidx=row["BUNCH"].data<unsigned int>();
327  float bxlumi=0.0;
328  if(!row["BUNCHLUMI"].isNull()){
329  bxlumi=row["BUNCHLUMI"].data<float>();//Hz/ub
330  }
331  m_detailcache[lsnum]->fillbxdata(bxidx,bxlumi);
332  }
333  }
334  delete lumidetailQuery;
335  session->transaction().commit();
336  }catch(const coral::Exception& er){
337  session->transaction().rollback();
338  throw cms::Exception("DatabaseError ")<<er.what();
339  }
340 }
unsigned int m_detailcachedrun
ISessionProxyPtr connectReadOnly(const std::string &connectstring)
Definition: DBService.cc:22
std::string m_connectStr
bool isAvailable() const
Definition: Service.h:46
unsigned int m_summarycachedrun
unsigned int m_cachesize
unsigned int maxavailableLSforRun(coral::ISchema &schema, const std::string &tablename, unsigned int runnumber)
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(), 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  auto 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  return;
179  }
180  if(m_cachesize!=0){
181  lsmin=(lsmax-m_cachesize)>0 ? (lsmax-m_cachesize+1) : 1;
182  }
183  //std::cout<<"lsmin "<<lsmin<<" lsmax "<<lsmax<<std::endl;
184  coral::AttributeList lumisummaryBindVariables;
185  lumisummaryBindVariables.extend("lsmin",typeid(unsigned int));
186  lumisummaryBindVariables.extend("lsmax",typeid(unsigned int));
187  lumisummaryBindVariables.extend("runnumber",typeid(unsigned int));
188  lumisummaryBindVariables["runnumber"].data<unsigned int>()=m_summarycachedrun;
189  lumisummaryBindVariables["lsmin"].data<unsigned int>()=lsmin;
190  lumisummaryBindVariables["lsmax"].data<unsigned int>()=lsmax;
191  std::string conditionStr("RUNNUMBER=:runnumber AND LUMISECTION>=:lsmin AND LUMISECTION<=:lsmax");
192  coral::AttributeList lumisummaryOutput;
193  lumisummaryOutput.extend("LUMISECTION",typeid(unsigned int));
194  lumisummaryOutput.extend("INSTLUMI",typeid(float));
195  lumisummaryOutput.extend("DELIVLUMISECTION",typeid(float));
196  lumisummaryOutput.extend("LIVELUMISECTION",typeid(float));
197  lumisummaryOutput.extend("CMS_ACTIVE",typeid(unsigned short));
198  coral::IQuery* lumisummaryQuery=schema.newQuery();
199  lumisummaryQuery->addToTableList(std::string("LUMI_SECTIONS"));
200  lumisummaryQuery->addToOutputList("LUMISECTION");
201  lumisummaryQuery->addToOutputList("INSTLUMI");
202  lumisummaryQuery->addToOutputList("DELIVLUMISECTION");
203  lumisummaryQuery->addToOutputList("LIVELUMISECTION");
204  lumisummaryQuery->addToOutputList("CMS_ACTIVE");
205  lumisummaryQuery->setCondition(conditionStr,lumisummaryBindVariables);
206  lumisummaryQuery->defineOutput(lumisummaryOutput);
207  coral::ICursor& lumisummarycursor=lumisummaryQuery->execute();
208  while( lumisummarycursor.next() ){
209  const coral::AttributeList& row=lumisummarycursor.currentRow();
210  unsigned int lsnum=row["LUMISECTION"].data<unsigned int>();
211  float instlumi=0.0;
212  if(!row["INSTLUMI"].isNull()){
213  instlumi=row["INSTLUMI"].data<float>();//Hz/ub
214  }
215  float intgdellumi=0.0;
216  if(!row["DELIVLUMISECTION"].isNull()){
217  intgdellumi=row["DELIVLUMISECTION"].data<float>()*1000.0;//convert to /ub
218  }
219  float intgreclumi=0.0;
220  if(!row["LIVELUMISECTION"].isNull()){
221  intgreclumi=row["LIVELUMISECTION"].data<float>()*1000.0;//convert to /ub
222  }
223  unsigned short cmsalive=0;
224  if(!row["CMS_ACTIVE"].isNull()){
225  cmsalive=row["CMS_ACTIVE"].data<unsigned short>();
226  }
227  auto tmpls = std::make_shared<DIPLumiSummary>(instlumi,intgdellumi,intgreclumi,cmsalive);
228  tmpls->setOrigin(m_summarycachedrun,lsnum);
229  //std::cout<<"filling "<<lsnum<<std::endl;
230  m_summarycache.insert(std::make_pair(lsnum,tmpls));
231  }
232  delete lumisummaryQuery;
233  session->transaction().commit();
234  }catch(const coral::Exception& er){
235  session->transaction().rollback();
236  throw cms::Exception("DatabaseError ")<<er.what();
237  }
238 }
ISessionProxyPtr connectReadOnly(const std::string &connectstring)
Definition: DBService.cc:22
std::string m_connectStr
bool isAvailable() const
Definition: Service.h:46
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)
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 240 of file DIPLumiProducer.cc.

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

Referenced by filldetailcache(), and fillsummarycache().

240  {
244  unsigned int result=0;
245  coral::AttributeList bindVariables;
246  bindVariables.extend("runnumber",typeid(unsigned int));
247  bindVariables["runnumber"].data<unsigned int>()=runnumber;
248  std::string conditionStr("RUNNUMBER=:runnumber");
249  coral::AttributeList MyOutput;
250  MyOutput.extend("maxavailablels",typeid(unsigned int));
251  coral::IQuery* myQuery=schema.newQuery();
252  myQuery->addToTableList(tablename);
253  myQuery->addToOutputList("max(LUMISECTION)","maxavailablels");
254  myQuery->setCondition(conditionStr,bindVariables);
255  myQuery->defineOutput(MyOutput);
256  coral::ICursor& mycursor=myQuery->execute();
257  while( mycursor.next() ){
258  const coral::AttributeList& row=mycursor.currentRow();
259  if(!row["maxavailablels"].isNull()){
260  result=row["maxavailablels"].data<unsigned int>();
261  }
262  }
263  return result;
264 }
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()==nullptr){
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()==nullptr){
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 
)
overrideprotectedvirtual

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