Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JEventProcessor_ST_online_efficiency.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: JEventProcessor_ST_online_efficiency.h
4 // Created: Wed Jan 20 10:35:58 EST 2016
5 // Creator: mkamel (on Linux ifarm1102 2.6.32-431.el6.x86_64 x86_64)
6 //
7 
8 #ifndef _JEventProcessor_ST_online_efficiency_
9 #define _JEventProcessor_ST_online_efficiency_
10 
11 #include <JANA/JEventProcessor.h>
12 #include <JANA/JApplication.h>
13 #include <JANA/JFactory.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 // Tracking libraries
25 // ROOT header files
26 #include <TDirectory.h>
27 #include <TH1.h>
28 #include <TH2.h>
29 #include "TF1.h"
30 #include "TH1D.h"
31 #include "TGraph.h"
32 // C++ header files
33 #include <stdint.h>
34 #include <vector>
35 #include <stdio.h>
36 #include "TObjArray.h"
37 #include "TMath.h"
38 // Define some constants
39 const double RAD2DEG = 57.29577951; // Convert radians to degrees
40 const uint32_t NCHANNELS = 30; // number of scintillator paddles
41 const uint32_t Nof_ss_intervals = 5;
42 const uint32_t Nof_bs_intervals = 3;
43 const uint32_t Nof_ns_intervals = 4;
44 // Declare 1D tracking histos
45 static TH1D *h_N_trck_prd_All;
46 static TH1D *h_N_recd_hit_All;
47 static TH1D *h_N_trck_prd_ss;
48 static TH1D *h_N_recd_hit_ss;
49 static TH1D *h_N_trck_prd_bs;
50 static TH1D *h_N_recd_hit_bs;
51 static TH1D *h_N_trck_prd_ns;
52 static TH1D *h_N_recd_hit_ns;
53 static TH1D *h_ST_Eff_All;
54 static TH1D *h_ST_Eff_ss;
55 static TH1D *h_ST_Eff_bs;
56 static TH1D *h_ST_Eff_ns;
57 
58 
59 // Declare detection efficency counters
71 
72 class JEventProcessor_ST_online_efficiency:public jana::JEventProcessor{
73  public:
76  const char* className(void){return "JEventProcessor_ST_online_efficiency";}
77 
78  private:
79  jerror_t init(void); ///< Called once at program start.
80  jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
81  jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber); ///< Called every event.
82  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
83  jerror_t fini(void); ///< Called after last event of last event source has been processed.
86  vector<vector<DVector3> >sc_pos; // SC geometry vector
87  vector<vector<DVector3> >sc_norm;
88  double z_target_center; // Target center along z
99 
107 
115 
120  int sc_index;
122  // Declare a vector which quantizes the point of the intersection of a charged particle
123  // with a plane in the middle of the scintillator
125  // Declare a vector which quantizes the unit vector of the charged particle track traversing
126  // through the scintillator with its origin at the intersection point
128  // Grab the paramteres associated to a track matched to the ST
129  vector<DSCHitMatchParams> st_params;
130  bool foundSC;
132  bool Barrel;
133 };
134 
135 #endif // _JEventProcessor_ST_online_efficiency_
136 
jerror_t fini(void)
Called after last event of last event source has been processed.
static TH1D * h_ST_Eff_ss
static TH1D * h_ST_Eff_All
static TH1D * h_N_trck_prd_ss
uint32_t N_recd_hit_All_nearby_plus[NCHANNELS]
uint32_t N_trck_prd_bs[NCHANNELS]
static TH1D * h_N_recd_hit_ns
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
TVector3 DVector3
Definition: DVector3.h:14
const Int_t NCHANNELS
const uint32_t Nof_ss_intervals
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
uint32_t N_recd_hit_bs[NCHANNELS]
static TH1D * h_ST_Eff_bs
static TH1D * h_N_recd_hit_ss
uint32_t N_recd_hit_ns[NCHANNELS]
static TH1D * h_N_trck_prd_All
uint32_t N_recd_hit_ss[NCHANNELS]
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
const double RAD2DEG
uint32_t N_trck_prd_ns[NCHANNELS]
uint32_t N_recd_hit_All_nearby_minus[NCHANNELS]
const uint32_t Nof_ns_intervals
uint32_t N_recd_hit_All[NCHANNELS]
jerror_t init(void)
Called once at program start.
uint32_t N_trck_prd_All[NCHANNELS]
static TH1D * h_N_recd_hit_bs
static TH1D * h_N_trck_prd_ns
static TH1D * h_ST_Eff_ns
uint32_t N_trck_prd_ss[NCHANNELS]
static TH1D * h_N_recd_hit_All
static TH1D * h_N_trck_prd_bs
uint32_t N_recd_hit_All_nearby[NCHANNELS]
const uint32_t Nof_bs_intervals