Public Member Functions | Private Attributes | List of all members
WaveformAndSimChannelDump Class Reference
Inheritance diagram for WaveformAndSimChannelDump:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 WaveformAndSimChannelDump (fhicl::ParameterSet const &p)
 
 WaveformAndSimChannelDump (WaveformAndSimChannelDump const &)=delete
 
 WaveformAndSimChannelDump (WaveformAndSimChannelDump &&)=delete
 
WaveformAndSimChannelDumpoperator= (WaveformAndSimChannelDump const &)=delete
 
WaveformAndSimChannelDumpoperator= (WaveformAndSimChannelDump &&)=delete
 
void analyze (art::Event const &e) override
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Attributes

std::string m_inputTagGEANT
 
std::string m_inputTagTPC
 
std::string m_outputFilename_tpc
 
std::string m_outputFilename_true_tpc
 
size_t m_max_channel
 
std::ofstream m_outputFile_tpc
 
std::ofstream m_outputFile_true_tpc
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 29 of file WaveformAndSimChannelDump_module.cc.

Constructor & Destructor Documentation

WaveformAndSimChannelDump::WaveformAndSimChannelDump ( fhicl::ParameterSet const &  p)
explicit

Definition at line 56 of file WaveformAndSimChannelDump_module.cc.

57  : EDAnalyzer(p),
58  m_inputTagGEANT (p.get<std::string>("InputTagGEANT" , "largeant")),
59  m_inputTagTPC (p.get<std::string>("InputTagTPC" , "daq" )),
60  m_outputFilename_tpc (p.get<std::string>("OutputFileTPC" ,"OutputFileTPC.txt" )),
61  m_outputFilename_true_tpc(p.get<std::string>("OutputFileTrueTPC","OutputFileTrueTPC.txt")),
62  m_max_channel(p.get<size_t>("MaxChannels", 2560)),
65 {
66 }
std::string string
Definition: nybbler.cc:12
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
p
Definition: test.py:223
WaveformAndSimChannelDump::WaveformAndSimChannelDump ( WaveformAndSimChannelDump const &  )
delete
WaveformAndSimChannelDump::WaveformAndSimChannelDump ( WaveformAndSimChannelDump &&  )
delete

Member Function Documentation

void WaveformAndSimChannelDump::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 68 of file WaveformAndSimChannelDump_module.cc.

69 {
71 
72  // TPC Waveforms
73  size_t n_ticks_tpc = 0;
74  auto const& digits_handle_tpc=e.getValidHandle<std::vector<raw::RawDigit>>(m_inputTagTPC);
75  auto& digits_tpc_in =*digits_handle_tpc;
76  for (auto&& digit: digits_tpc_in) {
77  bool isCollection=geo->SignalType(digit.Channel())==geo::kCollection;
78  if (digit.Channel() >= m_max_channel) continue;
79  m_outputFile_tpc << e.event() << " "
80  << digit.Channel() << " "
81  << isCollection << " ";
82  for(auto const& adc: digit.ADCs()){
83  m_outputFile_tpc << adc << " ";
84  }
85  n_ticks_tpc=digits_tpc_in.at(0).ADCs().size();
86  m_outputFile_tpc << "\n";
87  }
88 
89  // TPC truth
90  auto const& truth_handle_tpc=e.getValidHandle<std::vector<sim::SimChannel>>(m_inputTagGEANT);
91  auto& truth_tpc_in =*truth_handle_tpc;
92  for (auto&& truth: truth_tpc_in) {
93  bool isCollection=geo->SignalType(truth.Channel())==geo::kCollection;
94  if (truth.Channel() >= m_max_channel) continue;
95  m_outputFile_true_tpc << e.event() << " "
96  << truth.Channel() <<" "
97  << isCollection << " ";
98  for(size_t ichge=0; ichge<n_ticks_tpc; ++ichge){
99  m_outputFile_true_tpc << truth.Charge(ichge) << " ";
100  }
101  m_outputFile_true_tpc << "\n";
102  }
103 }
int16_t adc
Definition: CRTFragment.hh:202
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
const double e
LArSoft geometry interface.
Definition: ChannelGeo.h:16
Signal from collection planes.
Definition: geo_types.h:146
WaveformAndSimChannelDump& WaveformAndSimChannelDump::operator= ( WaveformAndSimChannelDump const &  )
delete
WaveformAndSimChannelDump& WaveformAndSimChannelDump::operator= ( WaveformAndSimChannelDump &&  )
delete

Member Data Documentation

std::string WaveformAndSimChannelDump::m_inputTagGEANT
private

Definition at line 46 of file WaveformAndSimChannelDump_module.cc.

std::string WaveformAndSimChannelDump::m_inputTagTPC
private

Definition at line 47 of file WaveformAndSimChannelDump_module.cc.

size_t WaveformAndSimChannelDump::m_max_channel
private

Definition at line 50 of file WaveformAndSimChannelDump_module.cc.

std::ofstream WaveformAndSimChannelDump::m_outputFile_tpc
private

Definition at line 51 of file WaveformAndSimChannelDump_module.cc.

std::ofstream WaveformAndSimChannelDump::m_outputFile_true_tpc
private

Definition at line 52 of file WaveformAndSimChannelDump_module.cc.

std::string WaveformAndSimChannelDump::m_outputFilename_tpc
private

Definition at line 48 of file WaveformAndSimChannelDump_module.cc.

std::string WaveformAndSimChannelDump::m_outputFilename_true_tpc
private

Definition at line 49 of file WaveformAndSimChannelDump_module.cc.


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