Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
remid::ReMIdDedxFD Class Reference
Inheritance diagram for remid::ReMIdDedxFD:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 ReMIdDedxFD (fhicl::ParameterSet const &pset)
 
 ~ReMIdDedxFD ()
 
void analyze (art::Event const &evt)
 
void beginJob ()
 
void beginRun (const art::Run &run)
 
void endJob ()
 
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

bool ContainedEvent (art::Ptr< rb::Cluster > slice, art::Ptr< rb::Track > trk)
 

Private Attributes

std::string fHitModuleLabel
 
std::string fSliceLabel
 Where to find reconstructed slices. More...
 
std::string fTrackLabel
 Where to find recondtructed tracks. More...
 
std::string fPidLabel
 Where to find the pids. More...
 
std::string fGeneratorLabel
 
std::string fNumiBeamLabel
 
std::string fSpillQualLabel
 
std::string fNumuEnergyLabel
 
std::string fQepidLabel
 
TH1D * fPOT
 Histogram of POT passing spill cuts. More...
 
TH1D * fSlicesPassingSelectionCuts
 
TH1D * fTrueSlicesPassingSelectionCuts
 
double fTotalPOT
 
bool fFD
 Is detector FD? More...
 
float fTrackLength
 
TTree * DedxSample
 Tree for holding dE/dx variables needed for making signal sample histograms. More...
 
float fDedx
 
int fnDedx
 
int fnDedxUsed
 
float fDistDedx
 
int fpdg
 
bool fVert
 
bool fUsed
 
float fzStart
 
float fzEnd
 
bool fPassOffTrackHits
 
bool fPassOffTrackEnergy
 
bool fPassHadEOnMuonTrack
 
int fnCellsPerPlane
 
float fmyDedx
 
float fDe
 
int fView
 
int fPlane
 
int fCell
 
float fPE
 
float fADC
 
float fPECorr
 
float fMIP
 
float fDx
 
float fxDead
 
float fxStart
 
float fyStart
 
float fxEnd
 
float fyEnd
 
float fxHit
 
float fyHit
 
float fzHit
 
float ftHit
 
float fxDir
 
float fyDir
 
float fzDir
 
float fmcDe
 
float fmcDeBirks
 
float fmcDx
 
float fTrueE
 
int fFiberBrightness
 
art::ServiceHandle< geo::Geometryfgeom
 
art::ServiceHandle< nova::dbi::RunHistoryServicefrh
 
art::ServiceHandle< geo::LiveGeometryflivegeom
 
art::ServiceHandle< cheat::BackTrackerbt
 
art::ServiceHandle< photrans::FiberBrightnessfb
 

Detailed Description

Definition at line 63 of file ReMIdDedxFD_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

remid::ReMIdDedxFD::ReMIdDedxFD ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 186 of file ReMIdDedxFD_module.cc.

References fGeneratorLabel, fHitModuleLabel, fNumuEnergyLabel, fSliceLabel, fTrackLabel, fhicl::ParameterSet::get(), and string.

186  :
187  EDAnalyzer(pset)
188  {
189  fHitModuleLabel = (pset.get< std::string >("HitModuleLabel"));
190  fSliceLabel = (pset.get< std::string >("SliceLabel"));
191  fTrackLabel = (pset.get< std::string >("TrackLabel"));
192  // fPidLabel = (pset.get< std::string >("PidLabel" ));
193  fGeneratorLabel = pset.get< std::string >("GeneratorInput");
194  fNumuEnergyLabel = pset.get< std::string >("NumuEnergyInput");
195  // fQepidLabel = pset.get< std::string >("QepidInput");
196  }
std::string fNumuEnergyLabel
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
std::string fSliceLabel
Where to find reconstructed slices.
std::string fTrackLabel
Where to find recondtructed tracks.
enum BeamMode string
remid::ReMIdDedxFD::~ReMIdDedxFD ( )

Definition at line 200 of file ReMIdDedxFD_module.cc.

201  {
202  }

Member Function Documentation

void remid::ReMIdDedxFD::analyze ( art::Event const &  evt)
virtual

Implements art::EDAnalyzer.

Definition at line 280 of file ReMIdDedxFD_module.cc.

References rawdata::RawDigit::ADC(), ana::assert(), bt, plot_validation_datamc::c, getBrightness::cell, rb::CellHit::Cell(), geo::PlaneGeo::Cell(), ContainedEvent(), DedxSample, geo::LiveGeometry::DistToEdgeXY(), geo::LiveGeometry::DistToEdgeZ(), dz, rb::Energy::E(), fADC, fb, fCell, fDe, fDistDedx, fDx, fFD, fFiberBrightness, fHitModuleLabel, fmcDe, fmcDeBirks, fmcDx, fMIP, fmyDedx, fnCellsPerPlane, fnDedx, fnDedxUsed, fNumuEnergyLabel, fPassHadEOnMuonTrack, fPassOffTrackEnergy, fPassOffTrackHits, fpdg, fPE, fPECorr, fPlane, fSliceLabel, ftHit, fTrackLabel, fTrackLength, fTrueE, fView, fxDead, fxDir, fxEnd, fxHit, fxStart, fyDir, fyEnd, fyHit, fyStart, fzDir, fzEnd, fzHit, fzStart, geom(), photrans::FiberBrightness::getBrightnessIndex(), art::DataViewImpl::getByLabel(), geo::CellGeo::GetCenter(), rb::RecoHit::GeV(), make_syst_table_plots::h, numue::NumuE::HadTrkE(), geo::CellGeo::HalfD(), geo::CellGeo::HalfW(), cheat::BackTracker::HaveTruthInfo(), cheat::BackTracker::HitsToParticle(), cheat::BackTracker::HitToFLSHit(), MECModelEnuComparisons::i, makeTrainCVSamples::int, rb::RecoHit::IsCalibrated(), calib::j, geo::kX, geo::kXorY, geo::kY, Mag(), calib::Calibrator::MakeRecoHit(), makeBrightnessMap::maxCell, makeBrightnessMap::maxPlane, std::min(), rb::RecoHit::MIP(), rb::CellHit::PE(), rb::RecoHit::PECorr(), rb::CellHit::Plane(), geo::GeometryBase::Plane(), NDAPDHVSetting::plane, art::PtrVector< T >::push_back(), rb::RecoHit::RecoHit(), art::PtrVector< T >::size(), std::sqrt(), ana::Sqrt(), rb::RecoHit::T(), make_root_from_grid_output::trklen, POTSpillRate::view, geo::PlaneGeo::View(), rb::RecoHit::X(), rb::RecoHit::Y(), and rb::RecoHit::Z().

281  {
282  //Only written for FD
283  if (!fFD) return;
284 
285  // get a geometry handle **************************************
288  //***************************************************************
289 
290  //Getting event hits
292  evt.getByLabel(fHitModuleLabel, hithdl);
293 
295  for(size_t h = 0; h < hithdl->size(); ++h){
296  art::Ptr<rb::CellHit> hit(hithdl, h);
297  allhits.push_back(hit);
298  }
299 
300  // get the slices out of the event
302  evt.getByLabel(fSliceLabel,slicecol);
303 
304  art::PtrVector<rb::Cluster> slicelist;
305 
306  for(unsigned int i = 0; i<slicecol->size();++i){
307  art::Ptr<rb::Cluster>slice(slicecol,i);
308  slicelist.push_back(slice);
309  }
310 
311  // get assosciations between slices and tracks
312  art::FindManyP<rb::Track> fndmnytrk(slicecol,evt,fTrackLabel);
313 
314  // get assosciations between slices and numu energy
315  art::FindManyP<numue::NumuE> fndmnyNumuEnergy(slicecol, evt, fNumuEnergyLabel);
316 
317  // loop over the slices
318  for(unsigned int iSlice = 0; iSlice<slicelist.size(); ++iSlice){
319 
320  // If slice is noise, skip it
321  if(slicelist[iSlice]->IsNoise()){ continue; }
322 
323  // get all of the tracks associated to this slice
324  std::vector<art::Ptr<rb::Track> > tracks = fndmnytrk.at(iSlice);
325  // if no tracks move on
326  if(tracks.size() == 0){ continue; }
327 
328  //Require precisely one track
329  if(tracks.size() != 1){ continue; }
330 
331 
332  //Require Best Track is 3D
333  bool is3D = true;
334 
335  int bestidx = 0;
336  if(!tracks[bestidx]->Is3D()) is3D = false;
337  if (!is3D){ continue; }
338 
339  //Default all pass cuts to false
340  fPassOffTrackHits = false;
341  fPassOffTrackEnergy = false;
342  fPassHadEOnMuonTrack = false;
343 
344  //Determine if tracks come from outside and stop
346 
347  /*
348  double distStartToFront = livegeo->DistToFront( tracks[bestidx]->Start() );
349  double distStartToTop = livegeo->DistToTop( tracks[bestidx]->Start() );
350  double distStartToSide = livegeo->DistToEdgeX( tracks[bestidx]->Start() );
351 
352 
353  //physical starts
354  if (distStartToFront < 0) continue;
355  if (distStartToTop < 0) continue;
356  if (distStartToSide < 0) continue;
357  */
358 
359  // endpoint isn't contained
360  double distEndToEdge = std::min(livegeo->DistToEdgeXY(tracks[bestidx]->Stop()), livegeo->DistToEdgeZ(tracks[bestidx]->Stop()));
361  bool isStopper = true;
362  if (distEndToEdge < 50) isStopper = false;
363 
364  // Process only contained tracks
365  if (!isStopper) continue;
366 
367  //Filling muon track length properties
368  fzStart = tracks[bestidx]->Start().Z();
369  fzEnd = tracks[bestidx]->Stop().Z();
370  fTrackLength = tracks[bestidx]->TotalLength();
371 
372  fxStart = tracks[bestidx]->Start().X();
373  fyStart = tracks[bestidx]->Start().Y();
374  fxEnd = tracks[bestidx]->Stop().X();
375  fyEnd = tracks[bestidx]->Stop().Y();
376 
377  fxDir = tracks[bestidx]->Dir().X();
378  fyDir = tracks[bestidx]->Dir().Y();
379  fzDir = tracks[bestidx]->Dir().Z();
380 
381  double trklen = tracks[bestidx]->TotalLength();
382 
383  unsigned int ntraj = tracks[bestidx]->NTrajectoryPoints();
384 
385  // vector holds effective active track length from the end of the track
386  std::vector<double> lengths(ntraj);
387 
388  // loop over trajectory points starting from the end
389  for(int itrj = ntraj-1; itrj >= 0; --itrj){
390  TVector3 trajpoint = tracks[bestidx]->TrajectoryPoint(itrj);
391  if(itrj == (int)ntraj-1) lengths[itrj] = 0.0;
392  else {
393  TVector3 lasttrajpoint = tracks[bestidx]->TrajectoryPoint(itrj+1);
394  lengths[itrj] = (trajpoint-lasttrajpoint).Mag() + lengths[itrj+1];
395  } // else
396  } // for itrj
397 
398  unsigned int minPlane = tracks[bestidx]->MinPlane();
399  unsigned int maxPlane = tracks[bestidx]->MaxPlane();
400  int maxXPlane = -1;
401  int maxYPlane = -1;
402  double hitCosx[tracks[bestidx]->NXCell()];
403  double hitCosy[tracks[bestidx]->NYCell()];
404 
405  for(unsigned int ihit = 0; ihit<tracks[bestidx]->NXCell(); ++ihit){
406  if(tracks[bestidx]->XCell(ihit)->Plane() > maxXPlane){ maxXPlane = tracks[bestidx]->XCell(ihit)->Plane(); }
407  // get direction with this x hit
408  double xyzplane[3];
409  geom->Plane(tracks[bestidx]->XCell(ihit)->Plane())->Cell(0)->GetCenter(xyzplane);
410  double dz = geom->Plane(tracks[bestidx]->XCell(ihit)->Plane())->Cell(0)->HalfD();
411 
412  double minz = xyzplane[2]-dz;
413  double maxz = xyzplane[2]+dz;
414  unsigned int currtrj = 0;
415  // find the matching trajectory point for this plane;
416  for(unsigned int itraj = 0;itraj<tracks[bestidx]->NTrajectoryPoints();++itraj){
417  if(tracks[bestidx]->TrajectoryPoint(itraj).Z()>minz && tracks[bestidx]->TrajectoryPoint(itraj).Z()<maxz){currtrj = itraj;}
418  } // for itaraj
419  TVector3 direction = tracks[bestidx]->Dir();
420  if(currtrj>0 && currtrj<tracks[bestidx]->NTrajectoryPoints()-2){
421  direction = tracks[bestidx]->TrajectoryPoint(currtrj) - tracks[bestidx]->TrajectoryPoint(currtrj-1);
422  }
423  direction = direction.Unit();
424  hitCosx[ihit] = sqrt(1.0/(direction.X()*direction.X()+direction.Z()*direction.Z()))*direction.Z();
425  } // for ihit XCell
426 
427  for(unsigned int ihit = 0; ihit<tracks[bestidx]->NYCell(); ++ihit){
428  if(tracks[bestidx]->YCell(ihit)->Plane() > maxYPlane){ maxYPlane = tracks[bestidx]->YCell(ihit)->Plane(); }
429  // get direction with this y hit
430  double xyzplane[3];
431  geom->Plane(tracks[bestidx]->YCell(ihit)->Plane())->Cell(0)->GetCenter(xyzplane);
432  double dz = geom->Plane(tracks[bestidx]->YCell(ihit)->Plane())->Cell(0)->HalfD();
433  // double dz = HalfD;
434  double minz = xyzplane[2]-dz;
435  double maxz = xyzplane[2]+dz;
436  unsigned int currtrj = 0;
437  // find the matching trajectory point for this plane;
438  for(unsigned int itraj = 0;itraj<tracks[bestidx]->NTrajectoryPoints();++itraj){
439  if(tracks[bestidx]->TrajectoryPoint(itraj).Z()>minz && tracks[bestidx]->TrajectoryPoint(itraj).Z()<maxz){currtrj = itraj;}
440  }
441  TVector3 direction = tracks[bestidx]->Dir();
442  if(currtrj>0 && currtrj<tracks[bestidx]->NTrajectoryPoints()-2){
443  direction = tracks[bestidx]->TrajectoryPoint(currtrj) - tracks[bestidx]->TrajectoryPoint(currtrj-1);
444  }
445  direction = direction.Unit();
446  hitCosy[ihit] = sqrt(1.0/(direction.Y()*direction.Y()+direction.Z()*direction.Z()))*direction.Z();
447  } // for ihit YCell
448 
449  ///
450 
451  // calculate dedx info for this track
452  std::vector<double> dedxs;
453  std::vector<double> des;
454  std::vector<double> pecorrs;
455  std::vector<double> mips;
456  std::vector<double> dxs;
457  std::vector<double> deads;
458  std::vector<double> xdedxs;
459  std::vector<unsigned int> dedxpls;
460 
461  std::vector<double> pes;
462  std::vector<double> adcs;
463  std::vector<double> xhits;
464  std::vector<double> yhits;
465  std::vector<double> zhits;
466  std::vector<double> thits;
467  std::vector<int> views;
468  std::vector<int> cells;
469  std::vector<int> planes;
470 
471  std::vector<double> mcdes;
472  std::vector<double> mcdebs;
473  std::vector<double> mcdxs;
474 
475  for(unsigned int iPlane = minPlane;iPlane<=maxPlane;++iPlane){
476 
477  double planeGeV = 0;
478  double planePECorr = 0;
479  double planeMIP = 0;
480 
481  int planeView = -1;
482  int plane = -1;
483  int cell = -1;
484  double planeX = 0;
485  double planeY = 0;
486  double planeZ = 0;
487  double planeT = 0;
488  double planeADC = 0;
489  double planePE = 0;
490 
491  double mcPlaneE = 0;
492  double mcPlaneEBirks = 0;
493  double mcPathLength = 0;
494  double totcosinview = 0;
495  double avgCosOtherView = 1.0;
496  bool useOtherView = true;
497  double nhits = 0;
498  double xyzplane[3];
499  geom->Plane(iPlane)->Cell(0)->GetCenter(xyzplane);
500  double dz = geom->Plane(iPlane)->Cell(0)->HalfD();
501  // double dz = HalfD;
502  double minz = xyzplane[2]-dz;
503  double maxz = xyzplane[2]+dz;
504  int matchpt = 0;
505  int minCell = 10000;
506  int maxCell = 0;
507  double nhitsother = 0;
508  int view = 0;
509  int fbIndex = -1;
510  fFiberBrightness = -1;
511  // find the matching trajectory point for this plane;
512  for(unsigned int itraj = 0;itraj<tracks[bestidx]->NTrajectoryPoints();++itraj){
513  if(tracks[bestidx]->TrajectoryPoint(itraj).Z()>minz && tracks[bestidx]->TrajectoryPoint(itraj).Z()<maxz){matchpt = itraj;}
514  }
515 
516  trklen = lengths[0];
517 
518  // find the track length up to this trajectory point
519  double xlength = trklen - lengths[matchpt];
520 
521 
522  if(minPlane == maxPlane){xlength = trklen/2;}
523  if(tracks[bestidx]->Stop().Y()>tracks[bestidx]->Start().Y()){xlength = (trklen-xlength);}
524 
525  if(geom->Plane(iPlane)->View() == geo::kX){
526  planeView = 0;
527  for(unsigned int iHit = 0; iHit<tracks[bestidx]->NXCell();++iHit){
528  if(tracks[bestidx]->XCell(iHit)->Plane() == iPlane && tracks[bestidx]->XCell(iHit)->View() != geo::kY){
529  const art::Ptr<rb::CellHit>& chit = tracks[bestidx]->XCell(iHit);
530  planeADC+=chit->ADC();
531  planePE +=chit->PE();
532  cell = chit->Cell();
533  plane = chit->Plane();
534  rb::RecoHit rhit = tracks[bestidx]->RecoHit(tracks[bestidx]->XCell(iHit));
535  if(minPlane == maxPlane){
536  rhit = cal->MakeRecoHit(*(tracks[bestidx]->XCell(iHit)), 0.25);
537  }
538  if(rhit.IsCalibrated()){
539  planeGeV+=rhit.GeV();
540  planePECorr+=rhit.PECorr();
541  planeMIP+=rhit.MIP();
542  planeX += rhit.X();
543  planeY += rhit.Y();
544  planeZ += rhit.Z();
545  planeT += rhit.T();
546  totcosinview+=hitCosx[iHit];
547  nhits+=1.0;
548  if(tracks[bestidx]->XCell(iHit)->Cell()<minCell){minCell = tracks[bestidx]->XCell(iHit)->Cell();}
549  if(tracks[bestidx]->XCell(iHit)->Cell()>maxCell){maxCell = tracks[bestidx]->XCell(iHit)->Cell();}
550 
551  fbIndex = fb->getBrightnessIndex(iPlane, tracks[bestidx]->XCell(iHit)->Cell() );
552 
553  if(bt->HaveTruthInfo()){
554  const art::Ptr<rb::CellHit>& chit = tracks[bestidx]->XCell(iHit);
555  const std::vector< sim::FLSHit > flsHits = bt->HitToFLSHit(chit);
556  for(int j = 0; j < (int)flsHits.size(); j++){
557  mcPlaneE += flsHits[j].GetEdep();
558  mcPlaneEBirks += flsHits[j].GetEdepBirks();
559  mcPathLength += flsHits[j].GetTotalPathLength();
560 
561  }//End loop over flshits in hit
562  } // if BackTracker
563 
564  }
565  }
566  } // for iHit
567 
568  // try to get the avgcos from the other view
569  double nhitsbefore = 0;
570  double nhitsafter = 0;
571  double totCosBefore = 0;
572  double totCosAfter = 0;
573  for(unsigned int iHit = 0; iHit<tracks[bestidx]->NYCell();++iHit){
574  if(tracks[bestidx]->YCell(iHit)->Plane() == iPlane-1){
575  ++nhitsbefore;
576  totCosBefore+=hitCosy[iHit];
577  }
578  else if(tracks[bestidx]->YCell(iHit)->Plane() == iPlane+1){
579  ++nhitsafter;
580  totCosAfter+=hitCosy[iHit];
581  }
582  }
583  if(nhitsbefore > 0 && nhitsafter > 0){
584  avgCosOtherView = ((totCosAfter+totCosBefore)/(nhitsbefore+nhitsafter));
585  nhitsother = (nhitsbefore+nhitsafter)/2;
586  }
587  else if(nhitsbefore > 0){
588  avgCosOtherView = totCosBefore/nhitsbefore;
589  nhitsother = nhitsbefore;
590  }
591  else if(nhitsafter > 0){
592  avgCosOtherView = totCosAfter/nhitsafter;
593  nhitsother = nhitsafter;
594  }
595  else{ useOtherView = false; }
596 
597  } else if(geom->Plane(iPlane)->View() == geo::kY){
598  planeView = 1;
599  view = 1;
600  for(unsigned int iHit = 0; iHit<tracks[bestidx]->NYCell();++iHit){
601  if(tracks[bestidx]->YCell(iHit)->Plane() == iPlane && tracks[bestidx]->YCell(iHit)->View() != geo::kX
602  && tracks[bestidx]->YCell(iHit)->View() != geo::kXorY){
603  const art::Ptr<rb::CellHit>& chit = tracks[bestidx]->YCell(iHit);
604  planeADC+=chit->ADC();
605  planePE +=chit->PE();
606  cell = chit->Cell();
607  plane = chit->Plane();
608 
609  rb::RecoHit rhit = tracks[bestidx]->RecoHit(tracks[bestidx]->YCell(iHit));
610  if(minPlane == maxPlane){
611  rhit = cal->MakeRecoHit(*(tracks[bestidx]->YCell(iHit)), 0.25);
612  }
613  if(rhit.IsCalibrated()){
614  planeGeV+=rhit.GeV();
615  planePECorr+=rhit.PECorr();
616  planeMIP+=rhit.MIP();
617  planeX += rhit.X();
618  planeY += rhit.Y();
619  planeZ += rhit.Z();
620  planeT += rhit.T();
621  totcosinview+=hitCosy[iHit];
622  nhits+=1.0;
623  if(tracks[bestidx]->YCell(iHit)->Cell()<minCell){minCell = tracks[bestidx]->YCell(iHit)->Cell();}
624  if(tracks[bestidx]->YCell(iHit)->Cell()>maxCell){maxCell = tracks[bestidx]->YCell(iHit)->Cell();}
625 
626  fbIndex = fb->getBrightnessIndex(iPlane, tracks[bestidx]->YCell(iHit)->Cell() );
627 
628  if(bt->HaveTruthInfo()){
629  const art::Ptr<rb::CellHit>& chit = tracks[bestidx]->YCell(iHit);
630  const std::vector< sim::FLSHit > flsHits = bt->HitToFLSHit(chit);
631  for(int j = 0; j < (int)flsHits.size(); j++){
632  mcPlaneE += flsHits[j].GetEdep();
633  mcPlaneEBirks += flsHits[j].GetEdepBirks();
634  mcPathLength += flsHits[j].GetTotalPathLength();
635 
636  }//End loop over flshits in hit
637  } // if BackTracker
638 
639  } // if isCalibrated
640  } //
641  } // for iHit
642 
643  // try to get the avgcos from the other view
644  double nhitsbefore = 0;
645  double nhitsafter = 0;
646  double totCosBefore = 0;
647  double totCosAfter = 0;
648  for(unsigned int iHit = 0; iHit<tracks[bestidx]->NXCell();++iHit){
649  if(tracks[bestidx]->XCell(iHit)->Plane() == iPlane-1){
650  ++nhitsbefore;
651  totCosBefore+=hitCosx[iHit];
652  }
653  else if(tracks[bestidx]->XCell(iHit)->Plane() == iPlane+1){
654  ++nhitsafter;
655  totCosAfter+=hitCosx[iHit];
656  }
657  }
658  if(nhitsbefore > 0 && nhitsafter > 0){
659  avgCosOtherView = TMath::Abs(((totCosAfter+totCosBefore)/(nhitsbefore+nhitsafter)));
660  nhitsother = (nhitsbefore+nhitsafter)/2;
661  }
662  else if(nhitsbefore > 0){
663  avgCosOtherView = TMath::Abs(totCosBefore/nhitsbefore);
664  nhitsother = nhitsbefore;
665  }
666  else if(nhitsafter > 0){
667  avgCosOtherView = TMath::Abs(totCosAfter/nhitsafter);
668  nhitsother = nhitsbefore;
669  }
670  else{ useOtherView = false; }
671 
672  } // if kY
673  fnCellsPerPlane = nhits;
674  if(nhits >0){
675 
676  if(nhits == 1) {
677  fFiberBrightness = fbIndex;
678  }
679 
680  double avgCos = TMath::Abs(totcosinview/nhits);
681  double xyzp[3];
682  geom->Plane(iPlane)->Cell(minCell)->GetCenter(xyzp);
683  double xyzp1[3];
684  geom->Plane(iPlane)->Cell(maxCell)->GetCenter(xyzp1);
685  double planewidth = 2*geom->Plane(iPlane)->Cell(1)->HalfD();
686  // double planewidth = 2*HalfD;
687  // calculate the amount of dead material to subtract off
688  // first add up live material
689  double liveLength = 0;
690  for(int i = minCell; i<maxCell+1;++i){
691  // get the cell half width
692  const geo::PlaneGeo* p = geom->Plane(iPlane);
693  const geo::CellGeo* c = p->Cell(i);
694  if(i == minCell || i == maxCell){ liveLength+=c->HalfW(); }
695  else{ liveLength+=(2.0*c->HalfW() ); }
696  }
697  // dead material is total length - live length only if min and max cell are not the same
698  double deadLength = 0;
699  if(minCell != maxCell){ deadLength = (TMath::Abs(xyzp1[view]-xyzp[view])-liveLength); }
700  double planeheight = planewidth*TMath::Tan(TMath::ACos(avgCos))-deadLength;
701  double planePathLength = TMath::Sqrt(planewidth*planewidth + planeheight*planeheight);
702  // std::cout << " ++++ " << iPlane << " " << planePathLength << " " << planewidth << " " << planeheight << std::endl;
703  // in the case of completely vertical track be a bit careful
704  if(avgCos == 0 || avgCos!=avgCos){ planePathLength = liveLength; }
705  if(useOtherView){
706  double deltaz = planewidth;
707  double deltav = planewidth*TMath::Tan(TMath::ACos(avgCos))-deadLength;
708  if(avgCos == 0 || avgCos!=avgCos){
709  deltav = liveLength;
710  // if the track looks completely vertical in both views,
711  // than no part of the track length should be in z direction
712  if(avgCosOtherView == 0 || avgCosOtherView != avgCosOtherView){ deltaz = 0; }
713  }
714 
715  // in opposite view dead length
716  double deltaov = (planewidth-deadLength)*TMath::Tan(TMath::ACos(avgCosOtherView));
717  // in the case that the other view looks completely vertical scale up
718  // the length between cells in this view by the number of hits in the other view
719  // this case should really never happen
720  if(avgCosOtherView == 0 || avgCosOtherView != avgCosOtherView){
721  deltaov = nhitsother*(TMath::Abs(xyzp1[view]-xyzp[view]))/nhits;
722  }
723  planePathLength = TMath::Sqrt(deltaz*deltaz+deltav*deltav+deltaov*deltaov);
724  }
725  // also the case of completely vertical track
726  if(minPlane == maxPlane){ planePathLength = liveLength; }
727 
728  xdedxs.push_back(xlength);
729 
730  assert(planeGeV/(planePathLength)>=0);
731  dedxs.push_back(planeGeV/(planePathLength));
732  des.push_back(planeGeV);
733  pecorrs.push_back(planePECorr);
734  mips.push_back(planeMIP);
735  dxs.push_back(planePathLength);
736  deads.push_back(deadLength);
737  xhits.push_back(planeX/nhits);
738  yhits.push_back(planeY/nhits);
739  zhits.push_back(planeZ/nhits);
740  thits.push_back(planeT/nhits);
741  views.push_back(planeView);
742  planes.push_back(plane);
743  cells.push_back(cell);
744  pes.push_back(planePE);
745  adcs.push_back(planeADC);
746 
747  mcdes.push_back(mcPlaneE);
748  mcdebs.push_back(mcPlaneEBirks);
749  mcdxs.push_back(mcPathLength);
750 
751  // std::cout << Form(" Dedx %d %2.6f %2.6f %2.6f", iPlane , planeGeV/(planePathLength), planeGeV, planePathLength ) << std::endl;
752  } //nhits > 0
753  } // iPlane
754  //.....
755 
756  //Looking at numu energy things
757  numue::NumuE numuE;
758  if (!fndmnyNumuEnergy.isValid()){ continue; }
759  std::vector<art::Ptr<numue::NumuE> > energyVec = fndmnyNumuEnergy.at(iSlice);
760  if (energyVec.empty()){ continue; }
761  numuE = *energyVec[0];
762 
763  //Require decent energy object; not too much hadronic energy in muon catcher
764  if (numuE.E() == -5){ continue; }
765  //Not much hadronic energy contamination on muon track
766  if (numuE.HadTrkE() < 0.025){ fPassHadEOnMuonTrack = true; }
767 
768  //Slice energy mostly on one tracks
769  double calEDiff = (slicelist[iSlice]->CalorimetricEnergy())-(tracks[bestidx]->CalorimetricEnergy());
770  if (calEDiff < 0.1){ fPassOffTrackEnergy = true; }
771 
772  //Slice hits mostly on one track
773  int hitDiff = (slicelist[iSlice]->NCell())-(tracks[bestidx]->NCell());
774  if (hitDiff < 4){ fPassOffTrackHits = true; }
775 
776  fpdg = 0;
777 
778  if (bt->HaveTruthInfo()){
779  const std::vector<const sim::Particle*> test_mu = bt->HitsToParticle(tracks[bestidx]->AllCells());
780  if (!test_mu.empty()) {
781  fpdg = test_mu[0]->PdgCode();
782  fTrueE = test_mu[0]->E();
783  }
784  } // if HaveTruthInfo
785 
786  if(ContainedEvent(slicelist[iSlice],tracks[bestidx])){
787  // get all the dedx variables filled
788  fnDedx = des.size() -1; // pid->NDedx()-1;
789  fnDedxUsed = des.size(); // pid->NMeasurementPlanes();
790  // loop over all of the dE/dx measurements
791  //for(unsigned int idedx = 0; idedx<pid->NDedx(); ++idedx){
792  for( int idedx = 0; idedx<fnDedx; ++idedx){
793 
794  fDe = des[idedx];
795  fPECorr = pecorrs[idedx];
796  fMIP = mips[idedx];
797  fDx = dxs[idedx];
798  fxDead = deads[idedx];
799  fmyDedx = fDe/fDx;
800 
801  fxHit = xhits[idedx];
802  fyHit = yhits[idedx];
803  fzHit = zhits[idedx];
804  ftHit = thits[idedx];
805  fView = views[idedx];
806  fPlane = planes[idedx];
807  fCell = cells[idedx];
808  fADC = adcs[idedx];
809  fPE = pes[idedx];
810 
811  fmcDe = mcdes[idedx];
812  fmcDeBirks = mcdebs[idedx];
813  fmcDx = mcdxs[idedx];
814 
815  // ............
816  // get the distance from the end of the track
817  // fDistDedx = (1.0 - pid->DedxLocation(idedx))*tracks[bestidx]->TotalLength();
818  fDistDedx = (1.0 -xdedxs[idedx]/trklen)*tracks[bestidx]->TotalLength();
819  // fill the dedx sample tree
820  DedxSample->Fill();
821  }//Loop over DedxSample
822 
823  }//If passes contaiment (now temporarely always true)
824 
825  } // end loop over slices
826 
827  }
float T() const
Definition: RecoHit.h:39
size_t NTrajectoryPoints() const
Definition: Track.h:83
double HalfD() const
Definition: CellGeo.cxx:205
void GetCenter(double *xyz, double localz=0.0) const
Definition: CellGeo.cxx:159
TVector3 TrajectoryPoint(unsigned int i) const
The ith point on the trajectory, a 3-vector in cm.
Definition: Track.cxx:158
art::Ptr< rb::CellHit > XCell(unsigned int xIdx) const
Get the ith cell in the x-view.
Definition: Cluster.cxx:157
float E() const
Definition: Energy.cxx:27
bool fFD
Is detector FD?
art::ServiceHandle< photrans::FiberBrightness > fb
X or Y views.
Definition: PlaneGeo.h:30
unsigned short Plane() const
Definition: CellHit.h:39
double DistToEdgeXY(TVector3 vertex)
const CellGeo * Cell(int icell) const
Definition: PlaneGeo.h:48
const char * p
Definition: xmltok.h:285
T sqrt(T number)
Definition: d0nt_math.hpp:156
Vertical planes which measure X.
Definition: PlaneGeo.h:28
rb::RecoHit MakeRecoHit(rb::CellHit const &cellhit, double w)
float Z() const
Definition: RecoHit.h:38
double HalfW() const
Definition: CellGeo.cxx:191
const PlaneGeo * Plane(unsigned int i) const
bool ContainedEvent(art::Ptr< rb::Cluster > slice, art::Ptr< rb::Track > trk)
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
art::PtrVector< rb::CellHit > AllCells() const
Get all cells from both views.
Definition: Cluster.cxx:180
Calibrated quantities relying on position in the orthogonal view. To generate a rb::CellHit from a rb...
Definition: RecoHit.h:19
virtual double TotalLength() const
Length (cm) of all the track segments.
Definition: Track.cxx:213
unsigned int getBrightnessIndex(unsigned int plane, unsigned int cell) const
unsigned short Cell() const
Definition: CellHit.h:40
art::ServiceHandle< cheat::BackTracker > bt
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:53
double CalorimetricEnergy(EEnergyCalcScheme escheme=kRecomputeEnergy) const
Simple estimate of neutrino energy.
Definition: Cluster.cxx:439
double DistToEdgeZ(TVector3 vertex)
double dz[NP][NC]
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:441
unsigned int NCell() const
Number of cells in either view.
Definition: Cluster.h:110
float HadTrkE() const
Definition: NumuE.cxx:284
art::Ptr< rb::CellHit > YCell(unsigned int yIdx) const
Get the ith cell in the y-view.
Definition: Cluster.cxx:165
std::vector< sim::FLSHit > HitToFLSHit(const rb::CellHit &hit) const
All the FLSHits that contributed to this hit, sorted from most to least light.
Geometry information for a single readout plane.
Definition: PlaneGeo.h:36
int evt
std::string fNumuEnergyLabel
float PE() const
Definition: CellHit.h:42
bool IsCalibrated() const
You MUST check here before accessing PECorr, MIP or GeV.
Definition: RecoHit.cxx:35
const double j
Definition: BetheBloch.cxx:29
std::string fSliceLabel
Where to find reconstructed slices.
size_type size() const
Definition: PtrVector.h:308
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
Definition: Cluster.cxx:145
float MIP() const
Definition: RecoHit.cxx:58
float GeV() const
Definition: RecoHit.cxx:69
int16_t ADC(uint32_t i) const
Definition: RawDigit.cxx:58
TTree * DedxSample
Tree for holding dE/dx variables needed for making signal sample histograms.
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:326
Definition: structs.h:12
float X() const
Definition: RecoHit.h:36
std::string fTrackLabel
Where to find recondtructed tracks.
void geom(int which=0)
Definition: geom.C:163
bool HaveTruthInfo() const
Is this a file with truth info in? (Is BackTracker going to be any use to you?)
Definition: BackTracker.h:133
float Mag() const
assert(nhit_max >=nhit_nbins)
float Y() const
Definition: RecoHit.h:37
float PECorr() const
Definition: RecoHit.cxx:47
T min(const caf::Proxy< T > &a, T b)
bool IsNoise() const
Is the noise flag set?
Definition: Cluster.h:163
TVector3 Stop() const
Position of the final trajectory point.
Definition: Track.cxx:186
Encapsulate the cell geometry.
Definition: CellGeo.h:25
virtual bool Is3D() const
Definition: Prong.h:71
std::vector< const sim::Particle * > HitsToParticle(const std::vector< const rb::CellHit * > &hits) const
Returns vector of sim::Particle objects contributing to the given collection of hits.
void remid::ReMIdDedxFD::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 206 of file ReMIdDedxFD_module.cc.

References DedxSample, fADC, fCell, fDe, fDedx, fDistDedx, fDx, fFiberBrightness, fmcDe, fmcDeBirks, fmcDx, fMIP, fmyDedx, fnCellsPerPlane, fnDedx, fnDedxUsed, fPassHadEOnMuonTrack, fPassOffTrackEnergy, fPassOffTrackHits, fpdg, fPE, fPECorr, fPlane, fPOT, fSlicesPassingSelectionCuts, ftHit, fTotalPOT, fTrackLength, fTrueE, fTrueSlicesPassingSelectionCuts, fUsed, fVert, fView, fxDead, fxDir, fxEnd, fxHit, fxStart, fyDir, fyEnd, fyHit, fyStart, fzDir, fzEnd, fzHit, fzStart, and art::TFileDirectory::make().

207  {
209 
210  DedxSample = tfs->make<TTree>("fDedxSample","Variables for Creating Dedx Sample Histograms");
211  DedxSample->Branch("dedx", &fDedx, "dedx/F");
212  DedxSample->Branch("nDedx", &fnDedx, "nDedx/I");
213  DedxSample->Branch("nDedxUsed", &fnDedxUsed, "nDedxUsed/I");
214  DedxSample->Branch("distFromEnd", &fDistDedx, "distFromEnd/F");
215  DedxSample->Branch("trackLength", &fTrackLength, "trackLength/F");
216  DedxSample->Branch("vert", &fVert, "vert/O");
217  DedxSample->Branch("used", &fUsed, "used/O");
218  DedxSample->Branch("zStart",&fzStart,"zStart/F");
219  DedxSample->Branch("zEnd",&fzEnd,"zEnd/F");
220  DedxSample->Branch("passOffTrackHits",&fPassOffTrackHits,"passOffTrackHits/O");
221  DedxSample->Branch("passOffTrackEnergy",&fPassOffTrackEnergy,"passOffTrackEnergy/O");
222  DedxSample->Branch("passHadEOnMuonTrack",&fPassHadEOnMuonTrack,"passHadEOnMuonTrack/O");
223 
224  DedxSample->Branch("ncellsPerPlane", &fnCellsPerPlane, "ncellsPerPlane/I");
225  DedxSample->Branch("mydedx", &fmyDedx, "mydedx/F");
226  DedxSample->Branch("de", &fDe, "de/F");
227  DedxSample->Branch("view", &fView, "view/I");
228  DedxSample->Branch("cell", &fCell, "cell/I");
229  DedxSample->Branch("plane", &fPlane, "plane/I");
230  DedxSample->Branch("adc", &fADC, "adc/F");
231  DedxSample->Branch("pe", &fPE, "pe/F");
232  DedxSample->Branch("pecorr", &fPECorr, "pecorr/F");
233  DedxSample->Branch("mip", &fMIP, "mip/F");
234  DedxSample->Branch("dx", &fDx, "dx/F");
235  DedxSample->Branch("deadx", &fxDead, "deadx/F");
236  DedxSample->Branch("xStart", &fxStart, "xStart/F");
237  DedxSample->Branch("yStart", &fyStart, "yStart/F");
238  DedxSample->Branch("xEnd", &fxEnd, "xEnd/F");
239  DedxSample->Branch("yEnd", &fyEnd, "yEnd/F");
240  DedxSample->Branch("xHit", &fxHit, "xHit/F");
241  DedxSample->Branch("yHit", &fyHit, "yHit/F");
242  DedxSample->Branch("zHit", &fzHit, "zHit/F");
243  DedxSample->Branch("tHit", &ftHit, "tHit/F");
244  DedxSample->Branch("xDir", &fxDir, "xDir/F");
245  DedxSample->Branch("yDir", &fyDir, "yDir/F");
246  DedxSample->Branch("zDir", &fzDir, "zDir/F");
247  DedxSample->Branch("mcde", &fmcDe, "mcde/F");
248  DedxSample->Branch("mcdeBirks",&fmcDeBirks, "mcdeBirks/F");
249  DedxSample->Branch("mcdx", &fmcDx, "mcdx/F");
250 
251  DedxSample->Branch("pdg", &fpdg, "pdg/I");
252  DedxSample->Branch("trueE", &fTrueE, "trueE/F");
253  DedxSample->Branch("fiberBrightness", &fFiberBrightness, "fiberBrightness/I");
254 
255  fPOT = tfs->make<TH1D>("POT", ";;Total POT",1, 0.0, 1.0);
256  fSlicesPassingSelectionCuts = tfs->make<TH1D>("SlicesPassingSelectionCuts", ";;Slices Passing Selection Cuts",1, 0.0, 1.0);
257  fTrueSlicesPassingSelectionCuts = tfs->make<TH1D>("TrueSlicesPassingSelectionCuts", ";;True Slices Passing Selection Cuts",1, 0.0, 1.0);
258 
259  fTotalPOT = 0.0;
260 
261  }
TH1D * fPOT
Histogram of POT passing spill cuts.
TH1D * fTrueSlicesPassingSelectionCuts
T * make(ARGS...args) const
TTree * DedxSample
Tree for holding dE/dx variables needed for making signal sample histograms.
void remid::ReMIdDedxFD::beginRun ( const art::Run run)

Definition at line 265 of file ReMIdDedxFD_module.cc.

References geo::GeometryBase::DetId(), fFD, fgeom, and novadaq::cnv::kFARDET.

267  {
268 
269  fFD = false;
270 
271  novadaq::cnv::DetId detID = fgeom->DetId();
272  if (detID == novadaq::cnv::kFARDET) fFD = true;
273 
274  return;
275  }
bool fFD
Is detector FD?
Far Detector at Ash River, MN.
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
art::ServiceHandle< geo::Geometry > fgeom
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
bool remid::ReMIdDedxFD::ContainedEvent ( art::Ptr< rb::Cluster slice,
art::Ptr< rb::Track trk 
)
private

Definition at line 839 of file ReMIdDedxFD_module.cc.

References DEFINE_ART_MODULE(), rb::Prong::Dir(), flivegeom, rb::Cluster::NCell(), rb::Track::NTrajectoryPoints(), geo::LiveGeometry::ProjectedLiveCellsToEdge(), rb::Track::Stop(), and rb::Track::TrajectoryPoint().

Referenced by analyze().

840  {
841 
842  bool contained = false;
843 
844  // check that this is a contained event
845 
846  // 2) how close is the track to the edge of the detector
847  // in planes
848  //SL - NOPE, need to ask slice, not track
849  // unsigned int firstpl = slice->MinPlane();
850  // unsigned int lastpl = slice->MaxPlane();
851  // in projected cells, just define directions here actually get projected cell below
852  TVector3 dirbwk = -trk->Dir();
853  TVector3 dirfwd = (trk->TrajectoryPoint(trk->NTrajectoryPoints()-1) - trk->TrajectoryPoint(trk->NTrajectoryPoints()-2)).Unit();
854 
855  // 3) hits in slice
856  int sliceNHit = slice->NCell();
857 
858  // 4) slice mean time
859  // double slcTime = slice->MeanTNS();
860 
861  // 5) hits on track
862  int trackNHit = trk->NCell();
863 
864  //std::cout<<"In contained event loop!"<<std::endl;
865  // cut the slice number of cells from edge
866  if((sliceNHit > 20)&&(trackNHit > 5)){
867  int fwdcell = flivegeom->ProjectedLiveCellsToEdge(trk->Stop(), dirfwd);
868  // int bwkcell = flivegeom->ProjectedLiveCellsToEdge(trk->Start(),dirbwk);
869 
870  // also make sure the track doesn't start too close to the end of the active region
871  if(fwdcell > 4) contained = true;
872  } // end if track ends projections contained
873 
874  return contained;
875 
876  }// ContainedEvent
size_t NTrajectoryPoints() const
Definition: Track.h:83
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
TVector3 TrajectoryPoint(unsigned int i) const
The ith point on the trajectory, a 3-vector in cm.
Definition: Track.cxx:158
int ProjectedLiveCellsToEdge(TVector3 vertex, TVector3 dir)
recommended projection to use
virtual TVector3 Dir() const
Unit vector describing prong direction.
Definition: Prong.h:77
art::ServiceHandle< geo::LiveGeometry > flivegeom
TVector3 Stop() const
Position of the final trajectory point.
Definition: Track.cxx:186
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 remid::ReMIdDedxFD::endJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 832 of file ReMIdDedxFD_module.cc.

References fPOT, and fTotalPOT.

833  {
834  fPOT->Fill(.5, fTotalPOT);
835  }
TH1D * fPOT
Histogram of POT passing spill cuts.
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
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  }
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 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

art::ServiceHandle<cheat::BackTracker> remid::ReMIdDedxFD::bt
private

Definition at line 163 of file ReMIdDedxFD_module.cc.

Referenced by analyze().

TTree* remid::ReMIdDedxFD::DedxSample
private

Tree for holding dE/dx variables needed for making signal sample histograms.

Definition at line 104 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fADC
private

Definition at line 135 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

art::ServiceHandle<photrans::FiberBrightness> remid::ReMIdDedxFD::fb
private

Definition at line 165 of file ReMIdDedxFD_module.cc.

Referenced by analyze().

int remid::ReMIdDedxFD::fCell
private

Definition at line 133 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fDe
private

Definition at line 130 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fDedx
private

Definition at line 107 of file ReMIdDedxFD_module.cc.

Referenced by beginJob().

float remid::ReMIdDedxFD::fDistDedx
private

Definition at line 110 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fDx
private

Definition at line 138 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

bool remid::ReMIdDedxFD::fFD
private

Is detector FD?

Definition at line 92 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginRun().

int remid::ReMIdDedxFD::fFiberBrightness
private

Definition at line 156 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

std::string remid::ReMIdDedxFD::fGeneratorLabel
private

Definition at line 80 of file ReMIdDedxFD_module.cc.

Referenced by ReMIdDedxFD().

art::ServiceHandle<geo::Geometry> remid::ReMIdDedxFD::fgeom
private

Definition at line 160 of file ReMIdDedxFD_module.cc.

Referenced by beginRun().

std::string remid::ReMIdDedxFD::fHitModuleLabel
private

Definition at line 76 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and ReMIdDedxFD().

art::ServiceHandle<geo::LiveGeometry> remid::ReMIdDedxFD::flivegeom
private

Definition at line 162 of file ReMIdDedxFD_module.cc.

Referenced by ContainedEvent().

float remid::ReMIdDedxFD::fmcDe
private

Definition at line 151 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fmcDeBirks
private

Definition at line 152 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fmcDx
private

Definition at line 153 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fMIP
private

Definition at line 137 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fmyDedx
private

Definition at line 129 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

int remid::ReMIdDedxFD::fnCellsPerPlane
private

Definition at line 128 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

int remid::ReMIdDedxFD::fnDedx
private

Definition at line 108 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

int remid::ReMIdDedxFD::fnDedxUsed
private

Definition at line 109 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

std::string remid::ReMIdDedxFD::fNumiBeamLabel
private

Definition at line 81 of file ReMIdDedxFD_module.cc.

std::string remid::ReMIdDedxFD::fNumuEnergyLabel
private

Definition at line 83 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and ReMIdDedxFD().

bool remid::ReMIdDedxFD::fPassHadEOnMuonTrack
private

Definition at line 125 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

bool remid::ReMIdDedxFD::fPassOffTrackEnergy
private

Definition at line 124 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

bool remid::ReMIdDedxFD::fPassOffTrackHits
private

Definition at line 123 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

int remid::ReMIdDedxFD::fpdg
private

Definition at line 117 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fPE
private

Definition at line 134 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fPECorr
private

Definition at line 136 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

std::string remid::ReMIdDedxFD::fPidLabel
private

Where to find the pids.

Definition at line 79 of file ReMIdDedxFD_module.cc.

int remid::ReMIdDedxFD::fPlane
private

Definition at line 132 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

TH1D* remid::ReMIdDedxFD::fPOT
private

Histogram of POT passing spill cuts.

Definition at line 86 of file ReMIdDedxFD_module.cc.

Referenced by beginJob(), and endJob().

std::string remid::ReMIdDedxFD::fQepidLabel
private

Definition at line 84 of file ReMIdDedxFD_module.cc.

art::ServiceHandle<nova::dbi::RunHistoryService> remid::ReMIdDedxFD::frh
private

Definition at line 161 of file ReMIdDedxFD_module.cc.

std::string remid::ReMIdDedxFD::fSliceLabel
private

Where to find reconstructed slices.

Definition at line 77 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and ReMIdDedxFD().

TH1D* remid::ReMIdDedxFD::fSlicesPassingSelectionCuts
private

Definition at line 87 of file ReMIdDedxFD_module.cc.

Referenced by beginJob().

std::string remid::ReMIdDedxFD::fSpillQualLabel
private

Definition at line 82 of file ReMIdDedxFD_module.cc.

float remid::ReMIdDedxFD::ftHit
private

Definition at line 147 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

double remid::ReMIdDedxFD::fTotalPOT
private

Definition at line 91 of file ReMIdDedxFD_module.cc.

Referenced by beginJob(), and endJob().

std::string remid::ReMIdDedxFD::fTrackLabel
private

Where to find recondtructed tracks.

Definition at line 78 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and ReMIdDedxFD().

float remid::ReMIdDedxFD::fTrackLength
private

Definition at line 95 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fTrueE
private

Definition at line 155 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

TH1D* remid::ReMIdDedxFD::fTrueSlicesPassingSelectionCuts
private

Definition at line 88 of file ReMIdDedxFD_module.cc.

Referenced by beginJob().

bool remid::ReMIdDedxFD::fUsed
private

Definition at line 120 of file ReMIdDedxFD_module.cc.

Referenced by beginJob().

bool remid::ReMIdDedxFD::fVert
private

Definition at line 119 of file ReMIdDedxFD_module.cc.

Referenced by beginJob().

int remid::ReMIdDedxFD::fView
private

Definition at line 131 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fxDead
private

Definition at line 139 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fxDir
private

Definition at line 148 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fxEnd
private

Definition at line 142 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fxHit
private

Definition at line 144 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fxStart
private

Definition at line 140 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fyDir
private

Definition at line 149 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fyEnd
private

Definition at line 143 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fyHit
private

Definition at line 145 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fyStart
private

Definition at line 141 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fzDir
private

Definition at line 150 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fzEnd
private

Definition at line 122 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fzHit
private

Definition at line 146 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().

float remid::ReMIdDedxFD::fzStart
private

Definition at line 121 of file ReMIdDedxFD_module.cc.

Referenced by analyze(), and beginJob().


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