ATLAS Offline Software
jTauSelect.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 // jTauSelect.cxx
5 // TopoCore
6 // Algorithm to select the abbreviated list of jTaus , no order is applied
7 //
8 
10 #include "L1TopoEvent/TOBArray.h"
12 #include "L1TopoEvent/GenericTOB.h"
13 #include <algorithm>
14 
15 REGISTER_ALG_TCS(jTauSelect)
16 
17 // constructor
19  defineParameter( "InputWidth", 120); // for fw
20  defineParameter( "OutputWidth", 6);
21  defineParameter( "MinET", 0 );
22  defineParameter( "MinEta", 0 );
23  defineParameter( "MaxEta", 196 );
24  defineParameter( "Isolation", 1024);
25  defineParameter( "passIsolation", false);
26 }
27 
28 
29 // destructor
31 
34 
35  m_numberOfjTaus = parameter("OutputWidth").value();
36  m_minET = parameter("MinET").value();
37  m_minEta = parameter("MinEta").value();
38  m_maxEta = parameter("MaxEta").value();
39  m_iso = parameter("Isolation").value();
40  m_passIsolation = parameter("passIsolation").value();
41 
43 }
44 
47 
48  const jTauTOBArray & clusters = dynamic_cast<const jTauTOBArray&>(input);
49 
50  // fill output array with GenericTOB built from clusters
51  for(jTauTOBArray::const_iterator jtau = clusters.begin(); jtau!= clusters.end(); ++jtau ) {
52  if ( parType_t((*jtau)-> Et()) < m_minET ) continue;
53  if ( parType_t(std::abs((*jtau)-> eta())) < m_minEta ) continue;
54  if ( parType_t(std::abs((*jtau)-> eta())) > m_maxEta ) continue;
55  if (! ( m_passIsolation || checkIsolation(*jtau) ) ) continue;
56 
57  const GenericTOB gtob(**jtau);
58  output.push_back( gtob );
59  }
60 
61 
62  // keep only max number of jTaus
63  int par = m_numberOfjTaus ;
64  unsigned int maxNumberOfJTaus = std::clamp(par, 0, std::abs(par));
65  if(maxNumberOfJTaus>0) {
66  while( output.size()> maxNumberOfJTaus ) {
67  if (output.size() == (maxNumberOfJTaus+1)) {
68  bool isAmbiguous = output[maxNumberOfJTaus-1].Et() == output[maxNumberOfJTaus].Et();
69  if (isAmbiguous) { output.setAmbiguityFlag(true); }
70  }
71  output.pop_back();
72  }
73  }
75 }
76 
77 
78 bool
80  if(m_passIsolation) return true;
81  return jtau->EtIso()*1024 < jtau->Et()*m_iso;
82 }
83 
TCS::jTauTOBArray
Definition: jTauTOBArray.h:19
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< jTauTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
TCS::jTauTOB::EtIso
unsigned int EtIso() const
Definition: jTauTOB.h:40
TCS::jTauTOB::Et
unsigned int Et() const
Definition: jTauTOB.h:32
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
jTauSelect.h
TCS::InputTOBArray
Definition: InputTOBArray.h:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TCS::jTauTOB
Definition: jTauTOB.h:16
TOBArray.h
TCS::jTauSelect::~jTauSelect
virtual ~jTauSelect()
Definition: jTauSelect.cxx:30
TCS::jTauSelect::checkIsolation
bool checkIsolation(const TCS::jTauTOB *jtau) const
Definition: jTauSelect.cxx:79
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::jTauSelect
Definition: jTauSelect.h:18
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
TCS::jTauSelect::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output) override final
Definition: jTauSelect.cxx:46
TCS::jTauSelect::initialize
virtual TCS::StatusCode initialize() override
Definition: jTauSelect.cxx:33
jTauTOBArray.h
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15