Commit 734f8b51 authored by Marco Vanadia's avatar Marco Vanadia Committed by Nils Erik Krumnack
Browse files

adding test option in analysisTop to store muons failing OR

parent f2fe77fd
......@@ -881,6 +881,10 @@ namespace top {
systematicTree->makeOutputVariable(m_mu_true_IFFclass, "mu_true_IFFclass");
systematicTree->makeOutputVariable(m_mu_true_isPrompt, "mu_true_isPrompt");
}
if(m_config->noORForMuons())
{
systematicTree->makeOutputVariable(m_mu_passOR, "mu_passOR");
}
if (m_config->enablePromptLeptonImprovedVetoStudies()) {
systematicTree->makeOutputVariable(m_PLIV_mu_PromptLeptonRNN_non_prompt_b, "PLIV_mu_PromptLeptonRNN_non_prompt_b");
systematicTree->makeOutputVariable(m_PLIV_mu_PromptLeptonRNN_non_prompt_c, "PLIV_mu_PromptLeptonRNN_non_prompt_c");
......@@ -2292,6 +2296,8 @@ namespace top {
m_mu_topoetcone20.resize(n_muons);
m_mu_ptvarcone30.resize(n_muons);
m_mu_isTight.resize(n_muons);
m_mu_passOR.resize(n_muons);
for (const auto& trigger : m_mu_trigMatched)
m_mu_trigMatched[trigger.first].resize(n_muons);
m_mu_d0sig.resize(n_muons);
......@@ -2342,6 +2348,12 @@ namespace top {
m_mu_isTight[i] = muPtr->auxdataConst<char>("passPreORSelection");
}
}
if(m_config->noORForMuons())
{
m_mu_passOR[i]=muPtr->auxdataConst<char>("passOverlapRemoval");
}
for (const auto& trigger : m_mu_trigMatched) {
std::string trig = "TRIGMATCH_" + trigger.first;
m_mu_trigMatched[trigger.first][i] = muPtr->auxdataConst<char>(trig);
......
......@@ -559,6 +559,7 @@ namespace top {
std::vector<float> m_mu_prodVtx_z;
std::vector<float> m_mu_prodVtx_perp;
std::vector<float> m_mu_prodVtx_phi;
std::vector<char> m_mu_passOR;
//soft muons
std::vector<float> m_softmu_pt;
......
......@@ -665,6 +665,8 @@ namespace top {
" noPhotonMuOR, noPhotonMuOrJetOR",
"recommended"
);
registerParameter("NoOverlapRemovalForMuons", "For tests: do not remove muons due to OR, instead store a flag with the OR result for them in the output. True or False (default: False).", "False");
registerParameter("OverlapRemovalSlidingInnerDRel",
"Overlap removal inner radius to be used for electron SlidingDR ,", "0.2");
......
......@@ -96,6 +96,8 @@ namespace top {
m_writeMETBuiltWithLooseObjects(false),
// Apply overlap removal on loose lepton definitons - not the top recommendation, for studies only
m_doOverlapRemovalOnLooseLeptonDef(false),
//test option for muons OR
m_noORForMuons(false),
// do overlap removal also with large-R jets
// (using whatever procedure is used in the official tools)
m_doLargeJetOverlapRemoval(false),
......@@ -1487,6 +1489,11 @@ namespace top {
if (settings->value("OverlapRemovalLeptonDef") == "Loose") this->setOverlapRemovalOnLooseLeptonDef();
m_overlap_removal_procedure = settings->value("OverlapRemovalProcedure");
//test option for muon OR
bool noORForMuons = false;
settings->retrieve("NoOverlapRemovalForMuons", noORForMuons);
this->setNoORForMuons(noORForMuons);
// do overlap removal also with large-R jets
// (using whatever procedure is used in the official tools)
......
......@@ -301,6 +301,13 @@ namespace top {
inline float overlapRemovalSlidingInnerDRmu() const
{return m_overlapRemovalSlidingInnerDRmu;}
//test option for muon OR
inline void setNoORForMuons(bool in){
if (!m_configFixed) m_noORForMuons=in;
}
inline bool noORForMuons() const{ return m_noORForMuons;}
// do overlap removal also with large-R jets
// (using whatever procedure is used in the official tools)
......@@ -2214,6 +2221,9 @@ namespace top {
float m_overlapRemovalSlidingInnerDRel = 0.2;
float m_overlapRemovalSlidingInnerDRmu = 0.2;
//test option for muon OR
bool m_noORForMuons;
// do overlap removal also with large-R jets
// (using whatever procedure is used in the official tools)
......
......@@ -964,6 +964,40 @@ void TopObjectSelection::applySelectionPreOverlapRemovalJetGhostTracks() {
goodPhotons, goodElectrons, goodMuons, goodTaus,
goodJets, goodLargeRJets, looseLeptonOR);
//test option for muons to store them also if they are removed from OR, saving a flag with the OR result for them
if(m_config->noORForMuons())
{
std::string passTopCuts("");
if (!looseLeptonOR) {
passTopCuts = "passPreORSelection";
}
if (looseLeptonOR) {
passTopCuts = "passPreORSelectionLoose";
}
std::vector<unsigned int> goodMuonsTemp;
unsigned int iMu=0;
for (const xAOD::Muon* x: *xaod_mu)
{
if(x->auxdataConst< char >(passTopCuts) == 1)
{
goodMuonsTemp.push_back(iMu);
}
bool passOR=false;
for(unsigned int isGoodMu : goodMuons)
{
if(iMu == isGoodMu)
{
passOR=true;
break;
}
}
x->auxdecor<char>("passOverlapRemoval") = passOR;
iMu++;
}
goodMuons = goodMuonsTemp;
}
// Additonal lepton information
std::vector<unsigned int> overlapsEl, overlapsMu;
if (m_overlapRemovalToolPostSelection->overlapsEl(overlapsEl)) {
......
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