Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JEventProcessor_ST_ZEff.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: JEventProcessor_ST_ZEff.h
4 // Created: Wed Aug 26 17:18:47 EDT 2015
5 // Creator: mkamel (on Linux ifarm1102 2.6.32-431.el6.x86_64 x86_64)
6 //
7 
8 #ifndef _JEventProcessor_ST_ZEff_
9 #define _JEventProcessor_ST_ZEff_
10 // Routine used to create our JEventProcessor
11 #include <JANA/JApplication.h>
12 #include <JANA/JFactory.h>
13 #include <JANA/JEventProcessor.h>
14 // ST header files
15 #include "START_COUNTER/DSCHit.h"
17 // PID libraries
18 #include "PID/DParticleID.h"
19 #include "PID/DChargedTrack.h"
20 #include <PID/DDetectorMatches.h>
21 #include <TRACKING/DTrackFitter.h>
22 //#include <PID/DDetectorMatches.h>
23 // RF libraries
24 #include <RF/DRFTDCDigiTime.h>
25 #include <RF/DRFTime_factory.h>
26 // Tracking libraries
28 // TOF libraries
29 #include <TOF/DTOFHit.h>
30 #include <BCAL/DBCALHit.h>
31 // ROOT header files
32 #include <TDirectory.h>
33 #include <TH1.h>
34 #include <TH2.h>
35 #include "TF1.h"
36 #include "TH1D.h"
37 #include "TGraph.h"
38 // C++ header files
39 #include <stdint.h>
40 #include <vector>
41 #include <stdio.h>
42 #include "TObjArray.h"
43 #include "TMath.h"
44 //using std::vector;
45 //using std::string;
46 // Define some constants
47 const double RAD2DEG = 57.29577951; // Convert radians to degrees
48 const uint32_t NCHANNELS = 30; // number of scintillator paddles
49 const uint32_t Nof_ss_intervals = 8;
50 const uint32_t Nof_bs_intervals = 4;
51 const uint32_t Nof_ns_intervals = 8;
52 // Declare 1D tracking histos
53 static TH1D *h_z_v;
54 static TH1D *h_fom;
55 static TH1D *h_N_Hit_in_track;
56 static TH1D *h1_qVectorSize;
57 static TH1D *h1_qVectorSize_ACuts;
58 
59 static TH1D *h1_RFtime;
60 static TH1D *h1_Centered_RFtime;
61 static TH1D *h1_SC_ShiftedTime;
62 static TH1D *h1_tDiff;
63 
67 
71 
75 
79  static TH1D *h1_st_pred_id;
80  // Declare 2D tracking histos
81 
82 static TH2I *h2_z_vs_r;
83 static TH2I *h2_x_vs_y;
84 
85 
86 
87 
88 
89 
90 class JEventProcessor_ST_ZEff:public jana::JEventProcessor{
91  public:
94  const char* className(void){return "JEventProcessor_ST_ZEff";}
95 
96  private:
97  jerror_t init(void); ///< Called once at program start.
98  jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
99  jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber); ///< Called every event.
100  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
101  jerror_t fini(void); ///< Called after last event of last event source has been processed.
102 
104  double z_target_center; // Target center along z
106  vector<vector<DVector3> >sc_pos; // SC geometry vector
107  vector<vector<DVector3> >sc_norm;
112 
113 
116  /*
117  // Grab match track detector parameters
118  uint32_t N_trck_prd_All[NCHANNELS];
119  uint32_t N_recd_hit_All[NCHANNELS];
120  uint32_t N_trck_prd_ss[NCHANNELS];
121  uint32_t N_recd_hit_ss[NCHANNELS];
122  uint32_t N_trck_prd_bs[NCHANNELS];
123  uint32_t N_recd_hit_bs[NCHANNELS];
124  uint32_t N_trck_prd_ns[NCHANNELS];
125  uint32_t N_recd_hit_ns[NCHANNELS];
126  uint32_t N_recd_hit_All_nearby_plus[NCHANNELS];
127  uint32_t N_recd_hit_All_nearby_minus[NCHANNELS];
128  uint32_t N_recd_hit_All_nearby[NCHANNELS];
129  uint32_t N_trck_prd_z_ss [Nof_ss_intervals][NCHANNELS];
130  uint32_t N_recd_hit_z_ss [Nof_ss_intervals][NCHANNELS];
131  uint32_t N_trck_prd_z_bs [Nof_bs_intervals][NCHANNELS];
132  uint32_t N_recd_hit_z_bs [Nof_bs_intervals][NCHANNELS];
133  uint32_t N_trck_prd_z_ns [Nof_ns_intervals][NCHANNELS];
134  uint32_t N_recd_hit_z_ns [Nof_ns_intervals][NCHANNELS];
135  DSCHitMatchParams locSCHitMatchParams; // SC
136  double z_ss[Nof_ss_intervals],z_bs[Nof_bs_intervals],z_ns[Nof_ss_intervals];
137  double theta_ss_max_left[Nof_ss_intervals];
138  double theta_ss_max_right[Nof_ss_intervals];
139  double theta_ss_min_left[Nof_ss_intervals];
140  double theta_ss_min_right[Nof_ss_intervals];
141  double smallest_ss_left[Nof_ss_intervals];
142  double theta_ss_small[Nof_ss_intervals];
143  double theta_ss_large[Nof_ss_intervals];
144 
145  double theta_bs_max_left[Nof_bs_intervals];
146  double theta_bs_max_right[Nof_bs_intervals];
147  double theta_bs_min_left[Nof_bs_intervals];
148  double theta_bs_min_right[Nof_bs_intervals];
149  double smallest_bs_left[Nof_bs_intervals];
150  double theta_bs_small[Nof_bs_intervals];
151  double theta_bs_large[Nof_bs_intervals];
152 
153  double theta_ns_max_left[Nof_ns_intervals];
154  double theta_ns_max_right[Nof_ns_intervals];
155  double theta_ns_min_left[Nof_ns_intervals];
156  double theta_ns_min_right[Nof_ns_intervals];
157  double smallest_ns_left[Nof_ns_intervals];
158  double theta_ns_small[Nof_ns_intervals];
159  double theta_ns_large[Nof_ns_intervals];
160  bool theta_momentum_cut_ss[Nof_ss_intervals];
161  bool theta_momentum_cut_bs[Nof_bs_intervals];
162  double locSCrIntersection;
163  int sc_index;
164  DVector3 locProjPos;
165  // Declare a vector which quantizes the point of the intersection of a charged particle
166  // with a plane in the middle of the scintillator
167  DVector3 IntersectionPoint;
168  // Declare a vector which quantizes the unit vector of the charged particle track traversing
169  // through the scintillator with its origin at the intersection point
170  DVector3 IntersectionDir;
171  // Grab the paramteres associated to a track matched to the ST
172  vector<DSCHitMatchParams> st_params;
173  bool foundSC;
174  bool sc_match, sc_match_pid;
175  bool Barrel;
176  */
177 
179 
180  vector<vector<double> >propagation_time_corr;
181  vector<vector<double> >PTC_Boundary;
182 };
183 
184 #endif // _JEventProcessor_ST_ZEff_
185 
static TH1D * h_N_trck_prd_z_ns_eff[Nof_ns_intervals]
static TH1D * h_N_recd_hit_z_bs[Nof_bs_intervals]
vector< vector< DVector3 > > sc_pos
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
vector< vector< double > > PTC_Boundary
static TH2I * h2_x_vs_y
static TH1D * h_N_recd_hit_z_ss[Nof_ss_intervals]
static TH1D * h_N_trck_prd_z_bs_eff[Nof_bs_intervals]
const Int_t NCHANNELS
static TH1D * h_z_v
const uint32_t Nof_ss_intervals
jerror_t fini(void)
Called after last event of last event source has been processed.
static TH1D * h1_RFtime
static TH1D * h_N_Hit_in_track
static TH1D * h1_qVectorSize
static TH1D * h_N_trck_prd_z_ss[Nof_ss_intervals]
static TH1D * h1_qVectorSize_ACuts
static TH2I * h2_z_vs_r
static TH1D * h_N_recd_hit_z_ss_ACC[Nof_ss_intervals]
double z_ns[Nof_ss_intervals]
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
static TH1D * h_N_trck_prd_z_ns[Nof_ns_intervals]
vector< vector< double > > propagation_time_corr
const double RAD2DEG
static TH1D * h1_Centered_RFtime
vector< vector< DVector3 > > sc_norm
static TH1D * h_N_trck_prd_z_bs[Nof_bs_intervals]
static TH1D * h_N_recd_hit_z_ns[Nof_ns_intervals]
const uint32_t Nof_ns_intervals
double z_bs[Nof_bs_intervals]
double z_ss[Nof_ss_intervals]
static TH1D * h_fom
static TH1D * h_N_recd_hit_z_bs_ACC[Nof_bs_intervals]
static TH1D * h1_tDiff
jerror_t init(void)
Called once at program start.
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
static TH1D * h_N_recd_hit_z_ns_ACC[Nof_ns_intervals]
static TH1D * h1_SC_ShiftedTime
static TH1D * h1_st_pred_id
const uint32_t Nof_bs_intervals
static TH1D * h_N_trck_prd_z_ss_eff[Nof_ss_intervals]