Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef CALOHOTTOWER_H
0004 #define CALOHOTTOWER_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <string>
0009 #include <vector>
0010 
0011 #include <TH1.h>
0012 
0013 #include <calotrigger/TriggerAnalyzer.h>
0014 
0015 class PHCompositeNode;
0016 class CDBTTree;
0017 
0018 class CaloHotTower : public SubsysReco
0019 {
0020  public:
0021 
0022   CaloHotTower(const std::string &name = "CaloHotTower");
0023 
0024   ~CaloHotTower() override;
0025 
0026   /** Called during initialization.
0027       Typically this is where you can book histograms, and e.g.
0028       register them to Fun4AllServer (so they can be output to file
0029       using Fun4AllServer::dumpHistos() method).
0030    */
0031   Int_t Init(PHCompositeNode *topNode) override;
0032 
0033   /** Called for each event.
0034       This is where you do the real work.
0035    */
0036   Int_t process_event(PHCompositeNode *topNode) override;
0037 
0038   /// Called at the end of all processing.
0039   Int_t End(PHCompositeNode *topNode) override;
0040 
0041   Int_t readHotTowerIndexFile();
0042 
0043   void setOutputFile(const std::string &outputFile) {
0044     this->m_outputFile = outputFile;
0045   }
0046 
0047   void setHotTowerIndexFile(const std::string &hotTowerIndexFile) {
0048     this->m_hotTowerIndexFile = hotTowerIndexFile;
0049   }
0050 
0051  private:
0052 
0053   UInt_t iEvent;
0054 
0055   Float_t energy_min;
0056   Float_t energy_max;
0057 
0058   UInt_t bins_energy;
0059   Float_t energy_low;
0060   Float_t energy_high;
0061 
0062   std::vector<std::string> m_triggers = {"MBD N&S >= 1", "MBD N&S >= 1, vtx < 10 cm",
0063                                                          "MBD N&S >= 1, vtx < 30 cm",
0064                                                          "MBD N&S >= 1, vtx < 60 cm"};
0065   UInt_t bins_events;
0066 
0067   std::string m_emcTowerNode;
0068   std::string m_outputFile;
0069   std::string m_hotTowerIndexFile;
0070   std::string m_calibName_hotMap;
0071 
0072   std::vector<std::pair<UInt_t,UInt_t>> hotTowerIndex;
0073 
0074   std::vector<TH1F*> hRefTowerEnergy; // filled only for runs where tower is identified as good (status = 0)
0075   std::vector<TH1F*> hHotTowerEnergy; // filled for only runs where tower is identified as hot (status = 2)
0076   std::vector<TH1F*> hHotTowerComplementEnergy; // filled only for runs where tower is identified as not hot (status != 2)
0077   TH1F* hEvents;
0078 
0079   CDBTTree* m_cdbttree_hotMap;
0080   TriggerAnalyzer* triggeranalyzer;
0081 };
0082 
0083 #endif // CALOHOTTOWER_H