 |
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;
131 ATH_MSG_DEBUG(
"Initialized decorator name: " << jetCleanDFName );
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;
392 std::unordered_map<unsigned int, std::vector<std::unique_ptr<JCT::HotCell>>>::const_iterator hotCells =
m_hotCellsMap.find(
runNumber);
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;
458 std::vector<unsigned int>
runNumbers = JCT::utils::vectorize<unsigned int>(runNumbersString,
", ");
462 return StatusCode::FAILURE;
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)
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;
SG::ConstAccessor< std::vector< float > > m_ePerSamp
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)
const std::string & key() const
Return the StoreGate ID for the referenced object.
string varName
end cluster ToT and charge
::StatusCode StatusCode
StatusCode definition for legacy code.
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)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
bool getCutResult(const std::string &cutName) const
Get the result of a cut, based on the cut name (safer)
#define ATH_MSG_WARNING(x)
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
int addCut(const std::string &cutName, const std::string &cutDescription)
Add a cut; returning the cut position.