ATLAS Offline Software
Loading...
Searching...
No Matches
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
19#include "LArRecEvent/LArCell.h"
20#include "TileEvent/TileCell.h"
21
23#include "CaloCompactCellTool.h"
27
29
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 {
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
66StatusCode 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 {
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}
#define endmsg
Calo cell packer/unpacker v400/500.
Definition of CaloDetDescrManager.
Container class for CaloCell.
Calo cell packer/unpacker v400/500.
void unpack(const CaloCompactCellContainer &packed, const std::vector< CaloCompactCellContainer::value_type > &vheader, CaloCellContainer &cells, DataPool< LArCell > &larpool, DataPool< TileCell > &tilepool) const
Unpack cells.
void pack(const CaloCellContainer &cells, CaloCompactCellContainer &packed, const SG::ThinningDecisionBase *dec, int version) const
Pack cells.
container class for CaloCompactCell objects
const std::vector< value_type > getHeader() const
returns header portion of the compact cell container
StatusCode getPersistent(const CaloCellContainer &theCellContainer, CaloCompactCellContainer *theCompactContainer, const SG::ThinningDecisionBase *dec, int theVersion=VERSION_LATEST)
StatusCode getTransient(const CaloCompactCellContainer &theCompactContainer, CaloCellContainer *theCellContainer)
a typed memory pool that saves time spent allocation small object.
Definition DataPool.h:63
Hold thinning decisions for one container.
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)
MsgStream & msg
Definition testRead.cxx:32