Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4DETECTORS_PHG4CYLINDERCELLRECO_H
0004 #define G4DETECTORS_PHG4CYLINDERCELLRECO_H
0005 
0006 #include <phparameter/PHParameterContainerInterface.h>
0007 
0008 #include <fun4all/SubsysReco.h>
0009 
0010 #include <map>
0011 #include <set>
0012 #include <string>
0013 #include <utility>  // for pair
0014 
0015 class PHCompositeNode;
0016 class PHG4Cell;
0017 
0018 class PHG4CylinderCellReco : public SubsysReco, public PHParameterContainerInterface
0019 {
0020  public:
0021   explicit PHG4CylinderCellReco(const std::string &name = "CYLINDERRECO");
0022 
0023   ~PHG4CylinderCellReco() override {}
0024 
0025   //! module initialization
0026   int InitRun(PHCompositeNode *topNode) override;
0027 
0028   //! event processing
0029   int process_event(PHCompositeNode *topNode) override;
0030 
0031   int ResetEvent(PHCompositeNode *topNode) override;
0032 
0033   // cppcheck-suppress virtualCallInConstructor
0034   void SetDefaultParameters() override;
0035 
0036   void Detector(const std::string &d);
0037   void cellsize(const int i, const double sr, const double sz);
0038   void etaphisize(const int i, const double deltaeta, const double deltaphi);
0039   void checkenergy(const int i = 1) { chkenergyconservation = i; }
0040   void OutputDetector(const std::string &d) { outdetector = d; }
0041 
0042   double get_timing_window_min(const int i) { return tmin_max[i].first; }
0043   double get_timing_window_max(const int i) { return tmin_max[i].second; }
0044   void set_timing_window(const int detid, const double tmin, const double tmax);
0045 
0046  protected:
0047   void set_size(const int i, const double sizeA, const double sizeB);
0048   int CheckEnergy(PHCompositeNode *topNode);
0049 
0050   std::map<int, int> binning;
0051   std::map<int, std::pair<double, double>> cell_size;  // cell size in phi/z
0052   std::map<int, std::pair<double, double>> zmin_max;   // zmin/zmax for each layer for faster lookup
0053   std::map<int, double> phistep;
0054   std::map<int, double> etastep;
0055   std::set<int> implemented_detid;
0056   std::string detector;
0057   std::string outdetector;
0058   std::string hitnodename;
0059   std::string cellnodename;
0060   std::string geonodename;
0061   std::string seggeonodename;
0062   std::map<int, std::pair<int, int>> n_phi_z_bins;
0063   std::map<unsigned long long, PHG4Cell *> cellptmap;  // This map holds the hit cells
0064   std::map<unsigned long long, PHG4Cell *>::iterator it;
0065   std::map<int, std::pair<double, double>> tmin_max;
0066   std::map<int, double> m_DeltaTMap;
0067 
0068   int nbins[2]{};
0069   int chkenergyconservation{0};
0070 
0071   double sum_energy_before_cuts{0.};
0072   double sum_energy_g4hit{0.};
0073 };
0074 
0075 #endif