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) {
22  return newItemType;
23  }
24  virtual RunNumber_t runNumberToUseForThisLumi() const { return 0; }
25  virtual bool fakeNewRun() const { return false; }
27  virtual void checkForNewRun(RunNumber_t run) {}
28 
29  virtual void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const;
31  virtual void overrideRunNumber(EventID& event, bool isRealData) {}
32  virtual void overrideRunNumber(RunID& run) {}
33  virtual void overrideRunNumber(LuminosityBlockID& lumi) {}
34 
35  static void fillDescription(ParameterSetDescription& desc);
36  };
37 
39  public:
40  explicit DefaultRunHelper() = default;
41  ~DefaultRunHelper() override;
42  };
43 
44  class SetRunHelper : public RunHelperBase {
45  public:
46  explicit SetRunHelper(ParameterSet const& pset);
47  ~SetRunHelper() override;
48 
50 
51  void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const override;
52  void overrideRunNumber(EventID& event, bool isRealData) override;
53  void overrideRunNumber(RunID& run) override;
55 
56  private:
59  bool firstTime_;
60  };
61 
63  public:
64  explicit SetRunForEachLumiHelper(ParameterSet const& pset);
65  ~SetRunForEachLumiHelper() override;
66 
68  InputSource::ItemType const& newIemType) override;
69  RunNumber_t runNumberToUseForThisLumi() const override;
70  bool fakeNewRun() const override { return fakeNewRun_; }
71  void checkForNewRun(RunNumber_t run) override;
72 
73  void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const override;
74  void overrideRunNumber(EventID& event, bool isRealData) override;
75  void overrideRunNumber(RunID& run) override;
77 
78  private:
79  std::vector<RunNumber_t> setRunNumberForEachLumi_;
83  bool firstTime_;
84  };
85 
86  std::unique_ptr<RunHelperBase> makeRunHelper(ParameterSet const& pset);
87 } // namespace edm
88 
89 #endif
bool fakeNewRun() const override
Definition: RunHelper.h:70
static void fillDescription(ParameterSetDescription &desc)
Definition: RunHelper.cc:158
virtual RunNumber_t runNumberToUseForThisLumi() const
Definition: RunHelper.h:24
unsigned int LuminosityBlockNumber_t
RunHelperBase()=default
virtual void overrideRunNumber(LuminosityBlockID &lumi)
Definition: RunHelper.h:33
virtual void checkForNewRun(RunNumber_t run)
Definition: RunHelper.h:27
virtual void overrideRunNumber(RunID &run)
Definition: RunHelper.h:32
virtual bool fakeNewRun() const
Definition: RunHelper.h:25
virtual InputSource::ItemType nextItemType(InputSource::ItemType const &previousItemType, InputSource::ItemType const &newItemType)
Definition: RunHelper.h:20
std::unique_ptr< RunHelperBase > makeRunHelper(ParameterSet const &pset)
Definition: RunHelper.cc:12
virtual void setForcedRunOffset(RunNumber_t firstRun)
Definition: RunHelper.h:26
virtual ~RunHelperBase()
Definition: RunHelper.cc:28
virtual void checkLumiConsistency(LuminosityBlockNumber_t lumi, LuminosityBlockNumber_t origninalLumi) const
Definition: RunHelper.cc:30
HLT enums.
RunNumber_t setRun_
Definition: RunHelper.h:57
firstRun
Definition: dataset.py:940
unsigned int RunNumber_t
std::vector< RunNumber_t > setRunNumberForEachLumi_
Definition: RunHelper.h:79
virtual void overrideRunNumber(EventID &event, bool isRealData)
Definition: RunHelper.h:31
Definition: event.py:1
virtual void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const
Definition: RunHelper.cc:34