LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
art::InputTag Class Reference

#include "InputTag.h"

Public Member Functions

 InputTag ()=default
 
 InputTag (std::string const &s)
 
 InputTag (char const *s)
 
 InputTag (std::string const &label, std::string const &instance, std::string const &processName={})
 
 InputTag (char const *label, char const *instance, char const *processName="")
 
std::string encode () const
 
bool empty () const noexcept
 
std::string const & label () const noexcept
 
std::string const & instance () const noexcept
 
std::string const & process () const noexcept
 
bool operator== (InputTag const &tag) const noexcept
 

Private Member Functions

void set_from_string_ (std::string const &s)
 

Private Attributes

std::string label_ {}
 
std::string instance_ {}
 
std::string process_ {}
 

Detailed Description

Definition at line 18 of file InputTag.h.

Constructor & Destructor Documentation

art::InputTag::InputTag ( )
default
art::InputTag::InputTag ( std::string const &  s)
inline

Definition at line 96 of file InputTag.h.

References set_from_string_().

97 {
99 }
Float_t s
Definition: plot.C:23
void set_from_string_(std::string const &s)
Definition: InputTag.cc:15
art::InputTag::InputTag ( char const *  s)
inline

Definition at line 101 of file InputTag.h.

References set_from_string_().

102 {
104 }
Float_t s
Definition: plot.C:23
void set_from_string_(std::string const &s)
Definition: InputTag.cc:15
art::InputTag::InputTag ( std::string const &  label,
std::string const &  instance,
std::string const &  processName = {} 
)
inline

Definition at line 84 of file InputTag.h.

87  : label_(label), instance_(instance), process_(processName)
88 {}
std::string label_
Definition: InputTag.h:75
std::string process_
Definition: InputTag.h:77
std::string const & instance() const noexcept
Definition: InputTag.h:60
std::string const & label() const noexcept
Definition: InputTag.h:55
std::string instance_
Definition: InputTag.h:76
art::InputTag::InputTag ( char const *  label,
char const *  instance,
char const *  processName = "" 
)
inline

Definition at line 90 of file InputTag.h.

93  : label_(label), instance_(instance), process_(processName)
94 {}
std::string label_
Definition: InputTag.h:75
std::string process_
Definition: InputTag.h:77
std::string const & instance() const noexcept
Definition: InputTag.h:60
std::string const & label() const noexcept
Definition: InputTag.h:55
std::string instance_
Definition: InputTag.h:76

Member Function Documentation

bool art::InputTag::empty ( void  ) const
inlinenoexcept

Definition at line 49 of file InputTag.h.

50  {
51  return label_.empty() && instance_.empty() && process_.empty();
52  }
std::string label_
Definition: InputTag.h:75
std::string process_
Definition: InputTag.h:77
std::string instance_
Definition: InputTag.h:76
std::string art::InputTag::encode ( ) const

Definition at line 36 of file InputTag.cc.

References instance_, label_, and process_.

Referenced by recob::DumpVertices::analyze(), sim::DumpOpDetBacktrackerRecords::analyze(), sim::DumpSimChannels::analyze(), sim::DumpSimPhotons::analyze(), recob::DumpPCAxes::analyze(), sim::DumpSimPhotonsLite::analyze(), recob::DumpSpacePoints::analyze(), recob::DumpChargedSpacePoints::analyze(), recob::DumpSeeds::analyze(), recob::DumpClusters::analyze(), hit::DumpHits::analyze(), sim::DumpMCParticles::analyze(), sim::DumpMCTracks::analyze(), caldata::DumpWires::analyze(), detsim::DumpRawDigits::analyze(), sim::DumpMCShowers::analyze(), recob::DumpPFParticles::analyze(), recob::DumpTracks::analyze(), sim::DumpMCParticles::DumpMCParticle(), evd::RecoBaseDrawer::GetBezierTracks(), anab::FVectorWriter< 4 >::initOutputs(), DUNE::NeutrinoShowerEff::processEff(), shower::EMShower::produce(), lar::example::RemoveIsolatedSpacePoints::produce(), lar::example::TotallyCheatTracker::produce(), anab::FVectorWriter< 4 >::setDataTag(), and detinfo::setDetectorClocksStandardTriggersFromEvent().

37  {
38  // NOTE: since the encoding gets used to form the configuration hash I did
39  // not want
40  // to change it so that not specifying a process would cause two colons to
41  // appear in the encoding and thus not being backwards compatible
42  static std::string const separator(":");
43  std::string result = label_;
44  if (!instance_.empty() || !process_.empty()) {
45  result += separator + instance_;
46  }
47  if (!process_.empty()) {
48  result += separator + process_;
49  }
50  return result;
51  }
std::string label_
Definition: InputTag.h:75
std::string process_
Definition: InputTag.h:77
std::string instance_
Definition: InputTag.h:76
bool art::InputTag::operator== ( InputTag const &  tag) const
inlinenoexcept

Definition at line 107 of file InputTag.h.

References instance_, label_, and process_.

108 {
109  return (label_ == tag.label_) && (instance_ == tag.instance_) &&
110  (process_ == tag.process_);
111 }
std::string label_
Definition: InputTag.h:75
std::string process_
Definition: InputTag.h:77
std::string instance_
Definition: InputTag.h:76
std::string const& art::InputTag::process ( ) const
inlinenoexcept
void art::InputTag::set_from_string_ ( std::string const &  s)
private

Definition at line 15 of file InputTag.cc.

References art::errors::Configuration, instance_, label_, and process_.

Referenced by InputTag().

16  {
17  // string is delimited by colons
18  std::vector<std::string> tokens;
19  // cet::split(s, ':', std::back_inserter(tokens));
20  boost::split(tokens, s, boost::is_any_of(":"), boost::token_compress_off);
21 
22  int nwords = tokens.size();
23  if (nwords > 3) {
24  throw art::Exception(errors::Configuration, "InputTag")
25  << "Input tag " << s << " has " << nwords << " tokens";
26  }
27  if (nwords > 0)
28  label_ = tokens[0];
29  if (nwords > 1)
30  instance_ = tokens[1];
31  if (nwords > 2)
32  process_ = tokens[2];
33  }
Float_t s
Definition: plot.C:23
std::string label_
Definition: InputTag.h:75
std::string process_
Definition: InputTag.h:77
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::string instance_
Definition: InputTag.h:76

Member Data Documentation

std::string art::InputTag::instance_ {}
private

Definition at line 76 of file InputTag.h.

Referenced by encode(), operator==(), and set_from_string_().

std::string art::InputTag::label_ {}
private

Definition at line 75 of file InputTag.h.

Referenced by encode(), operator==(), and set_from_string_().

std::string art::InputTag::process_ {}
private

Definition at line 77 of file InputTag.h.

Referenced by encode(), operator==(), and set_from_string_().


The documentation for this class was generated from the following files: