TrackPlots_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \brief TODO
3 /// \author shanahan@fnal.gov
4 /// \date March 2012
5 ////////////////////////////////////////////////////////////////////////
6 #include <iostream>
7 #include <map>
8 #include <string>
9 #include <vector>
10 
11 // Root
12 #include "TH1F.h"
13 #include "TH2F.h"
14 #include "TProfile.h"
15 
16 // Framework includes
25 
26 // NOvA includes
28 #include "DAQChannelMap/DAQChannelMap.h"
30 #include "Geometry/Geometry.h"
32 #include "NovaDAQConventions/DAQConventions.h"
33 #include "RecoBase/Track.h"
34 #include "RecoBase/CellHit.h"
35 
36 
37 namespace dprf {
38 
39  class TrackPlots : public art::EDAnalyzer
40  {
41  public:
42  explicit TrackPlots(fhicl::ParameterSet const &p);
43  ~TrackPlots();
44 
45  void beginRun(const art::Run& run);
46  virtual void analyze(art::Event const&);
47  void endJob();
48 
49  private:
50 
51  unsigned int DcmKey(unsigned int dib,unsigned int ldc) {
52  return dib*100+ldc; };
53  unsigned int DiBlock(unsigned int key) {
54  return key/100; };
55  unsigned int LDCM(unsigned int key) {
56  return key%100; };
57 
58  // configurables
59  //const fhicl::ParameterSet &fPSet;
60  const unsigned int fMinPlaneTrack,fMinCellTrack,fMinCellTrackView; ///< track cuts
61  const unsigned int fMinTrackHitDCM; ///< minimum number of hits on a track in a DCM to use it for comparision to other DCMs
62  const unsigned int fEventGroup; ///< Number of events per group
64  unsigned int fCallNumber;///< keep track number of calls, for defining event groups
65  typedef enum _groups { kAllG, kEvent, kNumGroup} Groups_t;
66  typedef enum _cutlevel { kAll, kPass, kNumLevel} Cuts_t;
67 
68  struct ViewH {
69  TH2F* hists[2];
70  };
71  std::map<unsigned int, ViewH> fHBookedChanCP;///< map of booked channels in cell-plane, vs group
72  //TH2F* fHRawDigits[geo::kXorY][kNumLevel]; ///< plots of raw digits
73  TH1F* fHExtentPlaneTrk[kNumLevel]; ///< plots of raw digits
74  TH1F* fHNCellTrk[kNumLevel]; ///< plots of raw digits
75  TH1F* fHNCellViewTrk[geo::kXorY][kNumLevel]; ///< plots of raw digits
76  TH1F* fHTrkCellXMinusY[kNumLevel]; ///< difference in cells per view
77 
78  TH2F* fHTracksDCM[kNumGroup][kNumLevel]; ///< DCMs with hits on tracks
79  TH2F* fHTracksDCMHits[kNumGroup][kNumLevel]; ///< Number of hits per track on DCM
80  TH2F* fHTracksOtherDCMs[kNumGroup][kNumLevel]; ///< Number of other DCMs with hits on track
81  TH2F* fHTracksOtherDCMHits[kNumGroup][kNumLevel]; ///< Number of hits on other DCMs with hits on track
82  TH2F* fHTracksOtherDCMRatio[kNumGroup][kNumLevel]; ///< Ratio of hits on track on DCM to hits on track on all other DCMs
83  TH2F* fHTrackEnd[geo::kXorY][kNumLevel]; ///< (Cell,Plane) for endpoints
84  // of track in Z, in each view
85 
86  std::map<unsigned int, std::map<unsigned int, float> > fTracksOtherDCMRatio; // map of ratio vs. event group (first key), for each dcm (second key)
88  void ResetEventGroup();
89  void FinishEventGroup(unsigned int);
90  void Normalize(unsigned int);
91 
92  };
93 
94 
95 }//namespace
96 
97 
98 namespace dprf {
99 
101  EDAnalyzer(pset),
102  //fPSet(pset),
103  fMinPlaneTrack(pset.get< unsigned int >("MinPlaneTrack")),
104  fMinCellTrack(pset.get< unsigned int >("MinCellTrack")),
105  fMinCellTrackView(pset.get< unsigned int >("MinCellTrackView")),
106  fMinTrackHitDCM(pset.get< unsigned int >("MinTrackHitDCM")),
107  fEventGroup(pset.get< unsigned int >("EventGroup")),
108  fRawDigitLabel(pset.get< std::string >("RawDigitLabel")),
109  fCellHitLabel(pset.get< std::string >("CellHitLabel")),
110  fTrackLabel(pset.get< std::string >("TrackLabel")),
111  fCallNumber(0),
112  fHExtentPlaneTrk{0, 0} // Flag the others are uninitialized too
113  {
114  }
115 
117  {
118  }
119 
121  {
122  if(fHExtentPlaneTrk[kAll]) return; // Don't make histograms twice
123 
126  const geo::PlaneGeo* plane;
127 
128  unsigned int ndcm = 12; // # of DCM in Far Detector
129  unsigned int ndb = 14; // # of diblocks in Far Detector
130 
131  if (geom->DetId() == novadaq::cnv::kNDOS){
132  ndcm = 3; // # of DCM in NDOS
133  ndb = 4;
134  }
135  if (geom->DetId() == novadaq::cnv::kNEARDET){
136  ndcm = 4; // # of DCM in NEAR Detector
137  ndb = 4;
138  }
139 
140 
141  for (unsigned int cut=kAll; cut<kNumLevel; cut++) {
142  std::string cutname(cut==kAll ? "All" : "On Good Tracks");
143 
144  for (unsigned int iv=geo::kX; iv<geo::kXorY; iv++)
145  {
146 
148  std::string viewName(view == geo::kX ? "X" : "Y");
149 
150 
151  const std::set<unsigned int>& planes=geom->GetPlanesByView(view);
152  // const geo::PlaneGeo* plane=(geom->Plane(*(planes.begin())));
153  plane=(geom->Plane(*(planes.begin())));
154 
155  fHTrackEnd[iv][cut]=
156  tfs->make<TH2F>(Form("HTrackEnd_%s_%d",viewName.c_str(),cut),
157  Form("Track Endpoints, %s, %s",viewName.c_str(),cutname.c_str()),
158  geom->NPlanes()+1,-.5,geom->NPlanes()+.5,
159  plane->Ncells()+1,-.5,plane->Ncells()+.5);
160 
161  }//view
162 
164  //
165  // ********* Hardcoded for NDOS *************
166  //
167  // tfs->make<TH1F>(Form("HTrackPlanes%d",cut),
168  // Form("Track Extent (Planes), %s",cutname.c_str()),
169  // 200.,-.5,199.5);
170  //
171  tfs->make<TH1F>(Form("HTrackPlanes%d",cut),
172  Form("Track Extent (Planes), %s",cutname.c_str()),
173  geom->NPlanes()+1,-.5,geom->NPlanes()+.5);
174 
175 
176  fHNCellTrk[cut]=
177  tfs->make<TH1F>(Form("HNCellTrk_%d",cut),
178  Form("Track Number of Cells, %s",cutname.c_str()),
179  geom->NPlanes()+1,-.5,geom->NPlanes()+.5);
181  tfs->make<TH1F>(Form("HNCellViewTrk_X_%d",cut),
182  Form("Track Number of Cells, X, %s",cutname.c_str()),
183  geom->NPlanes()+1,-.5,geom->NPlanes()+.5);
185  tfs->make<TH1F>(Form("HNCellViewTrk_Y_%d",cut),
186  Form("Track Number of Cells, Y, %s",cutname.c_str()),
187  geom->NPlanes()+1,-.5,geom->NPlanes()+.5);
188 
190  tfs->make<TH1F>(Form("HTrkCellXMinusY_%d",cut),
191  Form("Track Cell difference, X-Y view, %s",cutname.c_str()),
192  plane->Ncells()+1,-.5,plane->Ncells()+.5);
193  // 100, -.5, 99.5);
194 
195  //igrp=0 for all events, igrp=1 event-wise (or group-wise)
196  for (unsigned int igrp=0; igrp<2; igrp++) {
197  std::string groupname(igrp==kAll ? "(All Events)" : "Event Group");
198  fHTracksDCM[igrp][cut]=
199  tfs->make<TH2F>(Form("HTracksDCM_%d_%d",igrp,cut),
200  Form("Tracks in DCM (ldcm vs. db), %s %s",groupname.c_str(),cutname.c_str()),
201  ndb,+.5,(float)ndb+.5,ndcm,.5,(float)ndcm+.5);
202  fHTracksDCMHits[igrp][cut]=
203  tfs->make<TH2F>(Form("HTracksDCMHits_%d_%d",igrp,cut),
204  Form("Track Hits in DCM (ldcm vs. db), %s %s",groupname.c_str(),cutname.c_str()),
205  ndb,+.5,(float)ndb+.5,ndcm,.5,(float)ndcm+.5);
206 
207  fHTracksOtherDCMs[igrp][cut]=
208  tfs->make<TH2F>(Form("HTracksOtherDCMs_%d_%d",igrp,cut),
209  Form("Number of Other DCMs with Track Hits, vs. DCM (ldcm vs. db), %s %s",groupname.c_str(),cutname.c_str()),
210  ndb,+.5,(float)ndb+.5,ndcm,.5,(float)ndcm+.5);
211 
212  fHTracksOtherDCMHits[igrp][cut]=
213  tfs->make<TH2F>(Form("HTracksOtherDCMHits_%d_%d",igrp,cut),
214  Form("Number of Track Hits on Other DCMs, vs. DCM (ldcm vs. db), %s %s",groupname.c_str(),cutname.c_str()),
215  ndb,+.5,(float)ndb+.5,ndcm,.5,(float)ndcm+.5);
216 
217  fHTracksOtherDCMRatio[igrp][cut]=
218  tfs->make<TH2F>(Form("HTracksOtherDCMRatio_%d_%d",igrp,cut),
219  Form("Ratio of Track Hits on Other DCMs vs. DCM (ldcm vs. db), %s %s",groupname.c_str(),cutname.c_str()),
220  ndb,+.5,(float)ndb+.5,ndcm,.5,(float)ndcm+.5);
221  } //igrp
222 
223 
224  }//Cut levels
225 
226  } // end beginRun
227 
229  {
231 
232  // normalize "per-track" plots
233  Normalize(kAllG);
234 
235  // make plots vs. event group
236  if (!fTracksOtherDCMRatio.size()) return;
237  std::map<unsigned int, std::map<unsigned int, float> >::iterator
238  iter=fTracksOtherDCMRatio.begin();
239  std::map<unsigned int, std::map<unsigned int, float> >::iterator
241  end--;
242 
243  float bgroup=(float) iter->first;
244  float fgroup=(float) end->first;
245 
246  TProfile* hratioall=
247  tfs->make<TProfile>("HRatioOtherDCM_All",
248  "Ratio of Hits on other DCMs vs. event, All DCMs",
249  fTracksOtherDCMRatio.size()+1,bgroup-.5,fgroup+.5,"S");
250 
251  std::map<unsigned int, TProfile*> eventPlots; // per-dcm
252 
253  // loop over entries - corresponding to event groups
254  for (; iter!=fTracksOtherDCMRatio.end(); iter++) {
255 
256  float event=(float) iter->first;
257 
258  // loop over DCMs within each event group
259  std::map<unsigned int, float> gmap=iter->second;
260  std::map<unsigned int, float>::iterator siter=gmap.begin();
261  for(; siter!=gmap.end(); siter++) {
262  unsigned int key=siter->first;
263  unsigned int dib=DiBlock(key);
264  unsigned int ldc=LDCM(key);
265  float ratio=siter->second;
266 
267  if (eventPlots.find(key) == eventPlots.end() || !eventPlots[key]) {
268  eventPlots[key]=
269  tfs->make<TProfile>(Form("HRatioOtherDCM_%2.2d_%2.2d",dib,ldc),
270  Form("Ratio of Hits on other DCMs vs. event, %2.2d-%2.2d",dib,ldc),
271  fTracksOtherDCMRatio.size()+1,bgroup-.5,fgroup+.5,"S");
272  }
273  eventPlots[key]->Fill(event,ratio);
274  hratioall->Fill(event,ratio);
275  }
276  }
277 
278  } // end endRun
279 
281  {
282 
283  ResetEventGroup();
284 
285  // look for RawDigits. Don't continue if none
287  try {
288  evt.getByLabel(fRawDigitLabel,digs);
289  }
290  catch (...) {
291  mf::LogWarning("CPLTWarn") << "Failed to find a RawDigit, bail";
292  return ;
293  }
294 
297  /* -- until needed
298  // make "all hits" plots
299  for (unsigned int id=0; id<digs->size(); id++)
300  {
301  art::Ptr<rawdata::RawDigit> dig(digs,id);
302  unsigned int chan=dig->DaqChannel();
303 
304  // fill general plots
305  // need to use "offline" view, not online....
306  unsigned int plannum=daqchannelmap::DAQChannelMap::getPlaneGlobal(chan);
307  const geo::PlaneGeo* plane=geom->Plane(plannum);
308  unsigned int view=(unsigned int)plane->View();
309 
310 
311 
312 
313  }// digit id
314  */
315 
316  // look for Tracks. OK to return w/out error if none
318  try {
319  evt.getByLabel(fTrackLabel,tracks);
320  }
321  catch (...) {
322  return ;
323  }
324 
325  // can it exist but have zero size?
326  if (!tracks->size()) {
327  return;
328  }
329 
330  // get the CellHits, so we can find RawHits on tracks
332  try {
333  evt.getByLabel(fCellHitLabel,cells);
334  }
335  catch (...) {
336  mf::LogError("CPLTWarn") << "\nFound Tracks but no CellHits!\n";
337  assert(0);
338  }
339 
340 
341 
342  for(unsigned int tr = 0; tr < tracks->size(); tr++)
343  {
344 
345  //count DCMs on the track
346  std::map<unsigned int, unsigned int> DCMsHit;
347 
348  art::Ptr<rb::Track> track(tracks,tr);
349 
350  bool track_ok=TrackOK(track);
351 
352  // keep track of start and end hit in each view
353  unsigned short cellx[2][2]={{9999,0},{9999,0}};
354  unsigned short planex[2][2]={{9999,0},{9999,0}};
355 
356  // loop over CellHits on tracks
357  for (unsigned int ic=0; ic<track->NCell(); ic++)
358  {
359  art::Ptr<rb::CellHit> cell=track->Cell(ic);
360  const unsigned int chan = cell->DaqChannel();
361  const daqchannelmap::lchan logchan = cmap->Map()->encodeLChan(chan);
362  const unsigned int dib = cmap->Map()->getDiBlock(chan);
363  const unsigned int ldc = cmap->Map()->getDCM(chan);
364  DCMsHit[DcmKey(dib,ldc)]++;
365 
366 
367  const unsigned int plannum = cmap->Map()->getPlane(logchan);
368  if (plannum!=cell->Plane()) {
369  std::cout<<"Why is plane from CellHit != plane from chan???"<<std::endl;
370  assert(0);
371  }
372 
373  unsigned int cellnum=(unsigned int) cell->Cell();
374 
375  const geo::PlaneGeo* plane=geom->Plane(plannum);
376  unsigned int view=(unsigned int)plane->View();
377 
378  if (plannum<planex[view][0]) {
379  cellx[view][0]=cellnum;
380  planex[view][0]=plannum;
381  }
382  if (plannum>planex[view][1]) {
383  cellx[view][1]=cellnum;
384  planex[view][1]=plannum;
385  }
386 
387 
388  }//cell
389 
390  //count, for each DCM, hits on the track in all others
391  std::map<unsigned int, unsigned int>::iterator iter=DCMsHit.begin();
392  for (; iter!=DCMsHit.end(); iter++) {
393  unsigned int dcmkey=iter->first;
394  float otherdcmhits=0;
395  float otherdcm=0;
396  std::map<unsigned int, unsigned int>::iterator oter=DCMsHit.begin();
397  for (; oter!=DCMsHit.end(); oter++) {
398  unsigned int otherdcmkey=oter->first;
399  if (otherdcmkey==dcmkey) continue;
400  otherdcmhits+=(float)oter->second;
401  otherdcm++;
402  } //other DCMs
403 
404  float thisdcmhits=(float) iter->second;
405  float ratioOtherToThis=otherdcmhits/thisdcmhits;
406  if (thisdcmhits>fMinTrackHitDCM) {
407  for (unsigned int cut=kAll; cut<kNumLevel; cut++) {
408  // plot all tracks for cut=0, only good ones for cut=1
409  if (cut==1&&!track_ok) continue;
410 
411  unsigned int dib=DiBlock(dcmkey);
412  unsigned int ldc=LDCM(dcmkey);
413 
414  //igrp=0 for all events, igrp=1 for group of events
415  for (unsigned int igrp=0; igrp<2; igrp++) {
416  fHTracksDCM[igrp][cut]->Fill(dib,ldc);
417  fHTracksDCMHits[igrp][cut]->Fill(dib,ldc,thisdcmhits);
418  fHTracksOtherDCMs[igrp][cut]->Fill(dib,ldc,otherdcm);
419  fHTracksOtherDCMHits[igrp][cut]->Fill(dib,ldc,otherdcmhits);
420  fHTracksOtherDCMRatio[igrp][cut]->Fill(dib,ldc,ratioOtherToThis);
421  }
422  for (unsigned int iend=0; iend<2; iend++)
423  for (unsigned int iv=geo::kX; iv<geo::kXorY; iv++)
424  fHTrackEnd[iv][cut]->Fill(planex[iv][iend],cellx[iv][iend]);
425  } // cut
426  }//min hits on this DCM
427 
428  } // "this" DCM
429 
430  } // tracks
431 
432  FinishEventGroup((unsigned int) evt.id().event());
433 
434  }//ana
435 
437  {
438  //some histos to monitor the cuts
439  fHExtentPlaneTrk[kAll]->Fill(track->ExtentPlane());
440  fHNCellTrk[kAll]->Fill(track->NCell());
441  fHNCellViewTrk[geo::kX][kAll]->Fill(track->NXCell());
442  fHNCellViewTrk[geo::kY][kAll]->Fill(track->NYCell());
443 
444  // and some others
445  fHTrkCellXMinusY[kAll]->Fill(track->NXCell()-track->NYCell());
446 
447  // enough planes (extent)
448  if (track->ExtentPlane() < fMinPlaneTrack) return false;
449 
450  // enough cells
451  if (track->NCell() < fMinCellTrack) return false;
452 
453  // enough cells in each view
454  if (track->NXCell() < fMinCellTrackView ||
455  track->NYCell() < fMinCellTrackView ) return false;
456 
457  fHExtentPlaneTrk[kPass]->Fill(track->ExtentPlane());
458  fHNCellTrk[kPass]->Fill(track->NCell());
459  fHNCellViewTrk[geo::kX][kPass]->Fill(track->NXCell());
460  fHNCellViewTrk[geo::kY][kPass]->Fill(track->NYCell());
461  fHTrkCellXMinusY[kPass]->Fill(track->NXCell()-track->NYCell());
462  return true;
463  }
464 
465 
467  {
468  fCallNumber++;
469  if (fCallNumber) return; // don't do anything if not a new group
470 
471  for (unsigned int cut=kAll; cut<kNumLevel; cut++) {
472  fHTracksDCM[kEvent][cut]->Reset();
473  fHTracksDCMHits[kEvent][cut]->Reset();
474  fHTracksOtherDCMs[kEvent][cut]->Reset();
475  fHTracksOtherDCMHits[kEvent][cut]->Reset();
476  fHTracksOtherDCMRatio[kEvent][cut]->Reset();
477  }
478  }
479 
480 
481  void TrackPlots::FinishEventGroup(unsigned int event)
482  {
483 
484  if (fCallNumber<fEventGroup) return; // don't do anything until group
485  // is finished...
486  fCallNumber=-1; //ensure ResetEventGroup at next call
487  /*
488  if (fTracksOtherDCMRatio.size()==0) {
489  fTracksOtherDCMRatio=std::map<unsigned int, std::map<unsigned int, float> > ();
490  }
491 
492  */
493 
494 
495  // first, add the group histograms to the total
496  for (unsigned int cut=kPass; cut<kNumLevel; cut++) {
502  }
503 
504  // normalize the group-wise plots
505  Normalize(kEvent);
506 
507  // fill map of ratio, per event group, per dcm
509  for (unsigned int dib=1; dib<=(unsigned int) hist->GetXaxis()->GetNbins(); dib++)
510  {
511  for (unsigned int ldc=1; ldc<=(unsigned int) hist->GetYaxis()->GetNbins(); ldc++)
512  {
513  // not sure this is needed... was having segv's, but not sure it was due to this.
514  std::map<unsigned int, std::map<unsigned int, float> >::iterator find=
515  fTracksOtherDCMRatio.find(event);
516  std::map<unsigned int, std::map<unsigned int, float> >::iterator end=fTracksOtherDCMRatio.end();
517  if (find==end) {
518  std::map<unsigned int, float> amap=std::map<unsigned int, float> ();
519  fTracksOtherDCMRatio[event]=amap;
520  }
521  fTracksOtherDCMRatio[event][DcmKey(dib,ldc)]=
522  hist->GetBinContent(dib,ldc);
523  }
524  }
525  }
526 
527 
528  void TrackPlots::Normalize(unsigned int igrp)
529  {
530  for (unsigned int cut=kAll; cut<kNumLevel; cut++) {
531  fHTracksDCMHits[igrp][cut]->Divide(fHTracksDCM[igrp][cut]);
532  fHTracksOtherDCMs[igrp][cut]->Divide(fHTracksDCM[igrp][cut]);
533  fHTracksOtherDCMHits[igrp][cut]->Divide(fHTracksDCM[igrp][cut]);
534  fHTracksOtherDCMRatio[igrp][cut]->Divide(fHTracksDCM[igrp][cut]);
535  }
536  }
537 } //namespace dprf
538 
539 ////////////////////////////////////////////////////////////////////////
540 namespace dprf
541 {
543 }
TH2F * fHTracksDCMHits[kNumGroup][kNumLevel]
Number of hits per track on DCM.
TH1F * fHTrkCellXMinusY[kNumLevel]
difference in cells per view
const unsigned int fMinCellTrackView
track cuts
TH1F * fHNCellTrk[kNumLevel]
plots of raw digits
std::map< unsigned int, std::map< unsigned int, float > > fTracksOtherDCMRatio
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
unsigned int LDCM(unsigned int key)
const std::string fTrackLabel
module names
TH1F * fHNCellViewTrk[geo::kXorY][kNumLevel]
plots of raw digits
X or Y views.
Definition: PlaneGeo.h:30
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
unsigned short Plane() const
Definition: CellHit.h:39
enum dprf::TrackPlots::_cutlevel Cuts_t
const char * p
Definition: xmltok.h:285
TH1 * ratio(TH1 *h1, TH1 *h2)
Vertical planes which measure X.
Definition: PlaneGeo.h:28
unsigned int Ncells() const
Number of cells in this plane.
Definition: PlaneGeo.h:43
Definition: event.h:19
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
TH2F * fHTracksOtherDCMHits[kNumGroup][kNumLevel]
Number of hits on other DCMs with hits on track.
const PlaneGeo * Plane(unsigned int i) const
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
DEFINE_ART_MODULE(TestTMapFile)
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
TrackPlots(fhicl::ParameterSet const &p)
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
Definition: Run.h:31
const std::string fRawDigitLabel
const unsigned int fMinPlaneTrack
std::map< unsigned int, ViewH > fHBookedChanCP
map of booked channels in cell-plane, vs group
unsigned short Cell() const
Definition: CellHit.h:40
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:53
uint32_t DaqChannel() const
Definition: RawDigit.h:85
if(dump)
TH2F * fHTrackEnd[geo::kXorY][kNumLevel]
(Cell,Plane) for endpoints
correl_yv Fill(-(dy[iP-1][iC-1]), hyv->GetBinContent(iP, iC))
Prototype Near Detector on the surface at FNAL.
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
Geometry information for a single readout plane.
Definition: PlaneGeo.h:36
int evt
const std::string fCellHitLabel
Near Detector in the NuMI cavern.
const unsigned int fMinCellTrack
unsigned int DcmKey(unsigned int dib, unsigned int ldc)
unsigned int fCallNumber
keep track number of calls, for defining event groups
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
unsigned int DiBlock(unsigned int key)
Definition: run.py:1
TH2F * fHTracksDCM[kNumGroup][kNumLevel]
DCMs with hits on tracks.
OStream cout
Definition: OStream.cxx:6
void beginRun(const art::Run &run)
unsigned int NYCell() const
Number of cells in the y-view.
Definition: Cluster.h:108
EventNumber_t event() const
Definition: EventID.h:116
bool TrackOK(art::Ptr< rb::Track >)
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
Definition: Cluster.cxx:145
enum dprf::TrackPlots::_groups Groups_t
const Cut cut
Definition: exporter_fd.C:30
T * make(ARGS...args) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
const unsigned int fEventGroup
Number of events per group.
TH2F * fHTracksOtherDCMRatio[kNumGroup][kNumLevel]
Ratio of hits on track on DCM to hits on track on all other DCMs.
const unsigned int fMinTrackHitDCM
minimum number of hits on a track in a DCM to use it for comparision to other DCMs ...
unsigned int NXCell() const
Number of cells in the x-view.
Definition: Cluster.h:106
TH1F * fHExtentPlaneTrk[kNumLevel]
plots of raw digits
const std::set< unsigned int > & GetPlanesByView(View_t v=kXorY) const
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void geom(int which=0)
Definition: geom.C:163
unsigned int ExtentPlane(geo::View_t view=geo::kXorY) const
Definition: Cluster.h:250
plane_t getPlane(lchan logicalchan) const
Decode the plane number from an lchan.
TH2F * fHTracksOtherDCMs[kNumGroup][kNumLevel]
Number of other DCMs with hits on track.
assert(nhit_max >=nhit_nbins)
dcm_id_t getDCM(dchan daqchan) const
Decode the dcm ID from a dchan.
unsigned int NPlanes() const
Float_t track
Definition: plot.C:35
void Normalize(unsigned int)
diblock_t getDiBlock(dchan daqchan) const
Decode the diblock ID from a dchan.
EventID id() const
Definition: Event.h:56
void FinishEventGroup(unsigned int)
Encapsulate the geometry of one entire detector (near, far, ndos)
virtual void analyze(art::Event const &)
enum BeamMode string