Loading [MathJax]/extensions/tex2jax.js
|
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include "GaudiKernel/SystemOfUnits.h"
14 using namespace Gaudi::Units;
22 m_theEventInfo(
"TBEventInfo")
46 ATH_MSG_ERROR (
"Pcode should be in jO, if not PrimaryTrackOnly !" );
47 return StatusCode::FAILURE;
51 ATH_MSG_INFO (
"LArTBH6BeamInfo initialisation completed" );
52 return StatusCode::SUCCESS;
62 CLHEP::Hep3Vector
pos;
82 if(hit->GetSC() > 0)
continue;
84 if(hit->GetTrackID() != 1)
continue;
86 if(hit->GetPcode() !=
m_pcode)
continue;
90 v_x.push_back(
pos.x());
91 v_xz.push_back(
pos.z()+21600.*
mm);
94 v_y.push_back(
pos.y());
95 v_yz.push_back(
pos.z()+21600.*
mm);
102 if(v_x.size() < 2 || v_y.size() < 2) {
103 ATH_MSG_DEBUG (
"Could not fit, setting zero. "<<v_x.size()<<
"/"<<v_y.size() );
104 m_track = std::make_unique<TBTrack>(0,0);
116 return StatusCode::FAILURE;
121 std::vector<double> residual_x, residual_y;
128 check =
fitVect(v_x, v_xz, v_ex, a1_x, a2_x, chi2_x, residual_x);
132 return StatusCode::FAILURE;
135 check =
fitVect(v_y, v_yz, v_ey, a1_y, a2_y, chi2_y, residual_y);
138 return StatusCode::FAILURE;
146 m_track = std::make_unique<TBTrack>(v_x.size(), v_y.size());
154 for(
size_t i = 0;
i < v_x.size(); ++
i){
159 for(
size_t i = 0;
i < v_y.size(); ++
i){
175 return StatusCode::SUCCESS;
185 return StatusCode::SUCCESS;
214 int hitNum =
vec.size();
215 for(
i = 0;
i < hitNum; ++
i){
221 s += 1 / (vec_e[
i]*vec_e[
i]);
222 su +=
vec[
i] / (vec_e[
i]*vec_e[
i]);
223 sww += vec_z[
i]*vec_z[
i] / (vec_e[
i]*vec_e[
i]);
224 sw += vec_z[
i] / (vec_e[
i]*vec_e[
i]);
225 suw +=
vec[
i]*vec_z[
i] / (vec_e[
i]*vec_e[
i]);
228 const double denom = (
s*sww-sw*sw);
234 const double inv_denom = 1. /
denom;
235 a1 = (su*sww - sw*suw) * inv_denom;
236 a2 = (
s*suw - su*sw) * inv_denom;
237 ATH_MSG_DEBUG (
"Fit results:" <<
" intercept = " << a1 <<
" and slope = " << a2 );
241 for (
i = 0;
i < hitNum; ++
i) {
246 for(
i = 0;
i < hitNum; ++
i){
247 chi2 += (
vec[
i] - a1 - a2*vec_z[
i])*(
vec[
i] - a1 - a2*vec_z[
i])/(vec_e[
i]*vec_e[
i]);
void setChi2_v(double chi2v)
void setVslope(double vslope)
SG::ReadHandle< TBEventInfo > m_theEventInfo
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
void setVintercept(double vintercept)
LArTBH6BeamInfo(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteHandle< TBTrack > m_track
void setCryoHitv(float cryov)
void setCryoHitu(float cryou)
std::vector< size_t > vec
void setUslope(double uslope)
bool fitVect(const dVect &vec_x, const dVect &vec_xz, const dVect &vec_ex, double &a1, double &a2, double &chi2, dVect &residual)
Fit data to the function u = a1 + a2*w.
std::vector< double > dVect
void setUintercept(double uintercept)
::StatusCode StatusCode
StatusCode definition for legacy code.
double chi2(TH1 *h0, TH1 *h1)
void setCryoHitw(float cryow)
void setResidualv(int ind, double residualv)
std::vector< std::string > m_HitsCollNames
void setChi2_u(double chi2u)
void setResidualu(int ind, double residualu)
std::vector< SG::ReadHandle< AthenaHitsVector< LArG4H6FrontHit > > > m_hitcoll
virtual ~LArTBH6BeamInfo()