Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:15:34

0001 #ifndef ONCAL_ONCAL_H
0002 #define ONCAL_ONCAL_H
0003 
0004 #include <fun4all/SubsysReco.h>
0005 #include <iostream>
0006 #include <string>
0007 #include <utility>  // for pair
0008 #include <vector>
0009 
0010 class OnCal : public SubsysReco
0011 {
0012  public:
0013   ~OnCal() override = default;
0014 
0015   //  These might be overwritten by everyone...
0016   int process_event(PHCompositeNode *topNode) override;
0017   int End(PHCompositeNode *topNode) override = 0;  // Here you analyze and commit (if committing flag is set)
0018 
0019   // Thsse control committing to the database...
0020   virtual void CommitToPdbCal(const int value) = 0;  // Set the flag for whether EndOfAnalysis will commit or not
0021   virtual int VerificationOK() const = 0;            // Tell us whether the new calib is close enough to the old one
0022   virtual int CommitedToPdbCalOK() const = 0;        // Tell us whether committing was successful by re-reading the data
0023 
0024   // commit without verification, needed for bootstrap calib
0025   // which is too different from previous calibs (e.g. begin of new Run)
0026   virtual void CommitNoVerify(const int) { return; }
0027 
0028   //  These default behaviors from SubsysReco base class
0029   virtual void identify(std::ostream &out = std::cout) const { out << Name() << std::endl; }
0030   virtual int BeginRun(const int) { return 0; }
0031   int EndRun(const int) override { return 0; }
0032   int Reset(PHCompositeNode * /*topNode*/) override { return 0; }
0033   int ResetEvent(PHCompositeNode * /*topNode*/) override { return 0; }
0034   virtual void DumpCalib() const { return; }
0035 
0036   unsigned int AllDone() const { return alldone; }
0037   void AllDone(const int i) { alldone = i; }
0038   void AddComment(const std::string &adcom);
0039   const std::string &Comment() const { return m_Comment; }
0040   int GetPdbCalTables(std::vector<std::string> &vec) const
0041   {
0042     vec = pdbcaltables;
0043     return 0;
0044   }
0045   virtual int CopyTables(const int FromRun, const int ToRun, const int commit) const;
0046   virtual int CreateCalibration(const int /*runnumber*/, const std::string & /*what*/, std::string & /*comment*/, const int /*commit*/) { return -1; }
0047   virtual std::vector<std::string> GetLocalFileList() const { return localfilelist; }
0048 
0049  protected:
0050   OnCal(const std::string &Name);  // so noone can call it from outside
0051   unsigned int alldone{0};
0052   std::string m_Comment;
0053   std::vector<std::string> pdbcaltables;
0054   std::vector<std::string> pdbcalclasses;
0055   std::vector<std::pair<int, int> > bankids;
0056   std::vector<std::string> localfilelist;
0057 };
0058 
0059 #endif /* ONCAL_ONCAL_H */