ATLAS Offline Software
TBPlaneTrackingAlgo.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TBREC_TBPLANETRACKINGALGO_H
6 #define TBREC_TBPLANETRACKINGALGO_H
7 
9 
10 #include "TBEvent/TBHitPlaneCont.h"
11 
12 #include <utility>
13 #include <vector>
14 
21  public:
22 
24  // Contructor & Destructor //
26  TBPlaneTrackingAlgo(const std::string& name, ISvcLocator* pSvcLocator);
27  virtual ~TBPlaneTrackingAlgo(){};
28 
29  // public methods //
30  virtual StatusCode initialize() override;
31  virtual StatusCode execute() override;
32  virtual StatusCode finalize() override;
33 
34  private:
35  void FillRandomHit();
37 
38 
39  // Private function members //
40 
45  bool fitPlane(const TBHitPlaneCont * hitPlaneCont, double &a1, double &a2,
46  double &chi2, std::vector<double> &residual);
47 
51  bool fitHits(const std::vector<double> & u, const std::vector<double> & w,
52  const std::vector<double> & eu, // const std::vector<double> & ew,
53  double &a1, double &a2);
54 
58  double getResidual(const double & u, const double & w,const double &a1,
59  const double &a2);
60 
64  double getChi2(const std::vector<double> &v_u,
65  const std::vector<double> &v_w,
66  const std::vector<double> &v_eu,
67 // const std::vector<double> &v_ew,
68  const double &a1, const double &a2);
69 
74 
75  //Used to test this algo set to true if you want to debug
76  bool m_testAlgo;
79 
80  // Positions of BPC needed to construct hits
83  std::vector<float> m_bpc_errmeasX,m_bpc_errmeasY;
84 
85  std::vector<std::string> m_bpc_names;
86 
87  // filename containing positions constants
88  std::string m_calib_filename;
89  unsigned int m_runnumber;
90 
91 };
92 
93 #endif
TBPlaneTrackingAlgo::m_bpc_errposZY
std::vector< float > m_bpc_errposZY
Definition: TBPlaneTrackingAlgo.h:82
TBPlaneTrackingAlgo::m_runnumber
unsigned int m_runnumber
Definition: TBPlaneTrackingAlgo.h:89
TBPlaneTrackingAlgo::m_bpc_errposZX
std::vector< float > m_bpc_errposZX
Definition: TBPlaneTrackingAlgo.h:82
ClusterSeg::residual
@ residual
Definition: ClusterNtuple.h:20
TBPlaneTrackingAlgo::m_bpc_posZY
std::vector< float > m_bpc_posZY
Definition: TBPlaneTrackingAlgo.h:81
TBPlaneTrackingAlgo::m_bpc_posX
std::vector< float > m_bpc_posX
Definition: TBPlaneTrackingAlgo.h:81
TBPlaneTrackingAlgo::execute
virtual StatusCode execute() override
Definition: TBPlaneTrackingAlgo.cxx:49
TBPlaneTrackingAlgo::getChi2
double getChi2(const std::vector< double > &v_u, const std::vector< double > &v_w, const std::vector< double > &v_eu, const double &a1, const double &a2)
Calculates the chi2 += ((u_i - a1 - a2*w_i)/eu)^2.
Definition: TBPlaneTrackingAlgo.cxx:291
TBPlaneTrackingAlgo::getnewcalib
StatusCode getnewcalib()
Definition: TBPlaneTrackingAlgo.cxx:415
TBPlaneTrackingAlgo::m_hitPlaneCont_v
TBHitPlaneCont m_hitPlaneCont_v
Definition: TBPlaneTrackingAlgo.h:78
TBPlaneTrackingAlgo::m_bpc_posY
std::vector< float > m_bpc_posY
Definition: TBPlaneTrackingAlgo.h:81
TBPlaneTrackingAlgo::getResidual
double getResidual(const double &u, const double &w, const double &a1, const double &a2)
Calculates the residual-> r = (u_i - a1 - a2*w_i)
Definition: TBPlaneTrackingAlgo.cxx:283
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
TBPlaneTrackingAlgo::m_testAlgo
bool m_testAlgo
Definition: TBPlaneTrackingAlgo.h:76
AthAlgorithm.h
TBPlaneTrackingAlgo::buildHits
StatusCode buildHits()
Build HitPlaneCont from BPC.
Definition: TBPlaneTrackingAlgo.cxx:355
TBPlaneTrackingAlgo::TBPlaneTrackingAlgo
TBPlaneTrackingAlgo(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TBPlaneTrackingAlgo.cxx:21
TBPlaneTrackingAlgo::~TBPlaneTrackingAlgo
virtual ~TBPlaneTrackingAlgo()
Definition: TBPlaneTrackingAlgo.h:27
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TBHitPlaneCont
Definition: TBHitPlaneCont.h:20
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
TBPlaneTrackingAlgo::fitPlane
bool fitPlane(const TBHitPlaneCont *hitPlaneCont, double &a1, double &a2, double &chi2, std::vector< double > &residual)
Fit data to the function u = a1 + a2*w.
Definition: TBPlaneTrackingAlgo.cxx:183
TBPlaneTrackingAlgo::m_bpc_names
std::vector< std::string > m_bpc_names
Definition: TBPlaneTrackingAlgo.h:85
AthAlgorithm
Definition: AthAlgorithm.h:47
TBHitPlaneCont.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TBPlaneTrackingAlgo::m_bpc_errposX
std::vector< float > m_bpc_errposX
Definition: TBPlaneTrackingAlgo.h:82
TBPlaneTrackingAlgo::initialize
virtual StatusCode initialize() override
Definition: TBPlaneTrackingAlgo.cxx:42
TBPlaneTrackingAlgo::finalize
virtual StatusCode finalize() override
Definition: TBPlaneTrackingAlgo.cxx:175
TBPlaneTrackingAlgo::m_bpc_errposY
std::vector< float > m_bpc_errposY
Definition: TBPlaneTrackingAlgo.h:82
TBPlaneTrackingAlgo::m_hitPlaneCont_u
TBHitPlaneCont m_hitPlaneCont_u
Definition: TBPlaneTrackingAlgo.h:77
TBPlaneTrackingAlgo::m_calib_filename
std::string m_calib_filename
Definition: TBPlaneTrackingAlgo.h:88
TBPlaneTrackingAlgo::m_bpc_errmeasY
std::vector< float > m_bpc_errmeasY
Definition: TBPlaneTrackingAlgo.h:83
TBPlaneTrackingAlgo::m_bpc_errmeasX
std::vector< float > m_bpc_errmeasX
Definition: TBPlaneTrackingAlgo.h:83
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
TBPlaneTrackingAlgo::FillRandomHit
void FillRandomHit()
Definition: TBPlaneTrackingAlgo.cxx:314
TBPlaneTrackingAlgo::fitHits
bool fitHits(const std::vector< double > &u, const std::vector< double > &w, const std::vector< double > &eu, double &a1, double &a2)
Fit data to the function u = a1 + a2*w.
Definition: TBPlaneTrackingAlgo.cxx:236
TBPlaneTrackingAlgo::m_bpc_posZX
std::vector< float > m_bpc_posZX
Definition: TBPlaneTrackingAlgo.h:81
TBPlaneTrackingAlgo
Definition: TBPlaneTrackingAlgo.h:20