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::VertexDataStruct Class Reference

Public Types

template<typename T >
using VertexData_t = std::vector< T >
 
template<typename T >
using VtxCoordData_t = std::vector< BoxedArray< T[3]> >
 

Public Member Functions

 VertexDataStruct ()
 Creates an empty tracker data structure. More...
 
 VertexDataStruct (size_t maxVertices)
 Creates a vertex data structure allowing up to maxVertices vertices. More...
 
void Clear ()
 
void SetMaxVertices (size_t maxVertices)
 
void Resize (size_t nVertices)
 
void SetAddresses (TTree *pTree, std::string vertexLabel, bool saveHierarchyInfo)
 
size_t GetMaxVertices () const
 

Public Attributes

size_t MaxVertices
 maximum number of storable vertices More...
 
Short_t nvtx
 
VtxCoordData_t< Float_t > vtx
 
VertexData_t< Int_t > primaryvtx
 

Detailed Description

Vertices

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

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

Member Typedef Documentation

template<typename T >
using sbnd::AnalysisTreeDataStruct::VertexDataStruct::VertexData_t = std::vector<T>
template<typename T >
using sbnd::AnalysisTreeDataStruct::VertexDataStruct::VtxCoordData_t = std::vector<BoxedArray<T[3]> >

Constructor & Destructor Documentation

sbnd::AnalysisTreeDataStruct::VertexDataStruct::VertexDataStruct ( )
inline
sbnd::AnalysisTreeDataStruct::VertexDataStruct::VertexDataStruct ( size_t  maxVertices)
inline

Creates a vertex data structure allowing up to maxVertices vertices.

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

Member Function Documentation

void sbnd::AnalysisTreeDataStruct::VertexDataStruct::Clear ( )

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

1509  {
1511  nvtx = 0;
1512 
1513  for (size_t iVtx = 0; iVtx < MaxVertices; ++iVtx){
1514  FillWith(vtx[iVtx], -9999.);
1515  }
1516  FillWith(primaryvtx, -9999);
1517 } // AnalysisTreeDataStruct::VertexDataStruct::Clear()
size_t sbnd::AnalysisTreeDataStruct::VertexDataStruct::GetMaxVertices ( ) const
inline
void sbnd::AnalysisTreeDataStruct::VertexDataStruct::Resize ( size_t  nVertices)

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

1502 {
1503  MaxVertices = nVertices;
1504 
1505  vtx.resize(MaxVertices);
1506  primaryvtx.resize(MaxVertices);
1507 } // AnalysisTreeDataStruct::VertexDataStruct::Resize()
void sbnd::AnalysisTreeDataStruct::VertexDataStruct::SetAddresses ( TTree *  pTree,
std::string  vertexLabel,
bool  saveHierarchyInfo 
)

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

1521  {
1522  if (MaxVertices == 0) return; // no vertices, no tree!
1523 
1524  sbnd::AnalysisTreeDataStruct::BranchCreator CreateBranch(pTree);
1525 
1526  std::string VertexLabel = vertices;
1527  std::string BranchName;
1528 
1529  BranchName = "nvtx_" + VertexLabel;
1530  CreateBranch(BranchName, &nvtx, BranchName + "/S");
1531  std::string NVertexIndexStr = "[" + BranchName + "]";
1532 
1533  if(saveHierarchyInfo){
1534  BranchName = "primaryvtx_" + VertexLabel;
1535  CreateBranch(BranchName, primaryvtx, BranchName + NVertexIndexStr + "/I");
1536  }
1537 
1538  BranchName = "vtx_" + VertexLabel;
1539  CreateBranch(BranchName, vtx, BranchName + NVertexIndexStr + "[3]/F");
1540 } // AnalysisTreeDataStruct::VertexDataStruct::SetAddresses()
Little helper functor class to create or reset branches in a tree.
void sbnd::AnalysisTreeDataStruct::VertexDataStruct::SetMaxVertices ( size_t  maxVertices)
inline

Member Data Documentation

size_t sbnd::AnalysisTreeDataStruct::VertexDataStruct::MaxVertices

maximum number of storable vertices

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

Short_t sbnd::AnalysisTreeDataStruct::VertexDataStruct::nvtx
VertexData_t<Int_t> sbnd::AnalysisTreeDataStruct::VertexDataStruct::primaryvtx
VtxCoordData_t<Float_t> sbnd::AnalysisTreeDataStruct::VertexDataStruct::vtx

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