37 const float eta0=cl->eta0();
38 const float phi0=cl->phi0();
40 if(modulator) mod=modulator->getModulation(phi0, eshape);
42 float energy=E_unsubtr;
49 float DF_weight=HIEtaPhiWeightAcc(*cl);
50 if(DF_weight!=0.) mod/=DF_weight;
55 ATH_MSG_ERROR(
"No HIEventShape supplied, cannot do subtraction");
63 ATH_MSG_ERROR(
"No HIEventShapeIndex supplied, cannot do subtraction");
67 for(
unsigned int sample=0; sample<24; sample++)
70 if(!cl->hasSampling(s))
continue;
72 float nCells=
index->getShape(eta0,sample,shape)->nCells();
74 if(nCells!=0.) rho=
index->getShape(eta0,sample,shape)->rho()/nCells;
75 rho*=mod*std::cosh(eta0);
82 energy=E_unsubtr-E_subtr;
85 eta=eta_unsubtr+(eta_unsubtr*E_subtr-E_eta_subtr)/energy;
86 phi=phi_unsubtr+(phi_unsubtr*E_subtr-E_phi_subtr)/energy;
94 float area=shape->
at(es_bin)->area();
95 float rho=(
area==0.) ? 0. : shape->
at(es_bin)->et()/
area;
97 rho*=mod*std::cosh(eta0);
99 energy=E_unsubtr-E_subtr;
104 << std::setw(8) << eta0
105 << std::setw(8) << phi0
106 << std::setw(10) << std::setprecision(3) << modulator->getModulation(phi0, eshape)
107 << std::setw(10) << std::setprecision(3) << mod
108 << std::setw(10) << std::setprecision(3) << modulator->getModulation(phi0, eshape)/mod
109 << std::setw(10) << std::setprecision(3) <<
area
110 << std::setw(10) << std::setprecision(3) << rho*
area
111 << std::setw(10) << std::setprecision(3) << E_unsubtr*1e-3
112 << std::setw(10) << std::setprecision(3) << E_subtr*1e-3
113 << std::setw(10) << std::setprecision(3) << E_unsubtr*1e-3/std::cosh(eta0)
114 << std::setw(10) << std::setprecision(3) << E_subtr*1e-3/std::cosh(eta0));
120 float ET=energy/std::cosh(
eta);
121 subtr_mom.SetPxPyPzE(ET*std::cos(
phi),ET*std::sin(
phi),ET*std::sinh(
eta),energy);
127 float eta0=cl->eta0();
128 float phi0=cl->phi0();
132 for(
unsigned int sample=0; sample<24; sample++)
135 if(!cl->hasSampling(s))
continue;
136 float esamp=cl->eSample(s);
137 float ET=esamp/std::cosh(eta0);
139 float area_cluster=
getWeight(eta0,phi0,sample);
153 float HI_weight=HIEtaPhiWeightAcc(*cl);
176 TFile* f=TFile::Open(full_path.c_str());
180 return StatusCode::FAILURE;
183 m_h3W=(TH3F*)f->GetObjectChecked(
"h3_w",
"TH3F");
186 ATH_MSG_FATAL(
"Cannot find TH3F m_h3W in config file " << full_path );
187 return StatusCode::FAILURE;
190 m_h3Eta=(TH3F*)f->GetObjectChecked(
"h3_eta",
"TH3F");
193 ATH_MSG_FATAL(
"Cannot find TH3F m_h3Eta in config file " << full_path );
194 return StatusCode::FAILURE;
197 m_h3Phi=(TH3F*)f->GetObjectChecked(
"h3_phi",
"TH3F");
200 ATH_MSG_FATAL(
"Cannot find TH3F m_h3Phi in config file " << full_path );
201 return StatusCode::FAILURE;
203 m_h3W->SetDirectory(0);
210 return StatusCode::SUCCESS;
251 float area_slice=slice->area();
254 if(area_slice!=0.) area_sf-=area_cluster/area_slice;
255 slice->setNCells( std::floor(area_sf*slice->nCells()) );
256 slice->setEt(slice->et()-ET);
257 slice->setArea(area_slice-area_cluster);
259 slice->setRho(slice->rho() - ET/area_cluster);
262 for(
unsigned int ih=0; ih<slice->etCos().size(); ih++)
265 float tmp_cos = slice->etCos().at(ih);
266 slice->etCos()[ih] = tmp_cos + cos(ih_f*phi0)*ET;
268 float tmp_sin = slice->etSin().at(ih);
269 slice->etSin()[ih] = tmp_sin + sin(ih_f*phi0)*ET;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_VERBOSE(x)
Helper class to provide constant type-safe access to aux data.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
const T * at(size_type n) const
Access an element, as an rvalue.
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Class providing the definition of the 4-vector interface.
TLorentzVector FourMom_t
Definition of the 4-momentum type.
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)
constexpr float getBinArea()
unsigned int findBinEta(float eta)
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.