Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-07-16 08:12:45

0001 #ifndef INTT_CALO_TRKRECO_H
0002 #define INTT_CALO_TRKRECO_H
0003 
0004 //#include <vector>
0005 
0006 void INTT_Calo_trkReco_Init(void);
0007 void INTT_Calo_trkReco_End(void);
0008 void INTT_Calo_trkReco(void);
0009 
0010 bool Is_Hot_Emc(int iemc);
0011 float rz2eta(float r, float z);
0012 
0013 void LoadTrackerData(void);
0014 
0015 void Connect_Topo_and_Emc(void);
0016 
0017 void CalcCircle2(float x1,float y1,float x0, float y0, float &r, float &xc, float &yc);
0018 
0019 void CalcCircle(double x0, double y0, double x1,double y1, double x2, double y2,
0020         float &rs, float &xsc, float &ysc);
0021 
0022 float Calc_Remc(float xe, float ye, float x1,float y1, float x2, float y2,
0023         float xc, float yc);
0024 
0025 struct InttPair;
0026 void FindInttPair(void);
0027 void RemoveDuplicatedPair(InttPair &pair_i,InttPair &pair_j);
0028 void PrintInttPair(void);
0029 
0030 void FindCaloIntt(void);
0031 
0032 void FindInttMvtx(void);
0033 
0034 int FindMvtxHit(int layer, float rIntt, float xc, float yc,
0035         float zvtx, float r0, float r1, float z0, float z1,
0036         vector<int> &vMvtxHit);
0037 
0038 void FormInttMvtxTrk(float r0, float phi0, float z0,float r1, float phi1,float z1,
0039              int iMvtx0,int iMvtx1,int iMvtx2,
0040              float &r_intt_mvtx, float &xc_intt_mvtx, float &yc_intt_mvtx,
0041              float& zvtx_intt_mvtx,
0042              float &x0m, float &y0m, float &z0m, float &pt0m,float& phi0m, float &pz0m);
0043 
0044 void FormInttMvtxTrk(float r0, float phi0, float z0,float r1, float phi1,float z1,
0045              vector<int> &vMvtx0Hit, vector<int> &vMvtx1Hit,vector<int> &vMvtx2Hit,
0046              int &iMvtx0, int &iMvtx1, int &iMvtx2,
0047              float &r_intt_mvtx, float &xc_intt_mvtx, float &yc_intt_mvtx,
0048              float& zvtx_intt_mvtx,
0049              float &x0m, float &y0m, float &z0m, float &pt0m,float& phi0m, float &pz0m);
0050 
0051 void FormInttMvtxTrk1(float x0, float y0, float z0,float x1, float y1,float z1,
0052               vector<int> &vMvtxHit,
0053               vector<float> &vMvtx_r, vector<float> &vMvtx_phi, vector<float> &vMvtx_z,
0054               int &iMvtxHit,
0055               float &r_intt_mvtx, float &xc_intt_mvtx, float &yc_intt_mvtx,
0056               float& zvtx_intt_mvtx,
0057               float &x0m, float &y0m, float &z0m, float &pt0m,float& phi0m, float &pz0m);
0058 
0059 void FormInttMvtxTrk2(float x0, float y0, float z0,float x1, float y1,float z1,
0060               vector<int> &vMvtxHit_I, vector<int> &vMvtxHit_O,
0061               vector<float> &vMvtxI_r, vector<float> &vMvtxI_phi, vector<float> &vMvtxI_z,
0062               vector<float> &vMvtxO_r, vector<float> &vMvtxO_phi, vector<float> &vMvtxO_z,
0063               int &iMvtx_I, int &iMvtx_O,
0064               float &r_intt_mvtx, float &xc_intt_mvtx, float &yc_intt_mvtx,
0065               float& zvtx_intt_mvtx,
0066               float &x0m, float &y0m, float &z0m, float &pt0m,float& phi0m, float &pz0m);
0067 
0068 void FormInttMvtxTrk3(float x0, float y0, float z0,float x1, float y1,float z1,
0069               vector<int> &vMvtx0Hit, vector<int> &vMvtx1Hit,vector<int> &vMvtx2Hit,
0070               int &iMvtx0, int &iMvtx1, int &iMvtx2,
0071               float &r_intt_mvtx, float &xc_intt_mvtx, float &yc_intt_mvtx,
0072               float& zvtx_intt_mvtx,
0073               float &x0m, float &y0m, float &z0m, float &pt0m,float& phi0m, float &pz0m);
0074 
0075 int SelectBestMvtxHit(vector<int> &vMvtxhit, vector<float> &vMvtx_dr,
0076               vector<float> &vMvtx_dz0, vector<float> &vMvtx_dz1);
0077 
0078 void FindCaloInttMvtx(void);
0079 
0080 int SelectBestTopHit(vector<int>& vTop_near_trk);
0081 
0082 // structs, vectors, variables, and constants for EMC-INTT-Mvtx tracking
0083 //
0084 
0085 float xBC=0;     //x of Beam Center
0086 float yBC=0;     //y of Beam Center
0087 float gzvtx;     //Global zvtx;
0088 
0089 const float R_Emc = 103.5;
0090 const float Top_E_min = 0.2; //Minimun Calo energy [GeV].
0091 
0092 struct InttPair {
0093   int iINTT0;  //index of vINTT0r, vINTT0phi, vINTT0z
0094   int iINTT1;  //index of vINTT1r, vINTT1phi, vINTT1z
0095   float r;     // the radius of the circle of (INTT1,INTT0,BC)
0096   float xc;    // x of the center of the circle
0097   float yc;    // y of the center of the circle
0098   float z;     // z of INTT0;
0099   float zvtx;  // zvtx projection from INTT1 and INTT0
0100 };
0101 
0102 vector<InttPair>     vInttPair;
0103 
0104 struct CaloInttMvtx {
0105   int iTop;       //index in vTop_r, vTop_phi, vTop_z etc (best)
0106   int iINTT0;     //index in vINTT0r, vINTT0phi, vINTT0z
0107   int iINTT1;     //index in vINTT1r, vINTT1phi, vINTT1z
0108   int iMvtx0;     //index in vMvtx0r, vMvtx0phi, vMvtx0z (best)
0109   int iMvtx1;     //index in vMvtx1r, vMvtx1phi, vMvtx1z (best)
0110   int iMvtx2;     //index in vMvtx2r, vMvtx2phi, vMvtx2z (best)
0111 
0112   int sign;       // charge sign
0113 
0114   float r_intt;   // The radius of the circle of (INTT1,INTT0,BC)
0115   float xc_intt;  // The center of the circle of (INTT1,INTT0,BC)
0116   float yc_intt;  //
0117   float z_intt;   // z of intt tracklet. z of INTT0.
0118   float zvtx_intt;//
0119   
0120   float r_emc_intt;  //The radius of the circle of (EMC-INTT1-INTT0)
0121   float xc_emc_intt; //The center of the circle
0122   float yc_emc_intt;
0123   float z_emc_intt;
0124   float zvtx_emc_intt;// zvtxt projection of the EMC-INTT tracklet
0125 
0126   float r_intt_mvtx;
0127   float xc_intt_mvtx;
0128   float yc_intt_mvtx;
0129   float zvtx_intt_mvtx;
0130 
0131   // Emc cluser center
0132   float xemc;
0133   float yemc;
0134   float zemc;
0135   
0136   // energy of EMC/HCAL cluster pointed to by this track
0137   float total_e;   //total_e=emcal_e+ihcal_e+ohcal_e
0138   float emcal_e;   //emcal part of topo cluster energy
0139   float ihcal_e;   //ihcal part of topo cluster energy
0140   float ohcal_e;   //ohcal part of topo cluster energy
0141   float emc_e;     //energy of emcal cluster associated with topocluster
0142 
0143   // eID parameter
0144   float BDT_e;     // BDT socre for electron ID
0145   
0146   // EMC-INTT based track information.
0147   float x0e;    // (x0,y0,z0) of the track starting point
0148   float y0e;
0149   float z0e;
0150   float pt0e;   // (pt0, pt0, pz0) at (x0,y0,z0);
0151   float phi0e;
0152   float pz0e;
0153 
0154   // Mvtx-INTT based track information.
0155   float x0m;    // (x0,y0,z0) of the track starting point
0156   float y0m;
0157   float z0m;
0158   float pt0m;   // (pt0, pt0, pz0) at (x0,y0,z0);
0159   float phi0m;
0160   float pz0m;
0161 };
0162 
0163 vector<CaloInttMvtx> vCaloInttMvtx;
0164 CaloInttMvtx a_CaloInttMvtx;
0165 
0166 
0167 // Emc clusters
0168 vector<float> vEmc_r;
0169 vector<float> vEmc_phi;
0170 vector<float> vEmc_eta;
0171 vector<float> vEmc_z;
0172 vector<float> vEmc_e;
0173 
0174 // TopoClusters
0175 vector<float> vTop_r;
0176 vector<float> vTop_phi;
0177 vector<float> vTop_eta;
0178 vector<float> vTop_z;
0179 vector<float> vTop_e;
0180 vector<float> vTop_emc_e;
0181 vector<float> vTop_ihc_e;
0182 vector<float> vTop_ohc_e;
0183 
0184 // Emc Cluster info associated with TopCluster
0185 vector<float> vTop_emc_r;
0186 vector<float> vTop_emc_phi;
0187 vector<float> vTop_emc_eta;
0188 vector<float> vTop_emc_z;
0189 vector<float> vTop_emc_emc_e;
0190 
0191 // INTT0 and INTT1 clusters
0192 vector<float> vINTT0r;
0193 vector<float> vINTT0phi;
0194 vector<float> vINTT0z;
0195 vector<float> vINTT0t;
0196 
0197 vector<float> vINTT1r;
0198 vector<float> vINTT1phi;
0199 vector<float> vINTT1z;
0200 vector<float> vINTT1t;
0201 
0202 // Mvtx0, Mvtx1, Mvtx2 clusters
0203 vector<float> vMvtx0r;
0204 vector<float> vMvtx0phi;
0205 vector<float> vMvtx0z;
0206 vector<float> vMvtx0t;
0207 
0208 vector<float> vMvtx1r;
0209 vector<float> vMvtx1phi;
0210 vector<float> vMvtx1z;
0211 vector<float> vMvtx1t;
0212 
0213 vector<float> vMvtx2r;
0214 vector<float> vMvtx2phi;
0215 vector<float> vMvtx2z;
0216 vector<float> vMvtx2t;
0217 
0218 //
0219 // Histograms to monitor/diagonize the program
0220 //
0221 //Histograms
0222 TH1F *hzgvtx;
0223 TH1F *hINTTdphi;
0224 TH1F *hINTTdZvtx;
0225 TH1F *hINTTdz0;
0226 TH1F *hINTTdz1;
0227 TH2F *hINTTdz0dz1;
0228 TH2F *hINTTdz0dz1r;
0229 TH1F *hINTTdz_r;
0230 TH1F *hInttPair_r;
0231 TH1F *hEmcIntt_dr;
0232 TH1F *hEmcIntt_dr_Zcut;
0233 TH1F *hEmcIntt_dr_Zvtx2;
0234 TH1F *hEmcIntt_dr_Zvtx4;
0235 TH1F *hEmcIntt_dr_Zvtx5;
0236 TH1F *hdZe1;
0237 TH1F *hdZe0;
0238 TH1F *hTopEmc_dphi;
0239 TH1F *hTopEmc_deta;
0240 TH1F *hTopEmc_dphi_1;
0241 TH1F *hTopEmc_dphi_2;
0242 TH1F *hTopEmc_dphi_3;
0243 TH1F *hTopEmc_deta_1;
0244 TH1F *hTopEmc_deta_2;
0245 TH1F *hTopEmc_deta_3;
0246 
0247 TH1F *hZvtxTrk;
0248 TH1F *hZvtxTrk2;
0249 TH1F *hZvtxTrk3;
0250 TH1F *hZvtxTrk4;
0251 TH1F *hdZvtxTrk;
0252 TH1F *hdZvtxTrk2;
0253 TH1F *hdZvtxTrk3;
0254 TH1F *hdZvtxTrk4;
0255 TH1F *hTopE;
0256 TH1F *hp_Trk;
0257 TH1F *hptTrk;
0258 TH1F *hTopE_p;
0259 TH1F *hEmcE_p;
0260 TH1F *hTopE_p_Zvtx;
0261 TH1F *hEmcE_p_Zvtx;
0262 
0263 TH1F *hrIntt_rsEmc;
0264 TH1F *hrIntt_rsEmc2;
0265 TH1F *hrIntt_rsEmc3;
0266 
0267 TH1F *hMvtx0_dr;
0268 TH1F *hMvtx1_dr;
0269 TH1F *hMvtx2_dr;
0270 TH1F *hMvtx0_dz0;
0271 TH1F *hMvtx0_dz1;
0272 TH1F *hMvtx1_dz0;
0273 TH1F *hMvtx1_dz1;
0274 TH1F *hMvtx2_dz0;
0275 TH1F *hMvtx2_dz1;
0276 TH1F *hMvtx0_dr2;
0277 TH1F *hMvtx1_dr2;
0278 TH1F *hMvtx2_dr2;
0279 
0280 TH1F *hdphi_ij;
0281 TH1F *hdzvtx_ij;
0282 TH1F *hdphi_ij2;
0283 #endif