ATLAS Offline Software
JetNoSort.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 // JetNoSort.cxx
5 // TopoCore
6 // Created by Veronica Sorin on 14/8/14.
7 // Algorithm to generate ALL lists of JETs TOBs
8 //
10 #include "L1TopoEvent/TOBArray.h"
12 #include "L1TopoEvent/GenericTOB.h"
13 #include <algorithm>
14 
15 REGISTER_ALG_TCS(JetNoSort)
16 
17 
18 // constructor
19 TCS::JetNoSort::JetNoSort(const std::string & name) :
21 {
22  defineParameter( "InputWidth", 64 ); // for FW
23  defineParameter( "OutputWidth", 64 );
24  defineParameter( "JetSize", 2 );
25  m_jetsize = JetTOB::JS1;
26 }
27 
28 
30 {}
31 
34  m_numberOfJets = parameter("OutputWidth").value();
35  m_jsize = parameter("JetSize").value();
37 }
38 
39 
40 
41 
44  const JetTOBArray & jets = dynamic_cast<const JetTOBArray&>(input);
45  // because fw seems to have a differnt notation, for now 2 means JS1 8x8
46  m_jetsize = m_jsize==2?JetTOB::JS1:JetTOB::JS2;
47 
48  // fill output array with GenericTOBs builds from jets
49  for(JetTOBArray::const_iterator cl = jets.begin(); cl!= jets.end(); ++cl ) {
50 
51  output.push_back( GenericTOB(**cl, m_jetsize) );
52  }
53 
54 
55  // keep only max number of jets
56  int par = m_numberOfJets ;
57  unsigned int maxNumberOfJets = std::clamp(par, 0, std::abs(par));
58  if(maxNumberOfJets>0) {
59  while( output.size()> maxNumberOfJets ) {
60  output.pop_back();
61  }
62  }
64 }
65 
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::JetNoSort::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
Definition: JetNoSort.cxx:43
TCS::DataArrayImpl< JetTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
JetNoSort.h
TCS::JetTOB::JS2
@ JS2
Definition: JetTOB.h:21
TCS::JetNoSort::initialize
virtual TCS::StatusCode initialize()
Definition: JetNoSort.cxx:33
TCS::JetTOB::JS1
@ JS1
Definition: JetTOB.h:21
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
JetTOBArray.h
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::JetNoSort
Definition: JetNoSort.h:20
TCS::SortingAlg
Definition: SortingAlg.h:18
GenericTOB.h
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
TCS::JetTOBArray
Definition: JetTOBArray.h:21
TCS::JetNoSort::~JetNoSort
virtual ~JetNoSort()
Definition: JetNoSort.cxx:29
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15