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

Public Member Functions

 DataDump (fhicl::ParameterSet const &p)
 
 DataDump (DataDump const &)=delete
 
 DataDump (DataDump &&)=delete
 
DataDumpoperator= (DataDump const &)=delete
 
DataDumpoperator= (DataDump &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () 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

TTree * fTree
 
unsigned int run
 
unsigned int event
 
double evttime
 
std::vector< unsigned short > channel
 
std::vector< unsigned short > tick
 
std::vector< float > adc
 

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 36 of file DataDump_module.cc.

Constructor & Destructor Documentation

pdune::DataDump::DataDump ( fhicl::ParameterSet const &  p)
explicit

Definition at line 67 of file DataDump_module.cc.

68  : EDAnalyzer{p} // ,
69  // More initializers here.
70 {
71  // Call appropriate consumes<>() for any products to be retrieved by this module.
72 }
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
p
Definition: test.py:223
pdune::DataDump::DataDump ( DataDump const &  )
delete
pdune::DataDump::DataDump ( DataDump &&  )
delete

Member Function Documentation

void pdune::DataDump::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 74 of file DataDump_module.cc.

75 {
76 
77 //fGeom = &*(art::ServiceHandle<geo::Geometry>());
78 
79  run = e.run();
80  event = e.id().event();
81 
82  art::Timestamp ts = e.time();
83  if (ts.timeHigh() == 0){
84  TTimeStamp tts(ts.timeLow());
85  evttime = tts.AsDouble();
86  }
87  else{
88  TTimeStamp tts(ts.timeHigh(), ts.timeLow());
89  evttime = tts.AsDouble();
90  }
91  channel.clear();
92  tick.clear();
93  adc.clear();
94 
95  //std::ofstream outfile (Form("r%de%d.txt",run,event));
96 
97  auto const& wires =
98  e.getValidHandle<std::vector<recob::Wire> >("caldata:dataprep");
99 
100  for (auto & wire : * wires){
101  int channel_no = wire.Channel();
102  std::cout<<"Channel = "<<channel_no<<std::endl;
103  if (channel_no<2080 || channel_no > 2559) continue;
104  //for (auto & adc : wire.Signal()){
105  for (size_t i = 0; i < wire.Signal().size(); ++i){
106  //outfile<<channel<<" "<<i<<" "<<wire.Signal()[i]<<std::endl;
107  channel.push_back(channel_no);
108  tick.push_back(i);
109  adc.push_back(wire.Signal()[i]);
110  }
111  }
112  fTree->Fill();
113  //outfile.close();
114 }
constexpr std::uint32_t timeLow() const
Definition: Timestamp.h:29
std::vector< float > adc
constexpr std::uint32_t timeHigh() const
Definition: Timestamp.h:34
std::vector< unsigned short > tick
const double e
unsigned int run
std::vector< unsigned short > channel
QTextStream & endl(QTextStream &s)
void pdune::DataDump::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 116 of file DataDump_module.cc.

117 {
119  fTree = tfs->make<TTree>("spt","space point tree");
120  fTree->Branch("run",&run,"run/I");
121  fTree->Branch("event",&event,"event/I");
122  fTree->Branch("evttime",&evttime,"evttime/D");
123  fTree->Branch("channel", &channel);
124  fTree->Branch("tick",&tick);
125  fTree->Branch("adc",&adc);
126 }
std::vector< float > adc
std::vector< unsigned short > tick
unsigned int run
std::vector< unsigned short > channel
Event finding and building.
DataDump& pdune::DataDump::operator= ( DataDump const &  )
delete
DataDump& pdune::DataDump::operator= ( DataDump &&  )
delete

Member Data Documentation

std::vector<float> pdune::DataDump::adc
private

Definition at line 63 of file DataDump_module.cc.

std::vector<unsigned short> pdune::DataDump::channel
private

Definition at line 61 of file DataDump_module.cc.

unsigned int pdune::DataDump::event
private

Definition at line 59 of file DataDump_module.cc.

double pdune::DataDump::evttime
private

Definition at line 60 of file DataDump_module.cc.

TTree* pdune::DataDump::fTree
private

Definition at line 57 of file DataDump_module.cc.

unsigned int pdune::DataDump::run
private

Definition at line 58 of file DataDump_module.cc.

std::vector<unsigned short> pdune::DataDump::tick
private

Definition at line 62 of file DataDump_module.cc.


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