ATLAS Offline Software
jEmSelect.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 // jEmSelect.cxx
5 // TopoCore
6 // algorithm to create abbreviated jEm lists
7 //
9 #include "L1TopoEvent/TOBArray.h"
11 #include "L1TopoEvent/GenericTOB.h"
12 #include <algorithm>
13 
14 REGISTER_ALG_TCS(jEmSelect)
15 
16 
17 // constructor
18 TCS::jEmSelect::jEmSelect(const std::string & name) :
20 {
21  defineParameter( "InputWidth", 64 ); // for FW
22  defineParameter( "InputWidth1stStage", 16 ); // for FW
23  defineParameter( "OutputWidth", 10 );
24  defineParameter( "MinET", 0 );
25  defineParameter( "MinEta", 0 );
26  defineParameter( "MaxEta", 196 );
27  defineParameter( "IsoMin", 0 );
28  defineParameter( "Frac1Min", 0 );
29  defineParameter( "Frac2Min", 0 );
30 }
31 
32 
34 {}
35 
38  m_numberOfJets = parameter("OutputWidth").value();
39  m_et = parameter("MinET").value();
40  m_minEta = parameter("MinEta").value();
41  m_maxEta = parameter("MaxEta").value();
42  m_maxEta = parameter("MaxEta").value();
43  m_iso = parameter("IsoMin").value();
44  m_frac1 = parameter("Frac1Min").value();
45  m_frac2 = parameter("Frac2Min").value();
47 }
48 
49 
50 
51 
54 
55  const jEmTOBArray & jets = dynamic_cast<const jEmTOBArray&>(input);
56 
57  // fill output array with GenericTOBs builds from jets
58  for(jEmTOBArray::const_iterator jet = jets.begin(); jet!= jets.end(); ++jet ) {
59  // ET cut
60  if ( parType_t((*jet)->Et()) <= m_et ) continue;
61  // Isolation cuts
62  if ( !isocut(m_iso, (*jet)-> isolation()) ) continue;
63  if ( !isocut(m_frac1, (*jet)-> frac1()) ) continue;
64  if ( !isocut(m_frac2, (*jet)-> frac2()) ) continue;
65  // Eta cut
66  if ( parType_t(std::abs((*jet)-> eta())) < m_minEta ) continue;
67  if ( parType_t(std::abs((*jet)-> eta())) > m_maxEta ) continue;
68 
69  output.push_back( GenericTOB(**jet) );
70  }
71 
72  // keep only max number of jets
73  int par = m_numberOfJets ;
74  unsigned int maxNumberOfJets = std::clamp(par, 0, std::abs(par));
75  if(maxNumberOfJets>0) {
76 
77  if (output.size()> maxNumberOfJets) {setOverflow(true);}
78 
79  while( output.size()> maxNumberOfJets ) {
80  output.pop_back();
81  }
82  }
84 }
85 
TCS::jEmSelect
Definition: jEmSelect.h:18
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::jEmSelect::~jEmSelect
virtual ~jEmSelect()
Definition: jEmSelect.cxx:33
TCS::parType_t
uint32_t parType_t
Definition: Parameter.h:22
TCS::DataArrayImpl< jEmTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
TCS::jEmSelect::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output) override final
Definition: jEmSelect.cxx:53
TCS::jEmSelect::initialize
virtual TCS::StatusCode initialize() override
Definition: jEmSelect.cxx:37
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
TCS::InputTOBArray
Definition: InputTOBArray.h:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TOBArray.h
TCS::TOBArray
Definition: TOBArray.h:24
jEmTOBArray.h
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::SortingAlg
Definition: SortingAlg.h:18
GenericTOB.h
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
TCS::jEmTOBArray
Definition: jEmTOBArray.h:19
jEmSelect.h
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