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;
166 const double sumpttrk,
175 const double chf=sumpttrk/pt;
180 if(
m_doUgly && fmaxIndex==17)
return acceptData;
185 if(isJetClean==0)
return acceptData;
186 else if (fmax<DBL_MIN)
return acceptData;
187 else if(std::fabs(
eta)<2.4 && chf/fmax<0.1)
return acceptData;
202 const double sumpttrk,
207 const double AverageLArQF,
216 if (pt<DBL_MIN)
return acceptData;
217 const double chf=sumpttrk/pt;
222 if(
m_doUgly && fmaxIndex==17)
return acceptData;
229 if (fmax>0.80)
return acceptData;
230 if (emf>0.96)
return acceptData;
242 if (!useLLP && !useSuperLLP) {
243 if(!isTrigger && emf<0.05 && chf<0.05 && std::fabs(
eta)<2)
return acceptData;
244 if(emf<0.05 && std::fabs(
eta)>=2)
return acceptData;
246 if(fmax>0.99 && std::fabs(
eta)<2)
return acceptData;
248 if(hecf>0.5 && std::fabs(hecq)>0.5 && AverageLArQF/65535>0.8)
return acceptData;
250 if(emf>0.95 && std::fabs(larq)>0.8 && std::fabs(
eta)<2.8 && AverageLArQF/65535>0.8)
return acceptData;
253 if (useLLP && std::fabs(negE*0.001)>4 && fmax >0.85)
return acceptData;
255 if (useSuperLLP && std::fabs(negE*0.001)>60)
return acceptData;
266 if (fmax<DBL_MIN)
return acceptData;
267 if(std::fabs(
eta)<2.4 && chf/fmax<0.1)
return acceptData;
282 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()));
283 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()));
288 std::vector<float> sumPtTrkvec;
291 if( ! sumPtTrkvec.empty() ) sumpttrk = sumPtTrkvec[0];
295 int FracSamplingMaxIndex = -1;
299 float FracSamplingMax = 0;
310 return accept (isJetClean, sumpttrk, FracSamplingMax,
jet.eta(),
jet.pt(), FracSamplingMaxIndex);
313 return accept (isJetClean, FracSamplingMaxIndex);
317 ATH_MSG_DEBUG(
"DFCommon jet cleaning variable not available ... Using jet cleaning tool");
329 float LArQuality = 0;
334 float HECQuality = 0;
345 float AverageLArQF = 0;
359 FracSamplingMaxIndex);}
372 return StatusCode::SUCCESS;
385 for (
const std::unique_ptr<JCT::HotCell>& cell : hotCells->second)
386 if (cell->jetAffectedByHotCell(
jet))
425 return StatusCode::FAILURE;
430 if (readCells.ReadFile(
m_hotCellsFile.value().c_str(),kEnvGlobal))
433 return StatusCode::FAILURE;
437 const TString runNumbersString = readCells.GetValue(
"RunNumbers",
"");
438 if (runNumbersString==
"")
441 return StatusCode::FAILURE;
446 if (runNumbers.empty())
449 return StatusCode::FAILURE;
453 for (
unsigned int run : runNumbers){
457 for (
size_t iCell = 0; iCell < 100; ++iCell)
459 const TString baseName = Form(
"Run%u.Cell%zu.",
run,iCell);
462 const int layer = readCells.GetValue(baseName+
"Layer", -1 );
463 const float minEta = readCells.GetValue(baseName+
"EtaMin",-10.);
464 const float maxEta = readCells.GetValue(baseName+
"EtaMax", 10.);
465 const float minPhi = readCells.GetValue(baseName+
"PhiMin",-10.);
466 const float maxPhi = readCells.GetValue(baseName+
"PhiMax", 10.);
469 if (layer < 0 && minEta < -5 && maxEta > 5 && minPhi < -5 && maxPhi > 5)
471 if (layer < 0 || minEta < -5 || maxEta > 5 || minPhi < -5 || maxPhi > 5)
474 ATH_MSG_ERROR(Form(
"Got Layer=%d, EtaMin=%f, EtaMax=%f, PhiMin=%f, PhiMax=%f",layer,minEta,maxEta,minPhi,maxPhi));
475 return StatusCode::FAILURE;
477 cellVec.emplace_back(std::make_unique<JCT::HotCell>(layer,minEta,maxEta,minPhi,maxPhi));
484 return StatusCode::FAILURE;
489 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".
int run(int argc, char *argv[])