CMS 3D CMS Logo

RunHelper.h
Go to the documentation of this file.
1 #ifndef IOPool_Input_RunHelper_h
2 #define IOPool_Input_RunHelper_h
3 
7 
8 #include <memory>
9 #include <vector>
10 
11 namespace edm {
12  class IndexIntoFile;
14 
15  class RunHelperBase {
16  public:
17  explicit RunHelperBase() = default;
18  virtual ~RunHelperBase();
19 
20  virtual InputSource::ItemType nextItemType(InputSource::ItemType const& previousItemType,
21  InputSource::ItemType const& newItemType,
24  EventNumber_t) {
25  return newItemType;
26  }
27  virtual RunNumber_t runNumberToUseForThisLumi() const { return 0; }
28  virtual bool fakeNewRun() const { return false; }
31 
32  virtual void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const;
34  virtual void overrideRunNumber(EventID& event, bool isRealData) {}
35  virtual void overrideRunNumber(RunID& run) {}
37 
39  };
40 
42  public:
43  explicit DefaultRunHelper() = default;
44  ~DefaultRunHelper() override;
45  };
46 
47  class SetRunHelper : public RunHelperBase {
48  public:
49  explicit SetRunHelper(ParameterSet const& pset);
50  ~SetRunHelper() override;
51 
53 
54  void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const override;
55  void overrideRunNumber(EventID& event, bool isRealData) override;
56  void overrideRunNumber(RunID& run) override;
58 
59  private:
62  bool firstTime_;
63  };
64 
66  public:
67  explicit SetRunForEachLumiHelper(ParameterSet const& pset);
68  ~SetRunForEachLumiHelper() override;
69 
71  InputSource::ItemType const& newIemType,
74  EventNumber_t) override;
75  RunNumber_t runNumberToUseForThisLumi() const override;
76  bool fakeNewRun() const override { return fakeNewRun_; }
77  void checkForNewRun(RunNumber_t run, LuminosityBlockNumber_t nextLumi) override;
78 
79  void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const override;
80  void overrideRunNumber(EventID& event, bool isRealData) override;
81  void overrideRunNumber(RunID& run) override;
83 
84  private:
85  std::vector<RunNumber_t> setRunNumberForEachLumi_;
89  bool firstTime_;
90  };
91 
93  public:
95 
97  InputSource::ItemType const& newIemType,
100  EventNumber_t) override;
101  RunNumber_t runNumberToUseForThisLumi() const override;
102  bool fakeNewRun() const override { return fakeNewRun_; }
103  void checkForNewRun(RunNumber_t run, LuminosityBlockNumber_t nextLumi) override;
104 
105  void checkRunConsistency(RunNumber_t run, RunNumber_t originalRun) const override;
106  void overrideRunNumber(EventID& event, bool isRealData) override;
107  void overrideRunNumber(RunID& run) override;
108  void overrideRunNumber(LuminosityBlockID& lumi) override;
109 
110  private:
112  std::vector<edm::LuminosityBlockID> const lumiToRun_;
116  };
117  std::unique_ptr<RunHelperBase> makeRunHelper(ParameterSet const& pset);
118 } // namespace edm
119 
120 #endif
dataset.firstRun
firstRun
Definition: dataset.py:940
edm::RunHelperBase::overrideRunNumber
virtual void overrideRunNumber(EventID &event, bool isRealData)
Definition: RunHelper.h:34
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
edm::FirstLuminosityBlockForEachRunHelper::lastUsedRunNumber_
RunNumber_t lastUsedRunNumber_
Definition: RunHelper.h:114
edm::RunHelperBase::fakeNewRun
virtual bool fakeNewRun() const
Definition: RunHelper.h:28
edm::RunHelperBase::~RunHelperBase
virtual ~RunHelperBase()
Definition: RunHelper.cc:33
edm::FirstLuminosityBlockForEachRunHelper::nextItemType
InputSource::ItemType nextItemType(InputSource::ItemType const &previousItemType, InputSource::ItemType const &newIemType, RunNumber_t, LuminosityBlockNumber_t, EventNumber_t) override
Definition: RunHelper.cc:172
edm::SetRunHelper::firstTime_
bool firstTime_
Definition: RunHelper.h:62
edm::RunID
Definition: RunID.h:28
edm::DefaultRunHelper
Definition: RunHelper.h:41
edm::SetRunForEachLumiHelper::nextItemType
InputSource::ItemType nextItemType(InputSource::ItemType const &previousItemType, InputSource::ItemType const &newIemType, RunNumber_t, LuminosityBlockNumber_t, EventNumber_t) override
Definition: RunHelper.cc:104
edm::SetRunHelper::SetRunHelper
SetRunHelper(ParameterSet const &pset)
Definition: RunHelper.cc:45
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::FirstLuminosityBlockForEachRunHelper::lumiToRun_
const std::vector< edm::LuminosityBlockID > lumiToRun_
Definition: RunHelper.h:112
RunLumiEventNumber.h
edm::SetRunForEachLumiHelper::SetRunForEachLumiHelper
SetRunForEachLumiHelper(ParameterSet const &pset)
Definition: RunHelper.cc:94
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::FirstLuminosityBlockForEachRunHelper
Definition: RunHelper.h:92
edm::FirstLuminosityBlockForEachRunHelper::fakeNewRun_
bool fakeNewRun_
Definition: RunHelper.h:115
edm::SetRunForEachLumiHelper::fakeNewRun_
bool fakeNewRun_
Definition: RunHelper.h:88
edm::FirstLuminosityBlockForEachRunHelper::FirstLuminosityBlockForEachRunHelper
FirstLuminosityBlockForEachRunHelper(ParameterSet const &pset)
Definition: RunHelper.cc:166
edm::FirstLuminosityBlockForEachRunHelper::findRunFromLumi
RunNumber_t findRunFromLumi(LuminosityBlockNumber_t) const
Definition: RunHelper.cc:223
edm::LuminosityBlockNumber_t
unsigned int LuminosityBlockNumber_t
Definition: RunLumiEventNumber.h:13
edm::FirstLuminosityBlockForEachRunHelper::fakeNewRun
bool fakeNewRun() const override
Definition: RunHelper.h:102
edm::FirstLuminosityBlockForEachRunHelper::runNumberToUseForThisLumi
RunNumber_t runNumberToUseForThisLumi() const override
Definition: RunHelper.cc:192
edm::SetRunHelper::forcedRunOffset_
int forcedRunOffset_
Definition: RunHelper.h:61
edm::RunHelperBase::fillDescription
static void fillDescription(ParameterSetDescription &desc)
Definition: RunHelper.cc:240
edm::FirstLuminosityBlockForEachRunHelper::overrideRunNumber
void overrideRunNumber(EventID &event, bool isRealData) override
Definition: RunHelper.cc:211
edm::SetRunForEachLumiHelper::setRunNumberForEachLumi_
std::vector< RunNumber_t > setRunNumberForEachLumi_
Definition: RunHelper.h:85
edm::SetRunHelper::setForcedRunOffset
void setForcedRunOffset(RunNumber_t firstRun) override
Definition: RunHelper.cc:53
edm::FirstLuminosityBlockForEachRunHelper::realRunNumber_
RunNumber_t realRunNumber_
Definition: RunHelper.h:113
edm::SetRunForEachLumiHelper::fakeNewRun
bool fakeNewRun() const override
Definition: RunHelper.h:76
edm::makeRunHelper
std::unique_ptr< RunHelperBase > makeRunHelper(ParameterSet const &pset)
Definition: RunHelper.cc:12
edm::RunHelperBase::overrideRunNumber
virtual void overrideRunNumber(RunID &run)
Definition: RunHelper.h:35
edm::EventNumber_t
unsigned long long EventNumber_t
Definition: RunLumiEventNumber.h:12
edm::LuminosityBlockID
Definition: LuminosityBlockID.h:31
edm::DefaultRunHelper::DefaultRunHelper
DefaultRunHelper()=default
edm::RunHelperBase::checkRunConsistency
virtual void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const
Definition: RunHelper.cc:39
edm::RunHelperBase
Definition: RunHelper.h:15
edm::SetRunForEachLumiHelper
Definition: RunHelper.h:65
edm::SetRunForEachLumiHelper::~SetRunForEachLumiHelper
~SetRunForEachLumiHelper() override
Definition: RunHelper.cc:102
edm::RunHelperBase::RunHelperBase
RunHelperBase()=default
edm::RunHelperBase::runNumberToUseForThisLumi
virtual RunNumber_t runNumberToUseForThisLumi() const
Definition: RunHelper.h:27
edm::ParameterSet
Definition: ParameterSet.h:47
edm::SetRunForEachLumiHelper::overrideRunNumber
void overrideRunNumber(EventID &event, bool isRealData) override
Definition: RunHelper.cc:154
edm::SetRunHelper::setRun_
RunNumber_t setRun_
Definition: RunHelper.h:60
edm::SetRunForEachLumiHelper::checkRunConsistency
void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const override
Definition: RunHelper.cc:162
edm::SetRunForEachLumiHelper::indexOfNextRunNumber_
size_t indexOfNextRunNumber_
Definition: RunHelper.h:86
edm::SetRunForEachLumiHelper::runNumberToUseForThisLumi
RunNumber_t runNumberToUseForThisLumi() const override
Definition: RunHelper.cc:135
edm::SetRunForEachLumiHelper::checkForNewRun
void checkForNewRun(RunNumber_t run, LuminosityBlockNumber_t nextLumi) override
Definition: RunHelper.cc:139
edm::SetRunHelper::checkRunConsistency
void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const override
Definition: RunHelper.cc:90
edm::FirstLuminosityBlockForEachRunHelper::checkForNewRun
void checkForNewRun(RunNumber_t run, LuminosityBlockNumber_t nextLumi) override
Definition: RunHelper.cc:194
edm::RunHelperBase::overrideRunNumber
virtual void overrideRunNumber(LuminosityBlockID &lumi)
Definition: RunHelper.h:36
edm::DefaultRunHelper::~DefaultRunHelper
~DefaultRunHelper() override
Definition: RunHelper.cc:43
edm::InputSource::ItemType
ItemType
Definition: InputSource.h:78
edm::RunHelperBase::setForcedRunOffset
virtual void setForcedRunOffset(RunNumber_t firstRun)
Definition: RunHelper.h:29
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
writedatasetfile.run
run
Definition: writedatasetfile.py:27
Frameworkfwd.h
InputSource.h
edm::SetRunHelper
Definition: RunHelper.h:47
edm::RunHelperBase::checkForNewRun
virtual void checkForNewRun(RunNumber_t run, LuminosityBlockNumber_t nextLumi)
Definition: RunHelper.h:30
ParameterSetDescription
edm::SetRunForEachLumiHelper::realRunNumber_
RunNumber_t realRunNumber_
Definition: RunHelper.h:87
edm::SetRunHelper::overrideRunNumber
void overrideRunNumber(EventID &event, bool isRealData) override
Definition: RunHelper.cc:78
edm::FirstLuminosityBlockForEachRunHelper::checkRunConsistency
void checkRunConsistency(RunNumber_t run, RunNumber_t originalRun) const override
Definition: RunHelper.cc:219
edm::RunHelperBase::checkLumiConsistency
virtual void checkLumiConsistency(LuminosityBlockNumber_t lumi, LuminosityBlockNumber_t origninalLumi) const
Definition: RunHelper.cc:35
edm::SetRunForEachLumiHelper::firstTime_
bool firstTime_
Definition: RunHelper.h:89
event
Definition: event.py:1
edm::EventID
Definition: EventID.h:31
lumi
Definition: LumiSectionData.h:20
edm::SetRunHelper::~SetRunHelper
~SetRunHelper() override
Definition: RunHelper.cc:51
edm::RunHelperBase::nextItemType
virtual InputSource::ItemType nextItemType(InputSource::ItemType const &previousItemType, InputSource::ItemType const &newItemType, RunNumber_t, LuminosityBlockNumber_t, EventNumber_t)
Definition: RunHelper.h:20
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27