40 return p1->energy() < p2->energy();
72 ATH_MSG_INFO(
"TileCellVerify initialization completed" );
74 return StatusCode::SUCCESS;
87 int nCells1 = cellContainer1->size();
88 int nCells2 = cellContainer2->size();
92 if (nCells1 != nCells2) {
93 ATH_MSG_ERROR(
"The number of cells is not equal in the two cell "
97 return (StatusCode::SUCCESS);
101 vector<const CaloCell*> cells1;
102 vector<const CaloCell*> cells2;
107 for (
const CaloCell* cell : *cellContainer1) {
108 cells1.push_back(cell);
111 for (
const CaloCell* cell : *cellContainer2) {
112 cells2.push_back(cell);
120 bool bErrorFlag =
false;
121 bool bOnlyOnceFlag =
false;
122 bool lVerbose =
msgLvl(MSG::VERBOSE);
123 for (
int i = 0; i < nCells1; ++i) {
129 cell1 = (*cellContainer1)[i];
130 cell2 = (*cellContainer2)[i];
135 if (id1 !=
id2) bErrorFlag =
true;
138 if (!bOnlyOnceFlag) {
140 msg(MSG::VERBOSE) <<
" Index e1 id1 | e2 id2" <<
endmsg;
141 msg(MSG::VERBOSE) <<
"--------------------------------------------------------------------------------" <<
endmsg;
142 bOnlyOnceFlag =
true;
145 msg(MSG::VERBOSE) << setw(5) << i <<
" " << setw(12) << cell1->
energy() <<
" [";
146 msg(MSG::VERBOSE) <<
m_tileID->to_string(id1, -2) <<
"]";
147 msg(MSG::VERBOSE) <<
" | " << setw(12) << cell2->
energy() <<
" [";
150 if (bErrorFlag)
msg(MSG::VERBOSE) <<
" * ";
154 }
else if (bErrorFlag){
159 msg(MSG::VERBOSE) <<
"--------------------------------------------------------------------------------" <<
endmsg;
170 ATH_MSG_INFO(
"TileCellVerify execution completed successfully" );
172 return StatusCode::SUCCESS;
179 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Handle class for reading from StoreGate.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
Data object for each calorimeter readout cell.
double energy() const
get energy (data member)
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
bool operator()(const CaloCell *p1, const CaloCell *p2)
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual ~TileCellVerify()
SG::ReadHandleKey< CaloCellContainer > m_cellContainer2Key
SG::ReadHandleKey< CaloCellContainer > m_cellContainer1Key
TileCellVerify(const std::string &name, ISvcLocator *pSvcLocator)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.