Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OnCal.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file OnCal.h
1 #ifndef ONCAL_ONCAL_H
2 #define ONCAL_ONCAL_H
3 
4 #include <fun4all/SubsysReco.h>
5 #include <iostream>
6 #include <string>
7 #include <vector>
8 
9 class Event;
10 class PHCompositeNode;
11 
12 class OnCal : public SubsysReco
13 {
14  public:
15  virtual ~OnCal() {}
16 
17  // These might be overwritten by everyone...
18  int process_event(PHCompositeNode *topNode) override;
19  int End(PHCompositeNode *topNode) override = 0; // Here you analyze and commit (if committing flag is set)
20 
21  // Thsse control committing to the database...
22  virtual void CommitToPdbCal(const int value) = 0; // Set the flag for whether EndOfAnalysis will commit or not
23  virtual int VerificationOK() const = 0; // Tell us whether the new calib is close enough to the old one
24  virtual int CommitedToPdbCalOK() const = 0; // Tell us whether committing was successful by re-reading the data
25 
26  // commit without verification, needed for bootstrap calib
27  // which is too different from previous calibs (e.g. begin of new Run)
28  virtual void CommitNoVerify(const int) { return; }
29 
30  // These default behaviors from SubsysReco base class
31  virtual void identify(std::ostream &out = std::cout) const { out << Name() << std::endl; }
32  virtual int BeginRun(const int) { return 0; }
33  int EndRun(const int) override { return 0; }
34  int Reset(PHCompositeNode * /*topNode*/) override { return 0; }
35  int ResetEvent(PHCompositeNode * /*topNode*/) override { return 0; }
36  virtual void DumpCalib() const { return; }
37 
38  unsigned int AllDone() const { return alldone; }
39  void AllDone(const int i) { alldone = i; }
40  void AddComment(const std::string &adcom);
41  std::string Comment() const { return m_Comment; }
42  int GetPdbCalTables(std::vector<std::string> &vec) const
43  {
44  vec = pdbcaltables;
45  return 0;
46  }
47  virtual int CopyTables(const int FromRun, const int ToRun, const int commit) const;
48  virtual int CreateCalibration(const int /*runnumber*/, const std::string & /*what*/, std::string & /*comment*/, const int /*commit*/) { return -1; }
49  virtual std::vector<std::string> GetLocalFileList() const { return localfilelist; }
50 
51  protected:
52  OnCal(const std::string &Name); // so noone can call it from outside
54  std::vector<std::string> pdbcaltables;
55  std::vector<std::string> pdbcalclasses;
56  std::vector<std::pair<int, int> > bankids;
57  std::vector<std::string> localfilelist;
58  unsigned int alldone;
59 };
60 
61 #endif /* __ONCAL_H__ */