CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
edm::eventsetup::IntersectingIOVRecordIntervalFinder Class Reference

#include <IntersectingIOVRecordIntervalFinder.h>

Inheritance diagram for edm::eventsetup::IntersectingIOVRecordIntervalFinder:
edm::EventSetupRecordIntervalFinder

Public Member Functions

 IntersectingIOVRecordIntervalFinder (const EventSetupRecordKey &)
 
void swapFinders (std::vector< boost::shared_ptr< EventSetupRecordIntervalFinder > > &)
 
virtual ~IntersectingIOVRecordIntervalFinder ()
 
- 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 ()
 

Protected Member Functions

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

Private Member Functions

 IntersectingIOVRecordIntervalFinder (const IntersectingIOVRecordIntervalFinder &)
 
const
IntersectingIOVRecordIntervalFinder
operator= (const IntersectingIOVRecordIntervalFinder &)
 

Private Attributes

std::vector< boost::shared_ptr
< EventSetupRecordIntervalFinder > > 
finders_
 

Detailed Description

Definition at line 33 of file IntersectingIOVRecordIntervalFinder.h.

Constructor & Destructor Documentation

IntersectingIOVRecordIntervalFinder::IntersectingIOVRecordIntervalFinder ( const EventSetupRecordKey iKey)
explicit

Definition at line 32 of file IntersectingIOVRecordIntervalFinder.cc.

References edm::EventSetupRecordIntervalFinder::findingRecordWithKey().

33 {
35 }
void findingRecordWithKey(const eventsetup::EventSetupRecordKey &)
IntersectingIOVRecordIntervalFinder::~IntersectingIOVRecordIntervalFinder ( )
virtual

Definition at line 42 of file IntersectingIOVRecordIntervalFinder.cc.

43 {
44 }
edm::eventsetup::IntersectingIOVRecordIntervalFinder::IntersectingIOVRecordIntervalFinder ( const IntersectingIOVRecordIntervalFinder )
private

Member Function Documentation

const IntersectingIOVRecordIntervalFinder& edm::eventsetup::IntersectingIOVRecordIntervalFinder::operator= ( const IntersectingIOVRecordIntervalFinder )
private
void IntersectingIOVRecordIntervalFinder::setIntervalFor ( const EventSetupRecordKey iKey,
const IOVSyncValue iTime,
ValidityInterval oInterval 
)
protectedvirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 68 of file IntersectingIOVRecordIntervalFinder.cc.

References edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime(), finders_, edm::ValidityInterval::first(), edm::ValidityInterval::invalidInterval(), edm::IOVSyncValue::invalidIOVSyncValue(), edm::ValidityInterval::last(), edm::ValidityInterval::setFirst(), edm::ValidityInterval::setLast(), and run_regression::test.

71 {
72  if(finders_.empty()) {
74  return;
75  }
76 
77  bool haveAValidRecord = false;
78  bool haveUnknownEnding = false;
80 
81  for(std::vector<boost::shared_ptr<EventSetupRecordIntervalFinder> >::iterator it = finders_.begin(),
82  itEnd = finders_.end(); it != itEnd; ++it) {
83  ValidityInterval test = (*it)->findIntervalFor(iKey, iTime);
84  if ( test != ValidityInterval::invalidInterval() ) {
85  haveAValidRecord =true;
86  if(newInterval.first() < test.first()) {
87  newInterval.setFirst(test.first());
88  }
89  if(newInterval.last() > test.last()) {
90  newInterval.setLast(test.last());
91  }
92  if(test.last() == IOVSyncValue::invalidIOVSyncValue()) {
93  haveUnknownEnding=true;
94  }
95  } else {
96  //if it is invalid then we must check on each new IOVSyncValue so that
97  // we can find the time when it is valid
98  haveUnknownEnding=true;
99  }
100  }
101 
102  if(!haveAValidRecord) {
103  //If no Finder has a valid time, then this record is also invalid for this time
104  newInterval = ValidityInterval::invalidInterval();
105  } else if(haveUnknownEnding) {
106  newInterval.setLast(IOVSyncValue::invalidIOVSyncValue());
107  }
108  oInterval = newInterval;
109 }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
static const IOVSyncValue & beginOfTime()
std::vector< boost::shared_ptr< EventSetupRecordIntervalFinder > > finders_
static const ValidityInterval & invalidInterval()
static const IOVSyncValue & invalidIOVSyncValue()
Definition: IOVSyncValue.cc:92
void IntersectingIOVRecordIntervalFinder::swapFinders ( std::vector< boost::shared_ptr< EventSetupRecordIntervalFinder > > &  iFinders)

Definition at line 62 of file IntersectingIOVRecordIntervalFinder.cc.

References finders_.

63 {
64  finders_.swap(iFinders);
65 }
std::vector< boost::shared_ptr< EventSetupRecordIntervalFinder > > finders_

Member Data Documentation

std::vector<boost::shared_ptr<EventSetupRecordIntervalFinder> > edm::eventsetup::IntersectingIOVRecordIntervalFinder::finders_
private

Definition at line 56 of file IntersectingIOVRecordIntervalFinder.h.

Referenced by setIntervalFor(), and swapFinders().