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

Public Member Functions

 RawDigitOverlayDUNE35tAna (fhicl::ParameterSet const &p)
 
 RawDigitOverlayDUNE35tAna (RawDigitOverlayDUNE35tAna const &)=delete
 
 RawDigitOverlayDUNE35tAna (RawDigitOverlayDUNE35tAna &&)=delete
 
RawDigitOverlayDUNE35tAnaoperator= (RawDigitOverlayDUNE35tAna const &)=delete
 
RawDigitOverlayDUNE35tAnaoperator= (RawDigitOverlayDUNE35tAna &&)=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 ()
 
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 &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) 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 Member Functions

void FillADCVariables (art::Handle< std::vector< raw::RawDigit > > digit_handle, mix::RawDigitTypes type)
 
void Reset ()
 

Private Attributes

std::map< mix::RawDigitTypes, std::stringfRawDigitModuleLabels
 
std::map< mix::RawDigitTypes, art::Handle< std::vector< raw::RawDigit > > > fRawDigitProducts
 
TTree * fTree
 
size_t fNADCs
 
short fADCs [mix::kNMaxADCs]
 
raw::ChannelID_t fChannelIDs [mix::kNMaxADCs]
 
int fTypes [mix::kNMaxADCs]
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &paths, fhicl::ParameterSet const &config)
 
detail::ProcessAndEventSelectorsprocessAndEventSelectors ()
 
- 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 44 of file RawDigitOverlayDUNE35tAna_module.cc.

Constructor & Destructor Documentation

mix::RawDigitOverlayDUNE35tAna::RawDigitOverlayDUNE35tAna ( fhicl::ParameterSet const &  p)
explicit

Definition at line 78 of file RawDigitOverlayDUNE35tAna_module.cc.

79  :
80  EDAnalyzer(p)
81 {
82  fRawDigitModuleLabels[mix::kRawData] = p.get<std::string>("DataRawDigitModuleLabel");
83  fRawDigitModuleLabels[mix::kRawMC] = p.get<std::string>("MCRawDigitModuleLabel");
84  fRawDigitModuleLabels[mix::kRawMixed] = p.get<std::string>("MixedRawDigitModuleLabel");
85 }
std::string string
Definition: nybbler.cc:12
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:27
std::map< mix::RawDigitTypes, std::string > fRawDigitModuleLabels
p
Definition: test.py:223
mix::RawDigitOverlayDUNE35tAna::RawDigitOverlayDUNE35tAna ( RawDigitOverlayDUNE35tAna const &  )
delete
mix::RawDigitOverlayDUNE35tAna::RawDigitOverlayDUNE35tAna ( RawDigitOverlayDUNE35tAna &&  )
delete

Member Function Documentation

void mix::RawDigitOverlayDUNE35tAna::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 97 of file RawDigitOverlayDUNE35tAna_module.cc.

98 {
99 
100  Reset();
102  std::cout<<"Num TPC channels is: " << geometry->Nchannels() << std::endl;
103 
104  for (int type_num = mix::kRawData; type_num <= mix::kRawMixed; type_num++){
105  mix::RawDigitTypes type = static_cast<mix::RawDigitTypes>(type_num);
106  e.getByLabel(fRawDigitModuleLabels[type],fRawDigitProducts[type]);
107  if (!fRawDigitProducts[type].isValid()){
108  std::cerr<<"Could not find raw digit with label: " << fRawDigitModuleLabels[type] << std::endl;
109  }
110  else{
112  }
113  }
114 
115  /*
116  art::ServiceHandle<art::TFileService> tfs;
117 
118  art::Handle<std::vector<raw::RawDigit> > waveform1Handle,waveform2Handle,waveformSumHandle;
119  e.getByLabel(fRawDigitModule1,waveform1Handle);
120  e.getByLabel(fRawDigitModule2,waveform2Handle);
121  e.getByLabel(fRawDigitModuleSum,waveformSumHandle);
122  if(!waveform1Handle.isValid() || !waveform2Handle.isValid() || !waveformSumHandle.isValid()) throw std::runtime_error("some handle is not valid");
123  std::vector<raw::RawDigit> const& waveform1Vector(*waveform1Handle);
124  std::vector<raw::RawDigit> const& waveform2Vector(*waveform2Handle);
125  std::vector<raw::RawDigit> const& waveformSumVector(*waveformSumHandle);
126 
127  size_t histos_to_make = fAnaAlg.CheckOverlay(waveform1Vector,waveform2Vector,waveformSumVector);
128 
129  std::vector<TH1S*> histograms(histos_to_make);
130  for(size_t i_h=0; i_h<histograms.size(); i_h++){
131  std::stringstream hname; hname << "h" << i_h;
132  tfs->make<TH1S>(hname.str().c_str(),"GenericTitle",1,0,1);
133  }
134 
135  fAnaAlg.CreateOutputHistograms(histograms,
136  waveform1Vector,waveform2Vector,waveformSumVector,
137  e.run(),e.event());
138  */
139 
140  fTree->Fill();
141 }
unsigned int Nchannels() const
Returns the number of TPC readout channels in the detector.
void FillADCVariables(art::Handle< std::vector< raw::RawDigit > > digit_handle, mix::RawDigitTypes type)
const double e
std::map< mix::RawDigitTypes, art::Handle< std::vector< raw::RawDigit > > > fRawDigitProducts
std::map< mix::RawDigitTypes, std::string > fRawDigitModuleLabels
static QCString type
Definition: declinfo.cpp:672
QTextStream & endl(QTextStream &s)
void mix::RawDigitOverlayDUNE35tAna::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 87 of file RawDigitOverlayDUNE35tAna_module.cc.

87  {
89  fTree = tfs->make<TTree>("MRDT","MixerRawDigitTree");
90 
91  fTree->Branch("NADC",&fNADCs,"NADC/i");
92  fTree->Branch("ADC",fADCs,"ADC[NADC]/S");
93  fTree->Branch("ChannelID",fChannelIDs,"ChannelID[NADC]/I");
94  fTree->Branch("Type",fTypes,"Type[NADC]/I");
95 }
raw::ChannelID_t fChannelIDs[mix::kNMaxADCs]
void mix::RawDigitOverlayDUNE35tAna::FillADCVariables ( art::Handle< std::vector< raw::RawDigit > >  digit_handle,
mix::RawDigitTypes  type 
)
private

Definition at line 143 of file RawDigitOverlayDUNE35tAna_module.cc.

143  {
144  //Check if the handle is valid. If not, don't do anything :(
145  if (!digit_handle.isValid()){
146  std::cerr<<"Digit handle for type " << type << " not valid! Don't attempt to fill the tree for this product"<<std::endl;
147  return;
148  }
149  std::vector<raw::RawDigit> const& digitVector(*digit_handle);
150 
151  for (unsigned int i_raw = 0; i_raw < digitVector.size(); i_raw++){
152  raw::RawDigit raw_digit = digitVector[i_raw];
153 
154  raw::ChannelID_t channel = raw_digit.Channel();
155 
156  for (unsigned int i_adc = 0; i_adc < raw_digit.ADCs().size(); i_adc++){
157  fADCs[fNADCs] = raw_digit.ADCs()[i_adc];
159  fTypes[fNADCs] = static_cast<int>(type);
160  fNADCs++;
161  }
162  }
163 
164  return;
165 }
const ADCvector_t & ADCs() const
Reference to the compressed ADC count vector.
Definition: RawDigit.h:210
Collection of charge vs time digitized from a single readout channel.
Definition: RawDigit.h:69
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Definition: RawDigit.h:212
bool isValid() const
Definition: Handle.h:183
static QCString type
Definition: declinfo.cpp:672
raw::ChannelID_t fChannelIDs[mix::kNMaxADCs]
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:27
QTextStream & endl(QTextStream &s)
RawDigitOverlayDUNE35tAna& mix::RawDigitOverlayDUNE35tAna::operator= ( RawDigitOverlayDUNE35tAna const &  )
delete
RawDigitOverlayDUNE35tAna& mix::RawDigitOverlayDUNE35tAna::operator= ( RawDigitOverlayDUNE35tAna &&  )
delete
void mix::RawDigitOverlayDUNE35tAna::Reset ( )
private

Definition at line 167 of file RawDigitOverlayDUNE35tAna_module.cc.

167  {
168  fNADCs = 0;
169  for (int i = 0; i < mix::kNMaxADCs; i++){
170  fADCs[i] = -9999;
171  fChannelIDs[i] = -9999;
172  fTypes[i] = kNoType;
173  }
174 }
raw::ChannelID_t fChannelIDs[mix::kNMaxADCs]

Member Data Documentation

short mix::RawDigitOverlayDUNE35tAna::fADCs[mix::kNMaxADCs]
private

Definition at line 72 of file RawDigitOverlayDUNE35tAna_module.cc.

raw::ChannelID_t mix::RawDigitOverlayDUNE35tAna::fChannelIDs[mix::kNMaxADCs]
private

Definition at line 73 of file RawDigitOverlayDUNE35tAna_module.cc.

size_t mix::RawDigitOverlayDUNE35tAna::fNADCs
private

Definition at line 71 of file RawDigitOverlayDUNE35tAna_module.cc.

std::map<mix::RawDigitTypes, std::string> mix::RawDigitOverlayDUNE35tAna::fRawDigitModuleLabels
private

Definition at line 67 of file RawDigitOverlayDUNE35tAna_module.cc.

std::map<mix::RawDigitTypes, art::Handle<std::vector<raw::RawDigit> > > mix::RawDigitOverlayDUNE35tAna::fRawDigitProducts
private

Definition at line 68 of file RawDigitOverlayDUNE35tAna_module.cc.

TTree* mix::RawDigitOverlayDUNE35tAna::fTree
private

Definition at line 70 of file RawDigitOverlayDUNE35tAna_module.cc.

int mix::RawDigitOverlayDUNE35tAna::fTypes[mix::kNMaxADCs]
private

Definition at line 74 of file RawDigitOverlayDUNE35tAna_module.cc.


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