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

Public Member Functions

 WaveformsToTree (fhicl::ParameterSet const &p)
 
 WaveformsToTree (WaveformsToTree const &)=delete
 
 WaveformsToTree (WaveformsToTree &&)=delete
 
WaveformsToTreeoperator= (WaveformsToTree const &)=delete
 
WaveformsToTreeoperator= (WaveformsToTree &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () override
 
void endJob () 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_inputTag
 
int m_maxChannels
 
TTree * m_tree
 
std::vector< std::vector< int > > m_waveforms
 
std::vector< int > m_chans
 

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 28 of file WaveformsToTree_module.cc.

Constructor & Destructor Documentation

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

Definition at line 56 of file WaveformsToTree_module.cc.

57  : EDAnalyzer(p),
58  m_inputTag(p.get<std::string>("InputTag", "daq")),
59  m_maxChannels(p.get<int>("MaxChannels"))
60 {
61 }
std::string string
Definition: nybbler.cc:12
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
p
Definition: test.py:223
WaveformsToTree::WaveformsToTree ( WaveformsToTree const &  )
delete
WaveformsToTree::WaveformsToTree ( WaveformsToTree &&  )
delete

Member Function Documentation

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

Implements art::EDAnalyzer.

Definition at line 71 of file WaveformsToTree_module.cc.

72 {
73  m_waveforms.clear();
74  m_chans.clear();
75 
76  auto const& digits_handle=e.getValidHandle<std::vector<raw::RawDigit>>(m_inputTag);
77  auto& digits_in =*digits_handle;
78 
79  int nChan=0;
81  for(auto&& digit: digits_in){
82  bool isCollection=geo->SignalType(digit.Channel())==geo::kCollection;
83  if(!isCollection) continue;
84  if(nChan++ > m_maxChannels) break;
85 
86  m_chans.push_back(digit.Channel());
87  std::vector<int> waveform;
88  for(auto const& adc: digit.ADCs()){
89  waveform.push_back(adc);
90  }
91  m_waveforms.push_back(std::move(waveform));
92  }
93  m_tree->Fill();
94 }
std::vector< int > m_chans
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
def move(depos, offset)
Definition: depos.py:107
std::vector< std::vector< int > > m_waveforms
LArSoft geometry interface.
Definition: ChannelGeo.h:16
Signal from collection planes.
Definition: geo_types.h:146
void WaveformsToTree::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 63 of file WaveformsToTree_module.cc.

64 {
66  m_tree = tfs->make<TTree>("WaveformTree","title");
67  m_tree->Branch<std::vector<std::vector<int> > >("waveforms", &m_waveforms);
68  m_tree->Branch("chans", &m_chans);
69 }
std::vector< int > m_chans
std::vector< std::vector< int > > m_waveforms
void WaveformsToTree::endJob ( )
inlineoverridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 45 of file WaveformsToTree_module.cc.

45 { m_tree->Write(); }
WaveformsToTree& WaveformsToTree::operator= ( WaveformsToTree const &  )
delete
WaveformsToTree& WaveformsToTree::operator= ( WaveformsToTree &&  )
delete

Member Data Documentation

std::vector<int> WaveformsToTree::m_chans
private

Definition at line 52 of file WaveformsToTree_module.cc.

std::string WaveformsToTree::m_inputTag
private

Definition at line 48 of file WaveformsToTree_module.cc.

int WaveformsToTree::m_maxChannels
private

Definition at line 49 of file WaveformsToTree_module.cc.

TTree* WaveformsToTree::m_tree
private

Definition at line 50 of file WaveformsToTree_module.cc.

std::vector<std::vector<int> > WaveformsToTree::m_waveforms
private

Definition at line 51 of file WaveformsToTree_module.cc.


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