54 {
55 SG::AuxElement::ConstAccessor<ElementLink<xAOD::IParticleContainer> > orig_pfo(
m_orig_pfoK);
56 SG::AuxElement::ConstAccessor< std::vector<ElementLink<xAOD::CaloClusterContainer> > > clusterLinks(
m_clustersLinkK);
57
58
59
60
61 std::map<const xAOD::TrackParticle*, bool> isIsolatedMatchedTrack;
62 static const SG::AuxElement::ConstAccessor<int> acc_isInDenseEnvironment("IsInDenseEnvironment");
64 if( ! pfo->isCharged() ) continue;
65
66
67 if(!acc_isInDenseEnvironment.isAvailable(*pfo)){
68 asg::msgUserCode::ANA_MSG_ERROR("TCCHelpers.h: Dense environ variable not found, skipping given FE");
69 continue;
70 }
71 if(acc_isInDenseEnvironment(*pfo)==1){
72 continue;
73 }
74 const xAOD::IParticle* pfo_iparticle=pfo->chargedObjects().at(0);
75
77 isIsolatedMatchedTrack[pfoTrack] = true;
78 }
79
81 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");
82 return;
83 }
84 const EventContext& ctx =Gaudi::Hive::currentContext();
85 SG::ReadDecorHandle<xAOD::TrackParticleContainer, std::vector<ElementLink<xAOD::CaloClusterContainer>> > trackcalodecor(*
m_linkdecorkey,ctx);
86
87 if(!trackcalodecor.isPresent()){
88 asg::msgUserCode::ANA_MSG_ERROR(
"TCCHelpers.h: no link between track and cluster. We need these links : "<<
m_linkdecorkey->key());
89 }
90
92
93 if (isIsolatedMatchedTrack.find(trk) != isIsolatedMatchedTrack.end() ) continue;
94
95
97
98
99
100
101
102
103 const auto& clustLinks=trackcalodecor(*trk);
104 if(clustLinks.empty() ){
105 continue;
106 }
107
108
109
110 for( const auto& clLink : clustLinks) {
111
113
114
116 if(pfo->pt()<=0.) continue;
117
118 const xAOD::IParticle* pfo_orig = nullptr;
119 if ( orig_pfo.isAvailable(*pfo) ) pfo_orig = *orig_pfo( *pfo ) ;
120 else pfo_orig = pfo;
121
122 if( !(std::abs(pfo_orig->
eta() - cluster->
rawEta() )<0.01 && std::abs( pfo_orig->
phi() - cluster->
rawPhi() )<0.01))
continue;
123
124 if( ! pfo->isCharged() ){
125
127 }
128
129
130
131
132
134
135 }
136 }
137
138
139
141
142 }
143
144
145 }
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