54 {
57
58
59
60
61 std::map<const xAOD::TrackParticle*, bool> isIsolatedMatchedTrack;
63 if( ! pfo->isCharged() ) continue;
64
65 static const SG::AuxElement::ConstAccessor<int> acc_isInDenseEnvironment("IsInDenseEnvironment");
66 if(!acc_isInDenseEnvironment.isAvailable(*pfo)){
67 asg::msgUserCode::ANA_MSG_ERROR("TCCHelpers.h: Dense environ variable not found, skipping given FE");
68 continue;
69 }
70 if(acc_isInDenseEnvironment(*pfo)==1){
71 continue;
72 }
73 const xAOD::IParticle* pfo_iparticle=pfo->chargedObjects().at(0);
74
76 isIsolatedMatchedTrack[pfoTrack] = true;
77 }
78
80 asg::msgUserCode::ANA_MSG_ERROR("TCCHelpers.h m_linkdecorkey is not initialised in the struct to do anything, not sure what this means? Skip this case");
81 return;
82 }
83 const EventContext& ctx =Gaudi::Hive::currentContext();
84 SG::ReadDecorHandle<xAOD::TrackParticleContainer, std::vector<ElementLink<xAOD::CaloClusterContainer>> > trackcalodecor(*
m_linkdecorkey,ctx);
85
86 if(!trackcalodecor.isPresent()){
87 asg::msgUserCode::ANA_MSG_ERROR(
"TCCHelpers.h: no link between track and cluster. We need these links : "<<
m_linkdecorkey->key());
88 }
89
91
92 if (isIsolatedMatchedTrack.find(trk) != isIsolatedMatchedTrack.end() ) continue;
93
94
96
97
98
99
100
101
102 const auto& clustLinks=trackcalodecor(*trk);
103 if(clustLinks.empty() ){
104 continue;
105 }
106
107
108
109 for( const auto& clLink : clustLinks) {
110
112
113
115 if(pfo->pt()<=0.) continue;
116
117 const xAOD::IParticle* pfo_orig = nullptr;
118 if ( orig_pfo.isAvailable(*pfo) ) pfo_orig = *orig_pfo( *pfo ) ;
119 else pfo_orig = pfo;
120
121 if( !(std::abs(pfo_orig->
eta() - cluster->
rawEta() )<0.01 && std::abs( pfo_orig->
phi() - cluster->
rawPhi() )<0.01))
continue;
122
123 if( ! pfo->isCharged() ){
124
126 }
127
128
129
130
131
133
134 }
135 }
136
137
138
140
141 }
142
143
144 }
SG::ConstAccessor< T, ALLOC > ConstAccessor
flt_t rawPhi() const
Get in signal state UNCALIBRATED.
flt_t rawEta() const
Get in signal state UNCALIBRATED.
virtual double eta() const =0
The pseudorapidity ( ) of the particle.
virtual double phi() const =0
The azimuthal angle ( ) of the particle.
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:
const SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > * m_linkdecorkey
const CP::ITrackVertexAssociationTool * m_trackVertexAssoTool
virtual void processPFO(const xAOD::TrackParticle *trk, const xAOD::FlowElement *pfo)=0
virtual void processTrk(const xAOD::TrackParticle *trk)=0
std::string m_clustersLinkK
const xAOD::TrackParticleContainer * allTracks