Public Types | Public Member Functions | Public Attributes | List of all members
dune::AnalysisTreeDataStruct::PFParticleDataStruct Class Reference

Public Types

template<typename T >
using PFParticleData_t = std::vector< T >
 
template<typename T >
using DaughterData_t = std::vector< BoxedArray< T[kMaxNDaughtersPerPFP]>>
 
template<typename T >
using ClusterData_t = std::vector< BoxedArray< T[kMaxNClustersPerPFP]>>
 

Public Member Functions

 PFParticleDataStruct (size_t maxPFParticles=0)
 Creates a PFParticle data structure allowing up to maxPFParticles PFParticles. More...
 
void Clear ()
 
void SetMaxPFParticles (size_t maxPFParticles)
 
void Resize (size_t numPFParticles)
 
void SetAddresses (TTree *pTree)
 
size_t GetMaxPFParticles () const
 
size_t GetMaxDaughtersPerPFParticle (int=0) const
 
size_t GetMaxClustersPerPFParticle (int=0) const
 

Public Attributes

size_t MaxPFParticles
 maximum number of storable PFParticles More...
 
Branch data structures
Short_t nPFParticles
 the total number of PFParticles More...
 
PFParticleData_t< Short_t > pfp_selfID
 the PFParticles' own IDs More...
 
PFParticleData_t< Short_t > pfp_isPrimary
 whether the PFParticle is a primary particle More...
 
PFParticleData_t< Short_t > pfp_numDaughters
 the number of daughters belonging to this PFParticle More...
 
DaughterData_t< Short_t > pfp_daughterIDs
 the IDs of the daughter PFParticles More...
 
PFParticleData_t< Short_t > pfp_parentID
 the ID of this PFParticle's immediate parent More...
 
PFParticleData_t< Short_t > pfp_vertexID
 the ID of the vertex belonging to this PFParticle More...
 
PFParticleData_t< Short_t > pfp_isShower
 whether this PFParticle corresponds to a shower More...
 
PFParticleData_t< Short_t > pfp_isTrack
 whether this PFParticle corresponds to a track More...
 
PFParticleData_t< Short_t > pfp_trackID
 the ID of the track object corresponding to this PFParticle, if !isShower More...
 
PFParticleData_t< Short_t > pfp_showerID
 the ID of the shower object corresponding to this PFParticle, if isShower More...
 
PFParticleData_t< Short_t > pfp_isNeutrino
 whether this PFParticle is a neutrino More...
 
PFParticleData_t< Int_t > pfp_pdgCode
 the preliminary estimate of the PFParticle type using the PDG code More...
 
PFParticleData_t< Short_t > pfp_numClusters
 the number of associated clusters More...
 
ClusterData_t< Short_t > pfp_clusterIDs
 the IDs of any associated clusters More...
 
Short_t pfp_numNeutrinos
 the number of reconstructed neutrinos More...
 
Short_t pfp_neutrinoIDs [kMaxNPFPNeutrinos]
 

Detailed Description

Definition at line 403 of file AnalysisTree_module.cc.

Member Typedef Documentation

Definition at line 418 of file AnalysisTree_module.cc.

Definition at line 416 of file AnalysisTree_module.cc.

Definition at line 414 of file AnalysisTree_module.cc.

Constructor & Destructor Documentation

dune::AnalysisTreeDataStruct::PFParticleDataStruct::PFParticleDataStruct ( size_t  maxPFParticles = 0)
inline

Creates a PFParticle data structure allowing up to maxPFParticles PFParticles.

Definition at line 449 of file AnalysisTree_module.cc.

449  :
450  MaxPFParticles(maxPFParticles) { Clear(); }
size_t MaxPFParticles
maximum number of storable PFParticles

Member Function Documentation

void dune::AnalysisTreeDataStruct::PFParticleDataStruct::Clear ( )

Definition at line 1964 of file AnalysisTree_module.cc.

1964  {
1966 
1967  nPFParticles = -9999;
1968  FillWith(pfp_selfID, -9999);
1969  FillWith(pfp_isPrimary, -9999);
1970  FillWith(pfp_numDaughters, -9999);
1971  FillWith(pfp_parentID, -9999);
1972  FillWith(pfp_vertexID, -9999);
1973  FillWith(pfp_isShower, -9999);
1974  FillWith(pfp_isTrack, -9999);
1975  FillWith(pfp_trackID, -9999);
1976  FillWith(pfp_showerID, -9999);
1977  FillWith(pfp_pdgCode, -9999);
1978  FillWith(pfp_isNeutrino, -9999);
1979  pfp_numNeutrinos = -9999;
1980  FillWith(pfp_neutrinoIDs, -9999);
1981 
1982  for (size_t iPFParticle = 0; iPFParticle < MaxPFParticles; ++iPFParticle){
1983  // the following are BoxedArrays;
1984  // their iterators traverse all the array dimensions
1985  FillWith(pfp_daughterIDs[iPFParticle], -9999);
1986  FillWith(pfp_clusterIDs[iPFParticle], -9999);
1987  }
1988 }
Short_t pfp_numNeutrinos
the number of reconstructed neutrinos
size_t MaxPFParticles
maximum number of storable PFParticles
ClusterData_t< Short_t > pfp_clusterIDs
the IDs of any associated clusters
PFParticleData_t< Short_t > pfp_showerID
the ID of the shower object corresponding to this PFParticle, if isShower
PFParticleData_t< Short_t > pfp_selfID
the PFParticles&#39; own IDs
DaughterData_t< Short_t > pfp_daughterIDs
the IDs of the daughter PFParticles
PFParticleData_t< Short_t > pfp_isShower
whether this PFParticle corresponds to a shower
PFParticleData_t< Short_t > pfp_numDaughters
the number of daughters belonging to this PFParticle
Short_t nPFParticles
the total number of PFParticles
PFParticleData_t< Short_t > pfp_trackID
the ID of the track object corresponding to this PFParticle, if !isShower
PFParticleData_t< Int_t > pfp_pdgCode
the preliminary estimate of the PFParticle type using the PDG code
PFParticleData_t< Short_t > pfp_isNeutrino
whether this PFParticle is a neutrino
PFParticleData_t< Short_t > pfp_vertexID
the ID of the vertex belonging to this PFParticle
PFParticleData_t< Short_t > pfp_isPrimary
whether the PFParticle is a primary particle
PFParticleData_t< Short_t > pfp_parentID
the ID of this PFParticle&#39;s immediate parent
PFParticleData_t< Short_t > pfp_isTrack
whether this PFParticle corresponds to a track
size_t dune::AnalysisTreeDataStruct::PFParticleDataStruct::GetMaxClustersPerPFParticle ( int  = 0) const
inline

Definition at line 461 of file AnalysisTree_module.cc.

462  { return (size_t) kMaxNClustersPerPFP; }
constexpr int kMaxNClustersPerPFP
size_t dune::AnalysisTreeDataStruct::PFParticleDataStruct::GetMaxDaughtersPerPFParticle ( int  = 0) const
inline

Definition at line 459 of file AnalysisTree_module.cc.

460  { return (size_t) kMaxNDaughtersPerPFP; }
constexpr int kMaxNDaughtersPerPFP
size_t dune::AnalysisTreeDataStruct::PFParticleDataStruct::GetMaxPFParticles ( ) const
inline

Definition at line 458 of file AnalysisTree_module.cc.

458 { return MaxPFParticles; }
size_t MaxPFParticles
maximum number of storable PFParticles
void dune::AnalysisTreeDataStruct::PFParticleDataStruct::Resize ( size_t  numPFParticles)

Definition at line 1944 of file AnalysisTree_module.cc.

1945 {
1947 
1948  pfp_selfID.resize(MaxPFParticles);
1949  pfp_isPrimary.resize(MaxPFParticles);
1952  pfp_parentID.resize(MaxPFParticles);
1953  pfp_vertexID.resize(MaxPFParticles);
1954  pfp_isShower.resize(MaxPFParticles);
1955  pfp_isTrack.resize(MaxPFParticles);
1956  pfp_trackID.resize(MaxPFParticles);
1957  pfp_showerID.resize(MaxPFParticles);
1958  pfp_pdgCode.resize(MaxPFParticles);
1962 }
size_t MaxPFParticles
maximum number of storable PFParticles
ClusterData_t< Short_t > pfp_clusterIDs
the IDs of any associated clusters
PFParticleData_t< Short_t > pfp_showerID
the ID of the shower object corresponding to this PFParticle, if isShower
PFParticleData_t< Short_t > pfp_selfID
the PFParticles&#39; own IDs
DaughterData_t< Short_t > pfp_daughterIDs
the IDs of the daughter PFParticles
PFParticleData_t< Short_t > pfp_isShower
whether this PFParticle corresponds to a shower
PFParticleData_t< Short_t > pfp_numDaughters
the number of daughters belonging to this PFParticle
Short_t nPFParticles
the total number of PFParticles
PFParticleData_t< Short_t > pfp_trackID
the ID of the track object corresponding to this PFParticle, if !isShower
PFParticleData_t< Int_t > pfp_pdgCode
the preliminary estimate of the PFParticle type using the PDG code
PFParticleData_t< Short_t > pfp_isNeutrino
whether this PFParticle is a neutrino
PFParticleData_t< Short_t > pfp_vertexID
the ID of the vertex belonging to this PFParticle
PFParticleData_t< Short_t > pfp_numClusters
the number of associated clusters
PFParticleData_t< Short_t > pfp_isPrimary
whether the PFParticle is a primary particle
PFParticleData_t< Short_t > pfp_parentID
the ID of this PFParticle&#39;s immediate parent
PFParticleData_t< Short_t > pfp_isTrack
whether this PFParticle corresponds to a track
void dune::AnalysisTreeDataStruct::PFParticleDataStruct::SetAddresses ( TTree *  pTree)

Definition at line 1990 of file AnalysisTree_module.cc.

1992  {
1993 
1994  if (MaxPFParticles == 0) { return; } // no PFParticles, no tree
1995 
1996  dune::AnalysisTreeDataStruct::BranchCreator CreateBranch(pTree);
1997 
1998  AutoResettingStringSteam sstr;
1999  sstr() << kMaxNDaughtersPerPFP;
2000  std::string MaxNDaughtersIndexStr("[" + sstr.str() + "]");
2001 
2002  sstr.str("");
2003  sstr() << kMaxNClustersPerPFP;
2004  std::string MaxNClustersIndexStr("[" + sstr.str() + "]");
2005 
2006  sstr.str("");
2007  sstr() << kMaxNPFPNeutrinos;
2008  std::string MaxNNeutrinosIndexStr("[" + sstr.str() + "]");
2009 
2010  std::string BranchName;
2011 
2012  BranchName = "nPFParticles";
2013  CreateBranch(BranchName, &nPFParticles, BranchName + "/S");
2014  std::string NPFParticleIndexStr = "[" + BranchName + "]";
2015 
2016  BranchName = "pfp_selfID";
2017  CreateBranch(BranchName, pfp_selfID, BranchName + NPFParticleIndexStr + "/S");
2018 
2019  BranchName = "pfp_isPrimary";
2020  CreateBranch(BranchName, pfp_isPrimary, BranchName + NPFParticleIndexStr + "/S");
2021 
2022  BranchName = "pfp_numDaughters";
2023  CreateBranch(BranchName, pfp_numDaughters, BranchName + NPFParticleIndexStr + "/S");
2024 
2025  BranchName = "pfp_daughterIDs";
2026  CreateBranch(BranchName, pfp_daughterIDs, BranchName + NPFParticleIndexStr + MaxNDaughtersIndexStr + "/S");
2027 
2028  BranchName = "pfp_parentID";
2029  CreateBranch(BranchName, pfp_parentID, BranchName + NPFParticleIndexStr + "/S");
2030 
2031  BranchName = "pfp_vertexID";
2032  CreateBranch(BranchName, pfp_vertexID, BranchName + NPFParticleIndexStr + "/S");
2033 
2034  BranchName = "pfp_isShower";
2035  CreateBranch(BranchName, pfp_isShower, BranchName + NPFParticleIndexStr + "/S");
2036 
2037  BranchName = "pfp_isTrack";
2038  CreateBranch(BranchName, pfp_isTrack, BranchName + NPFParticleIndexStr + "/S");
2039 
2040  BranchName = "pfp_trackID";
2041  CreateBranch(BranchName, pfp_trackID, BranchName + NPFParticleIndexStr + "/S");
2042 
2043  BranchName = "pfp_showerID";
2044  CreateBranch(BranchName, pfp_showerID, BranchName + NPFParticleIndexStr + "/S");
2045 
2046  BranchName = "pfp_pdgCode";
2047  CreateBranch(BranchName, pfp_pdgCode, BranchName + NPFParticleIndexStr + "/I");
2048 
2049  BranchName = "pfp_numClusters";
2050  CreateBranch(BranchName, pfp_numClusters, BranchName + NPFParticleIndexStr + "/S");
2051 
2052  BranchName = "pfp_clusterIDs";
2053  CreateBranch(BranchName, pfp_clusterIDs, BranchName + NPFParticleIndexStr + MaxNClustersIndexStr + "/S");
2054 
2055  BranchName = "pfp_isNeutrino";
2056  CreateBranch(BranchName, pfp_isNeutrino, BranchName + NPFParticleIndexStr + "/S");
2057 
2058  BranchName = "pfp_numNeutrinos";
2059  CreateBranch(BranchName, &pfp_numNeutrinos, BranchName + "/S");
2060 
2061  BranchName = "pfp_neutrinoIDs";
2062  CreateBranch(BranchName, pfp_neutrinoIDs, BranchName + MaxNNeutrinosIndexStr + "/S");
2063 }
constexpr int kMaxNDaughtersPerPFP
Short_t pfp_numNeutrinos
the number of reconstructed neutrinos
constexpr int kMaxNPFPNeutrinos
size_t MaxPFParticles
maximum number of storable PFParticles
ClusterData_t< Short_t > pfp_clusterIDs
the IDs of any associated clusters
std::string string
Definition: nybbler.cc:12
PFParticleData_t< Short_t > pfp_showerID
the ID of the shower object corresponding to this PFParticle, if isShower
PFParticleData_t< Short_t > pfp_selfID
the PFParticles&#39; own IDs
DaughterData_t< Short_t > pfp_daughterIDs
the IDs of the daughter PFParticles
PFParticleData_t< Short_t > pfp_isShower
whether this PFParticle corresponds to a shower
PFParticleData_t< Short_t > pfp_numDaughters
the number of daughters belonging to this PFParticle
Little helper functor class to create or reset branches in a tree.
Short_t nPFParticles
the total number of PFParticles
PFParticleData_t< Short_t > pfp_trackID
the ID of the track object corresponding to this PFParticle, if !isShower
constexpr int kMaxNClustersPerPFP
PFParticleData_t< Int_t > pfp_pdgCode
the preliminary estimate of the PFParticle type using the PDG code
PFParticleData_t< Short_t > pfp_isNeutrino
whether this PFParticle is a neutrino
PFParticleData_t< Short_t > pfp_vertexID
the ID of the vertex belonging to this PFParticle
PFParticleData_t< Short_t > pfp_numClusters
the number of associated clusters
PFParticleData_t< Short_t > pfp_isPrimary
whether the PFParticle is a primary particle
PFParticleData_t< Short_t > pfp_parentID
the ID of this PFParticle&#39;s immediate parent
PFParticleData_t< Short_t > pfp_isTrack
whether this PFParticle corresponds to a track
void dune::AnalysisTreeDataStruct::PFParticleDataStruct::SetMaxPFParticles ( size_t  maxPFParticles)
inline

Definition at line 453 of file AnalysisTree_module.cc.

454  { MaxPFParticles = maxPFParticles; Resize(MaxPFParticles); }
size_t MaxPFParticles
maximum number of storable PFParticles

Member Data Documentation

size_t dune::AnalysisTreeDataStruct::PFParticleDataStruct::MaxPFParticles

maximum number of storable PFParticles

Definition at line 420 of file AnalysisTree_module.cc.

Short_t dune::AnalysisTreeDataStruct::PFParticleDataStruct::nPFParticles

the total number of PFParticles

Definition at line 424 of file AnalysisTree_module.cc.

ClusterData_t<Short_t> dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_clusterIDs

the IDs of any associated clusters

Definition at line 442 of file AnalysisTree_module.cc.

DaughterData_t<Short_t> dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_daughterIDs

the IDs of the daughter PFParticles

Definition at line 429 of file AnalysisTree_module.cc.

PFParticleData_t<Short_t> dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_isNeutrino

whether this PFParticle is a neutrino

Definition at line 438 of file AnalysisTree_module.cc.

PFParticleData_t<Short_t> dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_isPrimary

whether the PFParticle is a primary particle

Definition at line 426 of file AnalysisTree_module.cc.

PFParticleData_t<Short_t> dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_isShower

whether this PFParticle corresponds to a shower

Definition at line 433 of file AnalysisTree_module.cc.

PFParticleData_t<Short_t> dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_isTrack

whether this PFParticle corresponds to a track

Definition at line 434 of file AnalysisTree_module.cc.

Short_t dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_neutrinoIDs[kMaxNPFPNeutrinos]

the PFParticle IDs of the neutrinos

Definition at line 445 of file AnalysisTree_module.cc.

PFParticleData_t<Short_t> dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_numClusters

the number of associated clusters

Definition at line 441 of file AnalysisTree_module.cc.

PFParticleData_t<Short_t> dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_numDaughters

the number of daughters belonging to this PFParticle

Definition at line 428 of file AnalysisTree_module.cc.

Short_t dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_numNeutrinos

the number of reconstructed neutrinos

Definition at line 444 of file AnalysisTree_module.cc.

PFParticleData_t<Short_t> dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_parentID

the ID of this PFParticle's immediate parent

Definition at line 430 of file AnalysisTree_module.cc.

PFParticleData_t<Int_t> dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_pdgCode

the preliminary estimate of the PFParticle type using the PDG code

Definition at line 439 of file AnalysisTree_module.cc.

PFParticleData_t<Short_t> dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_selfID

the PFParticles' own IDs

Definition at line 425 of file AnalysisTree_module.cc.

PFParticleData_t<Short_t> dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_showerID

the ID of the shower object corresponding to this PFParticle, if isShower

Definition at line 436 of file AnalysisTree_module.cc.

PFParticleData_t<Short_t> dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_trackID

the ID of the track object corresponding to this PFParticle, if !isShower

Definition at line 435 of file AnalysisTree_module.cc.

PFParticleData_t<Short_t> dune::AnalysisTreeDataStruct::PFParticleDataStruct::pfp_vertexID

the ID of the vertex belonging to this PFParticle

Definition at line 432 of file AnalysisTree_module.cc.


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