ATLAS Offline Software
TrackChi2Branch.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
6 #include <xAODMuon/Muon.h>
7 namespace MuonVal{
9  VectorBranch<float>(parent.tree(), parent.name() + "_chi2"),
10  m_nDoF {std::make_shared<VectorBranch<unsigned int>>(parent.tree(), parent.name() + "_nDoF")}
11  {
12  parent.getTree().addBranch(m_nDoF);
13  m_nDoF = parent.getTree().getBranch<VectorBranch<unsigned int>>(m_nDoF->name());
14  }
16  const xAOD::TrackParticle* trk = nullptr;
18  trk = static_cast<const xAOD::TrackParticle*>(p);
19  } else if (p->type() == xAOD::Type::ObjectType::Muon) {
20  trk = static_cast<const xAOD::Muon*>(p)->primaryTrackParticle();
21  } else {
22  THROW_EXCEPTION("No track particle object has been given to " <<name());
23  }
24 
25  push_back(trk->chiSquared());
26  m_nDoF->push_back(trk->numberDoF());
27  }
31 }
throwExcept.h
MuonVal::TrackChi2Branch::TrackChi2Branch
TrackChi2Branch(IParticleFourMomBranch &parent)
Definition: TrackChi2Branch.cxx:8
Muon.h
tree
TChain * tree
Definition: tile_monitor.h:30
MuonVal::TrackChi2Branch::operator+=
void operator+=(const xAOD::IParticle *p) override
Definition: TrackChi2Branch.cxx:29
xAOD::TrackParticle_v1::chiSquared
float chiSquared() const
Returns the of the overall track fit.
MuonVal::VectorBranch
Definition: VectorBranch.h:14
THROW_EXCEPTION
#define THROW_EXCEPTION(MSG)
Definition: MMReadoutElement.cxx:48
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
TrackChi2Branch.h
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
MuonVal::TrackChi2Branch::push_back
void push_back(const xAOD::IParticle *p) override
Similar to the IAuxElementDecoration branch but only accepting IParticles.
Definition: TrackChi2Branch.cxx:15
test_pyathena.parent
parent
Definition: test_pyathena.py:15
MuonVal
Class to store array like branches into the n-tuples.
Definition: MuonTPMetaDataAlg.cxx:25
MuonVal::MuonTesterTree::name
std::string name() const
Name of the tree.
Definition: MuonTesterTree.cxx:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MuonVal::TrackChi2Branch::m_nDoF
std::shared_ptr< VectorBranch< unsigned int > > m_nDoF
Definition: TrackChi2Branch.h:22
Muon
struct TBPatternUnitContext Muon
MuonVal::MuonTesterBranch::parent
MuonTesterTree & parent()
Returns the reference to the MuonTesterTree parent.
Definition: MuonTesterBranch.cxx:38
MuonVal::IMuonTesterBranch::name
virtual std::string name() const =0
Returns the name of the branch.
xAOD::TrackParticle_v1::numberDoF
float numberDoF() const
Returns the number of degrees of freedom of the overall track or vertex fit as float.
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
MuonVal::IParticleFourMomBranch
Helper class to easily to add xAOD::IParticles and associated decorator variables to the MuonTesterTr...
Definition: IParticleFourMomBranch.h:31
MuonVal::MuonTesterTree::tree
TTree * tree()
TTree object.
Definition: MuonTesterTree.cxx:22
readCCLHist.float
float
Definition: readCCLHist.py:83