Skip to content

Commit

Permalink
Implementing option for deadHV photon veto (#1712)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Hank <[email protected]>
  • Loading branch information
mdhank and Michael Hank authored Jan 16, 2025
1 parent 8d3c000 commit 691338a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Root/ElectronSelector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ EL::StatusCode ElectronSelector :: initialize ()
}
}
else {
ANA_MSG_WARNING("Not applying veto of dead HV cells although it's recommended - please double check!");
ANA_MSG_WARNING("Not applying veto of dead HV cells on electrons although it's recommended - please double check!");
}


Expand Down
25 changes: 25 additions & 0 deletions Root/PhotonSelector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ EL::StatusCode PhotonSelector :: initialize ()
m_ph_cutflow_author_cut = m_ph_cutflowHist_1->GetXaxis()->FindBin("author_cut");
m_ph_cutflow_OQ_cut = m_ph_cutflowHist_1->GetXaxis()->FindBin("OQ_cut");
m_ph_cutflow_PID_cut = m_ph_cutflowHist_1->GetXaxis()->FindBin("PID_cut");
m_ph_cutflow_deadHVCell_cut = m_ph_cutflowHist_1->GetXaxis()->FindBin("deadHVCell_cut");
m_ph_cutflow_ptmax_cut = m_ph_cutflowHist_1->GetXaxis()->FindBin("ptmax_cut");
m_ph_cutflow_ptmin_cut = m_ph_cutflowHist_1->GetXaxis()->FindBin("ptmin_cut");
m_ph_cutflow_eta_cut = m_ph_cutflowHist_1->GetXaxis()->FindBin("eta_cut"); // including crack veto, if applied
Expand Down Expand Up @@ -193,6 +194,18 @@ EL::StatusCode PhotonSelector :: 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 on photons although it's recommended - please double check!");
}

ANA_MSG_INFO( "PhotonSelector Interface succesfully initialized!" );

return EL::StatusCode::SUCCESS;
Expand Down Expand Up @@ -456,6 +469,18 @@ bool PhotonSelector :: passCuts( const xAOD::Photon* photon )
}
if(m_useCutFlow) m_ph_cutflowHist_1->Fill( m_ph_cutflow_PID_cut, 1 );

// *********************************************************************************************************************************************************************
//
// Dead HV Cell veto (affects only 2016 data)
//
if ( m_applyDeadHVCellVeto ) {
if( !m_deadHVTool->accept(photon) ){
ANA_MSG_DEBUG( "Photon failed dead HV cell veto." );
return 0;
}
}
if (m_useCutFlow) m_ph_cutflowHist_1->Fill( m_ph_cutflow_deadHVCell_cut, 1 );

// *********************************************************************************************************************************************************************
//
// pT max cut
Expand Down
7 changes: 7 additions & 0 deletions xAODAnaHelpers/PhotonSelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <xAODAnaHelpers/Algorithm.h>
#include <xAODTracking/VertexContainer.h>
#include <xAODEgamma/PhotonContainer.h>
#include <EgammaAnalysisInterfaces/IAsgDeadHVCellRemovalTool.h>

namespace CP {
class IsolationSelectionTool;
Expand Down Expand Up @@ -46,6 +47,8 @@ class PhotonSelector : public xAH::Algorithm
bool m_vetoCrack = true;
bool m_doAuthorCut = true;
bool m_doOQCut = true;
/// @brief Apply veto dead HV cells, affects only 2016 data
bool m_applyDeadHVCellVeto = false;
/** read object quality from derivation, rather than calculating it on the fly */
bool m_readOQFromDerivation = false;

Expand Down Expand Up @@ -82,6 +85,7 @@ class PhotonSelector : public xAH::Algorithm
int m_ph_cutflow_author_cut; //!
int m_ph_cutflow_OQ_cut; //!
int m_ph_cutflow_PID_cut; //!
int m_ph_cutflow_deadHVCell_cut; //!
int m_ph_cutflow_ptmax_cut; //!
int m_ph_cutflow_ptmin_cut; //!
int m_ph_cutflow_eta_cut; //!
Expand All @@ -93,6 +97,9 @@ class PhotonSelector : public xAH::Algorithm
/* tools */
CP::IsolationSelectionTool* m_IsolationSelectionTool = 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; //!

public:

/* this is a standard constructor */
Expand Down

0 comments on commit 691338a

Please sign in to comment.