11 #include "GaudiKernel/ToolHandle.h"
23 m_onlineHelper(nullptr),
24 m_larFEBTstart(nullptr),
25 m_groupingType(
"ExtendedSubDetector")
90 msg(MSG::ERROR) <<
"Could not get LArOnlineID helper !" <<
endmsg;
91 return StatusCode::FAILURE;
100 if (
sc.isFailure()) {
101 msg(MSG::ERROR) <<
"Could not get LArOnlineID helper !" <<
endmsg;
102 return StatusCode::FAILURE;
111 ToolHandle<LArPhysWaveTool> larPhysWaveTool(
"LArPhysWaveTool");
112 sc=larPhysWaveTool.retrieve();
113 if (
sc!=StatusCode::SUCCESS) {
122 if (
sc!=StatusCode::SUCCESS) {
124 <<
". Disabling use of PhysCaliTdiff values in wave shift." );
127 ATH_MSG_INFO(
"LArPhysCaliTdiff successfully retrieved" );
135 if(!
sc.isSuccess()) {
143 ATH_MSG_INFO(
"Will use helper class for start time." );
156 ATH_MSG_INFO(
"Manually shifting pulses by a constant index from peak." );
173 ATH_MSG_INFO(
"Manually shifting pulses by *FEB* time indexes." );
175 if (
sc.isFailure()) {
176 ATH_MSG_ERROR(
"Cannot find any FEB time offsets. Please check." );
183 auto totalShifts = std::make_unique<LArOFCBinComplete>();
185 ATH_MSG_ERROR(
"Failed to set grouping type for LArPhysCaliTdiffComplete object" );
186 return StatusCode::FAILURE;
189 if(totalShifts->initialize().isFailure()) {
190 ATH_MSG_ERROR(
"Failed to initialize LArPhysCaliTdiffComplete object" );
191 return StatusCode::FAILURE;
203 if (
sc.isFailure()) {
204 ATH_MSG_INFO(
"LArPhysWaveContainer (key=" <<
key <<
") not found in StoreGate" );
207 ATH_MSG_INFO(
"Processing LArPhysWaveContainer from StoreGate, key = " <<
key );
216 if ( wave_it == wave_it_e ) {
217 ATH_MSG_INFO(
"LArPhysWaveContainer (key = " <<
key <<
") has no wave with gain = " <<
gain );
221 for ( ; wave_it!=wave_it_e; wave_it++) {
223 if ( nchannel < 100 || ( nchannel < 1000 && nchannel%100==0 ) || nchannel%1000==0 )
224 ATH_MSG_INFO(
"Processing physics waveform number " << nchannel );
230 if ( larPhysWave->
isEmpty() ) {
257 float tdiff = larPhysCaliTdiff->
Tdiff(chid,
gain);
258 if (tdiff<=-999.) tdiff = 0.;
260 tdiff = tdiff>0. ? (
float)((
long)(tdiff+0.5)) : (
float)((long)(tdiff-0.5));
272 <<
" --> Time shift for channel 0x" << MSG::hex << chid.
get_compact() << MSG::dec
310 if (
sc.isFailure()) {
317 return StatusCode::SUCCESS;
347 if (
sc.isFailure()) {
348 ATH_MSG_INFO(
"LArPhysWaveContainer (key=" <<
key <<
") not found in StoreGate" );
351 if ( larPhysWaveContainerOld ==
nullptr ) {
356 ATH_MSG_INFO(
"ComputeTimeShiftByFEB(): processing LArPhysWaveContainer from StoreGate, key = " <<
key );
363 if ( wave_it == wave_it_e ) {
364 ATH_MSG_INFO(
"ComputeTimeShiftByFEB(): LArPhysWaveContainer (key = " <<
key <<
") has no wave with gain = " <<
gain );
368 for ( ; wave_it!=wave_it_e; wave_it++) {
371 if ( larPhysWave->
isEmpty() )
continue;
377 unsigned newFEBTstart = 999;
378 unsigned theChanInFEB = 0;
392 ATH_MSG_VERBOSE(std::hex << chid << std::dec<<
" TimeOffset: "<<bindiff);
398 theChanInFEB =
static_cast<unsigned>(nChanInFEB.
TimeOffset(febid)+1);
417 for (;
it!=it_e;++
it) {
424 ATH_MSG_INFO( nFeb <<
". FEB ID 0x" << std::hex << (*it).get_compact() << std::dec
436 outfile <<
"FakeLArTimeOffset.FEBids = [ " ;
439 for (;
it!=it_e;++
it) {
440 outfile <<
"0x" << std::hex << (*it).get_compact() << std::dec ;
445 outfile <<
"FakeLArTimeOffset.FEbTimeOffsets = [ " ;
448 for (;
it!=it_e;++
it) {
459 return StatusCode::FAILURE;
464 ATH_MSG_ERROR(
"Can't record LArFEBTimeOffset to DetectorStore" );
465 return StatusCode::FAILURE;
471 ATH_MSG_ERROR(
"Can't symlink LArFEBTimeOffset to abstract interface in DetectorStore" );
472 return StatusCode::FAILURE;
475 return StatusCode::SUCCESS;