21 SelectByList() : used_set(nullptr) {};
22 const std::set<unsigned int>* used_set;
26 return (used_set->find(eb)==used_set->end());
46 return StatusCode::SUCCESS;
52 ATH_MSG_DEBUG(
"Starting HIEventShapeJetIteration execution" );
55 getShapes(input_shape,output_shape,
true).ignore();
76 theCaloJets = readHandleCaloJets.
cptr();
80 theTrackJets = readHandleTrackJets.
cptr();
85 ATH_MSG_ERROR(
"Incompatible options. Cannot track jets and constituents together.");
89 std::set<unsigned int> used_indices;
90 std::set<unsigned int> used_eta_bins;
92 std::vector<const xAOD::CaloCluster*> assoc_clusters;
93 assoc_clusters.reserve(6400);
106 auto modShape = std::make_unique<xAOD::HIEventShapeContainer> ();
107 auto modShapeAux = std::make_unique<xAOD::HIEventShapeAuxContainer> ();
108 modShape->setStore( modShapeAux.get() );
111 modShape->push_back(
ms);
115 if(write_handle_modShape.
record ( std::move(modShape), std::move(modShapeAux)).isFailure() ){
125 std::set<unsigned int>& used_indices, std::set<unsigned int>& used_eta_bins)
const
127 for(
const auto *theJet : *theJets)
130 std::vector<const xAOD::IParticle*> assoc_clusters;
140 return StatusCode::FAILURE;
144 << std::setw(10) << jet4mom.Eta()
145 << std::setw(10) << jet4mom.Phi()
146 << std::setw(10) << jet4mom.E()*1
e-3
147 << std::setw(25) <<
" has " << assoc_clusters.size() <<
" assoc. clusters");
149 for(
auto & assoc_cluster : assoc_clusters)
151 if( jet4mom.DeltaR( assoc_cluster->p4() ) >
m_excludeDR )
continue;
155 if(used_indices.insert(tower_index).second)
157 particleList.push_back(cl_ptr);
162 return StatusCode::SUCCESS;
168 std::set<unsigned int> used_indices;
169 std::set<unsigned int> used_eta_bins;
170 return makeClusterList(particleList,theJets,used_indices,used_eta_bins);
174 std::set<unsigned int> used_indices;
175 std::set<unsigned int> used_eta_bins;
176 for(
const auto *theJets : theJets_vector)
180 return StatusCode::SUCCESS;
185 if(es_index==
nullptr)
190 if(es_index==
nullptr)
196 for(
const auto *assoc_cluster : assoc_clusters)
203 for(
auto s : *output_shape)
205 float sum_et=
s->et();
207 if(sum_et!=0.) sum_nc=
s->rho()*
s->area()/sum_et;
208 s->setNCells(sum_nc);
227 if (!read_handle_cont.
isValid()) {
229 return(StatusCode::FAILURE);
231 summary_container = read_handle_cont.
cptr();
234 for(
const auto *
sh : *summary_container)
245 if (!s_fcal) std::abort();
246 if(
scheme==3) (*ms)=(*s_fcal);
249 float et_fcal=s_fcal->
et();
250 float et_fcal_recip=0;
251 if(et_fcal > 0.) et_fcal_recip=1.0/et_fcal;
252 for(
unsigned int ih=0; ih <
ms->etCos().
size(); ih++)
254 float qx=
ms->etCos().at(ih);
255 float qy=
ms->etSin().at(ih);
257 float qx_fcal=s_fcal->
etCos().at(ih);
258 float qy_fcal=s_fcal->
etSin().at(ih);
260 ms->etCos()[ih]=(qx*qx_fcal+qy*qy_fcal)*et_fcal_recip;
261 ms->etSin()[ih]=(qy*qx_fcal-qx*qy_fcal)*et_fcal_recip;
265 return StatusCode::SUCCESS;
274 for(
unsigned int used_indice : used_indices)
283 for(
auto &&
i : *output_shape)
286 float eta0=0.5*(
s->etaMin()+
s->etaMax());
288 double neff=nphibins-mod_counts[eb];
290 if (neff-mod_factors[eb] != 0) {
291 cf=neff/(neff-mod_factors[eb]);
297 s->setEt(
s->et()*cf);
298 s->setRho(
s->rho()*cf);
301 return StatusCode::SUCCESS;
309 input_shape = readHandleEvtShape.
ptr();
316 output_shape=shape_copy.first;
320 if(writeHandleEvtShape.
record ( std::move(unique_first_copy), std::move(unique_second_copy)).isFailure() ){
322 return(StatusCode::FAILURE);
329 auto output_shapex=std::make_unique<xAOD::HIEventShapeContainer> ();
330 auto output_Aux=std::make_unique<xAOD::HIEventShapeAuxContainer> ();
331 output_shapex->setStore( output_Aux.get() );
332 output_shapex->reserve( input_shape->
size() );
334 for(
const auto *
s : *input_shape)
337 output_shapex->push_back(s_copy);
342 if(writeHandleEvtShape.
record ( std::move(output_shapex), std::move(output_Aux)).isFailure() ){
344 return(StatusCode::FAILURE);
346 output_shape = writeHandleEvtShape.
ptr();
351 return StatusCode::SUCCESS;