Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Introduce option to run AsgDeadHVCellRemovalTool for electrons #1706

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Root/ElectronSelector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ EL::StatusCode ElectronSelector :: initialize ()
m_el_cutflow_all = m_el_cutflowHist_1->GetXaxis()->FindBin("all");
m_el_cutflow_author_cut = m_el_cutflowHist_1->GetXaxis()->FindBin("author_cut");
m_el_cutflow_OQ_cut = m_el_cutflowHist_1->GetXaxis()->FindBin("OQ_cut");
m_el_cutflow_deadHVCell_cut = m_el_cutflowHist_1->GetXaxis()->FindBin("deadHVCell_cut");
m_el_cutflow_ptmax_cut = m_el_cutflowHist_1->GetXaxis()->FindBin("ptmax_cut");
m_el_cutflow_ptmin_cut = m_el_cutflowHist_1->GetXaxis()->FindBin("ptmin_cut");
m_el_cutflow_eta_cut = m_el_cutflowHist_1->GetXaxis()->FindBin("eta_cut"); // including crack veto, if applied
Expand All @@ -167,6 +168,7 @@ EL::StatusCode ElectronSelector :: initialize ()
m_el_cutflow_all = m_el_cutflowHist_2->GetXaxis()->FindBin("all");
m_el_cutflow_author_cut = m_el_cutflowHist_2->GetXaxis()->FindBin("author_cut");
m_el_cutflow_OQ_cut = m_el_cutflowHist_2->GetXaxis()->FindBin("OQ_cut");
m_el_cutflow_deadHVCell_cut = m_el_cutflowHist_2->GetXaxis()->FindBin("deadHVCell_cut");
m_el_cutflow_ptmax_cut = m_el_cutflowHist_2->GetXaxis()->FindBin("ptmax_cut");
m_el_cutflow_ptmin_cut = m_el_cutflowHist_2->GetXaxis()->FindBin("ptmin_cut");
m_el_cutflow_eta_cut = m_el_cutflowHist_2->GetXaxis()->FindBin("eta_cut"); // including crack veto, if applied
Expand Down Expand Up @@ -401,6 +403,19 @@ EL::StatusCode ElectronSelector :: initialize ()

// **********************************************************************************************


// Set up the dead HV Removal Tool
if (m_applyDeadHVCellVeto)
m_deadHVTool.setTypeAndName("AsgDeadHVCellRemovalTool/deadHVTool");
if (m_deadHVTool.retrieve().isFailure()){
ANA_MSG_ERROR("Failed to retrieve DeadHVTool, aborting");
return StatusCode::FAILURE;
}
else {
ANA_MSG_WARNING("Not applying veto of dead HV cells although it's recommended - please double check!");
}


ANA_MSG_INFO( "ElectronSelector Interface succesfully initialized!" );

return EL::StatusCode::SUCCESS;
Expand Down Expand Up @@ -860,6 +875,19 @@ int ElectronSelector :: passCuts( const xAOD::Electron* electron, const xAOD::Ve
if (!m_isUsedBefore && m_useCutFlow) m_el_cutflowHist_1->Fill( m_el_cutflow_OQ_cut, 1 );
if ( m_isUsedBefore && m_useCutFlow ) { m_el_cutflowHist_2->Fill( m_el_cutflow_OQ_cut, 1 ); }

// *********************************************************************************************************************************************************************
//
// Dead HV Cell veto (affects only 2016 data)
//
if ( m_applyDeadHVCellVeto ) {
if( !m_deadHVTool->accept(electron) ){
ANA_MSG_DEBUG( "Electron failed dead HV cell veto." );
return 0;
}
}
if (!m_isUsedBefore && m_useCutFlow) m_el_cutflowHist_1->Fill( m_el_cutflow_deadHVCell_cut, 1 );
if ( m_isUsedBefore && m_useCutFlow ) { m_el_cutflowHist_2->Fill( m_el_cutflow_deadHVCell_cut, 1 ); }

// *********************************************************************************************************************************************************************
//
// pT max cut
Expand Down
10 changes: 10 additions & 0 deletions xAODAnaHelpers/ElectronSelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// EDM include(s):
#include "xAODEgamma/ElectronContainer.h"
#include "xAODTracking/Vertex.h"
#include "EgammaAnalysisInterfaces/IAsgDeadHVCellRemovalTool.h"

// package include(s):
#include "xAODAnaHelpers/ParticlePIDManager.h"
Expand Down Expand Up @@ -128,6 +129,8 @@ class ElectronSelector : public xAH::Algorithm
bool m_doAuthorCut = true;
/// @brief Perform object quality cut
bool m_doOQCut = true;
/// @brief Apply veto dead HV cells, affects only 2016 data
bool m_applyDeadHVCellVeto = false;

///// electron PID /////

Expand Down Expand Up @@ -199,6 +202,7 @@ class ElectronSelector : public xAH::Algorithm

std::string m_isoDecSuffix = "";


private:

/**
Expand Down Expand Up @@ -247,6 +251,7 @@ class ElectronSelector : public xAH::Algorithm
int m_el_cutflow_all; //!
int m_el_cutflow_author_cut; //!
int m_el_cutflow_OQ_cut; //!
int m_el_cutflow_deadHVCell_cut; //!
int m_el_cutflow_ptmax_cut; //!
int m_el_cutflow_ptmin_cut; //!
int m_el_cutflow_eta_cut; //!
Expand All @@ -259,6 +264,8 @@ class ElectronSelector : public xAH::Algorithm

std::vector<std::string> m_IsoKeys; //!



/* tools */

/// @brief MC15 ASG tool for isolation
Expand All @@ -278,6 +285,9 @@ class ElectronSelector : public xAH::Algorithm
/// @brief class to manage cut-based PID selection/decorations - see ISSUE for explaination
ElectronCutBasedPIDManager* m_el_CutBased_PIDManager = nullptr; //!

/// @brief tool that selects on dead HV from the 2016 run, according to https://twiki.cern.ch/twiki/bin/view/AtlasProtected/EGammaIdentificationRun2#Removal_of_Electron_Photon_clust
asg::AnaToolHandle<IAsgDeadHVCellRemovalTool> m_deadHVTool;

/* other private members */

/** @rst
Expand Down
Loading