Skip to content

Commit

Permalink
introduce option to run AsgDeadHVCellRemovalTool for electrons
Browse files Browse the repository at this point in the history
  • Loading branch information
miholzbo committed Oct 29, 2024
1 parent 1f23e8b commit 3196344
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
24 changes: 24 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,15 @@ EL::StatusCode ElectronSelector :: initialize ()

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


// Set up the dead HV Removal Tool
m_deadHVTool.setTypeAndName("AsgDeadHVCellRemovalTool/deadHVTool");
if (m_deadHVTool.retrieve().isFailure()){
ANA_MSG_ERROR("Failed to retrieve DeadHVTool, aborting");
return StatusCode::FAILURE;
}


ANA_MSG_INFO( "ElectronSelector Interface succesfully initialized!" );

return EL::StatusCode::SUCCESS;
Expand Down Expand Up @@ -860,6 +871,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

0 comments on commit 3196344

Please sign in to comment.