ATLAS Offline Software
eTauSelect.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 // eTauSelect.cxx
5 // TopoCore
6 // Algorithm to select the abbreviated list of eTaus , no order is applied
7 //
9 #include "L1TopoEvent/TOBArray.h"
11 #include "L1TopoEvent/GenericTOB.h"
12 #include <algorithm>
13 
14 REGISTER_ALG_TCS(eTauSelect)
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( "RCoreMin", 0 );
23  defineParameter( "RHadMin", 0 );
24  defineParameter( "MinEta", 0 );
25  defineParameter( "MaxEta", 196 );
26 }
27 
28 
29 // destructor
31 
34  m_numberOfeTaus = parameter("OutputWidth").value();
35  m_et = parameter("MinET").value();
36  m_minRCore = parameter("RCoreMin").value();
37  m_minRHad = parameter("RHadMin").value();
39 }
40 
43 
44  const eTauTOBArray & clusters = dynamic_cast<const eTauTOBArray&>(input);
45 
46  // fill output array with GenericTOB buildt from clusters
47  for(eTauTOBArray::const_iterator etau = clusters.begin(); etau!= clusters.end(); ++etau ) {
48 
49  if( parType_t((*etau)->Et()) <= m_et ) continue; // ET cut
50 
51  // Isolation cut
52  if ( !isocut(m_minRCore, (*etau)-> rCore()) ) {continue;}
53  if ( !isocut(m_minRHad, (*etau)-> rHad()) ) {continue;}
54 
55  const GenericTOB gtob(**etau);
56  output.push_back( gtob );
57  }
58 
59 
60  // keep only max number of clusters
61  int par = m_numberOfeTaus ;
62  unsigned int maxNumberOfeTaus = std::clamp(par, 0, std::abs(par));
63  if(maxNumberOfeTaus>0) {
64 
65  if (output.size()> maxNumberOfeTaus) {setOverflow(true);}
66 
67  while( output.size()> maxNumberOfeTaus ) {
68  output.pop_back();
69  }
70  }
72 }
73 
TCS::eTauSelect::initialize
virtual TCS::StatusCode initialize() override
Definition: eTauSelect.cxx:33
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< eTauTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
eTauSelect.h
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
TCS::eTauTOBArray
Definition: eTauTOBArray.h:14
TCS::eTauSelect::~eTauSelect
virtual ~eTauSelect()
Definition: eTauSelect.cxx:30
TCS::InputTOBArray
Definition: InputTOBArray.h:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TOBArray.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::eTauSelect
Definition: eTauSelect.h:18
TCS::eTauSelect::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output) override final
Definition: eTauSelect.cxx:42
TCS::SortingAlg
Definition: SortingAlg.h:18
GenericTOB.h
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
GlobalSim::isocut
bool isocut(const std::string &threshold, const unsigned int bit)
Definition: isocut.cxx:10
eTauTOBArray.h
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15