ATLAS Offline Software
L1Topo/L1TopoAlgorithms/Root/eEmSelect.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 // eEmSelect.cxx
5 // TopoCore
6 // Algorithm to select the abbreviated list of eEMs , no order is applied
7 //
9 #include "L1TopoEvent/TOBArray.h"
11 #include "L1TopoEvent/GenericTOB.h"
12 #include <algorithm>
13 
14 REGISTER_ALG_TCS(eEmSelect)
15 
16 // constructor
18  defineParameter( "InputWidth", 120 ); // for fw
19  defineParameter( "InputWidth1stStage", 30 ); // for fw
20  defineParameter( "OutputWidth", 6 );
21  defineParameter( "MinET", 0 );
22  defineParameter( "REtaMin", 0 );
23  defineParameter( "RHadMin", 0 );
24  defineParameter( "WsTotMin", 0 );
25  defineParameter( "MinEta", 0 );
26  defineParameter( "MaxEta", 196 );
27 }
28 
29 
30 // destructor
32 
35  m_numberOfeEms = parameter("OutputWidth").value();
36  m_et = parameter("MinET").value();
37  m_minREta = parameter("REtaMin").value();
38  m_minRHad = parameter("RHadMin").value();
39  m_minWsTot = parameter("WsTotMin").value();
41 }
42 
45 
46  const eEmTOBArray & eems = dynamic_cast<const eEmTOBArray&>(input);
47 
48  // fill output array with GenericTOB buildt from eEms
49  for(eEmTOBArray::const_iterator eem = eems.begin(); eem!= eems.end(); ++eem ) {
50 
51  if( parType_t((*eem)->Et()) <= m_et ) continue; // ET cut
52  // isolation cut
53  if ( !isocut(m_minREta, (*eem)-> Reta()) ) {continue;}
54  if ( !isocut(m_minRHad, (*eem)-> Rhad()) ) {continue;}
55  if ( !isocut(m_minWsTot, (*eem)-> Wstot()) ) {continue;}
56 
57  const GenericTOB gtob(**eem);
58  output.push_back( gtob );
59  }
60 
61 
62  // keep only max number of eEms
63  int par = m_numberOfeEms ;
64  unsigned int maxNumberOfeEms = std::clamp(par, 0, std::abs(par));
65  if(maxNumberOfeEms>0) {
66 
67  if (output.size()> maxNumberOfeEms) {setOverflow(true);}
68 
69  while( output.size()> maxNumberOfeEms ) {
70  output.pop_back();
71  }
72  }
74 }
75 
TCS::eEmSelect
Definition: L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/eEmSelect.h:18
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::parType_t
uint32_t parType_t
Definition: Parameter.h:22
TCS::DataArrayImpl< eEmTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
xAOD::EgammaParameters::Reta
@ Reta
e237/e277
Definition: EgammaEnums.h:154
TCS::eEmSelect::~eEmSelect
virtual ~eEmSelect()
Definition: L1Topo/L1TopoAlgorithms/Root/eEmSelect.cxx:31
TCS::eEmSelect::initialize
virtual TCS::StatusCode initialize() override
Definition: L1Topo/L1TopoAlgorithms/Root/eEmSelect.cxx:34
TCS::eEmTOBArray
Definition: L1Topo/L1TopoEvent/L1TopoEvent/eEmTOBArray.h:14
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
TCS::DataArrayImpl::end
iterator end()
Definition: DataArrayImpl.h:43
TCS::InputTOBArray
Definition: InputTOBArray.h:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TOBArray.h
eEmTOBArray.h
TCS::TOBArray
Definition: TOBArray.h:24
merge.output
output
Definition: merge.py:17
TCS::GenericTOB
Definition: GenericTOB.h:35
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition: AlgFactory.h:62
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
TCS::SortingAlg
Definition: SortingAlg.h:18
GenericTOB.h
TCS::DataArrayImpl::begin
iterator begin()
Definition: DataArrayImpl.h:40
eEmSelect.h
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
TCS::eEmSelect::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output) override final
Definition: L1Topo/L1TopoAlgorithms/Root/eEmSelect.cxx:44
xAOD::EgammaParameters::Rhad
@ Rhad
ethad/et
Definition: EgammaEnums.h:160
GlobalSim::isocut
bool isocut(const std::string &threshold, const unsigned int bit)
Definition: isocut.cxx:10
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15