Public Member Functions | Private Attributes | List of all members
APAIORdReader Class Reference
Inheritance diagram for APAIORdReader:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Member Functions

 APAIORdReader (fhicl::ParameterSet const &p)
 
 APAIORdReader (APAIORdReader const &)=delete
 
 APAIORdReader (APAIORdReader &&)=delete
 
APAIORdReaderoperator= (APAIORdReader const &)=delete
 
APAIORdReaderoperator= (APAIORdReader &&)=delete
 
void produce (art::Event &e) override
 
- Public Member Functions inherited from art::EDProducer
 EDProducer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDProducer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Producer
virtual ~Producer () noexcept
 
 Producer (fhicl::ParameterSet const &)
 
 Producer (Producer const &)=delete
 
 Producer (Producer &&)=delete
 
Produceroperator= (Producer const &)=delete
 
Produceroperator= (Producer &&)=delete
 
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::Modifier
 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- 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 fInputDirBaseName
 
uint32_t fAPAmin
 
uint32_t fAPAmax
 

Additional Inherited Members

- Public Types inherited from art::EDProducer
using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
- Public Types inherited from art::detail::Producer
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 
- Static Public Member Functions inherited from art::EDProducer
static void commitEvent (EventPrincipal &ep, Event &e)
 
- 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 27 of file APAIORdReader_module.cc.

Constructor & Destructor Documentation

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

Definition at line 52 of file APAIORdReader_module.cc.

53  : EDProducer{p} // ,
54 // More initializers here.
55 {
56  fInputDirBaseName = p.get<std::string>("InputDirBaseName","APAIO");
57  fAPAmin = p.get<uint32_t>("APAMin",0);
58  fAPAmax = p.get<uint32_t>("APAMax",150);
59  produces<std::vector<raw::RawDigit>>();
60 
61 }
std::string string
Definition: nybbler.cc:12
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
std::string fInputDirBaseName
p
Definition: test.py:223
APAIORdReader::APAIORdReader ( APAIORdReader const &  )
delete
APAIORdReader::APAIORdReader ( APAIORdReader &&  )
delete

Member Function Documentation

APAIORdReader& APAIORdReader::operator= ( APAIORdReader const &  )
delete
APAIORdReader& APAIORdReader::operator= ( APAIORdReader &&  )
delete
void APAIORdReader::produce ( art::Event e)
overridevirtual

Implements art::EDProducer.

Definition at line 63 of file APAIORdReader_module.cc.

64 {
65  // Implementation of required member function here.
66 
67  std::unique_ptr<std::vector<raw::RawDigit>> digcol(new std::vector<raw::RawDigit>);
68 
69  auto runno = e.run();
70  auto subrunno = e.subRun();
71  auto eventno = e.event();
72 
73  TString inputdir=fInputDirBaseName;
74  inputdir += "r";
75  TString rnst="";
76  rnst.Form("%08d",runno);
77  inputdir += rnst;
78  inputdir += "s";
79  TString srnst="";
80  srnst.Form("%05d",subrunno);
81  inputdir += srnst;
82  inputdir += "e";
83  TString est="";
84  est.Form("%08d",eventno);
85  inputdir += est;
86  gSystem->ExpandPathName(inputdir);
87 
88  void* dirp = gSystem->OpenDirectory(inputdir);
89  const char* entry;
90 
91  size_t version=0;
92 
93  TString fullfilename = "";
94  while((entry = (char*)gSystem->GetDirEntry(dirp)))
95  {
96  TString str=entry;
97  if (str.Contains("apa"))
98  {
99  fullfilename = inputdir;
100  fullfilename += "/";
101  fullfilename += entry;
102  //std::cout << " APAIORdReader found file: " << fullfilename << std::endl;
103  FILE *infile = fopen(fullfilename,"r");
104  while (infile != NULL)
105  {
106  uint32_t chan=0;
107  uint32_t samples=0;
108  raw::Compress_t compression = raw::kNone;
109  float pedestal=0;
110  float sigma=0;
111  uint32_t nadc=0;
112 
113  fread(&version,sizeof(version),1,infile);
114  if (feof(infile)) break;
115 
116  fread(&chan,sizeof(chan),1,infile);
117  //std::cout << "chan: " << chan << std::endl;
118  uint32_t apanum = chan/2560;
119  if (apanum > fAPAmax || apanum < fAPAmin) break;
120 
121  fread(&samples,sizeof(samples),1,infile);
122  fread(&compression,sizeof(compression),1,infile);
123  fread (&pedestal,sizeof(pedestal),1,infile);
124  fread (&sigma,sizeof(sigma),1,infile);
125  fread(&nadc,sizeof(nadc),1,infile);
126  raw::RawDigit::ADCvector_t adcs(nadc);
127  fread(adcs.data(),sizeof(adcs.front()),adcs.size(),infile);
128  digcol->emplace_back(chan,samples,adcs,compression);
129  digcol->back().SetPedestal(pedestal,sigma);
130  }
131  if (infile != NULL) fclose(infile);
132  }
133  }
134  gSystem->FreeDirectory(dirp);
135  e.put(std::move(digcol));
136 }
EventNumber_t event() const
Definition: DataViewImpl.cc:85
enum raw::_compress Compress_t
QList< Entry > entry
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:73
no compression
Definition: RawTypes.h:9
string infile
def move(depos, offset)
Definition: depos.py:107
SubRunNumber_t subRun() const
Definition: DataViewImpl.cc:78
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
std::string fInputDirBaseName
RunNumber_t run() const
Definition: DataViewImpl.cc:71
static QCString str

Member Data Documentation

uint32_t APAIORdReader::fAPAmax
private

Definition at line 47 of file APAIORdReader_module.cc.

uint32_t APAIORdReader::fAPAmin
private

Definition at line 46 of file APAIORdReader_module.cc.

std::string APAIORdReader::fInputDirBaseName
private

Definition at line 45 of file APAIORdReader_module.cc.


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