Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:16:59

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef CALOTOWERCALIB_H
0004 #define CALOTOWERCALIB_H
0005 
0006 #include "CaloTowerDefs.h"
0007 
0008 #include <calobase/TowerInfoContainer.h>  // for TowerInfoContainer, TowerIn...
0009 
0010 #include <fun4all/SubsysReco.h>
0011 
0012 #include <iostream>
0013 #include <string>
0014 
0015 class CDBTTree;
0016 class PHCompositeNode;
0017 class TowerInfoContainer;
0018 
0019 class CaloTowerCalib : public SubsysReco
0020 {
0021  public:
0022   CaloTowerCalib(const std::string &name = "CaloTowerCalib");
0023 
0024   ~CaloTowerCalib() override;
0025 
0026   int InitRun(PHCompositeNode *topNode) override;
0027   int process_event(PHCompositeNode *topNode) override;
0028   void CreateNodeTree(PHCompositeNode *topNode);
0029 
0030   void set_detector_type(CaloTowerDefs::DetectorSystem dettype)
0031   {
0032     m_dettype = dettype;
0033     return;
0034   }
0035   void setCalibName(const std::string &name)
0036   {
0037     m_calibName = name;
0038     m_overrideCalibName = 1;
0039     return;
0040   }
0041   void setFieldName(const std::string &name)
0042   {
0043     m_fieldname = name;
0044     m_overrideFieldName = 1;
0045     return;
0046   }
0047   void set_inputNodePrefix(const std::string &name)
0048   {
0049     m_inputNodePrefix = name;
0050     return;
0051   }
0052   void set_outputNodePrefix(const std::string &name)
0053   {
0054     m_outputNodePrefix = name;
0055     return;
0056   }
0057 
0058   void set_directURL(const std::string &url)
0059   {
0060     m_giveDirectURL = true;
0061     m_directURL = url;
0062   }
0063 
0064   void set_directURL_timecalib(const std::string &url)
0065   {
0066     m_giveDirectURL_time = true;
0067     m_directURL_time = url;
0068   }
0069 
0070   void set_directURL_ZScrosscalib(const std::string &url)
0071   {
0072     m_giveDirectURL_ZScrosscalib = true;
0073     m_directURL_ZScrosscalib = url;
0074   }
0075 
0076   void set_doZScrosscalib(bool doZScrosscalib)
0077   {
0078     m_doZScrosscalib = doZScrosscalib;
0079   }
0080 
0081   void set_dotimecalib(bool dotimecalib)
0082   {
0083     m_dotimecalib = dotimecalib;
0084   }
0085 
0086   void set_doCalibOnly(bool docalib = true)
0087   {
0088     if (docalib) 
0089     {
0090       m_dotimecalib = false;
0091       m_doZScrosscalib = false;
0092     }
0093   }
0094 
0095   void set_use_TowerInfov2(bool use) { m_use_TowerInfov2 = use; }
0096 
0097  private:
0098   CaloTowerDefs::DetectorSystem m_dettype;
0099 
0100   std::string m_detector;
0101   TowerInfoContainer::DETECTOR m_DETECTOR;
0102   std::string m_fieldname;
0103   std::string m_calibName;
0104   std::string m_fieldname_time;
0105   std::string m_calibName_time;
0106   std::string m_fieldname_ZScrosscalib;
0107   std::string m_calibName_ZScrosscalib;
0108   bool m_overrideCalibName{false};
0109   bool m_overrideFieldName{false};
0110   std::string m_inputNodePrefix{"TOWERS_"};
0111   std::string m_outputNodePrefix{"TOWERINFO_CALIB_"};
0112   std::string RawTowerNodeName;
0113   std::string CalibTowerNodeName;
0114 
0115   bool m_use_TowerInfov2 = 0;
0116 
0117   bool m_giveDirectURL = false;
0118   std::string m_directURL = "";
0119 
0120   bool m_giveDirectURL_time = false;
0121   std::string m_directURL_time = "";
0122   bool m_dotimecalib = true;
0123 
0124   bool m_giveDirectURL_ZScrosscalib = false;
0125   std::string m_directURL_ZScrosscalib = "";
0126   bool m_doZScrosscalib = true;
0127 
0128   CDBTTree *cdbttree = nullptr;
0129   CDBTTree *cdbttree_time = nullptr;
0130   CDBTTree *cdbttree_ZScrosscalib = nullptr;
0131 };
0132 
0133 #endif  // CALOTOWERBUILDER_H