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

Public Types

template<typename T >
using ShowerData_t = std::vector< T >
 
template<typename T >
using PlaneData_t = std::vector< BoxedArray< T[kNplanes]>>
 
template<typename T >
using HitData_t = std::vector< BoxedArray< T[kNplanes][kMaxShowerHits]>>
 
template<typename T >
using HitCoordData_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...
 
PlaneData_t< Float_t > shwr_totEng
 Total energy of the shower per plane. More...
 
PlaneData_t< Float_t > shwr_dedx
 dE/dx of the shower per plane More...
 
PlaneData_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 329 of file AnalysisTree_module.cc.

Member Typedef Documentation

Definition at line 346 of file AnalysisTree_module.cc.

Definition at line 344 of file AnalysisTree_module.cc.

Definition at line 342 of file AnalysisTree_module.cc.

Definition at line 340 of file AnalysisTree_module.cc.

Constructor & Destructor Documentation

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

Creates a shower data structure allowing up to maxShowers showers.

Definition at line 380 of file AnalysisTree_module.cc.

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

Member Function Documentation

void dune::AnalysisTreeDataStruct::ShowerDataStruct::Clear ( )

Definition at line 2097 of file AnalysisTree_module.cc.

2097  {
2098  Resize(MaxShowers);
2099  nshowers = 0;
2100 
2101  FillWith(showerID, -9999 );
2102  FillWith(shwr_bestplane, -9999 );
2103  FillWith(shwr_length, -99999.);
2104  FillWith(shwr_startdcosx, -99999.);
2105  FillWith(shwr_startdcosy, -99999.);
2106  FillWith(shwr_startdcosz, -99999.);
2107  FillWith(shwr_startx, -99999.);
2108  FillWith(shwr_starty, -99999.);
2109  FillWith(shwr_startz, -99999.);
2110  FillWith(shwr_pidmvamu, -99999.);
2111  FillWith(shwr_pidmvae, -99999.);
2112  FillWith(shwr_pidmvapich, -99999.);
2113  FillWith(shwr_pidmvaphoton, -99999.);
2114  FillWith(shwr_pidmvapr, -99999.);
2115 
2116  FillWith(shwr_hasPFParticle, -1);
2117  FillWith(shwr_PFParticleID, -1);
2118 
2119  for (size_t iShw = 0; iShw < MaxShowers; ++iShw){
2120  // the following are BoxedArray's;
2121  // their iterators traverse all the array dimensions
2122  FillWith(shwr_totEng[iShw], -99999.);
2123  FillWith(shwr_dedx[iShw], -99999.);
2124  FillWith(shwr_mipEng[iShw], -99999.);
2125  } // for shower
2126 
2127 } // dune::AnalysisTreeDataStruct::ShowerDataStruct::Clear()
ShowerData_t< Float_t > shwr_startx
startx of shower
ShowerData_t< Float_t > shwr_startz
startz of shower
PlaneData_t< Float_t > shwr_dedx
dE/dx of the shower per plane
ShowerData_t< Float_t > shwr_startdcosy
Y directional cosine at start of shower.
ShowerData_t< Float_t > shwr_length
Shower length.
ShowerData_t< Float_t > shwr_starty
starty of shower
PlaneData_t< Float_t > shwr_mipEng
Total MIP energy of the shower per plane.
size_t MaxShowers
maximum number of storable showers
ShowerData_t< Short_t > shwr_bestplane
Shower best plane.
ShowerData_t< Short_t > showerID
Shower ID.
ShowerData_t< Float_t > shwr_startdcosx
X directional cosine at start of shower.
ShowerData_t< Float_t > shwr_startdcosz
Z directional cosine at start of shower.
PlaneData_t< Float_t > shwr_totEng
Total energy of the shower per plane.
size_t dune::AnalysisTreeDataStruct::ShowerDataStruct::GetMaxHitsPerShower ( int  = 0,
int  = 0 
) const
inline

Definition at line 398 of file AnalysisTree_module.cc.

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

Definition at line 396 of file AnalysisTree_module.cc.

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

Definition at line 395 of file AnalysisTree_module.cc.

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

Applies a special prescription to mark shower information as missing.

Definition at line 2131 of file AnalysisTree_module.cc.

2132 {
2133  // here we implement the policy prescription for a missing set of showers;
2134  // this means that no shower data product was found in the event,
2135  // yet the user has accepted to go on.
2136  // We now need to mark this product in a unmistakably clear way, so that it
2137  // is not confused with a valid collection of an event where no showers
2138  // were reconstructed, not as a list of valid showers.
2139  // The prescription currently implemented is:
2140  // - have only one shower in the list;
2141  // - set the ID of that shower as -9999
2142  //
2143 
2144  // first set the data structures to contain one invalid shower:
2145  SetMaxShowers(1); // includes resize to a set of one shower
2146  Clear(); // initializes all the showers in the set (one) as invalid
2147  // now set the tree addresses to the newly allocated memory;
2148  // this creates the tree branches in case they are not there yet
2149  SetAddresses(pTree);
2150 
2151  // then, set the variables so that ROOT tree knows there is one shower only
2152  nshowers = 1;
2153 
2154 } // dune::AnalysisTreeDataStruct::ShowerDataStruct::MarkMissing()
std::string dune::AnalysisTreeDataStruct::ShowerDataStruct::Name ( ) const
inline

Definition at line 383 of file AnalysisTree_module.cc.

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

Definition at line 2070 of file AnalysisTree_module.cc.

2071 {
2072  MaxShowers = nShowers;
2073 
2074  showerID.resize(MaxShowers);
2075  shwr_bestplane.resize(MaxShowers);
2076  shwr_length.resize(MaxShowers);
2077  shwr_startdcosx.resize(MaxShowers);
2078  shwr_startdcosy.resize(MaxShowers);
2079  shwr_startdcosz.resize(MaxShowers);
2080  shwr_startx.resize(MaxShowers);
2081  shwr_starty.resize(MaxShowers);
2082  shwr_startz.resize(MaxShowers);
2083  shwr_totEng.resize(MaxShowers);
2084  shwr_dedx.resize(MaxShowers);
2085  shwr_mipEng.resize(MaxShowers);
2086  shwr_pidmvamu.resize(MaxShowers);
2087  shwr_pidmvae.resize(MaxShowers);
2088  shwr_pidmvapich.resize(MaxShowers);
2089  shwr_pidmvaphoton.resize(MaxShowers);
2090  shwr_pidmvapr.resize(MaxShowers);
2091 
2093  shwr_PFParticleID.resize(MaxShowers);
2094 
2095 } // dune::AnalysisTreeDataStruct::ShowerDataStruct::Resize()
ShowerData_t< Float_t > shwr_startx
startx of shower
ShowerData_t< Float_t > shwr_startz
startz of shower
PlaneData_t< Float_t > shwr_dedx
dE/dx of the shower per plane
ShowerData_t< Float_t > shwr_startdcosy
Y directional cosine at start of shower.
ShowerData_t< Float_t > shwr_length
Shower length.
ShowerData_t< Float_t > shwr_starty
starty of shower
PlaneData_t< Float_t > shwr_mipEng
Total MIP energy of the shower per plane.
size_t MaxShowers
maximum number of storable showers
ShowerData_t< Short_t > shwr_bestplane
Shower best plane.
ShowerData_t< Short_t > showerID
Shower ID.
ShowerData_t< Float_t > shwr_startdcosx
X directional cosine at start of shower.
ShowerData_t< Float_t > shwr_startdcosz
Z directional cosine at start of shower.
PlaneData_t< Float_t > shwr_totEng
Total energy of the shower per plane.
void dune::AnalysisTreeDataStruct::ShowerDataStruct::SetAddresses ( TTree *  pTree)

Definition at line 2158 of file AnalysisTree_module.cc.

2159 {
2160  if (MaxShowers == 0) return; // no showers, no tree!
2161 
2162  dune::AnalysisTreeDataStruct::BranchCreator CreateBranch(pTree);
2163 
2164  AutoResettingStringSteam sstr;
2165  sstr() << kMaxShowerHits;
2166  std::string MaxShowerHitsIndexStr("[" + sstr.str() + "]");
2167 
2168  std::string ShowerLabel = Name();
2169  std::string BranchName;
2170 
2171  BranchName = "nshowers_" + ShowerLabel;
2172  CreateBranch(BranchName, &nshowers, BranchName + "/S");
2173  std::string NShowerIndexStr = "[" + BranchName + "]";
2174 
2175  BranchName = "showerID_" + ShowerLabel;
2176  CreateBranch(BranchName, showerID, BranchName + NShowerIndexStr + "/S");
2177 
2178  BranchName = "shwr_bestplane_" + ShowerLabel;
2179  CreateBranch(BranchName, shwr_bestplane, BranchName + NShowerIndexStr + "/S");
2180 
2181  BranchName = "shwr_length_" + ShowerLabel;
2182  CreateBranch(BranchName, shwr_length, BranchName + NShowerIndexStr + "/F");
2183 
2184  BranchName = "shwr_startdcosx_" + ShowerLabel;
2185  CreateBranch(BranchName, shwr_startdcosx, BranchName + NShowerIndexStr + "/F");
2186 
2187  BranchName = "shwr_startdcosy_" + ShowerLabel;
2188  CreateBranch(BranchName, shwr_startdcosy, BranchName + NShowerIndexStr + "/F");
2189 
2190  BranchName = "shwr_startdcosz_" + ShowerLabel;
2191  CreateBranch(BranchName, shwr_startdcosz, BranchName + NShowerIndexStr + "/F");
2192 
2193  BranchName = "shwr_startx_" + ShowerLabel;
2194  CreateBranch(BranchName, shwr_startx, BranchName + NShowerIndexStr + "/F");
2195 
2196  BranchName = "shwr_starty_" + ShowerLabel;
2197  CreateBranch(BranchName, shwr_starty, BranchName + NShowerIndexStr + "/F");
2198 
2199  BranchName = "shwr_startz_" + ShowerLabel;
2200  CreateBranch(BranchName, shwr_startz, BranchName + NShowerIndexStr + "/F");
2201 
2202  BranchName = "shwr_totEng_" + ShowerLabel;
2203  CreateBranch(BranchName, shwr_totEng, BranchName + NShowerIndexStr + "[3]/F");
2204 
2205  BranchName = "shwr_dedx_" + ShowerLabel;
2206  CreateBranch(BranchName, shwr_dedx, BranchName + NShowerIndexStr + "[3]/F");
2207 
2208  BranchName = "shwr_mipEng_" + ShowerLabel;
2209  CreateBranch(BranchName, shwr_mipEng, BranchName + NShowerIndexStr + "[3]/F");
2210 
2211  BranchName = "shwr_hasPFParticle_" + ShowerLabel;
2212  CreateBranch(BranchName, shwr_hasPFParticle, BranchName + NShowerIndexStr + "/S");
2213 
2214  BranchName = "shwr_PFParticleID_" + ShowerLabel;
2215  CreateBranch(BranchName, shwr_PFParticleID, BranchName + NShowerIndexStr + "/S");
2216 
2217  BranchName = "shwr_pidmvamu_" + ShowerLabel;
2218  CreateBranch(BranchName, shwr_pidmvamu, BranchName + NShowerIndexStr + "/F");
2219 
2220  BranchName = "shwr_pidmvae_" + ShowerLabel;
2221  CreateBranch(BranchName, shwr_pidmvae, BranchName + NShowerIndexStr + "/F");
2222 
2223  BranchName = "shwr_pidmvapich_" + ShowerLabel;
2224  CreateBranch(BranchName, shwr_pidmvapich, BranchName + NShowerIndexStr + "/F");
2225 
2226  BranchName = "shwr_pidmvaphoton_" + ShowerLabel;
2227  CreateBranch(BranchName, shwr_pidmvaphoton, BranchName + NShowerIndexStr + "/F");
2228 
2229  BranchName = "shwr_pidmvapr_" + ShowerLabel;
2230  CreateBranch(BranchName, shwr_pidmvapr, BranchName + NShowerIndexStr + "/F");
2231 
2232 } // dune::AnalysisTreeDataStruct::ShowerDataStruct::SetAddresses()
ShowerData_t< Float_t > shwr_startx
startx of shower
ShowerData_t< Float_t > shwr_startz
startz of shower
PlaneData_t< Float_t > shwr_dedx
dE/dx of the shower per plane
std::string string
Definition: nybbler.cc:12
ShowerData_t< Float_t > shwr_startdcosy
Y directional cosine at start of shower.
ShowerData_t< Float_t > shwr_length
Shower length.
ShowerData_t< Float_t > shwr_starty
starty of shower
PlaneData_t< Float_t > shwr_mipEng
Total MIP energy of the shower per plane.
Little helper functor class to create or reset branches in a tree.
size_t MaxShowers
maximum number of storable showers
ShowerData_t< Short_t > shwr_bestplane
Shower best plane.
ShowerData_t< Short_t > showerID
Shower ID.
ShowerData_t< Float_t > shwr_startdcosx
X directional cosine at start of shower.
constexpr int kMaxShowerHits
ShowerData_t< Float_t > shwr_startdcosz
Z directional cosine at start of shower.
PlaneData_t< Float_t > shwr_totEng
Total energy of the shower per plane.
void dune::AnalysisTreeDataStruct::ShowerDataStruct::SetMaxShowers ( size_t  maxShowers)
inline

Definition at line 390 of file AnalysisTree_module.cc.

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

Definition at line 389 of file AnalysisTree_module.cc.

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

Member Data Documentation

size_t dune::AnalysisTreeDataStruct::ShowerDataStruct::MaxShowers

maximum number of storable showers

Definition at line 350 of file AnalysisTree_module.cc.

std::string dune::AnalysisTreeDataStruct::ShowerDataStruct::name

name of the shower algorithm (for branch names)

Definition at line 348 of file AnalysisTree_module.cc.

Short_t dune::AnalysisTreeDataStruct::ShowerDataStruct::nshowers

number of showers

Definition at line 354 of file AnalysisTree_module.cc.

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

Shower ID.

Definition at line 355 of file AnalysisTree_module.cc.

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

Shower best plane.

Definition at line 356 of file AnalysisTree_module.cc.

PlaneData_t<Float_t> dune::AnalysisTreeDataStruct::ShowerDataStruct::shwr_dedx

dE/dx of the shower per plane

Definition at line 365 of file AnalysisTree_module.cc.

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

Definition at line 375 of file AnalysisTree_module.cc.

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

Shower length.

Definition at line 357 of file AnalysisTree_module.cc.

PlaneData_t<Float_t> dune::AnalysisTreeDataStruct::ShowerDataStruct::shwr_mipEng

Total MIP energy of the shower per plane.

Definition at line 366 of file AnalysisTree_module.cc.

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

Definition at line 376 of file AnalysisTree_module.cc.

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

Definition at line 369 of file AnalysisTree_module.cc.

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

Definition at line 368 of file AnalysisTree_module.cc.

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

Definition at line 371 of file AnalysisTree_module.cc.

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

Definition at line 370 of file AnalysisTree_module.cc.

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

Definition at line 372 of file AnalysisTree_module.cc.

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

X directional cosine at start of shower.

Definition at line 358 of file AnalysisTree_module.cc.

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

Y directional cosine at start of shower.

Definition at line 359 of file AnalysisTree_module.cc.

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

Z directional cosine at start of shower.

Definition at line 360 of file AnalysisTree_module.cc.

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

startx of shower

Definition at line 361 of file AnalysisTree_module.cc.

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

starty of shower

Definition at line 362 of file AnalysisTree_module.cc.

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

startz of shower

Definition at line 363 of file AnalysisTree_module.cc.

PlaneData_t<Float_t> dune::AnalysisTreeDataStruct::ShowerDataStruct::shwr_totEng

Total energy of the shower per plane.

Definition at line 364 of file AnalysisTree_module.cc.


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