30 "True: Use separate correction COOL channel, False: Correction + data in the same channel");
40 ATH_MSG_INFO (
"Initialing LArRampAdHocPatchingAlg..." );
47 return StatusCode::FAILURE;
52 return StatusCode::FAILURE;
60 return StatusCode::FAILURE;
64 ATH_MSG_ERROR (
"Wrong size of MEDIUM gain values vector !" );
65 return StatusCode::FAILURE;
73 return StatusCode::FAILURE;
78 return StatusCode::FAILURE;
84 return StatusCode::SUCCESS;
109 ATH_MSG_INFO (
"Going to apply ad-hoc patches to HIGH gain ramps." );
114 ATH_MSG_INFO (
"Going to apply ad-hoc patches to MEDIUM gain ramps." );
119 ATH_MSG_INFO (
"Going to apply ad-hoc patches to LOW gain ramps." );
124 return StatusCode::SUCCESS;
131 if (channelsToBePatched.size() != patchesToBeApplied.size())
132 return StatusCode::FAILURE;
134 for (
unsigned ich=0;ich<channelsToBePatched.size();++ich ) {
137 const unsigned patchMethod = patchesToBeApplied[ich];
142 if (
m_contIn->get(chid,gain).isEmpty())
continue;
147 if ( valuesToBeApplied[putcount].
empty() )
return StatusCode::FAILURE;
161 return StatusCode::SUCCESS;
167 unsigned s =
m_contIn->get(chid,gain).m_vRamp.size();
172 if(s==0)
return false;
174 for (
unsigned i=1;i<s;++i){
178 if (
sc.isFailure()) {
179 ATH_MSG_ERROR (
"Failed to zero the ramp intercept channel 0x"
180 << MSG::hex << chid.
get_compact() << MSG::dec <<
", gain " << gain <<
"." );
183 ATH_MSG_INFO (
"Successfully zeroed the ramp intercept channel 0x"
184 << MSG::hex << chid.
get_compact() << MSG::dec <<
", gain " << gain <<
"." );
191 unsigned s = rvalues.size();
196 if(s==0)
return false;
197 for (
unsigned i=0;i<s;++i){
202 catch(...) {
ATH_MSG_INFO (
"Skipping insert of corrections, maybe it's not about this partition");}
203 if (
sc.isFailure()) {
205 << MSG::hex << chid.
get_compact() << MSG::dec <<
", gain " << gain <<
"." );
208 ATH_MSG_INFO (
"Successfully put the values for channel 0x"
209 << MSG::hex << chid.
get_compact() << MSG::dec <<
", gain " << gain <<
"." );
#define ATH_CHECK
Evaluate an expression and check for errors.
Algorithm implementing ad-hoc Ramp patches.
static const Attributes_t empty
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
value_type get_compact() const
Get the compact id.
GroupingType
Grouping type.
std::vector< unsigned > m_patchesToBeAppliedMG
std::vector< std::vector< double > > m_valuesToBeAppliedHG
~LArRampAdHocPatchingAlg()
Destructor.
std::vector< unsigned > m_channelsToBePatchedLG
std::vector< unsigned > m_channelsToBePatchedMG
StatusCode stop()
Finalize method.
LArRampComplete::LArCondObj LArRampObj
std::vector< unsigned > m_channelsToBePatchedHG
std::vector< unsigned > m_patchesToBeAppliedHG
const LArRampComplete * m_contIn
std::vector< std::vector< double > > m_valuesToBeAppliedMG
std::string m_containerKey
std::vector< std::vector< double > > m_valuesToBeAppliedLG
LArRampComplete * m_contOut
StatusCode ApplyAdHocPatches(std::vector< unsigned > &channelsToBePatched, std::vector< unsigned > &patchesTobeApplied, std::vector< std::vector< double > > &valuesToBeApplied, unsigned gain)
bool ZeroTheIntercept(HWIdentifier chid, unsigned gain)
std::string m_newContainerKey
LArRampAdHocPatchingAlg(const std::string &name, ISvcLocator *pSvcLocator)
regular Algorithm constructor
bool PutTheValues(HWIdentifier chid, std::vector< double > &rvalues, unsigned gain)
std::vector< unsigned > m_patchesToBeAppliedLG
StatusCode initialize()
Initialize method.
std::vector< float > m_vRamp
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string