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  virtual ~DefaultRunHelper();
41  };
42 
43  class SetRunHelper : public RunHelperBase {
44  public:
45  explicit SetRunHelper(ParameterSet const& pset);
46  virtual ~SetRunHelper();
47 
48  virtual void setForcedRunOffset(RunNumber_t firstRun) override;
49 
50  virtual void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const override;
51  virtual void overrideRunNumber(EventID& event, bool isRealData) override;
52  virtual void overrideRunNumber(RunID& run) override;
53  virtual void overrideRunNumber(LuminosityBlockID& lumi) override;
54 
55  private:
58  bool firstTime_;
59  };
60 
62  public:
63  explicit SetRunForEachLumiHelper(ParameterSet const& pset);
64  virtual ~SetRunForEachLumiHelper();
65 
67  InputSource::ItemType const& previousItemType,
68  InputSource::ItemType const& newIemType) override;
69  virtual RunNumber_t runNumberToUseForThisLumi() const override;
70  virtual bool fakeNewRun() const override {return fakeNewRun_;}
71  virtual void checkForNewRun(RunNumber_t run) override;
72 
73  virtual void checkRunConsistency(RunNumber_t run, RunNumber_t origninalRun) const override;
74  virtual void overrideRunNumber(EventID& event, bool isRealData) override;
75  virtual void overrideRunNumber(RunID& run) override;
76  virtual void overrideRunNumber(LuminosityBlockID& lumi) override;
77 
78  private:
79  std::vector<RunNumber_t> setRunNumberForEachLumi_;
83  bool firstTime_;
84  };
85 
86  std::unique_ptr<RunHelperBase>
88 }
89 
90 #endif
static void fillDescription(ParameterSetDescription &desc)
Definition: RunHelper.cc:174
virtual RunNumber_t runNumberToUseForThisLumi() const
Definition: RunHelper.h:23
virtual bool fakeNewRun() const override
Definition: RunHelper.h:70
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:934
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