@@ -71,23 +71,27 @@ void DigitQcTaskLaser::rebinFromConfig()
7171
7272 const std::string rebinKeyword = " binning" ;
7373 const char * channelIdPlaceholder = " #" ;
74- for (auto & param : mCustomParameters .getAllDefaults ()) {
75- if (param.first .rfind (rebinKeyword, 0 ) != 0 )
76- continue ;
77- std::string hName = param.first .substr (rebinKeyword.length () + 1 );
78- std::string binning = param.second .c_str ();
79- if (hName.find (channelIdPlaceholder) != std::string::npos) {
80- for (const auto & chID : mSetAllowedChIDs ) {
81- std::string hNameCur = hName.substr (0 , hName.find (channelIdPlaceholder)) + std::to_string (chID) + hName.substr (hName.find (channelIdPlaceholder) + 1 );
82- rebinHisto (hNameCur, binning);
83- }
84- for (const auto & chID : mSetRefPMTChIDs ) {
85- std::string hNameCur = hName.substr (0 , hName.find (channelIdPlaceholder)) + std::to_string (chID) + hName.substr (hName.find (channelIdPlaceholder) + 1 );
86- rebinHisto (hNameCur, binning);
74+ try {
75+ for (auto & param : mCustomParameters .getAllDefaults ()) {
76+ if (param.first .rfind (rebinKeyword, 0 ) != 0 )
77+ continue ;
78+ std::string hName = param.first .substr (rebinKeyword.length () + 1 );
79+ std::string binning = param.second .c_str ();
80+ if (hName.find (channelIdPlaceholder) != std::string::npos) {
81+ for (const auto & chID : mSetAllowedChIDs ) {
82+ std::string hNameCur = hName.substr (0 , hName.find (channelIdPlaceholder)) + std::to_string (chID) + hName.substr (hName.find (channelIdPlaceholder) + 1 );
83+ rebinHisto (hNameCur, binning);
84+ }
85+ for (const auto & chID : mSetRefPMTChIDs ) {
86+ std::string hNameCur = hName.substr (0 , hName.find (channelIdPlaceholder)) + std::to_string (chID) + hName.substr (hName.find (channelIdPlaceholder) + 1 );
87+ rebinHisto (hNameCur, binning);
88+ }
89+ } else {
90+ rebinHisto (hName, binning);
8791 }
88- } else {
89- rebinHisto (hName, binning);
9092 }
93+ } catch (std::out_of_range& oor) {
94+ ILOG (Error) << " Cannot access the default custom parameters : " << oor.what () << ENDM;
9195 }
9296}
9397
0 commit comments