CMS 3D CMS Logo

EventSetupTestHelper.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/TestProcessor
4 // Class : EventSetupTestHelper
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: root
10 // Created: Tue, 08 May 2018 18:33:15 GMT
11 //
12 
13 // system include files
14 
15 // user include files
18 
19 namespace edm {
20  namespace test {
21 
22 //
23 // constants, enums and typedefs
24 //
25 
26 //
27 // static data member definitions
28 //
29 
30 //
31 // constructors and destructor
32 //
33 EventSetupTestHelper::EventSetupTestHelper(std::vector<ESProduceEntry> iProxies):
34  proxies_{std::move(iProxies)}
35 {
36  //Deal with duplicates
37  std::set<eventsetup::EventSetupRecordKey> records;
38  for(auto const& p: proxies_) {
39  records.insert(p.recordKey_);
40  }
41  for(auto const&k: records) {
44  }
45 }
46 
47 void
49  const ValidityInterval& ) {
50 }
51 
52 void
54  const IOVSyncValue& iSync,
55  ValidityInterval& oIOV) {
56  if(iSync.luminosityBlockNumber()==0) {
57  //make valid through first run
58  oIOV = ValidityInterval(iSync,
59  IOVSyncValue(EventID(iSync.eventID().run(),1,1)));
60  } else if(iSync.eventID().event() == 0) {
61  oIOV = ValidityInterval(iSync,
62  IOVSyncValue(EventID(iSync.eventID().run(),iSync.eventID().luminosityBlock(),1)));
63  } else {
64  //Make valid for only this point
65  oIOV = ValidityInterval(iSync,iSync);
66  }
67 }
68 
69 void
71  KeyedProxies& aProxyList) {
72  for(auto const& p: proxies_) {
73  if(p.recordKey_ == iRecordKey) {
74  aProxyList.emplace_back(p.dataKey_,p.proxy_);
75  }
76  }
77 }
78 
79 std::shared_ptr<eventsetup::DataProxy>
80 EventSetupTestHelper::getProxy(unsigned int iIndex) {
81  return proxies_[iIndex].proxy_;
82 }
83 
84 void
86  for(auto const& p: proxies_) {
87  p.proxy_->invalidate();
88  }
89 }
90 
91 
92  }
93 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
const EventID & eventID() const
Definition: IOVSyncValue.h:42
void setIntervalFor(const eventsetup::EventSetupRecordKey &, const IOVSyncValue &, ValidityInterval &) final
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
void usingRecordWithKey(const EventSetupRecordKey &)
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
std::vector< ESProduceEntry > proxies_
void newInterval(const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) final
called when a new interval of validity occurs for iRecordType
LuminosityBlockNumber_t luminosityBlockNumber() const
Definition: IOVSyncValue.h:43
EventSetupTestHelper(std::vector< ESProduceEntry >)
int k[5][pyjets_maxn]
std::shared_ptr< eventsetup::DataProxy > getProxy(unsigned int index)
void registerProxies(const eventsetup::EventSetupRecordKey &iRecordKey, KeyedProxies &aProxyList) final
HLT enums.
def move(src, dest)
Definition: eostools.py:510
void findingRecordWithKey(const eventsetup::EventSetupRecordKey &)