Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:12:42

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef HCAL_TOWERID_H
0004 #define HCAL_TOWERID_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 //#include <cdbobjects/CDBTTree.h>
0008 
0009 #include <string>
0010 #include <vector>
0011 #include <TTree.h>
0012 #include <TH1F.h>
0013 #include <TH2F.h>
0014 
0015 class TTree;
0016 class PHCompositeNode;
0017 class Fun4AllHistoManager;
0018 class TFile;
0019 class RawCluster;
0020 class TowerInfoContainer;
0021 
0022 class hcal_towerid : public SubsysReco
0023 {
0024  public:
0025 
0026   hcal_towerid(const std::string &name = "towerid.root", const std::string &cdbtreename_i = "test.root",const std::string &cdbtreename_o = "test2.root", float adccut_i = 250, float adccut_o = 250, float sigmas_lo = 1, float sigmas_hi = 4.5, float inner_f = 0.03, float outer_f = 0.03);
0027 
0028   ~hcal_towerid() override;
0029 
0030   /** Called during initialization.
0031       Typically this is where you can book histograms, and e.g.
0032       register them to Fun4AllServer (so they can be output to file
0033       using Fun4AllServer::dumpHistos() method).
0034   */
0035   int Init(PHCompositeNode *topNode) override;
0036 
0037   /** Called for first event when run number is known.
0038       Typically this is where you may want to fetch data from
0039       database, because you know the run number. A place
0040       to book histograms which have to know the run number.
0041   */
0042   int InitRun(PHCompositeNode *topNode) override;
0043 
0044   /** Called for each event.
0045       This is where you do the real work.
0046   */
0047   int process_event(PHCompositeNode *topNode) override;
0048 
0049   /// Clean up internals after each event.
0050   int ResetEvent(PHCompositeNode *topNode) override;
0051 
0052   /// Called at the end of each run.
0053   int EndRun(const int runnumber) override;
0054 
0055   /// Called at the end of all processing.
0056   int End(PHCompositeNode *topNode) override;
0057 
0058   /// Reset
0059   int Reset(PHCompositeNode * /*topNode*/) override;    
0060 
0061   void Print(const std::string &what = "ALL") const override;
0062   
0063 
0064  private:
0065 
0066   TTree *T;
0067   TTree *T2;
0068   TFile *out;
0069 
0070 //  CDBTTree *cdbttree;
0071  
0072   //Fun4AllHistoManager *hm = nullptr;
0073   std::string Outfile = "commissioning.root";
0074 
0075   TH1F*Fspeci_i = new TH1F("Fspeci_i","Fspeci_i",0,1,1);
0076   TH1F*Fspeci_o = new TH1F("Fspeci_o","Fspeci_o",0,1,1);
0077 
0078   TH1F*Fspec_i = new TH1F("Espec_i","Espec_i",0,1,1);
0079   TH1F*Fspec_o = new TH1F("Fspec_i","Fspec_i",0,1,1);
0080 
0081   TH1F*Espec_i = new TH1F("Espec_i","Espec_i",0,1,1);
0082   TH1F*Espec_o = new TH1F("Espec_o","Espec_o",0,1,1);
0083 
0084   const std::string cdbtreename_i;
0085   const std::string cdbtreename_o;  
0086   float adccut_i;
0087   float adccut_o;
0088   float sigmas_lo;
0089   float sigmas_hi;
0090   float inner_f;
0091   float outer_f;
0092     
0093   int m_hot_channels_i;
0094   int m_hot_channels_o;
0095   int itowerF[1536] = {0};
0096   int otowerF[1536] = {0};
0097 
0098   float itowerE[1536] = {0};
0099   float otowerE[1536] = {0};
0100 
0101   int ihottowers[1536] = {0};
0102   int ohottowers[1536] = {0};
0103   int ideadtowers[1536] = {0};
0104   int odeadtowers[1536] = {0};
0105     
0106   int icoldtowers[1536] = {0};
0107   int ocoldtowers[1536] = {0};
0108 
0109 int goodevents = 0;
0110 };
0111 
0112 #endif