ATLAS Offline Software
eEmNoSort.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 // eEmNoSort.cxx
5 // TopoCore
6 // Algorithm to generate ALL lists of eEm TOBs
7 
9 #include "L1TopoEvent/TOBArray.h"
11 #include "L1TopoEvent/GenericTOB.h"
12 #include <algorithm>
13 
14 REGISTER_ALG_TCS(eEmNoSort)
15 
16 // constructor
18  defineParameter( "InputWidth", 120 ); // for fw
19  defineParameter( "OutputWidth", 120 );
20  defineParameter( "REtaMin", 0);
21  defineParameter( "RHadMin", 0);
22  defineParameter( "WsTotMin", 0);
23 }
24 
25 
26 // destructor
28 
31  m_numberOfeEms = parameter("OutputWidth").value();
32  m_minREta = parameter("REtaMin").value();
33  m_minRHad = parameter("RHadMin").value();
34  m_minWsTot = parameter("WsTotMin").value();
36 }
37 
40 
41  const eEmTOBArray & clusters = dynamic_cast<const eEmTOBArray&>(input);
42 
43  // fill output array with GenericTOB built from clusters
44  for(eEmTOBArray::const_iterator eem = clusters.begin(); eem!= clusters.end(); ++eem ) {
45 
46  // Isolation cut
47  if ( !isocut(m_minREta, (*eem)-> Reta()) ) {continue;}
48  if ( !isocut(m_minRHad, (*eem)-> Rhad()) ) {continue;}
49  if ( !isocut(m_minWsTot, (*eem)-> Wstot()) ) {continue;}
50 
51  const GenericTOB gtob(**eem);
52  output.push_back( gtob );
53  }
54 
55 
56  // keep only max number of clusters
57  int par = m_numberOfeEms ;
58  unsigned int maxNumberOfeEms = std::clamp(par, 0, std::abs(par));
59  if(maxNumberOfeEms>0) {
60  while( output.size()> maxNumberOfeEms ) {
61  output.pop_back();
62  }
63  }
65 }
66 
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::eEmNoSort::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output) override final
Definition: eEmNoSort.cxx:39
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::eEmTOBArray
Definition: L1Topo/L1TopoEvent/L1TopoEvent/eEmTOBArray.h:14
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
TCS::eEmNoSort
Definition: eEmNoSort.h:18
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:221
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
TCS::eEmNoSort::~eEmNoSort
virtual ~eEmNoSort()
Definition: eEmNoSort.cxx:27
TCS::SortingAlg
Definition: SortingAlg.h:18
eEmNoSort.h
GenericTOB.h
TCS::eEmNoSort::initialize
virtual TCS::StatusCode initialize() override
Definition: eEmNoSort.cxx:30
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
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