LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
RunHistoryStandard.h
Go to the documentation of this file.
1 // RunHistoryStandard.h
3 //
4 // Detector info class for run history
5 //
6 // jpaley@fnal.gov
7 //
9 #ifndef DETINFO_RUNHISTORY_H
10 #define DETINFO_RUNHISTORY_H
11 
12 #include <cstdint>
13 #include <string>
14 #include <vector>
15 
17 
19 namespace detinfo {
20 
21  class SubRunStandard : public SubRun {
22  public:
24  SubRunStandard(SubRunStandard const&) = delete;
25  virtual ~SubRunStandard(){};
26 
27  virtual uint64_t TStart() const override { return fTStart; }
28  void SetTStart(uint64_t t) { fTStart = t; }
29 
30  private:
31  uint64_t fTStart;
32  };
33 
34  class RunHistoryStandard : public RunHistory {
35  public:
37  RunHistoryStandard(int runnum);
38  RunHistoryStandard(RunHistoryStandard const&) = delete;
39  virtual ~RunHistoryStandard();
40 
41  virtual bool Update(uint64_t ts = 0) override = 0;
42 
43  virtual int RunNumber() const override { return fRun; }
44  virtual int NSubruns() const override { return fNSubruns; }
45  virtual int RunType() const override { return fRunType; }
46  virtual std::string RunTypeAsString() const override;
47  virtual uint64_t TStart() const override { return fTStart; }
48  virtual uint64_t TStop() const override { return fTStop; }
49  virtual uint64_t Duration() const override { return fTStop - fTStart; }
50 
51  std::vector<std::string> Shifters() { return fShifter; }
52 
53  void SetNSubruns(int nsr) { fNSubruns = nsr; }
54  void SetRunType(int rt) { fRunType = rt; }
55  void SetDetId(int id) { fDetId = id; }
56  void SetTStart(uint64_t t) { fTStart = t; }
57  void SetTStop(uint64_t t) { fTStop = t; }
58  void AddShifter(std::string sh) { fShifter.push_back(sh); }
59  void SetShifters(std::vector<std::string> sh) { fShifter = sh; }
60  void SetDetName(std::string dn) { fDetName = dn; }
61 
62  private:
63  protected:
64  int fRun;
65  int fNSubruns;
66  int fRunType;
67  int fDetId;
68 
69  uint64_t fTStart;
70  uint64_t fTStop;
71 
72  std::vector<std::string> fShifter;
73  std::string fDetName;
74 
75  std::vector<SubRunStandard> fSubrun;
76 
77  }; // class RunHistoryStandard
78 } //namespace detinfo
79 #endif // DETINFO_RUNHISTORY_H
virtual uint64_t TStop() const override
virtual uint64_t Duration() const override
void SetTStart(uint64_t t)
void SetShifters(std::vector< std::string > sh)
std::vector< std::string > Shifters()
bool Update(detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, PFPStruct &pfp)
Definition: PFPUtils.cxx:1055
virtual int NSubruns() const override
virtual int RunNumber() const override
virtual int RunType() const override
void SetDetName(std::string dn)
General LArSoft Utilities.
std::vector< SubRunStandard > fSubrun
virtual uint64_t TStart() const override
std::vector< std::string > fShifter
void AddShifter(std::string sh)
virtual uint64_t TStart() const override