52 {
53
54
55
58
59
62 outputTracks->setStore( outputAuxTracks );
63
64
65
68 for(; trackItr != trackEnd; ++trackItr ){
70 if(!track){
ATH_MSG_INFO(
"Not a valid track");
continue; }
71
73
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
107 for(; trackItr2 != trackEnd2; ++trackItr2 ){
108 if(trackItr==trackItr2) continue;
109 const TRACK* track2 = *trackItr2;
110 double dif_eta =
track->eta() - track2->
eta();
111 double dif_phi =
track->phi() - track2->
phi();
112 if(dif_phi<0) dif_phi=-dif_phi;
113 if(dif_phi>
M_PI){dif_phi=2*
M_PI-dif_phi;}
114 double deltaR = sqrt(dif_eta*dif_eta+dif_phi*dif_phi);
116 }
121 }
122 }
123 }
124 }
125
127
128
131
132
135 outputClusters->setStore( outputAuxClusters );
136
137
138
141
142
143
144
145
146
149 for(;clusterItr != clusterEnd; ++clusterItr){
150 const CLUSTER* cluster = *clusterItr;
153 ASSOCCONTAINER::iterator assocItr = trackClusters->begin();
154 for( ; trackItr != trackEnd; ++trackItr ){
156 vector< vector<double> > etrack =
m_trackInCalo->getXYZEtaPhiPerLayer(track);
158 for(int cell_sid=0;cell_sid<CaloSampling::Unknown;cell_sid++){
159 int lay=-1;
160 if (cell_sid==0 || cell_sid==4 ){lay=0;}
161 else if(cell_sid==1 || cell_sid==5 ){lay=1;}
162 else if(cell_sid==2 || cell_sid==6 ){lay=2;}
163 else if(cell_sid==3 || cell_sid==7 ){lay=3;}
164 else if(cell_sid==12 || cell_sid==18){lay=4;}
165 else if(cell_sid==13 || cell_sid==19){lay=5;}
166 else if(cell_sid==15 || cell_sid==17){lay=5;}
167 else if(cell_sid==14 || cell_sid==20){lay=6;}
168 else if(cell_sid==16) {lay=6;}
169 else if(cell_sid==8 ){lay=7;}
170 else if(cell_sid==9 ){lay=8;}
171 else if(cell_sid==10 ){lay=9;}
172 else if(cell_sid==11 ){lay=10;}
173 if(lay==-1) continue;
176 if(dif_phi<0) dif_phi=-dif_phi;
177 if(dif_phi>
M_PI){dif_phi=2*
M_PI-dif_phi;}
178 double tmp = sqrt(dif_eta*dif_eta+dif_phi*dif_phi);
180 }
183 while(i!=outputClusters->
size()){
if(outputClusters->
at(i)==cluster){
break;}
i++;}
184 if(i==outputClusters->
size()){
188 }
189
190 assocItr->push_back(i);
191 }
192 ++assocItr;
193 }
194 }
195
197
198
201
202
203 ConstDataVector<CELLCONTAINER>* outputCells =
new ConstDataVector<CELLCONTAINER>(
SG::VIEW_ELEMENTS );
205
206
209
210
211 clusterItr = outputClusters->
begin();
212 clusterEnd = outputClusters->
end();
213 ASSOCCONTAINER::iterator assocItr = clusterCells->begin();
214
215 for(;clusterItr != clusterEnd; ++clusterItr){
216 const CLUSTER* cluster = *clusterItr;
220 for(;cellItr != cellEnd; ++cellItr){
223 while(i!=outputCells->size()){
if(outputCells->
at(i)==cell){
break;}
i++;}
224 if(i==outputCells->size()){
226 }
227
228 assocItr->push_back(i);
229 }
230 }
231 ++assocItr;
232 }
233
234
237
238
239
240 trackItr = outputTracks->
begin();
241 trackEnd = outputTracks->
end();
242 assocItr = trackCells->begin();
243
244 for( ; trackItr != trackEnd; ++trackItr ){
246 vector< vector<double> > etrack =
m_trackInCalo->getXYZEtaPhiPerLayer(track);
247
250 for(;cellItr != cellEnd; ++cellItr){
253
254 int lay=-1;
255 if (cell_sid==0 || cell_sid==4 ){lay=0;}
256 else if(cell_sid==1 || cell_sid==5 ){lay=1;}
257 else if(cell_sid==2 || cell_sid==6 ){lay=2;}
258 else if(cell_sid==3 || cell_sid==7 ){lay=3;}
259 else if(cell_sid==12 || cell_sid==18){lay=4;}
260 else if(cell_sid==13 || cell_sid==19){lay=5;}
261 else if(cell_sid==15 || cell_sid==17){lay=5;}
262 else if(cell_sid==14 || cell_sid==20){lay=6;}
263 else if(cell_sid==16) {lay=6;}
264 else if(cell_sid==8 ){lay=7;}
265 else if(cell_sid==9 ){lay=8;}
266 else if(cell_sid==10 ){lay=9;}
267 else if(cell_sid==11 ){lay=10;}
268 if(lay==-1) continue;
269 double dif_eta =
cell->eta() - etrack[lay][3];
270 double dif_phi =
cell->phi() - etrack[lay][4];
271 if(dif_phi<0) dif_phi=-dif_phi;
272 if(dif_phi>
M_PI){dif_phi=2*
M_PI-dif_phi;}
273 double deltaR = sqrt(dif_eta*dif_eta+dif_phi*dif_phi);
276 while(i!=outputCells->size()){
if(outputCells->
at(i)==cell){
break;}
i++;}
277 if(i==outputCells->size()){
279 }
280 assocItr->push_back(i);
281 }
282 }
283 ++assocItr;
284 }
285
286 ATH_MSG_DEBUG(
"Number of selected cells: " << outputCells->size());
287
292
293
294 return StatusCode::SUCCESS;
295
296}
Scalar deltaR(const MatrixBase< Derived > &vec) const
#define CHECK(...)
Evaluate an expression and check for errors.
std::vector< std::vector< int > > ASSOCCONTAINER
#define ASSOCCONTAINER_CONSTRUCTOR(size)
ServiceHandle< StoreGateSvc > & evtStore()
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ElementProxy at(size_type n)
Access an element, as an lvalue.
DataModel_detail::const_iterator< DataVector > const_iterator
const T * at(size_type n) const
Access an element, as an rvalue.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
void makePrivateStore()
Create a new (empty) private store for this object.
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
CaloClusterCellLink::const_iterator const_cell_iterator
Iterator of the underlying CaloClusterCellLink (explicitly const version)
const_cell_iterator cell_end() const
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
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.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
retrieve(aClass, aKey=None)
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
CaloClusterAuxContainer_v2 CaloClusterAuxContainer
Define the latest version of the calorimeter cluster auxiliary container.