ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloCnv
CaloTPCnv
src
CaloCompactCellTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
//-----------------------------------------------------------------------
6
// File and Version Information:
7
// $Id: CaloCompactCellTool.cxx,v 1.35 2009-03-19 01:42:15 ssnyder Exp $
8
//
9
// Description: see CaloCompactCellTool.h
10
//
11
// Environment:
12
// Software developed for the ATLAS Detector at the CERN LHC
13
//
14
// All compactor versions before version 400 are removed and can be found only in
15
// old versions in CVS
16
//-----------------------------------------------------------------------
17
18
#include "
AthenaKernel/getMessageSvc.h
"
19
#include "
LArRecEvent/LArCell.h
"
20
#include "
TileEvent/TileCell.h
"
21
22
#include "
AthAllocators/DataPool.h
"
23
#include "
CaloCompactCellTool.h
"
24
#include "
CaloDetDescr/CaloDetDescrManager.h
"
25
#include "
CaloIdentifier/CaloCell_ID.h
"
26
#include "
CaloCellPacker_400_500.h
"
27
28
CaloCompactCellTool::CaloCompactCellTool
() {}
29
30
StatusCode
CaloCompactCellTool::getTransient
31
(
const
CaloCompactCellContainer
& theCompactContainer,
32
CaloCellContainer
* theCellContainer)
33
{
34
const
std::vector<CaloCompactCellContainer::value_type> theHeader = theCompactContainer.
getHeader
();
35
//ATH_MSG_DEBUG( " getTransient: using version: "<<theHeader[1] );
36
37
DataPool<LArCell>
larCellsP(220000);
//initialize for the default value will resize latter to full size
38
DataPool<TileCell>
tileCellsP(13000);
39
40
switch
(theHeader[1]) {
41
42
case
VERSION_400
:
43
case
VERSION_500
:
44
case
VERSION_501
:
45
case
VERSION_502
:
46
case
VERSION_503
:
47
case
VERSION_504
:
48
{
49
CaloCellPacker_400_500
packer;
50
packer.
unpack
(theCompactContainer, theHeader, *theCellContainer,
51
larCellsP, tileCellsP);
52
}
53
break
;
54
55
default
:
56
MsgStream
msg
(
Athena::getMessageSvc
(),
"CaloCompactCellTool"
);
57
msg
<<
" unknown version "
<< theHeader[1]
58
<<
" requested for unpacking the CaloCompactCellContainer"
<<
endmsg
;
59
return
StatusCode::FAILURE;
60
}
61
62
return
StatusCode::SUCCESS;
63
}
64
65
66
StatusCode
CaloCompactCellTool::getPersistent
//fill the CaloCompactCellContainer
67
(
const
CaloCellContainer
& theCellContainer,
68
CaloCompactCellContainer
* theCompactContainer,
69
const
SG::ThinningDecisionBase
* dec,
70
int
theVersion )
71
{
72
//ATH_MSG_DEBUG( "CaloCell container contains " << theCellContainer.size() << " cells. Write compact Ver: " << theVersion );
73
74
if
(theVersion ==
VERSION_LATEST
)
75
theVersion =
VERSION_504
;
76
77
switch
(theVersion ) {
78
79
case
VERSION_400
:
80
case
VERSION_500
:
81
case
VERSION_501
:
82
case
VERSION_502
:
83
case
VERSION_503
:
84
case
VERSION_504
:
85
{
86
CaloCellPacker_400_500
packer;
87
88
packer.
pack
(theCellContainer, *theCompactContainer, dec, theVersion);
89
}
90
break
;
91
92
default
:
93
MsgStream
msg
(
Athena::getMessageSvc
(),
"CaloCompactCellTool"
);
94
msg
<<
" unknown version "
<< theVersion
95
<<
" requested for packing the CaloCellContainer"
<<
endmsg
;
96
return
StatusCode::FAILURE;
97
}
98
return
StatusCode::SUCCESS;
99
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
CaloCellPacker_400_500.h
Calo cell packer/unpacker v400/500.
CaloCell_ID.h
CaloCompactCellTool.h
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
DataPool.h
LArCell.h
TileCell.h
CaloCellContainer
Container class for CaloCell.
Definition
CaloCellContainer.h:55
CaloCellPacker_400_500
Calo cell packer/unpacker v400/500.
Definition
CaloCellPacker_400_500.h:145
CaloCellPacker_400_500::unpack
void unpack(const CaloCompactCellContainer &packed, const std::vector< CaloCompactCellContainer::value_type > &vheader, CaloCellContainer &cells, DataPool< LArCell > &larpool, DataPool< TileCell > &tilepool) const
Unpack cells.
Definition
CaloCellPacker_400_500.cxx:878
CaloCellPacker_400_500::pack
void pack(const CaloCellContainer &cells, CaloCompactCellContainer &packed, const SG::ThinningDecisionBase *dec, int version) const
Pack cells.
Definition
CaloCellPacker_400_500.cxx:469
CaloCompactCellContainer
container class for CaloCompactCell objects
Definition
CaloCompactCellContainer.h:31
CaloCompactCellContainer::getHeader
const std::vector< value_type > getHeader() const
returns header portion of the compact cell container
Definition
CaloCompactCellContainer.cxx:53
CaloCompactCellTool::VERSION_502
@ VERSION_502
Definition
CaloCompactCellTool.h:35
CaloCompactCellTool::VERSION_500
@ VERSION_500
Definition
CaloCompactCellTool.h:33
CaloCompactCellTool::VERSION_503
@ VERSION_503
Definition
CaloCompactCellTool.h:36
CaloCompactCellTool::VERSION_LATEST
@ VERSION_LATEST
Definition
CaloCompactCellTool.h:40
CaloCompactCellTool::VERSION_504
@ VERSION_504
Definition
CaloCompactCellTool.h:37
CaloCompactCellTool::VERSION_501
@ VERSION_501
Definition
CaloCompactCellTool.h:34
CaloCompactCellTool::VERSION_400
@ VERSION_400
Definition
CaloCompactCellTool.h:32
CaloCompactCellTool::CaloCompactCellTool
CaloCompactCellTool()
Definition
CaloCompactCellTool.cxx:28
CaloCompactCellTool::getPersistent
StatusCode getPersistent(const CaloCellContainer &theCellContainer, CaloCompactCellContainer *theCompactContainer, const SG::ThinningDecisionBase *dec, int theVersion=VERSION_LATEST)
Definition
CaloCompactCellTool.cxx:67
CaloCompactCellTool::getTransient
StatusCode getTransient(const CaloCompactCellContainer &theCompactContainer, CaloCellContainer *theCellContainer)
Definition
CaloCompactCellTool.cxx:31
DataPool
a typed memory pool that saves time spent allocation small object.
Definition
DataPool.h:63
SG::ThinningDecisionBase
Hold thinning decisions for one container.
Definition
ThinningDecisionBase.h:39
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition
getMessageSvc.cxx:20
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0