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
FWLiteESSource Class Reference
Inheritance diagram for FWLiteESSource:
edm::eventsetup::DataProxyProvider edm::EventSetupRecordIntervalFinder

Public Member Functions

 FWLiteESSource (edm::ParameterSet const &iPS)
 
virtual void newInterval (const edm::eventsetup::EventSetupRecordKey &iRecordType, const edm::ValidityInterval &iInterval) override
 called when a new interval of validity occurs for iRecordType More...
 
virtual ~FWLiteESSource ()
 
- 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 ()
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
const
eventsetup::ComponentDescription
descriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
std::set
< eventsetup::EventSetupRecordKey
findingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder ()
 

Private Member Functions

virtual void delaySettingRecords () override
 
 FWLiteESSource (const FWLiteESSource &)
 
const FWLiteESSourceoperator= (const FWLiteESSource &)
 
virtual void registerProxies (const edm::eventsetup::EventSetupRecordKey &iRecordKey, KeyedProxies &aProxyList) override
 
virtual void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
 

Private Attributes

fwlite::EventSetup m_es
 
std::auto_ptr< TFile > m_file
 
std::map
< edm::eventsetup::EventSetupRecordKey,
fwlite::RecordID
m_keyToID
 

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
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- 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 &)
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 100 of file FWLiteESSource.cc.

Constructor & Destructor Documentation

FWLiteESSource::FWLiteESSource ( edm::ParameterSet const &  iPS)

Definition at line 149 of file FWLiteESSource.cc.

149  :
150 m_file( TFile::Open(iPS.getParameter<std::string>("fileName").c_str())),
151 m_es( m_file.get())
152 {
153 }
std::auto_ptr< TFile > m_file
fwlite::EventSetup m_es
FWLiteESSource::~FWLiteESSource ( )
virtual

Definition at line 160 of file FWLiteESSource.cc.

161 {
162 }
FWLiteESSource::FWLiteESSource ( const FWLiteESSource )
private

Member Function Documentation

void FWLiteESSource::delaySettingRecords ( )
overrideprivatevirtual

override this method if you need to delay setting what records you will be using until after all modules are loaded

Reimplemented from edm::EventSetupRecordIntervalFinder.

Definition at line 239 of file FWLiteESSource.cc.

References edm::EventSetupRecordIntervalFinder::findingRecordWithKey(), edm::typelookup::findType(), relval_steps::key, m_es, m_keyToID, fwlite::EventSetup::namesOfAvailableRecords(), fwlite::EventSetup::recordID(), edmStreamStallGrapher::t, and edm::eventsetup::DataProxyProvider::usingRecordWithKey().

240 {
242  std::vector<std::string> recordNames = m_es.namesOfAvailableRecords();
243 
244  for(std::vector<std::string>::const_iterator it = recordNames.begin(),
245  itEnd = recordNames.end();
246  it != itEnd;
247  ++it) {
248  HCTypeTag t = HCTypeTag::findType(*it);
249  if(t != HCTypeTag() ) {
253  m_keyToID[key]=m_es.recordID(it->c_str());
254  }
255  }
256 }
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
Definition: typelookup.cc:76
std::vector< std::string > namesOfAvailableRecords() const
Definition: EventSetup.cc:134
std::map< edm::eventsetup::EventSetupRecordKey, fwlite::RecordID > m_keyToID
void usingRecordWithKey(const EventSetupRecordKey &)
fwlite::EventSetup m_es
RecordID recordID(const char *iRecordName) const
Definition: EventSetup.cc:98
void findingRecordWithKey(const eventsetup::EventSetupRecordKey &)
void FWLiteESSource::newInterval ( const edm::eventsetup::EventSetupRecordKey iRecordType,
const edm::ValidityInterval iInterval 
)
overridevirtual

called when a new interval of validity occurs for iRecordType

Implements edm::eventsetup::DataProxyProvider.

Definition at line 180 of file FWLiteESSource.cc.

References edm::eventsetup::DataProxyProvider::invalidateProxies().

182 {
183  invalidateProxies(iRecordType);
184 }
void invalidateProxies(const EventSetupRecordKey &iRecordKey)
const FWLiteESSource& FWLiteESSource::operator= ( const FWLiteESSource )
private
void FWLiteESSource::registerProxies ( const edm::eventsetup::EventSetupRecordKey iRecordKey,
KeyedProxies aProxyList 
)
overrideprivatevirtual

Implements edm::eventsetup::DataProxyProvider.

Definition at line 190 of file FWLiteESSource.cc.

References gather_cfg::cout, edm::typelookup::findType(), fwlite::EventSetup::get(), LogDebug, m_es, m_keyToID, edm::eventsetup::EventSetupRecordKey::name(), groupFilesInBlocks::tt, and fwlite::Record::typeAndLabelOfAvailableData().

192 {
194 
195  fwlite::RecordID recID = m_keyToID[iRecordKey];
196  const fwlite::Record& rec = m_es.get(recID);
197  typedef std::vector<std::pair<std::string,std::string> > TypesAndLabels;
198  TypesAndLabels typesAndLabels = rec.typeAndLabelOfAvailableData();
199 
200  std::cout <<"Looking for data in record "<<iRecordKey.name()<<std::endl;
201  for(TypesAndLabels::const_iterator it = typesAndLabels.begin(), itEnd = typesAndLabels.end();
202  it != itEnd;
203  ++it) {
204  std::cout <<" need type "<<it->first<<std::endl;
205  HCTypeTag tt = HCTypeTag::findType(it->first);
206  if(tt != HCTypeTag() ) {
207  edm::eventsetup::DataKey dk(tt,edm::eventsetup::IdTags(it->second.c_str()));
208  aProxyList.push_back(std::make_pair(dk,
209  boost::shared_ptr<edm::eventsetup::DataProxy>(new FWLiteProxy(TypeID(tt.value()),&rec))));
210  } else {
211  LogDebug("UnknownESType")<<"The type '"<<it->first<<"' is unknown in this job";
212  std::cout <<" *****FAILED*****"<<std::endl;
213  }
214  }
215 
216 }
#define LogDebug(id)
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
Definition: typelookup.cc:76
std::map< edm::eventsetup::EventSetupRecordKey, fwlite::RecordID > m_keyToID
unsigned int RecordID
Definition: EventSetup.h:63
fwlite::EventSetup m_es
std::vector< std::pair< std::string, std::string > > typeAndLabelOfAvailableData() const
Definition: Record.cc:236
tuple cout
Definition: gather_cfg.py:121
const Record & get(const RecordID &) const
Definition: EventSetup.cc:127
void FWLiteESSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey iKey,
const edm::IOVSyncValue iSync,
edm::ValidityInterval oIOV 
)
overrideprivatevirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 220 of file FWLiteESSource.cc.

References edm::IOVSyncValue::endOfTime(), fwlite::Record::endSyncValue(), fwlite::IOVSyncValue::eventID(), edm::IOVSyncValue::eventID(), fwlite::EventSetup::get(), m_es, m_keyToID, edm::EventID::run(), fwlite::Record::startSyncValue(), fwlite::EventSetup::syncTo(), fwlite::IOVSyncValue::time(), edm::IOVSyncValue::time(), and edm::Timestamp::value().

223 {
224  m_es.syncTo(iSync.eventID(), iSync.time());
225 
226  const fwlite::Record& rec = m_es.get(m_keyToID[iKey]);
227  edm::IOVSyncValue endSync(rec.endSyncValue().eventID(),
228  rec.endSyncValue().time());
229  if(rec.endSyncValue().eventID().run()==0 &&
230  rec.endSyncValue().time().value() == 0ULL) {
231  endSync = edm::IOVSyncValue::endOfTime();
232  }
234  rec.startSyncValue().time()),
235  endSync);
236 }
RunNumber_t run() const
Definition: EventID.h:39
void syncTo(const edm::EventID &, const edm::Timestamp &)
Definition: EventSetup.cc:72
const EventID & eventID() const
Definition: IOVSyncValue.h:42
std::map< edm::eventsetup::EventSetupRecordKey, fwlite::RecordID > m_keyToID
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
const IOVSyncValue & startSyncValue() const
Definition: Record.cc:166
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
fwlite::EventSetup m_es
const edm::Timestamp & time() const
Definition: IOVSyncValue.h:44
const Timestamp & time() const
Definition: IOVSyncValue.h:44
const Record & get(const RecordID &) const
Definition: EventSetup.cc:127
TimeValue_t value() const
Definition: Timestamp.h:56
const edm::EventID & eventID() const
Definition: IOVSyncValue.h:42
const IOVSyncValue & endSyncValue() const
Definition: Record.cc:170

Member Data Documentation

fwlite::EventSetup FWLiteESSource::m_es
private

Definition at line 132 of file FWLiteESSource.cc.

Referenced by delaySettingRecords(), registerProxies(), and setIntervalFor().

std::auto_ptr<TFile> FWLiteESSource::m_file
private

Definition at line 131 of file FWLiteESSource.cc.

std::map<edm::eventsetup::EventSetupRecordKey, fwlite::RecordID> FWLiteESSource::m_keyToID
private

Definition at line 133 of file FWLiteESSource.cc.

Referenced by delaySettingRecords(), registerProxies(), and setIntervalFor().