ATLAS Offline Software
Classes | Functions | Variables
python.CaloThinCellsByClusterAlg_test Namespace Reference

Classes

class  CheckThinningAlg
 
class  CreateDataAlg
 

Functions

def make_calo_cells (mgr)
 
def make_clusters (mgr, ccc, hashes, ctx)
 
def testCfg (flags)
 

Variables

 cell_hashes = set()
 
 flags = initConfigFlags()
 
 Files
 
 TimeStamps
 
 GeometryLAr
 
 GeometryTile
 
 acc = MainServicesCfg(flags)
 

Function Documentation

◆ make_calo_cells()

def python.CaloThinCellsByClusterAlg_test.make_calo_cells (   mgr)

Definition at line 20 of file CaloThinCellsByClusterAlg_test.py.

20 def make_calo_cells (mgr):
21  ccc = ROOT.CaloCellContainer()
22  for i in range (mgr.element_size()):
23  elt = mgr.get_element (ROOT.IdentifierHash (i))
24  if not elt: break
25  cc = ROOT.CaloCell (elt, 0, 0, 0, 0)
26  ccc.push_back (cc)
27  ROOT.SetOwnership (cc, False)
28  ccc.order()
29  ccc.updateCaloIterators()
30  return ccc
31 
32 

◆ make_clusters()

def python.CaloThinCellsByClusterAlg_test.make_clusters (   mgr,
  ccc,
  hashes,
  ctx 
)

Definition at line 33 of file CaloThinCellsByClusterAlg_test.py.

33 def make_clusters (mgr, ccc, hashes, ctx):
34  clc = ROOT.xAOD.CaloClusterContainer()
35  clc_store = ROOT.xAOD.CaloClusterAuxContainer()
36  clc.setStore (clc_store)
37  cellLinks = ROOT.CaloClusterCellLinkContainer()
38  ids = ROOT.vector(ROOT.IdentifierHash)()
39 
40  for i in range(2):
41  cl = ROOT.xAOD.CaloCluster()
42  clc.push_back (cl)
43  ROOT.SetOwnership (cl, False)
44  eta = 0.5 - i # 0.5 or -0.5
45  phi = 1
46  cl.setEta (eta)
47  cl.setPhi (phi)
48  cl.setClusterSize (ROOT.xAOD.CaloCluster.SW_37ele)
49  links = ROOT.CaloClusterCellLink (ccc)
50  cl.addCellLink (links)
51  ROOT.SetOwnership (links, False)
52 
53  mgr.cellsInZone (eta - 0.05, eta + 0.05, phi - 0.05, phi + 0.05, ids)
54  for hash in ids:
55  elt = mgr.get_element (hash)
56  s = elt.getSampling()
57  if s == 0 or s == 2:
58  idx = ccc.findIndex (hash)
59  if idx < 0:
60  print ("??? Can't find cell with hash ", hash)
61  else:
62  hashes.add (hash.value())
63  cl.addCell (idx, 1)
64  cl.setLink(cellLinks, ctx)
65 
66  return (clc, clc_store, cellLinks)
67 
68 

◆ testCfg()

def python.CaloThinCellsByClusterAlg_test.testCfg (   flags)

Definition at line 114 of file CaloThinCellsByClusterAlg_test.py.

114 def testCfg (flags):
115  result = ComponentAccumulator()
116 
117  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
118  from TileGeoModel.TileGMConfig import TileGMCfg
119  result.merge(LArGMCfg(flags))
120  result.merge(TileGMCfg(flags))
121 
122  from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
123  result.merge(LArOnOffIdMappingCfg(flags))
124 
125  result.addEventAlgo (CreateDataAlg ('CreateDataAlg'))
126 
127  CaloThinCellsByClusterAlg=CompFactory.CaloThinCellsByClusterAlg
128  result.addEventAlgo (CaloThinCellsByClusterAlg ('thinAlg',
129  StreamName = 'StreamAOD',
130  Clusters = 'Clusters',
131  SamplingCellsName = ['EMB3']))
132 
133  result.addEventAlgo (CheckThinningAlg ('CheckThinningAlg'))
134  return result
135 
136 
137 # Work around issue with cling in root 6.20.06 getting confused
138 # by forward declarations.
139 ROOT.xAOD.CaloClusterContainer_v1
140 
141 

Variable Documentation

◆ acc

python.CaloThinCellsByClusterAlg_test.acc = MainServicesCfg(flags)

Definition at line 154 of file CaloThinCellsByClusterAlg_test.py.

◆ cell_hashes

python.CaloThinCellsByClusterAlg_test.cell_hashes = set()

Definition at line 17 of file CaloThinCellsByClusterAlg_test.py.

◆ Files

python.CaloThinCellsByClusterAlg_test.Files

Definition at line 145 of file CaloThinCellsByClusterAlg_test.py.

◆ flags

python.CaloThinCellsByClusterAlg_test.flags = initConfigFlags()

Definition at line 144 of file CaloThinCellsByClusterAlg_test.py.

◆ GeometryLAr

python.CaloThinCellsByClusterAlg_test.GeometryLAr

Definition at line 147 of file CaloThinCellsByClusterAlg_test.py.

◆ GeometryTile

python.CaloThinCellsByClusterAlg_test.GeometryTile

Definition at line 148 of file CaloThinCellsByClusterAlg_test.py.

◆ TimeStamps

python.CaloThinCellsByClusterAlg_test.TimeStamps

Definition at line 146 of file CaloThinCellsByClusterAlg_test.py.

python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
python.CaloThinCellsByClusterAlg_test.make_calo_cells
def make_calo_cells(mgr)
Definition: CaloThinCellsByClusterAlg_test.py:20
python.CaloThinCellsByClusterAlg_test.make_clusters
def make_clusters(mgr, ccc, hashes, ctx)
Definition: CaloThinCellsByClusterAlg_test.py:33
LArCablingConfig.LArOnOffIdMappingCfg
def LArOnOffIdMappingCfg(configFlags)
Definition: LArCablingConfig.py:62
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
python.CaloThinCellsByClusterAlg_test.testCfg
def testCfg(flags)
Definition: CaloThinCellsByClusterAlg_test.py:114
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7