@@ -192,9 +192,9 @@ class icarus::trigger::LVDSgates: public art::EDProducer {
192192 { ComboMode::OR, " OR" }
193193 };
194194
195- fhicl::OptionalAtom<std::string > TriggerGatesTag {
195+ fhicl::OptionalAtom<art::InputTag > TriggerGatesTag {
196196 Name (" TriggerGatesTag" ),
197- Comment (" label of trigger gate extraction module (no instance name)" )
197+ Comment (" tag of trigger gate extraction module (no instance name)" )
198198 };
199199
200200 fhicl::Sequence<std::string> Thresholds {
@@ -386,11 +386,11 @@ class icarus::trigger::LVDSgates: public art::EDProducer {
386386
387387 // / Converts a threshold string into an input tag.
388388 static art::InputTag makeTag
389- (std::string const & thresholdStr, std::string const & defModule);
389+ (std::string const & thresholdStr, art::InputTag const & defModule);
390390
391391 // / Converts an input tag into an instance name for the corresponding output.
392392 static std::string makeOutputInstanceName
393- (art::InputTag const & inputTag, std::string const & defModule);
393+ (art::InputTag const & inputTag, art::InputTag const & defModule);
394394
395395}; // class icarus::trigger::LVDSgates
396396
@@ -412,11 +412,11 @@ icarus::trigger::LVDSgates::LVDSgates
412412 //
413413 // more complex parameter parsing
414414 //
415- std::string const discrModuleLabel = config ().TriggerGatesTag ().value_or (" " );
415+ art::InputTag const discrModuleTag = config ().TriggerGatesTag ().value_or (" " );
416416 for (std::string const & thresholdStr: config ().Thresholds ()) {
417- art::InputTag const inputTag = makeTag (thresholdStr, discrModuleLabel );
417+ art::InputTag const inputTag = makeTag (thresholdStr, discrModuleTag );
418418 fADCthresholds [thresholdStr]
419- = { inputTag, makeOutputInstanceName (inputTag, discrModuleLabel ) };
419+ = { inputTag, makeOutputInstanceName (inputTag, discrModuleTag ) };
420420 } // for all thresholds
421421
422422 //
@@ -863,34 +863,38 @@ auto icarus::trigger::LVDSgates::ReadTriggerGates(
863863
864864// ------------------------------------------------------------------------------
865865art::InputTag icarus::trigger::LVDSgates::makeTag
866- (std::string const & thresholdStr, std::string const & defModule)
866+ (std::string const & thresholdStr, art::InputTag const & defModule)
867867{
868868 auto const isNumber = [pattern=std::regex{ " [+-]?[0-9]+" }]
869869 (std::string const & s) -> bool
870870 { return std::regex_match (s, pattern); };
871- return
871+ if (!thresholdStr.empty () && !defModule.instance ().empty ()) {
872+ throw art::Exception (art::errors::Configuration)
873+ << " Both the input gate module tag instance name (`TriggerGatesTag`: '"
874+ << defModule.encode () << " ') and the threshold '" << thresholdStr
875+ << " ' are set. One of them must be empty.\n " ;
876+ }
877+ return
872878 ((thresholdStr.find (' :' ) != std::string::npos) || !isNumber (thresholdStr))
873879 ? art::InputTag{ thresholdStr }
874- : defModule.empty ()
880+ : defModule.label (). empty ()
875881 ? throw (art::Exception (art::errors::Configuration)
876882 << " No default module label (`TriggerGatesTag`) specified"
877- " , and it's needed for threshold '"
878- << thresholdStr << " '.\n " )
879- : art::InputTag{ defModule, thresholdStr }
883+ " , and it's needed for threshold '" << thresholdStr << " '.\n " )
884+ : art::InputTag{ defModule.label (), thresholdStr, defModule.process () }
880885 ;
881886} // icarus::trigger::LVDSgates::makeTag()
882887
883888
884889// ------------------------------------------------------------------------------
885890std::string icarus::trigger::LVDSgates::makeOutputInstanceName
886- (art::InputTag const & inputTag, std::string const & defModule)
891+ (art::InputTag const & inputTag, art::InputTag const & defModule)
887892{
888- return (inputTag.label () == defModule)
893+ return (inputTag.label () == defModule. label () )
889894 ? inputTag.instance ()
890- : inputTag.instance ().empty ()
891- ? inputTag.label (): inputTag.label () + inputTag.instance ()
895+ : inputTag.label () + inputTag.instance ()
892896 ;
893- } // icarus::trigger::LVDSgates::makeTag ()
897+ } // icarus::trigger::LVDSgates::makeOutputInstanceName ()
894898
895899
896900// ------------------------------------------------------------------------------
0 commit comments