Public Types | Public Member Functions | Public Attributes | List of all members
dune::AnaRootParserDataStruct::ShowerDataStruct Class Reference

Public Types

template<typename T >
using ShowerData_t = std::vector< T >
 
template<typename T >
using ShowerPlaneData_t = std::vector< BoxedArray< T[kNplanes]>>
 
template<typename T >
using ShowerHitData_t = std::vector< BoxedArray< T[kNplanes][kMaxShowerHits]>>
 
template<typename T >
using ShowerHitCoordData_t = std::vector< BoxedArray< T[kNplanes][kMaxShowerHits][3]>>
 

Public Member Functions

 ShowerDataStruct (std::string new_name="", size_t maxShowers=0)
 Creates a shower data structure allowing up to maxShowers showers. More...
 
std::string Name () const
 
void Clear ()
 
void MarkMissing (TTree *pTree)
 Applies a special prescription to mark shower information as missing. More...
 
void SetName (std::string new_name)
 
void SetMaxShowers (size_t maxShowers)
 
void Resize (size_t nShowers)
 
void SetAddresses (TTree *pTree)
 
size_t GetMaxShowers () const
 
size_t GetMaxPlanesPerShower (int=0) const
 
size_t GetMaxHitsPerShower (int=0, int=0) const
 

Public Attributes

std::string name
 name of the shower algorithm (for branch names) More...
 
size_t MaxShowers
 maximum number of storable showers More...
 
Branch data structures
Short_t nshowers
 number of showers More...
 
ShowerData_t< Short_t > showerID
 Shower ID. More...
 
ShowerData_t< Short_t > shwr_bestplane
 Shower best plane. More...
 
ShowerData_t< Float_t > shwr_length
 Shower length. More...
 
ShowerData_t< Float_t > shwr_startdcosx
 X directional cosine at start of shower. More...
 
ShowerData_t< Float_t > shwr_startdcosy
 Y directional cosine at start of shower. More...
 
ShowerData_t< Float_t > shwr_startdcosz
 Z directional cosine at start of shower. More...
 
ShowerData_t< Float_t > shwr_startx
 startx of shower More...
 
ShowerData_t< Float_t > shwr_starty
 starty of shower More...
 
ShowerData_t< Float_t > shwr_startz
 startz of shower More...
 
ShowerPlaneData_t< Float_t > shwr_totEng
 Total energy of the shower per plane. More...
 
ShowerPlaneData_t< Float_t > shwr_dedx
 dE/dx of the shower per plane More...
 
ShowerPlaneData_t< Float_t > shwr_mipEng
 Total MIP energy of the shower per plane. More...
 
ShowerData_t< Float_t > shwr_pidmvamu
 
ShowerData_t< Float_t > shwr_pidmvae
 
ShowerData_t< Float_t > shwr_pidmvapich
 
ShowerData_t< Float_t > shwr_pidmvaphoton
 
ShowerData_t< Float_t > shwr_pidmvapr
 
ShowerData_t< Short_t > shwr_hasPFParticle
 
ShowerData_t< Short_t > shwr_PFParticleID
 

Detailed Description

Shower algorithm result

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

Definition at line 358 of file AnaRootParser_module.cc.

Member Typedef Documentation

Definition at line 369 of file AnaRootParser_module.cc.

Definition at line 375 of file AnaRootParser_module.cc.

Definition at line 373 of file AnaRootParser_module.cc.

Definition at line 371 of file AnaRootParser_module.cc.

Constructor & Destructor Documentation

dune::AnaRootParserDataStruct::ShowerDataStruct::ShowerDataStruct ( std::string  new_name = "",
size_t  maxShowers = 0 
)
inline

Creates a shower data structure allowing up to maxShowers showers.

Definition at line 409 of file AnaRootParser_module.cc.

409  :
410  name(new_name), MaxShowers(maxShowers) { Clear(); }
std::string name
name of the shower algorithm (for branch names)
size_t MaxShowers
maximum number of storable showers

Member Function Documentation

void dune::AnaRootParserDataStruct::ShowerDataStruct::Clear ( )

Definition at line 2502 of file AnaRootParser_module.cc.

2502  {
2503  Resize(MaxShowers);
2504  nshowers = 0;
2505 
2506  FillWith(showerID, -999 );
2507  FillWith(shwr_bestplane, -999 );
2508  FillWith(shwr_length, -999.);
2509  FillWith(shwr_startdcosx, -999.);
2510  FillWith(shwr_startdcosy, -999.);
2511  FillWith(shwr_startdcosz, -999.);
2512  FillWith(shwr_startx, -999.);
2513  FillWith(shwr_starty, -999.);
2514  FillWith(shwr_startz, -999.);
2515  FillWith(shwr_pidmvamu, -999.);
2516  FillWith(shwr_pidmvae, -999.);
2517  FillWith(shwr_pidmvapich, -999.);
2518  FillWith(shwr_pidmvaphoton, -999.);
2519  FillWith(shwr_pidmvapr, -999.);
2520 
2521  FillWith(shwr_hasPFParticle, -1);
2522  FillWith(shwr_PFParticleID, -1);
2523 
2524  for (size_t iShw = 0; iShw < MaxShowers; ++iShw){
2525  // the following are BoxedArray's;
2526  // their iterators traverse all the array dimensions
2527  FillWith(shwr_totEng[iShw], -999.);
2528  FillWith(shwr_dedx[iShw], -999.);
2529  FillWith(shwr_mipEng[iShw], -999.);
2530  } // for shower
2531 
2532 } // dune::AnaRootParserDataStruct::ShowerDataStruct::Clear()
ShowerPlaneData_t< Float_t > shwr_mipEng
Total MIP energy of the shower per plane.
ShowerPlaneData_t< Float_t > shwr_dedx
dE/dx of the shower per plane
ShowerData_t< Short_t > shwr_bestplane
Shower best plane.
ShowerData_t< Float_t > shwr_startx
startx of shower
ShowerPlaneData_t< Float_t > shwr_totEng
Total energy of the shower per plane.
ShowerData_t< Float_t > shwr_startdcosz
Z directional cosine at start of shower.
ShowerData_t< Float_t > shwr_length
Shower length.
ShowerData_t< Float_t > shwr_starty
starty of shower
ShowerData_t< Float_t > shwr_startdcosy
Y directional cosine at start of shower.
ShowerData_t< Float_t > shwr_startz
startz of shower
size_t MaxShowers
maximum number of storable showers
ShowerData_t< Float_t > shwr_startdcosx
X directional cosine at start of shower.
size_t dune::AnaRootParserDataStruct::ShowerDataStruct::GetMaxHitsPerShower ( int  = 0,
int  = 0 
) const
inline

Definition at line 427 of file AnaRootParser_module.cc.

428  { return (size_t) kMaxShowerHits; }
constexpr int kMaxShowerHits
size_t dune::AnaRootParserDataStruct::ShowerDataStruct::GetMaxPlanesPerShower ( int  = 0) const
inline

Definition at line 425 of file AnaRootParser_module.cc.

426  { return (size_t) kNplanes; }
constexpr int kNplanes
size_t dune::AnaRootParserDataStruct::ShowerDataStruct::GetMaxShowers ( ) const
inline

Definition at line 424 of file AnaRootParser_module.cc.

424 { return MaxShowers; }
size_t MaxShowers
maximum number of storable showers
void dune::AnaRootParserDataStruct::ShowerDataStruct::MarkMissing ( TTree *  pTree)

Applies a special prescription to mark shower information as missing.

Definition at line 2536 of file AnaRootParser_module.cc.

2537 {
2538  // here we implement the policy prescription for a missing set of showers;
2539  // this means that no shower data product was found in the event,
2540  // yet the user has accepted to go on.
2541  // We now need to mark this product in a unmistakably clear way, so that it
2542  // is not confused with a valid collection of an event where no showers
2543  // were reconstructed, not as a list of valid showers.
2544  // The prescription currently implemented is:
2545  // - have only one shower in the list;
2546  // - set the ID of that shower as -999
2547  //
2548 
2549  // first set the data structures to contain one invalid shower:
2550  SetMaxShowers(1); // includes resize to a set of one shower
2551  Clear(); // initializes all the showers in the set (one) as invalid
2552  // now set the tree addresses to the newly allocated memory;
2553  // this creates the tree branches in case they are not there yet
2554  SetAddresses(pTree);
2555 
2556  // then, set the variables so that ROOT tree knows there is one shower only
2557  nshowers = 1;
2558 
2559 } // dune::AnaRootParserDataStruct::ShowerDataStruct::MarkMissing()
std::string dune::AnaRootParserDataStruct::ShowerDataStruct::Name ( ) const
inline

Definition at line 412 of file AnaRootParser_module.cc.

412 { return name; }
std::string name
name of the shower algorithm (for branch names)
void dune::AnaRootParserDataStruct::ShowerDataStruct::Resize ( size_t  nShowers)

Definition at line 2475 of file AnaRootParser_module.cc.

2476 {
2477  MaxShowers = nShowers;
2478 
2479  showerID.resize(MaxShowers);
2480  shwr_bestplane.resize(MaxShowers);
2481  shwr_length.resize(MaxShowers);
2482  shwr_startdcosx.resize(MaxShowers);
2483  shwr_startdcosy.resize(MaxShowers);
2484  shwr_startdcosz.resize(MaxShowers);
2485  shwr_startx.resize(MaxShowers);
2486  shwr_starty.resize(MaxShowers);
2487  shwr_startz.resize(MaxShowers);
2488  shwr_totEng.resize(MaxShowers);
2489  shwr_dedx.resize(MaxShowers);
2490  shwr_mipEng.resize(MaxShowers);
2491  shwr_pidmvamu.resize(MaxShowers);
2492  shwr_pidmvae.resize(MaxShowers);
2493  shwr_pidmvapich.resize(MaxShowers);
2494  shwr_pidmvaphoton.resize(MaxShowers);
2495  shwr_pidmvapr.resize(MaxShowers);
2496 
2498  shwr_PFParticleID.resize(MaxShowers);
2499 
2500 } // dune::AnaRootParserDataStruct::ShowerDataStruct::Resize()
ShowerPlaneData_t< Float_t > shwr_mipEng
Total MIP energy of the shower per plane.
ShowerPlaneData_t< Float_t > shwr_dedx
dE/dx of the shower per plane
ShowerData_t< Short_t > shwr_bestplane
Shower best plane.
ShowerData_t< Float_t > shwr_startx
startx of shower
ShowerPlaneData_t< Float_t > shwr_totEng
Total energy of the shower per plane.
ShowerData_t< Float_t > shwr_startdcosz
Z directional cosine at start of shower.
ShowerData_t< Float_t > shwr_length
Shower length.
ShowerData_t< Float_t > shwr_starty
starty of shower
ShowerData_t< Float_t > shwr_startdcosy
Y directional cosine at start of shower.
ShowerData_t< Float_t > shwr_startz
startz of shower
size_t MaxShowers
maximum number of storable showers
ShowerData_t< Float_t > shwr_startdcosx
X directional cosine at start of shower.
void dune::AnaRootParserDataStruct::ShowerDataStruct::SetAddresses ( TTree *  pTree)

Definition at line 2563 of file AnaRootParser_module.cc.

2564 {
2565  if (MaxShowers == 0) return; // no showers, no tree!
2566 
2568 
2569  AutoResettingStringSteam sstr;
2570  sstr() << kMaxShowerHits;
2571  std::string MaxShowerHitsIndexStr("[" + sstr.str() + "]");
2572 
2573  std::string ShowerLabel = Name();
2574  std::string BranchName;
2575 
2576  BranchName = "nshowers_" + ShowerLabel;
2577  CreateBranch(BranchName, &nshowers, BranchName + "/S");
2578  std::string NShowerIndexStr = "[" + BranchName + "]";
2579 
2580  BranchName = "showerID_" + ShowerLabel;
2581  CreateBranch(BranchName, showerID, BranchName + NShowerIndexStr + "/S");
2582 
2583  BranchName = "shwr_bestplane_" + ShowerLabel;
2584  CreateBranch(BranchName, shwr_bestplane, BranchName + NShowerIndexStr + "/S");
2585 
2586  BranchName = "shwr_length_" + ShowerLabel;
2587  CreateBranch(BranchName, shwr_length, BranchName + NShowerIndexStr + "/F");
2588 
2589  BranchName = "shwr_startdcosx_" + ShowerLabel;
2590  CreateBranch(BranchName, shwr_startdcosx, BranchName + NShowerIndexStr + "/F");
2591 
2592  BranchName = "shwr_startdcosy_" + ShowerLabel;
2593  CreateBranch(BranchName, shwr_startdcosy, BranchName + NShowerIndexStr + "/F");
2594 
2595  BranchName = "shwr_startdcosz_" + ShowerLabel;
2596  CreateBranch(BranchName, shwr_startdcosz, BranchName + NShowerIndexStr + "/F");
2597 
2598  BranchName = "shwr_startx_" + ShowerLabel;
2599  CreateBranch(BranchName, shwr_startx, BranchName + NShowerIndexStr + "/F");
2600 
2601  BranchName = "shwr_starty_" + ShowerLabel;
2602  CreateBranch(BranchName, shwr_starty, BranchName + NShowerIndexStr + "/F");
2603 
2604  BranchName = "shwr_startz_" + ShowerLabel;
2605  CreateBranch(BranchName, shwr_startz, BranchName + NShowerIndexStr + "/F");
2606 
2607  BranchName = "shwr_totEng_" + ShowerLabel;
2608  CreateBranch(BranchName, shwr_totEng, BranchName + NShowerIndexStr + "[3]/F");
2609 
2610  BranchName = "shwr_dedx_" + ShowerLabel;
2611  CreateBranch(BranchName, shwr_dedx, BranchName + NShowerIndexStr + "[3]/F");
2612 
2613  BranchName = "shwr_mipEng_" + ShowerLabel;
2614  CreateBranch(BranchName, shwr_mipEng, BranchName + NShowerIndexStr + "[3]/F");
2615 
2616  BranchName = "shwr_hasPFParticle_" + ShowerLabel;
2617  CreateBranch(BranchName, shwr_hasPFParticle, BranchName + NShowerIndexStr + "/S");
2618 
2619  BranchName = "shwr_PFParticleID_" + ShowerLabel;
2620  CreateBranch(BranchName, shwr_PFParticleID, BranchName + NShowerIndexStr + "/S");
2621 
2622  BranchName = "shwr_pidmvamu_" + ShowerLabel;
2623  CreateBranch(BranchName, shwr_pidmvamu, BranchName + NShowerIndexStr + "/F");
2624 
2625  BranchName = "shwr_pidmvae_" + ShowerLabel;
2626  CreateBranch(BranchName, shwr_pidmvae, BranchName + NShowerIndexStr + "/F");
2627 
2628  BranchName = "shwr_pidmvapich_" + ShowerLabel;
2629  CreateBranch(BranchName, shwr_pidmvapich, BranchName + NShowerIndexStr + "/F");
2630 
2631  BranchName = "shwr_pidmvaphoton_" + ShowerLabel;
2632  CreateBranch(BranchName, shwr_pidmvaphoton, BranchName + NShowerIndexStr + "/F");
2633 
2634  BranchName = "shwr_pidmvapr_" + ShowerLabel;
2635  CreateBranch(BranchName, shwr_pidmvapr, BranchName + NShowerIndexStr + "/F");
2636 
2637 } // dune::AnaRootParserDataStruct::ShowerDataStruct::SetAddresses()
ShowerPlaneData_t< Float_t > shwr_mipEng
Total MIP energy of the shower per plane.
ShowerPlaneData_t< Float_t > shwr_dedx
dE/dx of the shower per plane
Little helper functor class to create or reset branches in a tree.
ShowerData_t< Short_t > shwr_bestplane
Shower best plane.
std::string string
Definition: nybbler.cc:12
ShowerData_t< Float_t > shwr_startx
startx of shower
ShowerPlaneData_t< Float_t > shwr_totEng
Total energy of the shower per plane.
constexpr int kMaxShowerHits
ShowerData_t< Float_t > shwr_startdcosz
Z directional cosine at start of shower.
ShowerData_t< Float_t > shwr_length
Shower length.
ShowerData_t< Float_t > shwr_starty
starty of shower
ShowerData_t< Float_t > shwr_startdcosy
Y directional cosine at start of shower.
ShowerData_t< Float_t > shwr_startz
startz of shower
size_t MaxShowers
maximum number of storable showers
ShowerData_t< Float_t > shwr_startdcosx
X directional cosine at start of shower.
void dune::AnaRootParserDataStruct::ShowerDataStruct::SetMaxShowers ( size_t  maxShowers)
inline

Definition at line 419 of file AnaRootParser_module.cc.

420  { MaxShowers = maxShowers; Resize(MaxShowers); }
size_t MaxShowers
maximum number of storable showers
void dune::AnaRootParserDataStruct::ShowerDataStruct::SetName ( std::string  new_name)
inline

Definition at line 418 of file AnaRootParser_module.cc.

418 { name = new_name; }
std::string name
name of the shower algorithm (for branch names)

Member Data Documentation

size_t dune::AnaRootParserDataStruct::ShowerDataStruct::MaxShowers

maximum number of storable showers

Definition at line 379 of file AnaRootParser_module.cc.

std::string dune::AnaRootParserDataStruct::ShowerDataStruct::name

name of the shower algorithm (for branch names)

Definition at line 377 of file AnaRootParser_module.cc.

Short_t dune::AnaRootParserDataStruct::ShowerDataStruct::nshowers

number of showers

Definition at line 383 of file AnaRootParser_module.cc.

ShowerData_t<Short_t> dune::AnaRootParserDataStruct::ShowerDataStruct::showerID

Shower ID.

Definition at line 384 of file AnaRootParser_module.cc.

ShowerData_t<Short_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_bestplane

Shower best plane.

Definition at line 385 of file AnaRootParser_module.cc.

ShowerPlaneData_t<Float_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_dedx

dE/dx of the shower per plane

Definition at line 394 of file AnaRootParser_module.cc.

ShowerData_t<Short_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_hasPFParticle

Definition at line 404 of file AnaRootParser_module.cc.

ShowerData_t<Float_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_length

Shower length.

Definition at line 386 of file AnaRootParser_module.cc.

ShowerPlaneData_t<Float_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_mipEng

Total MIP energy of the shower per plane.

Definition at line 395 of file AnaRootParser_module.cc.

ShowerData_t<Short_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_PFParticleID

Definition at line 405 of file AnaRootParser_module.cc.

ShowerData_t<Float_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_pidmvae

Definition at line 398 of file AnaRootParser_module.cc.

ShowerData_t<Float_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_pidmvamu

Definition at line 397 of file AnaRootParser_module.cc.

ShowerData_t<Float_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_pidmvaphoton

Definition at line 400 of file AnaRootParser_module.cc.

ShowerData_t<Float_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_pidmvapich

Definition at line 399 of file AnaRootParser_module.cc.

ShowerData_t<Float_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_pidmvapr

Definition at line 401 of file AnaRootParser_module.cc.

ShowerData_t<Float_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_startdcosx

X directional cosine at start of shower.

Definition at line 387 of file AnaRootParser_module.cc.

ShowerData_t<Float_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_startdcosy

Y directional cosine at start of shower.

Definition at line 388 of file AnaRootParser_module.cc.

ShowerData_t<Float_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_startdcosz

Z directional cosine at start of shower.

Definition at line 389 of file AnaRootParser_module.cc.

ShowerData_t<Float_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_startx

startx of shower

Definition at line 390 of file AnaRootParser_module.cc.

ShowerData_t<Float_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_starty

starty of shower

Definition at line 391 of file AnaRootParser_module.cc.

ShowerData_t<Float_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_startz

startz of shower

Definition at line 392 of file AnaRootParser_module.cc.

ShowerPlaneData_t<Float_t> dune::AnaRootParserDataStruct::ShowerDataStruct::shwr_totEng

Total energy of the shower per plane.

Definition at line 393 of file AnaRootParser_module.cc.


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