CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::SetRunHelper Class Reference

#include <RunHelper.h>

Inheritance diagram for edm::SetRunHelper:
edm::RunHelperBase

Public Member Functions

void checkRunConsistency (RunNumber_t run, RunNumber_t origninalRun) const override
 
void overrideRunNumber (EventID &event, bool isRealData) override
 
void overrideRunNumber (RunID &run) override
 
void overrideRunNumber (LuminosityBlockID &lumi) override
 
void setForcedRunOffset (RunNumber_t firstRun) override
 
 SetRunHelper (ParameterSet const &pset)
 
 ~SetRunHelper () override
 
- Public Member Functions inherited from edm::RunHelperBase
virtual void checkForNewRun (RunNumber_t run, LuminosityBlockNumber_t nextLumi)
 
virtual void checkLumiConsistency (LuminosityBlockNumber_t lumi, LuminosityBlockNumber_t origninalLumi) const
 
virtual bool fakeNewRun () const
 
virtual InputSource::ItemType nextItemType (InputSource::ItemType const &previousItemType, InputSource::ItemType const &newItemType, RunNumber_t, LuminosityBlockNumber_t, EventNumber_t)
 
 RunHelperBase ()=default
 
virtual RunNumber_t runNumberToUseForThisLumi () const
 
virtual ~RunHelperBase ()
 

Private Attributes

bool firstTime_
 
int forcedRunOffset_
 
RunNumber_t setRun_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::RunHelperBase
static void fillDescription (ParameterSetDescription &desc)
 

Detailed Description

Definition at line 47 of file RunHelper.h.

Constructor & Destructor Documentation

◆ SetRunHelper()

edm::SetRunHelper::SetRunHelper ( ParameterSet const &  pset)
explicit

Definition at line 45 of file RunHelper.cc.

46  : RunHelperBase(),
47  setRun_(pset.getUntrackedParameter<unsigned int>("setRunNumber")),
49  firstTime_(true) {}
RunHelperBase()=default
RunNumber_t setRun_
Definition: RunHelper.h:60

◆ ~SetRunHelper()

edm::SetRunHelper::~SetRunHelper ( )
override

Definition at line 51 of file RunHelper.cc.

51 {}

Member Function Documentation

◆ checkRunConsistency()

void edm::SetRunHelper::checkRunConsistency ( RunNumber_t  run,
RunNumber_t  origninalRun 
) const
overridevirtual

Reimplemented from edm::RunHelperBase.

Definition at line 90 of file RunHelper.cc.

References cms::cuda::assert(), forcedRunOffset_, and writedatasetfile::run.

90  {
91  assert(run == originalRun + forcedRunOffset_);
92  }
assert(be >=bs)

◆ overrideRunNumber() [1/3]

void edm::SetRunHelper::overrideRunNumber ( EventID event,
bool  isRealData 
)
overridevirtual

Reimplemented from edm::RunHelperBase.

Definition at line 78 of file RunHelper.cc.

References edm::errors::Configuration, edmPickEvents::event, Exception, edm::LuminosityBlockID::firstValidLuminosityBlock(), edm::RunID::firstValidRun(), forcedRunOffset_, and writedatasetfile::run.

78  {
79  if (isRealData) {
80  throw Exception(errors::Configuration, "SetRunHelper::overrideRunNumber()")
81  << "The 'setRunNumber' parameter of PoolSource cannot be used with real data.\n";
82  }
83  id = EventID(id.run() + forcedRunOffset_, id.luminosityBlock(), id.event());
84  if (RunID(id.run()) < RunID::firstValidRun()) {
85  id = EventID(
87  }
88  }
static LuminosityBlockID firstValidLuminosityBlock()
static RunID firstValidRun()
Definition: RunID.h:58

◆ overrideRunNumber() [2/3]

void edm::SetRunHelper::overrideRunNumber ( RunID run)
overridevirtual

Reimplemented from edm::RunHelperBase.

Definition at line 66 of file RunHelper.cc.

References edm::RunID::firstValidRun(), forcedRunOffset_, and writedatasetfile::run.

66  {
67  id = RunID(id.run() + forcedRunOffset_);
68  if (id < RunID::firstValidRun())
69  id = RunID::firstValidRun();
70  }
static RunID firstValidRun()
Definition: RunID.h:58

◆ overrideRunNumber() [3/3]

void edm::SetRunHelper::overrideRunNumber ( LuminosityBlockID lumi)
overridevirtual

Reimplemented from edm::RunHelperBase.

Definition at line 72 of file RunHelper.cc.

References edm::RunID::firstValidRun(), forcedRunOffset_, and writedatasetfile::run.

72  {
73  id = LuminosityBlockID(id.run() + forcedRunOffset_, id.luminosityBlock());
74  if (RunID(id.run()) < RunID::firstValidRun())
75  id = LuminosityBlockID(RunID::firstValidRun().run(), id.luminosityBlock());
76  }
static RunID firstValidRun()
Definition: RunID.h:58

◆ setForcedRunOffset()

void edm::SetRunHelper::setForcedRunOffset ( RunNumber_t  firstRun)
overridevirtual

Reimplemented from edm::RunHelperBase.

Definition at line 53 of file RunHelper.cc.

References edm::errors::Configuration, Exception, dataset::firstRun, firstTime_, forcedRunOffset_, and setRun_.

53  {
54  if (firstTime_ && setRun_ != 0) {
56  if (forcedRunOffset_ < 0) {
58  << "The value of the 'setRunNumber' parameter must not be\n"
59  << "less than the first run number in the first input file.\n"
60  << "'setRunNumber' was " << setRun_ << ", while the first run was " << firstRun << ".\n";
61  }
62  }
63  firstTime_ = false;
64  }
RunNumber_t setRun_
Definition: RunHelper.h:60
firstRun
Definition: dataset.py:940

Member Data Documentation

◆ firstTime_

bool edm::SetRunHelper::firstTime_
private

Definition at line 62 of file RunHelper.h.

Referenced by setForcedRunOffset().

◆ forcedRunOffset_

int edm::SetRunHelper::forcedRunOffset_
private

Definition at line 61 of file RunHelper.h.

Referenced by checkRunConsistency(), overrideRunNumber(), and setForcedRunOffset().

◆ setRun_

RunNumber_t edm::SetRunHelper::setRun_
private

Definition at line 60 of file RunHelper.h.

Referenced by setForcedRunOffset().