Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PHG4CylinderCellReco.h
Go to the documentation of this file.
1 #ifndef PHG4CYLINDERCELLRECO_H
2 #define PHG4CYLINDERCELLRECO_H
3 
4 
6 
7 #include <fun4all/SubsysReco.h>
8 #include <phool/PHTimeServer.h>
9 
10 #include <map>
11 #include <set>
12 #include <string>
13 
14 class PHCompositeNode;
15 class PHG4Cell;
16 
18 {
19  public:
20 
21  explicit PHG4CylinderCellReco(const std::string &name = "CYLINDERRECO");
22 
24 
26  int InitRun(PHCompositeNode *topNode);
27 
29  int process_event(PHCompositeNode *topNode);
30 
31  int ResetEvent(PHCompositeNode *topNode);
32 
33  void SetDefaultParameters();
34 
35  void Detector(const std::string &d);
36  void cellsize(const int i, const double sr, const double sz);
37  void etaphisize(const int i, const double deltaeta, const double deltaphi);
38  void checkenergy(const int i=1) {chkenergyconservation = i;}
39  void OutputDetector(const std::string &d) {outdetector = d;}
40 
41  double get_timing_window_min(const int i) {return tmin_max[i].first;}
42  double get_timing_window_max(const int i) {return tmin_max[i].second;}
43  void set_timing_window(const int detid, const double tmin, const double tmax);
44 
45  protected:
46  void set_size(const int i, const double sizeA, const double sizeB);
47  int CheckEnergy(PHCompositeNode *topNode);
48  static std::pair<double, double> get_etaphi(const double x, const double y, const double z);
49  static double get_eta(const double radius, const double z);
50  bool lines_intersect( double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy, double* rx, double* ry);
51  bool line_and_rectangle_intersect( double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy, double* rr);
52 
53  std::map<int, int> binning;
54  std::map<int, std::pair <double,double> > cell_size; // cell size in phi/z
55  std::map<int, std::pair <double,double> > zmin_max; // zmin/zmax for each layer for faster lookup
56  std::map<int, double> phistep;
57  std::map<int, double> etastep;
58  std::set<int> implemented_detid;
59  std::string detector;
60  std::string outdetector;
61  std::string hitnodename;
62  std::string cellnodename;
63  std::string geonodename;
64  std::string seggeonodename;
65  std::map<int, std::pair<int, int> > n_phi_z_bins;
66  std::map<unsigned long long, PHG4Cell*> cellptmap; // This map holds the hit cells
67  std::map<unsigned long long, PHG4Cell*>::iterator it;
68  std::map<int, std::pair<double,double> > tmin_max;
69 
71  int nbins[2];
73 
76 };
77 
78 #endif
std::map< unsigned long long, PHG4Cell * > cellptmap
void Detector(const std::string &d)
int ResetEvent(PHCompositeNode *topNode)
Clean up after each event.
std::map< int, std::pair< double, double > > cell_size
double get_timing_window_min(const int i)
PHTimeServer::timer _timer
void OutputDetector(const std::string &d)
std::map< int, std::pair< double, double > > zmin_max
PHG4CylinderCellReco(const std::string &name="CYLINDERRECO")
static double get_eta(const double radius, const double z)
std::map< int, double > etastep
std::map< unsigned long long, PHG4Cell * >::iterator it
void set_size(const int i, const double sizeA, const double sizeB)
static std::pair< double, double > get_etaphi(const double x, const double y, const double z)
int InitRun(PHCompositeNode *topNode)
module initialization
void checkenergy(const int i=1)
bool lines_intersect(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy, double *rx, double *ry)
std::map< int, int > binning
std::map< int, std::pair< double, double > > tmin_max
std::map< int, std::pair< int, int > > n_phi_z_bins
double get_timing_window_max(const int i)
void etaphisize(const int i, const double deltaeta, const double deltaphi)
void set_timing_window(const int detid, const double tmin, const double tmax)
bool line_and_rectangle_intersect(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy, double *rr)
void cellsize(const int i, const double sr, const double sz)
std::map< int, double > phistep
int process_event(PHCompositeNode *topNode)
event processing
int CheckEnergy(PHCompositeNode *topNode)
std::set< int > implemented_detid
PHTimer server for accessing external information.
wrapper around PHTimer, for storage in a map
Definition: PHTimeServer.h:34