41 HotCell(
const int layer,
const float etaMin,
const float etaMax,
const float phiMin,
const float phiMax);
53HotCell::HotCell(
const int layer,
const float etaMin,
const float etaMax,
const float phiMin,
const float phiMax)
64 const float eta =
jet.eta();
65 const float phi =
jet.phi();
74 ATH_MSG_WARNING(
"Could not retrieve EnergyPerSampling from jet, cleaning performance may be reduced");
76 if (fmaxIndex ==
m_layer || ePerSamp > 0.4)
119 ATH_MSG_ERROR(
"Tool initialized with unknown cleaning level." );
120 return StatusCode::FAILURE;
131 ATH_MSG_DEBUG(
"Initialized decorator name: " << jetCleanDFName );
133 m_accept.addCut(
"Cleaning",
"Cleaning of the jet" );
140 return StatusCode::SUCCESS;
153 if(
m_doUgly && fmaxIndex==17)
return acceptData;
158 if(isJetClean==0)
return acceptData;
173 const double sumpttrk,
182 const double chf=sumpttrk/pt;
187 if(
m_doUgly && fmaxIndex==17)
return acceptData;
192 if(isJetClean==0)
return acceptData;
193 else if (fmax<DBL_MIN)
return acceptData;
194 else if(std::fabs(
eta)<2.4 && chf/fmax<0.1)
return acceptData;
214 const double sumpttrk,
219 const double AverageLArQF,
228 if (pt<DBL_MIN)
return acceptData;
229 const double chf=sumpttrk/pt;
234 if(
m_doUgly && fmaxIndex==17)
return acceptData;
241 if (fmax>0.80)
return acceptData;
242 if (emf>0.96)
return acceptData;
254 if (!useLLP && !useSuperLLP) {
255 if(!isTrigger && emf<0.05 && chf<0.05 && std::fabs(
eta)<2)
return acceptData;
256 if(emf<0.05 && std::fabs(
eta)>=2)
return acceptData;
258 if(fmax>0.99 && std::fabs(
eta)<2)
return acceptData;
260 if(hecf>0.5 && std::fabs(hecq)>0.5 && AverageLArQF/65535>0.8)
return acceptData;
262 if(emf>0.95 && std::fabs(larq)>0.8 && std::fabs(
eta)<2.8 && AverageLArQF/65535>0.8)
return acceptData;
265 if (useLLP && std::fabs(negE*0.001)>4 && fmax >0.85)
return acceptData;
267 if (useSuperLLP && std::fabs(negE*0.001)>60)
return acceptData;
278 if (fmax<DBL_MIN)
return acceptData;
279 if(std::fabs(
eta)<2.4 && chf/fmax<0.1)
return acceptData;
294 ATH_MSG_FATAL(Form(
"JetCleaningTool failed to retrieve a required variable - please confirm that the xAOD::Jet being passed contains the variable named %s",varName.c_str()));
295 throw std::runtime_error(Form(
"JetCleaningTool failed to retrieve a required variable - please confirm that the xAOD::Jet being passed contains the variable named %s",varName.c_str()));
300 std::vector<float> sumPtTrkvec;
303 if( ! sumPtTrkvec.empty() ) sumpttrk = sumPtTrkvec[0];
307 int FracSamplingMaxIndex = -1;
311 float FracSamplingMax = 0;
322 return accept (isJetClean, sumpttrk, FracSamplingMax,
jet.eta(),
jet.pt(), FracSamplingMaxIndex);
325 return accept (isJetClean, FracSamplingMaxIndex);
329 ATH_MSG_DEBUG(
"DFCommon jet cleaning variable not available ... Using jet cleaning tool");
341 float LArQuality = 0;
346 float HECQuality = 0;
357 float AverageLArQF = 0;
371 FracSamplingMaxIndex);}
384 return StatusCode::SUCCESS;
397 for (
const std::unique_ptr<JCT::HotCell>& cell : hotCells->second)
398 if (cell->jetAffectedByHotCell(
jet))
438 return StatusCode::FAILURE;
443 if (readCells.ReadFile(
m_hotCellsFile.value().c_str(),kEnvGlobal))
446 return StatusCode::FAILURE;
450 const TString runNumbersString = readCells.GetValue(
"RunNumbers",
"");
451 if (runNumbersString==
"")
454 return StatusCode::FAILURE;
459 if (runNumbers.empty())
462 return StatusCode::FAILURE;
466 for (
unsigned int run : runNumbers){
470 for (
size_t iCell = 0; iCell < 100; ++iCell)
472 const TString baseName = Form(
"Run%u.Cell%zu.",
run,iCell);
475 const int layer = readCells.GetValue(baseName+
"Layer", -1 );
476 const float minEta = readCells.GetValue(baseName+
"EtaMin",-10.);
477 const float maxEta = readCells.GetValue(baseName+
"EtaMax", 10.);
478 const float minPhi = readCells.GetValue(baseName+
"PhiMin",-10.);
479 const float maxPhi = readCells.GetValue(baseName+
"PhiMax", 10.);
482 if (layer < 0 && minEta < -5 && maxEta > 5 && minPhi < -5 && maxPhi > 5)
484 if (layer < 0 || minEta < -5 || maxEta > 5 || minPhi < -5 || maxPhi > 5)
487 ATH_MSG_ERROR(Form(
"Got Layer=%d, EtaMin=%f, EtaMax=%f, PhiMin=%f, PhiMax=%f",layer,minEta,maxEta,minPhi,maxPhi));
488 return StatusCode::FAILURE;
490 cellVec.emplace_back(std::make_unique<JCT::HotCell>(layer,minEta,maxEta,minPhi,maxPhi));
497 return StatusCode::FAILURE;
502 return StatusCode::SUCCESS;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
SG::ConstAccessor< std::vector< float > > m_ePerSamp
bool jetAffectedByHotCell(const xAOD::Jet &jet) const
HotCell(const int layer, const float etaMin, const float etaMax, const float phiMin, const float phiMax)
Helper class to provide constant type-safe access to aux data.
Handle class for adding a decoration to an object.
void setCutResult(const std::string &cutName, bool cutResult)
Set the result of a cut, based on the cut name (safer)
bool getCutResult(const std::string &cutName) const
Get the result of a cut, based on the cut name (safer)
Class mimicking the AthMessaging class from the offline software.
AsgMessaging(const std::string &name)
Constructor with a name.
bool fileExists(const TString &fileName)
bool vectorize(const TString &str, const TString &sep, std::vector< T > &result)
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".