ATLAS Offline Software
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 
22 #include "AthAllocators/DataPool.h"
23 #include "CaloCompactCellTool.h"
26 #include "CaloCellPacker_400_500.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 
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  {
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 }
CaloCompactCellTool::VERSION_501
@ VERSION_501
Definition: CaloCompactCellTool.h:34
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
CaloCompactCellTool::VERSION_500
@ VERSION_500
Definition: CaloCompactCellTool.h:33
CaloCellPacker_400_500.h
Calo cell packer/unpacker v400/500.
SG::ThinningDecisionBase
Hold thinning decisions for one container.
Definition: ThinningDecisionBase.h:39
CaloCellPacker_400_500
Calo cell packer/unpacker v400/500.
Definition: CaloCellPacker_400_500.h:145
CaloCompactCellTool::VERSION_400
@ VERSION_400
Definition: CaloCompactCellTool.h:32
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
CaloCell_ID.h
CaloCompactCellTool::VERSION_503
@ VERSION_503
Definition: CaloCompactCellTool.h:36
CaloCompactCellContainer
container class for CaloCompactCell objects
Definition: CaloCompactCellContainer.h:31
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
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:881
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:470
TileCell.h
CaloCompactCellTool::VERSION_504
@ VERSION_504
Definition: CaloCompactCellTool.h:37
CaloCompactCellTool::VERSION_502
@ VERSION_502
Definition: CaloCompactCellTool.h:35
CaloCompactCellTool::getPersistent
StatusCode getPersistent(const CaloCellContainer &theCellContainer, CaloCompactCellContainer *theCompactContainer, const SG::ThinningDecisionBase *dec, int theVersion=VERSION_LATEST)
Definition: CaloCompactCellTool.cxx:67
DataPool.h
CaloCompactCellContainer::getHeader
const std::vector< value_type > getHeader() const
returns header portion of the compact cell container
Definition: CaloCompactCellContainer.cxx:53
LArCell.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
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. This is typically used by containe...
Definition: DataPool.h:63
CaloCompactCellTool.h
CaloCompactCellTool::CaloCompactCellTool
CaloCompactCellTool()
Definition: CaloCompactCellTool.cxx:28
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7