ATLAS Offline Software
JetAbbreviated.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 // JetAbbreviated.cxx
5 // TopoCore
6 // Created by Veronica Sorin on 14/8/14.
7 
9 #include "L1TopoEvent/TOBArray.h"
11 #include "L1TopoEvent/GenericTOB.h"
12 #include <algorithm>
13 
14 REGISTER_ALG_TCS(JetAbbreviated)
15 
16 
17 // constructor
20 {
21  defineParameter( "NumberOfJets", 0 );
22  defineParameter( "JetSize", 0 );
23  defineParameter( "MinEta", 0 );
24  defineParameter( "MaxEta", 49);
25  m_jetsize = JetTOB::JS1;
26 }
27 
28 
30 {}
31 
32 
33 
34 
35 
36 
39  const JetTOBArray & jets = dynamic_cast<const JetTOBArray&>(input);
40  // because fw seems to have a differnt notation, for now 2 means JS1 8x8
41  m_jetsize = parameter("JetSize").value()==2?JetTOB::JS1:JetTOB::JS2;
42 
43 
44  // fill output array with GenericTOBs builds from jets
45  for(JetTOBArray::const_iterator cl = jets.begin(); cl!= jets.end(); ++cl ) {
46 
47  if (parType_t(std::abs((*cl)-> eta())) < parameter("MinEta").value()) continue;
48  if (parType_t(std::abs((*cl)-> eta())) > parameter("MaxEta").value()) continue;
49 
50  output.push_back( GenericTOB(**cl, m_jetsize) );
51  }
52 
53 
54  // keep only max number of jets
55  int par = parameter("NumberOfJets").value();
56  unsigned int maxNumberOfJets = std::clamp(par, 0, std::abs(par));
57  if(maxNumberOfJets>0) {
58  while( output.size()> maxNumberOfJets ) {
59  output.pop_back();
60  }
61  }
63 }
64 
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< JetTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
TCS::JetTOB::JS2
@ JS2
Definition: JetTOB.h:21
TCS::JetAbbreviated
Definition: JetAbbreviated.h:20
athena.value
value
Definition: athena.py:122
TCS::JetTOB::JS1
@ JS1
Definition: JetTOB.h:21
TCS::JetAbbreviated::~JetAbbreviated
virtual ~JetAbbreviated()
Definition: JetAbbreviated.cxx:29
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
JetTOBArray.h
TCS::InputTOBArray
Definition: InputTOBArray.h:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TOBArray.h
TCS::TOBArray
Definition: TOBArray.h:24
TCS::JetAbbreviated::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
Definition: JetAbbreviated.cxx:38
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
JetAbbreviated.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
TCS::SortingAlg
Definition: SortingAlg.h:18
GenericTOB.h
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
TCS::JetTOBArray
Definition: JetTOBArray.h:21
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