LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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 <string>
13 #include <vector>
14 #include <map>
15 
16 #include "fhiclcpp/ParameterSet.h"
18 
20 namespace detinfo {
21 
22  class SubRunStandard : public SubRun {
23  public:
25  SubRunStandard(SubRunStandard const&) = delete;
26  virtual ~SubRunStandard() {};
27 
28  virtual uint64_t TStart() const override { return fTStart; }
29  void SetTStart(uint64_t t) { fTStart = t; }
30 
31  private:
32  uint64_t fTStart;
33  };
34 
35  class RunHistoryStandard : public RunHistory {
36  public:
38  RunHistoryStandard(int runnum);
39  RunHistoryStandard(RunHistoryStandard const&) = delete;
40  virtual ~RunHistoryStandard();
41 
42  virtual bool Update(uint64_t ts=0) override = 0;
43 
44  virtual int RunNumber() const override{ return fRun; }
45  virtual int NSubruns() const override{ return fNSubruns; }
46  virtual int RunType() const override{ return fRunType; }
47  virtual std::string RunTypeAsString() const override;
48  virtual uint64_t TStart() const override { return fTStart; }
49  virtual uint64_t TStop() const override { return fTStop; }
50  virtual uint64_t Duration() const override { return fTStop-fTStart; }
51 
52  std::vector<std::string> Shifters() { return fShifter; }
53 
54  void SetNSubruns(int nsr) { fNSubruns = nsr;}
55  void SetRunType(int rt) { fRunType = rt; }
56  void SetDetId(int id) { fDetId = id; }
57  void SetTStart(uint64_t t) { fTStart = t; }
58  void SetTStop(uint64_t t) { fTStop = t; }
59  void AddShifter(std::string sh) { fShifter.push_back(sh); }
60  void SetShifters(std::vector<std::string> sh) { fShifter = sh; }
61  void SetDetName(std::string dn) { fDetName = dn; }
62 
63  private:
64  protected:
65  int fRun;
66  int fNSubruns;
67  int fRunType;
68  int fDetId;
69 
70  uint64_t fTStart;
71  uint64_t fTStop;
72 
73  std::vector<std::string> fShifter;
74  std::string fDetName;
75 
76  std::vector<SubRunStandard> fSubrun;
77 
78  }; // class RunHistoryStandard
79 } //namespace detinfo
80 #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()
virtual int NSubruns() const override
virtual int RunNumber() const override
c1 Update()
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