|
ATLAS Offline Software
|
#include <TBPlaneTrackingAlgo.h>
|
| TBPlaneTrackingAlgo (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual | ~TBPlaneTrackingAlgo () |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute () override |
|
virtual StatusCode | finalize () override |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
void | FillRandomHit () |
|
StatusCode | getnewcalib () |
|
bool | fitPlane (const TBHitPlaneCont *hitPlaneCont, double &a1, double &a2, double &chi2, std::vector< double > &residual) |
| Fit data to the function u = a1 + a2*w. More...
|
|
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. More...
|
|
double | getResidual (const double &u, const double &w, const double &a1, const double &a2) |
| Calculates the residual-> r = (u_i - a1 - a2*w_i) More...
|
|
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. More...
|
|
StatusCode | buildHits () |
| Build HitPlaneCont from BPC. More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Definition at line 20 of file TBPlaneTrackingAlgo.h.
◆ StoreGateSvc_t
◆ TBPlaneTrackingAlgo()
TBPlaneTrackingAlgo::TBPlaneTrackingAlgo |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~TBPlaneTrackingAlgo()
virtual TBPlaneTrackingAlgo::~TBPlaneTrackingAlgo |
( |
| ) |
|
|
inlinevirtual |
◆ buildHits()
StatusCode TBPlaneTrackingAlgo::buildHits |
( |
| ) |
|
|
private |
Build HitPlaneCont from BPC.
Definition at line 355 of file TBPlaneTrackingAlgo.cxx.
366 for (
const TBBPC* bpc : *bpcCont) {
367 std::string
name = bpc->getDetectorName();
384 if(!(bpc->isXPosOverflow()||bpc->isXPulseOverflow())){
393 hitu->
setValidFlag(bpc->isXPosOverflow()&&bpc->isYPosOverflow());
397 if(!(bpc->isYPosOverflow()||bpc->isYPulseOverflow())){
406 hitv->
setValidFlag(bpc->isXPosOverflow()&&bpc->isYPosOverflow());
411 return StatusCode::SUCCESS;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode TBPlaneTrackingAlgo::execute |
( |
| ) |
|
|
overridevirtual |
Definition at line 49 of file TBPlaneTrackingAlgo.cxx.
53 const EventContext& ctx = Gaudi::Hive::currentContext();
57 "Using FillRandomHit method to get data");
65 if ( checkOut.isFailure() )
68 return StatusCode::FAILURE;
72 if (evtType != 1)
return StatusCode::SUCCESS;
77 unsigned int thisrun=ctx.eventID().run_number();
95 setFilterPassed(
false);
96 return StatusCode::SUCCESS;
99 int hitPlaneNumU, hitPlaneNumV;
103 if( (hitPlaneNumU < 2) || (hitPlaneNumV < 2) ){
105 <<
"Not enough hits in one or both planes, "
106 <<
"Cannot make track.");
108 setFilterPassed(
false);
109 return StatusCode::SUCCESS;
115 std::vector<double> residual_u, residual_v;
125 setFilterPassed(
false);
126 return StatusCode::SUCCESS;
132 setFilterPassed(
false);
133 return StatusCode::SUCCESS;
140 track->setUintercept(a1_u);
141 track->setVintercept(a1_v);
142 track->setUslope(a2_u);
143 track->setVslope(a2_v);
146 for(
int i = 0;
i < hitPlaneNumU;
i++){
147 track->setResidualu(
i, residual_u[
i]);
151 for(
int i = 0;
i < hitPlaneNumV;
i++){
152 track->setResidualv(
i, residual_v[
i]);
159 track->setChi2_u(chi2_u);
160 track->setChi2_v(chi2_v);
165 if (
sc.isFailure( ) ) {
170 setFilterPassed(
true);
171 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ FillRandomHit()
void TBPlaneTrackingAlgo::FillRandomHit |
( |
| ) |
|
|
private |
◆ finalize()
StatusCode TBPlaneTrackingAlgo::finalize |
( |
| ) |
|
|
overridevirtual |
◆ fitHits()
bool TBPlaneTrackingAlgo::fitHits |
( |
const std::vector< double > & |
u, |
|
|
const std::vector< double > & |
w, |
|
|
const std::vector< double > & |
eu, |
|
|
double & |
a1, |
|
|
double & |
a2 |
|
) |
| |
|
private |
Fit data to the function u = a1 + a2*w.
Definition at line 236 of file TBPlaneTrackingAlgo.cxx.
263 int numHits = v_u.size();
264 for(
int i = 0;
i < numHits;
i++){
265 m_s += 1 / (v_eu[
i]*v_eu[
i]);
266 m_su += v_u[
i] / (v_eu[
i]*v_eu[
i]);
267 m_sww += v_w[
i]*v_w[
i] / (v_eu[
i]*v_eu[
i]);
268 m_sw += v_w[
i] / (v_eu[
i]*v_eu[
i]);
269 m_suw += v_u[
i]*v_w[
i] / (v_eu[
i]*v_eu[
i]);
272 const double denom = (m_s*m_sww-m_sw*m_sw);
277 const double inv_denom = 1. /
denom;
278 a1 = (m_su*m_sww - m_sw*m_suw) * inv_denom;
279 a2 = (m_s*m_suw - m_su*m_sw) * inv_denom;
◆ fitPlane()
bool TBPlaneTrackingAlgo::fitPlane |
( |
const TBHitPlaneCont * |
hitPlaneCont, |
|
|
double & |
a1, |
|
|
double & |
a2, |
|
|
double & |
chi2, |
|
|
std::vector< double > & |
residual |
|
) |
| |
|
private |
Fit data to the function u = a1 + a2*w.
and determines intercept, slope, residual for each BPC, and chi2 on fit
Definition at line 183 of file TBPlaneTrackingAlgo.cxx.
188 int hitPlaneNum = hitPlaneCont->
size();
190 ATH_MSG_DEBUG (
"The hit plane container size is: " << hitPlaneNum);
192 std::vector<double> vec_u;
193 std::vector<double> vec_w;
194 std::vector<double> err_vec_u;
195 std::vector<double> err_vec_w;
202 vec_u.push_back(hp->getPosu());
203 vec_w.push_back(hp->getPosw());
204 err_vec_u.push_back(hp->getErroru());
205 err_vec_w.push_back(hp->getErrorw());
208 if(vec_u.size() != vec_w.size()){
225 <<
" intercept = " << a1
226 <<
" and slope = " << a2);
229 for (
int i = 0;
i < hitPlaneNum;
i++) {
◆ getChi2()
double TBPlaneTrackingAlgo::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 |
|
) |
| |
|
private |
Calculates the chi2 += ((u_i - a1 - a2*w_i)/eu)^2.
Definition at line 291 of file TBPlaneTrackingAlgo.cxx.
303 int numX = v_u.size();
306 for(
int i = 0;
i < numX;
i++){
307 chi2 += (v_u[
i] - a1 - a2*v_w[
i])*(v_u[
i] - a1 - a2*v_w[
i])/(v_eu[
i]*v_eu[
i]);
◆ getnewcalib()
StatusCode TBPlaneTrackingAlgo::getnewcalib |
( |
| ) |
|
|
private |
Definition at line 415 of file TBPlaneTrackingAlgo.cxx.
447 std::ifstream calibfile;
450 if(!calibfile.good()){
452 return StatusCode::FAILURE;
458 pos = calibfile.tellg();
463 pos = calibfile.tellg();
465 for(
int j=0;j<bpcnumber+1;j++) calibfile.ignore(5000,
'\n');
479 calibfile.seekg(
pos);
481 for(
int j=0;j<bpcnumber;j++)
510 return StatusCode::SUCCESS;
◆ getResidual()
double TBPlaneTrackingAlgo::getResidual |
( |
const double & |
u, |
|
|
const double & |
w, |
|
|
const double & |
a1, |
|
|
const double & |
a2 |
|
) |
| |
|
private |
◆ initialize()
StatusCode TBPlaneTrackingAlgo::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_bpc_errmeasX
std::vector<float> TBPlaneTrackingAlgo::m_bpc_errmeasX |
|
private |
◆ m_bpc_errmeasY
std::vector<float> TBPlaneTrackingAlgo::m_bpc_errmeasY |
|
private |
◆ m_bpc_errposX
std::vector<float> TBPlaneTrackingAlgo::m_bpc_errposX |
|
private |
◆ m_bpc_errposY
std::vector<float> TBPlaneTrackingAlgo::m_bpc_errposY |
|
private |
◆ m_bpc_errposZX
std::vector<float> TBPlaneTrackingAlgo::m_bpc_errposZX |
|
private |
◆ m_bpc_errposZY
std::vector<float> TBPlaneTrackingAlgo::m_bpc_errposZY |
|
private |
◆ m_bpc_names
std::vector<std::string> TBPlaneTrackingAlgo::m_bpc_names |
|
private |
◆ m_bpc_posX
std::vector<float> TBPlaneTrackingAlgo::m_bpc_posX |
|
private |
◆ m_bpc_posY
std::vector<float> TBPlaneTrackingAlgo::m_bpc_posY |
|
private |
◆ m_bpc_posZX
std::vector<float> TBPlaneTrackingAlgo::m_bpc_posZX |
|
private |
◆ m_bpc_posZY
std::vector<float> TBPlaneTrackingAlgo::m_bpc_posZY |
|
private |
◆ m_calib_filename
std::string TBPlaneTrackingAlgo::m_calib_filename |
|
private |
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_hitPlaneCont_u
◆ m_hitPlaneCont_v
◆ m_runnumber
unsigned int TBPlaneTrackingAlgo::m_runnumber |
|
private |
◆ m_testAlgo
bool TBPlaneTrackingAlgo::m_testAlgo |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
std::vector< float > m_bpc_errposZY
def retrieve(aClass, aKey=None)
void setValidFlag(bool valid)
std::vector< float > m_bpc_errposZX
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::vector< float > m_bpc_posZY
std::vector< float > m_bpc_posX
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
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.
TBHitPlaneCont m_hitPlaneCont_v
void setErroru(double eu)
std::vector< float > m_bpc_posY
double getResidual(const double &u, const double &w, const double &a1, const double &a2)
Calculates the residual-> r = (u_i - a1 - a2*w_i)
@ u
Enums for curvilinear frames.
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
StatusCode buildHits()
Build HitPlaneCont from BPC.
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
double chi2(TH1 *h0, TH1 *h1)
bool fitPlane(const TBHitPlaneCont *hitPlaneCont, double &a1, double &a2, double &chi2, std::vector< double > &residual)
Fit data to the function u = a1 + a2*w.
std::vector< std::string > m_bpc_names
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
void clear()
Erase all the elements in the collection.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::vector< float > m_bpc_errposX
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataObjIDColl m_extendedExtraObjects
#define ATH_MSG_WARNING(x)
std::vector< float > m_bpc_errposY
TBHitPlaneCont m_hitPlaneCont_u
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
std::string m_calib_filename
AthAlgorithm()
Default constructor:
std::vector< float > m_bpc_errmeasY
std::vector< float > m_bpc_errmeasX
void setErrorw(double ew)
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.
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
std::vector< float > m_bpc_posZX