ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
top::OverlapRemovalASG Class Reference

The Harmonization Group recommended object overlap removal. More...

#include <OverlapRemovalASG.h>

Inheritance diagram for top::OverlapRemovalASG:
Collaboration diagram for top::OverlapRemovalASG:

Public Member Functions

 OverlapRemovalASG (bool dolargeJet=false)
 Sets up ASG Overlap Removal Tool. More...
 
virtual ~OverlapRemovalASG ()
 does nothing More...
 
virtual void overlapremoval (const xAOD::PhotonContainer *photon, const xAOD::ElectronContainer *el, const xAOD::MuonContainer *mu, const xAOD::TauJetContainer *tau, const xAOD::JetContainer *jet, const xAOD::JetContainer *ljet, std::vector< unsigned int > &goodPhotons, std::vector< unsigned int > &goodElectrons, std::vector< unsigned int > &goodMuons, std::vector< unsigned int > &goodTaus, std::vector< unsigned int > &goodJets, std::vector< unsigned int > &goodLargeRJets, const bool isLooseEvent)
 Perform the "ASG standard" overlap removal. More...
 
virtual void print (std::ostream &) const
 Print something useful to the screen. More...
 
virtual bool overlapsEl (std::vector< unsigned int > &)
 
virtual bool overlapsMu (std::vector< unsigned int > &)
 

Protected Member Functions

virtual void removeObjectOverlap (const xAOD::IParticleContainer *xaod, std::vector< unsigned int > &OUT_vec, const std::string passTopCuts)
 For a generic container of type DataVector, fill a vector of ints for objects we want to keep. More...
 
virtual void removeObject (const xAOD::IParticleContainer *xaod, std::vector< unsigned int > &OUT_vec, const std::string passTopCuts)
 For a generic container of type DataVector, fill a vector of ints for objects we want to keep This doesn't check for overlap removal (Large R jets) More...
 

Protected Attributes

asg::AnaToolHandle< ORUtils::IOverlapRemovalToolm_overlapRemovalTool
 
asg::AnaToolHandle< ORUtils::IOverlapRemovalToolm_overlapRemovalToolLoose
 
const std::string m_passPreORSelection
 
const std::string m_passPreORSelectionLoose
 
const std::string m_overlaps
 
bool m_doLargeJet
 

Detailed Description

The Harmonization Group recommended object overlap removal.

Definition at line 22 of file OverlapRemovalASG.h.

Constructor & Destructor Documentation

◆ OverlapRemovalASG()

top::OverlapRemovalASG::OverlapRemovalASG ( bool  dolargeJet = false)

Sets up ASG Overlap Removal Tool.

Parameters
dolargeJetEnables OR also with large-R jets This is false by default becaause large-R jets are a bit special.

Definition at line 12 of file OverlapRemovalASG.cxx.

12  :
13  m_overlapRemovalTool("OverlapRemovalTool"),
14  m_overlapRemovalToolLoose("OverlapRemovalToolLoose"),
15  m_passPreORSelection("passPreORSelection"),
16  m_passPreORSelectionLoose("passPreORSelectionLoose"),
17  m_overlaps("overlaps"),
18  m_doLargeJet(dolargeJet) {
19  top::check(m_overlapRemovalTool.retrieve(), "Failed to retrieve overlap removal tool");
20  top::check(m_overlapRemovalToolLoose.retrieve(), "Failed to retrieve (loose) overlap removal tool");
21  }

◆ ~OverlapRemovalASG()

top::OverlapRemovalASG::~OverlapRemovalASG ( )
virtual

does nothing

Definition at line 23 of file OverlapRemovalASG.cxx.

23  {
24  }

Member Function Documentation

◆ overlapremoval()

void top::OverlapRemovalASG::overlapremoval ( const xAOD::PhotonContainer photon,
const xAOD::ElectronContainer el,
const xAOD::MuonContainer mu,
const xAOD::TauJetContainer tau,
const xAOD::JetContainer jet,
const xAOD::JetContainer ljet,
std::vector< unsigned int > &  goodPhotons,
std::vector< unsigned int > &  goodElectrons,
std::vector< unsigned int > &  goodMuons,
std::vector< unsigned int > &  goodTaus,
std::vector< unsigned int > &  goodJets,
std::vector< unsigned int > &  goodLargeRJets,
const bool  isLooseEvent 
)
virtual

Perform the "ASG standard" overlap removal.

This runs for every event.

Parameters
photonAll the photons in the event
elAll the electrons (even bad ones). Good ones are decorated with passPreORSelection = 1.
muAll the muons in the event
tauAll the taus in the event
jetAll the jets in the event
ljetAll the large-R jets in the event
goodPhotonsThe indices of the photons to keep
goodElectronsThe indices of the electrons to keep (e.g. the 0th, 2nd)
goodMuonsThe indices of the muons to keep
goodTausThe indices of the taus to keep
goodJetsThe indices of the jets to keep
goodLargeRJetsThe indices of the large-R jets to keep

Implements top::OverlapRemovalBase.

Definition at line 26 of file OverlapRemovalASG.cxx.

38  {
39  std::string passTopCuts("");
40  if (!isLoose) {
42  ljet), "Failed to remove overlaps");
43  else top::check(m_overlapRemovalTool->removeOverlaps(el, mu, jet, tau, photon), "Failed to remove overlaps");
44  passTopCuts = m_passPreORSelection;
45  }
46  if (isLoose) {
48  ljet), "Failed to remove overlaps");
49  else top::check(m_overlapRemovalToolLoose->removeOverlaps(el, mu, jet, tau, photon), "Failed to remove overlaps");
50 
51  passTopCuts = m_passPreORSelectionLoose;
52  }
53 
54  removeObjectOverlap(photon, goodPhotons, passTopCuts);
55  removeObjectOverlap(el, goodElectrons, passTopCuts);
56  removeObjectOverlap(mu, goodMuons, passTopCuts);
57  removeObjectOverlap(tau, goodTaus, passTopCuts);
58  removeObjectOverlap(jet, goodJets, passTopCuts);
59  if (m_doLargeJet) removeObjectOverlap(ljet, goodLargeRJets, passTopCuts);
60  else removeObject(ljet, goodLargeRJets, passTopCuts);
61  }

◆ overlapsEl()

virtual bool top::OverlapRemovalBase::overlapsEl ( std::vector< unsigned int > &  )
inlinevirtualinherited

Definition at line 38 of file OverlapRemovalBase.h.

38 {return false;}

◆ overlapsMu()

virtual bool top::OverlapRemovalBase::overlapsMu ( std::vector< unsigned int > &  )
inlinevirtualinherited

Definition at line 39 of file OverlapRemovalBase.h.

39 {return false;}

◆ print()

void top::OverlapRemovalASG::print ( std::ostream &  os) const
virtual

Print something useful to the screen.

Implements top::OverlapRemovalBase.

Definition at line 97 of file OverlapRemovalASG.cxx.

97  {
98  os << "OverlapRemovalASG\n";
99  os << " (1) remove electron that sharing track with muon\n";
100  os << " (2) remove single jet closest to an electron (within dR < 0.2)\n";
101  os << " (3) remove electron with dR < 0.4 of jet\n";
102  os << " (4) remove muon within dR < 0.4 of any jet\n";
103  }

◆ removeObject()

void top::OverlapRemovalASG::removeObject ( const xAOD::IParticleContainer xaod,
std::vector< unsigned int > &  OUT_vec,
const std::string  passTopCuts 
)
protectedvirtual

For a generic container of type DataVector, fill a vector of ints for objects we want to keep This doesn't check for overlap removal (Large R jets)

Definition at line 80 of file OverlapRemovalASG.cxx.

82  {
83  OUT_vec.clear();
84 
85  unsigned int index(0);
86 
87  if (xaod) {
88  for (auto x : *xaod) {
89  if (x->auxdataConst< char >(passTopCuts) == 1) {
90  OUT_vec.push_back(index);
91  }
92  ++index;
93  }
94  }
95  }

◆ removeObjectOverlap()

void top::OverlapRemovalASG::removeObjectOverlap ( const xAOD::IParticleContainer xaod,
std::vector< unsigned int > &  OUT_vec,
const std::string  passTopCuts 
)
protectedvirtual

For a generic container of type DataVector, fill a vector of ints for objects we want to keep.

Definition at line 63 of file OverlapRemovalASG.cxx.

65  {
66  OUT_vec.clear();
67 
68  unsigned int index(0);
69 
70  if (xaod) {
71  for (auto x : *xaod) {
72  if (x->auxdataConst< char >(passTopCuts) == 1 && x->auxdataConst< char >(m_overlaps) == 0) {
73  OUT_vec.push_back(index);
74  }
75  ++index;
76  }
77  }
78  }

Member Data Documentation

◆ m_doLargeJet

bool top::OverlapRemovalASG::m_doLargeJet
protected

Definition at line 96 of file OverlapRemovalASG.h.

◆ m_overlapRemovalTool

asg::AnaToolHandle<ORUtils::IOverlapRemovalTool> top::OverlapRemovalASG::m_overlapRemovalTool
protected

Definition at line 89 of file OverlapRemovalASG.h.

◆ m_overlapRemovalToolLoose

asg::AnaToolHandle<ORUtils::IOverlapRemovalTool> top::OverlapRemovalASG::m_overlapRemovalToolLoose
protected

Definition at line 90 of file OverlapRemovalASG.h.

◆ m_overlaps

const std::string top::OverlapRemovalASG::m_overlaps
protected

Definition at line 94 of file OverlapRemovalASG.h.

◆ m_passPreORSelection

const std::string top::OverlapRemovalASG::m_passPreORSelection
protected

Definition at line 92 of file OverlapRemovalASG.h.

◆ m_passPreORSelectionLoose

const std::string top::OverlapRemovalASG::m_passPreORSelectionLoose
protected

Definition at line 93 of file OverlapRemovalASG.h.


The documentation for this class was generated from the following files:
ORUtils::IOverlapRemovalTool::removeOverlaps
virtual StatusCode removeOverlaps(const xAOD::ElectronContainer *electrons, const xAOD::MuonContainer *muons, const xAOD::JetContainer *jets, const xAOD::TauJetContainer *taus=0, const xAOD::PhotonContainer *photons=0, const xAOD::JetContainer *fatJets=0) const =0
Declare the interface.
asg::AnaToolHandle::retrieve
StatusCode retrieve()
initialize the tool
index
Definition: index.py:1
top::OverlapRemovalASG::m_overlapRemovalToolLoose
asg::AnaToolHandle< ORUtils::IOverlapRemovalTool > m_overlapRemovalToolLoose
Definition: OverlapRemovalASG.h:90
top::OverlapRemovalASG::removeObjectOverlap
virtual void removeObjectOverlap(const xAOD::IParticleContainer *xaod, std::vector< unsigned int > &OUT_vec, const std::string passTopCuts)
For a generic container of type DataVector, fill a vector of ints for objects we want to keep.
Definition: OverlapRemovalASG.cxx:63
top::OverlapRemovalASG::m_passPreORSelection
const std::string m_passPreORSelection
Definition: OverlapRemovalASG.h:92
x
#define x
top::OverlapRemovalASG::m_passPreORSelectionLoose
const std::string m_passPreORSelectionLoose
Definition: OverlapRemovalASG.h:93
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
top::OverlapRemovalASG::removeObject
virtual void removeObject(const xAOD::IParticleContainer *xaod, std::vector< unsigned int > &OUT_vec, const std::string passTopCuts)
For a generic container of type DataVector, fill a vector of ints for objects we want to keep This do...
Definition: OverlapRemovalASG.cxx:80
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
top::check
void check(bool thingToCheck, const std::string &usefulFailureMessage)
Print an error message and terminate if thingToCheck is false.
Definition: EventTools.cxx:15
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
DeMoScan.index
string index
Definition: DeMoScan.py:362
top::OverlapRemovalASG::m_doLargeJet
bool m_doLargeJet
Definition: OverlapRemovalASG.h:96
xAOD::photon
@ photon
Definition: TrackingPrimitives.h:199
top::OverlapRemovalASG::m_overlaps
const std::string m_overlaps
Definition: OverlapRemovalASG.h:94
top::OverlapRemovalASG::m_overlapRemovalTool
asg::AnaToolHandle< ORUtils::IOverlapRemovalTool > m_overlapRemovalTool
Definition: OverlapRemovalASG.h:89
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53