Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
comi::Leana Class Reference

Analysis module for low energy events and noise. More...

Inheritance diagram for comi::Leana:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 Leana (fhicl::ParameterSet const &pset)
 
virtual ~Leana ()
 
void beginJob ()
 
void analyze (art::Event const &evt)
 
void reconfigure (const fhicl::ParameterSet &p)
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Member Functions

void Ana1Hit (unsigned int iwin)
 
void AnaNHit (unsigned int iwin)
 
void MuonCandidate (unsigned int iwin, unsigned int sz, unsigned int nx, unsigned int ny)
 
void FindClosestMuon (unsigned int i, double x, double y, double z, double t, double *dstop, double *tstop, unsigned int *istop, double *dperp, double *tperp, unsigned int *iperp, bool assn=true)
 
void DumpMuon (unsigned int i)
 
void DumpMuonTable ()
 
void DumpMichel (unsigned int i)
 
bool IsPointOnEdge (double x, double y, double z)
 

Private Attributes

TH1D * fEventCount
 Event counter. More...
 
TH1D * fSliceSz
 Histogram of Nhit per slice. More...
 
TH2D * fSliceSzVsEvent
 Histogram of slice size vs. event. More...
 
TH1D * f1HitADC
 ADC spectrum for 1 hit slices. More...
 
TH1D * f1HitTDC
 TDC spectrum for 1 hit slices. More...
 
TH2D * f1HitADCvsTDC
 ADC vs TDC for 1 hit slices. More...
 
TH1D * f2HitDplane
 Distance from first to last plane. More...
 
TH1D * f3HitDplane
 Distance from first to last plane. More...
 
TH1D * f3HitSamePlaneDcell
 Max-min cell in same plane. More...
 
TH1D * f3HitDiffPlaneDcell
 Max-min cell in different planes. More...
 
LeanaNtfNt
 Ntuple for hit clusters. More...
 
TTree * fNtTree
 Ntuple for hit clusters. More...
 
std::vector< art::Ptr< rawdata::RawDigit > > fDigi
 
std::vector< util::RawSlicefWin
 The raw slices for this event. More...
 
double fT0
 Event NOvA trigger time (usec) More...
 
bool fDoFill
 Should we be filling ntuple / histogram? More...
 
unsigned int fMuIndx1
 Current muon list. More...
 
unsigned int fMuIndx2
 Old non-associated muons. More...
 
std::vector< MuonCandfMuon [MUON_BUFF_SZ]
 Table of muon data. More...
 
int fDumpMichel
 Dump table of Michel electrons? More...
 
double fTimeWindow
 [usec] Time window size More...
 
unsigned int fNhit
 Number of hits req'd in window. More...
 
unsigned int fNhitX
 Number of hits req'd in x view. More...
 
unsigned int fNhitY
 Number of hits req'd in y view. More...
 
int fDcellCut
 Allowed gap between hit cells. More...
 
int fDplaneCut
 Allowed gap between hit planes. More...
 
unsigned int fMuonNhit
 Required # hits on muon track. More...
 
unsigned int fMuonNhitX
 

required in x view

More...
 
unsigned int fMuonNhitY
 

required in y view

More...
 
double fEdgeBuffer
 [cm] Edge distance for stopping/entering decision More...
 
double fDeltaTnamu
 Time for non-association (s) More...
 

Static Private Attributes

static const unsigned int MUON_BUFF_SZ = 4096
 
static const char kNotMu = 0
 Not a good muon candidate. More...
 
static const char kStopMu = 1
 A stopping muon candidate. More...
 
static const char kThruMu = 2
 A through-going muon candidate. More...
 

Detailed Description

Analysis module for low energy events and noise.

Definition at line 49 of file Leana_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

comi::Leana::Leana ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 147 of file Leana_module.cc.

References reconfigure().

147  :
148  EDAnalyzer(p),
149  fDoFill(true),
150  fMuIndx1(0),
151  fMuIndx2(0)
152  {
153  this->reconfigure(p);
154  }
bool fDoFill
Should we be filling ntuple / histogram?
const char * p
Definition: xmltok.h:285
unsigned int fMuIndx2
Old non-associated muons.
void reconfigure(const fhicl::ParameterSet &p)
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
unsigned int fMuIndx1
Current muon list.
comi::Leana::~Leana ( )
virtual

Definition at line 216 of file Leana_module.cc.

216 { }

Member Function Documentation

void comi::Leana::Ana1Hit ( unsigned int  iwin)
private

Definition at line 404 of file Leana_module.cc.

References f1HitADC, f1HitADCvsTDC, f1HitTDC, fDigi, fDoFill, fWin, MECModelEnuComparisons::i, comi::kUSEC_PER_TDC, and confusionMatrixTree::t.

Referenced by analyze().

405  {
406  unsigned int i = fWin[iwin].first;
407 
408  double t = fDigi[i]->TDC()*kUSEC_PER_TDC;
409  double q = fDigi[i]->ADC();
410 
411  if (fDoFill) f1HitADC->Fill(q);
412  if (fDoFill) f1HitTDC->Fill(t);
413  if (fDoFill) f1HitADCvsTDC->Fill(t,q);
414  }
TH1D * f1HitADC
ADC spectrum for 1 hit slices.
Definition: Leana_module.cc:87
bool fDoFill
Should we be filling ntuple / histogram?
TH2D * f1HitADCvsTDC
ADC vs TDC for 1 hit slices.
Definition: Leana_module.cc:89
TH1D * f1HitTDC
TDC spectrum for 1 hit slices.
Definition: Leana_module.cc:88
std::vector< util::RawSlice > fWin
The raw slices for this event.
static const double kUSEC_PER_TDC
std::vector< art::Ptr< rawdata::RawDigit > > fDigi
void comi::Leana::analyze ( art::Event const &  evt)
virtual

Implements art::EDAnalyzer.

Definition at line 220 of file Leana_module.cc.

References Ana1Hit(), AnaNHit(), chaninfo::BadChanList::Apply(), util::CountXY(), art::EventID::event(), comi::LeanaNt::evt, stan::math::fabs(), fDeltaTnamu, fDigi, fDoFill, fEventCount, fMuIndx1, fMuIndx2, fMuon, fNhit, fNhitX, fNhitY, fNt, fSliceSz, fSliceSzVsEvent, fT0, fTimeWindow, fWin, art::DataViewImpl::getByLabel(), MECModelEnuComparisons::i, art::Event::id(), comi::LeanaNt::iwin, kNotMu, comi::kUSEC_PER_TDC, MUON_BUFF_SZ, MuonCandidate(), comi::LeanaNt::nx, comi::LeanaNt::ny, comi::LeanaNt::run, art::Event::run(), moon_position_table_new3::second, comi::LeanaNt::subrun, art::Event::subRun(), rawdata::RawTrigger::TDCT0(), util::TimeSlice(), and util::TimeSort().

221  {
222  unsigned int i;
223  unsigned int fMaxSz = 10;
224 
225  fNt->run = evt.run();
226  fNt->subrun = evt.subRun();
227  fNt->evt = evt.id().event();
228 
229  //
230  // Get trigger and t0 data from the raw trigger information
231  //
233  evt.getByLabel("daq", trigv);
234  const rawdata::RawTrigger& trig = (*trigv)[0];
235  fT0 = trig.TDCT0()*kUSEC_PER_TDC;
236 
237  //
238  // Pull out the raw digits from the event
239  //
241  evt.getByLabel("daq", digidummy);
242 
243  //
244  // Shuffle the data into a vector we can manipulate
245  //
246  fDigi.clear();
247  for (i=0; i<digidummy->size(); ++i) {
248  fDigi.push_back(art::Ptr<rawdata::RawDigit>(digidummy, i));
249  }
251  badc->Apply(fDigi);
252  if (fDigi.size()==0) return;
253 
254  if (fDoFill) fEventCount->Fill(0.0);
255 
256  //
257  // Time sort and slice hits into windows
258  //
259  fWin.clear();
261  unsigned int tdcwin = rint(fTimeWindow*kTDC_PER_USEC);
263  if (fWin.size()<1) return;
264 
265  //
266  // Clear the muon table
267  //
268  fMuon[fMuIndx1].resize(fWin.size());
269  for (i=0; i<fWin.size(); ++i) {
270  fMuon[fMuIndx1][i].fId = kNotMu;
271  fMuon[fMuIndx1][i].fNOvAT = fT0;
272  fMuon[fMuIndx1][i].fT = 0.0;
273  }
274 
275  //
276  // Analyze the activity in each window in turn
277  //
278  for (i=0; i<fWin.size(); ++i) {
279  unsigned int sz = fWin[i].second-fWin[i].first+1;
280  unsigned int nx = 0;
281  unsigned int ny = 0;
282  util::CountXY(fDigi, fWin[i].first, fWin[i].second, &nx, &ny);
283 
284  fNt->iwin = i;
285  fNt->nx = nx;
286  fNt->ny = ny;
287 
288  if (fDoFill) fSliceSz->Fill(sz);
289  if (fDoFill) fSliceSzVsEvent->Fill(evt.id().event(), sz);
290 
291  // Analyze the small events
292  if (sz==1) this->Ana1Hit(i);
293  if (sz>1 && sz<=fMaxSz) this->AnaNHit(i);
294 
295  // Check if this activity is a muon
296  this->MuonCandidate(i, sz, nx, ny);
297  }
298 
299  // this->DumpMuonTable();
300 
301  //
302  // Compute the time between the muons at fMuIndx1 and fMuIndx2 in
303  // units of seconds
304  //
305  double tnassn = fabs(fMuon[fMuIndx2][0].fNOvAT -
306  fMuon[fMuIndx1][0].fNOvAT)/1.E6;
307  //
308  // Advance the muon indicies. The "current" entry (fMuIndx1) always
309  // advances. The secondary index (fMuIndx2) only advances if enough
310  // time have elapsed since the muon at the current index
311  //
313  if (tnassn>fDeltaTnamu) {
315  //
316  // Now that we have the data we need to compute backgrounds, we
317  // can start filling histograms.
318  //
319  fDoFill = true;
320  }
321  }
unsigned int fNhitX
Number of hits req&#39;d in x view.
bool fDoFill
Should we be filling ntuple / histogram?
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
int run
run number
Definition: LeanaNt.h:14
LeanaNt * fNt
Ntuple for hit clusters.
Definition: Leana_module.cc:97
static const unsigned int MUON_BUFF_SZ
int ny
number of hits in y view
Definition: LeanaNt.h:19
TH1D * fEventCount
Event counter.
Definition: Leana_module.cc:83
int nx
number of hits in x view
Definition: LeanaNt.h:18
double fT0
Event NOvA trigger time (usec)
unsigned int fMuIndx2
Old non-associated muons.
void CountXY(const std::vector< art::Ptr< rawdata::RawDigit > > &d, unsigned int i1, unsigned int i2, unsigned int *nx, unsigned int *ny)
Count the number of digits in each detector view.
Definition: RawUtil.cxx:38
TH2D * fSliceSzVsEvent
Histogram of slice size vs. event.
Definition: Leana_module.cc:85
int evt
void TimeSlice(const std::vector< art::Ptr< rawdata::RawDigit > > &d, unsigned int dt_tdc, unsigned int nhit, unsigned int nhitx, unsigned int nhity, std::vector< RawSlice > &slice)
Find windows in time that have significant activity in the detector.
Definition: RawUtil.cxx:111
unsigned int fNhitY
Number of hits req&#39;d in y view.
unsigned int fNhit
Number of hits req&#39;d in window.
void AnaNHit(unsigned int iwin)
double fDeltaTnamu
Time for non-association (s)
TH1D * fSliceSz
Histogram of Nhit per slice.
Definition: Leana_module.cc:84
std::vector< util::RawSlice > fWin
The raw slices for this event.
int subrun
subrun number
Definition: LeanaNt.h:15
void MuonCandidate(unsigned int iwin, unsigned int sz, unsigned int nx, unsigned int ny)
static const int kTDC_PER_USEC
Definition: Cana_module.cc:87
void Ana1Hit(unsigned int iwin)
double fTimeWindow
[usec] Time window size
int Apply(art::PtrVector< rawdata::RawDigit > &rd)
static const double kUSEC_PER_TDC
std::vector< art::Ptr< rawdata::RawDigit > > fDigi
int iwin
timing window number inside event
Definition: LeanaNt.h:17
static const char kNotMu
Not a good muon candidate.
unsigned long long TDCT0() const
Return just the lower 32 bits of the timing marker. This is the reference "t0" for the RawDigit TDC c...
Definition: RawTrigger.cxx:44
void TimeSort(std::vector< art::Ptr< rawdata::RawDigit > > &d)
Arrange the list of raw hits in time order (early to late)
Definition: RawUtil.cxx:31
unsigned int fMuIndx1
Current muon list.
Definition: fwd.h:28
std::vector< MuonCand > fMuon[MUON_BUFF_SZ]
Table of muon data.
int evt
event number
Definition: LeanaNt.h:16
void comi::Leana::AnaNHit ( unsigned int  iwin)
private

Definition at line 418 of file Leana_module.cc.

References abs(), plot_validation_datamc::c, demo5::c1, demo5::c2, geo::GeometryBase::CellInfo(), visualisationForPaperMasterPlot::cmap, comi::LeanaNt::compx, comi::LeanaNt::compy, comi::LeanaNt::dcellx, comi::LeanaNt::dcelly, comi::LeanaNt::dperp, comi::LeanaNt::dperpna, comi::LeanaNt::dplanex, comi::LeanaNt::dplaney, comi::LeanaNt::dstop, comi::LeanaNt::dstopna, DumpMichel(), fDcellCut, fDigi, fDoFill, fDplaneCut, fDumpMichel, FindClosestMuon(), check_time_usage::float, fNt, fNtTree, fWin, geom(), cmap::dataprov::CMap::GetCell(), cmap::dataprov::CMap::GetPlane(), MECModelEnuComparisons::i, comi::LeanaNt::iwin, comi::kUSEC_PER_TDC, geo::kX, geo::kY, comi::LeanaNt::nx, comi::LeanaNt::ny, plot_validation_datamc::p1, plot_validation_datamc::p2, geo::GeometryBase::Plane(), comi::LeanaNt::qx, comi::LeanaNt::qy, comi::LeanaNt::t, confusionMatrixTree::t, comi::LeanaNt::tperp, comi::LeanaNt::tperpna, comi::LeanaNt::tstop, fillBadChanDBTables::tstop, comi::LeanaNt::tstopna, registry_explorer::v, geo::PlaneGeo::View(), comi::LeanaNt::x, submit_syst::x, comi::LeanaNt::y, submit_syst::y, comi::LeanaNt::z, and test::z.

Referenced by analyze().

419  {
420  unsigned int i;
421 
424 
425  unsigned int i1 = fWin[iwin].first;
426  unsigned int i2 = fWin[iwin].second;
427  unsigned int j1, j2;
428  //
429  // Look for the smallest gap between each hit and its neighbors in
430  // terms of cell and plane numbers. Flag isolated hits as bad.
431  //
432  static const int kUNINIT = 999999;
433  std::vector<bool> goodhit(i2+1);
434  for (j1=i1; j1<=i2; ++j1) {
435  int dcell = kUNINIT; // distance to closest cell
436  int dplane = kUNINIT; // distance to closest plane
437 
438  int p1 = cmap->GetPlane(fDigi[j1].get());
439  int c1 = cmap->GetCell (fDigi[j1].get());
440  int v1 = geom->Plane(p1)->View();
441 
442  for (j2=i1; j2<=i2; ++j2) {
443  if (j1==j2) continue;
444 
445  int p2 = cmap->GetPlane(fDigi[j2].get());
446  int c2 = cmap->GetCell (fDigi[j2].get());
447  int v2 = geom->Plane(p2)->View();
448 
449  if (v1==v2) {
450  if (abs(c2-c1)<dcell) dcell = abs(c2-c1);
451  }
452  if (abs(p2-p1)<dplane) dplane = abs(p2-p1);
453  }
454  //
455  // If dcell and dplane are still uninitialized, its because there
456  // is only one hit in this view. Reset the values to 0.
457  //
458  if (dcell == kUNINIT) dcell = 0;
459  if (dplane == kUNINIT) dplane = 0;
460 
461  if (dcell<=fDcellCut && dplane<=fDplaneCut) goodhit[j1] = true;
462  else goodhit[j1] = false;
463  }
464 
465  int nx = 0;
466  int ny = 0;
467  int c1x = 999999, c2x = -999999;
468  int c1y = 999999, c2y = -999999;
469  int p1x = 999999, p2x = -999999;
470  int p1y = 999999, p2y = -999999;
471  double x=0, y=0, z=0, t=0;
472  double qx=0, qy=0;
473  double xyz[3];
474  for (i=i1; i<=i2; ++i) {
475  if (goodhit[i]==false) continue;
476 
477  int p = cmap->GetPlane(fDigi[i].get());
478  int c = cmap->GetCell (fDigi[i].get());
479 
480  geo::View_t v;
481  geom->CellInfo(p, c, &v, xyz);
482 
483  if (v==geo::kX) {
484  ++nx;
485  x += xyz[0];
486  qx += fDigi[i]->ADC();
487  if (c<c1x) c1x = c;
488  if (p<p1x) p1x = p;
489  if (c>c2x) c2x = c;
490  if (p>p2x) p2x = p;
491  }
492  if (v==geo::kY) {
493  ++ny;
494  y += xyz[1];
495  qy += fDigi[i]->ADC();
496  if (c<c1y) c1y = c;
497  if (p<p1y) p1y = p;
498  if (c>c2y) c2y = c;
499  if (p>p2y) p2y = p;
500  }
501  z += xyz[2];
502  t += fDigi[i]->TDC()*kUSEC_PER_TDC;
503  }
504  //
505  // Require at least one good hit in each view
506  //
507  if (nx<1 || ny<1) return;
508 
509  fNt->iwin = iwin;
510  fNt->nx = nx;
511  fNt->ny = ny;
512  fNt->x = x = x/(float)nx;
513  fNt->y = y = y/(float)ny;
514  fNt->z = z = z/(float)(nx+ny);
515  fNt->t = t = t/(float)(nx+ny);
516  fNt->qx = qx;
517  fNt->qy = qy;
518 
519  fNt->dcellx = c2x-c1x;
520  fNt->dcelly = c2y-c1y;
521  fNt->dplanex = p2x-p1x;
522  fNt->dplaney = p2y-p1y;
523 
524  fNt->compx = (float)nx/(float)((fNt->dcellx+1)*(fNt->dplanex+1));
525  fNt->compy = (float)ny/(float)((fNt->dcelly+1)*(fNt->dplaney+1));
526 
527  //
528  // Find the closest muon to this cluster
529  //
530  double dstop, tstop; // Distance and time to stop muon end point
531  double dperp, tperp; // Distance and time to muon track
532  unsigned int istop, iperp; // Indicies of matched muons
533  this->FindClosestMuon(iwin,
534  x, y, z, t,
535  &dstop, &tstop, &istop,
536  &dperp, &tperp, &iperp);
537  fNt->dstop = dstop;
538  fNt->tstop = tstop;
539  fNt->dperp = dperp;
540  fNt->tperp = tperp;
541 
542  //
543  // Find the closest muon to this cluster in an unassociated event
544  //
545  unsigned int istopna, iperpna;
546  this->FindClosestMuon(iwin,
547  x, y, z, t,
548  &dstop, &tstop, &istopna,
549  &dperp, &tperp, &iperpna,
550  false);
551  fNt->dstopna = dstop;
552  fNt->tstopna = tstop;
553  fNt->dperpna = dperp;
554  fNt->tperpna = tperp;
555 
556  if (fDoFill) fNtTree->Fill();
557 
558  //
559  // Check if this is a Michel candidate, if yes, print it to a log
560  // file
561  //
562  if (fDumpMichel==1) {
563  bool ismichel = true;
564  if ( fNt->dplanex>=(fNt->nx+fNt->ny) ) ismichel = false;
565  if ( fNt->dplaney>=(fNt->nx+fNt->ny) ) ismichel = false;
566  if ( fNt->dcellx >=(fNt->nx+fNt->ny) ) ismichel = false;
567  if ( fNt->dcelly >=(fNt->nx+fNt->ny) ) ismichel = false;
568  if ( 4*fNt->nx <= (fNt->nx+fNt->ny) ) ismichel = false;
569  if ( 4*fNt->ny <= (fNt->nx+fNt->ny) ) ismichel = false;
570  if ( fNt->dstop > 30.0 ) ismichel = false;
571  if ( fNt->tstop > 10.0 ) ismichel = false;
572  if (ismichel) this->DumpMichel(istop);
573  }
574  }
void FindClosestMuon(unsigned int i, double x, double y, double z, double t, double *dstop, double *tstop, unsigned int *istop, double *dperp, double *tperp, unsigned int *iperp, bool assn=true)
float tstopna
time difference to muon stop point IDed above
Definition: LeanaNt.h:45
int dcellx
range of cells in x view
Definition: LeanaNt.h:20
int dplaney
range of cells in y view
Definition: LeanaNt.h:23
bool fDoFill
Should we be filling ntuple / histogram?
LeanaNt * fNt
Ntuple for hit clusters.
Definition: Leana_module.cc:97
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
int ny
number of hits in y view
Definition: LeanaNt.h:19
const char * p
Definition: xmltok.h:285
Vertical planes which measure X.
Definition: PlaneGeo.h:28
float dstop
minimum distance to a muon stop point
Definition: LeanaNt.h:35
void abs(TH1 *hist)
int fDumpMichel
Dump table of Michel electrons?
float tperpna
time difference to muon track IDed above
Definition: LeanaNt.h:42
float compy
"completeness" in y view
Definition: LeanaNt.h:25
const PlaneGeo * Plane(unsigned int i) const
int nx
number of hits in x view
Definition: LeanaNt.h:18
float tstop
time difference to muon stop point IDed above
Definition: LeanaNt.h:36
float tperp
time difference to muon track IDed above
Definition: LeanaNt.h:33
float z
location of collection (cm)
Definition: LeanaNt.h:28
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
void CellInfo(unsigned int ip, unsigned int ic, View_t *view=0, double *pos=0, double *dpos=0) const
float dperp
minimum perpendicular distance to a muon track
Definition: LeanaNt.h:32
c2
Definition: demo5.py:33
float dstopna
minimum distance to a muon stop point
Definition: LeanaNt.h:44
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:53
int dcelly
range of cells in y view
Definition: LeanaNt.h:21
float compx
"completeness" in x view
Definition: LeanaNt.h:24
unsigned short GetPlane(const rawdata::RawDigit *dig)
Definition: CMap.cxx:285
float y
location of collection (cm)
Definition: LeanaNt.h:27
z
Definition: test.py:28
std::vector< util::RawSlice > fWin
The raw slices for this event.
float x
location of collection (cm)
Definition: LeanaNt.h:26
void DumpMichel(unsigned int i)
int fDcellCut
Allowed gap between hit cells.
int dplanex
range of cells in x view
Definition: LeanaNt.h:22
float qy
charge of collection in y view (ADC)
Definition: LeanaNt.h:30
void geom(int which=0)
Definition: geom.C:163
static const double kUSEC_PER_TDC
TTree * fNtTree
Ntuple for hit clusters.
Definition: Leana_module.cc:98
std::vector< art::Ptr< rawdata::RawDigit > > fDigi
unsigned short GetCell(const rawdata::RawDigit *dig)
Definition: CMap.cxx:327
c1
Definition: demo5.py:24
int iwin
timing window number inside event
Definition: LeanaNt.h:17
float qx
charge of collection in x view (ADC)
Definition: LeanaNt.h:29
float t
time of collection (usec)
Definition: LeanaNt.h:31
float dperpna
minimum perpendicular distance to a muon track
Definition: LeanaNt.h:41
int fDplaneCut
Allowed gap between hit planes.
void comi::Leana::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 176 of file Leana_module.cc.

References MakeMiniprodValidationCuts::f, f1HitADC, f1HitADCvsTDC, f1HitTDC, f2HitDplane, f3HitDiffPlaneDcell, f3HitDplane, f3HitSamePlaneDcell, fEventCount, fNt, fNtTree, fSliceSz, fSliceSzVsEvent, H1, H2, and art::TFileDirectory::make().

177  {
178  //
179  // Some macros to make booking histograms a little easier
180  //
181 #define H1(NAME,LABEL,N,X1,X2) \
182  NAME = f->make<TH1D>(#NAME,LABEL,N,X1,X2)
183 
184 #define H2(NAME,LABEL,NX,X1,X2,NY,Y1,Y2) \
185  NAME = f->make<TH2D>(#NAME,LABEL,NX,X1,X2,NY,Y1,Y2)
186 
188  //
189  // General event-level histograms
190  //
191  H1(fEventCount, ";;Events Seen", 1, -0.5,0.5);
192  H1(fSliceSz, ";N_{hit};N_{slices}", 101, -0.5,100.5);
193  H2(fSliceSzVsEvent,";Event;N_{hit}", 100, 0.0,1000000,101,-0.5,100.5);
194 
195  //
196  // 1-hit slice histograms
197  //
198  H1(f1HitADC,";ADC;N_{hit}",4096,-0.5,4095.5);
199  H1(f1HitTDC,";t [#musec]; N_{hit}",700,-100,600);
200  H2(f1HitADCvsTDC,";t [#musec]; ADC",
201  700,-100,600,4096,-0.5,4095.5);
202 
203  H1(f2HitDplane,";#Delta_{plane}",51,-0.5,50.5);
204  H1(f3HitDplane,";#Delta_{plane}",51,-0.5,50.5);
205 
206  H1(f3HitSamePlaneDcell,";#Delta_{cell}",51,-0.5,50.5);
207  H1(f3HitDiffPlaneDcell,";#Delta_{cell}",51,-0.5,50.5);
208 
209  fNt = new LeanaNt;
210  fNtTree = f->make<TTree>("le","Leana Analysis Tree");
211  fNtTree->Branch("fLeanaNt","comi::LeanaNt",&fNt,1600,99);
212  }
TH1D * f3HitSamePlaneDcell
Max-min cell in same plane.
Definition: Leana_module.cc:94
TH1D * f1HitADC
ADC spectrum for 1 hit slices.
Definition: Leana_module.cc:87
#define H1(NAME, LABEL, N, X1, X2)
TH2D * f1HitADCvsTDC
ADC vs TDC for 1 hit slices.
Definition: Leana_module.cc:89
LeanaNt * fNt
Ntuple for hit clusters.
Definition: Leana_module.cc:97
#define H2(NAME, LABEL, NX, X1, X2, NY, Y1, Y2)
TH1D * fEventCount
Event counter.
Definition: Leana_module.cc:83
TH1D * f1HitTDC
TDC spectrum for 1 hit slices.
Definition: Leana_module.cc:88
TH2D * fSliceSzVsEvent
Histogram of slice size vs. event.
Definition: Leana_module.cc:85
TH1D * f2HitDplane
Distance from first to last plane.
Definition: Leana_module.cc:91
TH1D * fSliceSz
Histogram of Nhit per slice.
Definition: Leana_module.cc:84
T * make(ARGS...args) const
TH1D * f3HitDplane
Distance from first to last plane.
Definition: Leana_module.cc:92
TTree * fNtTree
Ntuple for hit clusters.
Definition: Leana_module.cc:98
TH1D * f3HitDiffPlaneDcell
Max-min cell in different planes.
Definition: Leana_module.cc:95
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDAnalyzer::currentContext ( ) const
protectedinherited
void comi::Leana::DumpMichel ( unsigned int  i)
private

Definition at line 374 of file Leana_module.cc.

References om::cout, comi::LeanaNt::dstop, DumpMuon(), allTimeWatchdog::endl, comi::LeanaNt::evt, fNt, comi::LeanaNt::nx, comi::LeanaNt::ny, comi::LeanaNt::run, comi::LeanaNt::subrun, comi::LeanaNt::t, comi::LeanaNt::tstop, comi::LeanaNt::x, comi::LeanaNt::y, and comi::LeanaNt::z.

Referenced by AnaNHit().

375  {
376  std::cout << "||"
377  << "==================================="
378  << "==================================="
379  << std::endl;
380  std::cout << fNt->run << "/"
381  << fNt->subrun << "/"
382  << fNt->evt
383  << " Michel Candidate"
384  << std::endl;
385 
386  std::cout << "(nx,ny)=("
387  << fNt->nx << ","
388  << fNt->ny << ") "
389  << "(x,y,z,t)="
390  << fNt->x << ","
391  << fNt->y << ","
392  << fNt->z << ","
393  << fNt->t << ") "
394  << " (dstop,tstop)=("
395  << fNt->dstop << ","
396  << fNt->tstop << ")"
397  << std::endl;
398 
399  this->DumpMuon(imu);
400  }
int run
run number
Definition: LeanaNt.h:14
LeanaNt * fNt
Ntuple for hit clusters.
Definition: Leana_module.cc:97
int ny
number of hits in y view
Definition: LeanaNt.h:19
float dstop
minimum distance to a muon stop point
Definition: LeanaNt.h:35
int nx
number of hits in x view
Definition: LeanaNt.h:18
float tstop
time difference to muon stop point IDed above
Definition: LeanaNt.h:36
float z
location of collection (cm)
Definition: LeanaNt.h:28
float y
location of collection (cm)
Definition: LeanaNt.h:27
float x
location of collection (cm)
Definition: LeanaNt.h:26
OStream cout
Definition: OStream.cxx:6
int subrun
subrun number
Definition: LeanaNt.h:15
void DumpMuon(unsigned int i)
float t
time of collection (usec)
Definition: LeanaNt.h:31
int evt
event number
Definition: LeanaNt.h:16
void comi::Leana::DumpMuon ( unsigned int  i)
private

Definition at line 325 of file Leana_module.cc.

References om::cout, allTimeWatchdog::endl, fMuIndx1, fMuon, MECModelEnuComparisons::i, kNotMu, kStopMu, kThruMu, util::pythag(), and gen_flatrecord::size.

Referenced by DumpMichel(), and DumpMuonTable().

326  {
327  std::cout << "[" << i << "] ";
328 
329  if (i>= fMuon[fMuIndx1].size()) {
330  std::cout << " not valid muon" << std::endl;
331  return;
332  }
333 
334  if (fMuon[fMuIndx1][i].fId == kNotMu) std::cout << " not-mu ";
335  if (fMuon[fMuIndx1][i].fId == kStopMu) std::cout << " stop-mu ";
336  if (fMuon[fMuIndx1][i].fId == kThruMu) std::cout << " thru-mu ";
337 
338  std::cout << " (x1,y1,z1)=("
339  << fMuon[fMuIndx1][i].fX1 << ","
340  << fMuon[fMuIndx1][i].fY1 << ","
341  << fMuon[fMuIndx1][i].fZ1 << ") ";
342 
343  std::cout << " (x2,y2,z2)=("
344  << fMuon[fMuIndx1][i].fX2 << ","
345  << fMuon[fMuIndx1][i].fY2 << ","
346  << fMuon[fMuIndx1][i].fZ2 << ") ";
347 
348  std::cout << " L=" <<
349  util::pythag((fMuon[fMuIndx1][i].fX1-fMuon[fMuIndx1][i].fX2),
350  (fMuon[fMuIndx1][i].fY1-fMuon[fMuIndx1][i].fY2),
351  (fMuon[fMuIndx1][i].fZ1-fMuon[fMuIndx1][i].fZ2));
352 
353  std::cout << " t=" << fMuon[fMuIndx1][i].fT << std::endl;
354  }
static const char kThruMu
A through-going muon candidate.
static const char kStopMu
A stopping muon candidate.
OStream cout
Definition: OStream.cxx:6
double pythag(double x, double y)
2D Euclidean distance
Definition: MathUtil.h:29
static const char kNotMu
Not a good muon candidate.
unsigned int fMuIndx1
Current muon list.
std::vector< MuonCand > fMuon[MUON_BUFF_SZ]
Table of muon data.
void comi::Leana::DumpMuonTable ( )
private

Definition at line 358 of file Leana_module.cc.

References om::cout, DumpMuon(), allTimeWatchdog::endl, fMuIndx1, fMuIndx2, fMuon, and MECModelEnuComparisons::i.

359  {
360  std::cout << "*= indx1=" << fMuIndx1
361  << " has " << fMuon[fMuIndx1].size() << " entries\n";
362 
363  for (unsigned int i=0; i<fMuon[fMuIndx1].size(); ++i) this->DumpMuon(i);
364 
365  std::cout << " indx2=" << fMuIndx2
366  << " has " << fMuon[fMuIndx2].size() << " entries\n";
367  std::cout << " " << fMuon[fMuIndx2][0].fNOvAT << "\t"
368  << fMuon[fMuIndx2][0].fT << std::endl;
369 
370  }
unsigned int fMuIndx2
Old non-associated muons.
OStream cout
Definition: OStream.cxx:6
void DumpMuon(unsigned int i)
unsigned int fMuIndx1
Current muon list.
std::vector< MuonCand > fMuon[MUON_BUFF_SZ]
Table of muon data.
void comi::Leana::FindClosestMuon ( unsigned int  i,
double  x,
double  y,
double  z,
double  t,
double *  dstop,
double *  tstop,
unsigned int istop,
double *  dperp,
double *  tperp,
unsigned int iperp,
bool  assn = true 
)
private

Definition at line 641 of file Leana_module.cc.

References geo::ClosestApproach(), fMuIndx1, fMuIndx2, fMuon, MECModelEnuComparisons::i, kNotMu, kStopMu, util::pythag(), submit_syst::x, and submit_syst::y.

Referenced by AnaNHit().

646  {
647  //
648  // Decide if we're looking for real associations (assn=true) or are
649  // looking for random coinicidences
650  //
651  unsigned int imu = 0;
652  if (assn==true) imu = fMuIndx1;
653  else imu = fMuIndx2;
654 
655  unsigned int i;
656  double dstop;
657  double dperp;
658  *dend = 9E99;
659  *tend = 9E99;
660  *dtrk = 9E99;
661  *ttrk = 9E99;
662  *istop = 999999;
663  *iperp = 999999;
664  for (i=0; i<fMuon[imu].size(); ++i) {
665  if (fMuon[imu][i].fId==kNotMu) continue;
666  if (fMuon[imu][i].fT>=t) continue;
667 
668  if (fMuon[imu][i].fId==kStopMu) {
669  //
670  // Find distance to stop mu end point
671  //
672  dstop =
673  util::pythag((x-fMuon[imu][i].fX2),
674  (y-fMuon[imu][i].fY2),
675  (z-fMuon[imu][i].fZ2));
676  if (dstop<*dend) {
677  *dend = dstop;
678  *tend = t-fMuon[imu][i].fT;
679  *istop = i;
680  }
681  }
682  //
683  // Find perpendicular distance to muon track
684  //
685  double point[3] = {x,y,z};
686  double icept[3] = { fMuon[imu][i].fX1,
687  fMuon[imu][i].fY1,
688  fMuon[imu][i].fZ1
689  };
690  double slope[3] = {
691  fMuon[imu][i].fX2 - fMuon[imu][i].fX1,
692  fMuon[imu][i].fY2 - fMuon[imu][i].fY1,
693  fMuon[imu][i].fZ2 - fMuon[imu][i].fZ1,
694  };
695  double closest[3] = {-999999.,-999999.,-999999.};
696  dperp = geo::ClosestApproach(point, icept, slope, closest);
697  //
698  // If the point happens outside the limits of the track, compute
699  // the distance to the track end points
700  //
701  if (closest[1]<fMuon[imu][i].fY2) {
702  dperp = util::pythag((x-fMuon[imu][i].fX2),
703  (y-fMuon[imu][i].fY2),
704  (z-fMuon[imu][i].fZ2));
705  }
706  if (closest[1]>fMuon[imu][i].fY1) {
707  dperp = util::pythag((x-fMuon[imu][i].fX1),
708  (y-fMuon[imu][i].fY1),
709  (z-fMuon[imu][i].fZ1));
710  }
711  if (dperp<*dtrk) {
712  *dtrk = dperp;
713  *ttrk = t-fMuon[imu][i].fT;
714  *iperp = i;
715  }
716  }
717  }
unsigned int fMuIndx2
Old non-associated muons.
static const char kStopMu
A stopping muon candidate.
z
Definition: test.py:28
double ClosestApproach(const double point[], const double intercept[], const double slopes[], double closest[])
Find the distance of closest approach between point and line.
Definition: Geo.cxx:222
double pythag(double x, double y)
2D Euclidean distance
Definition: MathUtil.h:29
static const char kNotMu
Not a good muon candidate.
unsigned int fMuIndx1
Current muon list.
std::vector< MuonCand > fMuon[MUON_BUFF_SZ]
Table of muon data.
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
bool comi::Leana::IsPointOnEdge ( double  x,
double  y,
double  z 
)
private
Todo:
Hardwired to the NDOS case...

Definition at line 721 of file Leana_module.cc.

References DEFINE_ART_MODULE(), geo::GeometryBase::DetHalfHeight(), geo::GeometryBase::DetHalfWidth(), stan::math::fabs(), fEdgeBuffer, and geom().

Referenced by MuonCandidate().

722  {
724 
725  if (y>geom->DetHalfHeight()-fEdgeBuffer) return true;
726  if (fabs(x)>geom->DetHalfWidth()-fEdgeBuffer) return true;
727  if (z<fEdgeBuffer) return true;
728  //
729  //! \todo Hardwired to the NDOS case...
730  //
731  if (z>810.0-fEdgeBuffer) return true;
732  // if (z>geom->DetLength()-fEdgeBuffer) return true;
733  return false;
734  }
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
double DetHalfHeight() const
z
Definition: test.py:28
double fEdgeBuffer
[cm] Edge distance for stopping/entering decision
double DetHalfWidth() const
void geom(int which=0)
Definition: geom.C:163
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
void comi::Leana::MuonCandidate ( unsigned int  iwin,
unsigned int  sz,
unsigned int  nx,
unsigned int  ny 
)
private

Definition at line 578 of file Leana_module.cc.

References trk::RLFit::AssumeDownGoing(), fDigi, trk::RLFit::Fit(), fMuIndx1, fMuon, fMuonNhit, fMuonNhitX, fMuonNhitY, fWin, trk::RLFit::fWx, trk::RLFit::fWy, trk::RLFit::fX1, trk::RLFit::fX2, trk::RLFit::fXhit, trk::RLFit::fY1, trk::RLFit::fY2, trk::RLFit::fYhit, trk::RLFit::fZ1, trk::RLFit::fZ2, geom(), MECModelEnuComparisons::i, IsPointOnEdge(), kNotMu, kStopMu, kThruMu, comi::kUSEC_PER_TDC, and moon_position_table_new3::second.

Referenced by analyze().

582  {
583  if (sz<fMuonNhit || nx<fMuonNhitX || ny<fMuonNhitY) {
584  fMuon[fMuIndx1][iwin].fId = kNotMu;
585  return;
586  }
587 
589 
590  trk::RLFit trkfit(fDigi, fWin[iwin].first, fWin[iwin].second);
591  trkfit.Fit();
592  trkfit.AssumeDownGoing();
593 
594  //
595  // Does this look like an entering track?
596  //
597  bool isentering = false;
598  if (this->IsPointOnEdge(trkfit.fX1,trkfit.fY1,trkfit.fZ1)) {
599  isentering = true;
600  }
601 
602  if (isentering==false) {
603  fMuon[fMuIndx1][iwin].fId = kNotMu;
604  return;
605  }
606 
607  fMuon[fMuIndx1][iwin].fX1 = trkfit.fX1;
608  fMuon[fMuIndx1][iwin].fY1 = trkfit.fY1;
609  fMuon[fMuIndx1][iwin].fZ1 = trkfit.fZ1;
610 
611  fMuon[fMuIndx1][iwin].fX2 = trkfit.fX2;
612  fMuon[fMuIndx1][iwin].fY2 = trkfit.fY2;
613  fMuon[fMuIndx1][iwin].fZ2 = trkfit.fZ2;
614 
615  bool isstopping = false;
616  if (this->IsPointOnEdge(trkfit.fX2,trkfit.fY2,trkfit.fZ2)==false) {
617  isstopping = true;
618  }
619 
620  if (isstopping) fMuon[fMuIndx1][iwin].fId = kStopMu;
621  else fMuon[fMuIndx1][iwin].fId = kThruMu;
622 
623  unsigned int i;
624  double sumt = 0.0;
625  double sumw = 0.0;
626  for (i=0; i<trkfit.fXhit.size(); ++i) {
627  sumw += trkfit.fWx[i];
628  sumt += trkfit.fWx[i]*trkfit.fXhit[i]->TDC()*kUSEC_PER_TDC;
629  }
630  for (i=0; i<trkfit.fYhit.size(); ++i) {
631  sumw += trkfit.fWy[i];
632  sumt += trkfit.fWy[i]*trkfit.fYhit[i]->TDC()*kUSEC_PER_TDC;
633  }
634 
635  fMuon[fMuIndx1][iwin].fNOvAT = sumt/sumw;
636  fMuon[fMuIndx1][iwin].fT = fMuon[fMuIndx1][iwin].fNOvAT;
637  }
unsigned int fMuonNhitY
required in y view
static const char kThruMu
A through-going muon candidate.
bool IsPointOnEdge(double x, double y, double z)
static const char kStopMu
A stopping muon candidate.
std::vector< util::RawSlice > fWin
The raw slices for this event.
void geom(int which=0)
Definition: geom.C:163
static const double kUSEC_PER_TDC
std::vector< art::Ptr< rawdata::RawDigit > > fDigi
unsigned int fMuonNhit
Required # hits on muon track.
unsigned int fMuonNhitX
required in x view
static const char kNotMu
Not a good muon candidate.
unsigned int fMuIndx1
Current muon list.
std::vector< MuonCand > fMuon[MUON_BUFF_SZ]
Table of muon data.
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void comi::Leana::reconfigure ( const fhicl::ParameterSet p)

Definition at line 158 of file Leana_module.cc.

References fDcellCut, fDeltaTnamu, fDplaneCut, fDumpMichel, fEdgeBuffer, fMuonNhit, fMuonNhitX, fMuonNhitY, fNhit, fNhitX, fNhitY, fTimeWindow, and fhicl::ParameterSet::get().

Referenced by Leana().

159  {
160  fTimeWindow = p.get<double>("TimeWindow");
161  fNhit = p.get<unsigned int>("Nhit");
162  fNhitX = p.get<unsigned int>("NhitX");
163  fNhitY = p.get<unsigned int>("NhitY");
164  fDcellCut = p.get<unsigned int>("DcellCut");
165  fDplaneCut = p.get<unsigned int>("DplaneCut");
166  fMuonNhit = p.get<unsigned int>("MuonNhit");
167  fMuonNhitX = p.get<unsigned int>("MuonNhitX");
168  fMuonNhitY = p.get<unsigned int>("MuonNhitY");
169  fEdgeBuffer = p.get<double>("EdgeBuffer");
170  fDeltaTnamu = p.get<double>("DeltaTnamu");
171  fDumpMichel = p.get<int>("DumpMichel");
172  }
unsigned int fNhitX
Number of hits req&#39;d in x view.
unsigned int fMuonNhitY
required in y view
int fDumpMichel
Dump table of Michel electrons?
T get(std::string const &key) const
Definition: ParameterSet.h:231
unsigned int fNhitY
Number of hits req&#39;d in y view.
unsigned int fNhit
Number of hits req&#39;d in window.
double fDeltaTnamu
Time for non-association (s)
int fDcellCut
Allowed gap between hit cells.
double fEdgeBuffer
[cm] Edge distance for stopping/entering decision
double fTimeWindow
[usec] Time window size
unsigned int fMuonNhit
Required # hits on muon track.
unsigned int fMuonNhitX
required in x view
int fDplaneCut
Allowed gap between hit planes.
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

Referenced by art::RootOutput::RootOutput().

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

TH1D* comi::Leana::f1HitADC
private

ADC spectrum for 1 hit slices.

Definition at line 87 of file Leana_module.cc.

Referenced by Ana1Hit(), and beginJob().

TH2D* comi::Leana::f1HitADCvsTDC
private

ADC vs TDC for 1 hit slices.

Definition at line 89 of file Leana_module.cc.

Referenced by Ana1Hit(), and beginJob().

TH1D* comi::Leana::f1HitTDC
private

TDC spectrum for 1 hit slices.

Definition at line 88 of file Leana_module.cc.

Referenced by Ana1Hit(), and beginJob().

TH1D* comi::Leana::f2HitDplane
private

Distance from first to last plane.

Definition at line 91 of file Leana_module.cc.

Referenced by beginJob().

TH1D* comi::Leana::f3HitDiffPlaneDcell
private

Max-min cell in different planes.

Definition at line 95 of file Leana_module.cc.

Referenced by beginJob().

TH1D* comi::Leana::f3HitDplane
private

Distance from first to last plane.

Definition at line 92 of file Leana_module.cc.

Referenced by beginJob().

TH1D* comi::Leana::f3HitSamePlaneDcell
private

Max-min cell in same plane.

Definition at line 94 of file Leana_module.cc.

Referenced by beginJob().

int comi::Leana::fDcellCut
private

Allowed gap between hit cells.

Definition at line 131 of file Leana_module.cc.

Referenced by AnaNHit(), and reconfigure().

double comi::Leana::fDeltaTnamu
private

Time for non-association (s)

Definition at line 138 of file Leana_module.cc.

Referenced by analyze(), and reconfigure().

std::vector< art::Ptr<rawdata::RawDigit> > comi::Leana::fDigi
private

Definition at line 112 of file Leana_module.cc.

Referenced by Ana1Hit(), analyze(), AnaNHit(), and MuonCandidate().

bool comi::Leana::fDoFill
private

Should we be filling ntuple / histogram?

Definition at line 117 of file Leana_module.cc.

Referenced by Ana1Hit(), analyze(), and AnaNHit().

int comi::Leana::fDplaneCut
private

Allowed gap between hit planes.

Definition at line 132 of file Leana_module.cc.

Referenced by AnaNHit(), and reconfigure().

int comi::Leana::fDumpMichel
private

Dump table of Michel electrons?

Definition at line 123 of file Leana_module.cc.

Referenced by AnaNHit(), and reconfigure().

double comi::Leana::fEdgeBuffer
private

[cm] Edge distance for stopping/entering decision

Definition at line 137 of file Leana_module.cc.

Referenced by IsPointOnEdge(), and reconfigure().

TH1D* comi::Leana::fEventCount
private

Event counter.

Definition at line 83 of file Leana_module.cc.

Referenced by analyze(), and beginJob().

unsigned int comi::Leana::fMuIndx1
private

Current muon list.

Definition at line 118 of file Leana_module.cc.

Referenced by analyze(), DumpMuon(), DumpMuonTable(), FindClosestMuon(), and MuonCandidate().

unsigned int comi::Leana::fMuIndx2
private

Old non-associated muons.

Definition at line 119 of file Leana_module.cc.

Referenced by analyze(), DumpMuonTable(), and FindClosestMuon().

std::vector<MuonCand> comi::Leana::fMuon[MUON_BUFF_SZ]
private

Table of muon data.

Definition at line 120 of file Leana_module.cc.

Referenced by analyze(), DumpMuon(), DumpMuonTable(), FindClosestMuon(), and MuonCandidate().

unsigned int comi::Leana::fMuonNhit
private

Required # hits on muon track.

Definition at line 134 of file Leana_module.cc.

Referenced by MuonCandidate(), and reconfigure().

unsigned int comi::Leana::fMuonNhitX
private

required in x view

Definition at line 135 of file Leana_module.cc.

Referenced by MuonCandidate(), and reconfigure().

unsigned int comi::Leana::fMuonNhitY
private

required in y view

Definition at line 136 of file Leana_module.cc.

Referenced by MuonCandidate(), and reconfigure().

unsigned int comi::Leana::fNhit
private

Number of hits req'd in window.

Definition at line 127 of file Leana_module.cc.

Referenced by analyze(), and reconfigure().

unsigned int comi::Leana::fNhitX
private

Number of hits req'd in x view.

Definition at line 128 of file Leana_module.cc.

Referenced by analyze(), and reconfigure().

unsigned int comi::Leana::fNhitY
private

Number of hits req'd in y view.

Definition at line 129 of file Leana_module.cc.

Referenced by analyze(), and reconfigure().

LeanaNt* comi::Leana::fNt
private

Ntuple for hit clusters.

Definition at line 97 of file Leana_module.cc.

Referenced by analyze(), AnaNHit(), beginJob(), and DumpMichel().

TTree* comi::Leana::fNtTree
private

Ntuple for hit clusters.

Definition at line 98 of file Leana_module.cc.

Referenced by AnaNHit(), and beginJob().

TH1D* comi::Leana::fSliceSz
private

Histogram of Nhit per slice.

Definition at line 84 of file Leana_module.cc.

Referenced by analyze(), and beginJob().

TH2D* comi::Leana::fSliceSzVsEvent
private

Histogram of slice size vs. event.

Definition at line 85 of file Leana_module.cc.

Referenced by analyze(), and beginJob().

double comi::Leana::fT0
private

Event NOvA trigger time (usec)

Definition at line 115 of file Leana_module.cc.

Referenced by analyze().

double comi::Leana::fTimeWindow
private

[usec] Time window size

Definition at line 126 of file Leana_module.cc.

Referenced by analyze(), and reconfigure().

std::vector<util::RawSlice> comi::Leana::fWin
private

The raw slices for this event.

Definition at line 114 of file Leana_module.cc.

Referenced by Ana1Hit(), analyze(), AnaNHit(), and MuonCandidate().

const char comi::Leana::kNotMu = 0
staticprivate

Not a good muon candidate.

Definition at line 107 of file Leana_module.cc.

Referenced by analyze(), DumpMuon(), FindClosestMuon(), and MuonCandidate().

const char comi::Leana::kStopMu = 1
staticprivate

A stopping muon candidate.

Definition at line 108 of file Leana_module.cc.

Referenced by DumpMuon(), FindClosestMuon(), and MuonCandidate().

const char comi::Leana::kThruMu = 2
staticprivate

A through-going muon candidate.

Definition at line 109 of file Leana_module.cc.

Referenced by DumpMuon(), and MuonCandidate().

const unsigned int comi::Leana::MUON_BUFF_SZ = 4096
staticprivate

Definition at line 106 of file Leana_module.cc.

Referenced by analyze().


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