All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Attributes | List of all members
sim::DumpSimChannels Class Reference
Inheritance diagram for sim::DumpSimChannels:

Public Types

using Parameters = art::EDAnalyzer::Table< Config >
 

Public Member Functions

 DumpSimChannels (Parameters const &config)
 Configuration-checking constructor. More...
 
 DumpSimChannels (DumpSimChannels const &)=delete
 
 DumpSimChannels (DumpSimChannels &&)=delete
 
DumpSimChannelsoperator= (DumpSimChannels const &)=delete
 
DumpSimChannelsoperator= (DumpSimChannels &&)=delete
 
void analyze (art::Event const &event) override
 
template<typename Stream >
void DumpSimChannel (Stream &&out, sim::SimChannel const &simchannel, std::string indent="", bool bIndentFirst=true) const
 Dumps the content of the specified SimChannel in the output stream. More...
 

Private Attributes

art::InputTag fInputChannels
 name of SimChannel's data product More...
 
std::string fOutputCategory
 name of the stream for output More...
 

Detailed Description

Definition at line 52 of file DumpSimChannels_module.cc.

Member Typedef Documentation

using sim::DumpSimChannels::Parameters = art::EDAnalyzer::Table<Config>

Definition at line 55 of file DumpSimChannels_module.cc.

Constructor & Destructor Documentation

sim::DumpSimChannels::DumpSimChannels ( Parameters const &  config)
explicit

Configuration-checking constructor.

Definition at line 103 of file DumpSimChannels_module.cc.

104  : EDAnalyzer(config)
105  , fInputChannels(config().InputSimChannels())
106  , fOutputCategory(config().OutputCategory())
107 {}
std::string fOutputCategory
name of the stream for output
art::InputTag fInputChannels
name of SimChannel&#39;s data product
sim::DumpSimChannels::DumpSimChannels ( DumpSimChannels const &  )
delete
sim::DumpSimChannels::DumpSimChannels ( DumpSimChannels &&  )
delete

Member Function Documentation

void sim::DumpSimChannels::analyze ( art::Event const &  event)
override

Definition at line 122 of file DumpSimChannels_module.cc.

122  {
123 
124  // get the particles from the event
125  auto const& SimChannels
126  = *(event.getValidHandle<std::vector<sim::SimChannel>>(fInputChannels));
127 
128  mf::LogVerbatim(fOutputCategory) << "Event " << event.id()
129  << " : data product '" << fInputChannels.encode() << "' contains "
130  << SimChannels.size() << " SimChannels";
131 
132  unsigned int iSimChannel = 0;
133  for (sim::SimChannel const& simChannel: SimChannels) {
134 
135  // a bit of a header
136  mf::LogVerbatim log(fOutputCategory);
137  log << "[#" << (iSimChannel++) << "] ";
138  DumpSimChannel(log, simChannel, " ", false);
139 
140  } // for
141  mf::LogVerbatim(fOutputCategory) << "\n";
142 
143 } // sim::DumpSimChannels::analyze()
Energy deposited on a readout channel by simulated tracks.
Definition: SimChannel.h:145
std::string fOutputCategory
name of the stream for output
art::InputTag fInputChannels
name of SimChannel&#39;s data product
void DumpSimChannel(Stream &&out, sim::SimChannel const &simchannel, std::string indent="", bool bIndentFirst=true) const
Dumps the content of the specified SimChannel in the output stream.
template<typename Stream >
void sim::DumpSimChannels::DumpSimChannel ( Stream &&  out,
sim::SimChannel const &  simchannel,
std::string  indent = "",
bool  bIndentFirst = true 
) const

Dumps the content of the specified SimChannel in the output stream.

Template Parameters
Streamthe type of output stream
Parameters
outthe output stream
simchannelthe SimChannel to be dumped
indentbase indentation string (default: none)
bIndentFirstif first output line should be indented (default: yes)

The indent string is prepended to every line of output, with the possible exception of the first one, in case bIndentFirst is true.

The output starts on the current line, and the last line is NOT broken.

Definition at line 112 of file DumpSimChannels_module.cc.

115  {
116  if (bIndentFirst) out << indent;
117  channel.Dump(out, indent);
118 } // sim::DumpSimChannels::DumpSimChannels()
DumpSimChannels& sim::DumpSimChannels::operator= ( DumpSimChannels const &  )
delete
DumpSimChannels& sim::DumpSimChannels::operator= ( DumpSimChannels &&  )
delete

Member Data Documentation

art::InputTag sim::DumpSimChannels::fInputChannels
private

name of SimChannel's data product

Definition at line 93 of file DumpSimChannels_module.cc.

std::string sim::DumpSimChannels::fOutputCategory
private

name of the stream for output

Definition at line 94 of file DumpSimChannels_module.cc.


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