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

Public Member Functions

 RawEventDisplay (fhicl::ParameterSet const &pset)
 
virtual ~RawEventDisplay ()
 
void beginJob ()
 
void beginRun (const art::Run &run)
 
void reconfigure (fhicl::ParameterSet const &pset)
 
void analyze (const art::Event &evt)
 
- 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 fRawDigitLabel
 
std::string fTPCInput
 
std::string fTPCInstance
 
unsigned int fEvent
 
unsigned int fRun
 
unsigned int fSubRun
 
unsigned int fNUCh
 
unsigned int fNVCh
 
unsigned int fNZCh
 
unsigned int fUChanMin
 
unsigned int fUChanMax
 
unsigned int fVChanMin
 
unsigned int fVChanMax
 
unsigned int fZChanMin
 
unsigned int fZChanMax
 
unsigned int fNticks
 
unsigned int fNofAPA
 
unsigned int fChansPerAPA
 
std::vector< TH2S * > fTimeChanU
 
std::vector< TH2S * > fTimeChanV
 
std::vector< TH2S * > fTimeChanZ
 
unsigned int nADC_uncompPed
 
geo::GeometryCore const * fGeom = &*(art::ServiceHandle<geo::Geometry>())
 

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 56 of file RawEventDisplay_module.cc.

Constructor & Destructor Documentation

raw_event_display::RawEventDisplay::RawEventDisplay ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 118 of file RawEventDisplay_module.cc.

118  : EDAnalyzer(parameterSet) {
119  this->reconfigure(parameterSet);
120 
121  }
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
void reconfigure(fhicl::ParameterSet const &pset)
raw_event_display::RawEventDisplay::~RawEventDisplay ( )
virtual

Definition at line 126 of file RawEventDisplay_module.cc.

126 {}

Member Function Documentation

void raw_event_display::RawEventDisplay::analyze ( const art::Event evt)

Definition at line 253 of file RawEventDisplay_module.cc.

253  {
254 
255  // called once per event
256 
257  fEvent = event.id().event();
258  fRun = event.run();
259  fSubRun = event.subRun();
260  std::cout << "EventNumber = " << fEvent << std::endl;
261 
262  // Get the objects holding raw information: RawDigit for TPC data
264  auto RawTPC = event.getHandle< std::vector<raw::RawDigit> >(itag1);
265 
266  // Fill pointer vectors - more useful form for the raw data
267  // a more usable form
268  std::vector< art::Ptr<raw::RawDigit> > RawDigits;
269  art::fill_ptr_vector(RawDigits, RawTPC);
270 
271 
272 
273  // Loop over all RawDigits (entire channels)
274  for(auto const & dptr : RawDigits) {
275  const raw::RawDigit & digit = *dptr;
276 
277  // Get the channel number for this digit
278  uint32_t chan = digit.Channel();
279  // number of samples in uncompressed ADC
280  int nSamples = digit.Samples();
281  unsigned int apa = std::floor( chan/fChansPerAPA );
282  int pedestal = (int)digit.GetPedestal();
283 
284  std::vector<short> uncompressed(nSamples);
285  // with pedestal
286  raw::Uncompress(digit.ADCs(), uncompressed, pedestal, digit.Compression());
287  // subtract pedestals
288  std::vector<short> uncompPed(nSamples);
289  for (int i=0; i<nSamples; i++) uncompPed.at(i)=uncompressed.at(i)-pedestal;
290 
291  // number of ADC uncompressed without pedestal
292  nADC_uncompPed=uncompPed.size();
293 
294 
295  //Induction Plane
296  if( fGeom->View(chan) == geo::kU){
297  for(unsigned int l=0;l<nADC_uncompPed;l++) {
298  if(uncompPed.at(l)!=0){
299  fTimeChanU[apa]->Fill(chan,l, uncompPed.at(l));
300  }
301  }
302  }// end of U View
303 
304  //Induction Plane
305  if( fGeom->View(chan) == geo::kV){
306  for(unsigned int l=0;l<nADC_uncompPed;l++) {
307  if(uncompPed.at(l)!=0){
308  fTimeChanV[apa]->Fill(chan,l, uncompPed.at(l));
309  }
310  }
311  }// end of V View
312 
313  if ( fGeom->View(chan) == geo::kZ){
314  for(unsigned int l=0;l<nADC_uncompPed;l++) {
315  if(uncompPed.at(l)!=0){
316  fTimeChanZ[apa]->Fill(chan,l, uncompPed.at(l));
317  }
318  }
319  }
320 
321 
322  } // RawDigits
323 
324  return;
325  }
float GetPedestal() const
Definition: RawDigit.h:214
const ADCvector_t & ADCs() const
Reference to the compressed ADC count vector.
Definition: RawDigit.h:210
ULong64_t Samples() const
Number of samples in the uncompressed ADC data.
Definition: RawDigit.h:213
Collection of charge vs time digitized from a single readout channel.
Definition: RawDigit.h:69
Planes which measure V.
Definition: geo_types.h:130
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Definition: RawDigit.h:212
std::vector< raw::RawDigit > RawDigits
Definition: HDF5Utils.h:23
Planes which measure Z direction.
Definition: geo_types.h:132
static QStrList * l
Definition: config.cpp:1044
Planes which measure U.
Definition: geo_types.h:129
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
raw::Compress_t Compression() const
Compression algorithm used to store the ADC counts.
Definition: RawDigit.h:216
type * at(uint i)
Definition: qinternallist.h:81
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
QTextStream & endl(QTextStream &s)
void raw_event_display::RawEventDisplay::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 130 of file RawEventDisplay_module.cc.

130  {
131  // place to define the histograms
132 
134  //Histogram names and titles
135  std::stringstream name, title;
136 
137  unsigned int UChMin;
138  unsigned int UChMax;
139  unsigned int VChMin;
140  unsigned int VChMax;
141  unsigned int ZChMin;
142  unsigned int ZChMax;
143  TH2S* TempHisto;
144 
145 
146  // Accquiring geometry data
149 
150  // taken from dune35t module a way to organise the channel mapping:
151  // loop through channels in the first APA to find the channel boundaries for each view
152  // will adjust for desired APA after
153  fUChanMin = 0;
154  fZChanMax = fChansPerAPA - 1;
155  for ( unsigned int c = fUChanMin + 1; c < fZChanMax; c++ ){
156  if ( fGeom->View(c) == geo::kV && fGeom->View(c-1) == geo::kU ){
157  fVChanMin = c;
158  fUChanMax = c - 1;
159  }
160  if ( fGeom->View(c) == geo::kZ && fGeom->View(c-1) == geo::kV ){
161  fZChanMin = c;
162  fVChanMax = c-1;
163  }
164  }
165 
166 
169  fNZCh=fZChanMax-fZChanMin+1;
170 
171 
172  unsigned int minT = 0;
173  unsigned int maxT = 0;
174  minT = 0;
175  maxT = fNticks;
176  unsigned int binT = (maxT-minT);
177 
178  for(unsigned int i=0;i<fNofAPA;i++){
179  UChMin=fUChanMin + i*fChansPerAPA;
180  UChMax=fUChanMax + i*fChansPerAPA;
181  VChMin=fVChanMin + i*fChansPerAPA;
182  VChMax=fVChanMax + i*fChansPerAPA;
183  ZChMin=fZChanMin + i*fChansPerAPA;
184  ZChMax=fZChanMax + i*fChansPerAPA;
185 
186  // construct the histograms; TH2 constructors: ("Name", "Title", NxBin, xMin, xMax, NyBin, yMax, yMin)
187  name.str("");
188  name << "fTimeChanU";
189  name << i;
190  title.str("");
191  title << "Time vs Channel(Plane U, APA";
192  title << i<<")";
193  TempHisto = tfs->make<TH2S>(name.str().c_str(),title.str().c_str(), UChMax - UChMin + 1, UChMin, UChMax, binT, minT, maxT);
194  fTimeChanU.push_back(TempHisto);
195 
196  name.str("");
197  name << "fTimeChanV";
198  name << i;
199  title.str("");
200  title << "Time vs Channel(Plane V, APA";
201  title << i<<")";
202  TempHisto = tfs->make<TH2S>(name.str().c_str(),title.str().c_str(), VChMax - VChMin + 1, VChMin, VChMax, binT, minT, maxT);
203  fTimeChanV.push_back(TempHisto);
204 
205  name.str("");
206  name << "fTimeChanZ";
207  name << i;
208  title.str("");
209  title << "Time vs Channel(Plane Z, APA";
210  title <<i<<")";
211  TempHisto = tfs->make<TH2S>(name.str().c_str(),title.str().c_str(), ZChMax - ZChMin + 1, ZChMin, ZChMax, binT, minT, maxT);
212  fTimeChanZ.push_back(TempHisto);
213 
214 
215  fTimeChanU[i]->SetStats(0);
216  fTimeChanV[i]->SetStats(0);
217  fTimeChanZ[i]->SetStats(0);
218 
219 
220  fTimeChanU[i]->GetXaxis()->SetTitle("Channel"); fTimeChanU[i]->GetYaxis()->SetTitle("TDC");
221  fTimeChanV[i]->GetXaxis()->SetTitle("Channel"); fTimeChanV[i]->GetYaxis()->SetTitle("TDC");
222  fTimeChanZ[i]->GetXaxis()->SetTitle("Channel"); fTimeChanZ[i]->GetYaxis()->SetTitle("TDC");
223  }
224 
225 
226  }
static QCString name
Definition: declinfo.cpp:673
Planes which measure V.
Definition: geo_types.h:130
Planes which measure Z direction.
Definition: geo_types.h:132
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
unsigned int Nchannels() const
Returns the number of TPC readout channels in the detector.
Planes which measure U.
Definition: geo_types.h:129
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
void raw_event_display::RawEventDisplay::beginRun ( const art::Run run)

Definition at line 230 of file RawEventDisplay_module.cc.

230  {
231  // place to read databases or run independent info
232  }
void raw_event_display::RawEventDisplay::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 236 of file RawEventDisplay_module.cc.

236  {
237 
238  // reconfigure without recompiling
239  // read in the parameters from the .fcl file
240  // allows for interactive changes of the parameter values
241 
242  fTPCInput = p.get< std::string >("TPCInputModule");
243  fTPCInstance = p.get< std::string >("TPCInstanceName");
244  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataForJob();
245  fNticks = detProp.NumberTimeSamples();
246  return;
247  }
std::string string
Definition: nybbler.cc:12
p
Definition: test.py:223

Member Data Documentation

unsigned int raw_event_display::RawEventDisplay::fChansPerAPA
private

Definition at line 95 of file RawEventDisplay_module.cc.

unsigned int raw_event_display::RawEventDisplay::fEvent
private

Definition at line 75 of file RawEventDisplay_module.cc.

geo::GeometryCore const* raw_event_display::RawEventDisplay::fGeom = &*(art::ServiceHandle<geo::Geometry>())
private

Definition at line 111 of file RawEventDisplay_module.cc.

unsigned int raw_event_display::RawEventDisplay::fNofAPA
private

Definition at line 94 of file RawEventDisplay_module.cc.

unsigned int raw_event_display::RawEventDisplay::fNticks
private

Definition at line 92 of file RawEventDisplay_module.cc.

unsigned int raw_event_display::RawEventDisplay::fNUCh
private

Definition at line 81 of file RawEventDisplay_module.cc.

unsigned int raw_event_display::RawEventDisplay::fNVCh
private

Definition at line 82 of file RawEventDisplay_module.cc.

unsigned int raw_event_display::RawEventDisplay::fNZCh
private

Definition at line 83 of file RawEventDisplay_module.cc.

std::string raw_event_display::RawEventDisplay::fRawDigitLabel
private

Definition at line 70 of file RawEventDisplay_module.cc.

unsigned int raw_event_display::RawEventDisplay::fRun
private

Definition at line 76 of file RawEventDisplay_module.cc.

unsigned int raw_event_display::RawEventDisplay::fSubRun
private

Definition at line 77 of file RawEventDisplay_module.cc.

std::vector<TH2S*> raw_event_display::RawEventDisplay::fTimeChanU
private

Definition at line 100 of file RawEventDisplay_module.cc.

std::vector<TH2S*> raw_event_display::RawEventDisplay::fTimeChanV
private

Definition at line 101 of file RawEventDisplay_module.cc.

std::vector<TH2S*> raw_event_display::RawEventDisplay::fTimeChanZ
private

Definition at line 102 of file RawEventDisplay_module.cc.

std::string raw_event_display::RawEventDisplay::fTPCInput
private

Definition at line 71 of file RawEventDisplay_module.cc.

std::string raw_event_display::RawEventDisplay::fTPCInstance
private

Definition at line 72 of file RawEventDisplay_module.cc.

unsigned int raw_event_display::RawEventDisplay::fUChanMax
private

Definition at line 87 of file RawEventDisplay_module.cc.

unsigned int raw_event_display::RawEventDisplay::fUChanMin
private

Definition at line 86 of file RawEventDisplay_module.cc.

unsigned int raw_event_display::RawEventDisplay::fVChanMax
private

Definition at line 89 of file RawEventDisplay_module.cc.

unsigned int raw_event_display::RawEventDisplay::fVChanMin
private

Definition at line 88 of file RawEventDisplay_module.cc.

unsigned int raw_event_display::RawEventDisplay::fZChanMax
private

Definition at line 91 of file RawEventDisplay_module.cc.

unsigned int raw_event_display::RawEventDisplay::fZChanMin
private

Definition at line 90 of file RawEventDisplay_module.cc.

unsigned int raw_event_display::RawEventDisplay::nADC_uncompPed
private

Definition at line 108 of file RawEventDisplay_module.cc.


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