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

Public Member Functions

 PDDPTPCRawDecoderTest (fhicl::ParameterSet const &p)
 
 PDDPTPCRawDecoderTest (PDDPTPCRawDecoderTest const &)=delete
 
 PDDPTPCRawDecoderTest (PDDPTPCRawDecoderTest &&)=delete
 
PDDPTPCRawDecoderTestoperator= (PDDPTPCRawDecoderTest const &)=delete
 
PDDPTPCRawDecoderTestoperator= (PDDPTPCRawDecoderTest &&)=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 __RawDigitLabel
 
unsigned __Ticks
 
unsigned __Chans
 
TH2I * __AdcData
 

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 32 of file PDDPTPCRawDecoderTest_module.cc.

Constructor & Destructor Documentation

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

Definition at line 61 of file PDDPTPCRawDecoderTest_module.cc.

62  : EDAnalyzer{p} // ,
63  // More initializers here.
64 {
65  // Call appropriate consumes<>() for any products to be retrieved by this module.
66  __RawDigitLabel = p.get< std::string >("RawDigitLabel");
67  __Ticks = p.get< unsigned >("Ticks");
68  __Chans = p.get< unsigned >("Chans");
69 
70 }
std::string string
Definition: nybbler.cc:12
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
p
Definition: test.py:223
PDDPTPCRawDecoderTest::PDDPTPCRawDecoderTest ( PDDPTPCRawDecoderTest const &  )
delete
PDDPTPCRawDecoderTest::PDDPTPCRawDecoderTest ( PDDPTPCRawDecoderTest &&  )
delete

Member Function Documentation

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

Implements art::EDAnalyzer.

Definition at line 72 of file PDDPTPCRawDecoderTest_module.cc.

73 {
74  auto Raw = e.getHandle< std::vector<raw::RawDigit> >(__RawDigitLabel);
75  std::vector< art::Ptr<raw::RawDigit> > Digits;
76  art::fill_ptr_vector(Digits, Raw);
77 
78  //loop through all RawDigits (over entire channels)
79  mf::LogInfo("") << "Total number of channels "<<Digits.size();
80 
81  for(auto &digit : Digits)
82  {
83  auto chan = digit->Channel();
84  auto samples = digit->Samples();
85  //mf::LogInfo("") << "vector size " << chan <<" "<< samples;
86 
88  // note: only works with uncompressed data for now
89  raw::Uncompress(digit->ADCs(), data, digit->Compression());
90 
91  if( chan >= __Chans ) break; //continue;
92  unsigned tick = 0;
93  for( auto &adc : data )
94  {
95  if( tick >= __Ticks ) break;
96  __AdcData->Fill( chan, tick++, adc );
97  }
98  }
99 }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:73
int16_t adc
Definition: CRTFragment.hh:202
const double e
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
Definition: raw.cxx:776
void PDDPTPCRawDecoderTest::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 101 of file PDDPTPCRawDecoderTest_module.cc.

102 {
103  // Implementation of optional member function here.
105 
106  // put all channels in single histogram
107  __AdcData = tfs->make<TH2I>( "amc_data","AMC Data",
108  __Chans, 0, __Chans, __Ticks, 0, __Ticks );
109 }
void PDDPTPCRawDecoderTest::endJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 111 of file PDDPTPCRawDecoderTest_module.cc.

112 {
113  // Implementation of optional member function here.
114 }
PDDPTPCRawDecoderTest& PDDPTPCRawDecoderTest::operator= ( PDDPTPCRawDecoderTest const &  )
delete
PDDPTPCRawDecoderTest& PDDPTPCRawDecoderTest::operator= ( PDDPTPCRawDecoderTest &&  )
delete

Member Data Documentation

TH2I* PDDPTPCRawDecoderTest::__AdcData
private

Definition at line 57 of file PDDPTPCRawDecoderTest_module.cc.

unsigned PDDPTPCRawDecoderTest::__Chans
private

Definition at line 55 of file PDDPTPCRawDecoderTest_module.cc.

std::string PDDPTPCRawDecoderTest::__RawDigitLabel
private

Definition at line 53 of file PDDPTPCRawDecoderTest_module.cc.

unsigned PDDPTPCRawDecoderTest::__Ticks
private

Definition at line 54 of file PDDPTPCRawDecoderTest_module.cc.


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