ATLAS Offline Software
ClusterSelect.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 // ClusterSelect.cxx
5 // TopoCore
6 // Created by V Sorin, Joerg Stelzer
7 // Algorithm to select the abbreviated list of clusters , no order is applied
8 //
10 #include "L1TopoEvent/TOBArray.h"
12 #include "L1TopoEvent/GenericTOB.h"
13 #include <algorithm>
14 
15 REGISTER_ALG_TCS(ClusterSelect)
16 
17 // constructor
19  defineParameter( "InputWidth", 120 ); // for fw
20  defineParameter( "InputWidth1stStage", 30 ); // for fw
21  defineParameter( "OutputWidth", 6 );
22  defineParameter( "MinET", 0 );
23  defineParameter( "IsoMask", 0);
24  defineParameter( "MinEta", 0 );
25  defineParameter( "MaxEta", 63);
26  defineParameter( "DoIsoCut", 1);
27 }
28 
29 
30 // destructor
32 
35  m_numberOfClusters = parameter("OutputWidth").value();
36  m_et = parameter("MinET").value();
37  m_iso = parameter("IsoMask").value();
38  m_minEta = parameter("MinEta").value();
39  m_maxEta = parameter("MaxEta").value();
40  m_doIsoCut = parameter("DoIsoCut").value();
42 }
43 
46 
47  const ClusterTOBArray & clusters = dynamic_cast<const ClusterTOBArray&>(input);
48 
49  // fill output array with GenericTOB buildt from clusters
50  for(ClusterTOBArray::const_iterator cl = clusters.begin(); cl!= clusters.end(); ++cl ) {
51  const GenericTOB gtob(**cl);
52 
53  if( parType_t((*cl)->Et()) <= m_et ) continue; // ET cut
54  // isolation cut
55  if (m_doIsoCut && (m_iso != 0 )) {
56  if((parType_t((*cl)->isolation()) & m_iso) != m_iso ) continue;
57  }
58  // eta cut
59  if (parType_t(std::abs((*cl)-> eta())) < m_minEta) continue;
60  if (parType_t(std::abs((*cl)-> eta())) > m_maxEta) continue;
61 
62  output.push_back( gtob );
63  }
64 
65 
66  // keep only max number of clusters
67  int par = m_numberOfClusters ;
68  unsigned int maxNumberOfClusters = std::clamp(par, 0, std::abs(par));
69  if(maxNumberOfClusters>0) {
70 
71  if (output.size()> maxNumberOfClusters) {setOverflow(true);}
72 
73  while( output.size()> maxNumberOfClusters ) {
74  output.pop_back();
75  }
76  }
78 }
79 
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::ClusterSelect::~ClusterSelect
virtual ~ClusterSelect()
Definition: ClusterSelect.cxx:31
TCS::parType_t
uint32_t parType_t
Definition: Parameter.h:22
TCS::DataArrayImpl< ClusterTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
TCS::ClusterTOBArray
Definition: ClusterTOBArray.h:19
ClusterTOBArray.h
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
ClusterSelect.h
TCS::ClusterSelect::initialize
virtual TCS::StatusCode initialize()
Definition: ClusterSelect.cxx:34
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
TCS::ClusterSelect::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
Definition: ClusterSelect.cxx:45
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
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
TCS::ClusterSelect
Definition: ClusterSelect.h:19
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15