|
ATLAS Offline Software
|
Go to the documentation of this file.
22 #include "GaudiKernel/SystemOfUnits.h"
25 #include "boost/algorithm/string.hpp"
26 #include <boost/tokenizer.hpp>
34 using namespace boost;
49 ATH_MSG_INFO(
"TrigEgammaMonitorTagAndProbeAlgorithm::initialize()...");
61 ATH_MSG_DEBUG(
"Trigger already booked, removing from trigger list " << trigName);
67 return StatusCode::SUCCESS;
74 std::vector<std::shared_ptr<const xAOD::Electron>> probes;
81 return StatusCode::SUCCESS;
88 return StatusCode::SUCCESS;
96 return StatusCode::SUCCESS;
99 for(
unsigned int ilist = 0; ilist !=
m_trigList.size(); ilist++) {
101 std::string probeTrigger =
m_trigList.at(ilist);
104 std::vector<std::pair<const xAOD::Egamma*, const TrigCompositeUtils::Decision*>> pairObjs;
106 ATH_MSG_DEBUG(
"Start Chain Analysis ============================= " << probeTrigger);
110 const std::string& trigName=probeTrigger;
112 ATH_MSG_DEBUG(
"Trigger " << probeTrigger <<
" pidword " <<
info.pidname <<
" threshold " <<
info.etthr);
117 ATH_MSG_DEBUG(
"Probes " << probes.size() <<
" Pairs " << pairObjs.size() );
126 return StatusCode::SUCCESS;
165 if ( offElectrons->
size() < 2 ) {
189 ATH_MSG_DEBUG(
"Disable trigger tags because trigger tags list is empty.");
202 for(
const auto *
const elTag : *offElectrons)
206 for(
const auto *
const elProbe : *offElectrons)
211 if(elProbe==elTag)
continue;
225 if(
dR(elTag->caloCluster()->eta(),elTag->caloCluster()->phi(),
226 elProbe->caloCluster()->eta(),elProbe->caloCluster()->phi()) <= 0.2 ){
231 else if(Jpsieelifetime<-1 || 0.2<Jpsieelifetime){
232 ATH_MSG_DEBUG(
"tag and probe pair not in Jpsi lifetime window");
240 el1.SetPtEtaPhiE(elTag->pt(), elTag->trackParticle()->eta(), elTag->trackParticle()->phi(), elTag->e());
241 el2.SetPtEtaPhiE(elProbe->pt(), elProbe->trackParticle()->eta(), elProbe->trackParticle()->phi(), elProbe->e());
242 float tpPairMass = (el1 + el2).M();
256 auto selProbe = std::make_shared<const xAOD::Electron>(*elProbe);
259 probeElectrons.emplace_back(std::move(selProbe));
270 ATH_MSG_DEBUG(
"Number of probes found is " << probeElectrons.size() );
279 for(
unsigned int ilist = 0; ilist !=
m_tagTrigList.size(); ilist++) {
281 if (
tdt()->isPassed(
tag) )
291 std::vector<std::shared_ptr<const xAOD::Electron>>& probeElectrons,
292 std::vector<std::pair<const xAOD::Egamma*, const TrigCompositeUtils::Decision *>> &pairObj )
const
294 for(
const auto&
el : probeElectrons)
297 match()->match(
el.get(), probeTrigItem, dec, TrigDefs::includeFailedDecisions);
299 pairObj.emplace_back(
el.get(), dec);
317 if(!
el->trackParticle()){
326 if(!
el->caloCluster()){
348 float absEta = fabs(
el->caloCluster()->etaBE(2));
369 bool tagPassed=
false;
385 bool tagMatched=
false;
386 for(
unsigned int ilist = 0; ilist !=
m_tagTrigList.size(); ilist++) {
411 if(!
el->trackParticle()){
418 if(!
el->caloCluster()){
427 float absEta = fabs(
el->caloCluster()->etaBE(2));
443 TLorentzVector probeCandidate;
444 probeCandidate.SetPtEtaPhiE(
el->pt(),
el->trackParticle()->eta(),
el->trackParticle()->phi(),
el->e());
445 Int_t jetsAroundProbeElectron = 0;
446 for(
const auto *
const i_jet : *
jets){
448 jet.SetPtEtaPhiE(i_jet->pt(), i_jet->eta(), i_jet->phi(), i_jet->e());
452 if ( jetsAroundProbeElectron >= 2 ) {
466 const auto& ctx = Gaudi::Hive::currentContext() ;
467 for(
int ipid=0;ipid<3;ipid++){
469 const std::string pidname=
"is"+
m_isemname[ipid];
471 decor(*
eg)=
static_cast<bool>(
accept);
473 for(
int ipid=0;ipid<4;ipid++){
475 const std::string pidname=
"is"+
m_lhname[ipid];
477 decor(*
eg)=
static_cast<bool>(
accept);
479 for(
int ipid=0;ipid<3;ipid++){
481 const std::string pidname=
"is"+
m_dnnname[ipid];
483 decor(*
eg)=
static_cast<bool>(
accept);
494 TLorentzVector el1track;
495 TLorentzVector el2track;
496 float simple = -99999.;
510 float ptEECalo = (el1track+el2track).
Pt();
512 float den = (0.299792458*ptEECalo);
513 if(fabs(den) < 1
e-6)
return simple;
515 return lxy*3096.916/den;
520 double pt1,
double pt2,
double vx,
double vy)
const
522 double simple = -99999.;
523 double den =
sin(phi2-phi1);
526 if(fabs(phi1 - phi2) < 1
e-6)
return simple;
527 if(fabs(den) < 1
e-6)
return simple;
529 double simpleXv = (-
d2*
cos(phi1) +
d1*
cos(phi2)) / den;
530 double simpleYv = (-
d2*
sin(phi1) +
d1*
sin(phi2)) / den;
531 double argxy = (simpleXv-vx)*(simpleXv-vx) + (simpleYv-vy)*(simpleYv-vy);
533 if(argxy < 0)
return simple;
535 double rxy = sqrt(argxy);
537 double f1 = (fabs(pt1)*
cos(phi1)+fabs(pt2)*
cos(phi2));
538 double f2 = (fabs(pt1)*
sin(phi1)+fabs(pt2)*
sin(phi2));
541 if(argm < 0)
return simple;
543 double c = sqrt( argm );
545 if ( fabs(
c) < 1
e-6 )
return simple;
547 double a = (simpleXv-vx)*
f1;
548 double b = (simpleYv-vy)*
f2;
Gaudi::Property< std::string > m_anatype
analysis name
void fillEfficiencies(const std::vector< std::pair< const xAOD::Egamma *, const TrigCompositeUtils::Decision * > > &, const TrigInfo &) const
virtual double pt() const override final
The transverse momentum ( ) of the particle.
bool isIsolated(const xAOD::Electron *, const std::string &) const
Check if electron fulfils isolation criteria.
float dR(const float, const float, const float, const float) const
Get delta R.
Gaudi::Property< std::vector< std::string > > m_trigInputList
Properties.
const std::map< std::string, TrigInfo > & getTrigInfoMap()
Helper methods.
Gaudi::Property< bool > m_doJpsiee
do jpsiee tag and probe
The common trigger namespace for trigger analysis tools.
bool isGoodProbeElectron(const ToolHandle< GenericMonitoringTool > &monGroup, const xAOD::Electron *el, const xAOD::JetContainer *) const
Probe selection.
Gaudi::Property< float > m_ZeeMassMin
Zee lower mass cut.
TrigEgammaMonitorTagAndProbeAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< float > m_ZeeMassMax
Zee upper mass cut.
SG::ReadHandleKey< xAOD::JetContainer > m_jetKey
Jet container for probe selection.
double simple_lxy(int, double, double, double, double, double, double, double, double) const
Calculate the displacement of the Jpsi vertex w.r.t.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
void dressPid(const xAOD::Electron *eg) const
Rerun offline selection.
StatusCode accept(const xAOD::Muon *mu)
void fillDistributions(const std::vector< std::pair< const xAOD::Egamma *, const TrigCompositeUtils::Decision * > > &, const TrigInfo &) const
virtual double m() const
The invariant mass of the particle.
Gaudi::Property< std::string > m_offTagTightness
Define the PID for tag electron.
SG::ReadDecorHandleKey< xAOD::EventInfo > m_eventInfoDecorKey
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
const xAOD::TrackParticle * trackParticle(size_t index=0) const
Pointer to the xAOD::TrackParticle/s that match the electron candidate.
const uint32_t BADCLUSELECTRON
const ToolHandle< Trig::TrigDecisionTool > & tdt() const
Get the TDT
virtual ~TrigEgammaMonitorTagAndProbeAlgorithm() override
@ LAr
The LAr calorimeter.
float d0() const
Returns the parameter.
SG::ReadHandleKey< xAOD::ElectronContainer > m_offElectronKey
Event Wise offline ElectronContainer Access and end iterator.
@ Error
The sub-detector issued an error.
Gaudi::Property< std::vector< std::string > > m_dnnname
dnn names
void fillResolutions(const std::vector< std::pair< const xAOD::Egamma *, const TrigCompositeUtils::Decision * >> &pairObjs, const TrigInfo &info) const
*****************************************************************************************************...
bool isHLTTruncated() const
TrigInfo getTrigInfo(const std::string &) const
Get the trigger info parsed from the chain name (only single lepton triggers)
Description of a calorimeter cluster.
Gaudi::Property< float > m_tagMinEt
Minimum tag Et.
void setTrigInfo(const std::string &)
Set the trigger info parsed from the chain name.
void matchObjects(const std::string &trigItem, std::vector< std::shared_ptr< const xAOD::Electron >> &, std::vector< std::pair< const xAOD::Egamma *, const TrigCompositeUtils::Decision * >> &) const
Match probes called by derived classes.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< bool > m_applyMinimalTrigger
Enable the requirement of triggers.
bool executeTandP(const EventContext &ctx, std::vector< std::shared_ptr< const xAOD::Electron >> &) const
Tag and Probe method called by derived classes.
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
virtual StatusCode initialize() override
initialize
bool minimalTriggerRequirement() const
at least one chain should pass.
float getPseudoLifetime(const xAOD::Electron *, const xAOD::Electron *) const
Return pseudo-lifetime of Jpsi.
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable >> &&variables) const
Fills a vector of variables to a group by reference.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
ToolHandleArray< IAsgElectronIsEMSelector > m_electronIsEMTool
Offline isEM Selectors.
Class used to describe composite objects in the HLT.
Gaudi::Property< bool > m_rmCrack
Remove crack region for Probe default True.
ToolHandleArray< IAsgElectronLikelihoodTool > m_electronLHTool
Offline LH Selectors.
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.)
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_electronIsolationKeyPtCone20
Ensure offline electron isolation decoration is retrieved after being created.
Gaudi::Property< std::vector< std::string > > m_isemname
isem names
std::vector< std::string > m_trigList
List of triggers from menu after filter.
virtual double pt() const
The transverse momentum ( ) of the particle (negative for negative-energy clusters)
bool ApplyElectronPid(const xAOD::Electron *eg, const std::string &) const
Get offline electron decision.
virtual StatusCode initialize() override
initialize
const ToolHandle< TrigEgammaMatchingToolMT > & match() const
Get the e/g match tool.
void fillLabel(const ToolHandle< GenericMonitoringTool > &groupHandle, const std::string &histname, const std::string &label) const
Gaudi::Property< std::vector< std::string > > m_lhname
lh names
ToolHandleArray< IAsgElectronLikelihoodTool > m_electronDNNTool
Offline DNN Selectors.
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
bool absEta(const xAOD::TauJet &tau, double &out)
EventFlagErrorState errorState(EventFlagSubDet subDet) const
Get the error state for a particular sub-detector.
bool isEventFlagBitSet(EventFlagSubDet subDet, size_t bit) const
Check one particular bit of one particular sub-detector.
bool isTagElectron(const ToolHandle< GenericMonitoringTool > &monGroup, const xAOD::Electron *el) const
Tag Electron selection.
Gaudi::Property< bool > m_applyJetNearProbeSelection
Apply nearby jet selection.
Class describing a TrackParticle.
Declare a monitored scalar variable.
Handle class for reading from StoreGate.
Gaudi::Property< std::vector< std::string > > m_tagTrigList
Tag trigger list.
setBGCode setTAP setLVL2ErrorBits bool
size_type size() const noexcept
Returns the number of elements in the collection.
Helper class to provide type-safe access to aux data.
virtual double e() const
The total energy of the particle.
Gaudi::Property< bool > m_oppositeCharge
Select opposite or same-sign pairs – for background studies.
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
Gaudi::Property< std::string > m_offProbeIsolation
Probe isolation.