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

Public Types

template<typename T >
using ShowerData_t = std::vector< T >
 

Public Member Functions

 ShowerDataStruct ()
 Creates an empty showerer data structure. More...
 
 ShowerDataStruct (size_t maxShowers)
 Creates a shower data structure allowing up to maxShowers showers. More...
 
void Clear ()
 
void SetMaxShowers (size_t maxShowers)
 
void Resize (size_t nShowers)
 
void SetShowerAddresses (TTree *pTree, std::string showerLabel, bool saveHierarchyInfo)
 
size_t GetMaxShowers () const
 
size_t GetMaxPlanesPerShower (int=0) const
 

Public Attributes

size_t MaxShowers
 maximum number of storable showers More...
 
Short_t nshowers
 
ShowerData_t< Int_t > shwId
 
ShowerData_t< Int_t > shwbestplane
 
ShowerData_t< Float_t > shwlength
 
ShowerData_t< Float_t > shwopenangle
 
ShowerData_t< Float_t > shwstartx
 
ShowerData_t< Float_t > shwstarty
 
ShowerData_t< Float_t > shwstartz
 
ShowerData_t< Float_t > shwdirx
 
ShowerData_t< Float_t > shwdiry
 
ShowerData_t< Float_t > shwdirz
 
ShowerData_t< Int_t > shwisprimary
 If SaveHierarchyInfo is true, there are additional variables: More...
 
ShowerData_t< Int_t > shwndaughters
 
ShowerData_t< Int_t > shwpfpid
 
ShowerData_t< Int_t > shwparentpfpid
 

Detailed Description

Shower algorithm result

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

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

Member Typedef Documentation

template<typename T >
using sbnd::AnalysisTreeDataStruct::ShowerDataStruct::ShowerData_t = std::vector<T>

Constructor & Destructor Documentation

sbnd::AnalysisTreeDataStruct::ShowerDataStruct::ShowerDataStruct ( )
inline
sbnd::AnalysisTreeDataStruct::ShowerDataStruct::ShowerDataStruct ( size_t  maxShowers)
inline

Creates a shower data structure allowing up to maxShowers showers.

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

Member Function Documentation

void sbnd::AnalysisTreeDataStruct::ShowerDataStruct::Clear ( )

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

1413  {
1414  Resize(MaxShowers);
1415  nshowers = 0;
1416 
1417  // For variables with the ShowerData_t form
1418  FillWith(shwId, -9999);
1419  FillWith(shwbestplane, -9999);
1420  FillWith(shwlength, -9999.);
1421  FillWith(shwopenangle, -9999.);
1422  FillWith(shwstartx, -9999.);
1423  FillWith(shwstarty, -9999.);
1424  FillWith(shwstartz, -9999.);
1425  FillWith(shwdirx, -9999.);
1426  FillWith(shwdiry, -9999.);
1427  FillWith(shwdirz, -9999.);
1428  FillWith(shwisprimary, -9999);
1429  FillWith(shwndaughters, -9999);
1430  FillWith(shwpfpid, -9999);
1431  FillWith(shwparentpfpid, -9999);
1432 
1433 } // sbnd::AnalysisTreeDataStruct::ShowerDataStruct::Clear()
ShowerData_t< Int_t > shwisprimary
If SaveHierarchyInfo is true, there are additional variables:
size_t sbnd::AnalysisTreeDataStruct::ShowerDataStruct::GetMaxPlanesPerShower ( int  = 0) const
inline

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

379  { return (size_t) kNplanes; }
size_t sbnd::AnalysisTreeDataStruct::ShowerDataStruct::GetMaxShowers ( ) const
inline
void sbnd::AnalysisTreeDataStruct::ShowerDataStruct::Resize ( size_t  nShowers)

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

1393 {
1394  MaxShowers = nShowers;
1395 
1396  shwId.resize(MaxShowers);
1397  shwbestplane.resize(MaxShowers);
1398  shwlength.resize(MaxShowers);
1399  shwopenangle.resize(MaxShowers);
1400  shwstartx.resize(MaxShowers);
1401  shwstarty.resize(MaxShowers);
1402  shwstartz.resize(MaxShowers);
1403  shwdirx.resize(MaxShowers);
1404  shwdiry.resize(MaxShowers);
1405  shwdirz.resize(MaxShowers);
1406  shwisprimary.resize(MaxShowers);
1407  shwndaughters.resize(MaxShowers);
1408  shwpfpid.resize(MaxShowers);
1409  shwparentpfpid.resize(MaxShowers);
1410 
1411 } // AnalysisTreeDataStruct::ShowerDataStruct.Resize()
ShowerData_t< Int_t > shwisprimary
If SaveHierarchyInfo is true, there are additional variables:
void sbnd::AnalysisTreeDataStruct::ShowerDataStruct::SetMaxShowers ( size_t  maxShowers)
inline
void sbnd::AnalysisTreeDataStruct::ShowerDataStruct::SetShowerAddresses ( TTree *  pTree,
std::string  showerLabel,
bool  saveHierarchyInfo 
)

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

1437  {
1438  if (MaxShowers == 0) return; // no tracks, no tree!
1439 
1440  sbnd::AnalysisTreeDataStruct::BranchCreator CreateBranch(pTree);
1441 
1442  std::string ShowerLabel = showerLabel;
1443  std::string BranchName;
1444 
1445  BranchName = "nshowers_" + ShowerLabel;
1446  CreateBranch(BranchName, &nshowers, BranchName + "/S");
1447  std::string NShowersIndexStr = "[" + BranchName + "]";
1448 
1449  BranchName = "shwId_" + ShowerLabel;
1450  CreateBranch(BranchName, shwId, BranchName + NShowersIndexStr + "/I");
1451 
1452  BranchName = "shwbestplane_" + ShowerLabel;
1453  CreateBranch(BranchName, shwbestplane, BranchName + NShowersIndexStr + "/I");
1454 
1455  BranchName = "shwlength_" + ShowerLabel;
1456  CreateBranch(BranchName, shwlength, BranchName + NShowersIndexStr + "/F");
1457 
1458  BranchName = "shwlength_" + ShowerLabel;
1459  CreateBranch(BranchName, shwlength, BranchName + NShowersIndexStr + "/F");
1460 
1461  BranchName = "shwopenangle_" + ShowerLabel;
1462  CreateBranch(BranchName, shwopenangle, BranchName + NShowersIndexStr + "/F");
1463 
1464  BranchName = "shwstartx_" + ShowerLabel;
1465  CreateBranch(BranchName, shwstartx, BranchName + NShowersIndexStr + "/F");
1466 
1467  BranchName = "shwstarty_" + ShowerLabel;
1468  CreateBranch(BranchName, shwstarty, BranchName + NShowersIndexStr + "/F");
1469 
1470  BranchName = "shwstartz_" + ShowerLabel;
1471  CreateBranch(BranchName, shwstartz, BranchName + NShowersIndexStr + "/F");
1472 
1473  BranchName = "shwdirx_" + ShowerLabel;
1474  CreateBranch(BranchName, shwdirx, BranchName + NShowersIndexStr + "/F");
1475 
1476  BranchName = "shwdiry_" + ShowerLabel;
1477  CreateBranch(BranchName, shwdiry, BranchName + NShowersIndexStr + "/F");
1478 
1479  BranchName = "shwdirz_" + ShowerLabel;
1480  CreateBranch(BranchName, shwdirz, BranchName + NShowersIndexStr + "/F");
1481 
1482  if(saveHierarchyInfo){
1483  BranchName = "shwisprimary_" + ShowerLabel;
1484  CreateBranch(BranchName, shwisprimary, BranchName + NShowersIndexStr + "/O");
1485 
1486  BranchName = "shwndaughters_" + ShowerLabel;
1487  CreateBranch(BranchName, shwndaughters, BranchName + NShowersIndexStr + "/I");
1488 
1489  BranchName = "shwpfpid_" + ShowerLabel;
1490  CreateBranch(BranchName, shwpfpid, BranchName + NShowersIndexStr + "/I");
1491 
1492  BranchName = "shwparentpfpid_" + ShowerLabel;
1493  CreateBranch(BranchName, shwparentpfpid, BranchName + NShowersIndexStr + "/I");
1494  }
1495 } // sbnd::AnalysisTreeDataStruct::ShowerDataStruct::SetShowerAddresses()
Little helper functor class to create or reset branches in a tree.
ShowerData_t< Int_t > shwisprimary
If SaveHierarchyInfo is true, there are additional variables:

Member Data Documentation

size_t sbnd::AnalysisTreeDataStruct::ShowerDataStruct::MaxShowers

maximum number of storable showers

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

Short_t sbnd::AnalysisTreeDataStruct::ShowerDataStruct::nshowers
ShowerData_t<Int_t> sbnd::AnalysisTreeDataStruct::ShowerDataStruct::shwbestplane
ShowerData_t<Float_t> sbnd::AnalysisTreeDataStruct::ShowerDataStruct::shwdirx
ShowerData_t<Float_t> sbnd::AnalysisTreeDataStruct::ShowerDataStruct::shwdiry
ShowerData_t<Float_t> sbnd::AnalysisTreeDataStruct::ShowerDataStruct::shwdirz
ShowerData_t<Int_t> sbnd::AnalysisTreeDataStruct::ShowerDataStruct::shwId
ShowerData_t<Int_t> sbnd::AnalysisTreeDataStruct::ShowerDataStruct::shwisprimary

If SaveHierarchyInfo is true, there are additional variables:

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

ShowerData_t<Float_t> sbnd::AnalysisTreeDataStruct::ShowerDataStruct::shwlength
ShowerData_t<Int_t> sbnd::AnalysisTreeDataStruct::ShowerDataStruct::shwndaughters
ShowerData_t<Float_t> sbnd::AnalysisTreeDataStruct::ShowerDataStruct::shwopenangle
ShowerData_t<Int_t> sbnd::AnalysisTreeDataStruct::ShowerDataStruct::shwparentpfpid
ShowerData_t<Int_t> sbnd::AnalysisTreeDataStruct::ShowerDataStruct::shwpfpid
ShowerData_t<Float_t> sbnd::AnalysisTreeDataStruct::ShowerDataStruct::shwstartx
ShowerData_t<Float_t> sbnd::AnalysisTreeDataStruct::ShowerDataStruct::shwstarty
ShowerData_t<Float_t> sbnd::AnalysisTreeDataStruct::ShowerDataStruct::shwstartz

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