All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RunHistoryStandard.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // RunHistoryStandard.h
3 //
4 // Detector info class for run history
5 //
6 // jpaley@fnal.gov
7 //
8 ////////////////////////////////////////////////////////////////////////
9 #ifndef DETINFO_RUNHISTORY_H
10 #define DETINFO_RUNHISTORY_H
11 
12 #include <string>
13 #include <vector>
14 
16 
17 ///General LArSoft Utilities
18 namespace detinfo {
19 
20  class SubRunStandard : public SubRun {
21  public:
23  SubRunStandard(SubRunStandard const&) = delete;
24  virtual ~SubRunStandard() {};
25 
26  virtual uint64_t TStart() const override { return fTStart; }
27  void SetTStart(uint64_t t) { fTStart = t; }
28 
29  private:
30  uint64_t fTStart;
31  };
32 
33  class RunHistoryStandard : public RunHistory {
34  public:
36  RunHistoryStandard(int runnum);
37  RunHistoryStandard(RunHistoryStandard const&) = delete;
38  virtual ~RunHistoryStandard();
39 
40  virtual bool Update(uint64_t ts=0) override = 0;
41 
42  virtual int RunNumber() const override{ return fRun; }
43  virtual int NSubruns() const override{ return fNSubruns; }
44  virtual int RunType() const override{ return fRunType; }
45  virtual std::string RunTypeAsString() const override;
46  virtual uint64_t TStart() const override { return fTStart; }
47  virtual uint64_t TStop() const override { return fTStop; }
48  virtual uint64_t Duration() const override { return fTStop-fTStart; }
49 
50  std::vector<std::string> Shifters() { return fShifter; }
51 
52  void SetNSubruns(int nsr) { fNSubruns = nsr;}
53  void SetRunType(int rt) { fRunType = rt; }
54  void SetDetId(int id) { fDetId = id; }
55  void SetTStart(uint64_t t) { fTStart = t; }
56  void SetTStop(uint64_t t) { fTStop = t; }
57  void AddShifter(std::string sh) { fShifter.push_back(sh); }
58  void SetShifters(std::vector<std::string> sh) { fShifter = sh; }
59  void SetDetName(std::string dn) { fDetName = dn; }
60 
61  private:
62  protected:
63  int fRun;
64  int fNSubruns;
65  int fRunType;
66  int fDetId;
67 
68  uint64_t fTStart;
69  uint64_t fTStop;
70 
71  std::vector<std::string> fShifter;
72  std::string fDetName;
73 
74  std::vector<SubRunStandard> fSubrun;
75 
76  }; // class RunHistoryStandard
77 } //namespace detinfo
78 #endif // DETINFO_RUNHISTORY_H
virtual int NSubruns() const override
void SetTStart(uint64_t t)
virtual uint64_t TStop() const override
virtual int RunType() const override
void SetShifters(std::vector< std::string > sh)
std::vector< std::string > Shifters()
virtual uint64_t Duration() const override
void SetDetName(std::string dn)
virtual bool Update(uint64_t ts=0) override=0
std::vector< SubRunStandard > fSubrun
virtual uint64_t TStart() const override
std::vector< std::string > fShifter
virtual int RunNumber() const override
virtual std::string RunTypeAsString() const override
virtual uint64_t TStart() const override
void AddShifter(std::string sh)