ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCellContainerFinalizerTool Class Reference

#include <CaloCellContainerFinalizerTool.h>

Inheritance diagram for CaloCellContainerFinalizerTool:
Collaboration diagram for CaloCellContainerFinalizerTool:

Public Member Functions

virtual StatusCode initialize () override
virtual StatusCode process (CaloCellContainer *theCellContainer, const EventContext &ctx) const override
virtual StatusCode process (CaloConstCellContainer *theCellContainer, const EventContext &ctx) const override

Private Member Functions

template<class CONTAINER>
StatusCode doProcess (CONTAINER *theCellContainer) const

Private Attributes

const CaloCell_IDm_theCaloCCIDM =nullptr

Detailed Description

Definition at line 18 of file CaloCellContainerFinalizerTool.h.

Member Function Documentation

◆ doProcess()

template<class CONTAINER>
StatusCode CaloCellContainerFinalizerTool::doProcess ( CONTAINER * theCellContainer) const
private

Definition at line 37 of file CaloCellContainerFinalizerTool.cxx.

38{
39
40 const unsigned int hashMax=m_theCaloCCIDM->calo_cell_hash_max();
41 if (theCont->size()<hashMax) {
42 ATH_MSG_DEBUG("CaloCellContainer size " << theCont->size() << " smaller than hashMax: " << hashMax);
43 }
44 else if (theCont->size()==hashMax) {
45 ATH_MSG_DEBUG("CaloCellContainer size " << theCont->size() << " correspond to hashMax : " << hashMax);
46 theCont->setHasTotalSize(true);
47 }
48 else {
49 msg(MSG::WARNING) << "CaloCellContainer size " << theCont->size()
50 << " larger than hashMax ! Too many cells ! " << hashMax << endmsg ;
51
52 }
53
54
55 // check whether in order
56 if (theCont->checkOrdered()){
57 ATH_MSG_DEBUG("CaloCellContainer ordered");
58 theCont->setIsOrdered(true);
59 } else {
60 ATH_MSG_DEBUG("CaloCellContainer not ordered");
61 theCont->setIsOrdered(false);
62 }
63
64 /*
65 CaloCellContainer::const_iterator itrCell=theCont->begin();
66 unsigned int index=0;
67
68 for (; itrCell!=theCont->end();++itrCell){
69 const CaloDetDescrElement * theDDE=(*itrCell)->caloDDE();
70 std::cout << " index " << index << " hash " << theDDE->calo_hash() << std::endl;
71
72 ++index ;
73 }
74 */
75
76
77 // check whether in order and complete
78 if (theCont->checkOrderedAndComplete()){
79 ATH_MSG_DEBUG("CaloCellContainer ordered and complete");
80 theCont->setIsOrderedAndComplete(true);
81 } else {
82 ATH_MSG_DEBUG("CaloCellContainer not ordered or incomplete");
83 theCont->setIsOrderedAndComplete(false);
84 }
85
86 if (!theCont->isOrdered()) {
87 ATH_MSG_DEBUG("Now ordering CaloCellContainer");
88 theCont->order();
89
90 //FIXME check again whether in order
91 ATH_MSG_DEBUG("Now check CaloCellContainer ordered");
92 if (theCont->checkOrdered()){
93 ATH_MSG_DEBUG( "CaloCellContainer ordered");
94 theCont->setIsOrdered(true);
95 } else {
96 ATH_MSG_DEBUG( "CaloCellContainer not ordered");
97 theCont->setIsOrdered(false);
98 }
99
100
101 // check whether in order and complete
102 if (theCont->checkOrderedAndComplete()){
103 ATH_MSG_DEBUG( " CaloCellContainer ordered and complete");
104 theCont->setIsOrderedAndComplete(true);
105 } else {
106 ATH_MSG_DEBUG("CaloCellContainer not ordered or incomplete");
107 theCont->setIsOrderedAndComplete(false);
108 }
109 }
110
111 theCont->updateCaloIterators();
112
113 return StatusCode::SUCCESS;
114}
#define endmsg
#define ATH_MSG_DEBUG(x)
MsgStream & msg
Definition testRead.cxx:32

◆ initialize()

StatusCode CaloCellContainerFinalizerTool::initialize ( )
overridevirtual

Definition at line 29 of file CaloCellContainerFinalizerTool.cxx.

30{
31
32 ATH_CHECK(detStore()->retrieve(m_theCaloCCIDM,"CaloCell_ID"));
33 return StatusCode::SUCCESS;
34}
#define ATH_CHECK
Evaluate an expression and check for errors.
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ process() [1/2]

StatusCode CaloCellContainerFinalizerTool::process ( CaloCellContainer * theCellContainer,
const EventContext & ctx ) const
overridevirtual

Definition at line 118 of file CaloCellContainerFinalizerTool.cxx.

120{
121 CHECK( doProcess (theCont) );
122 return StatusCode::SUCCESS;
123}
#define CHECK(...)
Evaluate an expression and check for errors.
StatusCode doProcess(CONTAINER *theCellContainer) const

◆ process() [2/2]

StatusCode CaloCellContainerFinalizerTool::process ( CaloConstCellContainer * theCellContainer,
const EventContext & ctx ) const
overridevirtual

Definition at line 127 of file CaloCellContainerFinalizerTool.cxx.

129{
130 // Container will automatically be locked when recorded.
131 return doProcess (theCont);
132}

Member Data Documentation

◆ m_theCaloCCIDM

const CaloCell_ID* CaloCellContainerFinalizerTool::m_theCaloCCIDM =nullptr
private

Definition at line 36 of file CaloCellContainerFinalizerTool.h.


The documentation for this class was generated from the following files: