00001 #ifndef __TMUIROADEVAL_H__ 00002 #define __TMUIROADEVAL_H__ 00003 00004 #include<TDataType.h> 00005 #include<PHException.h> 00006 #include<MUIOO.h> 00007 00009 00011 class TMuiRoadEval : public TObject 00012 { 00013 public: 00014 00016 00017 00018 TMuiRoadEval(); 00019 00021 virtual ~TMuiRoadEval(){;} 00022 00024 00026 00027 // getter 00028 // 00031 virtual UShort_t get_n_true_hits() const { 00032 // count number of bits set to get total number of true hits 00033 // 00034 UShort_t nhits = 0; 00035 int limit = MUIOO::MAX_PLANE * MUIOO::MAX_ORIENTATION; 00036 for (int i = 0; i<limit; i++){ 00037 nhits += (_n_true_hits & (1<<i)) >> i; 00038 } 00039 return nhits; 00040 } 00041 00042 virtual bool get_is_plane_true_hit(UShort_t iplane) const { 00043 return (_n_true_hits & 1 << iplane) != 0; 00044 } 00045 00046 virtual bool get_is_plane_masked_hit(UShort_t iplane) const { 00047 return (_n_masked_hits & 1 << iplane) != 0; 00048 } 00049 00050 virtual bool get_is_plane_reco_true_hit(UShort_t iplane) const { 00051 return (_n_reco_true_hits & 1 << iplane) != 0; 00052 } 00053 00054 virtual bool get_is_plane_reco_ghost_hit(UShort_t iplane) const { 00055 return (_n_reco_ghost_hits & 1 << iplane) != 0; 00056 } 00057 00058 virtual UShort_t get_panel_true_hits(int ipanel) const { 00059 // count number of bits set to get total number of true hits 00060 // 00061 UShort_t nhits = 0; 00062 int limit = MUIOO::MAX_ORIENTATION; 00063 for (int i = 0; i<limit; i++){ 00064 nhits += (_n_true_hits & (1<<(i + ipanel*limit))) >> (i + ipanel*limit); 00065 } 00066 return nhits; 00067 } 00068 00070 virtual UShort_t get_n_masked_hits() const { 00071 // count number of bits set to get total number of true hits 00072 // 00073 UShort_t nhits = 0; 00074 int limit = MUIOO::MAX_PLANE * MUIOO::MAX_ORIENTATION; 00075 for (int i = 0; i<limit; i++){ 00076 nhits += (_n_masked_hits & (1<<i)) >> i; 00077 } 00078 return nhits; 00079 } 00080 00082 virtual Float_t get_ratio_masked() const { 00083 return difference(get_n_true_hits(),get_n_masked_hits()); 00084 } 00085 00087 virtual UShort_t get_n_reco_true_hits() const { 00088 // count number of bits set to get total number of true hits 00089 UShort_t nhits=0; 00090 int limit = MUIOO::MAX_PLANE * MUIOO::MAX_ORIENTATION; 00091 for (int i = 0; i<limit; i++){ 00092 nhits += (_n_reco_true_hits & (1<<i)) >> i; 00093 } 00094 return nhits; 00095 } 00096 00097 virtual UShort_t get_panel_reco_true_hits(int ipanel) const { 00098 // count number of bits set to get total number of true hits 00099 // 00100 UShort_t nhits = 0; 00101 int limit = MUIOO::MAX_ORIENTATION; 00102 for (int i = 0; i<limit; i++){ 00103 nhits += (_n_reco_true_hits & (1<<(i + ipanel*limit))) >> (i + ipanel*limit); 00104 } 00105 return nhits; 00106 } 00107 00110 virtual UShort_t get_n_reco_ghost_hits() const { 00111 // count number of bits set to get total number of true hits 00112 UShort_t nhits=0; 00113 int limit = MUIOO::MAX_PLANE * MUIOO::MAX_ORIENTATION; 00114 for (int i = 0; i<limit; i++){ 00115 nhits += (_n_reco_ghost_hits & (1<<i)) >> i; 00116 } 00117 return nhits; 00118 } 00119 00121 virtual Float_t get_ratio_ghost() const { 00122 return difference(get_n_reco_true_hits(), get_n_reco_ghost_hits()); 00123 } 00124 00125 //setter 00126 // 00128 virtual void set_n_true_hits(UShort_t n_true_hits) { _n_true_hits = n_true_hits;} 00130 virtual void set_n_masked_hits(UShort_t n_masked_hits) { _n_masked_hits = n_masked_hits;} 00132 virtual void set_n_reco_true_hits(UShort_t n_reco_true_hits) { _n_reco_true_hits = n_reco_true_hits;} 00135 virtual void set_n_reco_ghost_hits(UShort_t n_reco_ghost_hits) { _n_reco_ghost_hits = n_reco_ghost_hits;} 00136 00138 00140 00141 //getter 00142 // 00144 virtual Float_t get_px_true_vx() const { return _px_true_vx;} 00146 virtual Float_t get_py_true_vx() const { return _py_true_vx;} 00148 virtual Float_t get_pz_true_vx() const { return _pz_true_vx;} 00150 virtual Float_t get_ptot_true_vx() const { return _ptot_true_vx;} 00151 00152 //setter 00153 // 00155 virtual void set_px_true_vx(Float_t px_true) { _px_true_vx = px_true;} 00157 virtual void set_py_true_vx(Float_t py_true) { _py_true_vx = py_true;} 00159 virtual void set_pz_true_vx(Float_t pz_true) { _pz_true_vx = pz_true;} 00161 virtual void set_ptot_true_vx(Float_t ptot_true) { _ptot_true_vx = ptot_true;} 00163 00164 00165 virtual void TMuiRoadEval::print(std::ostream& os = std::cout) const; 00167 00168 private: 00169 00170 virtual Float_t difference(Float_t a, Float_t b) const { 00171 if(a!=0) { 00172 return (b-a)/a; 00173 } else { 00174 return -999.0; 00175 } 00176 } 00177 00178 virtual Float_t difference(UShort_t a, UShort_t b) const { 00179 if(a!=0) { 00180 return (1.0*b)/(1.0*a); 00181 } else { 00182 return -999.0; 00183 } 00184 } 00185 00186 // Global evalution varibles. 00187 // 00188 UShort_t _n_true_hits; 00189 UShort_t _n_masked_hits; 00190 UShort_t _n_reco_true_hits; 00191 UShort_t _n_reco_ghost_hits; 00192 00193 // Momentum evaluation varibles at vertex. 00194 // 00195 Float_t _px_true_vx; 00196 Float_t _py_true_vx; 00197 Float_t _pz_true_vx; 00198 Float_t _ptot_true_vx; 00199 00200 ClassDef(TMuiRoadEval,1) 00201 }; 00202 00203 #endif /* __TMUIROADEVAL_H__ */