31 const float eta0=cl->eta0();
32 const float phi0=cl->phi0();
34 float mod=modulator->getModulation(phi0, eshape);
43 float eta=(*cellIter)->eta();
44 float phi=(*cellIter)->phi();
46 float nCells=
index->getShape(eta0,sample,shape)->nCells();
48 if(nCells!=0.) rho=
index->getShape(eta0,sample,shape)->rho()/nCells;
50 float geoWeight=cellIter.weight();
51 float cell_E_w=(*cellIter)->energy()*geoWeight;
68 float sig=(E_unsubtr!=0. ? E_cl/E_unsubtr : 0.);
70 float ET_cl=(std::abs(eta_cl)>99. ? 0. : E_cl/std::cosh(eta_cl));
71 subtr_mom.SetPxPyPzE(ET_cl*std::cos(phi_cl),ET_cl*std::sin(phi_cl),ET_cl*std::sinh(eta_cl),E_cl);
76 float eta0=cl->eta0();
77 float phi0=cl->phi0();
89 float sgn=(isNeg) ? -1 : 1;
92 float cell_et = theCell->
et();
94 unsigned int iSlice=
index->getIndex(eta0,layer);
99 slice->setNCells(slice->nCells()+sgn);
100 slice->setEt(slice->et()+sgn*cell_et*geoWeight);
104 slice->setArea(slice->area() + sgn*
area*geoWeight);
105 slice->setRho(slice->rho() + sgn*rho);
107 for(
unsigned int ih=0; ih<shape->
at(iSlice)->etCos().size(); ih++)
110 float tmp_cos = shape->
at(iSlice)->etCos().at(ih);
111 shape->
at(iSlice)->etCos()[ih] = tmp_cos + cell_et*cos(ih_f*phi0)*geoWeight;
113 float tmp_sin = shape->
at(iSlice)->etSin().at(ih);
114 shape->
at(iSlice)->etSin()[ih] = tmp_sin + cell_et*sin(ih_f*phi0)*geoWeight;
128 const float eta0=cl->eta0();
129 const float phi0=cl->phi0();
131 float mod=modulator->getModulation(phi0, eshape);
138 std::vector<float> E_sample(CaloSampling::Unknown,0);
139 uint32_t samplingPattern=0;
141 const auto *cellLink = cl->getCellLinks();
142 if( cellLink == NULL){
143 ATH_MSG_ERROR(
"HIJetCellSubtraction: cellLink null - returning");
153 samplingPattern |= (0x1U<<sample);
154 float eta=(*cellIter)->eta();
155 float phi=(*cellIter)->phi();
157 float nCells=
index->getShape(eta0,sample,shape)->nCells();
159 if(nCells!=0.) rho=
index->getShape(eta0,sample,shape)->rho()/nCells;
162 float geoWeight=cellIter.weight();
163 float cell_E_w=(*cellIter)->energy()*geoWeight;
167 eta_cl+=cell_E_w*
eta;
168 phi_cl+=cell_E_w*
phi;
170 E_sample[sample]+=cell_E_w;
172 float abs_weight=std::abs(cell_E_w);
173 float cell_x=(*cellIter)->x();
174 float cell_y=(*cellIter)->y();
175 float cell_z=(*cellIter)->z();
177 er2+=std::sqrt(cell_x*cell_x+cell_y*cell_y+cell_z*cell_z)*abs_weight;
186 float sig=(E_unsubtr!=0. ? E_cl/E_unsubtr : 0.);
188 float ET_cl=(std::abs(eta_cl)>99. ? 0. : E_cl/std::cosh(eta_cl));
190 subtr_mom.SetPxPyPzE(ET_cl*std::cos(phi_cl),ET_cl*std::sin(phi_cl),ET_cl*std::sinh(eta_cl),E_cl);
193 cl->setSamplingPattern(samplingPattern);
194 for(
unsigned int isample=0; isample < E_sample.size(); isample++)
196 if( samplingPattern & (0x1U << isample) )
198 float current_energy=E_sample.at(isample);
200 cl->setEnergy(s,current_energy);
205 if(etot2!=0.)
cm=er2/etot2;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Helper class to provide constant type-safe access to aux data.
Helper class to provide type-safe access to aux data.
Data object for each calorimeter readout cell.
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
virtual double et() const override final
get et
CaloCell_ID::CaloSample getSampling() const
cell sampling
const T * at(size_type n) const
Access an element, as an rvalue.
Helper class to provide type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
CaloClusterCellLink::iterator cell_iterator
Iterator of the underlying CaloClusterCellLink (non-const version)
CaloClusterCellLink::const_iterator const_cell_iterator
Iterator of the underlying CaloClusterCellLink (explicitly const version)
@ CENTER_MAG
Cluster Centroid ( )
CaloSampling::CaloSample CaloSample
Class providing the definition of the 4-vector interface.
TLorentzVector FourMom_t
Definition of the 4-momentum type.
void prefetchNext(Iter iter, Iter endIter)
Prefetch next object in sequence.
float getAreaEtaPhi(const CaloCell *theCell)
constexpr xAOD::CaloCluster::State unsubtractedClusterState()
constexpr xAOD::CaloCluster::State subtractedClusterState()
void setClusterP4(const xAOD::CaloCluster::FourMom_t &p, xAOD::CaloCluster *cl, xAOD::CaloCluster::State s)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
HIEventShapeContainer_v2 HIEventShapeContainer
Define the latest version of the container.
HIEventShape_v2 HIEventShape
Definition of the latest event info version.
Functions to prefetch blocks of memory.