|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "GaudiKernel/ITHistSvc.h"
31 m_thistSvc(
"THistSvc",
name )
33 declareInterface<IJetDecorator>(
this);
48 return StatusCode::FAILURE;
50 TFile tf(
fname.c_str());
53 return StatusCode::FAILURE;
56 std::vector<std::string> histsInSvc =
m_thistSvc->getHists();
58 TListIter
next(tf.GetListOfKeys());
62 if(
hname.find(
'_')==std::string::npos)
continue;
64 std::string para =
hname.substr(
hname.find(
'_')+1);
69 if(
find(histsInSvc.begin(),histsInSvc.end(),location)==histsInSvc.end()){
73 return StatusCode::FAILURE;
83 int ret = sscanf(para.c_str(),
"sample%d_pt%lf_%lf_eta%lf_%lf_phi%lf_%lf",
95 return StatusCode::FAILURE;
100 <<
" ptMin=" << ptMin <<
" ptMax=" << ptMax
102 <<
" phiMin=" << phiMin <<
" phiMax=" << phiMax <<
endmsg;
108 ATH_MSG_ERROR(
"JetBadChanCorrTool needs to have its input jet container name configured!");
109 return StatusCode::FAILURE;
125 return StatusCode::SUCCESS;
130 return StatusCode::SUCCESS;
140 if (!handle.isValid()){
142 return StatusCode::FAILURE;
145 const auto *badCellMap = handle.cptr();
154 corrCellHandle(*
jet) = -1.;
155 corrDotxHandle(*
jet) = -1.;
156 corrJetHandle(*
jet) = -1.;
157 corrJetForCellHandle(*
jet) = -1.;
159 return StatusCode::SUCCESS;
175 double rawPt = p4.Pt();
176 double rawE = p4.E();
179 double corr_jet_associate=0;
180 double corr_jet_forcell=0;
187 for( ;cellIt!=cellItE; ++cellIt) {
191 double cellWeight = cellIt.
weight();
193 double cell_energy =
cell->e() * cellWeight;
197 bool considerBad =
cell->badcell();
204 if(
cell->provenance() & 0x0200)
210 double frac = frac_cell * cellWeight;
212 corr_jet_associate +=
frac;
218 corr_dotx += cell_energy;
220 corr_cell += cell_energy;
222 corr_jet_forcell +=
frac;
227 const double inv_rawE = 1. / rawE;
228 corr_cell *= inv_rawE;
229 corr_dotx *= inv_rawE;
231 <<
" BCH_CORR_CELL=" << corr_cell
232 <<
" BCH_CORR_DOTX=" << corr_dotx
233 <<
" BCH_CORR_JET=" << corr_jet_associate
234 <<
" BCH_CORR_JET_FORCELL=" << corr_jet_forcell <<
endmsg;
236 corrCellHandle(*
jet) = corr_cell;
237 corrDotxHandle(*
jet) = corr_dotx;
238 corrJetForCellHandle(*
jet) = corr_jet_forcell;
242 corrJetHandle(*
jet) = corr_jet_associate;
244 return StatusCode::SUCCESS;
249 ATH_MSG_DEBUG(
" Missing cells for cone search "<< badCellMap->
size() <<
" jet="<<
jet->index() <<
" R="
250 <<
jet->getSizeParameter() <<
" input="<<
jet->getInputType() <<
" jet_eta="<<
jet->eta() ) ;
252 double corr_jet_cone=0;
256 double jeteta =
jet->eta();
257 double jetphi =
jet->phi();
258 std::vector<jet::CellPosition> closeCells = badCellMap->
cellsInDeltaR(jeteta,jetphi,
jet->getSizeParameter() );
262 for(; itr!=itrE; ++itr){
264 double cell_eta = itr->x();
265 double cell_phi = itr->phi();
270 double frac_cell =
getProfile(rawPt,
dr, sampling, cell_eta, cell_phi);
272 corr_jet_cone += frac_cell;
275 return corr_jet_cone;
286 size_t nconstit=
jet->numConstituents();
287 for(
size_t i=0;
i<nconstit;
i++) {
293 if(
v) corrCell += badE;
297 if(rawE==0) corrCellHandle(*
jet) = 0;
298 else corrCellHandle(*
jet) = corrCell / rawE;
300 return StatusCode::SUCCESS;
306 for(; itr!=itrE; ++itr){
308 return (*itr).frac(
dr);
JetConstituentVector::iterator iterator
static const_iterator end(const xAOD::Jet *jet)
Scalar phi() const
phi method
std::string find(const std::string &s)
return a remapped string
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Scalar eta() const
pseudorapidity method
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
virtual Type::ObjectType type() const =0
The type of the object as a simple enumeration.
const std::string & key() const
Return the StoreGate ID for the referenced object.
Class providing the definition of the 4-vector interface.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
unsigned int size() const
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Description of a calorimeter cluster.
std::vector< CellPosition > cellsInDeltaR(double eta, double phi, double r) const
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
Handle class for adding a decoration to an object.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
static const_iterator begin(const xAOD::Jet *jet)
@ ENG_BAD_CELLS
Total em-scale energy of bad cells in this cluster.
bool is_tile() const
cell belongs to Tile
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Helpers for checking error return status codes and reporting errors.
Wrapper to avoid constant divisions when using units.
Data object for each calorimeter readout cell.
CaloCell_ID::CaloSample getSampling() const
cell sampling
weight_t weight() const
Accessor for weight associated to this cell.
float eta() const
cell eta
float phi() const
cell phi