24 void computeVertexCorr(
double&
eta,
double&
phi,
const Amg::Vector3D& vertex,
double radius) {
26 if (radius<1.)
return;
28 if (std::fabs(
eta)>10. || std::fabs(
phi)>10.)
return;
31 double iradius = 1 /
radius;
32 eta += (-
vertex[2]/std::cosh(
eta) +
sc.apply (vertex[1], vertex[0])*std::tanh(
eta)) * iradius;
33 phi +=
sc.apply (vertex[0], -vertex[1]) * iradius;
43 std::vector<ElementLink<xAOD::IParticleContainer> > ipLinks(neutralLinks.size());
44 for(
size_t i=0;
i<neutralLinks.size();
i++) ipLinks[i] = neutralLinks[i];
61 template<
typename DTYPE,
typename CTYPE>
63 static const std::string
ts =
typeid(DTYPE).
name();
65 const auto split =
wh.key().rfind (
'.');
66 if (
split == std::string::npos)
67 throw std::runtime_error (
"decor key does not contain a .: " +
wh.key());
81 declareInterface<ITrackCaloClusterTool>(
this);
92 return StatusCode::SUCCESS;
109 if(tccInfo.
pv0==
nullptr){
111 return StatusCode::FAILURE;
130 const auto & clusterLinks = clusterLinksH(*trk);
131 if( clusterLinks.empty() )
continue;
133 FourMom_t tcc_4p(0.,0.,0.,0.);
144 ATH_MSG_VERBOSE (
"cluster->pt() " << cluster_pt <<
" cluster->eta() " << cluster->
eta() <<
" cluster->phi() "
145 << cluster->
phi() <<
" track pt " << trk->
pt() <<
" (tccInfo.clusterToTracksWeightMap.at(cluster)).Pt() " << (tccInfo.
clusterToTracksWeightMap.at(cluster)).Pt());
157 eta = pars->position().eta();
158 phi = pars->position().phi();
162 dec_isCorrected(*trk) = 1;
163 dec_calEntryEta(*trk) =
eta;
164 dec_calEntryPhi(*trk) =
phi;
174 ATH_MSG_VERBOSE (
"Created TCC with pt " << tcc->
pt() <<
" eta " << tcc->
eta() <<
" phi " << tcc->
phi() <<
" mass " << tcc->
m() <<
" signalType= " << tcc->
signalType());
178 double det_eta = pars->position().eta();
179 dec_detEta(*tcc) = det_eta;
184 return StatusCode::SUCCESS;
215 if( ! clusterLinksH(*track).empty() )
continue;
219 if (!isMatched)
continue;
229 double det_eta = track->eta();
231 if(pars) det_eta = pars->position().eta();
232 dec_detEta(*tcc) = det_eta;
237 return StatusCode::SUCCESS;
255 return StatusCode::SUCCESS;
276 const std::vector< ElementLink<xAOD::CaloClusterContainer> > ClusterLink {clusterLink};
282 dec_detEta(*tcc) = dec_detEta(*cluster);
287 return StatusCode::SUCCESS;
313 std::vector<ElementLink< xAOD::FlowElementContainer > >
m_pfoLinks;
322 const FourMom_t & totalP =
m_tccInfo->trackTotalClusterPt.at(trk);
323 double totalpfo_pt =
m_useEnergy ? totalP.E() : totalP.Pt();
324 m_tcc_4p += pfo->
p4()*(( trk->
pt() * pfo_pt / totalpfo_pt) / ((
m_tccInfo->clusterToTracksWeightMap.at(pfo)).Pt()));
356 return StatusCode::SUCCESS;
362 const EventContext& ctx=Gaudi::Hive::currentContext();
385 if(pfo->pt() <= 0)
continue;
392 if(pfo->isCharged()) {
395 if(!PVMatchedAcc(*pfo))
continue;
400 const std::vector< ElementLink<xAOD::FlowElementContainer> > PFOLink {pfoLink};
404 if(pfo->isCharged()) {
415 return StatusCode::SUCCESS;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Base class for elements of a container that can have aux data.
Some common helper functions used by decoration handles.
Handle class for reading a decoration on an object.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ElementLink implementation for ROOT usage.
SG::ConstAccessor< T, ALLOC > ConstAccessor
SG::Decorator< T, ALLOC > Decorator
SG::Accessor< T, ALLOC > Accessor
const SG::AuxVectorData * container() const
Return the container holding this element.
size_t index() const
Return the index of this element within its container.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Handle class for reading a decoration on an object.
const_pointer_type ptr()
Dereference the pointer.
const_pointer_type cptr()
Dereference the pointer.
virtual double pt() const
The transverse momentum ( ) of the particle (negative for negative-energy clusters)
virtual double m() const
The invariant mass of the particle.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double e() const
The total energy of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
virtual double pt() const override
void setP4(float pt, float eta, float phi, float m)
virtual double m() const override
The invariant mass of the particle.
virtual double phi() const override
The azimuthal angle ( ) of the particle.
virtual double eta() const override
The pseudorapidity ( ) of the particle.
signal_t signalType() const
void setChargedObjectLinks(const std::vector< ElementLink< IParticleContainer > > &elV)
void setSignalType(signal_t t)
SignalType
Enum to encode the nature of the object this FlowElement represents.
void setOtherObjectLinks(const std::vector< ElementLink< IParticleContainer > > &elV)
virtual double e() const override
The total energy of the particle.
virtual FourMom_t p4() const override
The full 4-momentum of the particle.
Class providing the definition of the 4-vector interface.
TLorentzVector FourMom_t
Definition of the 4-momentum type.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
const Amg::Vector3D & position() const
Returns the 3-pos.
void setParameters(T *h, TGraphAsymmErrors *tg)
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Eigen::Matrix< double, 3, 1 > Vector3D
std::string decorKeyFromKey(const std::string &key, const std::string &deflt)
Extract the decoration part of key.
\bried Internal helper class for TCC & UFO building.
ParametersBase< TrackParametersDim, Charged > TrackParameters
FlowElementContainer_v1 FlowElementContainer
Definition of the current "pfo container version".
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
FlowElement_v1 FlowElement
Definition of the current "pfo version".
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Helper to simultaneously calculate sin and cos of the same angle.
Helper to simultaneously calculate sin and cos of the same angle.
Implements a loop over tracks and pflow object to build UFOs.
const SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > * m_linkdecorkey
const CP::ITrackVertexAssociationTool * m_trackVertexAssoTool
virtual void combinedUFOLoop(const TrackCaloClusterInfo *tccInfo, const xAOD::FlowElementContainer *pfos)
std::string m_clustersLinkK
Implement a concrete CombinedUFOLoop dedicated to building UFO see TCCHelpers.h in TrackCaloClusterRe...
virtual void processTrk(const xAOD::TrackParticle *trk)
std::vector< ElementLink< xAOD::FlowElementContainer > > m_pfoLinks
xAOD::FlowElementContainer * m_tccContainer
const TrackCaloClusterInfo * m_tccInfo
const xAOD::FlowElementContainer * m_pfoContainer
virtual void processPFO(const xAOD::TrackParticle *trk, const xAOD::FlowElement *pfo)
Holds all the necessary information to build TrackCaloCluster objects.
std::map< const xAOD::TrackParticle *, FourMom_t > trackTotalClusterPt
std::map< const xAOD::IParticle *, FourMom_t > clusterToTracksWeightMap
const xAOD::TrackParticleContainer * allTracks
const xAOD::CaloClusterContainer * allClusters