13 double den = std::abs(
x1+
x2);
14 if (den <
thresh)
return true;
15 double diff = std::abs (
x1-
x2) / den;
33 return StatusCode::FAILURE;
40 return StatusCode::FAILURE;
48 return StatusCode::SUCCESS;
57 return StatusCode::SUCCESS;
64 bool badCompare =
false;
65 const EventContext& ctx = getContext();
69 const unsigned evt=ctx.eventID().event_number();
70 m_outfile <<
"Event " <<
evt <<
" contains " <<
cells->size() <<
" CaloCells" << std::endl;
71 m_outfile <<
"ID\tEnergy\tTime\tQual\tprov" << std::endl;
75 size_t evt_in, cells_size_in;
81 << cells_size_in <<
" " << CaloCells <<
82 "; expected event number " <<
evt <<
" and cell count " <<
97 double remainingEne=0;
98 unsigned nRemaining=0;
102 std::stringstream
id;
129 m_outfile <<
id.str() <<
"0x" << std::hex <<
cell->ID().get_identifier32().get_compact() << std::dec
131 <<
"\t" <<
cell->e() <<
"\t" <<
cell->time() <<
"\t" <<
cell->gain()
132 <<
"\t" <<
cell->quality() <<
"\t0x" << std::hex <<
cell->provenance() << std::dec << std::endl;
135 float energy_in, time_in;
136 int quality_in, provenance_in, gain_in;
138 std::string
id, samp;
141 m_reffile >> std::hex >> id_in >> std::dec >> energy_in >> time_in >>
142 gain_in >> quality_in >> std::hex >> provenance_in >> std::dec;
146 id_in !=
cell->ID().get_identifier32().get_compact() ||
147 gain_in !=
cell->gain() ||
148 quality_in !=
cell->quality() ||
149 provenance_in !=
cell->provenance())
152 std::hex <<
"0x" << id_in <<
" " << std::dec <<
155 gain_in <<
" " << quality_in <<
" " <<
156 std::hex <<
"0x" << provenance_in << std::dec);
158 cell->ID().get_identifier32().get_compact() << std::dec <<
" " <<
159 cell->e() <<
" " <<
cell->time() <<
" "
160 <<
cell->gain() <<
" " <<
161 cell->quality() <<
" 0x" << std::hex <<
cell->provenance() << std::dec);
168 remainingEne+=
cell->e();
172 m_outfile <<
"Sum of " << nRemaining <<
" cell energies: " << remainingEne << std::endl;
174 std::string Sum, Of, Cell,
Energies;
175 unsigned nRemaining_in;
176 float remainingEne_in;
180 nRemaining_in != nRemaining ||
181 !
isEqual (remainingEne_in, remainingEne))
184 Sum << Of << nRemaining_in << Cell <<
Energies <<
187 "Sum of " << nRemaining <<
" cell energies: " << remainingEne);
194 return StatusCode::FAILURE;
196 return StatusCode::SUCCESS;