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 
21  InputSource::ItemType const& previousItemType,
22  InputSource::ItemType const& newItemType) {return newItemType;}
23  virtual RunNumber_t runNumberToUseForThisLumi() const {return 0;}
24  virtual bool fakeNewRun() const {return false;}
26  virtual void checkForNewRun(RunNumber_t run) {}
27 
28  virtual void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const;
30  virtual void overrideRunNumber(EventID& event, bool isRealData) {}
31  virtual void overrideRunNumber(RunID& run) {}
32  virtual void overrideRunNumber(LuminosityBlockID& lumi) {}
33 
34  static void fillDescription(ParameterSetDescription& desc);
35  };
36 
38  public:
39  explicit DefaultRunHelper() = default;
40  ~DefaultRunHelper() override;
41  };
42 
43  class SetRunHelper : public RunHelperBase {
44  public:
45  explicit SetRunHelper(ParameterSet const& pset);
46  ~SetRunHelper() override;
47 
49 
50  void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const override;
51  void overrideRunNumber(EventID& event, bool isRealData) override;
52  void overrideRunNumber(RunID& run) override;
54 
55  private:
58  bool firstTime_;
59  };
60 
62  public:
63  explicit SetRunForEachLumiHelper(ParameterSet const& pset);
64  ~SetRunForEachLumiHelper() override;
65 
67  InputSource::ItemType const& previousItemType,
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>
88 }
89 
90 #endif
bool fakeNewRun() const override
Definition: RunHelper.h:70
static void fillDescription(ParameterSetDescription &desc)
Definition: RunHelper.cc:174
virtual RunNumber_t runNumberToUseForThisLumi() const
Definition: RunHelper.h:23
unsigned int LuminosityBlockNumber_t
RunHelperBase()=default
virtual void overrideRunNumber(LuminosityBlockID &lumi)
Definition: RunHelper.h:32
virtual void checkForNewRun(RunNumber_t run)
Definition: RunHelper.h:26
virtual void overrideRunNumber(RunID &run)
Definition: RunHelper.h:31
virtual bool fakeNewRun() const
Definition: RunHelper.h:24
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:13
virtual void setForcedRunOffset(RunNumber_t firstRun)
Definition: RunHelper.h:25
virtual ~RunHelperBase()
Definition: RunHelper.cc:29
virtual void checkLumiConsistency(LuminosityBlockNumber_t lumi, LuminosityBlockNumber_t origninalLumi) const
Definition: RunHelper.cc:32
HLT enums.
RunNumber_t setRun_
Definition: RunHelper.h:56
firstRun
Definition: dataset.py:938
unsigned int RunNumber_t
std::vector< RunNumber_t > setRunNumberForEachLumi_
Definition: RunHelper.h:79
virtual void overrideRunNumber(EventID &event, bool isRealData)
Definition: RunHelper.h:30
Definition: event.py:1
virtual void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const
Definition: RunHelper.cc:37