30#include "GaudiKernel/Bootstrap.h"
31#include "GaudiKernel/ISvcLocator.h"
51 return p1->amplitude() < p2->amplitude();
81 ATH_MSG_INFO(
"TileRawChannelVerify initialization completed" );
83 return StatusCode::SUCCESS;
93 SelectAllObject<TileRawChannelContainer>::const_iterator rawItr1 = selAll1.
begin();
94 SelectAllObject<TileRawChannelContainer>::const_iterator end1 = selAll1.
end();
97 SelectAllObject<TileRawChannelContainer>::const_iterator rawItr2 = selAll2.
begin();
98 SelectAllObject<TileRawChannelContainer>::const_iterator end2 = selAll2.
end();
102 for (; rawItr1 != end1; ++rawItr1) ++nSize1;
105 for (; rawItr2 != end2; ++rawItr2) ++nSize2;
110 if (nSize1 != nSize2) {
111 ATH_MSG_ERROR(
"The number of rawChannels is not equal in the two containers" );
112 return (StatusCode::SUCCESS);
116 vector<const TileRawChannel*> rawChannels1;
117 vector<const TileRawChannel*> rawChannels2;
121 rawItr1 = selAll1.
begin();
122 end1 = selAll1.
end();
123 for (; rawItr1 != end1; ++rawItr1)
124 rawChannels1.push_back((*rawItr1));
128 rawItr2 = selAll2.
begin();
129 end2 = selAll2.
end();
130 for (; rawItr2 != end2; ++rawItr2)
131 rawChannels2.push_back((*rawItr2));
136 rawItr1 = selAll1.
begin();
137 end1 = selAll1.
end();
139 rawItr2 = selAll2.
begin();
140 end2 = selAll2.
end();
143 bool bErrorFlag =
false;
144 bool bHeaderFlag =
true;
145 for (
int i = 0; i < nSize1; ++i) {
147 rawChannel1 = rawChannels1[i];
148 rawChannel2 = rawChannels2[i];
150 rawChannel1 = (*rawItr1);
152 rawChannel2 = (*rawItr2);
159 double diff = fabs(amp1 - amp2);
165 msg(MSG::VERBOSE) <<
" Index e1 id1 | e2 id2" <<
endmsg;
166 msg(MSG::VERBOSE) <<
"--------------------------------------------------------------------------------" <<
endmsg;
169 msg(MSG::VERBOSE) << setw(5) << i
170 <<
" " << setw(12) << amp1
172 <<
" | " << setw(12) << amp2
175 msg(MSG::VERBOSE) <<
" A* ";
178 msg(MSG::VERBOSE) <<
" I* ";
181 }
else if (bErrorFlag) {
186 msg(MSG::VERBOSE) <<
"--------------------------------------------------------------------------------" <<
endmsg;
197 ATH_MSG_INFO(
"TileRawChannelVerify execution completed successfully" );
199 return StatusCode::SUCCESS;
204 ATH_MSG_INFO(
"TileRawChannelVerify finalized successfully" );
206 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.
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
SelectAllObjectMT< DCC, OBJECT > SelectAllObject
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
Small class holding a single method to compare two different TileRawChannel.
bool operator()(const TileRawChannel *p1, const TileRawChannel *p2)
const_pointer_type cptr()
Dereference the pointer.
StatusCode finalize()
finalize method
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainer1Key
StatusCode execute()
execute method
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainer2Key
bool m_dumpRawChannels
if true=> Differences found in the TileRawChannels are dumped on the screen
double m_precision
maximum difference between the amplitudes of the TileRawChannels to be compared
virtual ~TileRawChannelVerify()
Destructor.
const TileHWID * m_tileHWID
Pointer to TileHWID.
TileRawChannelVerify(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
bool m_sortFlag
if true=> TileRawChannels are sorted by amplitude
StatusCode initialize()
initialize method
float amplitude(int ind=0) const
HWIdentifier adc_HWID(void) const
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.