26 return StatusCode::SUCCESS;
35 ATH_CHECK( tccInfo.
record( std::make_unique<TrackCaloClusterInfo>() ) );
42 tccInfo->allClusters = &*clusterContainer;
43 tccInfo->allTracks = &*tracks;
46 if(!vertices->empty()) {
47 tccInfo->pv0=(*vertices)[0];
50 return StatusCode::FAILURE;
56 return StatusCode::SUCCESS;
62 std::multimap <const xAOD::IParticle*, const xAOD::TrackParticle*> clusterToTracksMap;
68 const auto & clustLinks = clusterLinks( *trk );
69 if(clustLinks.empty() )
continue;
71 for(
const auto& clLink : clustLinks) {
73 clusterToTracksMap.insert(std::make_pair(cluster, trk));
76 totalP4 += cluster->
p4();
82 for (std::pair<const xAOD::IParticle*, const xAOD::TrackParticle*> entry : clusterToTracksMap)
86 double totalcluster_pt =
m_useEnergy ? tccInfo->trackTotalClusterPt.at(entry.second).E() : tccInfo->trackTotalClusterPt.at(entry.second).Pt();
90 totalP4 += entry.second->p4() * (cluster_pt/totalcluster_pt);
94 return StatusCode::SUCCESS;
111 std::multimap <const xAOD::IParticle*, const xAOD::TrackParticle*>
pfoToTracksMap;
121 totalP4 += pfo->
p4();
166 return StatusCode::SUCCESS;
187 ATH_MSG_VERBOSE(
"ReadDecorHandle's default container: "<<clusterLinks.key());
205 for (std::pair<const xAOD::IParticle*, const xAOD::TrackParticle*> entry : wcoll.
pfoToTracksMap){
206 double cluster_pt =
m_useEnergy ? entry.first->e() : entry.first->pt();
207 double totalcluster_pt =
m_useEnergy ? tccInfo->trackTotalClusterPt.at(entry.second).E() : tccInfo->trackTotalClusterPt.at(entry.second).Pt();
211 totalP4 += entry.second->p4() * (cluster_pt/totalcluster_pt);
214 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Some common helper functions used by decoration handles.
Handle class for reading a decoration on an object.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Handle class for reading a decoration on an object.
const std::string & decorKey() const
Return the name of the decoration alias (CONT.DECOR).
bool isAvailable()
Test to see if this variable exists in the store, for the referenced object.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
const_pointer_type cptr() const
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
virtual StatusCode execute() override
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_inputTracksHandle
Tracks used by this alg.
virtual StatusCode initialize() override
virtual StatusCode fillInfo(SG::WriteHandle< TrackCaloClusterInfo > &tccInfo) const
TrackCaloClusterInfoAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_inputClustersHandle
Original clusters from which the m_inputObjectName are build ()
Gaudi::Property< bool > m_useEnergy
use cluster energy or pt?
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_assoClustersKey
Decoration of tracks expected by this alg (set by TrackParticleClusterAssociationAlg)
SG::WriteHandleKey< TrackCaloClusterInfo > m_tccInfoHandle
TrackCaloClusterInfo created by this alg.
SG::ReadHandleKey< xAOD::VertexContainer > m_inputVertexHandle
virtual StatusCode initialize() override
TrackCaloClusterInfoUFOAlg(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< std::string > m_orig_pfo
Gaudi::Property< float > m_clusterEcut
cluster with E below this cut won't be considered in the TCC alg. WARNING cut must be configured as i...
SG::ReadHandleKey< xAOD::FlowElementContainer > m_inputPFOHandle
ToolHandle< CP::ITrackVertexAssociationTool > m_trackVertexAssoTool
virtual StatusCode fillInfo(SG::WriteHandle< TrackCaloClusterInfo > &tccInfo) const override
virtual FourMom_t p4() const override
The full 4-momentum of the particle.
Class providing the definition of the 4-vector interface.
virtual FourMom_t p4() const =0
The full 4-momentum of the particle.
virtual double pt() const =0
The transverse momentum ( ) of the particle.
TLorentzVector FourMom_t
Definition of the 4-momentum type.
virtual double e() const =0
The total energy of the particle.
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.
FlowElement_v1 FlowElement
Definition of the current "pfo version".
TrackParticle_v1 TrackParticle
Reference the current persistent version:
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 collection of energy sharing weights for UFO see TC...
virtual void processPFO(const xAOD::TrackParticle *trk, const xAOD::FlowElement *pfo)
const xAOD::IParticle::FourMom_t nullV
std::multimap< const xAOD::IParticle *, const xAOD::TrackParticle * > pfoToTracksMap
TrackCaloClusterInfo * tccInfo_nonconst
virtual void processTrk(const xAOD::TrackParticle *)
Holds all the necessary information to build TrackCaloCluster objects.