ATLAS Offline Software
TileCellIDCToCell.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //*****************************************************************************
6 // Filename : TileCellIDCToCell.cxx
7 // Author : Alexandre Solodkov
8 // Created : Jan, 2003
9 //
10 // DESCRIPTION:
11 // Implementation comments only. Class level comments go in .h file.
12 //
13 // HISTORY:
14 //
15 // BUGS:
16 //
17 //*****************************************************************************
18 
19 
20 #include "TileCellIDCToCell.h"
21 
22 
23 // access all Cells inside container
26 
27 // Calo includes
28 #include "CaloIdentifier/TileID.h"
30 
31 // Tile includes
34 #include "TileEvent/TileCellIDC.h"
35 #include "TileEvent/TileCell.h"
36 
37 
38 //
39 // Constructor
40 //
41 TileCellIDCToCell::TileCellIDCToCell(const std::string& name, ISvcLocator* pSvcLocator)
42  : AthAlgorithm(name, pSvcLocator)
43  , m_tileID(0)
44  , m_tileInfo(0)
45  , m_tileMgr(0)
46 {
47  declareProperty("TileCellIDC", m_cellIDC = "TileCellIDC"); // Name of input container
48  declareProperty("TileCellContainer", m_cellContainer = "TileCellContainer"); // Name of output container
49  declareProperty("TileInfoName", m_infoName = "TileInfo"); // name of TileInfo store
50 }
51 
53 {}
54 
55 //****************************************************************************
56 //* Initialization
57 //****************************************************************************
58 
60 {
61 
62  // retrieve Tile detector manager, TileID helper and TileIfno from det store
66 
67  ATH_MSG_INFO( "TileCellIDCToCell initialization completed" );
68 
69  return StatusCode::SUCCESS;
70 }
71 
72 
73 //****************************************************************************
74 //* Execution
75 //****************************************************************************
76 
78 {
79 
80  /* zero all counters and sums */
81  int nCell = 0;
82  float eCellTot = 0.0;
83 
85 
86  //**
87  //* Get TileCells from TileIDC
88  //**
89  const TileCellIDC* inputCells;
90 
91  if (evtStore()->retrieve(inputCells, m_cellIDC).isFailure() ) {
92 
93  ATH_MSG_WARNING( " Could not find container " << m_cellIDC );
94  ATH_MSG_WARNING( " creating empty cell container " );
95 
96  } else {
97 
98  SelectAllObject<TileCellIDC> selAll(inputCells);
101 
102  TileCell * c;
103  const TileCell * cinp;
104 
105  //**
106  //* Iterate over cells, creating new TileCells
107  //* Add each TileCell to the CaloCellContainer.
108  //**
109 
110  for( ; inpItr != end; ++inpItr) {
111 
112  cinp = (*inpItr);
113 
114  ++nCell;
115  eCellTot += cinp->energy();
116 
117  c = new TileCell( cinp );
118  cells->push_back( c );
119 
120  ATH_MSG_VERBOSE( "TileCellIDCToCell: cell_id="
121  << m_tileID->to_string(cinp->subcalo_hash(),-2)
122  << " nCell=" << nCell << " energy=" << cinp->energy());
123  }
124  }
125 
126  /* Register the set of TileCells to the event store. */
127 
128  CHECK( evtStore()->record(cells, m_cellContainer, false ) );
129 
130  // Execution completed.
131  ATH_MSG_DEBUG( "TileCellIDCToCell execution completed." );
132  ATH_MSG_DEBUG( " nCell=" << nCell << " eneTot=" << eCellTot );
133 
134  ATH_MSG_VERBOSE( "TileCell container registered to the TES with name"
135  << m_cellContainer );
136 
137  return StatusCode::SUCCESS;
138 }
139 
140 //************************************************************************
141 
142 
143 //****************************************************************************
144 //* Finalize
145 //****************************************************************************
146 
148 {
149 
150  ATH_MSG_INFO( "TileCellIDCToCell::finalize() end" );
151 
152  return StatusCode::SUCCESS;
153 }
154 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TileCell
Definition: TileCell.h:57
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:271
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SelectAllObjectMT::end
const_iterator end()
Definition: SelectAllObjectMT.h:131
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TileCellIDCToCell::m_tileID
const TileID * m_tileID
Definition: TileCellIDCToCell.h:61
TileInfo.h
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TileCellIDCToCell::m_cellContainer
std::string m_cellContainer
Definition: TileCellIDCToCell.h:58
TileID.h
TileDetDescrManager.h
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
CaloCell::energy
double energy() const
get energy (data member)
Definition: CaloCell.h:311
RunTileCalibRec.CaloCellContainer
CaloCellContainer
Definition: RunTileCalibRec.py:403
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
SelectAllObjectMT::begin
const_iterator begin()
Definition: SelectAllObjectMT.h:115
SelectAllObjectMT
Definition: SelectAllObjectMT.h:11
TileCellIDCToCell::m_tileInfo
const TileInfo * m_tileInfo
Definition: TileCellIDCToCell.h:62
TileCellIDCToCell::~TileCellIDCToCell
virtual ~TileCellIDCToCell()
Definition: TileCellIDCToCell.cxx:52
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TileCellIDC.h
TileCell.h
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
TileCellIDCToCell::finalize
StatusCode finalize()
Definition: TileCellIDCToCell.cxx:147
SelectAllObjectMT::const_iterator
Definition: SelectAllObjectMT.h:22
AthAlgorithm
Definition: AthAlgorithm.h:47
TileCellIDCToCell::m_infoName
std::string m_infoName
Definition: TileCellIDCToCell.h:59
TileCellIDCToCell.h
TileCellIDCToCell::m_cellIDC
std::string m_cellIDC
Definition: TileCellIDCToCell.h:57
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TileCell::subcalo_hash
IdentifierHash subcalo_hash(void) const
get subcalo hash for TileCal cells
Definition: TileCell.h:228
errorcheck.h
Helpers for checking error return status codes and reporting errors.
TileCellIDCToCell::execute
StatusCode execute()
Definition: TileCellIDCToCell.cxx:77
CaloCellContainer.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
TileCellIDCToCell::TileCellIDCToCell
TileCellIDCToCell(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TileCellIDCToCell.cxx:41
Tile_Base_ID::to_string
std::string to_string(const Identifier &id, int level=0) const
Definition: Tile_Base_ID.cxx:52
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SelectAllObject.h
TileCellIDCToCell::m_tileMgr
const TileDetDescrManager * m_tileMgr
Definition: TileCellIDCToCell.h:63
TileCellIDCToCell::initialize
StatusCode initialize()
Definition: TileCellIDCToCell.cxx:59
python.compressB64.c
def c
Definition: compressB64.py:93
TileCellIDC
Definition: TileCellIDC.h:13