All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Hitdumper Class Reference
Inheritance diagram for Hitdumper:

Public Member Functions

 Hitdumper (fhicl::ParameterSet const &p)
 
virtual ~Hitdumper ()
 
void beginJob () override
 
void reconfigure (fhicl::ParameterSet const &pset)
 
void analyze (const art::Event &evt) override
 
virtual void beginSubRun (art::SubRun const &sr) override
 

Private Member Functions

void ResetVars ()
 Resets the variables that are saved to the TTree. More...
 
void ResetWireHitsVars (int n)
 Resets wire hits tree variables. More...
 
void ResetCRTStripsVars (int n)
 Resets crt strips tree variables. More...
 
void ResetCRTCustomTracksVars (int n)
 Resets custom crt tracks tree variables. More...
 
void ResetCRTTracksVars (int n)
 Resets crt tracks tree variables. More...
 
void ResetCRTHitsVars (int n)
 Resets crt hits tree variables. More...
 
void ResetOpHitsVars (int n)
 Resets optical hits tree variables. More...
 
void ResetPmtTriggerVars (int n)
 Resets pmt hardware trigger variables. More...
 
void ResetPmtSoftTriggerVars ()
 Rests pmt software trigger variables. More...
 
void ResetCrtSoftTriggerVars ()
 Resets crt software trigger variables. More...
 
void ResetMuonTracksVars (int n)
 Resets crossing muon tracks tree variables. More...
 
void ResetMuonHitVars (int n)
 Resets crossing muon hit tree variables. More...
 
void ResizeMCNeutrino (int nNeutrinos)
 Resize the data structure for MCNeutrino particles. More...
 
void ResizeGenie (int nPrimaries)
 Resize the data structure for Genie primaries. More...
 

Private Attributes

opdet::sbndPDMapAlg _pd_map
 
TTree * fTree
 
int _run
 The run number. More...
 
int _subrun
 The subrun number. More...
 
int _event
 The event number. More...
 
double _evttime
 The event time. More...
 
int _t0
 The t0. More...
 
int _nhits
 Number of reco hits in the event. More...
 
std::vector< int > _hit_cryostat
 Cryostat where the hit belongs to. More...
 
std::vector< int > _hit_tpc
 TPC where the hit belongs to. More...
 
std::vector< int > _hit_plane
 Plane where the hit belongs to. More...
 
std::vector< int > _hit_wire
 Wire where the hit belongs to. More...
 
std::vector< int > _hit_channel
 Channel where the hit belongs to. More...
 
std::vector< double > _hit_peakT
 Hit peak time. More...
 
std::vector< double > _hit_charge
 Hit charge. More...
 
std::vector< double > _hit_ph
 Hit ph? More...
 
std::vector< double > _hit_width
 Hit width. More...
 
std::vector< double > _hit_full_integral
 Hit charge integral. More...
 
std::vector< int > _waveform_number
 Number for each waveform, to allow for searching. More...
 
std::vector< double > _adc_on_wire
 ADC on wire to draw waveform. More...
 
std::vector< int > _time_for_waveform
 Time for waveform to plot. More...
 
int _adc_count
 Used for plotting waveforms. More...
 
std::vector< int > _waveform_integral
 Used to see progression of the waveform integral. More...
 
std::vector< int > _adc_count_in_waveform
 Used to view all waveforms on a hitplane together. More...
 
int _nstrips
 Number of CRT strips. More...
 
std::vector< int > _crt_plane
 CRT plane. More...
 
std::vector< int > _crt_module
 CRT module. More...
 
std::vector< int > _crt_strip
 CRT strip. More...
 
std::vector< int > _crt_orient
 CRT orientation (0 for y (horizontal) and 1 for x (vertical)) More...
 
std::vector< double > _crt_time
 CRT time. More...
 
std::vector< double > _crt_adc
 CRT adc. More...
 
std::vector< double > _crt_pos_x
 CRT position X. More...
 
std::vector< double > _crt_pos_y
 CRT position Y. More...
 
std::vector< double > _crt_pos_z
 CRT position Z. More...
 
int _nctrks
 Number of created CRT tracks. More...
 
std::vector< double > _ctrk_x1
 CRT track x1. More...
 
std::vector< double > _ctrk_y1
 CRT track y1. More...
 
std::vector< double > _ctrk_z1
 CRT track z1. More...
 
std::vector< double > _ctrk_t1
 CRT track t1. More...
 
std::vector< double > _ctrk_adc1
 CRT track adc1. More...
 
std::vector< int > _ctrk_mod1x
 CRT track mod2x. More...
 
std::vector< double > _ctrk_x2
 CRT track x2. More...
 
std::vector< double > _ctrk_y2
 CRT track y2. More...
 
std::vector< double > _ctrk_z2
 CRT track z2. More...
 
std::vector< double > _ctrk_t2
 CRT track t2. More...
 
std::vector< double > _ctrk_adc2
 CRT track adc2. More...
 
std::vector< int > _ctrk_mod2x
 CRT track mod2x. More...
 
int _nchits
 Number of CRT hits. More...
 
std::vector< double > _chit_x
 CRT hit x. More...
 
std::vector< double > _chit_y
 CRT hit y. More...
 
std::vector< double > _chit_z
 CRT hit z. More...
 
std::vector< double > _chit_time
 CRT hit time. More...
 
std::vector< int > _chit_plane
 CRT hit plane. More...
 
int _ncts
 Number of CRT tracks. More...
 
std::vector< double > _ct_time
 CRT track time. More...
 
std::vector< double > _ct_pes
 CRT track PEs. More...
 
std::vector< double > _ct_x1
 CRT track x1. More...
 
std::vector< double > _ct_y1
 CRT track y1. More...
 
std::vector< double > _ct_z1
 CRT track z1. More...
 
std::vector< double > _ct_x2
 CRT track x2. More...
 
std::vector< double > _ct_y2
 CRT track y2. More...
 
std::vector< double > _ct_z2
 CRT track z2. More...
 
int _nophits
 Number of Optical Hits. More...
 
std::vector< int > _ophit_opch
 OpChannel of the optical hit. More...
 
std::vector< int > _ophit_opdet
 OpDet of the optical hit. More...
 
std::vector< double > _ophit_peakT
 Peak time of the optical hit. More...
 
std::vector< double > _ophit_width
 Width of the optical hit. More...
 
std::vector< double > _ophit_area
 Area of the optical hit. More...
 
std::vector< double > _ophit_amplitude
 Amplitude of the optical hit. More...
 
std::vector< double > _ophit_pe
 PEs of the optical hit. More...
 
std::vector< double > _ophit_opdet_x
 OpDet X coordinate of the optical hit. More...
 
std::vector< double > _ophit_opdet_y
 OpDet Y coordinate of the optical hit. More...
 
std::vector< double > _ophit_opdet_z
 OpDet Z coordinate of the optical hit. More...
 
std::vector< int > _ophit_opdet_type
 OpDet tyoe of the optical hit. More...
 
std::vector< int > _pmtTrigger_npmtshigh
 number of pmt pairs above threshold, index = time during trigger window (usually beam spill) More...
 
int _pmtTrigger_maxpassed
 maximum number of pmt pairs above threshold during trigger window (usually beam spill) More...
 
bool _pmtSoftTrigger_foundBeamTrigger
 
int _pmtSoftTrigger_tts
 Whether the beam spill was found or not. More...
 
double _pmtSoftTrigger_promptPE
 Trigger Time Stamp (TTS), ns (relative to start of beam spill) More...
 
double _pmtSoftTrigger_prelimPE
 Total photoelectron count 100 ns after the TTS. More...
 
int _pmtSoftTrigger_nAboveThreshold
 Total photoelectron count before the TTS, during the beam spill. More...
 
int _crtSoftTrigger_hitsperplane [7]
 number of individual PMTs above ADC threshold (fcl) during the beam spill More...
 
int _nmuontrks
 number of muon tracks More...
 
std::vector< double > _muontrk_t0
 t0 (time of interaction) More...
 
std::vector< float > _muontrk_x1
 x coordinate closer to anode More...
 
std::vector< float > _muontrk_y1
 y coordinate closer to anode More...
 
std::vector< float > _muontrk_z1
 z coordinate closer to anode More...
 
std::vector< float > _muontrk_x2
 x coordinate closer to cathode More...
 
std::vector< float > _muontrk_y2
 y coordinate closer to cathode More...
 
std::vector< float > _muontrk_z2
 z coordinate closer to cathode More...
 
std::vector< float > _muontrk_theta_xz
 theta_xz trajectory angle More...
 
std::vector< float > _muontrk_theta_yz
 theta_yz trajectory angle More...
 
std::vector< int > _muontrk_tpc
 tpc that muon is located in More...
 
std::vector< int > _muontrk_type
 type of muon track More...
 
int _nmhits
 Number of muon collection hits per track. More...
 
std::vector< int > _mhit_trk
 Track number that the hit belongs to. More...
 
std::vector< int > _mhit_tpc
 TPC where the hit belongs to. More...
 
std::vector< int > _mhit_wire
 Wire where the hit belongs to. More...
 
std::vector< int > _mhit_channel
 Channel where the hit belongs to. More...
 
std::vector< double > _mhit_peakT
 Hit peak time. More...
 
std::vector< double > _mhit_charge
 Hit charge. More...
 
size_t MaxMCNeutrinos
 
Int_t mcevts_truth
 ! The number of MCNeutrinos there is currently room for More...
 
std::vector< Int_t > nuScatterCode_truth
 Scattering code given by Genie for each neutrino. More...
 
std::vector< Int_t > nuID_truth
 Unique ID of each true neutrino. More...
 
std::vector< Int_t > nuPDG_truth
 neutrino PDG code More...
 
std::vector< Int_t > ccnc_truth
 0=CC 1=NC More...
 
std::vector< Int_t > mode_truth
 0=QE/El, 1=RES, 2=DIS, 3=Coherent production More...
 
std::vector< Float_t > enu_truth
 true neutrino energy More...
 
std::vector< Float_t > Q2_truth
 Momentum transfer squared. More...
 
std::vector< Float_t > W_truth
 hadronic invariant mass More...
 
std::vector< Int_t > hitnuc_truth
 hit nucleon More...
 
std::vector< Float_t > nuvtxx_truth
 neutrino vertex x More...
 
std::vector< Float_t > nuvtxy_truth
 neutrino vertex y More...
 
std::vector< Float_t > nuvtxz_truth
 neutrino vertex z More...
 
std::vector< Float_t > nu_dcosx_truth
 neutrino dcos x More...
 
std::vector< Float_t > nu_dcosy_truth
 neutrino dcos y More...
 
std::vector< Float_t > nu_dcosz_truth
 neutrino dcos z More...
 
std::vector< Float_t > lep_mom_truth
 lepton momentum More...
 
std::vector< Float_t > lep_dcosx_truth
 lepton dcos x More...
 
std::vector< Float_t > lep_dcosy_truth
 lepton dcos y More...
 
std::vector< Float_t > lep_dcosz_truth
 lepton dcos z More...
 
std::vector< Float_t > tpx_flux
 Px of parent particle leaving BNB target. More...
 
std::vector< Float_t > tpy_flux
 Py of parent particle leaving BNB target. More...
 
std::vector< Float_t > tpz_flux
 Pz of parent particle leaving BNB target. More...
 
std::vector< Int_t > tptype_flux
 Type of parent particle leaving BNB target. More...
 
size_t MaxGeniePrimaries = 0
 
Int_t genie_no_primaries
 
std::vector< Int_t > genie_primaries_pdg
 
std::vector< Float_t > genie_Eng
 
std::vector< Float_t > genie_Px
 
std::vector< Float_t > genie_Py
 
std::vector< Float_t > genie_Pz
 
std::vector< Float_t > genie_P
 
std::vector< Int_t > genie_status_code
 
std::vector< Float_t > genie_mass
 
std::vector< Int_t > genie_trackID
 
std::vector< Int_t > genie_ND
 
std::vector< Int_t > genie_mother
 
TTree * _sr_tree
 A tree filled per subrun (for POT accounting) More...
 
int _sr_run
 
int _sr_subrun
 
double _sr_begintime
 
double _sr_endtime
 
double _sr_pot
 POTs in each subrun. More...
 
int _max_hits
 maximum number of hits (to be set via fcl) More...
 
int _max_ophits
 maximum number of hits (to be set via fcl) More...
 
int _max_samples
 maximum number of samples (to be set via fcl) More...
 
int _max_chits
 maximum number of CRT hits (to be set via fcl) More...
 
int _max_nctrks
 maximum number of CRT tracks (to be set via fcl) More...
 
std::string fHitsModuleLabel
 Label for Hit dataproduct (to be set via fcl) More...
 
std::string fLArG4ModuleLabel
 Label for LArG4 dataproduct (to be set via fcl) More...
 
std::string fCRTStripModuleLabel
 Label for CRTStrip dataproduct (to be set via fcl) More...
 
std::string fCRTHitModuleLabel
 Label for CRTHit dataproduct (to be set via fcl) More...
 
std::string fCRTTrackModuleLabel
 Label for CRTTrack dataproduct (to be set via fcl) More...
 
std::string fpmtTriggerModuleLabel
 Label for pmtTrigger dataproduct (to be set vis fcl) More...
 
std::string fpmtSoftTriggerModuleLabel
 Label for pmt software trigger data product (to be set via fcl) More...
 
std::string fcrtSoftTriggerModuleLabel
 Label for crt software trigger data product (to be set via fcl) More...
 
std::string fMuonTrackModuleLabel
 Label for MuonTrack dataproduct (to be set via fcl) More...
 
std::string fDigitModuleLabel
 Label for digitizer (to be set via fcl) More...
 
std::string fGenieGenModuleLabel
 Label for Genie dataproduct (to be set via fcl) More...
 
std::vector< std::string > fOpHitsModuleLabels
 Labels for OpHit dataproducts (to be set via fcl) More...
 
bool fkeepCRThits
 Keep the CRT hits (to be set via fcl) More...
 
bool fkeepCRTstrips
 Keep the CRT strips (to be set via fcl) More...
 
bool fmakeCRTtracks
 Make the CRT tracks (to be set via fcl) More...
 
bool freadCRTtracks
 Keep the CRT tracks (to be set via fcl) More...
 
bool freadOpHits
 Add OpHits to output (to be set via fcl) More...
 
bool freadMuonTracks
 Add MuonTracks to output (to be set via fcl) More...
 
bool freadMuonHits
 Add MuonTrack hits to output(to be set via fcl) More...
 
bool freadTruth
 Add Truth info to output (to be set via fcl) More...
 
bool freadpmtTrigger
 Add pmt hardware trigger info to output (to be set via fcl) More...
 
bool freadpmtSoftTrigger
 Add pmt software trigger info to output (to be set via fcl) More...
 
bool freadcrtSoftTrigger
 Add crt software trigger info to output (to be set via fcl) More...
 
bool fsavePOTInfo
 Add POT info to output (to be set via fcl) More...
 
bool fcheckTransparency
 Checks for wire transprency (to be set via fcl) More...
 
bool fUncompressWithPed
 Uncompresses the waveforms if true (to be set via fcl) More...
 
int fWindow
 
bool fSkipInd
 If true, induction planes are not saved (to be set via fcl) More...
 
std::vector< int > fKeepTaggerTypes = {0, 1, 2, 3, 4, 5, 6}
 Taggers to keep (to be set via fcl) More...
 
sbnd::CRTHitRecoAlg hitAlg
 
geo::GeometryCore const * fGeometryService
 
art::ServiceHandle
< geo::AuxDetGeometry
fAuxDetGeoService
 
const geo::AuxDetGeometryfAuxDetGeo
 
const geo::AuxDetGeometryCorefAuxDetGeoCore
 

Detailed Description

Definition at line 99 of file HitDumper_module.cc.

Constructor & Destructor Documentation

Hitdumper::Hitdumper ( fhicl::ParameterSet const &  p)
explicit

Definition at line 385 of file HitDumper_module.cc.

386 : EDAnalyzer(pset)
387 {
388 
389  fGeometryService = lar::providerFrom<geo::Geometry>();
390  // fDetectorClocks = lar::providerFrom<detinfo::DetectorClocksService>();
391  // fDetectorProperties = lar::providerFrom<detinfo::DetectorPropertiesService>();
392  // fTrigClock = fDetectorClocks->TriggerClock();
393  fAuxDetGeo = &(*fAuxDetGeoService);
394  fAuxDetGeoCore = fAuxDetGeo->GetProviderPtr();
395 
396  // Read in the parameters from the .fcl file.
397  this->reconfigure(pset);
398 }
void reconfigure(fhicl::ParameterSet const &pset)
const geo::AuxDetGeometryCore * fAuxDetGeoCore
const geo::AuxDetGeometry * fAuxDetGeo
geo::GeometryCore const * fGeometryService
Hitdumper::~Hitdumper ( )
virtual

Definition at line 444 of file HitDumper_module.cc.

445 {
446  // Clean up dynamic memory and other resources here.
447 }

Member Function Documentation

void Hitdumper::analyze ( const art::Event &  evt)
override

Definition at line 450 of file HitDumper_module.cc.

451 {
452  // Reset the TTree variables
453  ResetVars();
454 
455  _run = evt.run();
456  _subrun = evt.subRun();
457  _event = evt.id().event();
458 
459  _t0 = 0.;
460  // t0 = detprop->TriggerOffset(); // units of TPC ticks
461 
462  //
463  // Hits
464  //
465  art::Handle<std::vector<recob::Hit>> hitListHandle;
466  std::vector<art::Ptr<recob::Hit>> hitlist;
467  if (evt.getByLabel(fHitsModuleLabel,hitListHandle)) {
468  art::fill_ptr_vector(hitlist, hitListHandle);
469  _nhits = hitlist.size();
470 
471  // Calculate how many hits we will save if skipping the induction planes
472  if (fSkipInd) {
473  _nhits = 0;
474  for (auto h : hitlist) {
475  if (h->WireID().Plane == 2) {
476  _nhits++;
477  }
478  }
479  }
480  }
481  else {
482  std::cout << "Failed to get recob::Hit data product." << std::endl;
483  _nhits = 0;
484  }
485 
486  if (_nhits > _max_hits) {
487  std::cout << "Available hits are " << _nhits
488  << ", which is above the maximum number allowed to store." << std::endl;
489  std::cout << "Will only store " << _max_hits << "hits." << std::endl;
490  _nhits = _max_hits;
491  }
492 
494 
495  size_t counter = 0;
496  for (size_t i = 0; i < hitlist.size(); ++i) {
497  geo::WireID wireid = hitlist[i]->WireID();
498  if (fSkipInd && wireid.Plane != 2) {
499  continue;
500  }
501 
502  _hit_cryostat[counter] = wireid.Cryostat;
503  _hit_tpc[counter] = wireid.TPC;
504  _hit_plane[counter] = wireid.Plane;
505  _hit_wire[counter] = wireid.Wire;
506  _hit_channel[counter] = hitlist[i]->Channel();
507  // peak time needs plane dependent offset correction applied.
508  _hit_peakT[counter] = hitlist[i]->PeakTime();
509  _hit_charge[counter] = hitlist[i]->Integral();
510  _hit_ph[counter] = hitlist[i]->PeakAmplitude();
511  _hit_width[counter] = hitlist[i]->RMS();
512  counter ++;
513  }
514 
515  //
516  // CRT strips
517  //
518  int _nstr = 0;
519  art::Handle<std::vector<sbnd::crt::CRTData> > crtStripListHandle;
520  std::vector<art::Ptr<sbnd::crt::CRTData> > striplist;
521  // art::Handle< std::vector<sbnd::crt::CRTData> > crtStripListHandle;
522  // std::vector< art::Ptr<sbnd::crt::CRTData> > striplist;
523  if (evt.getByLabel(fCRTStripModuleLabel, crtStripListHandle)) {
524  art::fill_ptr_vector(striplist, crtStripListHandle);
525  _nstr = striplist.size();
526  } else {
527  std::cout << "Failed to get sbnd::crt::CRTData data product." << std::endl;
528  }
529 
530  int ns = 0;
531  if (_nstr > _max_chits) _nstr = _max_chits;
532  // strips are always in pairs, one entry for each sipm (2 sipms per strip)
533 
534  ResetCRTStripsVars(_nstr);
535 
536  for (int i = 0; i < _nstr; i += 2){
537  uint32_t chan = striplist[i]->Channel();
538 
539  // std::pair<std::string,unsigned> tagger = CRTHitRecoAlg::ChannelToTagger(chan);
540  std::pair<std::string,unsigned> tagger = hitAlg.ChannelToTagger(chan);
542 
543  bool keep_tagger = false;
544  for (auto t : fKeepTaggerTypes) {
545  if (ip == t) {
546  keep_tagger = true;
547  }
548  }
549  // std::cout << "Tagger name " << tagger.first << ", ip " << ip << ", kept? " << (keep_tagger ? "yes" : "no") << std::endl;
550 
551  if (ip != sbnd::kCRTNotDefined && keep_tagger) {
552 
553  uint32_t ttime = striplist[i]->T0();
554  float ctime = (int)ttime * 0.001; // convert form ns to us
555  // recover simulation bug where neg times are sotred as unsigned integers
556  // if (ttime > MAX_INT) ctime = 0.001 * (ttime - MAX_INT * 2);
557  if (ctime < 1600. && ctime > -1400.) {
558  uint32_t adc1 = striplist[i]->ADC();
559  uint32_t adc2 = striplist[i+1]->ADC();
560  if (adc1 > 4095) adc1 = 4095;
561  if (adc2 > 4095) adc2 = 4095;
562  // std::cout << tagger.first << " " << tagger.second << std::endl;
563  // int sipm = chan & 1; // 0 or 1
564  int strip = (chan >> 1) & 15;
565  int module = (chan>> 5);
566  //
567  std::string name = fGeometryService->AuxDet(module).TotalVolume()->GetName();
568  TVector3 center = fAuxDetGeoCore->AuxDetChannelToPosition(2*strip, name);
569  _crt_plane.push_back(ip);
570  _crt_module.push_back(module);
571  _crt_strip.push_back(strip);
572  _crt_orient.push_back(tagger.second);
573  _crt_time.push_back(ctime);
574  _crt_adc.push_back(adc1 + adc2 - 127.2); // -127.2/131.9 correct for gain and 2*ped to get pe
575  _crt_pos_x.push_back(center.X());
576  _crt_pos_y.push_back(center.Y());
577  _crt_pos_z.push_back(center.Z());
578  ns++;
579  }
580  }
581  }
582  _nstrips = ns;
583 
584 
585 
586  //
587  // CRT Custom Tracks
588  //
590  _nctrks = 0;
591  if (fmakeCRTtracks) {
592  int ntr = 0;
593  int iflag[1000] = {0};
594  for (int i = 0; i < (ns - 1); ++i) {
595  if (iflag[i] == 0) {
596  iflag[i] = 1;
597  float plane1x = 0, plane2x = 0;
598  float plane1y = 0, plane2y = 0;
599  float plane1tx = 0, plane2tx = 0;
600  float plane1ty = 0, plane2ty = 0;
601  float plane1xm = -1, plane2xm = -1;
602  float plane1ym = -1, plane2ym = -1;
603  int nh1x = 0, nh2x = 0;
604  int nh1y = 0, nh2y = 0;
605  float adc1x = 0, adc2x = 0;
606  float adc1y = 0, adc2y = 0;
607  if (_crt_plane[i] == sbnd::kCRTFaceSouth) { // 1
608  if (_crt_orient[i] == kCRTVertical && _crt_adc[i] > 500) { // < 500 hardcoded
609  if (nh1x == 0 || (_crt_module[i] == plane1xm)) {
610  nh1x++;
611  if (_crt_adc[i] > adc1x) {
612  plane1tx = _crt_time[i];
613  adc1x += _crt_adc[i];
614  plane1x = _crt_pos_x[i];
615  plane1xm = _crt_module[i];
616  }
617  }
618  }
619  else if (_crt_orient[i]==kCRTHorizontal && _crt_adc[i]>500) { // < 500 hardcoded
620  if (nh1y==0 || (_crt_module[i]==plane1ym)) {
621  nh1y++;
622  if (_crt_adc[i]>adc1y) {
623  plane1ty=_crt_time[i];
624  adc1y+=_crt_adc[i];
625  plane1y=_crt_pos_y[i];
626  plane1ym=_crt_module[i];
627  }
628  }
629  }
630  }
631  else {
632  if (_crt_orient[i]==kCRTVertical && _crt_adc[i]>500) { // < 500 hardcoded
633  if (nh2x==0 || (_crt_module[i]==plane2xm)) {
634  nh2x++;
635  if (_crt_adc[i]>adc2x) {
636  plane2tx=_crt_time[i];
637  adc2x+=_crt_adc[i];
638  plane2x=_crt_pos_x[i];
639  plane2xm=_crt_module[i];
640  }
641  }
642  }
643  else if (_crt_orient[i]==kCRTHorizontal && _crt_adc[i]>500) { // < 500 hardcoded
644  if (nh2y==0 || (_crt_module[i]==plane2ym)) {
645  nh2y++;
646  if (_crt_adc[i]>adc2y) {
647  plane2ty=_crt_time[i];
648  adc2y+=_crt_adc[i];
649  plane2y=_crt_pos_y[i];
650  plane2ym=_crt_module[i];
651  }
652  }
653  }
654  }
655  for (int j=i+1;j<ns;++j) {
656  float tdiff = fabs(_crt_time[i]-_crt_time[j]);
657  if (tdiff<0.1) {
658  iflag[j]=1;
660  if (_crt_orient[j]==kCRTVertical && _crt_adc[j]>1000) {
661  if (nh1x==0 || (_crt_module[j]==plane1xm)) {
662  nh1x++;
663  if (_crt_adc[j]>adc1x) {
664  plane1tx=_crt_time[j];
665  adc1x+=_crt_adc[j];
666  plane1x=_crt_pos_x[j];
667  plane1xm=_crt_module[j];
668  }
669  }
670  }
671  else if (_crt_orient[j]==kCRTHorizontal && _crt_adc[j]>1000) {
672  if (nh1y==0 || (_crt_module[j]==plane1ym)) {
673  nh1y++;
674  if (_crt_adc[j]>adc1y) {
675  plane1ty=_crt_time[j];
676  adc1y+=_crt_adc[j];
677  plane1y=_crt_pos_y[j];
678  plane1ym=_crt_module[j];
679  }
680  }
681  }
682  }
683  else {
684  if (_crt_orient[j]==kCRTVertical && _crt_adc[j]>1000) {
685  if (nh2x==0 || (_crt_module[j]==plane2xm)) {
686  nh2x++;
687  if (_crt_adc[j]>adc2x) {
688  plane2tx=_crt_time[j];
689  adc2x+=_crt_adc[j];
690  plane2x=_crt_pos_x[j];
691  plane2xm=_crt_module[j];
692  }
693  }
694  }
695  else if (_crt_orient[j]==kCRTHorizontal && _crt_adc[j]>1000) {
696  if (nh2y==0 || (_crt_module[j]==plane2ym)) {
697  nh2y++;
698  if (_crt_adc[j]>adc2y) {
699  plane2ty=_crt_time[j];
700  adc2y+=_crt_adc[j];
701  plane2y=_crt_pos_y[j];
702  plane2ym=_crt_module[j];
703  }
704  }
705  }
706  }
707  }
708  } // look for hits at the same time as hit i
709  if (nh1x>0 && nh1y>0 && nh2x>0 && nh2y>0 && adc1x<9000 && adc1y<9000 && adc2x<9000 && adc2y<9000) {
710  // make a track!
711  _ctrk_x1.push_back(plane1x);
712  _ctrk_y1.push_back(plane1y);
713  _ctrk_z1.push_back(-239.95);
714  _ctrk_t1.push_back(0.5*(plane1tx+plane1ty));
715  _ctrk_adc1.push_back(adc1x+adc1y);
716  _ctrk_mod1x.push_back(plane1xm);
717  _ctrk_x2.push_back(plane2x);
718  _ctrk_y2.push_back(plane2y);
719  _ctrk_z2.push_back(656.25);
720  _ctrk_t2.push_back(0.5*(plane2tx+plane2ty));
721  _ctrk_adc2.push_back(adc2x+adc2y);
722  _ctrk_mod2x.push_back(plane2xm);
723  ntr++;
724  // std::cout << "track " << ntr << std::endl;
725  // std::cout << "x y t adc: plane 1 " << plane1x << " " << plane1y << " " <<
726  // 0.5*(plane1tx+plane1ty) << " " << adc1x << " " << adc1y << std::endl;
727  // std::cout << " : plane 2 " << plane2x << " " << plane2y << " " <<
728  // 0.5*(plane2tx+plane2ty) << " " << adc2x << " " << adc2y << std::endl;
729  }
730  } // i is the first hit with this time
731  } // loop over hits
732  _nctrks = ntr;
733  } // end if make tracks
734 
735  //
736  // CRT hits
737  //
738  if (fkeepCRThits) {
739  art::Handle<std::vector<sbn::crt::CRTHit> > crtHitListHandle;
740  std::vector<art::Ptr<sbn::crt::CRTHit> > chitlist;
741  // art::Handle< std::vector<sbnd::crt::CRTData> > crtStripListHandle;
742  // std::vector< art::Ptr<sbnd::crt::CRTData> > striplist;
743  if (evt.getByLabel(fCRTHitModuleLabel, crtHitListHandle)) {
744  art::fill_ptr_vector(chitlist, crtHitListHandle);
745  _nchits = chitlist.size();
746  }
747  else {
748  std::cout << "Failed to get sbn::crt::CRTHit data product." << std::endl;
749  _nchits = 0;
750  }
751 
752  if (_nchits > _max_chits) {
753  std::cout << "Available CRT hits are " << _nchits
754  << ", which is above the maximum number allowed to store." << std::endl;
755  std::cout << "Will only store " << _max_chits << "CRT hits." << std::endl;
757  }
758 
760 
761  for (int i = 0; i < _nchits; ++i){
762  // int ip = kNotDefined;
763  sbnd::CRTPlane ip = sbnd::CRTCommonUtils::GetPlaneIndex(chitlist[i]->tagger);
764 
765  _chit_time[i]=chitlist[i]->ts1_ns*0.001;
766  if (chitlist[i]->ts1_ns > MAX_INT) {
767  _chit_time[i] = 0.001 * (chitlist[i]->ts1_ns - TIME_CORRECTION);
768  }
769 
770  _chit_x[i] = chitlist[i]->x_pos;
771  _chit_y[i] = chitlist[i]->y_pos;
772  _chit_z[i] = chitlist[i]->z_pos;
773  _chit_plane[i] = ip;
774  }
775  }
776 
777  //
778  // CRT tracks
779  //
780  _ncts = 0;
781  if (freadCRTtracks) {
782  art::Handle<std::vector<sbn::crt::CRTTrack> > crtTrackListHandle;
783  std::vector<art::Ptr<sbn::crt::CRTTrack> > ctrklist;
784  if (evt.getByLabel(fCRTTrackModuleLabel, crtTrackListHandle)) {
785  art::fill_ptr_vector(ctrklist, crtTrackListHandle);
786  _ncts = ctrklist.size();
788 
790 
791  for (int i = 0; i < _ncts; ++i){
792  _ct_pes[i] = ctrklist[i]->peshit;
793  _ct_time[i] = ctrklist[i]->ts1_ns*0.001;
794  if (ctrklist[i]->ts1_ns > MAX_INT) {
795  _ct_time[i] = 0.001 * (ctrklist[i]->ts1_ns - TIME_CORRECTION);
796  }
797  _ct_x1[i] = ctrklist[i]->x1_pos;
798  _ct_y1[i] = ctrklist[i]->y1_pos;
799  _ct_z1[i] = ctrklist[i]->z1_pos;
800  _ct_x2[i] = ctrklist[i]->x2_pos;
801  _ct_y2[i] = ctrklist[i]->y2_pos;
802  _ct_z2[i] = ctrklist[i]->z2_pos;
803  }
804  } else {
805  std::cout << "Failed to get sbn::crt::CRTTrack data product." << std::endl;
806  }
807  }
808 
809 
810  //
811  // Optical Hits
812  //
813  if (freadOpHits) {
814  _nophits = 0;
815  size_t previous_nophits = 0;
816 
817  // Loop over all the ophits labels
818  for (auto ophit_label : fOpHitsModuleLabels) {
819 
820  art::Handle<std::vector<recob::OpHit>> ophitListHandle;
821  std::vector<art::Ptr<recob::OpHit>> ophitlist;
822  if (evt.getByLabel(ophit_label, ophitListHandle)) {
823  art::fill_ptr_vector(ophitlist, ophitListHandle);
824  _nophits += ophitlist.size();
825  }
826  else {
827  std::cout << "Failed to get recob::OpHit data product." << std::endl;
828  }
829 
830  if (_nophits > _max_ophits) {
831  std::cout << "Available optical hits are " << _nophits << ", which is above the maximum number allowed to store." << std::endl;
832  std::cout << "Will only store " << _max_ophits << " optical hits." << std::endl;
834  }
835 
837 
838  for (size_t i = 0; i < ophitlist.size(); ++i) {
839  size_t index = previous_nophits + i;
840  _ophit_opch[index] = ophitlist.at(i)->OpChannel();
841  _ophit_opdet[index] = fGeometryService->OpDetFromOpChannel(ophitlist.at(i)->OpChannel());
842  _ophit_peakT[index] = ophitlist.at(i)->PeakTime();
843  _ophit_width[index] = ophitlist.at(i)->Width();
844  _ophit_area[index] = ophitlist.at(i)->Area();
845  _ophit_amplitude[index] = ophitlist.at(i)->Amplitude();
846  _ophit_pe[index] = ophitlist.at(i)->PE();
847  auto opdet_center = fGeometryService->OpDetGeoFromOpChannel(ophitlist.at(i)->OpChannel()).GetCenter();
848  _ophit_opdet_x[index] = opdet_center.X();
849  _ophit_opdet_y[index] = opdet_center.Y();
850  _ophit_opdet_z[index] = opdet_center.Z();
851  auto pd_type = _pd_map.pdType(ophitlist.at(i)->OpChannel());
852  if (pd_type == "pmt_coated") {_ophit_opdet_type[index] = kPMTCoated;}
853  else if (pd_type == "pmt_uncoated") {_ophit_opdet_type[index] = kPMTUnCoated;}
854  else if (pd_type == "xarapuca_vis") {_ophit_opdet_type[index] = kXArapucaVis;}
855  else if (pd_type == "xarapuca_vuv") {_ophit_opdet_type[index] = kXArapucaVuv;}
856  else {_ophit_opdet_type[index] = kPDNotDefined;}
857  }
858  previous_nophits = _nophits;
859  }
860  }
861 
862  //
863  // pmt hardware trigger
864  //
865 
866  if (freadpmtTrigger){
867  art::Handle<std::vector<sbnd::comm::pmtTrigger> > pmtTriggerListHandle;
868  std::vector<art::Ptr<sbnd::comm::pmtTrigger> > pmttriggerlist;
869 
870  if (evt.getByLabel(fpmtTriggerModuleLabel, pmtTriggerListHandle)){
871  art::fill_ptr_vector(pmttriggerlist, pmtTriggerListHandle);
872  ResetPmtTriggerVars( (int)pmttriggerlist[0]->numPassed.size());
873 
874  for (int i=0; i < (int)pmttriggerlist[0]->numPassed.size(); i++){
875  _pmtTrigger_npmtshigh[i] = pmttriggerlist[0]->numPassed[i];
876  }
877  _pmtTrigger_maxpassed = pmttriggerlist[0]->maxPMTs;
878 
879  }
880  else{
881  std::cout << "Failed to get sbnd::comm::pmtTrigger data product" << std::endl;
882  }
883  }
884 
885  //
886  // PMT Software Trigger
887  //
888  if (freadpmtSoftTrigger){
889  art::Handle<sbnd::trigger::pmtSoftwareTrigger> pmtSoftTriggerHandle;
890  if (evt.getByLabel(fpmtSoftTriggerModuleLabel, pmtSoftTriggerHandle)){
891  const sbnd::trigger::pmtSoftwareTrigger &pmtSoftTriggerMetrics = (*pmtSoftTriggerHandle);
893  _pmtSoftTrigger_foundBeamTrigger = pmtSoftTriggerMetrics.foundBeamTrigger;
894  _pmtSoftTrigger_tts = pmtSoftTriggerMetrics.triggerTimestamp;
895  _pmtSoftTrigger_promptPE = pmtSoftTriggerMetrics.promptPE;
896  _pmtSoftTrigger_prelimPE = pmtSoftTriggerMetrics.prelimPE;
897  _pmtSoftTrigger_nAboveThreshold = pmtSoftTriggerMetrics.nAboveThreshold;
898  // _pmtSoftTrigger_pmtInfoVec = pmtsofttriggerlist[0]->pmtInfoVec;
899  }
900  else{
901  std::cout << "Failed to get sbnd::trigger::pmtSoftwareTrigger data product" << std::endl;
902  }
903  }
904 
905  //
906  // CRT Software Trigger
907  //
908  if (freadcrtSoftTrigger){
909  art::Handle<sbndaq::CRTmetric> crtSoftTriggerHandle;
910  if (evt.getByLabel(fcrtSoftTriggerModuleLabel, crtSoftTriggerHandle)){
911  const sbndaq::CRTmetric &crtSoftTriggerMetrics = (*crtSoftTriggerHandle);
913  for (int i=0; i<7; i++){
914  _crtSoftTrigger_hitsperplane[i] = crtSoftTriggerMetrics.hitsperplane[i];
915  }
916  }
917  else{
918  std::cout << "Failed to get sbndaq::crtMetric data product" << std::endl;
919  }
920 
921  }
922 
923  //
924  // Muon tracks
925  //
926  _nmuontrks = 0;
927  if (freadMuonTracks){
928  art::Handle<std::vector<sbnd::comm::MuonTrack> > muonTrackListHandle;
929  std::vector<art::Ptr<sbnd::comm::MuonTrack> > muontrklist;
930 
931  if (evt.getByLabel(fMuonTrackModuleLabel, muonTrackListHandle)){
932  art::fill_ptr_vector(muontrklist, muonTrackListHandle);
933  _nmuontrks = muontrklist.size();
935 
936  for (int i=0; i < _nmuontrks; i++){
937  _muontrk_t0[i] = muontrklist[i]->t0_us;
938  _muontrk_x1[i] = muontrklist[i]->x1_pos;
939  _muontrk_y1[i] = muontrklist[i]->y1_pos;
940  _muontrk_z1[i] = muontrklist[i]->z1_pos;
941  _muontrk_x2[i] = muontrklist[i]->x2_pos;
942  _muontrk_y2[i] = muontrklist[i]->y2_pos;
943  _muontrk_z2[i] = muontrklist[i]->z2_pos;
944  _muontrk_theta_xz[i] = muontrklist[i]->theta_xz;
945  _muontrk_theta_yz[i] = muontrklist[i]->theta_yz;
946  _muontrk_tpc[i] = muontrklist[i]->tpc;
947  _muontrk_type[i] = muontrklist[i]->type;
948  }
949  if (freadMuonHits){
950  art::FindMany<recob::Hit> muontrkassn(muonTrackListHandle, evt, fMuonTrackModuleLabel);
951  ResetMuonHitVars(3000); //estimate of maximum collection hits
952  _nmhits = 0;
953  for (int i=0; i < _nmuontrks; i++){
954  std::vector< const recob::Hit*> muonhitsVec = muontrkassn.at(i);
955  _nmhits += (muonhitsVec.size());
956  for (size_t j=0; j<muonhitsVec.size(); j++){
957  auto muonhit = muonhitsVec.at(j);
958  geo::WireID wireid = muonhit->WireID();
959  _mhit_trk.push_back(i);
960  _mhit_tpc.push_back(wireid.TPC);
961  _mhit_wire.push_back(wireid.Wire);
962  _mhit_channel.push_back(muonhit->Channel());
963  _mhit_peakT.push_back(muonhit->PeakTime());
964  _mhit_charge.push_back(muonhit->Integral());
965  }
966  }
967  }
968  }
969  else{
970  std::cout << "Failed to get sbnd::comm::MuonTrack data product" << std::endl;
971  }
972  }
973 
974  if (fcheckTransparency) {
975 
976  _waveform_number.resize(_max_hits*_max_samples, -9999.);
977  _adc_on_wire.resize(_max_hits*_max_samples, -9999.);
978  _time_for_waveform.resize(_max_hits*_max_samples, -9999.);
979  _waveform_integral.resize(_max_hits*_max_samples, -9999.);
980  _adc_count_in_waveform.resize(_max_hits*_max_samples, -9999.);
981 
982  art::Handle<std::vector<raw::RawDigit>> digitVecHandle;
983 
984  bool retVal = evt.getByLabel(fDigitModuleLabel, digitVecHandle);
985  if(retVal == true) {
986  mf::LogInfo("HitDumper") << "I got fDigitModuleLabel: " << fDigitModuleLabel << std::endl;
987  } else {
988  mf::LogWarning("HitDumper") << "Could not get fDigitModuleLabel: " << fDigitModuleLabel << std::endl;
989  }
990 
991  int waveform_number_tracker = 0;
992  int adc_counter = 1;
993  _adc_count = _nhits * (fWindow * 2 + 1);
994 
995  // loop over waveforms
996  for(size_t rdIter = 0; rdIter < digitVecHandle->size(); ++rdIter) {
997 
998  //GET THE REFERENCE TO THE CURRENT raw::RawDigit.
999  art::Ptr<raw::RawDigit> digitVec(digitVecHandle, rdIter);
1000  int channel = digitVec->Channel();
1001  auto fDataSize = digitVec->Samples();
1002  std::vector<short> rawadc; //UNCOMPRESSED ADC VALUES.
1003  rawadc.resize(fDataSize);
1004 
1005  // see if there is a hit on this channel
1006  for (int ihit = 0; ihit < _nhits; ++ihit) {
1007  if (_hit_channel[ihit] == channel) {
1008 
1009  int pedestal = (int)digitVec->GetPedestal();
1010  //UNCOMPRESS THE DATA.
1011  if (fUncompressWithPed) {
1012  raw::Uncompress(digitVec->ADCs(), rawadc, pedestal, digitVec->Compression());
1013  }
1014  else {
1015  raw::Uncompress(digitVec->ADCs(), rawadc, digitVec->Compression());
1016  }
1017 
1018  unsigned int bin = _hit_peakT[ihit];
1019  unsigned int low_edge,high_edge;
1020  if((int)bin > fWindow and _hit_plane[ihit] == 0) {
1021  low_edge = bin - (2*fWindow);
1022  }
1023  else if ((int)bin>fWindow) {
1024  low_edge = bin-fWindow;
1025  }
1026  else {
1027  low_edge = 0;
1028  }
1029  high_edge = bin + fWindow;
1030  if (high_edge > (fDataSize-1)) {
1031  high_edge = fDataSize - 1;
1032  }
1033  double integral = 0.0;
1034  waveform_number_tracker++;
1035  int counter_for_adc_in_waveform = 0;
1036  for (size_t ibin = low_edge; ibin <= high_edge; ++ibin) {
1037  _adc_count_in_waveform[adc_counter] = counter_for_adc_in_waveform;
1038  counter_for_adc_in_waveform++;
1039  _waveform_number[adc_counter] = waveform_number_tracker;
1040  _adc_on_wire[adc_counter] = rawadc[ibin]-pedestal;
1041  _time_for_waveform[adc_counter] = ibin;
1042  //std::cout << "DUMP: " << _waveform_number[adc_counter] << " " << _adc_count << " " << _hit_plane[ihit] << " " << _hit_wire[ihit] << " " <<ibin << " " << (rawadc[ibin]-pedestal) << " " << _time_for_waveform[adc_counter] << " " << _adc_on_wire[adc_counter] << std::endl;
1043  integral+=_adc_on_wire[adc_counter];
1044  _waveform_integral[adc_counter] = integral;
1045  adc_counter++;
1046  }
1047  std::cout << "DUMP SUM: " << _hit_tpc[ihit] << " " << _hit_plane[ihit] << " " << _hit_wire[ihit] << " " << integral << " " << waveform_number_tracker << std::endl;
1048  _hit_full_integral[ihit] = integral;
1049  } // if hit channel matches waveform channel
1050  } //end loop over hits
1051  }// end loop over waveforms
1052  }// end if fCheckTrasparency
1053 
1054 
1055  if (freadTruth){
1056 
1057  int nGeniePrimaries = 0, nMCNeutrinos = 0;
1058  art::Handle< std::vector<simb::MCTruth> > mctruthListHandle;
1059  std::vector<art::Ptr<simb::MCTruth> > mclist;
1060  if (evt.getByLabel(fGenieGenModuleLabel,mctruthListHandle)){
1061  art::fill_ptr_vector(mclist, mctruthListHandle);
1062  }else {
1063  std::cout << "Failed to get Genie data product." << std::endl;
1064  }
1065 
1066  art::Ptr<simb::MCTruth> mctruth;
1067 
1068  if (!mclist.empty()) {//at least one mc record
1069 
1070  mctruth = mclist[0];
1071 
1072  if (mctruth->NeutrinoSet()) nGeniePrimaries = mctruth->NParticles();
1073 
1074  } // if have MC truth
1075  MF_LOG_DEBUG("HitDumper") << "Expected " << nGeniePrimaries << " GENIE particles";
1076 
1077  //Initially call the number of neutrinos to be stored the number of MCTruth objects. This is not strictly true i.e. BNB + cosmic overlay but we will count the number of neutrinos later
1078  nMCNeutrinos = mclist.size();
1079 
1080  ResizeGenie(nGeniePrimaries);
1081  ResizeMCNeutrino(nMCNeutrinos);
1082 
1083  mcevts_truth = mclist.size();
1084  //Brailsford 2017/10/16
1085  //Issue 17917
1086  //To keep a 1:1 between neutrinos and 'flux' we need the assns
1087  art::FindManyP<simb::MCFlux> fmFluxNeutrino(mctruthListHandle, evt, fGenieGenModuleLabel);
1088  // Get GTruth information for scattering code
1089  art::FindManyP< simb::GTruth > fmgt( mctruthListHandle, evt, fGenieGenModuleLabel );
1090 
1091  if (mcevts_truth > 0){//at least one mc record
1092 
1093  //Brailsford 2017/10/16
1094  //Issue 17917
1095  //Loop over every truth in the spill rather than just looking at the first one.
1096  //Because MCTruth could be a neutrino OR something else (e.g. cosmics) we are going to have to count up how many neutrinos there are
1097  mcevts_truth = 0;
1098  for (unsigned int i_mctruth = 0; i_mctruth < mclist.size(); i_mctruth++){
1099  //fetch an mctruth
1100  art::Ptr<simb::MCTruth> curr_mctruth = mclist[i_mctruth];
1101  //Check if it's a neutrino
1102  if (!curr_mctruth->NeutrinoSet()) continue;
1103 
1104  // Genie Truth association only for the neutrino
1105  if (fmgt.size()>i_mctruth) {
1106  std::vector< art::Ptr<simb::GTruth> > mcgtAssn = fmgt.at(i_mctruth);
1107 
1108  nuScatterCode_truth[i_mctruth] = mcgtAssn[0]->fGscatter;
1109  } else {
1110  nuScatterCode_truth[i_mctruth] = -1.;
1111  }
1112 
1113  nuPDG_truth[i_mctruth] = curr_mctruth->GetNeutrino().Nu().PdgCode();
1114  ccnc_truth[i_mctruth] = curr_mctruth->GetNeutrino().CCNC();
1115  mode_truth[i_mctruth] = curr_mctruth->GetNeutrino().Mode();
1116  Q2_truth[i_mctruth] = curr_mctruth->GetNeutrino().QSqr();
1117  W_truth[i_mctruth] = curr_mctruth->GetNeutrino().W();
1118  hitnuc_truth[i_mctruth] = curr_mctruth->GetNeutrino().HitNuc();
1119  enu_truth[i_mctruth] = curr_mctruth->GetNeutrino().Nu().E();
1120  nuvtxx_truth[i_mctruth] = curr_mctruth->GetNeutrino().Nu().Vx();
1121  nuvtxy_truth[i_mctruth] = curr_mctruth->GetNeutrino().Nu().Vy();
1122  nuvtxz_truth[i_mctruth] = curr_mctruth->GetNeutrino().Nu().Vz();
1123  if (curr_mctruth->GetNeutrino().Nu().P()){
1124  nu_dcosx_truth[i_mctruth] = curr_mctruth->GetNeutrino().Nu().Px()/curr_mctruth->GetNeutrino().Nu().P();
1125  nu_dcosy_truth[i_mctruth] = curr_mctruth->GetNeutrino().Nu().Py()/curr_mctruth->GetNeutrino().Nu().P();
1126  nu_dcosz_truth[i_mctruth] = curr_mctruth->GetNeutrino().Nu().Pz()/curr_mctruth->GetNeutrino().Nu().P();
1127  }
1128  lep_mom_truth[i_mctruth] = curr_mctruth->GetNeutrino().Lepton().P();
1129  if (curr_mctruth->GetNeutrino().Lepton().P()){
1130  lep_dcosx_truth[i_mctruth] = curr_mctruth->GetNeutrino().Lepton().Px()/curr_mctruth->GetNeutrino().Lepton().P();
1131  lep_dcosy_truth[i_mctruth] = curr_mctruth->GetNeutrino().Lepton().Py()/curr_mctruth->GetNeutrino().Lepton().P();
1132  lep_dcosz_truth[i_mctruth] = curr_mctruth->GetNeutrino().Lepton().Pz()/curr_mctruth->GetNeutrino().Lepton().P();
1133  }
1134  //Brailsford
1135  //2017/10/17
1136  //Issue 12918
1137  //Use the art::Ptr key as the neutrino's unique ID
1138  nuID_truth[i_mctruth] = curr_mctruth.key();
1139  //We need to also store N 'flux' neutrinos per event so now check that the FindOneP is valid and, if so, use it!
1140  if (fmFluxNeutrino.isValid()){
1141  if (fmFluxNeutrino.at(0).size()>i_mctruth){
1142  art::Ptr<simb::MCFlux> curr_mcflux = fmFluxNeutrino.at(0).at(i_mctruth);
1143  tpx_flux[i_mctruth] = curr_mcflux->ftpx;
1144  tpy_flux[i_mctruth] = curr_mcflux->ftpy;
1145  tpz_flux[i_mctruth] = curr_mcflux->ftpz;
1146  tptype_flux[i_mctruth] = curr_mcflux->ftptype;
1147  }
1148  }
1149 
1150  //Let's increase the neutrino count
1151  mcevts_truth++;
1152  }
1153 
1154  if (mctruth->NeutrinoSet()){
1155  //genie particles information
1156  genie_no_primaries = mctruth->NParticles();
1157 
1158  size_t StoreParticles = std::min((size_t) genie_no_primaries, MaxGeniePrimaries);
1159  if (genie_no_primaries > (int) StoreParticles) {
1160  // got this error? it might be a bug,
1161  // since the structure should have enough room for everything
1162  mf::LogError("HitDumper") << "event has "
1163  << genie_no_primaries << " MC particles, only "
1164  << StoreParticles << " stored in tree";
1165  }
1166  for(size_t iPart = 0; iPart < StoreParticles; ++iPart){
1167  const simb::MCParticle& part(mctruth->GetParticle(iPart));
1168  genie_primaries_pdg[iPart]=part.PdgCode();
1169  genie_Eng[iPart]=part.E();
1170  genie_Px[iPart]=part.Px();
1171  genie_Py[iPart]=part.Py();
1172  genie_Pz[iPart]=part.Pz();
1173  genie_P[iPart]=part.P();
1174  genie_status_code[iPart]=part.StatusCode();
1175  genie_mass[iPart]=part.Mass();
1176  genie_trackID[iPart]=part.TrackId();
1177  genie_ND[iPart]=part.NumberDaughters();
1178  genie_mother[iPart]=part.Mother();
1179  } // for particle
1180  } //if neutrino set
1181  }//if (mcevts_truth)
1182  }//if (fReadTruth){
1183 
1184 
1185 
1186  fTree->Fill();
1187 
1188 }
int _pmtTrigger_maxpassed
maximum number of pmt pairs above threshold during trigger window (usually beam spill) ...
bool fSkipInd
If true, induction planes are not saved (to be set via fcl)
void ResetOpHitsVars(int n)
Resets optical hits tree variables.
std::vector< Int_t > genie_status_code
std::vector< double > _ophit_opdet_y
OpDet Y coordinate of the optical hit.
std::vector< int > _time_for_waveform
Time for waveform to plot.
std::vector< int > _hit_cryostat
Cryostat where the hit belongs to.
void ResetCRTStripsVars(int n)
Resets crt strips tree variables.
std::vector< int > _pmtTrigger_npmtshigh
number of pmt pairs above threshold, index = time during trigger window (usually beam spill) ...
std::vector< Int_t > mode_truth
0=QE/El, 1=RES, 2=DIS, 3=Coherent production
void ResizeGenie(int nPrimaries)
Resize the data structure for Genie primaries.
int _nctrks
Number of created CRT tracks.
std::vector< double > _ctrk_z2
CRT track z2.
bool fUncompressWithPed
Uncompresses the waveforms if true (to be set via fcl)
std::vector< double > _ophit_peakT
Peak time of the optical hit.
std::vector< float > _muontrk_x1
x coordinate closer to anode
std::vector< int > _hit_wire
Wire where the hit belongs to.
std::vector< Float_t > lep_dcosy_truth
lepton dcos y
std::vector< Float_t > tpx_flux
Px of parent particle leaving BNB target.
unsigned int event
Definition: DataStructs.h:634
void ResetWireHitsVars(int n)
Resets wire hits tree variables.
int _nmuontrks
number of muon tracks
std::vector< int > fKeepTaggerTypes
Taggers to keep (to be set via fcl)
std::vector< float > _muontrk_z1
z coordinate closer to anode
int _max_chits
maximum number of CRT hits (to be set via fcl)
std::vector< int > _mhit_trk
Track number that the hit belongs to.
std::vector< int > _mhit_wire
Wire where the hit belongs to.
std::vector< int > _hit_channel
Channel where the hit belongs to.
std::vector< float > _muontrk_x2
x coordinate closer to cathode
size_t MaxGeniePrimaries
int _crtSoftTrigger_hitsperplane[7]
number of individual PMTs above ADC threshold (fcl) during the beam spill
unsigned int run
Definition: DataStructs.h:635
int _nhits
Number of reco hits in the event.
opdet::sbndPDMapAlg _pd_map
std::vector< std::string > fOpHitsModuleLabels
Labels for OpHit dataproducts (to be set via fcl)
int _event
The event number.
std::vector< double > _chit_time
CRT hit time.
Int_t mcevts_truth
! The number of MCNeutrinos there is currently room for
std::vector< int > _adc_count_in_waveform
Used to view all waveforms on a hitplane together.
std::vector< double > _crt_pos_y
CRT position Y.
void ResizeMCNeutrino(int nNeutrinos)
Resize the data structure for MCNeutrino particles.
std::vector< int > _muontrk_tpc
tpc that muon is located in
std::vector< double > _crt_time
CRT time.
std::string fCRTStripModuleLabel
Label for CRTStrip dataproduct (to be set via fcl)
std::string fGenieGenModuleLabel
Label for Genie dataproduct (to be set via fcl)
std::vector< double > _ophit_pe
PEs of the optical hit.
std::vector< double > _mhit_peakT
Hit peak time.
std::string fHitsModuleLabel
Label for Hit dataproduct (to be set via fcl)
std::vector< int > _hit_tpc
TPC where the hit belongs to.
std::vector< int > _waveform_number
Number for each waveform, to allow for searching.
Uncoated PMT.
std::vector< Float_t > nuvtxy_truth
neutrino vertex y
std::vector< double > _ct_z2
CRT track z2.
std::vector< Float_t > nu_dcosx_truth
neutrino dcos x
std::vector< Float_t > Q2_truth
Momentum transfer squared.
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
const int MAX_INT
std::vector< Float_t > nu_dcosy_truth
neutrino dcos y
std::vector< double > _ophit_opdet_z
OpDet Z coordinate of the optical hit.
bool fkeepCRThits
Keep the CRT hits (to be set via fcl)
std::vector< Float_t > genie_P
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:580
std::vector< double > _crt_pos_z
CRT position Z.
void ResetCRTCustomTracksVars(int n)
Resets custom crt tracks tree variables.
std::vector< Float_t > nuvtxz_truth
neutrino vertex z
bool freadCRTtracks
Keep the CRT tracks (to be set via fcl)
std::vector< int > _crt_module
CRT module.
int _nchits
Number of CRT hits.
std::string fpmtSoftTriggerModuleLabel
Label for pmt software trigger data product (to be set via fcl)
std::vector< Float_t > nu_dcosz_truth
neutrino dcos z
std::vector< Float_t > tpy_flux
Py of parent particle leaving BNB target.
int _run
The run number.
std::vector< int > _mhit_tpc
TPC where the hit belongs to.
int _max_samples
maximum number of samples (to be set via fcl)
unsigned int OpDetFromOpChannel(int opChannel) const
Convert unique channel to detector number.
std::vector< Int_t > tptype_flux
Type of parent particle leaving BNB target.
void ResetCRTHitsVars(int n)
Resets crt hits tree variables.
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
std::vector< double > _hit_width
Hit width.
int _nmhits
Number of muon collection hits per track.
std::vector< int > _ophit_opdet_type
OpDet tyoe of the optical hit.
int hitsperplane[7]
Definition: CRTmetric.hh:13
std::vector< Float_t > genie_Eng
Not defined.
int _max_ophits
maximum number of hits (to be set via fcl)
while getopts h
std::vector< double > _crt_adc
CRT adc.
Arapuca VUV.
std::vector< Int_t > nuID_truth
Unique ID of each true neutrino.
std::vector< int > _crt_strip
CRT strip.
std::vector< int > _ctrk_mod2x
CRT track mod2x.
sbnd::CRTHitRecoAlg hitAlg
std::vector< Float_t > genie_Py
std::vector< double > _ctrk_x1
CRT track x1.
std::vector< double > _ct_y1
CRT track y1.
std::vector< Int_t > nuScatterCode_truth
Scattering code given by Genie for each neutrino.
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
Definition: counter.h:285
std::vector< Float_t > genie_Pz
std::vector< Int_t > hitnuc_truth
hit nucleon
std::vector< Float_t > lep_dcosx_truth
lepton dcos x
std::vector< double > _ct_y2
CRT track y2.
bool freadMuonTracks
Add MuonTracks to output (to be set via fcl)
std::vector< double > _hit_full_integral
Hit charge integral.
Arapuca Vis.
std::vector< double > _ctrk_y2
CRT track y2.
std::vector< double > _adc_on_wire
ADC on wire to draw waveform.
std::vector< int > _hit_plane
Plane where the hit belongs to.
int _nstrips
Number of CRT strips.
std::vector< double > _chit_y
CRT hit y.
void ResetPmtTriggerVars(int n)
Resets pmt hardware trigger variables.
std::vector< double > _mhit_charge
Hit charge.
const geo::AuxDetGeometryCore * fAuxDetGeoCore
enum::sbnd::CRTPlane GetPlaneIndex(std::string tagger)
const long int TIME_CORRECTION
std::string fMuonTrackModuleLabel
Label for MuonTrack dataproduct (to be set via fcl)
std::vector< double > _ctrk_t1
CRT track t1.
Int_t genie_no_primaries
std::vector< double > _ophit_amplitude
Amplitude of the optical hit.
std::vector< Float_t > W_truth
hadronic invariant mass
std::vector< float > _muontrk_z2
z coordinate closer to cathode
std::string fpmtTriggerModuleLabel
Label for pmtTrigger dataproduct (to be set vis fcl)
std::vector< double > _ctrk_adc1
CRT track adc1.
void ResetCrtSoftTriggerVars()
Resets crt software trigger variables.
return match has_match and(match.match_pdg==11 or match.match_pdg==-11)
std::vector< float > _muontrk_theta_yz
theta_yz trajectory angle
std::vector< Int_t > ccnc_truth
0=CC 1=NC
double _pmtSoftTrigger_prelimPE
Total photoelectron count 100 ns after the TTS.
std::pair< std::string, unsigned > ChannelToTagger(uint32_t channel)
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
std::vector< int > _ctrk_mod1x
CRT track mod2x.
std::vector< Float_t > genie_Px
std::vector< double > _ctrk_z1
CRT track z1.
int _nophits
Number of Optical Hits.
std::vector< int > _waveform_integral
Used to see progression of the waveform integral.
int _adc_count
Used for plotting waveforms.
bool freadpmtSoftTrigger
Add pmt software trigger info to output (to be set via fcl)
std::vector< Int_t > genie_trackID
std::vector< double > _hit_ph
Hit ph?
std::vector< Float_t > tpz_flux
Pz of parent particle leaving BNB target.
double _pmtSoftTrigger_promptPE
Trigger Time Stamp (TTS), ns (relative to start of beam spill)
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
bool fcheckTransparency
Checks for wire transprency (to be set via fcl)
std::vector< Float_t > enu_truth
true neutrino energy
std::vector< int > _crt_plane
CRT plane.
std::string fcrtSoftTriggerModuleLabel
Label for crt software trigger data product (to be set via fcl)
std::vector< double > _ophit_width
Width of the optical hit.
std::vector< Int_t > genie_primaries_pdg
std::vector< double > _ct_x1
CRT track x1.
void ResetMuonTracksVars(int n)
Resets crossing muon tracks tree variables.
std::vector< double > _ct_x2
CRT track x2.
Horizontal Tagger.
std::vector< double > _ctrk_t2
CRT track t2.
std::vector< double > _ct_z1
CRT track z1.
bool freadpmtTrigger
Add pmt hardware trigger info to output (to be set via fcl)
int _subrun
The subrun number.
bool _pmtSoftTrigger_foundBeamTrigger
std::vector< Float_t > genie_mass
int _max_nctrks
maximum number of CRT tracks (to be set via fcl)
std::string fCRTTrackModuleLabel
Label for CRTTrack dataproduct (to be set via fcl)
bool freadOpHits
Add OpHits to output (to be set via fcl)
std::vector< Int_t > nuPDG_truth
neutrino PDG code
bool fmakeCRTtracks
Make the CRT tracks (to be set via fcl)
std::vector< int > _chit_plane
CRT hit plane.
std::vector< Float_t > lep_dcosz_truth
lepton dcos z
std::vector< double > _crt_pos_x
CRT position X.
std::vector< Int_t > genie_mother
const TGeoVolume * TotalVolume() const
Definition: AuxDetGeo.h:106
int _ncts
Number of CRT tracks.
bool freadMuonHits
Add MuonTrack hits to output(to be set via fcl)
std::vector< double > _chit_x
CRT hit x.
Coated PMT.
VertivalTagger.
std::vector< double > _chit_z
CRT hit z.
std::vector< Float_t > lep_mom_truth
lepton momentum
std::vector< double > _muontrk_t0
t0 (time of interaction)
std::vector< float > _muontrk_y1
y coordinate closer to anode
std::string fDigitModuleLabel
Label for digitizer (to be set via fcl)
bool freadcrtSoftTrigger
Add crt software trigger info to output (to be set via fcl)
std::vector< double > _ctrk_x2
CRT track x2.
static double tdiff(const art::Timestamp &ts1, const art::Timestamp &ts2)
int _max_hits
maximum number of hits (to be set via fcl)
std::vector< double > _hit_peakT
Hit peak time.
std::vector< double > _hit_charge
Hit charge.
constexpr WireID()=default
Default constructor: an invalid TPC ID.
std::vector< int > _ophit_opch
OpChannel of the optical hit.
unsigned int subRun
Definition: DataStructs.h:636
std::vector< Int_t > genie_ND
std::vector< double > _ctrk_y1
CRT track y1.
void ResetPmtSoftTriggerVars()
Rests pmt software trigger variables.
then echo fcl name
geo::GeometryCore const * fGeometryService
std::vector< double > _ctrk_adc2
CRT track adc2.
std::vector< float > _muontrk_y2
y coordinate closer to cathode
int _pmtSoftTrigger_nAboveThreshold
Total photoelectron count before the TTS, during the beam spill.
void ResetMuonHitVars(int n)
Resets crossing muon hit tree variables.
TCEvent evt
Definition: DataStructs.cxx:8
std::vector< int > _mhit_channel
Channel where the hit belongs to.
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
Definition: raw.cxx:776
void ResetCRTTracksVars(int n)
Resets crt tracks tree variables.
std::vector< double > _ct_time
CRT track time.
std::string pdType(size_t ch) const override
std::string fCRTHitModuleLabel
Label for CRTHit dataproduct (to be set via fcl)
OpDetGeo const & OpDetGeoFromOpChannel(unsigned int OpChannel) const
Returns the geo::OpDetGeo object for the given channel number.
int _pmtSoftTrigger_tts
Whether the beam spill was found or not.
std::vector< float > _muontrk_theta_xz
theta_xz trajectory angle
std::vector< Float_t > nuvtxx_truth
neutrino vertex x
std::vector< int > _ophit_opdet
OpDet of the optical hit.
TVector3 AuxDetChannelToPosition(uint32_t const &channel, std::string const &auxDetName) const
std::vector< int > _muontrk_type
type of muon track
std::vector< int > _crt_orient
CRT orientation (0 for y (horizontal) and 1 for x (vertical))
BEGIN_PROLOG could also be cout
int _t0
The t0.
std::vector< double > _ophit_area
Area of the optical hit.
void ResetVars()
Resets the variables that are saved to the TTree.
std::vector< double > _ct_pes
CRT track PEs.
bool freadTruth
Add Truth info to output (to be set via fcl)
std::vector< double > _ophit_opdet_x
OpDet X coordinate of the optical hit.
void Hitdumper::beginJob ( )
override

Definition at line 1190 of file HitDumper_module.cc.

1191  {
1192  // Implementation of optional member function here.
1193  art::ServiceHandle<art::TFileService> tfs;
1194  fTree = tfs->make<TTree>("hitdumpertree","analysis tree");
1195  fTree->Branch("run",&_run,"run/I");
1196  fTree->Branch("subrun",&_subrun,"subrun/I");
1197  fTree->Branch("event",&_event,"event/I");
1198  fTree->Branch("evttime",&_evttime,"evttime/D");
1199  fTree->Branch("t0",&_t0,"t0/I");
1200 
1201  fTree->Branch("nhits", &_nhits, "nhits/I");
1202  fTree->Branch("hit_cryostat", &_hit_cryostat);
1203  fTree->Branch("hit_tpc", &_hit_tpc);
1204  fTree->Branch("hit_plane", &_hit_plane);
1205  fTree->Branch("hit_wire", &_hit_wire);
1206  fTree->Branch("hit_channel", &_hit_channel);
1207  fTree->Branch("hit_peakT", &_hit_peakT);
1208  fTree->Branch("hit_charge", &_hit_charge);
1209  fTree->Branch("hit_ph", &_hit_ph);
1210  fTree->Branch("hit_width", &_hit_width);
1211  fTree->Branch("hit_full_integral", &_hit_full_integral);
1212 
1213  if (fcheckTransparency) {
1214  fTree->Branch("adc_count", &_adc_count,"adc_count/I");
1215  fTree->Branch("waveform_number", &_waveform_number);
1216  fTree->Branch("time_for_waveform",&_time_for_waveform);
1217  fTree->Branch("adc_on_wire", &_adc_on_wire);
1218  fTree->Branch("waveform_integral", &_waveform_integral);
1219  fTree->Branch("adc_count_in_waveform", &_adc_count_in_waveform);
1220  }
1221 
1222  if (fkeepCRTstrips) {
1223  fTree->Branch("nstrips", &_nstrips, "nstrips/I");
1224  fTree->Branch("crt_plane", &_crt_plane);
1225  fTree->Branch("crt_module", &_crt_module);
1226  fTree->Branch("crt_strip", &_crt_strip);
1227  fTree->Branch("crt_orient", &_crt_orient);
1228  fTree->Branch("crt_time", &_crt_time);
1229  fTree->Branch("crt_adc", &_crt_adc);
1230  fTree->Branch("crt_pos_x", &_crt_pos_x);
1231  fTree->Branch("crt_pos_y", &_crt_pos_y);
1232  fTree->Branch("crt_pos_z", &_crt_pos_z);
1233  }
1234 
1235  if (fmakeCRTtracks) {
1236  fTree->Branch("nctrks", &_nctrks, "nctrks/I");
1237  fTree->Branch("ctrk_x1", &_ctrk_x1);
1238  fTree->Branch("ctrk_y1", &_ctrk_y1);
1239  fTree->Branch("ctrk_z1", &_ctrk_z1);
1240  fTree->Branch("ctrk_t1", &_ctrk_t1);
1241  fTree->Branch("ctrk_adc1", &_ctrk_adc1);
1242  fTree->Branch("ctrk_mod1x", &_ctrk_mod1x);
1243  fTree->Branch("ctrk_x2", &_ctrk_x2);
1244  fTree->Branch("ctrk_y2", &_ctrk_y2);
1245  fTree->Branch("ctrk_z2", &_ctrk_z2);
1246  fTree->Branch("ctrk_t2", &_ctrk_t2);
1247  fTree->Branch("ctrk_adc2", &_ctrk_adc2);
1248  fTree->Branch("ctrk_mod2x", &_ctrk_mod2x);
1249  }
1250  if (fkeepCRThits) {
1251  fTree->Branch("nchits", &_nchits, "nchits/I");
1252  fTree->Branch("chit_x", &_chit_x);
1253  fTree->Branch("chit_y", &_chit_y);
1254  fTree->Branch("chit_z", &_chit_z);
1255  fTree->Branch("chit_time", &_chit_time);
1256  fTree->Branch("chit_plane", &_chit_plane);
1257  }
1258  if (freadCRTtracks) {
1259  fTree->Branch("ncts", &_ncts, "ncts/I");
1260  fTree->Branch("ct_x1", &_ct_x1);
1261  fTree->Branch("ct_y1", &_ct_y1);
1262  fTree->Branch("ct_z1", &_ct_z1);
1263  fTree->Branch("ct_x2", &_ct_x2);
1264  fTree->Branch("ct_y2", &_ct_y2);
1265  fTree->Branch("ct_z2", &_ct_z2);
1266  fTree->Branch("ct_time", &_ct_time);
1267  fTree->Branch("ct_pes", &_ct_pes);
1268  }
1269 
1270  if (freadOpHits) {
1271  fTree->Branch("nophits", &_nophits, "nophits/I");
1272  fTree->Branch("ophit_opch", &_ophit_opch);
1273  fTree->Branch("ophit_opdet", &_ophit_opdet);
1274  fTree->Branch("ophit_peakT", &_ophit_peakT);
1275  fTree->Branch("ophit_width", &_ophit_width);
1276  fTree->Branch("ophit_area", &_ophit_area);
1277  fTree->Branch("ophit_amplitude", &_ophit_amplitude);
1278  fTree->Branch("ophit_pe", &_ophit_pe);
1279  fTree->Branch("ophit_opdet_x", &_ophit_opdet_x);
1280  fTree->Branch("ophit_opdet_y", &_ophit_opdet_y);
1281  fTree->Branch("ophit_opdet_z", &_ophit_opdet_z);
1282  fTree->Branch("ophit_opdet_type", &_ophit_opdet_type);
1283  }
1284 
1285  if (freadpmtTrigger){
1286  fTree->Branch("pmtTrigger_npmtshigh", &_pmtTrigger_npmtshigh);
1287  fTree->Branch("pmtTrigger_maxpassed", &_pmtTrigger_maxpassed, "pmtTrigger_maxpassed/I");
1288  }
1289 
1290  if (freadpmtSoftTrigger){
1291  fTree->Branch("pmtSoftTrigger_foundBeamTrigger", &_pmtSoftTrigger_foundBeamTrigger);
1292  fTree->Branch("pmtSoftTrigger_tts", &_pmtSoftTrigger_tts);
1293  fTree->Branch("pmtSoftTrigger_promptPE", &_pmtSoftTrigger_promptPE);
1294  fTree->Branch("pmtSoftTrigger_prelimPE", &_pmtSoftTrigger_prelimPE);
1295  fTree->Branch("pmtSoftTrigger_nAboveThreshold", &_pmtSoftTrigger_nAboveThreshold);
1296  // fTree->Branch("pmtSoftTrigger_", &_pmtSoftTigger_)
1297  }
1298 
1299  if (freadcrtSoftTrigger){
1300  fTree->Branch("crtSoftTrigger_hitsperplane", &_crtSoftTrigger_hitsperplane,"crtSoftTrigger_hitsperplane[7]/I");
1301  }
1302 
1303  if (freadMuonTracks) {
1304  fTree->Branch("nmuontrks", &_nmuontrks, "nmuontrks/I");
1305  fTree->Branch("muontrk_t0", &_muontrk_t0);
1306  fTree->Branch("muontrk_x1", &_muontrk_x1);
1307  fTree->Branch("muontrk_y1", &_muontrk_y1);
1308  fTree->Branch("muontrk_z1", &_muontrk_z1);
1309  fTree->Branch("muontrk_x2", &_muontrk_x2);
1310  fTree->Branch("muontrk_y2", &_muontrk_y2);
1311  fTree->Branch("muontrk_z2", &_muontrk_z2);
1312  fTree->Branch("muontrk_theta_xz", &_muontrk_theta_xz);
1313  fTree->Branch("muontrk_theta_yz", &_muontrk_theta_yz);
1314  fTree->Branch("muontrk_tpc", &_muontrk_tpc);
1315  fTree->Branch("muontrk_type", &_muontrk_type);
1316  }
1317 
1318  if (freadMuonHits) {
1319  fTree->Branch("nmhits", &_nmhits, "nmhits/I");
1320  fTree->Branch("mhit_trk", &_mhit_trk);
1321  fTree->Branch("mhit_tpc", &_mhit_tpc);
1322  fTree->Branch("mhit_wire", &_mhit_wire);
1323  fTree->Branch("mhit_channel", &_mhit_channel);
1324  fTree->Branch("mhit_peakT", &_mhit_peakT);
1325  fTree->Branch("mhit_charge", &_mhit_charge);
1326  }
1327 
1328  if (freadTruth) {
1329  fTree->Branch("mcevts_truth",&mcevts_truth,"mcevts_truth/I");
1330  fTree->Branch("nuScatterCode_truth",&nuScatterCode_truth);
1331  fTree->Branch("nuID_truth",&nuID_truth);
1332  fTree->Branch("nuPDG_truth",&nuPDG_truth);
1333  fTree->Branch("ccnc_truth",&ccnc_truth);
1334  fTree->Branch("mode_truth",&mode_truth);
1335  fTree->Branch("enu_truth",&enu_truth);
1336  fTree->Branch("Q2_truth",&Q2_truth);
1337  fTree->Branch("W_truth",&W_truth);
1338  fTree->Branch("hitnuc_truth",&hitnuc_truth);
1339  fTree->Branch("nuvtxx_truth",&nuvtxx_truth);
1340  fTree->Branch("nuvtxy_truth",&nuvtxy_truth);
1341  fTree->Branch("nuvtxz_truth",&nuvtxz_truth);
1342  fTree->Branch("nu_dcosx_truth",&nu_dcosx_truth);
1343  fTree->Branch("nu_dcosy_truth",&nu_dcosy_truth);
1344  fTree->Branch("nu_dcosz_truth",&nu_dcosz_truth);
1345  fTree->Branch("lep_mom_truth",&lep_mom_truth);
1346  fTree->Branch("lep_dcosx_truth",&lep_dcosx_truth);
1347  fTree->Branch("lep_dcosy_truth",&lep_dcosy_truth);
1348  fTree->Branch("lep_dcosz_truth",&lep_dcosz_truth);
1349 
1350  fTree->Branch("tpx_flux",&tpx_flux);
1351  fTree->Branch("tpy_flux",&tpy_flux);
1352  fTree->Branch("tpz_flux",&tpz_flux);
1353  fTree->Branch("tptype_flux",&tptype_flux);
1354 
1355  fTree->Branch("genie_no_primaries",&genie_no_primaries);
1356  fTree->Branch("genie_primaries_pdg",&genie_primaries_pdg);
1357  fTree->Branch("genie_Eng",&genie_Eng);
1358  fTree->Branch("genie_Px",&genie_Px);
1359  fTree->Branch("genie_Py",&genie_Py);
1360  fTree->Branch("genie_Pz",&genie_Pz);
1361  fTree->Branch("genie_P",&genie_P);
1362  fTree->Branch("genie_status_code",&genie_status_code);
1363  fTree->Branch("genie_mass",&genie_mass);
1364  fTree->Branch("genie_trackID",&genie_trackID);
1365  fTree->Branch("genie_ND",&genie_ND);
1366  fTree->Branch("genie_mother",&genie_mother);
1367  }
1368 
1369  if (fsavePOTInfo) {
1370  _sr_tree = tfs->make<TTree>("pottree","");
1371  _sr_tree->Branch("run", &_sr_run, "run/I");
1372  _sr_tree->Branch("subrun", &_sr_subrun, "subrun/I");
1373  _sr_tree->Branch("begintime", &_sr_begintime, "begintime/D");
1374  _sr_tree->Branch("endtime", &_sr_endtime, "endtime/D");
1375  _sr_tree->Branch("pot", &_sr_pot, "pot/D");
1376  }
1377 
1378 }
int _pmtTrigger_maxpassed
maximum number of pmt pairs above threshold during trigger window (usually beam spill) ...
std::vector< Int_t > genie_status_code
std::vector< double > _ophit_opdet_y
OpDet Y coordinate of the optical hit.
std::vector< int > _time_for_waveform
Time for waveform to plot.
std::vector< int > _hit_cryostat
Cryostat where the hit belongs to.
std::vector< int > _pmtTrigger_npmtshigh
number of pmt pairs above threshold, index = time during trigger window (usually beam spill) ...
std::vector< Int_t > mode_truth
0=QE/El, 1=RES, 2=DIS, 3=Coherent production
int _nctrks
Number of created CRT tracks.
std::vector< double > _ctrk_z2
CRT track z2.
std::vector< double > _ophit_peakT
Peak time of the optical hit.
std::vector< float > _muontrk_x1
x coordinate closer to anode
std::vector< int > _hit_wire
Wire where the hit belongs to.
std::vector< Float_t > lep_dcosy_truth
lepton dcos y
std::vector< Float_t > tpx_flux
Px of parent particle leaving BNB target.
int _nmuontrks
number of muon tracks
std::vector< float > _muontrk_z1
z coordinate closer to anode
std::vector< int > _mhit_trk
Track number that the hit belongs to.
std::vector< int > _mhit_wire
Wire where the hit belongs to.
std::vector< int > _hit_channel
Channel where the hit belongs to.
std::vector< float > _muontrk_x2
x coordinate closer to cathode
int _crtSoftTrigger_hitsperplane[7]
number of individual PMTs above ADC threshold (fcl) during the beam spill
int _nhits
Number of reco hits in the event.
int _event
The event number.
std::vector< double > _chit_time
CRT hit time.
Int_t mcevts_truth
! The number of MCNeutrinos there is currently room for
std::vector< int > _adc_count_in_waveform
Used to view all waveforms on a hitplane together.
std::vector< double > _crt_pos_y
CRT position Y.
std::vector< int > _muontrk_tpc
tpc that muon is located in
std::vector< double > _crt_time
CRT time.
bool fkeepCRTstrips
Keep the CRT strips (to be set via fcl)
std::vector< double > _ophit_pe
PEs of the optical hit.
std::vector< double > _mhit_peakT
Hit peak time.
std::vector< int > _hit_tpc
TPC where the hit belongs to.
std::vector< int > _waveform_number
Number for each waveform, to allow for searching.
std::vector< Float_t > nuvtxy_truth
neutrino vertex y
std::vector< double > _ct_z2
CRT track z2.
std::vector< Float_t > nu_dcosx_truth
neutrino dcos x
std::vector< Float_t > Q2_truth
Momentum transfer squared.
std::vector< Float_t > nu_dcosy_truth
neutrino dcos y
std::vector< double > _ophit_opdet_z
OpDet Z coordinate of the optical hit.
bool fkeepCRThits
Keep the CRT hits (to be set via fcl)
std::vector< Float_t > genie_P
double _sr_pot
POTs in each subrun.
std::vector< double > _crt_pos_z
CRT position Z.
double _sr_endtime
std::vector< Float_t > nuvtxz_truth
neutrino vertex z
bool freadCRTtracks
Keep the CRT tracks (to be set via fcl)
std::vector< int > _crt_module
CRT module.
int _nchits
Number of CRT hits.
std::vector< Float_t > nu_dcosz_truth
neutrino dcos z
std::vector< Float_t > tpy_flux
Py of parent particle leaving BNB target.
int _run
The run number.
std::vector< int > _mhit_tpc
TPC where the hit belongs to.
std::vector< Int_t > tptype_flux
Type of parent particle leaving BNB target.
std::vector< double > _hit_width
Hit width.
int _nmhits
Number of muon collection hits per track.
std::vector< int > _ophit_opdet_type
OpDet tyoe of the optical hit.
bool fsavePOTInfo
Add POT info to output (to be set via fcl)
std::vector< Float_t > genie_Eng
std::vector< double > _crt_adc
CRT adc.
std::vector< Int_t > nuID_truth
Unique ID of each true neutrino.
std::vector< int > _crt_strip
CRT strip.
std::vector< int > _ctrk_mod2x
CRT track mod2x.
std::vector< Float_t > genie_Py
std::vector< double > _ctrk_x1
CRT track x1.
std::vector< double > _ct_y1
CRT track y1.
std::vector< Int_t > nuScatterCode_truth
Scattering code given by Genie for each neutrino.
std::vector< Float_t > genie_Pz
std::vector< Int_t > hitnuc_truth
hit nucleon
std::vector< Float_t > lep_dcosx_truth
lepton dcos x
std::vector< double > _ct_y2
CRT track y2.
bool freadMuonTracks
Add MuonTracks to output (to be set via fcl)
TTree * _sr_tree
A tree filled per subrun (for POT accounting)
std::vector< double > _hit_full_integral
Hit charge integral.
std::vector< double > _ctrk_y2
CRT track y2.
std::vector< double > _adc_on_wire
ADC on wire to draw waveform.
double _sr_begintime
std::vector< int > _hit_plane
Plane where the hit belongs to.
int _nstrips
Number of CRT strips.
std::vector< double > _chit_y
CRT hit y.
std::vector< double > _mhit_charge
Hit charge.
std::vector< double > _ctrk_t1
CRT track t1.
Int_t genie_no_primaries
std::vector< double > _ophit_amplitude
Amplitude of the optical hit.
std::vector< Float_t > W_truth
hadronic invariant mass
std::vector< float > _muontrk_z2
z coordinate closer to cathode
std::vector< double > _ctrk_adc1
CRT track adc1.
std::vector< float > _muontrk_theta_yz
theta_yz trajectory angle
std::vector< Int_t > ccnc_truth
0=CC 1=NC
double _pmtSoftTrigger_prelimPE
Total photoelectron count 100 ns after the TTS.
std::vector< int > _ctrk_mod1x
CRT track mod2x.
std::vector< Float_t > genie_Px
std::vector< double > _ctrk_z1
CRT track z1.
int _nophits
Number of Optical Hits.
std::vector< int > _waveform_integral
Used to see progression of the waveform integral.
int _adc_count
Used for plotting waveforms.
bool freadpmtSoftTrigger
Add pmt software trigger info to output (to be set via fcl)
std::vector< Int_t > genie_trackID
std::vector< double > _hit_ph
Hit ph?
std::vector< Float_t > tpz_flux
Pz of parent particle leaving BNB target.
double _pmtSoftTrigger_promptPE
Trigger Time Stamp (TTS), ns (relative to start of beam spill)
bool fcheckTransparency
Checks for wire transprency (to be set via fcl)
std::vector< Float_t > enu_truth
true neutrino energy
std::vector< int > _crt_plane
CRT plane.
std::vector< double > _ophit_width
Width of the optical hit.
std::vector< Int_t > genie_primaries_pdg
std::vector< double > _ct_x1
CRT track x1.
std::vector< double > _ct_x2
CRT track x2.
std::vector< double > _ctrk_t2
CRT track t2.
std::vector< double > _ct_z1
CRT track z1.
bool freadpmtTrigger
Add pmt hardware trigger info to output (to be set via fcl)
int _subrun
The subrun number.
bool _pmtSoftTrigger_foundBeamTrigger
std::vector< Float_t > genie_mass
bool freadOpHits
Add OpHits to output (to be set via fcl)
std::vector< Int_t > nuPDG_truth
neutrino PDG code
bool fmakeCRTtracks
Make the CRT tracks (to be set via fcl)
std::vector< int > _chit_plane
CRT hit plane.
std::vector< Float_t > lep_dcosz_truth
lepton dcos z
std::vector< double > _crt_pos_x
CRT position X.
std::vector< Int_t > genie_mother
int _ncts
Number of CRT tracks.
bool freadMuonHits
Add MuonTrack hits to output(to be set via fcl)
std::vector< double > _chit_x
CRT hit x.
std::vector< double > _chit_z
CRT hit z.
std::vector< Float_t > lep_mom_truth
lepton momentum
std::vector< double > _muontrk_t0
t0 (time of interaction)
std::vector< float > _muontrk_y1
y coordinate closer to anode
bool freadcrtSoftTrigger
Add crt software trigger info to output (to be set via fcl)
std::vector< double > _ctrk_x2
CRT track x2.
double _evttime
The event time.
std::vector< double > _hit_peakT
Hit peak time.
std::vector< double > _hit_charge
Hit charge.
std::vector< int > _ophit_opch
OpChannel of the optical hit.
std::vector< Int_t > genie_ND
std::vector< double > _ctrk_y1
CRT track y1.
std::vector< double > _ctrk_adc2
CRT track adc2.
art::ServiceHandle< art::TFileService > tfs
std::vector< float > _muontrk_y2
y coordinate closer to cathode
int _pmtSoftTrigger_nAboveThreshold
Total photoelectron count before the TTS, during the beam spill.
std::vector< int > _mhit_channel
Channel where the hit belongs to.
std::vector< double > _ct_time
CRT track time.
int _pmtSoftTrigger_tts
Whether the beam spill was found or not.
std::vector< float > _muontrk_theta_xz
theta_xz trajectory angle
std::vector< Float_t > nuvtxx_truth
neutrino vertex x
std::vector< int > _ophit_opdet
OpDet of the optical hit.
std::vector< int > _muontrk_type
type of muon track
std::vector< int > _crt_orient
CRT orientation (0 for y (horizontal) and 1 for x (vertical))
int _t0
The t0.
std::vector< double > _ophit_area
Area of the optical hit.
std::vector< double > _ct_pes
CRT track PEs.
bool freadTruth
Add Truth info to output (to be set via fcl)
std::vector< double > _ophit_opdet_x
OpDet X coordinate of the optical hit.
void Hitdumper::beginSubRun ( art::SubRun const &  sr)
overridevirtual

Definition at line 1591 of file HitDumper_module.cc.

1591  {
1592 
1593  if (!fsavePOTInfo) {
1594  return;
1595  }
1596 
1597  _sr_run = sr.run();
1598  _sr_subrun = sr.subRun();
1599  _sr_begintime = sr.beginTime().value();
1600  _sr_endtime = sr.endTime().value();
1601 
1602  art::Handle<sumdata::POTSummary> pot_handle;
1603  sr.getByLabel(fGenieGenModuleLabel, pot_handle);
1604 
1605  if (pot_handle.isValid()) {
1606  _sr_pot = pot_handle->totpot;
1607  } else {
1608  _sr_pot = 0.;
1609  }
1610 
1611  _sr_tree->Fill();
1612 
1613 }
std::string fGenieGenModuleLabel
Label for Genie dataproduct (to be set via fcl)
double _sr_pot
POTs in each subrun.
double _sr_endtime
bool fsavePOTInfo
Add POT info to output (to be set via fcl)
TTree * _sr_tree
A tree filled per subrun (for POT accounting)
double _sr_begintime
void Hitdumper::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 400 of file HitDumper_module.cc.

401 {
402 
403  _max_hits = p.get<int>("MaxHits", 50000);
404  _max_ophits = p.get<int>("MaxOpHits", 50000);
405  _max_samples = p.get<int>("MaxSamples", 5001);
406  _max_chits = p.get<int>("MaxCRTHits", 5000);
407  _max_nctrks = p.get<int>("MaxCRTTracks", 10);
408 
409  fHitsModuleLabel = p.get<std::string>("HitsModuleLabel");
410  fDigitModuleLabel = p.get<std::string>("DigitModuleLabel", "daq");
411  fLArG4ModuleLabel = p.get<std::string>("LArG4ModuleLabel", "largeant");
412  fCRTStripModuleLabel = p.get<std::string>("CRTStripModuleLabel", "crt");
413  fCRTHitModuleLabel = p.get<std::string>("CRTHitModuleLabel", "crthit");
414  fCRTTrackModuleLabel = p.get<std::string>("CRTTrackModuleLabel", "crttrack");
415  fOpHitsModuleLabels = p.get<std::vector<std::string>>("OpHitsModuleLabel");
416  fpmtTriggerModuleLabel = p.get<std::string>("pmtTriggerModuleLabel", "pmttriggerproducer");
417  fpmtSoftTriggerModuleLabel = p.get<std::string>("pmtSoftTriggerModuleLabel", "pmtSoftwareTrigger");
418  fcrtSoftTriggerModuleLabel = p.get<std::string>("crtSoftTriggerModuleLabel", "MetricProducer");
419  fMuonTrackModuleLabel = p.get<std::string>("MuonTrackModuleLabel", "MuonTrackProducer");
420  fGenieGenModuleLabel = p.get<std::string>("GenieGenModuleLabel", "generator");
421 
422  fkeepCRThits = p.get<bool>("keepCRThits",true);
423  fkeepCRTstrips = p.get<bool>("keepCRTstrips",false);
424  fmakeCRTtracks = p.get<bool>("makeCRTtracks",true);
425  freadCRTtracks = p.get<bool>("readCRTtracks",true);
426  freadOpHits = p.get<bool>("readOpHits",true);
427  freadpmtTrigger = p.get<bool>("readpmtTrigger",true);
428  freadpmtSoftTrigger= p.get<bool>("readpmtSoftTrigger",true);
429  freadcrtSoftTrigger= p.get<bool>("readcrtSoftTrigger",false);
430  freadMuonTracks = p.get<bool>("readMuonTracks",true);
431  freadMuonHits = p.get<bool>("readMuonHits",false);
432  fcheckTransparency = p.get<bool>("checkTransparency",false);
433  freadTruth = p.get<bool>("readTruth",true);
434  fsavePOTInfo = p.get<bool>("savePOTinfo",true);
435  fUncompressWithPed = p.get<bool>("UncompressWithPed",false);
436 
437  fWindow = p.get<int>("window",100);
438  fKeepTaggerTypes = p.get<std::vector<int>>("KeepTaggerTypes");
439 
440  fSkipInd = p.get<bool>("SkipInduction",false);
441 }
bool fSkipInd
If true, induction planes are not saved (to be set via fcl)
bool fUncompressWithPed
Uncompresses the waveforms if true (to be set via fcl)
std::vector< int > fKeepTaggerTypes
Taggers to keep (to be set via fcl)
int _max_chits
maximum number of CRT hits (to be set via fcl)
std::vector< std::string > fOpHitsModuleLabels
Labels for OpHit dataproducts (to be set via fcl)
bool fkeepCRTstrips
Keep the CRT strips (to be set via fcl)
std::string fCRTStripModuleLabel
Label for CRTStrip dataproduct (to be set via fcl)
std::string fGenieGenModuleLabel
Label for Genie dataproduct (to be set via fcl)
std::string fHitsModuleLabel
Label for Hit dataproduct (to be set via fcl)
pdgs p
Definition: selectors.fcl:22
bool fkeepCRThits
Keep the CRT hits (to be set via fcl)
bool freadCRTtracks
Keep the CRT tracks (to be set via fcl)
std::string fpmtSoftTriggerModuleLabel
Label for pmt software trigger data product (to be set via fcl)
std::string fLArG4ModuleLabel
Label for LArG4 dataproduct (to be set via fcl)
int _max_samples
maximum number of samples (to be set via fcl)
bool fsavePOTInfo
Add POT info to output (to be set via fcl)
int _max_ophits
maximum number of hits (to be set via fcl)
bool freadMuonTracks
Add MuonTracks to output (to be set via fcl)
std::string fMuonTrackModuleLabel
Label for MuonTrack dataproduct (to be set via fcl)
std::string fpmtTriggerModuleLabel
Label for pmtTrigger dataproduct (to be set vis fcl)
bool freadpmtSoftTrigger
Add pmt software trigger info to output (to be set via fcl)
bool fcheckTransparency
Checks for wire transprency (to be set via fcl)
std::string fcrtSoftTriggerModuleLabel
Label for crt software trigger data product (to be set via fcl)
bool freadpmtTrigger
Add pmt hardware trigger info to output (to be set via fcl)
int _max_nctrks
maximum number of CRT tracks (to be set via fcl)
std::string fCRTTrackModuleLabel
Label for CRTTrack dataproduct (to be set via fcl)
bool freadOpHits
Add OpHits to output (to be set via fcl)
bool fmakeCRTtracks
Make the CRT tracks (to be set via fcl)
bool freadMuonHits
Add MuonTrack hits to output(to be set via fcl)
std::string fDigitModuleLabel
Label for digitizer (to be set via fcl)
bool freadcrtSoftTrigger
Add crt software trigger info to output (to be set via fcl)
int _max_hits
maximum number of hits (to be set via fcl)
std::string fCRTHitModuleLabel
Label for CRTHit dataproduct (to be set via fcl)
bool freadTruth
Add Truth info to output (to be set via fcl)
void Hitdumper::ResetCRTCustomTracksVars ( int  n)
private

Resets custom crt tracks tree variables.

Definition at line 1416 of file HitDumper_module.cc.

1416  {
1417  _ctrk_x1.clear();
1418  _ctrk_y1.clear();
1419  _ctrk_z1.clear();
1420  _ctrk_t1.clear();
1421  _ctrk_adc1.clear();
1422  _ctrk_mod1x.clear();
1423  _ctrk_x2.clear();
1424  _ctrk_y2.clear();
1425  _ctrk_z2.clear();
1426  _ctrk_t2.clear();
1427  _ctrk_adc2.clear();
1428  _ctrk_mod2x.clear();
1429 
1430  _ctrk_x1.reserve(n);
1431  _ctrk_y1.reserve(n);
1432  _ctrk_z1.reserve(n);
1433  _ctrk_t1.reserve(n);
1434  _ctrk_adc1.reserve(n);
1435  _ctrk_mod1x.reserve(n);
1436  _ctrk_x2.reserve(n);
1437  _ctrk_y2.reserve(n);
1438  _ctrk_z2.reserve(n);
1439  _ctrk_t2.reserve(n);
1440  _ctrk_adc2.reserve(n);
1441  _ctrk_mod2x.reserve(n);
1442 }
std::vector< double > _ctrk_z2
CRT track z2.
std::vector< int > _ctrk_mod2x
CRT track mod2x.
std::vector< double > _ctrk_x1
CRT track x1.
std::vector< double > _ctrk_y2
CRT track y2.
std::vector< double > _ctrk_t1
CRT track t1.
std::vector< double > _ctrk_adc1
CRT track adc1.
std::vector< int > _ctrk_mod1x
CRT track mod2x.
std::vector< double > _ctrk_z1
CRT track z1.
std::vector< double > _ctrk_t2
CRT track t2.
std::vector< double > _ctrk_x2
CRT track x2.
std::vector< double > _ctrk_y1
CRT track y1.
std::vector< double > _ctrk_adc2
CRT track adc2.
void Hitdumper::ResetCRTHitsVars ( int  n)
private

Resets crt hits tree variables.

Definition at line 1455 of file HitDumper_module.cc.

1455  {
1456  _chit_plane.assign(n, DEFAULT_VALUE);
1457  _chit_time.assign(n, DEFAULT_VALUE);
1458  _chit_x.assign(n, DEFAULT_VALUE);
1459  _chit_y.assign(n, DEFAULT_VALUE);
1460  _chit_z.assign(n, DEFAULT_VALUE);
1461 }
std::vector< double > _chit_time
CRT hit time.
const int DEFAULT_VALUE
std::vector< double > _chit_y
CRT hit y.
std::vector< int > _chit_plane
CRT hit plane.
std::vector< double > _chit_x
CRT hit x.
std::vector< double > _chit_z
CRT hit z.
void Hitdumper::ResetCrtSoftTriggerVars ( )
private

Resets crt software trigger variables.

Definition at line 1490 of file HitDumper_module.cc.

1490  {
1491  for (int i=0; i<7; i++){
1493  }
1494 }
int _crtSoftTrigger_hitsperplane[7]
number of individual PMTs above ADC threshold (fcl) during the beam spill
void Hitdumper::ResetCRTStripsVars ( int  n)
private

Resets crt strips tree variables.

Definition at line 1394 of file HitDumper_module.cc.

1394  {
1395  _crt_plane.clear();
1396  _crt_module.clear();
1397  _crt_strip.clear();
1398  _crt_orient.clear();
1399  _crt_time.clear();
1400  _crt_adc.clear();
1401  _crt_pos_x.clear();
1402  _crt_pos_y.clear();
1403  _crt_pos_z.clear();
1404 
1405  _crt_plane.reserve(n);
1406  _crt_module.reserve(n);
1407  _crt_strip.reserve(n);
1408  _crt_orient.reserve(n);
1409  _crt_time.reserve(n);
1410  _crt_adc.reserve(n);
1411  _crt_pos_x.reserve(n);
1412  _crt_pos_y.reserve(n);
1413  _crt_pos_z.reserve(n);
1414 }
std::vector< double > _crt_pos_y
CRT position Y.
std::vector< double > _crt_time
CRT time.
std::vector< double > _crt_pos_z
CRT position Z.
std::vector< int > _crt_module
CRT module.
std::vector< double > _crt_adc
CRT adc.
std::vector< int > _crt_strip
CRT strip.
std::vector< int > _crt_plane
CRT plane.
std::vector< double > _crt_pos_x
CRT position X.
std::vector< int > _crt_orient
CRT orientation (0 for y (horizontal) and 1 for x (vertical))
void Hitdumper::ResetCRTTracksVars ( int  n)
private

Resets crt tracks tree variables.

Definition at line 1444 of file HitDumper_module.cc.

1444  {
1445  _ct_x1.assign(n, DEFAULT_VALUE);
1446  _ct_y1.assign(n, DEFAULT_VALUE);
1447  _ct_z1.assign(n, DEFAULT_VALUE);
1448  _ct_time.assign(n, DEFAULT_VALUE);
1449  _ct_pes.assign(n, DEFAULT_VALUE);
1450  _ct_x2.assign(n, DEFAULT_VALUE);
1451  _ct_y2.assign(n, DEFAULT_VALUE);
1452  _ct_z2.assign(n, DEFAULT_VALUE);
1453 }
std::vector< double > _ct_z2
CRT track z2.
const int DEFAULT_VALUE
std::vector< double > _ct_y1
CRT track y1.
std::vector< double > _ct_y2
CRT track y2.
std::vector< double > _ct_x1
CRT track x1.
std::vector< double > _ct_x2
CRT track x2.
std::vector< double > _ct_z1
CRT track z1.
std::vector< double > _ct_time
CRT track time.
std::vector< double > _ct_pes
CRT track PEs.
void Hitdumper::ResetMuonHitVars ( int  n)
private

Resets crossing muon hit tree variables.

Definition at line 1510 of file HitDumper_module.cc.

1510  {
1511  _mhit_trk.clear();
1512  _mhit_tpc.clear();
1513  _mhit_wire.clear();
1514  _mhit_channel.clear();
1515  _mhit_peakT.clear();
1516  _mhit_charge.clear();
1517 
1518  _mhit_trk.reserve(n);
1519  _mhit_tpc.reserve(n);
1520  _mhit_wire.reserve(n);
1521  _mhit_channel.reserve(n);
1522  _mhit_peakT.reserve(n);
1523  _mhit_charge.reserve(n);
1524 }
std::vector< int > _mhit_trk
Track number that the hit belongs to.
std::vector< int > _mhit_wire
Wire where the hit belongs to.
std::vector< double > _mhit_peakT
Hit peak time.
std::vector< int > _mhit_tpc
TPC where the hit belongs to.
std::vector< double > _mhit_charge
Hit charge.
std::vector< int > _mhit_channel
Channel where the hit belongs to.
void Hitdumper::ResetMuonTracksVars ( int  n)
private

Resets crossing muon tracks tree variables.

Definition at line 1496 of file HitDumper_module.cc.

1496  {
1497  _muontrk_t0.assign(n, DEFAULT_VALUE);
1498  _muontrk_x1.assign(n, DEFAULT_VALUE);
1499  _muontrk_y1.assign(n, DEFAULT_VALUE);
1500  _muontrk_z1.assign(n, DEFAULT_VALUE);
1501  _muontrk_x2.assign(n, DEFAULT_VALUE);
1502  _muontrk_y2.assign(n, DEFAULT_VALUE);
1503  _muontrk_z2.assign(n, DEFAULT_VALUE);
1504  _muontrk_theta_xz.assign(n, DEFAULT_VALUE);
1506  _muontrk_tpc.assign(n, DEFAULT_VALUE);
1507  _muontrk_type.assign(n, DEFAULT_VALUE);
1508 }
std::vector< float > _muontrk_x1
x coordinate closer to anode
std::vector< float > _muontrk_z1
z coordinate closer to anode
std::vector< float > _muontrk_x2
x coordinate closer to cathode
std::vector< int > _muontrk_tpc
tpc that muon is located in
const int DEFAULT_VALUE
std::vector< float > _muontrk_z2
z coordinate closer to cathode
std::vector< float > _muontrk_theta_yz
theta_yz trajectory angle
std::vector< double > _muontrk_t0
t0 (time of interaction)
std::vector< float > _muontrk_y1
y coordinate closer to anode
std::vector< float > _muontrk_y2
y coordinate closer to cathode
std::vector< float > _muontrk_theta_xz
theta_xz trajectory angle
std::vector< int > _muontrk_type
type of muon track
void Hitdumper::ResetOpHitsVars ( int  n)
private

Resets optical hits tree variables.

Definition at line 1463 of file HitDumper_module.cc.

1463  {
1464  _ophit_opch.resize(n, DEFAULT_VALUE);
1465  _ophit_opdet.resize(n, DEFAULT_VALUE);
1466  _ophit_peakT.resize(n, DEFAULT_VALUE);
1467  _ophit_width.resize(n, DEFAULT_VALUE);
1468  _ophit_area.resize(n, DEFAULT_VALUE);
1469  _ophit_amplitude.resize(n, DEFAULT_VALUE);
1470  _ophit_pe.resize(n, DEFAULT_VALUE);
1471  _ophit_opdet_x.resize(n, DEFAULT_VALUE);
1472  _ophit_opdet_y.resize(n, DEFAULT_VALUE);
1473  _ophit_opdet_z.resize(n, DEFAULT_VALUE);
1475 }
std::vector< double > _ophit_opdet_y
OpDet Y coordinate of the optical hit.
std::vector< double > _ophit_peakT
Peak time of the optical hit.
std::vector< double > _ophit_pe
PEs of the optical hit.
std::vector< double > _ophit_opdet_z
OpDet Z coordinate of the optical hit.
const int DEFAULT_VALUE
std::vector< int > _ophit_opdet_type
OpDet tyoe of the optical hit.
std::vector< double > _ophit_amplitude
Amplitude of the optical hit.
std::vector< double > _ophit_width
Width of the optical hit.
std::vector< int > _ophit_opch
OpChannel of the optical hit.
std::vector< int > _ophit_opdet
OpDet of the optical hit.
std::vector< double > _ophit_area
Area of the optical hit.
std::vector< double > _ophit_opdet_x
OpDet X coordinate of the optical hit.
void Hitdumper::ResetPmtSoftTriggerVars ( )
private

Rests pmt software trigger variables.

Definition at line 1482 of file HitDumper_module.cc.

1482  {
1484  _pmtSoftTrigger_tts = 0;
1488 }
double _pmtSoftTrigger_prelimPE
Total photoelectron count 100 ns after the TTS.
double _pmtSoftTrigger_promptPE
Trigger Time Stamp (TTS), ns (relative to start of beam spill)
bool _pmtSoftTrigger_foundBeamTrigger
int _pmtSoftTrigger_nAboveThreshold
Total photoelectron count before the TTS, during the beam spill.
int _pmtSoftTrigger_tts
Whether the beam spill was found or not.
void Hitdumper::ResetPmtTriggerVars ( int  n)
private

Resets pmt hardware trigger variables.

Definition at line 1477 of file HitDumper_module.cc.

1477  {
1480 }
int _pmtTrigger_maxpassed
maximum number of pmt pairs above threshold during trigger window (usually beam spill) ...
std::vector< int > _pmtTrigger_npmtshigh
number of pmt pairs above threshold, index = time during trigger window (usually beam spill) ...
const int DEFAULT_VALUE
void Hitdumper::ResetVars ( )
private

Resets the variables that are saved to the TTree.

Definition at line 1526 of file HitDumper_module.cc.

1526  {
1527 
1528 
1529  _run = -99999;
1530  _subrun = -99999;
1531  _event = -99999;
1532  _evttime = -99999;
1533  _t0 = -99999;
1534 
1535  mcevts_truth = 0;
1536  genie_no_primaries = 0;
1537 }
int _event
The event number.
Int_t mcevts_truth
! The number of MCNeutrinos there is currently room for
int _run
The run number.
Int_t genie_no_primaries
int _subrun
The subrun number.
double _evttime
The event time.
int _t0
The t0.
void Hitdumper::ResetWireHitsVars ( int  n)
private

Resets wire hits tree variables.

Definition at line 1381 of file HitDumper_module.cc.

1381  {
1382  _hit_cryostat.assign(n, DEFAULT_VALUE);
1383  _hit_tpc.assign(n, DEFAULT_VALUE);
1384  _hit_plane.assign(n, DEFAULT_VALUE);
1385  _hit_wire.assign(n, DEFAULT_VALUE);
1386  _hit_channel.assign(n, DEFAULT_VALUE);
1387  _hit_peakT.assign(n, DEFAULT_VALUE);
1388  _hit_charge.assign(n, DEFAULT_VALUE);
1389  _hit_ph.assign(n, DEFAULT_VALUE);
1390  _hit_width.assign(n, DEFAULT_VALUE);
1392 }
std::vector< int > _hit_cryostat
Cryostat where the hit belongs to.
std::vector< int > _hit_wire
Wire where the hit belongs to.
std::vector< int > _hit_channel
Channel where the hit belongs to.
std::vector< int > _hit_tpc
TPC where the hit belongs to.
const int DEFAULT_VALUE
std::vector< double > _hit_width
Hit width.
std::vector< double > _hit_full_integral
Hit charge integral.
std::vector< int > _hit_plane
Plane where the hit belongs to.
std::vector< double > _hit_ph
Hit ph?
std::vector< double > _hit_peakT
Hit peak time.
std::vector< double > _hit_charge
Hit charge.
void Hitdumper::ResizeGenie ( int  nPrimaries)
private

Resize the data structure for Genie primaries.

Definition at line 1571 of file HitDumper_module.cc.

1571  {
1572 
1573  // minimum size is 1, so that we always have an address
1574  MaxGeniePrimaries = (size_t) std::max(nPrimaries, 1);
1575 
1587 
1588 }
std::vector< Int_t > genie_status_code
size_t MaxGeniePrimaries
std::vector< Float_t > genie_P
const int DEFAULT_VALUE
std::vector< Float_t > genie_Eng
std::vector< Float_t > genie_Py
std::vector< Float_t > genie_Pz
std::vector< Float_t > genie_Px
std::vector< Int_t > genie_trackID
std::vector< Int_t > genie_primaries_pdg
std::vector< Float_t > genie_mass
std::vector< Int_t > genie_mother
std::vector< Int_t > genie_ND
void Hitdumper::ResizeMCNeutrino ( int  nNeutrinos)
private

Resize the data structure for MCNeutrino particles.

Definition at line 1539 of file HitDumper_module.cc.

1539  {
1540 
1541  //min size is 1, to guarantee an address
1542  MaxMCNeutrinos = (size_t) std::max(nNeutrinos, 1);
1543 
1563  //Also resize the flux information here as it's a 1:1 with the MCNeutrino
1568 
1569 }
std::vector< Int_t > mode_truth
0=QE/El, 1=RES, 2=DIS, 3=Coherent production
std::vector< Float_t > lep_dcosy_truth
lepton dcos y
std::vector< Float_t > tpx_flux
Px of parent particle leaving BNB target.
size_t MaxMCNeutrinos
std::vector< Float_t > nuvtxy_truth
neutrino vertex y
std::vector< Float_t > nu_dcosx_truth
neutrino dcos x
std::vector< Float_t > Q2_truth
Momentum transfer squared.
std::vector< Float_t > nu_dcosy_truth
neutrino dcos y
const int DEFAULT_VALUE
std::vector< Float_t > nuvtxz_truth
neutrino vertex z
std::vector< Float_t > nu_dcosz_truth
neutrino dcos z
std::vector< Float_t > tpy_flux
Py of parent particle leaving BNB target.
std::vector< Int_t > tptype_flux
Type of parent particle leaving BNB target.
std::vector< Int_t > nuID_truth
Unique ID of each true neutrino.
std::vector< Int_t > nuScatterCode_truth
Scattering code given by Genie for each neutrino.
std::vector< Int_t > hitnuc_truth
hit nucleon
std::vector< Float_t > lep_dcosx_truth
lepton dcos x
std::vector< Float_t > W_truth
hadronic invariant mass
std::vector< Int_t > ccnc_truth
0=CC 1=NC
std::vector< Float_t > tpz_flux
Pz of parent particle leaving BNB target.
std::vector< Float_t > enu_truth
true neutrino energy
std::vector< Int_t > nuPDG_truth
neutrino PDG code
std::vector< Float_t > lep_dcosz_truth
lepton dcos z
std::vector< Float_t > lep_mom_truth
lepton momentum
std::vector< Float_t > nuvtxx_truth
neutrino vertex x

Member Data Documentation

int Hitdumper::_adc_count
private

Used for plotting waveforms.

Definition at line 180 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_adc_count_in_waveform
private

Used to view all waveforms on a hitplane together.

Definition at line 182 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_adc_on_wire
private

ADC on wire to draw waveform.

Definition at line 178 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_chit_plane
private

CRT hit plane.

Definition at line 219 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_chit_time
private

CRT hit time.

Definition at line 217 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_chit_x
private

CRT hit x.

Definition at line 214 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_chit_y
private

CRT hit y.

Definition at line 215 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_chit_z
private

CRT hit z.

Definition at line 216 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_crt_adc
private

CRT adc.

Definition at line 192 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_crt_module
private

CRT module.

Definition at line 188 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_crt_orient
private

CRT orientation (0 for y (horizontal) and 1 for x (vertical))

Definition at line 190 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_crt_plane
private

CRT plane.

Definition at line 187 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_crt_pos_x
private

CRT position X.

Definition at line 193 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_crt_pos_y
private

CRT position Y.

Definition at line 194 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_crt_pos_z
private

CRT position Z.

Definition at line 195 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_crt_strip
private

CRT strip.

Definition at line 189 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_crt_time
private

CRT time.

Definition at line 191 of file HitDumper_module.cc.

int Hitdumper::_crtSoftTrigger_hitsperplane[7]
private

number of individual PMTs above ADC threshold (fcl) during the beam spill

Number of (very low level) CRT hits per plane

Definition at line 258 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ct_pes
private

CRT track PEs.

Definition at line 224 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ct_time
private

CRT track time.

Definition at line 223 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ct_x1
private

CRT track x1.

Definition at line 225 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ct_x2
private

CRT track x2.

Definition at line 228 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ct_y1
private

CRT track y1.

Definition at line 226 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ct_y2
private

CRT track y2.

Definition at line 229 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ct_z1
private

CRT track z1.

Definition at line 227 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ct_z2
private

CRT track z2.

Definition at line 230 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ctrk_adc1
private

CRT track adc1.

Definition at line 203 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ctrk_adc2
private

CRT track adc2.

Definition at line 209 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_ctrk_mod1x
private

CRT track mod2x.

Definition at line 204 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_ctrk_mod2x
private

CRT track mod2x.

Definition at line 210 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ctrk_t1
private

CRT track t1.

Definition at line 202 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ctrk_t2
private

CRT track t2.

Definition at line 208 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ctrk_x1
private

CRT track x1.

Definition at line 199 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ctrk_x2
private

CRT track x2.

Definition at line 205 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ctrk_y1
private

CRT track y1.

Definition at line 200 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ctrk_y2
private

CRT track y2.

Definition at line 206 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ctrk_z1
private

CRT track z1.

Definition at line 201 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ctrk_z2
private

CRT track z2.

Definition at line 207 of file HitDumper_module.cc.

int Hitdumper::_event
private

The event number.

Definition at line 161 of file HitDumper_module.cc.

double Hitdumper::_evttime
private

The event time.

Definition at line 162 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_hit_channel
private

Channel where the hit belongs to.

Definition at line 171 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_hit_charge
private

Hit charge.

Definition at line 173 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_hit_cryostat
private

Cryostat where the hit belongs to.

Definition at line 167 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_hit_full_integral
private

Hit charge integral.

Definition at line 176 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_hit_peakT
private

Hit peak time.

Definition at line 172 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_hit_ph
private

Hit ph?

Definition at line 174 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_hit_plane
private

Plane where the hit belongs to.

Definition at line 169 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_hit_tpc
private

TPC where the hit belongs to.

Definition at line 168 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_hit_width
private

Hit width.

Definition at line 175 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_hit_wire
private

Wire where the hit belongs to.

Definition at line 170 of file HitDumper_module.cc.

int Hitdumper::_max_chits
private

maximum number of CRT hits (to be set via fcl)

Definition at line 337 of file HitDumper_module.cc.

int Hitdumper::_max_hits
private

maximum number of hits (to be set via fcl)

Definition at line 334 of file HitDumper_module.cc.

int Hitdumper::_max_nctrks
private

maximum number of CRT tracks (to be set via fcl)

Definition at line 338 of file HitDumper_module.cc.

int Hitdumper::_max_ophits
private

maximum number of hits (to be set via fcl)

Definition at line 335 of file HitDumper_module.cc.

int Hitdumper::_max_samples
private

maximum number of samples (to be set via fcl)

Definition at line 336 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_mhit_channel
private

Channel where the hit belongs to.

Definition at line 279 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_mhit_charge
private

Hit charge.

Definition at line 281 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_mhit_peakT
private

Hit peak time.

Definition at line 280 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_mhit_tpc
private

TPC where the hit belongs to.

Definition at line 277 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_mhit_trk
private

Track number that the hit belongs to.

Definition at line 276 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_mhit_wire
private

Wire where the hit belongs to.

Definition at line 278 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_muontrk_t0
private

t0 (time of interaction)

Definition at line 262 of file HitDumper_module.cc.

std::vector<float> Hitdumper::_muontrk_theta_xz
private

theta_xz trajectory angle

Definition at line 269 of file HitDumper_module.cc.

std::vector<float> Hitdumper::_muontrk_theta_yz
private

theta_yz trajectory angle

Definition at line 270 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_muontrk_tpc
private

tpc that muon is located in

Definition at line 271 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_muontrk_type
private

type of muon track

Definition at line 272 of file HitDumper_module.cc.

std::vector<float> Hitdumper::_muontrk_x1
private

x coordinate closer to anode

Definition at line 263 of file HitDumper_module.cc.

std::vector<float> Hitdumper::_muontrk_x2
private

x coordinate closer to cathode

Definition at line 266 of file HitDumper_module.cc.

std::vector<float> Hitdumper::_muontrk_y1
private

y coordinate closer to anode

Definition at line 264 of file HitDumper_module.cc.

std::vector<float> Hitdumper::_muontrk_y2
private

y coordinate closer to cathode

Definition at line 267 of file HitDumper_module.cc.

std::vector<float> Hitdumper::_muontrk_z1
private

z coordinate closer to anode

Definition at line 265 of file HitDumper_module.cc.

std::vector<float> Hitdumper::_muontrk_z2
private

z coordinate closer to cathode

Definition at line 268 of file HitDumper_module.cc.

int Hitdumper::_nchits
private

Number of CRT hits.

Definition at line 213 of file HitDumper_module.cc.

int Hitdumper::_nctrks
private

Number of created CRT tracks.

Definition at line 198 of file HitDumper_module.cc.

int Hitdumper::_ncts
private

Number of CRT tracks.

Definition at line 222 of file HitDumper_module.cc.

int Hitdumper::_nhits
private

Number of reco hits in the event.

Definition at line 166 of file HitDumper_module.cc.

int Hitdumper::_nmhits
private

Number of muon collection hits per track.

Definition at line 275 of file HitDumper_module.cc.

int Hitdumper::_nmuontrks
private

number of muon tracks

Definition at line 261 of file HitDumper_module.cc.

int Hitdumper::_nophits
private

Number of Optical Hits.

Definition at line 232 of file HitDumper_module.cc.

int Hitdumper::_nstrips
private

Number of CRT strips.

Definition at line 186 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ophit_amplitude
private

Amplitude of the optical hit.

Definition at line 238 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ophit_area
private

Area of the optical hit.

Definition at line 237 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_ophit_opch
private

OpChannel of the optical hit.

Definition at line 233 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_ophit_opdet
private

OpDet of the optical hit.

Definition at line 234 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_ophit_opdet_type
private

OpDet tyoe of the optical hit.

Definition at line 243 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ophit_opdet_x
private

OpDet X coordinate of the optical hit.

Definition at line 240 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ophit_opdet_y
private

OpDet Y coordinate of the optical hit.

Definition at line 241 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ophit_opdet_z
private

OpDet Z coordinate of the optical hit.

Definition at line 242 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ophit_pe
private

PEs of the optical hit.

Definition at line 239 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ophit_peakT
private

Peak time of the optical hit.

Definition at line 235 of file HitDumper_module.cc.

std::vector<double> Hitdumper::_ophit_width
private

Width of the optical hit.

Definition at line 236 of file HitDumper_module.cc.

opdet::sbndPDMapAlg Hitdumper::_pd_map
private

Definition at line 155 of file HitDumper_module.cc.

bool Hitdumper::_pmtSoftTrigger_foundBeamTrigger
private

Definition at line 250 of file HitDumper_module.cc.

int Hitdumper::_pmtSoftTrigger_nAboveThreshold
private

Total photoelectron count before the TTS, during the beam spill.

Definition at line 254 of file HitDumper_module.cc.

double Hitdumper::_pmtSoftTrigger_prelimPE
private

Total photoelectron count 100 ns after the TTS.

Definition at line 253 of file HitDumper_module.cc.

double Hitdumper::_pmtSoftTrigger_promptPE
private

Trigger Time Stamp (TTS), ns (relative to start of beam spill)

Definition at line 252 of file HitDumper_module.cc.

int Hitdumper::_pmtSoftTrigger_tts
private

Whether the beam spill was found or not.

Definition at line 251 of file HitDumper_module.cc.

int Hitdumper::_pmtTrigger_maxpassed
private

maximum number of pmt pairs above threshold during trigger window (usually beam spill)

Definition at line 247 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_pmtTrigger_npmtshigh
private

number of pmt pairs above threshold, index = time during trigger window (usually beam spill)

Definition at line 246 of file HitDumper_module.cc.

int Hitdumper::_run
private

The run number.

Definition at line 159 of file HitDumper_module.cc.

double Hitdumper::_sr_begintime
private

Definition at line 330 of file HitDumper_module.cc.

double Hitdumper::_sr_endtime
private

Definition at line 330 of file HitDumper_module.cc.

double Hitdumper::_sr_pot
private

POTs in each subrun.

Definition at line 331 of file HitDumper_module.cc.

int Hitdumper::_sr_run
private

Definition at line 329 of file HitDumper_module.cc.

int Hitdumper::_sr_subrun
private

Definition at line 329 of file HitDumper_module.cc.

TTree* Hitdumper::_sr_tree
private

A tree filled per subrun (for POT accounting)

Definition at line 328 of file HitDumper_module.cc.

int Hitdumper::_subrun
private

The subrun number.

Definition at line 160 of file HitDumper_module.cc.

int Hitdumper::_t0
private

The t0.

Definition at line 163 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_time_for_waveform
private

Time for waveform to plot.

Definition at line 179 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_waveform_integral
private

Used to see progression of the waveform integral.

Definition at line 181 of file HitDumper_module.cc.

std::vector<int> Hitdumper::_waveform_number
private

Number for each waveform, to allow for searching.

Definition at line 177 of file HitDumper_module.cc.

std::vector<Int_t> Hitdumper::ccnc_truth
private

0=CC 1=NC

Definition at line 289 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::enu_truth
private

true neutrino energy

Definition at line 291 of file HitDumper_module.cc.

const geo::AuxDetGeometry* Hitdumper::fAuxDetGeo
private

Definition at line 380 of file HitDumper_module.cc.

const geo::AuxDetGeometryCore* Hitdumper::fAuxDetGeoCore
private

Definition at line 381 of file HitDumper_module.cc.

art::ServiceHandle<geo::AuxDetGeometry> Hitdumper::fAuxDetGeoService
private

Definition at line 379 of file HitDumper_module.cc.

bool Hitdumper::fcheckTransparency
private

Checks for wire transprency (to be set via fcl)

Definition at line 367 of file HitDumper_module.cc.

std::string Hitdumper::fCRTHitModuleLabel
private

Label for CRTHit dataproduct (to be set via fcl)

Definition at line 343 of file HitDumper_module.cc.

std::string Hitdumper::fcrtSoftTriggerModuleLabel
private

Label for crt software trigger data product (to be set via fcl)

Definition at line 347 of file HitDumper_module.cc.

std::string Hitdumper::fCRTStripModuleLabel
private

Label for CRTStrip dataproduct (to be set via fcl)

Definition at line 342 of file HitDumper_module.cc.

std::string Hitdumper::fCRTTrackModuleLabel
private

Label for CRTTrack dataproduct (to be set via fcl)

Definition at line 344 of file HitDumper_module.cc.

std::string Hitdumper::fDigitModuleLabel
private

Label for digitizer (to be set via fcl)

Definition at line 349 of file HitDumper_module.cc.

std::string Hitdumper::fGenieGenModuleLabel
private

Label for Genie dataproduct (to be set via fcl)

Definition at line 350 of file HitDumper_module.cc.

geo::GeometryCore const* Hitdumper::fGeometryService
private

Definition at line 377 of file HitDumper_module.cc.

std::string Hitdumper::fHitsModuleLabel
private

Label for Hit dataproduct (to be set via fcl)

Definition at line 340 of file HitDumper_module.cc.

bool Hitdumper::fkeepCRThits
private

Keep the CRT hits (to be set via fcl)

Definition at line 355 of file HitDumper_module.cc.

bool Hitdumper::fkeepCRTstrips
private

Keep the CRT strips (to be set via fcl)

Definition at line 356 of file HitDumper_module.cc.

std::vector<int> Hitdumper::fKeepTaggerTypes = {0, 1, 2, 3, 4, 5, 6}
private

Taggers to keep (to be set via fcl)

Definition at line 373 of file HitDumper_module.cc.

std::string Hitdumper::fLArG4ModuleLabel
private

Label for LArG4 dataproduct (to be set via fcl)

Definition at line 341 of file HitDumper_module.cc.

bool Hitdumper::fmakeCRTtracks
private

Make the CRT tracks (to be set via fcl)

Definition at line 357 of file HitDumper_module.cc.

std::string Hitdumper::fMuonTrackModuleLabel
private

Label for MuonTrack dataproduct (to be set via fcl)

Definition at line 348 of file HitDumper_module.cc.

std::vector<std::string> Hitdumper::fOpHitsModuleLabels
private

Labels for OpHit dataproducts (to be set via fcl)

Definition at line 351 of file HitDumper_module.cc.

std::string Hitdumper::fpmtSoftTriggerModuleLabel
private

Label for pmt software trigger data product (to be set via fcl)

Definition at line 346 of file HitDumper_module.cc.

std::string Hitdumper::fpmtTriggerModuleLabel
private

Label for pmtTrigger dataproduct (to be set vis fcl)

Definition at line 345 of file HitDumper_module.cc.

bool Hitdumper::freadcrtSoftTrigger
private

Add crt software trigger info to output (to be set via fcl)

Definition at line 365 of file HitDumper_module.cc.

bool Hitdumper::freadCRTtracks
private

Keep the CRT tracks (to be set via fcl)

Definition at line 358 of file HitDumper_module.cc.

bool Hitdumper::freadMuonHits
private

Add MuonTrack hits to output(to be set via fcl)

Definition at line 361 of file HitDumper_module.cc.

bool Hitdumper::freadMuonTracks
private

Add MuonTracks to output (to be set via fcl)

Definition at line 360 of file HitDumper_module.cc.

bool Hitdumper::freadOpHits
private

Add OpHits to output (to be set via fcl)

Definition at line 359 of file HitDumper_module.cc.

bool Hitdumper::freadpmtSoftTrigger
private

Add pmt software trigger info to output (to be set via fcl)

Definition at line 364 of file HitDumper_module.cc.

bool Hitdumper::freadpmtTrigger
private

Add pmt hardware trigger info to output (to be set via fcl)

Definition at line 363 of file HitDumper_module.cc.

bool Hitdumper::freadTruth
private

Add Truth info to output (to be set via fcl)

Definition at line 362 of file HitDumper_module.cc.

bool Hitdumper::fsavePOTInfo
private

Add POT info to output (to be set via fcl)

Definition at line 366 of file HitDumper_module.cc.

bool Hitdumper::fSkipInd
private

If true, induction planes are not saved (to be set via fcl)

Definition at line 370 of file HitDumper_module.cc.

TTree* Hitdumper::fTree
private

Definition at line 157 of file HitDumper_module.cc.

bool Hitdumper::fUncompressWithPed
private

Uncompresses the waveforms if true (to be set via fcl)

Definition at line 368 of file HitDumper_module.cc.

int Hitdumper::fWindow
private

Definition at line 369 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::genie_Eng
private

Definition at line 316 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::genie_mass
private

Definition at line 322 of file HitDumper_module.cc.

std::vector<Int_t> Hitdumper::genie_mother
private

Definition at line 325 of file HitDumper_module.cc.

std::vector<Int_t> Hitdumper::genie_ND
private

Definition at line 324 of file HitDumper_module.cc.

Int_t Hitdumper::genie_no_primaries
private

Definition at line 314 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::genie_P
private

Definition at line 320 of file HitDumper_module.cc.

std::vector<Int_t> Hitdumper::genie_primaries_pdg
private

Definition at line 315 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::genie_Px
private

Definition at line 317 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::genie_Py
private

Definition at line 318 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::genie_Pz
private

Definition at line 319 of file HitDumper_module.cc.

std::vector<Int_t> Hitdumper::genie_status_code
private

Definition at line 321 of file HitDumper_module.cc.

std::vector<Int_t> Hitdumper::genie_trackID
private

Definition at line 323 of file HitDumper_module.cc.

sbnd::CRTHitRecoAlg Hitdumper::hitAlg
private

Definition at line 375 of file HitDumper_module.cc.

std::vector<Int_t> Hitdumper::hitnuc_truth
private

hit nucleon

Definition at line 294 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::lep_dcosx_truth
private

lepton dcos x

Definition at line 302 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::lep_dcosy_truth
private

lepton dcos y

Definition at line 303 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::lep_dcosz_truth
private

lepton dcos z

Definition at line 304 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::lep_mom_truth
private

lepton momentum

Definition at line 301 of file HitDumper_module.cc.

size_t Hitdumper::MaxGeniePrimaries = 0
private

Definition at line 313 of file HitDumper_module.cc.

size_t Hitdumper::MaxMCNeutrinos
private

Definition at line 284 of file HitDumper_module.cc.

Int_t Hitdumper::mcevts_truth
private

! The number of MCNeutrinos there is currently room for

number of neutrino Int_teractions in the spill

Definition at line 285 of file HitDumper_module.cc.

std::vector<Int_t> Hitdumper::mode_truth
private

0=QE/El, 1=RES, 2=DIS, 3=Coherent production

Definition at line 290 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::nu_dcosx_truth
private

neutrino dcos x

Definition at line 298 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::nu_dcosy_truth
private

neutrino dcos y

Definition at line 299 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::nu_dcosz_truth
private

neutrino dcos z

Definition at line 300 of file HitDumper_module.cc.

std::vector<Int_t> Hitdumper::nuID_truth
private

Unique ID of each true neutrino.

Definition at line 287 of file HitDumper_module.cc.

std::vector<Int_t> Hitdumper::nuPDG_truth
private

neutrino PDG code

Definition at line 288 of file HitDumper_module.cc.

std::vector<Int_t> Hitdumper::nuScatterCode_truth
private

Scattering code given by Genie for each neutrino.

Definition at line 286 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::nuvtxx_truth
private

neutrino vertex x

Definition at line 295 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::nuvtxy_truth
private

neutrino vertex y

Definition at line 296 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::nuvtxz_truth
private

neutrino vertex z

Definition at line 297 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::Q2_truth
private

Momentum transfer squared.

Definition at line 292 of file HitDumper_module.cc.

std::vector<Int_t> Hitdumper::tptype_flux
private

Type of parent particle leaving BNB target.

Definition at line 310 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::tpx_flux
private

Px of parent particle leaving BNB target.

Definition at line 307 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::tpy_flux
private

Py of parent particle leaving BNB target.

Definition at line 308 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::tpz_flux
private

Pz of parent particle leaving BNB target.

Definition at line 309 of file HitDumper_module.cc.

std::vector<Float_t> Hitdumper::W_truth
private

hadronic invariant mass

Definition at line 293 of file HitDumper_module.cc.


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