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)
 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 ()
 
 FWLiteESSource (const FWLiteESSource &)
 
const FWLiteESSourceoperator= (const FWLiteESSource &)
 
virtual void registerProxies (const edm::eventsetup::EventSetupRecordKey &iRecordKey, KeyedProxies &aProxyList)
 
virtual void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
 

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
 
- 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 101 of file FWLiteESSource.cc.

Constructor & Destructor Documentation

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

Definition at line 150 of file FWLiteESSource.cc.

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

Definition at line 161 of file FWLiteESSource.cc.

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

Member Function Documentation

void FWLiteESSource::delaySettingRecords ( )
privatevirtual

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 240 of file FWLiteESSource.cc.

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

241 {
243  std::vector<std::string> recordNames = m_es.namesOfAvailableRecords();
244 
245  for(std::vector<std::string>::const_iterator it = recordNames.begin(),
246  itEnd = recordNames.end();
247  it != itEnd;
248  ++it) {
249  HCTypeTag t = HCTypeTag::findType(*it);
250  if(t != HCTypeTag() ) {
254  m_keyToID[key]=m_es.recordID(it->c_str());
255  }
256  }
257 }
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
Definition: typelookup.cc:51
std::vector< std::string > namesOfAvailableRecords() const
Definition: EventSetup.cc:135
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:99
list key
Definition: combine.py:13
void findingRecordWithKey(const eventsetup::EventSetupRecordKey &)
void FWLiteESSource::newInterval ( const edm::eventsetup::EventSetupRecordKey iRecordType,
const edm::ValidityInterval iInterval 
)
virtual

called when a new interval of validity occurs for iRecordType

Implements edm::eventsetup::DataProxyProvider.

Definition at line 181 of file FWLiteESSource.cc.

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

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

Implements edm::eventsetup::DataProxyProvider.

Definition at line 191 of file FWLiteESSource.cc.

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

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

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 221 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().

224 {
225  m_es.syncTo(iSync.eventID(), iSync.time());
226 
227  const fwlite::Record& rec = m_es.get(m_keyToID[iKey]);
228  edm::IOVSyncValue endSync(rec.endSyncValue().eventID(),
229  rec.endSyncValue().time());
230  if(rec.endSyncValue().eventID().run()==0 &&
231  rec.endSyncValue().time().value() == 0ULL) {
232  endSync = edm::IOVSyncValue::endOfTime();
233  }
235  rec.startSyncValue().time()),
236  endSync);
237 }
RunNumber_t run() const
Definition: EventID.h:42
void syncTo(const edm::EventID &, const edm::Timestamp &)
Definition: EventSetup.cc:74
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:146
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
fwlite::EventSetup m_es
TimeValue_t value() const
Definition: Timestamp.cc:72
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:128
const edm::EventID & eventID() const
Definition: IOVSyncValue.h:42
const IOVSyncValue & endSyncValue() const
Definition: Record.cc:150

Member Data Documentation

fwlite::EventSetup FWLiteESSource::m_es
private

Definition at line 133 of file FWLiteESSource.cc.

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

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

Definition at line 132 of file FWLiteESSource.cc.

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

Definition at line 134 of file FWLiteESSource.cc.

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