ATLAS Offline Software
Public Member Functions | List of all members
top::OverlapRemovalIndices Class Reference

The "standard" overlap removal for the top group. More...

#include <OverlapRemovalIndices.h>

Inheritance diagram for top::OverlapRemovalIndices:
Collaboration diagram for top::OverlapRemovalIndices:

Public Member Functions

 OverlapRemovalIndices ()
 Doesn't do anything. More...
 
virtual ~OverlapRemovalIndices ()
 Doesn't do anything. More...
 
virtual void overlapremoval (const xAOD::ElectronContainer *el, const xAOD::MuonContainer *mu, const xAOD::JetContainer *jet, const xAOD::JetContainer *ljet, std::vector< unsigned int > &OUT_el, std::vector< unsigned int > &OUT_mu, std::vector< unsigned int > &OUT_jet, std::vector< unsigned int > &OUT_ljet, const bool isLooseEvent)
 Perform our "standard" overlap removal. 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)
 
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 > &)
 

Detailed Description

The "standard" overlap removal for the top group.

Definition at line 30 of file OverlapRemovalIndices.h.

Constructor & Destructor Documentation

◆ OverlapRemovalIndices()

top::OverlapRemovalIndices::OverlapRemovalIndices ( )

Doesn't do anything.

Definition at line 12 of file OverlapRemovalIndices.cxx.

12  {
13  }

◆ ~OverlapRemovalIndices()

top::OverlapRemovalIndices::~OverlapRemovalIndices ( )
virtual

Doesn't do anything.

Definition at line 15 of file OverlapRemovalIndices.cxx.

15  {
16  }

Member Function Documentation

◆ overlapremoval() [1/2]

void top::OverlapRemovalIndices::overlapremoval ( const xAOD::ElectronContainer el,
const xAOD::MuonContainer mu,
const xAOD::JetContainer jet,
const xAOD::JetContainer ljet,
std::vector< unsigned int > &  OUT_el,
std::vector< unsigned int > &  OUT_mu,
std::vector< unsigned int > &  OUT_jet,
std::vector< unsigned int > &  OUT_ljet,
const bool  isLooseEvent 
)
virtual

Perform our "standard" overlap removal.

This runs for every event.

The overlap removal consists of:

  • (1) remove muon within dR < 0.4 of any jet
  • (2) remove single jet closest to an electron (within dR < 0.2)
  • (3) remove electron with dR < 0.4 of jet
Parameters
elAll the electrons (even bad ones). Good ones are decorated with passPreORSelection = 1.
muAll the muons in the event
jetAll the jets in the event
ljetAll the large-R jets in the event
OUT_elThe indices of the electrons to keep (e.g. the 0th, 2nd)
OUT_muThe indices of the muons to keep
OUT_jetThe indices of the jets to keep
OUT_ljetThe indices of the large-R jets to keep

Definition at line 18 of file OverlapRemovalIndices.cxx.

26  {
27  std::string passTopCuts("");
28  if (!isLoose) {
29  passTopCuts = "passPreORSelection";
30  }
31  if (isLoose) {
32  passTopCuts = "passPreORSelectionLoose";
33  }
34 
35 
36  // Work internally with std::list
37  // What passed the pre-overlap removal selection?
38  std::vector<unsigned int> IN_el, IN_mu, IN_jet, IN_ljet;
39  std::list<unsigned int> l_el, l_mu, l_jet, l_ljet;
40  unsigned int index_el(0), index_mu(0), index_jet(0), index_ljet(0);
41 
42  if (el) {
43  for (auto x : *el) {
44  if (x->auxdataConst< char >(passTopCuts) == 1) {
45  IN_el.push_back(index_el);
46  l_el.push_back(index_el);
47  }
48  ++index_el;
49  }
50  }
51 
52  if (mu) {
53  for (auto x : *mu) {
54  if (x->auxdataConst< char >(passTopCuts) == 1) {
55  IN_mu.push_back(index_mu);
56  l_mu.push_back(index_mu);
57  }
58  ++index_mu;
59  }
60  }
61 
62  if (jet) {
63  for (auto x : *jet) {
64  if (x->auxdataConst< char >(passTopCuts) == 1) {
65  IN_jet.push_back(index_jet);
66  l_jet.push_back(index_jet);
67  }
68  ++index_jet;
69  }
70  }
71 
72  if (ljet) {
73  for (auto x : *ljet) {
74  if (x->auxdataConst< char >(passTopCuts) == 1) {
75  IN_ljet.push_back(index_ljet);
76  l_ljet.push_back(index_ljet);
77  }
78  ++index_ljet;
79  }
80  }
81 
82  // Jets and Muons - remove muon with dR < 0.4
83  for (auto j : IN_jet) {
84  for (auto m : IN_mu) {
85  if (top::deltaR(*(jet->at(j)), *(mu->at(m))) < 0.4) {
86  l_mu.remove(m);
87  }
88  }
89  }
90 
91  // Jets and Electrons - remove single closest jet with dR < 0.2
92  for (auto e : IN_el) {
93  double closestdr = 100.;
94  int closestJetIndex = -1;
95  for (auto j : IN_jet) {
96  const double ejetdr = top::deltaR(*(jet->at(j)), *(el->at(e)));
97 
98  if (ejetdr < 0.2 && ejetdr < closestdr) {
99  closestdr = ejetdr;
100  closestJetIndex = j;
101  }
102  }
103 
104  if (closestJetIndex > -1) l_jet.remove(closestJetIndex);
105  }
106 
107  // Electrons and Jets - remove electrons with dR < 0.4
108  for (auto j : l_jet) {
109  for (auto e : IN_el) {
110  if (top::deltaR(*(el->at(e)), *(jet->at(j))) < 0.4) {
111  l_el.remove(e);
112  }
113  }
114  }
115 
116  // Save what's left of the std::lists into the OUT vectors;
117  OUT_el.clear();
118  OUT_mu.clear();
119  OUT_jet.clear();
120  OUT_ljet.clear();
121 
122  for (auto i : l_el) {
123  OUT_el.push_back(i);
124  }
125  for (auto i : l_mu) {
126  OUT_mu.push_back(i);
127  }
128  for (auto i : l_jet) {
129  OUT_jet.push_back(i);
130  }
131  for (auto i : l_ljet) {
132  OUT_ljet.push_back(i);
133  }
134  }

◆ overlapremoval() [2/2]

void top::OverlapRemovalIndices::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

Implements top::OverlapRemovalBase.

Definition at line 136 of file OverlapRemovalIndices.cxx.

148  {
149  overlapremoval(el, mu, jet, ljet, goodElectrons, goodMuons, goodJets, goodLargeRJets, isLoose);
150  }

◆ 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::OverlapRemovalIndices::print ( std::ostream &  os) const
virtual

Print something useful to the screen.

Implements top::OverlapRemovalBase.

Definition at line 152 of file OverlapRemovalIndices.cxx.

152  {
153  os << "OverlapRemovalIndices\n";
154  os << " (1) remove muon within dR < 0.4 of any jet\n";
155  os << " (2) remove single jet closest to an electron (within dR < 0.2)\n";
156  os << " (3) remove electron with dR < 0.4 of jet\n";
157  }

The documentation for this class was generated from the following files:
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
top::deltaR
double deltaR(const xAOD::IParticle &p1, const xAOD::IParticle &p2)
Calculate the delta-r distance between two particles (e.g.
Definition: EventTools.cxx:21
x
#define x
top::OverlapRemovalIndices::overlapremoval
virtual void overlapremoval(const xAOD::ElectronContainer *el, const xAOD::MuonContainer *mu, const xAOD::JetContainer *jet, const xAOD::JetContainer *ljet, std::vector< unsigned int > &OUT_el, std::vector< unsigned int > &OUT_mu, std::vector< unsigned int > &OUT_jet, std::vector< unsigned int > &OUT_ljet, const bool isLooseEvent)
Perform our "standard" overlap removal.
Definition: OverlapRemovalIndices.cxx:18
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
lumiFormat.i
int i
Definition: lumiFormat.py:92
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53