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
virtual void checkLumiConsistency(LuminosityBlockNumber_t lumi, LuminosityBlockNumber_t origninalLumi) const
Definition: RunHelper.cc:35
void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const override
Definition: RunHelper.cc:162
void setForcedRunOffset(RunNumber_t firstRun) override
Definition: RunHelper.cc:53
void checkForNewRun(RunNumber_t run, LuminosityBlockNumber_t nextLumi) override
Definition: RunHelper.cc:139
static void fillDescription(ParameterSetDescription &desc)
Definition: RunHelper.cc:240
void overrideRunNumber(EventID &event, bool isRealData) override
Definition: RunHelper.cc:78
InputSource::ItemType nextItemType(InputSource::ItemType const &previousItemType, InputSource::ItemType const &newIemType, RunNumber_t, LuminosityBlockNumber_t, EventNumber_t) override
Definition: RunHelper.cc:172
unsigned long long EventNumber_t
unsigned int LuminosityBlockNumber_t
RunHelperBase()=default
~SetRunHelper() override
Definition: RunHelper.cc:51
void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const override
Definition: RunHelper.cc:90
SetRunHelper(ParameterSet const &pset)
Definition: RunHelper.cc:45
virtual void overrideRunNumber(LuminosityBlockID &lumi)
Definition: RunHelper.h:36
std::vector< edm::LuminosityBlockID > const lumiToRun_
Definition: RunHelper.h:112
RunNumber_t findRunFromLumi(LuminosityBlockNumber_t) const
Definition: RunHelper.cc:223
virtual RunNumber_t runNumberToUseForThisLumi() const
Definition: RunHelper.h:27
void overrideRunNumber(EventID &event, bool isRealData) override
Definition: RunHelper.cc:211
virtual void overrideRunNumber(RunID &run)
Definition: RunHelper.h:35
virtual void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const
Definition: RunHelper.cc:39
bool fakeNewRun() const override
Definition: RunHelper.h:76
DefaultRunHelper()=default
~DefaultRunHelper() override
Definition: RunHelper.cc:43
std::unique_ptr< RunHelperBase > makeRunHelper(ParameterSet const &pset)
Definition: RunHelper.cc:12
FirstLuminosityBlockForEachRunHelper(ParameterSet const &pset)
Definition: RunHelper.cc:166
SetRunForEachLumiHelper(ParameterSet const &pset)
Definition: RunHelper.cc:94
virtual void setForcedRunOffset(RunNumber_t firstRun)
Definition: RunHelper.h:29
virtual bool fakeNewRun() const
Definition: RunHelper.h:28
InputSource::ItemType nextItemType(InputSource::ItemType const &previousItemType, InputSource::ItemType const &newIemType, RunNumber_t, LuminosityBlockNumber_t, EventNumber_t) override
Definition: RunHelper.cc:104
void checkForNewRun(RunNumber_t run, LuminosityBlockNumber_t nextLumi) override
Definition: RunHelper.cc:194
virtual ~RunHelperBase()
Definition: RunHelper.cc:33
~SetRunForEachLumiHelper() override
Definition: RunHelper.cc:102
RunNumber_t runNumberToUseForThisLumi() const override
Definition: RunHelper.cc:192
HLT enums.
RunNumber_t setRun_
Definition: RunHelper.h:60
RunNumber_t runNumberToUseForThisLumi() const override
Definition: RunHelper.cc:135
unsigned int RunNumber_t
virtual InputSource::ItemType nextItemType(InputSource::ItemType const &previousItemType, InputSource::ItemType const &newItemType, RunNumber_t, LuminosityBlockNumber_t, EventNumber_t)
Definition: RunHelper.h:20
void checkRunConsistency(RunNumber_t run, RunNumber_t originalRun) const override
Definition: RunHelper.cc:219
virtual void checkForNewRun(RunNumber_t run, LuminosityBlockNumber_t nextLumi)
Definition: RunHelper.h:30
std::vector< RunNumber_t > setRunNumberForEachLumi_
Definition: RunHelper.h:85
virtual void overrideRunNumber(EventID &event, bool isRealData)
Definition: RunHelper.h:34
Definition: event.py:1
void overrideRunNumber(EventID &event, bool isRealData) override
Definition: RunHelper.cc:154