Commit c783835d authored by Buddhadeb Mondal's avatar Buddhadeb Mondal Committed by Nils Erik Krumnack
Browse files

Use of rapidity instead of pseudo-rapidity in DeltaR calculation for overlap...

Use of rapidity instead of pseudo-rapidity in DeltaR calculation for overlap removal in particle level
parent f9540548
......@@ -651,6 +651,8 @@ namespace top {
"Overlap removal inner radius to be used for electron SlidingDR ,", "0.2");
registerParameter("OverlapRemovalSlidingInnerDRmu", "Overlap removal inner radius to be used for muon SlidingDR ,",
"0.2");
registerParameter("OverlapRemovalParticleLevelUseRapidity", "Use rapidity instead of pseudo-rapidity for DeltaR"
" calculation for overlap removal in particle level ","False", {"True", "False"});
registerParameter("LargeJetOverlapRemoval",
"Perform overlap removal including large-R jets. True or False (default: False).", "False");
......
......@@ -134,6 +134,7 @@ namespace top {
m_doParticleLevelOverlapRemovalMuJet(true),
m_doParticleLevelOverlapRemovalElJet(true),
m_doParticleLevelOverlapRemovalJetPhoton(false),
m_useParticleLevelOverlapRemovalWithRapidity(false),
// KLFitter
m_doKLFitter(false),
......@@ -939,6 +940,13 @@ namespace top {
tokens.pop_back();
}
}
// Particle level overlap removal use rapidity in deltaR calculation
if(settings->value("OverlapRemovalParticleLevelUseRapidity") == "True"){
this->setParticleLevelOverlapRemovalWithRapidity(true);
}
else{
this->setParticleLevelOverlapRemovalWithRapidity(false);
}
// check if you are running over AFII samples
// only check the configuration file if the AodMetaData is not instatiated
......
......@@ -416,6 +416,7 @@ namespace top {
inline bool doParticleLevelOverlapRemovalMuJet() const {return m_doParticleLevelOverlapRemovalMuJet;}
inline bool doParticleLevelOverlapRemovalElJet() const {return m_doParticleLevelOverlapRemovalElJet;}
inline bool doParticleLevelOverlapRemovalJetPhoton() const {return m_doParticleLevelOverlapRemovalJetPhoton;}
inline bool useParticleLevelOverlapRemovalWithRapidity() const {return m_useParticleLevelOverlapRemovalWithRapidity;}
inline void setParticleLevelOverlapRemovalMuJet(bool value) {
if (!m_configFixed) {
m_doParticleLevelOverlapRemovalMuJet = value;
......@@ -434,6 +435,12 @@ namespace top {
}
}
inline void setParticleLevelOverlapRemovalWithRapidity(bool value){
if(!m_configFixed){
m_useParticleLevelOverlapRemovalWithRapidity = value;
}
}
// KLFitter
inline bool doKLFitter() const {return m_doKLFitter;}
inline void setKLFitter() {
......@@ -2189,6 +2196,7 @@ namespace top {
bool m_doParticleLevelOverlapRemovalMuJet;
bool m_doParticleLevelOverlapRemovalElJet;
bool m_doParticleLevelOverlapRemovalJetPhoton;
bool m_useParticleLevelOverlapRemovalWithRapidity;
// KLFitter
bool m_doKLFitter;
......
......@@ -443,6 +443,8 @@ namespace top {
// 3. Photons & Jets:
// Remove Jets with dR < 0.4
// Use rapidity instead of pseudo-rapidity in deltaR calculation for overlap removal
bool useRapidityInDeltaRCalculation = m_config->useParticleLevelOverlapRemovalWithRapidity();
// Jets and Muons: Remove Muon with dR < 0.4
if (m_config->useTruthMuons() && m_config->useTruthJets() && m_config->doParticleLevelOverlapRemovalMuJet()) {
#ifdef TOP_PARTICLE_LEVEL_DEBUG_OVERLAP_REMOVAL
......@@ -451,9 +453,9 @@ namespace top {
};
#endif
idx_muons.remove_if([&idx_jets, &jets, this](std::size_t m) {
idx_muons.remove_if([&idx_jets, &jets, &useRapidityInDeltaRCalculation,this](std::size_t m) {
for (auto j : idx_jets) {
if (jets->at(j)->p4().DeltaR(m_muonsDressed->at(m)->p4()) < 0.4) {
if (xAOD::P4Helpers::deltaR(jets->at(j), m_muonsDressed->at(m), useRapidityInDeltaRCalculation) < 0.4) {
return true;
}
}
......@@ -474,9 +476,9 @@ namespace top {
};
#endif
idx_electrons.remove_if([&idx_jets, &jets, this](std::size_t e) {
idx_electrons.remove_if([&idx_jets, &jets, &useRapidityInDeltaRCalculation, this](std::size_t e) {
for (auto j : idx_jets) {
if (jets->at(j)->p4().DeltaR(m_electronsDressed->at(e)->p4()) < 0.4) {
if (xAOD::P4Helpers::deltaR(jets->at(j), m_electronsDressed->at(e), useRapidityInDeltaRCalculation) < 0.4) {
return true;
}
}
......@@ -497,9 +499,9 @@ namespace top {
};
#endif
idx_jets.remove_if([&idx_photons, &photons, &jets](std::size_t j) {
idx_jets.remove_if([&idx_photons, &photons, &useRapidityInDeltaRCalculation, &jets](std::size_t j) {
for (auto ph : idx_photons) {
if (photons->at(ph)->p4().DeltaR(jets->at(j)->p4()) < 0.4) {
if (xAOD::P4Helpers::deltaR(photons->at(ph), jets->at(j), useRapidityInDeltaRCalculation) < 0.4) {
return true;
}
}
......@@ -828,6 +830,9 @@ namespace top {
"originalTruthParticle"
};
// Use rapidity instead of pseudo-rapidity in deltaR calculation for overlap removal
bool useRapidityInDeltaRCalculation = m_config->useParticleLevelOverlapRemovalWithRapidity();
for (const auto& particle : dressedParticles) {
bool tp_isValid = false;
ElementLink<xAOD::TruthParticleContainer> truthProxy;
......@@ -840,11 +845,11 @@ namespace top {
}
if (not tp_isValid) {
if (particle->p4().DeltaR(photon.p4()) <= dressingCone) {
if (xAOD::P4Helpers::deltaR(particle, &photon, useRapidityInDeltaRCalculation) <= dressingCone) {
return true;
}
} else {
if ((*truthProxy)->p4().DeltaR(photon.p4()) <= dressingCone) {
if (xAOD::P4Helpers::deltaR((*truthProxy), &photon, useRapidityInDeltaRCalculation) <= dressingCone) {
return true;
}
}
......@@ -852,4 +857,4 @@ namespace top {
return false;
}
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment