ATLAS Offline Software
jEmNoSort.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 // jEmNoSort.cxx
5 // TopoCore
6 // Algorithm to generate ALL lists of jEm TOBs
7 
9 #include "L1TopoEvent/TOBArray.h"
11 #include "L1TopoEvent/GenericTOB.h"
12 #include <algorithm>
13 
14 REGISTER_ALG_TCS(jEmNoSort)
15 
16 
17 // constructor
18 TCS::jEmNoSort::jEmNoSort(const std::string & name) :
20 {
21  defineParameter( "InputWidth", 64 ); // for FW
22  defineParameter( "OutputWidth", 64 );
23  defineParameter( "IsoMin", 0 );
24  defineParameter( "Frac1Min", 0 );
25  defineParameter( "Frac2Min", 0 );
26 }
27 
28 
30 {}
31 
34  m_numberOfjEms = parameter("OutputWidth").value();
35  m_iso = parameter("IsoMin").value();
36  m_frac1 = parameter("Frac1Cut").value();
37  m_frac2 = parameter("Frac2Cut").value();
39 }
40 
41 
42 
43 
46  const jEmTOBArray & jets = dynamic_cast<const jEmTOBArray&>(input);
47 
48  // fill output array with GenericTOBs builds from jets
49  for(jEmTOBArray::const_iterator jet = jets.begin(); jet!= jets.end(); ++jet ) {
50  // Isolation cuts
51  if ( !isocut(m_iso, (*jet)-> isolation()) ) continue;
52  if ( !isocut(m_frac1, (*jet)-> frac1()) ) continue;
53  if ( !isocut(m_frac2, (*jet)-> frac2()) ) continue;
54 
55  output.push_back( GenericTOB(**jet) );
56  }
57 
58 
59  // keep only max number of jets
60  int par = m_numberOfjEms ;
61  unsigned int maxNumberOfjEms = std::clamp(par, 0, std::abs(par));
62  if(maxNumberOfjEms>0) {
63  while( output.size()> maxNumberOfjEms ) {
64  output.pop_back();
65  }
66  }
68 }
69 
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::DataArrayImpl< jEmTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
TCS::jEmNoSort::~jEmNoSort
virtual ~jEmNoSort()
Definition: jEmNoSort.cxx:29
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
jEmNoSort.h
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
TCS::jEmNoSort
Definition: jEmNoSort.h:19
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:228
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
TCS::jEmNoSort::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output) override final
Definition: jEmNoSort.cxx:45
GlobalSim::isocut
bool isocut(const std::string &threshold, const unsigned int bit)
Definition: isocut.cxx:10
TCS::jEmNoSort::initialize
virtual TCS::StatusCode initialize() override
Definition: jEmNoSort.cxx:33
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15