ATLAS Offline Software
Loading...
Searching...
No Matches
PerigeeFillerTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "PerigeeFillerTool.h"
6
8//#include "TrkParameters/TrackParameters.h"
10
11namespace D3PD {
12
13
15 const std::string& name,
16 const IInterface* parent)
17 : D3PD::BlockFillerTool<Trk::TrackParameters> (type, name, parent)
18{
19 // Avoid coverity warnings.
20 m_fillPerigee = true;
21 m_fillMomentum = true;
23 m_fillPhi = true;
24 book().ignore();
25
26 declareProperty ("FillPerigee", m_fillPerigee=true);
27 declareProperty ("FillMomentum", m_fillMomentum=false);
28 declareProperty ("FillThetaAndQoverP", m_fillThetaAndQoverP=true);
29 declareProperty ("FillPhi", m_fillPhi=true,
30 "Should the phi variable be filled?");
31 declareProperty ("DefaultValue", m_defaultValue=0,
32 "Default value to which to set unfilled variables.");
33}
34
36{
37 // track parameters at perigee
38 if(m_fillPerigee){
39 CHECK( addVariable ("d0", m_d0, "", m_defaultValue) );
40 CHECK( addVariable ("z0", m_z0, "", m_defaultValue) );
41 if (m_fillPhi)
42 CHECK( addVariable ("phi", m_phi, "", m_defaultValue) );
44 CHECK( addVariable ("theta", m_theta, "", m_defaultValue) );
45 CHECK( addVariable ("qoverp", m_qoverp, "", m_defaultValue) );
46 }
47 }
48
50 CHECK( addVariable ("pt", m_pt, "", m_defaultValue) );
51 CHECK( addVariable ("eta", m_eta, "", m_defaultValue) );
52 }
53
54 return StatusCode::SUCCESS;
55}
56
58{
59 // track parameters at perigee
60 if(m_fillPerigee){
61 *m_d0 = perigee.parameters()[Trk::d0];
62 *m_z0 = perigee.parameters()[Trk::z0];
63 if (m_fillPhi)
64 *m_phi = perigee.parameters()[Trk::phi0];
66 *m_theta = perigee.parameters()[Trk::theta];
67 *m_qoverp = perigee.parameters()[Trk::qOverP];
68 }
69 }
70
72 *m_pt = perigee.pT();
73 *m_eta = perigee.eta();
74 }
75
76 return StatusCode::SUCCESS;
77}
78
79
80} // namespace D3PD
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Type-safe wrapper for block filler tools.
bool m_fillPhi
Parameter: Should the phi variable be filled?
virtual StatusCode book() final
Declare tuple variables.
virtual StatusCode fill(const Trk::TrackParameters &p) override
Fill one block — type-safe version.
PerigeeFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
float m_defaultValue
Parameter: Value to which to set variables if they don't get filled.
double eta() const
Access method for pseudorapidity - from momentum.
double pT() const
Access method for transverse momentum.
Block filler tool for noisy FEB information.
Ensure that the ATLAS eigen extensions are properly loaded.
@ phi0
Definition ParamDefs.h:65
@ theta
Definition ParamDefs.h:66
@ qOverP
perigee
Definition ParamDefs.h:67
@ d0
Definition ParamDefs.h:63
@ z0
Definition ParamDefs.h:64
ParametersBase< TrackParametersDim, Charged > TrackParameters