Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:15

0001 #include "SvtxTrackInfo_v3.h"
0002 #include "TrackStateInfo_v1.h"
0003 
0004 /**
0005  * SvtxTrackInfo_v3 is a class developed to hold the information from the track
0006  * projection from the outermost TPC surface to the calorimeters
0007  **/
0008 
0009 void SvtxTrackInfo_v3::CopyFrom(const SvtxTrackInfo& source)
0010 {
0011   set_track_id(source.get_track_id());
0012   set_subsurfkey(source.get_subsurfkey());
0013   set_chisq(source.get_chisq());
0014   set_ndf(source.get_ndf());
0015   set_hitbitmap(source.get_hitbitmap());
0016   set_crossing(source.get_crossing());
0017 
0018   set_x(STATE::VERTEX, source.get_x());
0019   set_y(STATE::VERTEX, source.get_y());
0020   set_z(STATE::VERTEX, source.get_z());
0021   set_phi(STATE::VERTEX, source.get_phi());
0022   set_theta(STATE::VERTEX, source.get_theta());
0023   set_qOp(STATE::VERTEX, source.get_qOp());
0024 
0025   for (int istate = STATE::OUTER_TPC; istate <= STATE::HCALOUT_BACKFACE; istate++)
0026   {
0027     set_x(istate, source.get_x(istate));
0028     set_y(istate, source.get_y(istate));
0029     set_z(istate, source.get_z(istate));
0030     set_phi(istate, source.get_phi(istate));
0031     set_theta(istate, source.get_theta(istate));
0032     set_qOp(istate, source.get_qOp(istate));
0033 
0034     for (int i = 0; i < 5; i++)
0035     {
0036       for (int j = i; j < 5; j++)
0037       {
0038         set_covariance(istate, i, j, source.get_covariance(istate, i, j));
0039       }
0040     }
0041   }
0042 
0043   if (std::isnan(source.get_phi_outer_tpc()) || std::isnan(source.get_theta_outer_tpc()) || std::isnan(source.get_qOp_outer_tpc()))
0044   {
0045     return;
0046   }
0047 
0048   set_x(STATE::OUTER_TPC, source.get_x_outer_tpc());
0049   set_y(STATE::OUTER_TPC, source.get_y_outer_tpc());
0050   set_z(STATE::OUTER_TPC, source.get_z_outer_tpc());
0051   set_phi(STATE::OUTER_TPC, source.get_phi_outer_tpc());
0052   set_theta(STATE::OUTER_TPC, source.get_theta_outer_tpc());
0053   set_qOp(STATE::OUTER_TPC, source.get_qOp_outer_tpc());
0054 
0055   for (int i = 0; i < 5; i++)
0056   {
0057     for (int j = i; j < 5; j++)
0058     {
0059       set_covariance(STATE::VERTEX, i, j, source.get_covariance(i, j));
0060       set_covariance(STATE::OUTER_TPC, i, j, source.get_covariance_outer_tpc(i, j));
0061     }
0062   }
0063 }
0064 
0065 SvtxTrackInfo_v3& SvtxTrackInfo_v3::operator=(const SvtxTrackInfo_v3& source)
0066 {
0067   if (this != &source)
0068   {
0069     CopyFrom(source);
0070   }
0071   return *this;
0072 }