ATLAS Offline Software
ClusterNoSort.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 // ClusterNoSort.cxx
5 // TopoCore
6 // Created by V Sorin, Joerg Stelzer
7 // Algorithm to create the all 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(ClusterNoSort)
16 
17 // constructor
19  defineParameter( "InputWidth", 120 ); // for fw
20  defineParameter( "OutputWidth", 120 );
21  defineParameter( "IsoMask", 0);
22 }
23 
24 
25 // destructor
27 
30  m_numberOfClusters = parameter("OutputWidth").value();
31  m_iso = parameter("IsoMask").value();
33 }
34 
37 
38  const ClusterTOBArray & clusters = dynamic_cast<const ClusterTOBArray&>(input);
39 
40  // fill output array with GenericTOB buildt from clusters
41  for(ClusterTOBArray::const_iterator cl = clusters.begin(); cl!= clusters.end(); ++cl ) {
42  const GenericTOB gtob(**cl);
43 
44  // isolation cut
45  if (m_iso != 0 ) {
46  unsigned int isobit(0x1 << (m_iso-1));
47  if((parType_t((*cl)->isolation()) & isobit) != isobit ) continue;
48  }
49 
50  output.push_back( gtob );
51  }
52 
53 
54  // keep only max number of clusters
55  int par = m_numberOfClusters ;
56  unsigned int maxNumberOfClusters = std::clamp(par, 0, std::abs(par));
57  if(maxNumberOfClusters>0) {
58  while( output.size()> maxNumberOfClusters ) {
59  output.pop_back();
60  }
61  }
63 }
64 
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
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< 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
TCS::ClusterNoSort::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
Definition: ClusterNoSort.cxx:36
TCS::ClusterNoSort
Definition: ClusterNoSort.h:19
TCS::InputTOBArray
Definition: InputTOBArray.h:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TCS::ClusterNoSort::~ClusterNoSort
virtual ~ClusterNoSort()
Definition: ClusterNoSort.cxx:26
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::SortingAlg
Definition: SortingAlg.h:18
GenericTOB.h
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
TCS::ClusterNoSort::initialize
virtual TCS::StatusCode initialize()
Definition: ClusterNoSort.cxx:29
ClusterNoSort.h
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