Public Types | Public Member Functions | Public Attributes | List of all members
dune::AnaRootParserDataStruct::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 432 of file AnaRootParser_module.cc.

Member Typedef Documentation

Definition at line 447 of file AnaRootParser_module.cc.

Definition at line 445 of file AnaRootParser_module.cc.

Definition at line 443 of file AnaRootParser_module.cc.

Constructor & Destructor Documentation

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

Creates a PFParticle data structure allowing up to maxPFParticles PFParticles.

Definition at line 478 of file AnaRootParser_module.cc.

478  :
479  MaxPFParticles(maxPFParticles) { Clear(); }
size_t MaxPFParticles
maximum number of storable PFParticles

Member Function Documentation

void dune::AnaRootParserDataStruct::PFParticleDataStruct::Clear ( )

Definition at line 2369 of file AnaRootParser_module.cc.

2369  {
2371 
2372  nPFParticles = -999;
2373  FillWith(pfp_selfID, -999);
2374  FillWith(pfp_isPrimary, -999);
2375  FillWith(pfp_numDaughters, -999);
2376  FillWith(pfp_parentID, -999);
2377  FillWith(pfp_vertexID, -999);
2378  FillWith(pfp_isShower, -999);
2379  FillWith(pfp_isTrack, -999);
2380  FillWith(pfp_trackID, -999);
2381  FillWith(pfp_showerID, -999);
2382  FillWith(pfp_pdgCode, -999);
2383  FillWith(pfp_isNeutrino, -999);
2384  pfp_numNeutrinos = -999;
2385  FillWith(pfp_neutrinoIDs, -999);
2386 
2387  for (size_t iPFParticle = 0; iPFParticle < MaxPFParticles; ++iPFParticle){
2388  // the following are BoxedArrays;
2389  // their iterators traverse all the array dimensions
2390  FillWith(pfp_daughterIDs[iPFParticle], -999);
2391  FillWith(pfp_clusterIDs[iPFParticle], -999);
2392  }
2393 }
PFParticleData_t< Short_t > pfp_isShower
whether this PFParticle corresponds to a shower
PFParticleData_t< Short_t > pfp_selfID
the PFParticles&#39; own IDs
PFParticleData_t< Short_t > pfp_vertexID
the ID of the vertex belonging to this PFParticle
Short_t nPFParticles
the total number of PFParticles
ClusterData_t< Short_t > pfp_clusterIDs
the IDs of any associated clusters
PFParticleData_t< Short_t > pfp_isTrack
whether this PFParticle corresponds to a track
Short_t pfp_numNeutrinos
the number of reconstructed neutrinos
DaughterData_t< Short_t > pfp_daughterIDs
the IDs of the daughter PFParticles
PFParticleData_t< Short_t > pfp_isPrimary
whether the PFParticle is a primary particle
PFParticleData_t< Short_t > pfp_numDaughters
the number of daughters belonging to this PFParticle
PFParticleData_t< Short_t > pfp_isNeutrino
whether this PFParticle is a neutrino
PFParticleData_t< Short_t > pfp_trackID
the ID of the track object corresponding to this PFParticle, if !isShower
PFParticleData_t< Short_t > pfp_parentID
the ID of this PFParticle&#39;s immediate parent
PFParticleData_t< Int_t > pfp_pdgCode
the preliminary estimate of the PFParticle type using the PDG code
size_t MaxPFParticles
maximum number of storable PFParticles
PFParticleData_t< Short_t > pfp_showerID
the ID of the shower object corresponding to this PFParticle, if isShower
size_t dune::AnaRootParserDataStruct::PFParticleDataStruct::GetMaxClustersPerPFParticle ( int  = 0) const
inline

Definition at line 490 of file AnaRootParser_module.cc.

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

Definition at line 488 of file AnaRootParser_module.cc.

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

Definition at line 487 of file AnaRootParser_module.cc.

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

Definition at line 2349 of file AnaRootParser_module.cc.

2350 {
2352 
2353  pfp_selfID.resize(MaxPFParticles);
2354  pfp_isPrimary.resize(MaxPFParticles);
2357  pfp_parentID.resize(MaxPFParticles);
2358  pfp_vertexID.resize(MaxPFParticles);
2359  pfp_isShower.resize(MaxPFParticles);
2360  pfp_isTrack.resize(MaxPFParticles);
2361  pfp_trackID.resize(MaxPFParticles);
2362  pfp_showerID.resize(MaxPFParticles);
2363  pfp_pdgCode.resize(MaxPFParticles);
2367 }
PFParticleData_t< Short_t > pfp_isShower
whether this PFParticle corresponds to a shower
PFParticleData_t< Short_t > pfp_selfID
the PFParticles&#39; own IDs
PFParticleData_t< Short_t > pfp_vertexID
the ID of the vertex belonging to this PFParticle
Short_t nPFParticles
the total number of PFParticles
ClusterData_t< Short_t > pfp_clusterIDs
the IDs of any associated clusters
PFParticleData_t< Short_t > pfp_isTrack
whether this PFParticle corresponds to a track
DaughterData_t< Short_t > pfp_daughterIDs
the IDs of the daughter PFParticles
PFParticleData_t< Short_t > pfp_isPrimary
whether the PFParticle is a primary particle
PFParticleData_t< Short_t > pfp_numClusters
the number of associated clusters
PFParticleData_t< Short_t > pfp_numDaughters
the number of daughters belonging to this PFParticle
PFParticleData_t< Short_t > pfp_isNeutrino
whether this PFParticle is a neutrino
PFParticleData_t< Short_t > pfp_trackID
the ID of the track object corresponding to this PFParticle, if !isShower
PFParticleData_t< Short_t > pfp_parentID
the ID of this PFParticle&#39;s immediate parent
PFParticleData_t< Int_t > pfp_pdgCode
the preliminary estimate of the PFParticle type using the PDG code
size_t MaxPFParticles
maximum number of storable PFParticles
PFParticleData_t< Short_t > pfp_showerID
the ID of the shower object corresponding to this PFParticle, if isShower
void dune::AnaRootParserDataStruct::PFParticleDataStruct::SetAddresses ( TTree *  pTree)

Definition at line 2395 of file AnaRootParser_module.cc.

2397  {
2398 
2399  if (MaxPFParticles == 0) { return; } // no PFParticles, no tree
2400 
2402 
2403  AutoResettingStringSteam sstr;
2404  sstr() << kMaxNDaughtersPerPFP;
2405  std::string MaxNDaughtersIndexStr("[" + sstr.str() + "]");
2406 
2407  sstr.str("");
2408  sstr() << kMaxNClustersPerPFP;
2409  std::string MaxNClustersIndexStr("[" + sstr.str() + "]");
2410 
2411  sstr.str("");
2412  sstr() << kMaxNPFPNeutrinos;
2413  std::string MaxNNeutrinosIndexStr("[" + sstr.str() + "]");
2414 
2415  std::string BranchName;
2416 
2417  BranchName = "nPFParticles";
2418  CreateBranch(BranchName, &nPFParticles, BranchName + "/S");
2419  std::string NPFParticleIndexStr = "[" + BranchName + "]";
2420 
2421  BranchName = "pfp_selfID";
2422  CreateBranch(BranchName, pfp_selfID, BranchName + NPFParticleIndexStr + "/S");
2423 
2424  BranchName = "pfp_isPrimary";
2425  CreateBranch(BranchName, pfp_isPrimary, BranchName + NPFParticleIndexStr + "/S");
2426 
2427  BranchName = "pfp_numDaughters";
2428  CreateBranch(BranchName, pfp_numDaughters, BranchName + NPFParticleIndexStr + "/S");
2429 
2430  BranchName = "pfp_daughterIDs";
2431  CreateBranch(BranchName, pfp_daughterIDs, BranchName + NPFParticleIndexStr + MaxNDaughtersIndexStr + "/S");
2432 
2433  BranchName = "pfp_parentID";
2434  CreateBranch(BranchName, pfp_parentID, BranchName + NPFParticleIndexStr + "/S");
2435 
2436  BranchName = "pfp_vertexID";
2437  CreateBranch(BranchName, pfp_vertexID, BranchName + NPFParticleIndexStr + "/S");
2438 
2439  BranchName = "pfp_isShower";
2440  CreateBranch(BranchName, pfp_isShower, BranchName + NPFParticleIndexStr + "/S");
2441 
2442  BranchName = "pfp_isTrack";
2443  CreateBranch(BranchName, pfp_isTrack, BranchName + NPFParticleIndexStr + "/S");
2444 
2445  BranchName = "pfp_trackID";
2446  CreateBranch(BranchName, pfp_trackID, BranchName + NPFParticleIndexStr + "/S");
2447 
2448  BranchName = "pfp_showerID";
2449  CreateBranch(BranchName, pfp_showerID, BranchName + NPFParticleIndexStr + "/S");
2450 
2451  BranchName = "pfp_pdgCode";
2452  CreateBranch(BranchName, pfp_pdgCode, BranchName + NPFParticleIndexStr + "/I");
2453 
2454  BranchName = "pfp_numClusters";
2455  CreateBranch(BranchName, pfp_numClusters, BranchName + NPFParticleIndexStr + "/S");
2456 
2457  BranchName = "pfp_clusterIDs";
2458  CreateBranch(BranchName, pfp_clusterIDs, BranchName + NPFParticleIndexStr + MaxNClustersIndexStr + "/S");
2459 
2460  BranchName = "pfp_isNeutrino";
2461  CreateBranch(BranchName, pfp_isNeutrino, BranchName + NPFParticleIndexStr + "/S");
2462 
2463  BranchName = "pfp_numNeutrinos";
2464  CreateBranch(BranchName, &pfp_numNeutrinos, BranchName + "/S");
2465 
2466  BranchName = "pfp_neutrinoIDs";
2467  CreateBranch(BranchName, pfp_neutrinoIDs, BranchName + MaxNNeutrinosIndexStr + "/S");
2468 }
PFParticleData_t< Short_t > pfp_isShower
whether this PFParticle corresponds to a shower
Little helper functor class to create or reset branches in a tree.
PFParticleData_t< Short_t > pfp_selfID
the PFParticles&#39; own IDs
PFParticleData_t< Short_t > pfp_vertexID
the ID of the vertex belonging to this PFParticle
Short_t nPFParticles
the total number of PFParticles
constexpr int kMaxNPFPNeutrinos
std::string string
Definition: nybbler.cc:12
ClusterData_t< Short_t > pfp_clusterIDs
the IDs of any associated clusters
PFParticleData_t< Short_t > pfp_isTrack
whether this PFParticle corresponds to a track
Short_t pfp_numNeutrinos
the number of reconstructed neutrinos
DaughterData_t< Short_t > pfp_daughterIDs
the IDs of the daughter PFParticles
PFParticleData_t< Short_t > pfp_isPrimary
whether the PFParticle is a primary particle
PFParticleData_t< Short_t > pfp_numClusters
the number of associated clusters
PFParticleData_t< Short_t > pfp_numDaughters
the number of daughters belonging to this PFParticle
PFParticleData_t< Short_t > pfp_isNeutrino
whether this PFParticle is a neutrino
PFParticleData_t< Short_t > pfp_trackID
the ID of the track object corresponding to this PFParticle, if !isShower
PFParticleData_t< Short_t > pfp_parentID
the ID of this PFParticle&#39;s immediate parent
PFParticleData_t< Int_t > pfp_pdgCode
the preliminary estimate of the PFParticle type using the PDG code
constexpr int kMaxNDaughtersPerPFP
size_t MaxPFParticles
maximum number of storable PFParticles
PFParticleData_t< Short_t > pfp_showerID
the ID of the shower object corresponding to this PFParticle, if isShower
constexpr int kMaxNClustersPerPFP
void dune::AnaRootParserDataStruct::PFParticleDataStruct::SetMaxPFParticles ( size_t  maxPFParticles)
inline

Definition at line 482 of file AnaRootParser_module.cc.

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

Member Data Documentation

size_t dune::AnaRootParserDataStruct::PFParticleDataStruct::MaxPFParticles

maximum number of storable PFParticles

Definition at line 449 of file AnaRootParser_module.cc.

Short_t dune::AnaRootParserDataStruct::PFParticleDataStruct::nPFParticles

the total number of PFParticles

Definition at line 453 of file AnaRootParser_module.cc.

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

the IDs of any associated clusters

Definition at line 471 of file AnaRootParser_module.cc.

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

the IDs of the daughter PFParticles

Definition at line 458 of file AnaRootParser_module.cc.

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

whether this PFParticle is a neutrino

Definition at line 467 of file AnaRootParser_module.cc.

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

whether the PFParticle is a primary particle

Definition at line 455 of file AnaRootParser_module.cc.

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

whether this PFParticle corresponds to a shower

Definition at line 462 of file AnaRootParser_module.cc.

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

whether this PFParticle corresponds to a track

Definition at line 463 of file AnaRootParser_module.cc.

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

the PFParticle IDs of the neutrinos

Definition at line 474 of file AnaRootParser_module.cc.

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

the number of associated clusters

Definition at line 470 of file AnaRootParser_module.cc.

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

the number of daughters belonging to this PFParticle

Definition at line 457 of file AnaRootParser_module.cc.

Short_t dune::AnaRootParserDataStruct::PFParticleDataStruct::pfp_numNeutrinos

the number of reconstructed neutrinos

Definition at line 473 of file AnaRootParser_module.cc.

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

the ID of this PFParticle's immediate parent

Definition at line 459 of file AnaRootParser_module.cc.

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

the preliminary estimate of the PFParticle type using the PDG code

Definition at line 468 of file AnaRootParser_module.cc.

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

the PFParticles' own IDs

Definition at line 454 of file AnaRootParser_module.cc.

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

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

Definition at line 465 of file AnaRootParser_module.cc.

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

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

Definition at line 464 of file AnaRootParser_module.cc.

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

the ID of the vertex belonging to this PFParticle

Definition at line 461 of file AnaRootParser_module.cc.


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