 |
ATLAS Offline Software
|
Go to the documentation of this file.
11 m_trigdec(
"Trig::TrigDecisionTool/TrigDecisionTool"),
12 m_matchTool(
"Trig::TrigEgammaMatchingToolMT/TrigEgammaMatchingToolMT")
34 std::vector<std::string>
steps = {
"L1Calo",
"L2Calo",
"L2",
"EFCalo",
"EFTrack",
"HLT"};
40 return StatusCode::SUCCESS;
51 const auto& ctx = Gaudi::Hive::currentContext() ;
52 if (pidname ==
"tight"){
55 else if (pidname ==
"medium"){
58 else if (pidname ==
"loose"){
61 else if (pidname ==
"lhtight"){
64 else if (pidname ==
"lhmedium"){
67 else if (pidname ==
"lhloose"){
70 else if (pidname ==
"lhvloose"){
73 else if (pidname ==
"dnntight"){
76 else if (pidname ==
"dnnmedium"){
79 else if (pidname ==
"dnnloose"){
93 const auto& ctx = Gaudi::Hive::currentContext() ;
94 if (pidname ==
"tight"){
97 else if (pidname ==
"medium"){
100 else if (pidname ==
"loose"){
117 ATH_MSG_DEBUG(
"Electron doesn't provide isolation for ptcone20");
120 if (!(fabs(
eg->pt()) > 0)) {
121 ATH_MSG_DEBUG(
"Electron pt is zero, can't calculate relative isolation");
127 if (isolation ==
"loose"){
128 if (ptcone20_rel > 0.1) {
137 ATH_MSG_DEBUG(
"No valid working point defined for " << isolation <<
" continue without isolation");
146 bool efprescale=
false;
147 bool l1prescale=
false;
150 std::string l1item=
"";
152 if(trigger.starts_with(
"L1" ))
154 if(trigger.starts_with(
"HLT")){
156 const unsigned int bit=
tdt()->isPassedBits(trigger);
157 efprescale=bit & TrigDefs::EF_prescaled;
158 rerun=bit&TrigDefs::EF_resurrected;
162 ATH_MSG_DEBUG(
"Checking prescale for " << trigger <<
" " << l1item);
163 const unsigned int l1bit=
tdt()->isPassedBits(l1item);
164 bool l1_afterpre=l1bit&TrigDefs::L1_isPassedAfterPrescale;
165 bool l1_beforepre=l1bit&TrigDefs::L1_isPassedBeforePrescale;
166 l1prescale=l1_beforepre && !l1_afterpre;
167 prescale=efprescale || l1prescale;
168 ATH_MSG_DEBUG(
"L1 prescale " << l1item <<
" " << l1prescale <<
" before " << l1_beforepre <<
" after " << l1_afterpre);
169 ATH_MSG_DEBUG(
"EF prescale " << trigger <<
" " << efprescale <<
" Prescale " << prescale);
170 if(rerun)
return false;
171 if(prescale)
return true;
181 unsigned int condition=TrigDefs::includeFailedDecisions;
185 bool passedL1Calo=
false;
186 bool passedL2Calo=
false;
187 bool passedEFCalo=
false;
189 bool passedEFTrk=
false;
193 auto trigger =
info.trigger;
205 if(
info.signature ==
"Electron"){
206 std::string
key =
match()->key(
"FastElectrons");
209 }
else if(
info.signature ==
"Photon"){
216 std::string
key =
match()->key(
"PrecisionCalo_Electron");
217 if(
info.signature ==
"Photon")
key =
match()->key(
"PrecisionCalo_Photon");
229 if(
info.signature ==
"Electron"){
233 std::string
key =
match()->key(
"Electrons_GSF");
239 }
else if(
info.signature ==
"Photon"){
253 if(
info.signature ==
"Electron"){
257 std::string
key =
match()->key(
"Electrons_GSF");
263 }
else if(
info.signature ==
"Photon"){
294 float dphi = fabs(phi1 - phi2) < TMath::Pi() ? fabs(phi1 - phi2) : 2*TMath:: \
295 Pi() - fabs(phi1 - phi2);
296 return sqrt(deta*deta + dphi*dphi);
303 if(
eg && (
eg->caloCluster())){
305 return fabs(cluster->etaBE(2));
312 if(
eg && (
eg->caloCluster()) && (
eg->trackParticle())){
315 float eta = fabs(trk->
eta());
316 return clus->
e()/cosh(
eta);
323 if(
eg && (
eg->caloCluster())){
325 float eta2 = fabs(cluster->etaBE(2));
326 return cluster->e()/cosh(
eta2);
338 float den = emax+emax2;
340 if (fabs(den) < 1
e-6)
return -99.;
342 float val = (emax-emax2)/(den);
350 if(
eg &&
eg->trackParticle()){
355 if (fabs(trtHits) < 1
e-6) {
359 return ( (
double)trtHTHits / (
double)trtHits );
371 float vard0 =
t->definingParametersCovMatrix()(0,0);
373 d0sigma=sqrtf(vard0);
387 float vard0 =
t->definingParametersCovMatrix()(0,0);
389 d0sigma=sqrtf(vard0);
393 if (fabs(d0sigma) < 1
e-6)
return -99.;
394 return t->d0()/d0sigma;
401 if(
eg && (
eg->caloCluster())){
403 return cluster->energyBE(0);
410 if(
eg && (
eg->caloCluster())){
412 return cluster->energyBE(1);
419 if(
eg && (
eg->caloCluster())){
421 return cluster->energyBE(2);
428 if(
eg && (
eg->caloCluster())){
430 return cluster->energyBE(3);
437 if(
eg && (
eg->caloCluster())){
439 float ebe1 = cluster->energyBE(1);
440 float ebe2 = cluster->energyBE(2);
441 float ebe3 = cluster->energyBE(3);
442 return (ebe1+ebe2+ebe3);
449 if(
eg && (
eg->caloCluster())){
451 float ebe0 = cluster->energyBE(0);
452 float ebe1 = cluster->energyBE(1);
453 float ebe2 = cluster->energyBE(2);
454 float ebe3 = cluster->energyBE(3);
455 float eacc = ebe1+ebe2+ebe3;
456 if(eacc==0.)
return 0.;
464 #define GETTER(_name_) float TrigEgammaMonitorBaseAlgorithm::getShowerShape_##_name_(const xAOD::Egamma* eg) const \
466 eg->showerShapeValue(val,xAOD::EgammaParameters::_name_); \
494 #define GETTER(_name_) float TrigEgammaMonitorBaseAlgorithm::getIsolation_##_name_(const xAOD::Electron* eg) const\
496 eg->isolationValue(val,xAOD::Iso::_name_); \
507 #define GETTER(_name_) float TrigEgammaMonitorBaseAlgorithm::getIsolation_##_name_(const xAOD::Egamma* eg) const\
509 eg->isolationValue(val,xAOD::Iso::_name_); \
522 #define GETTER(_name_) float TrigEgammaMonitorBaseAlgorithm::getCluster_##_name_(const xAOD::Egamma* eg) const\
523 { if(eg && eg->caloCluster()) \
524 return eg->caloCluster()->_name_(); \
533 #define GETTER(_name_) float TrigEgammaMonitorBaseAlgorithm::getTrack_##_name_(const xAOD::Electron* eg) const\
534 { if(eg && eg->trackParticle()) \
535 return eg->trackParticle()->_name_(); \
546 #define GETTER(_name_) float TrigEgammaMonitorBaseAlgorithm::getTrackSummary_##_name_(const xAOD::Electron* eg) const \
547 { uint8_t val_uint8{0}; \
549 eg->trackParticleSummaryValue(val_uint8,xAOD::_name_); \
550 return val_uint8; } \
569 #define GETTER(_name_) float TrigEgammaMonitorBaseAlgorithm::getTrackSummaryFloat_##_name_(const xAOD::Electron* eg) const\
570 { float val_float{0}; \
572 eg->trackParticleSummaryValue(val_float,xAOD::_name_); \
573 return val_float; } \
582 #define GETTER(_name_) float TrigEgammaMonitorBaseAlgorithm::getCaloTrackMatch_##_name_(const xAOD::Electron* eg) const\
583 { float val={-99.}; \
585 eg->trackCaloMatchValue(val,xAOD::EgammaParameters::_name_);} \
637 std::map<std::string, std::string> pidMap = { {
"vloose" ,
"loose" },
638 {
"loose" ,
"loose" },
639 {
"medium" ,
"medium" },
640 {
"tight" ,
"tight" },
641 {
"loose1" ,
"loose" },
642 {
"medium1" ,
"medium" },
643 {
"tight1" ,
"tight" },
644 {
"lhvloose" ,
"lhvloose" },
645 {
"lhloose" ,
"lhloose" },
646 {
"lhmedium" ,
"lhmedium" },
647 {
"lhtight" ,
"lhtight" },
648 {
"dnnloose" ,
"dnnloose" },
649 {
"dnnmedium",
"dnnmedium"},
650 {
"dnntight" ,
"dnntight" } };
652 std::vector<std::string> isoNames = {
"ivarloose",
"ivarmedium",
"ivartight",
"icaloloose",
"icalomedium",
"icalotight"};
659 bool isolated =
false;
661 std::string isolation=
"";
664 std::string hltinfo=trigger;
665 std::string signature =
"";
671 std::vector<std::string>
parts;
677 signature =
"Electron";
680 signature =
"Photon";
687 if(
parts.at(1) ==
"idperf"){
691 else if(
parts.at(1)==
"etcut"){
697 pidname = pidMap.at(
parts.at(1));
706 for(
auto& iso : isoNames){
708 isolation=iso; isolated=
true;
break;
713 std::string str_thr =
parts.at(0);
714 str_thr.erase( 0, 1);
722 ATH_MSG_DEBUG(
"=================== Chain Parser =======================");
734 ATH_MSG_DEBUG(
"L1Seed : " << l1seed <<
" (Is Legacy? " << (l1legacy?
"Yes":
"No") <<
")");
735 ATH_MSG_DEBUG(
"========================================================");
737 TrigInfo info{l1legacy,l1seed,trigger,signature,
threshold,pidname,idperf,etcut,nogsf,lrt,ion,isolation,isolated};
745 std::vector<std::string>
parts;
748 std::string l1seed =
parts.back();
754 return m_trigdec->ExperimentalAndExpertMethods().isHLTTruncated();
763 #include "Gaudi/Parsers/Factory.h"
776 #include "GaudiKernel/ToStream.h"
783 for (
const auto& dict : vecDict ) {
float getDEmaxs1(const xAOD::Egamma *eg) const
ToolHandleArray< IAsgPhotonIsEMSelector > m_photonIsEMTool
Offline isEM Photon Selectors.
bool isIsolated(const xAOD::Electron *, const std::string &) const
Check if electron fulfils isolation criteria.
float getEnergyBE1(const xAOD::Egamma *eg) const
float dR(const float, const float, const float, const float) const
Get delta R.
Extra patterns decribing particle interation process.
@ deltaPhi0
difference between the cluster phi (presampler) and the eta of the track extrapolated to the presampl...
@ topoetcone20
Topo-cluster ET-sum.
@ ptvarcone20
Mini-Isolation http://arxiv.org/abs/1007.2221.
@ eProbabilityComb
Electron probability from combining the below probabilities [float].
@ deltaPhi3
difference between the cluster eta (3rd sampling) and the eta of the track extrapolated to the 3rd sa...
StatusCode parse(std::tuple< Tup... > &tup, const Gaudi::Parsers::InputData &input)
Scalar phi() const
phi method
ToolHandle< Trig::TrigDecisionTool > m_trigdec
Trigger decision tool.
std::ostream & toStream(const SG::VarHandleKeyArray &v, std::ostream &o)
Gaudi function used to convert a property to a string.
float getEt(const xAOD::Electron *eg) const
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
asg::AcceptData setAccept(const TrigCompositeUtils::Decision *, const TrigInfo &, const bool) const
Set the accept object for all trigger levels.
@ numberOfTRTXenonHits
number of TRT hits on track in straws with xenon [unit8_t].
bool ApplyPhotonPid(const xAOD::Photon *eg, const std::string &) const
Get offline electron decision.
@ deltaEta0
difference between the cluster eta (presampler) and the eta of the track extrapolated to the presampl...
@ deltaEta2
difference between the cluster eta (second sampling) and the eta of the track extrapolated to the sec...
@ ptcone20
Track isolation.
@ ethad1
transverse energy in the first sampling of the hadronic calorimeters behind the cluster calculated fr...
setEt setPhi setE277 setWeta2 eta1
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
@ deltaPhiRescaled3
difference between the cluster eta (3rd sampling) and the eta of the track extrapolated to the 3rd sa...
@ numberOfTRTHits
number of TRT hits [unit8_t].
const ToolHandle< Trig::TrigDecisionTool > & tdt() const
Get the TDT
float getE0Eaccordion(const xAOD::Egamma *eg) const
@ wtots1
shower width is determined in a window detaxdphi = 0,0625 ×~0,2, corresponding typically to 20 strips...
float getEnergyBE0(const xAOD::Egamma *eg) const
float getEnergyBE3(const xAOD::Egamma *eg) const
@ numberOfTRTHighThresholdHits
number of TRT hits which pass the high threshold (only xenon counted) [unit8_t].
@ deltaPhi1
difference between the cluster eta (1st sampling) and the eta of the track extrapolated to the 1st sa...
Base class for Athena Monitoring Algorithms.
@ f3
fraction of energy reconstructed in 3rd sampling
bool isHLTTruncated() const
@ numberOfInnermostPixelLayerOutliers
number of 0th layer barrel outliers
@ ethad
ET leakage into hadronic calorimeter with exclusion of energy in CaloSampling::TileGap3.
TrigInfo getTrigInfo(const std::string &) const
Get the trigger info parsed from the chain name (only single lepton triggers)
@ numberOfTRTHighThresholdOutliers
number of TRT high threshold outliers (only xenon counted) [unit8_t].
Description of a calorimeter cluster.
std::map< std::string, TrigInfo > m_trigInfo
creates map of trigger name and TrigInfo struct
Gaudi::Property< std::string > m_defaultProbePidElectron
default probe pid for electron trigitems that don't have pid in their name
void setTrigInfo(const std::string &)
Set the trigger info parsed from the chain name.
@ etcone20
Calorimeter isolation.
::StatusCode StatusCode
StatusCode definition for legacy code.
@ emins1
energy reconstructed in the strip with the minimal value between the first and second maximum
ToolHandle< Trig::TrigEgammaEmulationToolMT > m_emulatorTool
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
@ e011
uncalibrated energy (sum of cells) in presampler in a 1x1 window in cells in eta X phi
@ deltaEta3
difference between the cluster eta (3rd sampling) and the eta of the track extrapolated to the 3rd sa...
@ numberOfPixelOutliers
these are the pixel outliers, including the b-layer [unit8_t].
@ deltaPhiRescaled2
difference between the cluster phi (second sampling) and the phi of the track extrapolated to the sec...
ToolHandleArray< IAsgElectronIsEMSelector > m_electronIsEMTool
Offline isEM Selectors.
@ deltaPhiRescaled0
difference between the cluster phi (presampler) and the eta of the track extrapolated to the presampl...
Class used to describe composite objects in the HLT.
float getEaccordion(const xAOD::Egamma *eg) const
ToolHandleArray< IAsgElectronLikelihoodTool > m_electronLHTool
Offline LH Selectors.
double atof(std::string_view str)
Converts a string into a double / float.
float getEta2(const xAOD::Egamma *eg) const
Features helper.
bool ApplyElectronPid(const xAOD::Electron *eg, const std::string &) const
Get offline electron decision.
float getSigmaD0(const xAOD::Electron *eg) const
@ deltaPhi2
difference between the cluster phi (second sampling) and the phi of the track extrapolated to the sec...
std::ostream & operator<<(std::ostream &lhs, const TestGaudiProperty &rhs)
std::vector< Dict_t > VecDict_t
ToolHandle< TrigEgammaMatchingToolMT > m_matchTool
TrigEgammaMonitorBaseAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
const ToolHandle< TrigEgammaMatchingToolMT > & match() const
Get the e/g match tool.
virtual StatusCode initialize() override
initialize
@ numberOfTRTOutliers
number of TRT outliers [unit8_t].
@ pixeldEdx
the dE/dx estimate, calculated using the pixel clusters [?]
@ deltaPhiRescaled1
difference between the cluster eta (1st sampling) and the eta of the track extrapolated to the 1st sa...
ToolHandleArray< IAsgElectronLikelihoodTool > m_electronDNNTool
Offline DNN Selectors.
float getD0sig(const xAOD::Electron *eg) const
void setCutResult(const std::string &cutName, bool cutResult)
Set the result of a cut, based on the cut name (safer)
@ numberOfSCTOutliers
number of SCT outliers [unit8_t].
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [unit8_t].
float rTRT(const xAOD::Electron *eg) const
@ eProbabilityHT
Electron probability from High Threshold (HT) information [float].
=============================================================================
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ e277
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 7x7
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].
@ weta1
shower width using +/-3 strips around the one with the maximal energy deposit: w3 strips = sqrt{sum(E...
@ e132
uncalibrated energy (sum of cells) in strips in a 3x2 window in cells in eta X phi
@ Eratio
(emaxs1-e2tsts1)/(emaxs1+e2tsts1)
Class describing a TrackParticle.
@ e237
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 3x7
#define GETTER(_name_)
Macros for plotting.
@ deltaEta1
difference between the cluster eta (first sampling) and the eta of the track extrapolated to the firs...
float getEnergyBE2(const xAOD::Egamma *eg) const
@ f3core
E3(3x3)/E fraction of the energy reconstructed in the third compartment of the electromagnetic calori...
@ e2tsts1
energy of the cell corresponding to second energy maximum in the first sampling
virtual StatusCode initialize() override
initialize
Gaudi::Property< std::string > m_defaultProbePidPhoton
default probe pid for photon trigitems that don't have pid in their name
bool isPrescaled(const std::string &) const
Check if the event is prescaled.
@ emaxs1
energy of strip with maximal energy deposit
virtual double e() const
The total energy of the particle.
virtual ~TrigEgammaMonitorBaseAlgorithm()
std::string getL1Item(const std::string &trigger) const
Creates static map to return L1 item from trigger name.
@ fracs1
shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in ± n strip...
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
int addCut(const std::string &cutName, const std::string &cutDescription)
Add a cut; returning the cut position.
float getEtCluster37(const xAOD::Egamma *eg) const
@ weta2
the lateral width is calculated with a window of 3x5 cells using the energy weighted sum over all cel...