ATLAS Offline Software
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 
11 namespace D3PD {
12 
13 
15  const std::string& name,
16  const IInterface* parent)
18 {
19  // Avoid coverity warnings.
20  m_fillPerigee = true;
21  m_fillMomentum = true;
22  m_fillThetaAndQoverP = 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 
49  if(m_fillMomentum){
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 
71  if(m_fillMomentum){
72  *m_pt = perigee.pT();
73  *m_eta = perigee.eta();
74  }
75 
76  return StatusCode::SUCCESS;
77 }
78 
79 
80 } // namespace D3PD
D3PD::PerigeeFillerTool::m_pt
float * m_pt
Definition: PerigeeFillerTool.h:46
D3PD::PerigeeFillerTool::m_fillPerigee
bool m_fillPerigee
Definition: PerigeeFillerTool.h:28
PerigeeFillerTool.h
Trk::z0
@ z0
Definition: ParamDefs.h:70
D3PD::AddVariable::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.
Definition: AddVariable.cxx:85
D3PD::PerigeeFillerTool::book
virtual StatusCode book() final
Declare tuple variables.
Definition: PerigeeFillerTool.cxx:35
D3PD::PerigeeFillerTool::m_fillPhi
bool m_fillPhi
Parameter: Should the phi variable be filled?
Definition: PerigeeFillerTool.h:32
xAOD::TrackParameters
TrackParameters_v1 TrackParameters
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParameters.h:11
D3PD
Block filler tool for noisy FEB information.
Definition: InnerDetector/InDetMonitoring/InDetGlobalMonitoring/macros/EnhancedPrimaryVertexMonitoring/TrigD3PD/ChainGroup.h:21
D3PD::PerigeeFillerTool::m_fillMomentum
bool m_fillMomentum
Definition: PerigeeFillerTool.h:27
Trk::theta
@ theta
Definition: ParamDefs.h:72
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
D3PD::PerigeeFillerTool::m_qoverp
float * m_qoverp
Definition: PerigeeFillerTool.h:43
D3PD::PerigeeFillerTool::m_fillThetaAndQoverP
bool m_fillThetaAndQoverP
Definition: PerigeeFillerTool.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
D3PD::BlockFillerTool
Type-safe wrapper for block filler tools.
Definition: BlockFillerTool.h:68
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
Trk::ParametersBase
Definition: ParametersBase.h:55
D3PD::PerigeeFillerTool::m_eta
float * m_eta
Definition: PerigeeFillerTool.h:47
EventPrimitives.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::ParametersBase::pT
double pT() const
Access method for transverse momentum.
D3PD::PerigeeFillerTool::m_theta
float * m_theta
Definition: PerigeeFillerTool.h:42
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Trk::d0
@ d0
Definition: ParamDefs.h:69
errorcheck.h
Helpers for checking error return status codes and reporting errors.
D3PD::PerigeeFillerTool::PerigeeFillerTool
PerigeeFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PerigeeFillerTool.cxx:14
D3PD::PerigeeFillerTool::fill
virtual StatusCode fill(const Trk::TrackParameters &p) override
Fill one block — type-safe version.
Definition: PerigeeFillerTool.cxx:57
D3PD::PerigeeFillerTool::m_z0
float * m_z0
Definition: PerigeeFillerTool.h:40
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:73
D3PD::PerigeeFillerTool::m_d0
float * m_d0
Definition: PerigeeFillerTool.h:39
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Trk::ParametersBase::eta
double eta() const
Access method for pseudorapidity - from momentum.
D3PD::PerigeeFillerTool::m_phi
float * m_phi
Definition: PerigeeFillerTool.h:41
Trk::phi0
@ phi0
Definition: ParamDefs.h:71
D3PD::PerigeeFillerTool::m_defaultValue
float m_defaultValue
Parameter: Value to which to set variables if they don't get filled.
Definition: PerigeeFillerTool.h:35