Loading [MathJax]/jax/output/SVG/config.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Types | Public Member Functions | Private Member Functions | List of all members
CaloCompactCellTool Class Reference

helper to convert from CaloCellContainer to CaloCompactCellContainer and back More...

#include <CaloCompactCellTool.h>

Collaboration diagram for CaloCompactCellTool:

Public Types

enum  KNOWN_VERSIONS {
  VERSION_400 = 400, VERSION_500 = 500, VERSION_501 = 501, VERSION_502 = 502,
  VERSION_503 = 503, VERSION_504 = 504, VERSION_LATEST = -1
}
 

Public Member Functions

 CaloCompactCellTool ()
 
StatusCode getTransient (const CaloCompactCellContainer &theCompactContainer, CaloCellContainer *theCellContainer)
 
StatusCode getPersistent (const CaloCellContainer &theCellContainer, CaloCompactCellContainer *theCompactContainer, const SG::ThinningDecisionBase *dec, int theVersion=VERSION_LATEST)
 

Private Member Functions

int getLogCompact (const double &x, const double &log_x0, const double &log_x1, const int &n)
 
double unpackLog (const int &log_x, const double &log_x0, const double &log_x1, const int &n)
 
int getCubRootCompact (const double &x, const double &cbrt_x1, const int &n)
 
double unpackCubRoot (const int &cbrt_x, const double &cbrt_x1, const int &n)
 

Detailed Description

helper to convert from CaloCellContainer to CaloCompactCellContainer and back

Author
Sven Menke

Definition at line 28 of file CaloCompactCellTool.h.

Member Enumeration Documentation

◆ KNOWN_VERSIONS

Enumerator
VERSION_400 
VERSION_500 
VERSION_501 
VERSION_502 
VERSION_503 
VERSION_504 
VERSION_LATEST 

Definition at line 31 of file CaloCompactCellTool.h.

31  {
32  VERSION_400 = 400,
33  VERSION_500 = 500,
34  VERSION_501 = 501,
35  VERSION_502 = 502,
36  VERSION_503 = 503,
37  VERSION_504 = 504,
38 
39  // Select the latest version.
40  VERSION_LATEST = -1
41  };

Constructor & Destructor Documentation

◆ CaloCompactCellTool()

CaloCompactCellTool::CaloCompactCellTool ( )

Definition at line 28 of file CaloCompactCellTool.cxx.

28 {}

Member Function Documentation

◆ getCubRootCompact()

int CaloCompactCellTool::getCubRootCompact ( const double &  x,
const double &  cbrt_x1,
const int &  n 
)
inlineprivate

Definition at line 88 of file CaloCompactCellTool.h.

90  {
91  int result = 0;
92  double cbrt_x=cbrt(x);
93  if ( cbrt_x >= cbrt_x1 ) {
94  result = (1<<n)-1;
95  } else {
96  int nmax=1<<n;
97  result = (int)(cbrt_x/cbrt_x1*nmax);
98  }
99  return result;
100 }

◆ getLogCompact()

int CaloCompactCellTool::getLogCompact ( const double &  x,
const double &  log_x0,
const double &  log_x1,
const int &  n 
)
inlineprivate

Definition at line 69 of file CaloCompactCellTool.h.

73 {
74  int result = 0;
75  if ( x > 0 ) {
76  double log_x = log(x);
77  if ( log_x >= log_x1 ) {
78  result = (1<<n)-1;
79  }
80  else if ( log_x > log_x0 ) {
81  int nmax=1<<n;
82  result = (int)((log_x - log_x0)/(log_x1 - log_x0)*nmax);
83  }
84  }
85  return result;
86 }

◆ getPersistent()

StatusCode CaloCompactCellTool::getPersistent ( const CaloCellContainer theCellContainer,
CaloCompactCellContainer theCompactContainer,
const SG::ThinningDecisionBase dec,
int  theVersion = VERSION_LATEST 
)

Definition at line 66 of file CaloCompactCellTool.cxx.

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 }

◆ getTransient()

StatusCode CaloCompactCellTool::getTransient ( const CaloCompactCellContainer theCompactContainer,
CaloCellContainer theCellContainer 
)

Definition at line 30 of file CaloCompactCellTool.cxx.

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 }

◆ unpackCubRoot()

double CaloCompactCellTool::unpackCubRoot ( const int &  cbrt_x,
const double &  cbrt_x1,
const int &  n 
)
inlineprivate

Definition at line 114 of file CaloCompactCellTool.h.

116  {
117  double result = 0;
118  if ( cbrt_x > 0 ) {
119  int nmax=1<<n;
120  double r = (cbrt_x+0.5)*cbrt_x1/nmax;
121  result =r*r*r;
122  }
123  return result;
124 }

◆ unpackLog()

double CaloCompactCellTool::unpackLog ( const int &  log_x,
const double &  log_x0,
const double &  log_x1,
const int &  n 
)
inlineprivate

Definition at line 102 of file CaloCompactCellTool.h.

105  {
106  double result = 0;
107  if ( log_x > 0 ) {
108  int nmax=1<<n;
109  result = exp((log_x+0.5)*(log_x1-log_x0)/nmax+log_x0);
110  }
111  return result;
112 }

The documentation for this class was generated from the following files:
beamspotman.r
def r
Definition: beamspotman.py:676
get_generator_info.result
result
Definition: get_generator_info.py:21
CaloCompactCellTool::VERSION_501
@ VERSION_501
Definition: CaloCompactCellTool.h:34
CaloCompactCellTool::VERSION_500
@ VERSION_500
Definition: CaloCompactCellTool.h:33
CaloCellPacker_400_500
Calo cell packer/unpacker v400/500.
Definition: CaloCellPacker_400_500.h:145
CaloCompactCellTool::VERSION_400
@ VERSION_400
Definition: CaloCompactCellTool.h:32
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
x
#define x
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
CaloCompactCellTool::VERSION_503
@ VERSION_503
Definition: CaloCompactCellTool.h:36
beamspotman.n
n
Definition: beamspotman.py:731
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
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
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
CaloCompactCellTool::VERSION_504
@ VERSION_504
Definition: CaloCompactCellTool.h:37
CaloCompactCellTool::VERSION_502
@ VERSION_502
Definition: CaloCompactCellTool.h:35
CaloCompactCellContainer::getHeader
const std::vector< value_type > getHeader() const
returns header portion of the compact cell container
Definition: CaloCompactCellContainer.cxx:53
CaloCompactCellTool::VERSION_LATEST
@ VERSION_LATEST
Definition: CaloCompactCellTool.h:40
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
DataPool
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
Definition: DataPool.h:63
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
nmax
const int nmax(200)