76 std::unique_ptr<LArShapeComplete> larShapeCompleteCorr=std::make_unique<LArShapeComplete>();
78 sc = larShapeCompleteCorr->initialize();
79 if (
sc.isFailure() ) {
80 ATH_MSG_ERROR(
"Could not initialize LArShapeComplete data object - exit!" ) ;
104 bool doShapeCorr=
true;
105 if ( vShape.size() == 0 || vShapeDer.size() == 0 ) {
106 ATH_MSG_WARNING(
"Shape not found for gain "<< gain <<
" channel 0x" << std::hex <<
id.get_compact() << std::dec );
109 if ( vShape.size() != vShapeDer.size() ) {
110 ATH_MSG_WARNING(
"Shape (" << vShape.size() <<
") derivative (" << vShapeDer.size() <<
") don't have the same size for channel 0x"
111 << std::hex <<
id.get_compact() << std::dec );
115 std::vector<float> theShape;
116 std::vector<float> theShapeDer;
120 if ( vShapeResidual.size() == 0 || vShapeResidualDer.size() == 0 ) {
122 <<
" channel 0x" << std::hex <<
id.get_compact() << std::dec
123 <<
". Will not be applied!" );
126 if ( vShapeResidual.size() != vShapeResidualDer.size() ) {
127 ATH_MSG_ERROR(
"Shape residual (" << vShapeResidual.size() <<
") and its derivative (" << vShapeResidualDer.size()
128 <<
") don't have the same size for channel 0x"
129 << std::hex <<
id.get_compact() << std::dec
130 <<
". Will be not applied!" );
135 if ( vShape.size() > vShapeResidual.size() ) {
136 ATH_MSG_WARNING(
"Shape residual size does not match the shape size for channel 0x"
137 << std::hex <<
id.get_compact() << std::dec
138 <<
". Will be not corrected!" );
143 for (
unsigned k=0;k<vShape.size();k++) {
144 theShape.push_back( vShape[k] + vShapeResidual[k] );
145 theShapeDer.push_back( vShapeDer[k] + vShapeResidualDer[k] );
146 ATH_MSG_VERBOSE(
"Shape channel= " <<
id.get_compact() <<
": " << k <<
"\t" << vShape[k] <<
"\t" << vShapeDer[k]);
147 ATH_MSG_VERBOSE(
"Shape residual channel= " <<
id.get_compact() <<
": " << k <<
"\t" << vShapeResidual[k] <<
"\t" << vShapeResidualDer[k]);
151 for (
unsigned k=0;k<vShape.size();k++) {
152 theShape.push_back( vShape[k] );
153 theShapeDer.push_back( vShapeDer[k] );
157 std::vector<std::vector<float> > shapeAmpl { std::move(theShape) };
158 std::vector<std::vector<float> > shapeDer { std::move(theShapeDer) };
159 larShapeCompleteCorr->set(
id,(
int)gain,shapeAmpl,shapeDer,timeOffset,25.);
164 ATH_MSG_DEBUG(
" Selected shapes for " <<
count <<
" cells. NChannels=" << larShapeCompleteCorr->chan_size());
167 if (
sc.isFailure()) {
174 if (
sc.isFailure()) {
175 ATH_MSG_ERROR(
"Failed to sym-link LArShapeComplete object" );
181 return StatusCode::SUCCESS;