All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
sbnd::AnalysisTreeDataStruct Class Reference

Classes

class  BoxedArray
 A wrapper to a C array (needed to embed an array into a vector) More...
 
class  BranchCreator
 Little helper functor class to create or reset branches in a tree. More...
 
class  ShowerDataStruct
 
struct  SubRunData_t
 information from the subrun More...
 
class  TrackDataStruct
 
class  VertexDataStruct
 

Public Types

enum  DataBits_t : unsigned int {
  tdAuxDet = 0x01, tdCry = 0x02, tdGenie = 0x04, tdGeant = 0x08,
  tdHit = 0x10, tdTrack = 0x20, tdShower = 0x40, tdVtx = 0x80,
  tdSlice = 0x100, tdDefault = 0
}
 
template<typename T >
using AuxDetMCData_t = std::vector< BoxedArray< T[kMaxAuxDets]>>
 

Public Member Functions

bool hasAuxDetector () const
 Returns whether we have auxiliary detector data. More...
 
bool hasCryInfo () const
 Returns whether we have Cry data. More...
 
bool hasGenieInfo () const
 Returns whether we have Genie data. More...
 
bool hasHitInfo () const
 Returns whether we have Hit data. More...
 
bool hasTrackInfo () const
 Returns whether we have Track data. More...
 
bool hasShowerInfo () const
 Returns whether we have Shower data. More...
 
bool hasSliceInfo () const
 Returns whether we have Slice data. More...
 
bool hasVertexInfo () const
 Returns whether we have Vertex data. More...
 
bool hasGeantInfo () const
 Returns whether we have Geant data. More...
 
void SetBits (unsigned int setbits, bool unset=false)
 Sets the specified bits. More...
 
 AnalysisTreeDataStruct (size_t nTrackers=0)
 Constructor; clears all fields. More...
 
TrackDataStructGetTrackerData (size_t iTracker)
 
const TrackDataStructGetTrackerData (size_t iTracker) const
 
VertexDataStructGetVertexData (size_t iTracker)
 
ShowerDataStructGetShowerData ()
 
void ClearLocalData ()
 Clear all fields if this object (not the tracker algorithm data) More...
 
void Clear ()
 Clear all fields. More...
 
void SetTrackers (size_t nTrackers)
 Allocates data structures for the given number of trackers (no Clear()) More...
 
void SetVertices (size_t nTrackers)
 Allocates data structures for the given number of trackers (no Clear()) More...
 
void ResizeMCNeutrino (int nNeutrinos)
 Resize the data structure for MCNeutrino particles. More...
 
void ResizeGEANT (int nParticles)
 Resize the data strutcure for GEANT particles. More...
 
void ResizeGenie (int nPrimaries)
 Resize the data strutcure for Genie primaries. More...
 
void ResizeCry (int nPrimaries)
 Resize the data strutcure for Cry primaries. More...
 
void SetAddresses (TTree *pTree, const std::vector< std::string > &trackers, std::string showerLabel, const std::vector< std::string > &vertexLabels, bool isCosmics, const std::vector< bool > &saveHierarchyInfo, bool saveShowerHierarchyInfo)
 Connect this object with a tree. More...
 
void SetShowerAddresses (TTree *pTree, std::string showerLabel, bool saveHierarchyInfo)
 Connect this object with a tree. More...
 
size_t GetNTrackers () const
 Returns the number of trackers for which data structures are allocated. More...
 
size_t GetMaxHits () const
 Returns the number of hits for which memory is allocated. More...
 
size_t GetMaxTrackers () const
 Returns the number of trackers for which memory is allocated. More...
 
size_t GetMaxGEANTparticles () const
 Returns the number of GEANT particles for which memory is allocated. More...
 
size_t GetMaxGeniePrimaries () const
 Returns the number of GENIE primaries for which memory is allocated. More...
 

Public Attributes

SubRunData_t SubRunData
 subrun data collected at begin of subrun More...
 
Int_t run
 
Int_t subrun
 
Int_t event
 
Double_t evttime
 
Double_t beamtime
 
Float_t taulife
 
Char_t isdata
 
Int_t no_hits
 
Short_t hit_tpc [kMaxHits]
 
Short_t hit_plane [kMaxHits]
 
Short_t hit_wire [kMaxHits]
 
Short_t hit_channel [kMaxHits]
 
Float_t hit_peakT [kMaxHits]
 
Float_t hit_ph [kMaxHits]
 
Float_t hit_charge [kMaxHits]
 
Float_t hit_startT [kMaxHits]
 
Float_t hit_endT [kMaxHits]
 
Float_t hit_width [kMaxHits]
 
Short_t hit_trkid [kMaxHits]
 
Int_t hit_mcid [kMaxHits]
 
Float_t hit_frac [kMaxHits]
 
Float_t hit_energy [kMaxHits]
 
Float_t hit_nelec [kMaxHits]
 
Float_t hit_reconelec [kMaxHits]
 
Char_t kNTracker
 
std::vector< TrackDataStructTrackData
 
std::vector< VertexDataStructVertexData
 
ShowerDataStruct ShowerData
 
Int_t num_pfps
 
Int_t pfp_sliceid [kMaxPFPs]
 
Int_t pfp_pdg [kMaxPFPs]
 
Int_t num_slices
 
Int_t num_nuslices
 
Int_t best_nuslice_id
 
Int_t best_nuslice_pfpid
 
Int_t best_nuslice_pdg
 
Int_t best_nuslice_origin
 
Float_t best_nuslice_score
 
Float_t best_nuslice_hitcomp
 
Float_t best_nuslice_hitpurity
 
Float_t best_nuslice_lephitcomp
 
Float_t best_nuslice_lephitpurity
 
size_t MaxMCNeutrinos
 
Int_t mcevts_truth
 ! The number of MCNeutrinos there is currently room for More...
 
std::vector< Int_t > nuScatterCode_truth
 
std::vector< Int_t > nuID_truth
 
std::vector< Int_t > nuPDG_truth
 
std::vector< Int_t > ccnc_truth
 
std::vector< Int_t > mode_truth
 
std::vector< Float_t > enu_truth
 
std::vector< Float_t > Q2_truth
 
std::vector< Float_t > W_truth
 
std::vector< Int_t > hitnuc_truth
 
std::vector< Float_t > nuvtxx_truth
 
std::vector< Float_t > nuvtxy_truth
 
std::vector< Float_t > nuvtxz_truth
 
std::vector< Float_t > nu_dcosx_truth
 
std::vector< Float_t > nu_dcosy_truth
 
std::vector< Float_t > nu_dcosz_truth
 
std::vector< Float_t > lep_mom_truth
 
std::vector< Float_t > lep_dcosx_truth
 
std::vector< Float_t > lep_dcosy_truth
 
std::vector< Float_t > lep_dcosz_truth
 
std::vector< Float_t > tpx_flux
 
std::vector< Float_t > tpy_flux
 
std::vector< Float_t > tpz_flux
 
std::vector< Int_t > tptype_flux
 
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
 
Int_t mcevts_truthcry
 
Int_t cry_no_primaries
 
std::vector< Int_t > cry_primaries_pdg
 
std::vector< Float_t > cry_Eng
 
std::vector< Float_t > cry_Px
 
std::vector< Float_t > cry_Py
 
std::vector< Float_t > cry_Pz
 
std::vector< Float_t > cry_P
 
std::vector< Float_t > cry_StartPointx
 
std::vector< Float_t > cry_StartPointy
 
std::vector< Float_t > cry_StartPointz
 
std::vector< Int_t > cry_status_code
 
std::vector< Float_t > cry_mass
 
std::vector< Int_t > cry_trackID
 
std::vector< Int_t > cry_ND
 
std::vector< Int_t > cry_mother
 
size_t MaxGEANTparticles = 0
 
Int_t no_primaries
 ! how many particles there is currently room for More...
 
Int_t geant_list_size
 
Int_t geant_list_size_in_tpcAV
 
std::vector< Int_t > pdg
 
std::vector< Int_t > status
 
std::vector< Float_t > Eng
 
std::vector< Float_t > EndE
 
std::vector< Float_t > Mass
 
std::vector< Float_t > Px
 
std::vector< Float_t > Py
 
std::vector< Float_t > Pz
 
std::vector< Float_t > P
 
std::vector< Float_t > StartPointx
 
std::vector< Float_t > StartPointy
 
std::vector< Float_t > StartPointz
 
std::vector< Float_t > StartT
 
std::vector< Float_t > EndT
 
std::vector< Float_t > EndPointx
 
std::vector< Float_t > EndPointy
 
std::vector< Float_t > EndPointz
 
std::vector< Float_t > theta
 
std::vector< Float_t > phi
 
std::vector< Float_t > theta_xz
 
std::vector< Float_t > theta_yz
 
std::vector< Float_t > pathlen
 
std::vector< Int_t > inTPCActive
 
std::vector< Float_t > StartPointx_tpcAV
 
std::vector< Float_t > StartPointy_tpcAV
 
std::vector< Float_t > StartPointz_tpcAV
 
std::vector< Float_t > EndPointx_tpcAV
 
std::vector< Float_t > EndPointy_tpcAV
 
std::vector< Float_t > EndPointz_tpcAV
 
std::vector< Int_t > NumberDaughters
 
std::vector< Int_t > TrackId
 
std::vector< Int_t > Mother
 
std::vector< Int_t > process_primary
 
std::vector< std::string > processname
 
std::vector< Int_t > MergedId
 
std::vector< Int_t > MotherNuId
 
std::vector< Float_t > DepEnergy
 
std::vector< Float_t > NumElectrons
 
Float_t total_DepEnergy
 
Float_t total_NumElectrons
 
std::vector< UShort_t > NAuxDets
 Number of AuxDets crossed by this particle. More...
 
AuxDetMCData_t< Short_t > AuxDetID
 Which AuxDet this particle went through. More...
 
AuxDetMCData_t< Float_t > entryX
 Entry X position of particle into AuxDet. More...
 
AuxDetMCData_t< Float_t > entryY
 Entry Y position of particle into AuxDet. More...
 
AuxDetMCData_t< Float_t > entryZ
 Entry Z position of particle into AuxDet. More...
 
AuxDetMCData_t< Float_t > entryT
 Entry T position of particle into AuxDet. More...
 
AuxDetMCData_t< Float_t > exitX
 Exit X position of particle out of AuxDet. More...
 
AuxDetMCData_t< Float_t > exitY
 Exit Y position of particle out of AuxDet. More...
 
AuxDetMCData_t< Float_t > exitZ
 Exit Z position of particle out of AuxDet. More...
 
AuxDetMCData_t< Float_t > exitT
 Exit T position of particle out of AuxDet. More...
 
AuxDetMCData_t< Float_t > exitPx
 Exit x momentum of particle out of AuxDet. More...
 
AuxDetMCData_t< Float_t > exitPy
 Exit y momentum of particle out of AuxDet. More...
 
AuxDetMCData_t< Float_t > exitPz
 Exit z momentum of particle out of AuxDet. More...
 
AuxDetMCData_t< Float_t > CombinedEnergyDep
 Sum energy of all particles with this trackID (+ID or -ID) in AuxDet. More...
 
unsigned int bits
 complementary information More...
 

Detailed Description

Data structure with all the tree information.

Can connect to a tree, clear its fields and resize its data.

Definition at line 177 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

Member Typedef Documentation

template<typename T >
using sbnd::AnalysisTreeDataStruct::AuxDetMCData_t = std::vector<BoxedArray<T[kMaxAuxDets]>>

Member Enumeration Documentation

Enumerator
tdAuxDet 
tdCry 
tdGenie 
tdGeant 
tdHit 
tdTrack 
tdShower 
tdVtx 
tdSlice 
tdDefault 

Definition at line 418 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

Constructor & Destructor Documentation

sbnd::AnalysisTreeDataStruct::AnalysisTreeDataStruct ( size_t  nTrackers = 0)
inline

Constructor; clears all fields.

Definition at line 671 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

671  : bits(tdDefault)
672  { SetTrackers(nTrackers); SetVertices(nTrackers); Clear(); }
void SetTrackers(size_t nTrackers)
Allocates data structures for the given number of trackers (no Clear())
void SetVertices(size_t nTrackers)
Allocates data structures for the given number of trackers (no Clear())

Member Function Documentation

void sbnd::AnalysisTreeDataStruct::Clear ( )

Clear all fields.

Definition at line 1719 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

1719  {
1720  ClearLocalData();
1721  std::for_each
1722  (TrackData.begin(), TrackData.end(), std::mem_fn(&TrackDataStruct::Clear));
1723  std::for_each
1724  (VertexData.begin(), VertexData.end(), std::mem_fn(&VertexDataStruct::Clear));
1725  std::mem_fn(&ShowerDataStruct::Clear);
1726 } // sbnd::AnalysisTreeDataStruct::Clear()
void ClearLocalData()
Clear all fields if this object (not the tracker algorithm data)
void sbnd::AnalysisTreeDataStruct::ClearLocalData ( )

Clear all fields if this object (not the tracker algorithm data)

Definition at line 1546 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

1546  {
1547 
1548 // RunData.Clear();
1549  SubRunData.Clear();
1550 
1551  run = -99999;
1552  subrun = -99999;
1553  event = -99999;
1554  evttime = -99999;
1555  beamtime = -99999;
1556  isdata = -99;
1557  taulife = -999;
1558 
1559  // Clear hit info
1560  no_hits = 0;
1561  std::fill(hit_tpc, hit_tpc + sizeof(hit_tpc)/sizeof(hit_tpc[0]), -9999);
1562  std::fill(hit_plane, hit_plane + sizeof(hit_plane)/sizeof(hit_plane[0]), -9999);
1563  std::fill(hit_wire, hit_wire + sizeof(hit_wire)/sizeof(hit_wire[0]), -9999);
1564  std::fill(hit_channel, hit_channel + sizeof(hit_channel)/sizeof(hit_channel[0]), -9999);
1565  std::fill(hit_peakT, hit_peakT + sizeof(hit_peakT)/sizeof(hit_peakT[0]), -99999.);
1566  std::fill(hit_charge, hit_charge + sizeof(hit_charge)/sizeof(hit_charge[0]), -99999.);
1567  std::fill(hit_ph, hit_ph + sizeof(hit_ph)/sizeof(hit_ph[0]), -99999.);
1568  std::fill(hit_startT, hit_startT + sizeof(hit_startT)/sizeof(hit_startT[0]), -99999.);
1569  std::fill(hit_endT, hit_endT + sizeof(hit_endT)/sizeof(hit_endT[0]), -99999.);
1570  std::fill(hit_width, hit_width + sizeof(hit_width)/sizeof(hit_width[0]), -99999.);
1571  std::fill(hit_trkid, hit_trkid + sizeof(hit_trkid)/sizeof(hit_trkid[0]), -9999);
1572  std::fill(hit_mcid, hit_mcid + sizeof(hit_mcid)/sizeof(hit_mcid[0]), -9);
1573  std::fill(hit_frac, hit_frac + sizeof(hit_frac)/sizeof(hit_frac[0]), -9);
1574  std::fill(hit_nelec, hit_nelec + sizeof(hit_nelec)/sizeof(hit_nelec[0]), -9999);
1575  std::fill(hit_energy, hit_energy + sizeof(hit_energy)/sizeof(hit_energy[0]), -9999);
1576  std::fill(hit_reconelec, hit_reconelec + sizeof(hit_reconelec)/sizeof(hit_reconelec[0]), -9999);
1577 
1578  // Clear MCTruth info
1579  mcevts_truth = 0;
1580  mcevts_truthcry = -99999;
1581  FillWith(nuScatterCode_truth,-99999);
1582  FillWith(nuID_truth,-99999);
1583  FillWith(nuPDG_truth,-99999);
1584  FillWith(ccnc_truth,-99999);
1585  FillWith(mode_truth,-99999);
1586  FillWith(enu_truth,-99999);
1587  FillWith(Q2_truth,-99999);
1588  FillWith(W_truth,-99999);
1589  FillWith(hitnuc_truth,-99999);
1590  FillWith(nuvtxx_truth,-99999);
1591  FillWith(nuvtxy_truth,-99999);
1592  FillWith(nuvtxz_truth,-99999);
1593  FillWith(nu_dcosx_truth,-99999);
1594  FillWith(nu_dcosy_truth,-99999);
1595  FillWith(nu_dcosz_truth,-99999);
1596  FillWith(lep_mom_truth,-99999);
1597  FillWith(lep_dcosx_truth,-99999);
1598  FillWith(lep_dcosy_truth,-99999);
1599  FillWith(lep_dcosz_truth,-99999);
1600  FillWith(tpx_flux,-99999);
1601  FillWith(tpy_flux,-99999);
1602  FillWith(tpz_flux,-99999);
1603  FillWith(tptype_flux,-99999);
1604 
1605  genie_no_primaries = 0;
1606  cry_no_primaries = 0;
1607  no_primaries = 0;
1608  geant_list_size=0;
1610 
1611  FillWith(pdg, -99999);
1612  FillWith(status, -99999);
1613  FillWith(Mass, -99999.);
1614  FillWith(Eng, -99999.);
1615  FillWith(EndE, -99999.);
1616  FillWith(Px, -99999.);
1617  FillWith(Py, -99999.);
1618  FillWith(Pz, -99999.);
1619  FillWith(P, -99999.);
1620  FillWith(StartPointx, -99999.);
1621  FillWith(StartPointy, -99999.);
1622  FillWith(StartPointz, -99999.);
1623  FillWith(StartT, -9999999.);
1624  FillWith(EndT, -9999999.);
1625  FillWith(EndPointx, -99999.);
1626  FillWith(EndPointy, -99999.);
1627  FillWith(EndPointz, -99999.);
1628  FillWith(EndT, -99999.);
1629  FillWith(theta, -99999.);
1630  FillWith(phi, -99999.);
1631  FillWith(theta_xz, -99999.);
1632  FillWith(theta_yz, -99999.);
1633  FillWith(pathlen, -99999.);
1634  FillWith(inTPCActive, -99999);
1635  FillWith(StartPointx_tpcAV, -99999.);
1636  FillWith(StartPointy_tpcAV, -99999.);
1637  FillWith(StartPointz_tpcAV, -99999.);
1638  FillWith(EndPointx_tpcAV, -99999.);
1639  FillWith(EndPointy_tpcAV, -99999.);
1640  FillWith(EndPointz_tpcAV, -99999.);
1641  FillWith(NumberDaughters, -99999);
1642  FillWith(Mother, -99999);
1643  FillWith(TrackId, -99999);
1644  FillWith(process_primary, -99999);
1645  FillWith(processname, "noname");
1646  FillWith(MergedId, -99999);
1647  FillWith(MotherNuId, -99999);
1648  FillWith(DepEnergy, -9999);
1649  FillWith(NumElectrons, -9999);
1650  total_DepEnergy = -9999.;
1651  total_NumElectrons = -9999.;
1652  FillWith(genie_primaries_pdg, -99999);
1653  FillWith(genie_Eng, -99999.);
1654  FillWith(genie_Px, -99999.);
1655  FillWith(genie_Py, -99999.);
1656  FillWith(genie_Pz, -99999.);
1657  FillWith(genie_P, -99999.);
1658  FillWith(genie_status_code, -99999);
1659  FillWith(genie_mass, -99999.);
1660  FillWith(genie_trackID, -99999);
1661  FillWith(genie_ND, -99999);
1662  FillWith(genie_mother, -99999);
1663  FillWith(cry_primaries_pdg, -99999);
1664  FillWith(cry_Eng, -99999.);
1665  FillWith(cry_Px, -99999.);
1666  FillWith(cry_Py, -99999.);
1667  FillWith(cry_Pz, -99999.);
1668  FillWith(cry_P, -99999.);
1669  FillWith(cry_StartPointx, -99999.);
1670  FillWith(cry_StartPointy, -99999.);
1671  FillWith(cry_StartPointz, -99999.);
1672  FillWith(cry_status_code, -99999);
1673  FillWith(cry_mass, -99999.);
1674  FillWith(cry_trackID, -99999);
1675  FillWith(cry_ND, -99999);
1676  FillWith(cry_mother, -99999);
1677 
1678 
1679  // auxiliary detector information;
1680  FillWith(NAuxDets, 0);
1681  // - set to -9999 all the values of each of the arrays in AuxDetID;
1682  // this auto is BoxedArray<Short_t>
1683  for (auto& partInfo: AuxDetID) FillWith(partInfo, -9999);
1684  // - pythonish C++: as the previous line, for each one in a list of containers
1685  // of the same type (C++ is not python yet), using pointers to avoid copy;
1686  for (AuxDetMCData_t<Float_t>* cont: {
1687  &entryX, &entryY, &entryZ, &entryT,
1688  &exitX , &exitY , &exitZ, &exitT, &exitPx, &exitPy, &exitPz,
1690  })
1691  {
1692  // this auto is BoxedArray<Float_t>
1693  for (auto& partInfo: *cont) FillWith(partInfo, -99999.);
1694  } // for container
1695 
1696  // Clear PFP info
1697  num_pfps = 0;
1698  //FillWith(pfp_id,-999);
1699  FillWith(pfp_sliceid,-999);
1700  FillWith(pfp_pdg,-999);
1701 
1702  // Clear slice info
1703  num_slices = 0;
1704  num_nuslices = 0;
1705  best_nuslice_id = -999;
1706  best_nuslice_pdg = -999;
1707  best_nuslice_pfpid = -999;
1708  best_nuslice_origin = -9;
1709  best_nuslice_score = -9.;
1710  best_nuslice_hitcomp = -9.;
1711  best_nuslice_hitpurity = -9.;
1714 
1715 
1716 } // sbnd::AnalysisTreeDataStruct::ClearLocalData()
Int_t mcevts_truth
! The number of MCNeutrinos there is currently room for
Int_t no_primaries
! how many particles there is currently room for
AuxDetMCData_t< Float_t > entryT
Entry T position of particle into AuxDet.
AuxDetMCData_t< Float_t > exitT
Exit T position of particle out of AuxDet.
AuxDetMCData_t< Float_t > exitPx
Exit x momentum of particle out of AuxDet.
SubRunData_t SubRunData
subrun data collected at begin of subrun
AuxDetMCData_t< Float_t > exitPz
Exit z momentum of particle out of AuxDet.
AuxDetMCData_t< Float_t > exitY
Exit Y position of particle out of AuxDet.
AuxDetMCData_t< Float_t > exitX
Exit X position of particle out of AuxDet.
AuxDetMCData_t< Float_t > entryY
Entry Y position of particle into AuxDet.
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
AuxDetMCData_t< Float_t > entryZ
Entry Z position of particle into AuxDet.
AuxDetMCData_t< Float_t > exitPy
Exit y momentum of particle out of AuxDet.
AuxDetMCData_t< Float_t > CombinedEnergyDep
Sum energy of all particles with this trackID (+ID or -ID) in AuxDet.
AuxDetMCData_t< Short_t > AuxDetID
Which AuxDet this particle went through.
std::vector< UShort_t > NAuxDets
Number of AuxDets crossed by this particle.
AuxDetMCData_t< Float_t > entryX
Entry X position of particle into AuxDet.
AuxDetMCData_t< Float_t > exitZ
Exit Z position of particle out of AuxDet.
size_t sbnd::AnalysisTreeDataStruct::GetMaxGEANTparticles ( ) const
inline

Returns the number of GEANT particles for which memory is allocated.

Definition at line 725 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

size_t sbnd::AnalysisTreeDataStruct::GetMaxGeniePrimaries ( ) const
inline

Returns the number of GENIE primaries for which memory is allocated.

Definition at line 728 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

size_t sbnd::AnalysisTreeDataStruct::GetMaxHits ( ) const
inline

Returns the number of hits for which memory is allocated.

Definition at line 719 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

719 { return kMaxHits; }
size_t sbnd::AnalysisTreeDataStruct::GetMaxTrackers ( ) const
inline

Returns the number of trackers for which memory is allocated.

Definition at line 722 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

722 { return TrackData.capacity(); }
size_t sbnd::AnalysisTreeDataStruct::GetNTrackers ( ) const
inline

Returns the number of trackers for which data structures are allocated.

Definition at line 716 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

716 { return TrackData.size(); }
ShowerDataStruct& sbnd::AnalysisTreeDataStruct::GetShowerData ( )
inline
TrackDataStruct& sbnd::AnalysisTreeDataStruct::GetTrackerData ( size_t  iTracker)
inline

Definition at line 674 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

675  { return TrackData.at(iTracker); }
const TrackDataStruct& sbnd::AnalysisTreeDataStruct::GetTrackerData ( size_t  iTracker) const
inline

Definition at line 676 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

677  { return TrackData.at(iTracker); }
VertexDataStruct& sbnd::AnalysisTreeDataStruct::GetVertexData ( size_t  iTracker)
inline

Definition at line 679 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

680  { return VertexData.at(iTracker); }
bool sbnd::AnalysisTreeDataStruct::hasAuxDetector ( ) const
inline

Returns whether we have auxiliary detector data.

Definition at line 640 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

bool sbnd::AnalysisTreeDataStruct::hasCryInfo ( ) const
inline
bool sbnd::AnalysisTreeDataStruct::hasGeantInfo ( ) const
inline
bool sbnd::AnalysisTreeDataStruct::hasGenieInfo ( ) const
inline
bool sbnd::AnalysisTreeDataStruct::hasHitInfo ( ) const
inline
bool sbnd::AnalysisTreeDataStruct::hasShowerInfo ( ) const
inline
bool sbnd::AnalysisTreeDataStruct::hasSliceInfo ( ) const
inline
bool sbnd::AnalysisTreeDataStruct::hasTrackInfo ( ) const
inline
bool sbnd::AnalysisTreeDataStruct::hasVertexInfo ( ) const
inline
void sbnd::AnalysisTreeDataStruct::ResizeCry ( int  nPrimaries)

Resize the data strutcure for Cry primaries.

Definition at line 1842 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

1842  {
1843 
1844  cry_primaries_pdg.resize(nPrimaries);
1845  cry_Eng.resize(nPrimaries);
1846  cry_Px.resize(nPrimaries);
1847  cry_Py.resize(nPrimaries);
1848  cry_Pz.resize(nPrimaries);
1849  cry_P.resize(nPrimaries);
1850  cry_StartPointx.resize(nPrimaries);
1851  cry_StartPointy.resize(nPrimaries);
1852  cry_StartPointz.resize(nPrimaries);
1853  cry_status_code.resize(nPrimaries);
1854  cry_mass.resize(nPrimaries);
1855  cry_trackID.resize(nPrimaries);
1856  cry_ND.resize(nPrimaries);
1857  cry_mother.resize(nPrimaries);
1858 
1859 } // sbnd::AnalysisTreeDataStruct::ResizeCry()
void sbnd::AnalysisTreeDataStruct::ResizeGEANT ( int  nParticles)

Resize the data strutcure for GEANT particles.

Definition at line 1760 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

1760  {
1761 
1762  // minimum size is 1, so that we always have an address
1763  MaxGEANTparticles = (size_t) std::max(nParticles, 1);
1764 
1765  pdg.resize(MaxGEANTparticles);
1766  status.resize(MaxGEANTparticles);
1767  Mass.resize(MaxGEANTparticles);
1768  Eng.resize(MaxGEANTparticles);
1769  EndE.resize(MaxGEANTparticles);
1770  Px.resize(MaxGEANTparticles);
1771  Py.resize(MaxGEANTparticles);
1772  Pz.resize(MaxGEANTparticles);
1773  P.resize(MaxGEANTparticles);
1777  StartT.resize(MaxGEANTparticles);
1778  EndT.resize(MaxGEANTparticles);
1779  EndPointx.resize(MaxGEANTparticles);
1780  EndPointy.resize(MaxGEANTparticles);
1781  EndPointz.resize(MaxGEANTparticles);
1782  EndT.resize(MaxGEANTparticles);
1783  theta.resize(MaxGEANTparticles);
1784  phi.resize(MaxGEANTparticles);
1785  theta_xz.resize(MaxGEANTparticles);
1786  theta_yz.resize(MaxGEANTparticles);
1787  pathlen.resize(MaxGEANTparticles);
1788  DepEnergy.resize(MaxGEANTparticles);
1798  Mother.resize(MaxGEANTparticles);
1799  TrackId.resize(MaxGEANTparticles);
1802  MergedId.resize(MaxGEANTparticles);
1803  MotherNuId.resize(MaxGEANTparticles);
1804 
1805  // auxiliary detector structure
1806  NAuxDets.resize(MaxGEANTparticles);
1807  AuxDetID.resize(MaxGEANTparticles);
1808  entryX.resize(MaxGEANTparticles);
1809  entryY.resize(MaxGEANTparticles);
1810  entryZ.resize(MaxGEANTparticles);
1811  entryT.resize(MaxGEANTparticles);
1812  exitX.resize(MaxGEANTparticles);
1813  exitY.resize(MaxGEANTparticles);
1814  exitZ.resize(MaxGEANTparticles);
1815  exitT.resize(MaxGEANTparticles);
1816  exitPx.resize(MaxGEANTparticles);
1817  exitPy.resize(MaxGEANTparticles);
1818  exitPz.resize(MaxGEANTparticles);
1820 
1821 } // sbnd::AnalysisTreeDataStruct::ResizeGEANT()
AuxDetMCData_t< Float_t > entryT
Entry T position of particle into AuxDet.
AuxDetMCData_t< Float_t > exitT
Exit T position of particle out of AuxDet.
AuxDetMCData_t< Float_t > exitPx
Exit x momentum of particle out of AuxDet.
AuxDetMCData_t< Float_t > exitPz
Exit z momentum of particle out of AuxDet.
AuxDetMCData_t< Float_t > exitY
Exit Y position of particle out of AuxDet.
AuxDetMCData_t< Float_t > exitX
Exit X position of particle out of AuxDet.
AuxDetMCData_t< Float_t > entryY
Entry Y position of particle into AuxDet.
AuxDetMCData_t< Float_t > entryZ
Entry Z position of particle into AuxDet.
AuxDetMCData_t< Float_t > exitPy
Exit y momentum of particle out of AuxDet.
AuxDetMCData_t< Float_t > CombinedEnergyDep
Sum energy of all particles with this trackID (+ID or -ID) in AuxDet.
AuxDetMCData_t< Short_t > AuxDetID
Which AuxDet this particle went through.
std::vector< UShort_t > NAuxDets
Number of AuxDets crossed by this particle.
AuxDetMCData_t< Float_t > entryX
Entry X position of particle into AuxDet.
AuxDetMCData_t< Float_t > exitZ
Exit Z position of particle out of AuxDet.
void sbnd::AnalysisTreeDataStruct::ResizeGenie ( int  nPrimaries)

Resize the data strutcure for Genie primaries.

Definition at line 1823 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

1823  {
1824 
1825  // minimum size is 1, so that we always have an address
1826  MaxGeniePrimaries = (size_t) std::max(nPrimaries, 1);
1828  genie_Eng.resize(MaxGeniePrimaries);
1829  genie_Px.resize(MaxGeniePrimaries);
1830  genie_Py.resize(MaxGeniePrimaries);
1831  genie_Pz.resize(MaxGeniePrimaries);
1832  genie_P.resize(MaxGeniePrimaries);
1834  genie_mass.resize(MaxGeniePrimaries);
1836  genie_ND.resize(MaxGeniePrimaries);
1838 
1839 } // sbnd::AnalysisTreeDataStruct::ResizeGenie()
void sbnd::AnalysisTreeDataStruct::ResizeMCNeutrino ( int  nNeutrinos)

Resize the data structure for MCNeutrino particles.

Definition at line 1728 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

1728  {
1729 
1730  //min size is 1, to guarantee an address
1731  MaxMCNeutrinos = (size_t) std::max(nNeutrinos, 1);
1733  nuID_truth.resize(MaxMCNeutrinos);
1734  nuPDG_truth.resize(MaxMCNeutrinos);
1735  ccnc_truth.resize(MaxMCNeutrinos);
1736  mode_truth.resize(MaxMCNeutrinos);
1737  enu_truth.resize(MaxMCNeutrinos);
1738  Q2_truth.resize(MaxMCNeutrinos);
1739  W_truth.resize(MaxMCNeutrinos);
1740  hitnuc_truth.resize(MaxMCNeutrinos);
1741  nuvtxx_truth.resize(MaxMCNeutrinos);
1742  nuvtxy_truth.resize(MaxMCNeutrinos);
1743  nuvtxz_truth.resize(MaxMCNeutrinos);
1747  lep_mom_truth.resize(MaxMCNeutrinos);
1751  //Also resize the flux information here as it's a 1:1 with the MCNeutrino
1752  tpx_flux.resize(MaxMCNeutrinos);
1753  tpy_flux.resize(MaxMCNeutrinos);
1754  tpz_flux.resize(MaxMCNeutrinos);
1755  tptype_flux.resize(MaxMCNeutrinos);
1756 
1757  return;
1758 } // sbnd::AnalysisTreeDataStruct::ResizeMCNeutrino()
void sbnd::AnalysisTreeDataStruct::SetAddresses ( TTree *  pTree,
const std::vector< std::string > &  trackers,
std::string  showerLabel,
const std::vector< std::string > &  vertexLabels,
bool  isCosmics,
const std::vector< bool > &  saveHierarchyInfo,
bool  saveShowerHierarchyInfo 
)

Connect this object with a tree.

Definition at line 1861 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

1869  {
1870  BranchCreator CreateBranch(pTree);
1871 
1872  CreateBranch("run",&run,"run/I");
1873  CreateBranch("subrun",&subrun,"subrun/I");
1874  CreateBranch("event",&event,"event/I");
1875  CreateBranch("evttime",&evttime,"evttime/D");
1876  CreateBranch("beamtime",&beamtime,"beamtime/D");
1877  CreateBranch("pot",&SubRunData.pot,"pot/D");
1878 
1879  CreateBranch("isdata",&isdata,"isdata/B");
1880  CreateBranch("taulife",&taulife,"taulife/F");
1881 
1882  CreateBranch("no_hits",&no_hits,"no_hits/I");
1883  if (hasHitInfo()){
1884  CreateBranch("hit_tpc",hit_tpc,"hit_tpc[no_hits]/S");
1885  CreateBranch("hit_plane",hit_plane,"hit_plane[no_hits]/S");
1886  CreateBranch("hit_wire",hit_wire,"hit_wire[no_hits]/S");
1887  CreateBranch("hit_channel",hit_channel,"hit_channel[no_hits]/S");
1888  CreateBranch("hit_peakT",hit_peakT,"hit_peakT[no_hits]/F");
1889  CreateBranch("hit_charge",hit_charge,"hit_charge[no_hits]/F");
1890  CreateBranch("hit_ph",hit_ph,"hit_ph[no_hits]/F");
1891  CreateBranch("hit_startT",hit_startT,"hit_startT[no_hits]/F");
1892  CreateBranch("hit_endT",hit_endT,"hit_endT[no_hits]/F");
1893  CreateBranch("hit_width",hit_width,"hit_width[no_hits]/F");
1894  CreateBranch("hit_trkid",hit_trkid,"hit_trkid[no_hits]/S");
1895  CreateBranch("hit_mcid",hit_mcid,"hit_mcid[no_hits]/I");
1896  CreateBranch("hit_frac",hit_frac,"hit_frac[no_hits]/F");
1897  CreateBranch("hit_energy",hit_energy,"hit_energy[no_hits]/F");
1898  CreateBranch("hit_nelec",hit_nelec,"hit_nelec[no_hits]/F");
1899  CreateBranch("hit_reconelec",hit_reconelec,"hit_reconelec[no_hits]/F");
1900  }
1901 
1902  if (hasVertexInfo()){
1903  /*
1904  CreateBranch("nvtx",&nvtx,"nvtx/S");
1905  CreateBranch("vtx",vtx,"vtx[nvtx][3]/F");
1906  if(saveHierarchyInfo)
1907  CreateBranch("primaryvtx",primaryvtx,"primaryvtx[nvtx]/I");
1908  */
1909 
1910  kNTracker = trackers.size();
1911  for(int i=0; i<kNTracker; i++){
1912  std::string VertexLabel = vertexLabels[i];
1913 
1914  // note that if the tracker data has maximum number of tracks 0,
1915  // nothing is initialized (branches are not even created)
1916  VertexData[i].SetAddresses(pTree, VertexLabel, saveHierarchyInfo[i]);
1917  }
1918  }
1919 
1920  if (hasTrackInfo()){
1921  AutoResettingStringSteam sstr;
1922  sstr() << kMaxTrackHits;
1923  std::string MaxTrackHitsIndexStr("[" + sstr.str() + "]");
1924 
1925  kNTracker = trackers.size();
1926  CreateBranch("kNTracker",&kNTracker,"kNTracker/B");
1927  for(int i=0; i<kNTracker; i++){
1928  std::string TrackLabel = trackers[i];
1929  std::string BranchName;
1930 
1931  // note that if the tracker data has maximum number of tracks 0,
1932  // nothing is initialized (branches are not even created)
1933  TrackData[i].SetAddresses(pTree, TrackLabel, isCosmics, saveHierarchyInfo[i]);
1934  } // for trackers
1935  }
1936 
1937  if (hasShowerInfo()){
1938  std::string ShowerLabel = showerLabel;
1939  ShowerData.SetShowerAddresses(pTree, ShowerLabel, saveShowerHierarchyInfo);
1940  }
1941 
1942  if (hasSliceInfo()){
1943  CreateBranch("num_pfps",&num_pfps,"num_pfps/I");
1944  CreateBranch("pfp_sliceid",&pfp_sliceid,"pfp_sliceid[num_pfps]/I");
1945  CreateBranch("pfp_pdg",&pfp_pdg,"pfp_pdg[num_pfps]/I");
1946  CreateBranch("num_slices",&num_slices,"num_slices/I");
1947  CreateBranch("num_nuslices",&num_nuslices,"num_nuslices/I");
1948  CreateBranch("best_nuslice_id",&best_nuslice_id,"best_nuslice_id/I");
1949  CreateBranch("best_nuslice_pfpid",&best_nuslice_pfpid,"best_nuslice_pfpid/I");
1950  CreateBranch("best_nuslice_pdg",&best_nuslice_pdg,"best_nuslice_pdg/I");
1951  CreateBranch("best_nuslice_origin",&best_nuslice_origin,"best_nuslice_origin/I");
1952  CreateBranch("best_nuslice_score",&best_nuslice_score,"best_nuslice_score/F");
1953  CreateBranch("best_nuslice_hitcomp",&best_nuslice_hitcomp,"best_nuslice_hitcomp/F");
1954  CreateBranch("best_nuslice_hitpurity",&best_nuslice_hitpurity,"best_nuslice_hitpurity/F");
1955  CreateBranch("best_nuslice_lephitcomp",&best_nuslice_lephitcomp,"best_nuslice_lephitcomp/F");
1956  CreateBranch("best_nuslice_lephitpurity",&best_nuslice_lephitpurity,"best_nuslice_lephitpurity/F");
1957  }
1958 
1959  if (hasGenieInfo()){
1960  CreateBranch("mcevts_truth",&mcevts_truth,"mcevts_truth/I");
1961  CreateBranch("nuScatterCode_truth",nuScatterCode_truth,"nuScatterCode_truth[mcevts_truth]/I");
1962  CreateBranch("nuID_truth",nuID_truth,"nuID_truth[mcevts_truth]/I");
1963  CreateBranch("nuPDG_truth",nuPDG_truth,"nuPDG_truth[mcevts_truth]/I");
1964  CreateBranch("ccnc_truth",ccnc_truth,"ccnc_truth[mcevts_truth]/I");
1965  CreateBranch("mode_truth",mode_truth,"mode_truth[mcevts_truth]/I");
1966  CreateBranch("enu_truth",enu_truth,"enu_truth[mcevts_truth]/F");
1967  CreateBranch("Q2_truth",Q2_truth,"Q2_truth[mcevts_truth]/F");
1968  CreateBranch("W_truth",W_truth,"W_truth[mcevts_truth]/F");
1969  CreateBranch("hitnuc_truth",hitnuc_truth,"hitnuc_truth[mcevts_truth]/I");
1970  CreateBranch("nuvtxx_truth",nuvtxx_truth,"nuvtxx_truth[mcevts_truth]/F");
1971  CreateBranch("nuvtxy_truth",nuvtxy_truth,"nuvtxy_truth[mcevts_truth]/F");
1972  CreateBranch("nuvtxz_truth",nuvtxz_truth,"nuvtxz_truth[mcevts_truth]/F");
1973  CreateBranch("nu_dcosx_truth",nu_dcosx_truth,"nu_dcosx_truth[mcevts_truth]/F");
1974  CreateBranch("nu_dcosy_truth",nu_dcosy_truth,"nu_dcosy_truth[mcevts_truth]/F");
1975  CreateBranch("nu_dcosz_truth",nu_dcosz_truth,"nu_dcosz_truth[mcevts_truth]/F");
1976  CreateBranch("lep_mom_truth",lep_mom_truth,"lep_mom_truth[mcevts_truth]/F");
1977  CreateBranch("lep_dcosx_truth",lep_dcosx_truth,"lep_dcosx_truth[mcevts_truth]/F");
1978  CreateBranch("lep_dcosy_truth",lep_dcosy_truth,"lep_dcosy_truth[mcevts_truth]/F");
1979  CreateBranch("lep_dcosz_truth",lep_dcosz_truth,"lep_dcosz_truth[mcevts_truth]/F");
1980 
1981  CreateBranch("tpx_flux",tpx_flux,"tpx_flux[mcevts_truth]/F");
1982  CreateBranch("tpy_flux",tpy_flux,"tpy_flux[mcevts_truth]/F");
1983  CreateBranch("tpz_flux",tpz_flux,"tpz_flux[mcevts_truth]/F");
1984  CreateBranch("tptype_flux",tptype_flux,"tptype_flux[mcevts_truth]/I");
1985 
1986  CreateBranch("genie_no_primaries",&genie_no_primaries,"genie_no_primaries/I");
1987  CreateBranch("genie_primaries_pdg",genie_primaries_pdg,"genie_primaries_pdg[genie_no_primaries]/I");
1988  CreateBranch("genie_Eng",genie_Eng,"genie_Eng[genie_no_primaries]/F");
1989  CreateBranch("genie_Px",genie_Px,"genie_Px[genie_no_primaries]/F");
1990  CreateBranch("genie_Py",genie_Py,"genie_Py[genie_no_primaries]/F");
1991  CreateBranch("genie_Pz",genie_Pz,"genie_Pz[genie_no_primaries]/F");
1992  CreateBranch("genie_P",genie_P,"genie_P[genie_no_primaries]/F");
1993  CreateBranch("genie_status_code",genie_status_code,"genie_status_code[genie_no_primaries]/I");
1994  CreateBranch("genie_mass",genie_mass,"genie_mass[genie_no_primaries]/F");
1995  CreateBranch("genie_trackID",genie_trackID,"genie_trackID[genie_no_primaries]/I");
1996  CreateBranch("genie_ND",genie_ND,"genie_ND[genie_no_primaries]/I");
1997  CreateBranch("genie_mother",genie_mother,"genie_mother[genie_no_primaries]/I");
1998  }
1999 
2000  if (hasCryInfo()){
2001  CreateBranch("mcevts_truthcry",&mcevts_truthcry,"mcevts_truthcry/I");
2002  CreateBranch("cry_no_primaries",&cry_no_primaries,"cry_no_primaries/I");
2003  CreateBranch("cry_primaries_pdg",cry_primaries_pdg,"cry_primaries_pdg[cry_no_primaries]/I");
2004  CreateBranch("cry_Eng",cry_Eng,"cry_Eng[cry_no_primaries]/F");
2005  CreateBranch("cry_Px",cry_Px,"cry_Px[cry_no_primaries]/F");
2006  CreateBranch("cry_Py",cry_Py,"cry_Py[cry_no_primaries]/F");
2007  CreateBranch("cry_Pz",cry_Pz,"cry_Pz[cry_no_primaries]/F");
2008  CreateBranch("cry_P",cry_P,"cry_P[cry_no_primaries]/F");
2009  CreateBranch("cry_StartPointx",cry_StartPointx,"cry_StartPointx[cry_no_primaries]/F");
2010  CreateBranch("cry_StartPointy",cry_StartPointy,"cry_StartPointy[cry_no_primaries]/F");
2011  CreateBranch("cry_StartPointz",cry_StartPointz,"cry_StartPointz[cry_no_primaries]/F");
2012  CreateBranch("cry_status_code",cry_status_code,"cry_status_code[cry_no_primaries]/I");
2013  CreateBranch("cry_mass",cry_mass,"cry_mass[cry_no_primaries]/F");
2014  CreateBranch("cry_trackID",cry_trackID,"cry_trackID[cry_no_primaries]/I");
2015  CreateBranch("cry_ND",cry_ND,"cry_ND[cry_no_primaries]/I");
2016  CreateBranch("cry_mother",cry_mother,"cry_mother[cry_no_primaries]/I");
2017  }
2018 
2019  if (hasGeantInfo()){
2020  CreateBranch("no_primaries",&no_primaries,"no_primaries/I");
2021  CreateBranch("geant_list_size",&geant_list_size,"geant_list_size/I");
2022  CreateBranch("geant_list_size_in_tpcAV",&geant_list_size_in_tpcAV,"geant_list_size_in_tpcAV/I");
2023  CreateBranch("pdg",pdg,"pdg[geant_list_size]/I");
2024  CreateBranch("status",status,"status[geant_list_size]/I");
2025  CreateBranch("Mass",Mass,"Mass[geant_list_size]/F");
2026  CreateBranch("Eng",Eng,"Eng[geant_list_size]/F");
2027  CreateBranch("EndE",EndE,"EndE[geant_list_size]/F");
2028  CreateBranch("Px",Px,"Px[geant_list_size]/F");
2029  CreateBranch("Py",Py,"Py[geant_list_size]/F");
2030  CreateBranch("Pz",Pz,"Pz[geant_list_size]/F");
2031  CreateBranch("P",P,"P[geant_list_size]/F");
2032  CreateBranch("StartPointx",StartPointx,"StartPointx[geant_list_size]/F");
2033  CreateBranch("StartPointy",StartPointy,"StartPointy[geant_list_size]/F");
2034  CreateBranch("StartPointz",StartPointz,"StartPointz[geant_list_size]/F");
2035  CreateBranch("StartT",StartT,"StartT[geant_list_size]/F");
2036  CreateBranch("EndPointx",EndPointx,"EndPointx[geant_list_size]/F");
2037  CreateBranch("EndPointy",EndPointy,"EndPointy[geant_list_size]/F");
2038  CreateBranch("EndPointz",EndPointz,"EndPointz[geant_list_size]/F");
2039  CreateBranch("EndT",EndT,"EndT[geant_list_size]/F");
2040  CreateBranch("theta",theta,"theta[geant_list_size]/F");
2041  CreateBranch("phi",phi,"phi[geant_list_size]/F");
2042  CreateBranch("theta_xz",theta_xz,"theta_xz[geant_list_size]/F");
2043  CreateBranch("theta_yz",theta_yz,"theta_yz[geant_list_size]/F");
2044  CreateBranch("pathlen",pathlen,"pathlen[geant_list_size]/F");
2045  CreateBranch("inTPCActive",inTPCActive,"inTPCActive[geant_list_size]/I");
2046  CreateBranch("StartPointx_tpcAV",StartPointx_tpcAV,"StartPointx_tpcAV[geant_list_size]/F");
2047  CreateBranch("StartPointy_tpcAV",StartPointy_tpcAV,"StartPointy_tpcAV[geant_list_size]/F");
2048  CreateBranch("StartPointz_tpcAV",StartPointz_tpcAV,"StartPointz_tpcAV[geant_list_size]/F");
2049  CreateBranch("EndPointx_tpcAV",EndPointx_tpcAV,"EndPointx_tpcAV[geant_list_size]/F");
2050  CreateBranch("EndPointy_tpcAV",EndPointy_tpcAV,"EndPointy_tpcAV[geant_list_size]/F");
2051  CreateBranch("EndPointz_tpcAV",EndPointz_tpcAV,"EndPointz_tpcAV[geant_list_size]/F");
2052  CreateBranch("NumberDaughters",NumberDaughters,"NumberDaughters[geant_list_size]/I");
2053  CreateBranch("Mother",Mother,"Mother[geant_list_size]/I");
2054  CreateBranch("TrackId",TrackId,"TrackId[geant_list_size]/I");
2055  CreateBranch("MergedId", MergedId, "MergedId[geant_list_size]/I");
2056  CreateBranch("MotherNuId", MotherNuId, "MotherNuId[geant_list_size]/I");
2057  CreateBranch("process_primary",process_primary,"process_primary[geant_list_size]/I");
2058  CreateBranch("processname", processname);
2059  CreateBranch("DepEnergy", DepEnergy, "DepEnergy[geant_list_size]/F");
2060  CreateBranch("NumElectrons", NumElectrons, "NumElectrons[geant_list_size]/F");
2061  CreateBranch("total_DepEnergy", &total_DepEnergy, "total_DepEnergy/F");
2062  CreateBranch("total_NumElectrons", &total_NumElectrons,"total_NumElectrons/F");
2063  }
2064 
2065  if (hasAuxDetector()) {
2066  // Geant information is required to fill aux detector information.
2067  // if fSaveGeantInfo is not set to true, show an error message and quit!
2068  if (!hasGeantInfo()){
2069  throw art::Exception(art::errors::Configuration)
2070  << "Saving Auxiliary detector information requies saving GEANT information, "
2071  <<"please set fSaveGeantInfo flag to true in your fhicl file and rerun.\n";
2072  }
2073  std::ostringstream sstr;
2074  sstr << "[" << kMaxAuxDets << "]";
2075  std::string MaxAuxDetIndexStr = sstr.str();
2076  CreateBranch("NAuxDets", NAuxDets, "NAuxDets[geant_list_size]/s");
2077  CreateBranch("AuxDetID", AuxDetID, "AuxDetID[geant_list_size]" + MaxAuxDetIndexStr + "/S");
2078  CreateBranch("AuxDetEntryX", entryX, "AuxDetEntryX[geant_list_size]" + MaxAuxDetIndexStr + "/F");
2079  CreateBranch("AuxDetEntryY", entryY, "AuxDetEntryY[geant_list_size]" + MaxAuxDetIndexStr + "/F");
2080  CreateBranch("AuxDetEntryZ", entryZ, "AuxDetEntryZ[geant_list_size]" + MaxAuxDetIndexStr + "/F");
2081  CreateBranch("AuxDetEntryT", entryT, "AuxDetEntryT[geant_list_size]" + MaxAuxDetIndexStr + "/F");
2082  CreateBranch("AuxDetExitX", exitX, "AuxDetExitX[geant_list_size]" + MaxAuxDetIndexStr + "/F");
2083  CreateBranch("AuxDetExitY", exitY, "AuxDetExitY[geant_list_size]" + MaxAuxDetIndexStr + "/F");
2084  CreateBranch("AuxDetExitZ", exitZ, "AuxDetExitZ[geant_list_size]" + MaxAuxDetIndexStr + "/F");
2085  CreateBranch("AuxDetExitT", exitT, "AuxDetExitT[geant_list_size]" + MaxAuxDetIndexStr + "/F");
2086  CreateBranch("AuxDetExitPx", exitPx, "AuxDetExitPx[geant_list_size]" + MaxAuxDetIndexStr + "/F");
2087  CreateBranch("AuxDetExitPy", exitPy, "AuxDetExitPy[geant_list_size]" + MaxAuxDetIndexStr + "/F");
2088  CreateBranch("AuxDetExitPz", exitPz, "AuxDetExitPz[geant_list_size]" + MaxAuxDetIndexStr + "/F");
2089  CreateBranch("CombinedEnergyDep", CombinedEnergyDep,
2090  "CombinedEnergyDep[geant_list_size]" + MaxAuxDetIndexStr + "/F");
2091  } // if hasAuxDetector
2092 
2093 } // sbnd::AnalysisTreeDataStruct::SetAddresses()
bool hasVertexInfo() const
Returns whether we have Vertex data.
Int_t mcevts_truth
! The number of MCNeutrinos there is currently room for
Int_t no_primaries
! how many particles there is currently room for
bool hasGeantInfo() const
Returns whether we have Geant data.
void SetShowerAddresses(TTree *pTree, std::string showerLabel, bool saveHierarchyInfo)
AuxDetMCData_t< Float_t > entryT
Entry T position of particle into AuxDet.
AuxDetMCData_t< Float_t > exitT
Exit T position of particle out of AuxDet.
AuxDetMCData_t< Float_t > exitPx
Exit x momentum of particle out of AuxDet.
isCosmics(false)
bool hasSliceInfo() const
Returns whether we have Slice data.
bool hasGenieInfo() const
Returns whether we have Genie data.
SubRunData_t SubRunData
subrun data collected at begin of subrun
bool hasHitInfo() const
Returns whether we have Hit data.
AuxDetMCData_t< Float_t > exitPz
Exit z momentum of particle out of AuxDet.
AuxDetMCData_t< Float_t > exitY
Exit Y position of particle out of AuxDet.
AuxDetMCData_t< Float_t > exitX
Exit X position of particle out of AuxDet.
AuxDetMCData_t< Float_t > entryY
Entry Y position of particle into AuxDet.
bool hasShowerInfo() const
Returns whether we have Shower data.
AuxDetMCData_t< Float_t > entryZ
Entry Z position of particle into AuxDet.
bool hasTrackInfo() const
Returns whether we have Track data.
AuxDetMCData_t< Float_t > exitPy
Exit y momentum of particle out of AuxDet.
bool hasCryInfo() const
Returns whether we have Cry data.
AuxDetMCData_t< Float_t > CombinedEnergyDep
Sum energy of all particles with this trackID (+ID or -ID) in AuxDet.
AuxDetMCData_t< Short_t > AuxDetID
Which AuxDet this particle went through.
std::vector< UShort_t > NAuxDets
Number of AuxDets crossed by this particle.
AuxDetMCData_t< Float_t > entryX
Entry X position of particle into AuxDet.
constexpr unsigned short kMaxAuxDets
max number of auxiliary detector cells per MC particle
bool hasAuxDetector() const
Returns whether we have auxiliary detector data.
AuxDetMCData_t< Float_t > exitZ
Exit Z position of particle out of AuxDet.
void sbnd::AnalysisTreeDataStruct::SetBits ( unsigned int  setbits,
bool  unset = false 
)
inline

Sets the specified bits.

Definition at line 667 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

668  { if (unset) bits &= ~setbits; else bits |= setbits; }
void sbnd::AnalysisTreeDataStruct::SetShowerAddresses ( TTree *  pTree,
std::string  showerLabel,
bool  saveHierarchyInfo 
)

Connect this object with a tree.

void sbnd::AnalysisTreeDataStruct::SetTrackers ( size_t  nTrackers)
inline

Allocates data structures for the given number of trackers (no Clear())

Definition at line 692 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

692 { TrackData.resize(nTrackers); }
void sbnd::AnalysisTreeDataStruct::SetVertices ( size_t  nTrackers)
inline

Allocates data structures for the given number of trackers (no Clear())

Definition at line 695 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

695 { VertexData.resize(nTrackers); }

Member Data Documentation

AuxDetMCData_t<Short_t> sbnd::AnalysisTreeDataStruct::AuxDetID

Which AuxDet this particle went through.

Definition at line 623 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

Double_t sbnd::AnalysisTreeDataStruct::beamtime
Float_t sbnd::AnalysisTreeDataStruct::best_nuslice_hitcomp
Float_t sbnd::AnalysisTreeDataStruct::best_nuslice_hitpurity
Int_t sbnd::AnalysisTreeDataStruct::best_nuslice_id
Float_t sbnd::AnalysisTreeDataStruct::best_nuslice_lephitcomp
Float_t sbnd::AnalysisTreeDataStruct::best_nuslice_lephitpurity
Int_t sbnd::AnalysisTreeDataStruct::best_nuslice_origin
Int_t sbnd::AnalysisTreeDataStruct::best_nuslice_pdg
Int_t sbnd::AnalysisTreeDataStruct::best_nuslice_pfpid
Float_t sbnd::AnalysisTreeDataStruct::best_nuslice_score
unsigned int sbnd::AnalysisTreeDataStruct::bits

complementary information

Definition at line 637 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

std::vector<Int_t> sbnd::AnalysisTreeDataStruct::ccnc_truth
AuxDetMCData_t<Float_t> sbnd::AnalysisTreeDataStruct::CombinedEnergyDep

Sum energy of all particles with this trackID (+ID or -ID) in AuxDet.

Definition at line 635 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

std::vector<Float_t> sbnd::AnalysisTreeDataStruct::cry_Eng
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::cry_mass
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::cry_mother
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::cry_ND
Int_t sbnd::AnalysisTreeDataStruct::cry_no_primaries
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::cry_P
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::cry_primaries_pdg
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::cry_Px
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::cry_Py
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::cry_Pz
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::cry_StartPointx
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::cry_StartPointy
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::cry_StartPointz
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::cry_status_code
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::cry_trackID
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::DepEnergy
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::EndE
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::EndPointx
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::EndPointx_tpcAV
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::EndPointy
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::EndPointy_tpcAV
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::EndPointz
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::EndPointz_tpcAV
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::EndT
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::Eng
AuxDetMCData_t<Float_t> sbnd::AnalysisTreeDataStruct::entryT

Entry T position of particle into AuxDet.

Definition at line 627 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

AuxDetMCData_t<Float_t> sbnd::AnalysisTreeDataStruct::entryX

Entry X position of particle into AuxDet.

Definition at line 624 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

AuxDetMCData_t<Float_t> sbnd::AnalysisTreeDataStruct::entryY

Entry Y position of particle into AuxDet.

Definition at line 625 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

AuxDetMCData_t<Float_t> sbnd::AnalysisTreeDataStruct::entryZ

Entry Z position of particle into AuxDet.

Definition at line 626 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

std::vector<Float_t> sbnd::AnalysisTreeDataStruct::enu_truth
Int_t sbnd::AnalysisTreeDataStruct::event
Double_t sbnd::AnalysisTreeDataStruct::evttime
AuxDetMCData_t<Float_t> sbnd::AnalysisTreeDataStruct::exitPx

Exit x momentum of particle out of AuxDet.

Definition at line 632 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

AuxDetMCData_t<Float_t> sbnd::AnalysisTreeDataStruct::exitPy

Exit y momentum of particle out of AuxDet.

Definition at line 633 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

AuxDetMCData_t<Float_t> sbnd::AnalysisTreeDataStruct::exitPz

Exit z momentum of particle out of AuxDet.

Definition at line 634 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

AuxDetMCData_t<Float_t> sbnd::AnalysisTreeDataStruct::exitT

Exit T position of particle out of AuxDet.

Definition at line 631 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

AuxDetMCData_t<Float_t> sbnd::AnalysisTreeDataStruct::exitX

Exit X position of particle out of AuxDet.

Definition at line 628 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

AuxDetMCData_t<Float_t> sbnd::AnalysisTreeDataStruct::exitY

Exit Y position of particle out of AuxDet.

Definition at line 629 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

AuxDetMCData_t<Float_t> sbnd::AnalysisTreeDataStruct::exitZ

Exit Z position of particle out of AuxDet.

Definition at line 630 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

Int_t sbnd::AnalysisTreeDataStruct::geant_list_size
Int_t sbnd::AnalysisTreeDataStruct::geant_list_size_in_tpcAV
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::genie_Eng
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::genie_mass
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::genie_mother
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::genie_ND
Int_t sbnd::AnalysisTreeDataStruct::genie_no_primaries
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::genie_P
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::genie_primaries_pdg
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::genie_Px
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::genie_Py
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::genie_Pz
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::genie_status_code
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::genie_trackID
Short_t sbnd::AnalysisTreeDataStruct::hit_channel[kMaxHits]
Float_t sbnd::AnalysisTreeDataStruct::hit_charge[kMaxHits]
Float_t sbnd::AnalysisTreeDataStruct::hit_endT[kMaxHits]
Float_t sbnd::AnalysisTreeDataStruct::hit_energy[kMaxHits]
Float_t sbnd::AnalysisTreeDataStruct::hit_frac[kMaxHits]
Int_t sbnd::AnalysisTreeDataStruct::hit_mcid[kMaxHits]
Float_t sbnd::AnalysisTreeDataStruct::hit_nelec[kMaxHits]
Float_t sbnd::AnalysisTreeDataStruct::hit_peakT[kMaxHits]
Float_t sbnd::AnalysisTreeDataStruct::hit_ph[kMaxHits]
Short_t sbnd::AnalysisTreeDataStruct::hit_plane[kMaxHits]
Float_t sbnd::AnalysisTreeDataStruct::hit_reconelec[kMaxHits]
Float_t sbnd::AnalysisTreeDataStruct::hit_startT[kMaxHits]
Short_t sbnd::AnalysisTreeDataStruct::hit_tpc[kMaxHits]
Short_t sbnd::AnalysisTreeDataStruct::hit_trkid[kMaxHits]
Float_t sbnd::AnalysisTreeDataStruct::hit_width[kMaxHits]
Short_t sbnd::AnalysisTreeDataStruct::hit_wire[kMaxHits]
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::hitnuc_truth
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::inTPCActive
Char_t sbnd::AnalysisTreeDataStruct::isdata
Char_t sbnd::AnalysisTreeDataStruct::kNTracker
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::lep_dcosx_truth
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::lep_dcosy_truth
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::lep_dcosz_truth
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::lep_mom_truth
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::Mass
size_t sbnd::AnalysisTreeDataStruct::MaxGEANTparticles = 0
size_t sbnd::AnalysisTreeDataStruct::MaxGeniePrimaries = 0
size_t sbnd::AnalysisTreeDataStruct::MaxMCNeutrinos
Int_t sbnd::AnalysisTreeDataStruct::mcevts_truth

! The number of MCNeutrinos there is currently room for

Definition at line 507 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

Int_t sbnd::AnalysisTreeDataStruct::mcevts_truthcry
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::MergedId
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::mode_truth
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::Mother
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::MotherNuId
std::vector<UShort_t> sbnd::AnalysisTreeDataStruct::NAuxDets

Number of AuxDets crossed by this particle.

Definition at line 622 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

Int_t sbnd::AnalysisTreeDataStruct::no_hits
Int_t sbnd::AnalysisTreeDataStruct::no_primaries

! how many particles there is currently room for

Definition at line 569 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

std::vector<Float_t> sbnd::AnalysisTreeDataStruct::nu_dcosx_truth
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::nu_dcosy_truth
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::nu_dcosz_truth
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::nuID_truth
Int_t sbnd::AnalysisTreeDataStruct::num_nuslices
Int_t sbnd::AnalysisTreeDataStruct::num_pfps
Int_t sbnd::AnalysisTreeDataStruct::num_slices
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::NumberDaughters
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::NumElectrons
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::nuPDG_truth
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::nuScatterCode_truth
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::nuvtxx_truth
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::nuvtxy_truth
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::nuvtxz_truth
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::P
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::pathlen
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::pdg
Int_t sbnd::AnalysisTreeDataStruct::pfp_pdg[kMaxPFPs]
Int_t sbnd::AnalysisTreeDataStruct::pfp_sliceid[kMaxPFPs]
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::phi
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::process_primary
std::vector<std::string> sbnd::AnalysisTreeDataStruct::processname
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::Px
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::Py
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::Pz
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::Q2_truth
Int_t sbnd::AnalysisTreeDataStruct::run
ShowerDataStruct sbnd::AnalysisTreeDataStruct::ShowerData
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::StartPointx
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::StartPointx_tpcAV
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::StartPointy
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::StartPointy_tpcAV
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::StartPointz
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::StartPointz_tpcAV
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::StartT
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::status
Int_t sbnd::AnalysisTreeDataStruct::subrun
SubRunData_t sbnd::AnalysisTreeDataStruct::SubRunData

subrun data collected at begin of subrun

Definition at line 446 of file sbndcode/sbndcode/AnalysisTree/AnalysisTree_module.cc.

Float_t sbnd::AnalysisTreeDataStruct::taulife
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::theta
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::theta_xz
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::theta_yz
Float_t sbnd::AnalysisTreeDataStruct::total_DepEnergy
Float_t sbnd::AnalysisTreeDataStruct::total_NumElectrons
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::tptype_flux
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::tpx_flux
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::tpy_flux
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::tpz_flux
std::vector<TrackDataStruct> sbnd::AnalysisTreeDataStruct::TrackData
std::vector<Int_t> sbnd::AnalysisTreeDataStruct::TrackId
std::vector<VertexDataStruct> sbnd::AnalysisTreeDataStruct::VertexData
std::vector<Float_t> sbnd::AnalysisTreeDataStruct::W_truth

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