![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
54 :
asg::AsgMessaging(
"HotCell")
59 , m_phiMax(phiMax) { }
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;
129 ATH_MSG_DEBUG(
"Initialized decorator name: " << jetCleanDFName );
138 return StatusCode::SUCCESS;
151 if(
m_doUgly && fmaxIndex==17)
return acceptData;
156 if(isJetClean==0)
return acceptData;
171 const double sumpttrk,
180 const double chf=sumpttrk/
pt;
185 if(
m_doUgly && fmaxIndex==17)
return acceptData;
190 if(isJetClean==0)
return acceptData;
191 else if (fmax<DBL_MIN)
return acceptData;
192 else if(std::fabs(
eta)<2.4 && chf/fmax<0.1)
return acceptData;
212 const double sumpttrk,
217 const double AverageLArQF,
226 if (
pt<DBL_MIN)
return acceptData;
227 const double chf=sumpttrk/
pt;
232 if(
m_doUgly && fmaxIndex==17)
return acceptData;
239 if (fmax>0.80)
return acceptData;
240 if (emf>0.96)
return acceptData;
252 if (!useLLP && !useSuperLLP) {
253 if(!isTrigger && emf<0.05 && chf<0.05 && std::fabs(
eta)<2)
return acceptData;
254 if(emf<0.05 && std::fabs(
eta)>=2)
return acceptData;
256 if(fmax>0.99 && std::fabs(
eta)<2)
return acceptData;
258 if(hecf>0.5 && std::fabs(hecq)>0.5 && AverageLArQF/65535>0.8)
return acceptData;
260 if(emf>0.95 && std::fabs(larq)>0.8 && std::fabs(
eta)<2.8 && AverageLArQF/65535>0.8)
return acceptData;
263 if (useLLP && std::fabs(negE*0.001)>4 && fmax >0.85)
return acceptData;
265 if (useSuperLLP && std::fabs(negE*0.001)>60)
return acceptData;
276 if (fmax<DBL_MIN)
return acceptData;
277 if(std::fabs(
eta)<2.4 && chf/fmax<0.1)
return acceptData;
292 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()));
293 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()));
298 std::vector<float> sumPtTrkvec;
301 if( ! sumPtTrkvec.empty() ) sumpttrk = sumPtTrkvec[0];
305 int FracSamplingMaxIndex = -1;
309 float FracSamplingMax = 0;
317 return accept (isJetClean, FracSamplingMaxIndex);
320 ATH_MSG_DEBUG(
"DFCommon jet cleaning variable not available ... Using jet cleaning tool");
332 float LArQuality = 0;
337 float HECQuality = 0;
348 float AverageLArQF = 0;
362 FracSamplingMaxIndex);}
375 return StatusCode::SUCCESS;
383 std::unordered_map<unsigned int, std::vector<std::unique_ptr<JCT::HotCell>>>::const_iterator hotCells =
m_hotCellsMap.find(
runNumber);
388 for (
const std::unique_ptr<JCT::HotCell>&
cell : hotCells->second)
389 if (
cell->jetAffectedByHotCell(
jet))
429 return StatusCode::FAILURE;
434 if (readCells.ReadFile(
m_hotCellsFile.value().c_str(),kEnvGlobal))
437 return StatusCode::FAILURE;
441 const TString runNumbersString = readCells.GetValue(
"RunNumbers",
"");
442 if (runNumbersString==
"")
445 return StatusCode::FAILURE;
449 std::vector<unsigned int>
runNumbers = JCT::utils::vectorize<unsigned int>(runNumbersString,
", ");
453 return StatusCode::FAILURE;
461 for (
size_t iCell = 0; iCell < 100; ++iCell)
463 const TString baseName = Form(
"Run%u.Cell%zu.",
run,iCell);
466 const int layer = readCells.GetValue(baseName+
"Layer", -1 );
467 const float minEta = readCells.GetValue(baseName+
"EtaMin",-10.);
468 const float maxEta = readCells.GetValue(baseName+
"EtaMax", 10.);
469 const float minPhi = readCells.GetValue(baseName+
"PhiMin",-10.);
470 const float maxPhi = readCells.GetValue(baseName+
"PhiMax", 10.);
473 if (
layer < 0 && minEta < -5 && maxEta > 5 && minPhi < -5 && maxPhi > 5)
475 if (
layer < 0 || minEta < -5 || maxEta > 5 || minPhi < -5 || maxPhi > 5)
479 return StatusCode::FAILURE;
481 cellVec.emplace_back(std::make_unique<JCT::HotCell>(
layer,minEta,
maxEta,minPhi,maxPhi));
488 return StatusCode::FAILURE;
493 return StatusCode::SUCCESS;
Scalar phi() const
phi method
Scalar eta() const
pseudorapidity method
HotCell(const int layer, const float etaMin, const float etaMax, const float phiMin, const float phiMax)
int run(int argc, char *argv[])
Helper class to provide constant type-safe access to aux data.
bool fileExists(const TString &fileName)
string varName
end cluster ToT and charge
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::AuxElement::ConstAccessor< std::vector< float > > m_ePerSamp
Handle class for adding a decoration to an object.
bool jetAffectedByHotCell(const xAOD::Jet &jet) const
Class mimicking the AthMessaging class from the offline software.
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)
#define ATH_MSG_WARNING(x)
int addCut(const std::string &cutName, const std::string &cutDescription)
Add a cut; returning the cut position.