PandaTree
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
panda::ContainerBase Class Referenceabstract

Base class for all containers. More...

#include <ContainerBase.h>

Inheritance diagram for panda::ContainerBase:
panda::ReaderObject panda::Object panda::ArrayBase panda::CollectionBase

Public Types

typedef std::function< bool(Element const &, Element const &)> Comparison
 

Public Member Functions

 ContainerBase (ContainerBase const &)=delete
 
ContainerBaseoperator= (ContainerBase const &)=delete
 
char const * getName () const final
 Name of this object.
 
void setName (char const *name) final
 Set object name.
 
void print (std::ostream &=std::cout, UInt_t level=1) const override
 Print the object content.
 
void dump (std::ostream &=std::cout) const override
 Dump the object content.
 
virtual UInt_t size () const =0
 
virtual Element::datastoregetData ()=0
 
virtual Element::datastore const & getData () const =0
 
virtual ElementelemAt (UInt_t)=0
 
virtual Element const & elemAt (UInt_t) const =0
 
virtual std::vector< UInt_t > sort (Comparison const &fct)=0
 Sort the contents using a comparison function and returns an array of pre-sort indices. More...
 
- Public Member Functions inherited from panda::ReaderObject
 ReaderObject (ReaderObject const &src)
 
ReaderObjectoperator= (ReaderObject const &)
 
Int_t getEntry (TTree &tree, Long64_t entry, Bool_t localEntry=kFALSE) final
 Read an entry from an input tree. More...
 
Int_t getEntry (UInt_t treeId, Long64_t entry, Bool_t localEntry=kFALSE) override
 Read an entry from an input tree. More...
 
virtual void unlink (TTree &)
 Unlink from a tree.
 
void updateBranchArray (TTree &)
 
- Public Member Functions inherited from panda::Object
 Object (Object const &)
 
Objectoperator= (Object const &)
 
virtual void setStatus (TTree &tree, utils::BranchList const &)
 Set status of branches to true (matching branch) or false (vetoed branch) More...
 
virtual utils::BranchList getStatus (TTree &) const
 Get status of branches in the tree.
 
virtual utils::BranchList getBranchNames (Bool_t fullName=kTRUE, Bool_t direct=kFALSE) const
 Get the full list of branch names. More...
 
virtual UInt_t setAddress (TTree &tree, utils::BranchList const &={"*"}, Bool_t setStatus=kTRUE)
 Bind the tree branches to the elements of this object. More...
 
virtual void book (TTree &tree, utils::BranchList const &={"*"})
 Book new branches bound to this object on the tree. More...
 
virtual Int_t fill (TTree &tree)
 Fill a tree. More...
 
virtual void init ()
 Reset the object state.
 

Protected Member Functions

 ContainerBase (char const *name, UInt_t unitSize)
 
- Protected Member Functions inherited from panda::ReaderObject
UInt_t registerInput_ (TTree &)
 

Protected Attributes

TString name_ {""}
 
UInt_t const unitSize_ {0}
 
Char_t * array_ {0}
 
- Protected Attributes inherited from panda::ReaderObject
std::vector< BranchMappinginputBranches_
 List of list of input branches. More...
 

Additional Inherited Members

- Protected Types inherited from panda::ReaderObject
typedef std::vector< TBranch * > BranchArray
 
typedef std::pair< TTree *, BranchArray > BranchMapping
 List of branches linked with this object in the tree.
 

Detailed Description

Base class for all containers.

Panda containers can be Array (fixed size) or Collection (dynamic size). Both inherit from ContainerBase.

Member Function Documentation

§ sort()

virtual std::vector<UInt_t> panda::ContainerBase::sort ( Comparison const &  fct)
pure virtual

Sort the contents using a comparison function and returns an array of pre-sort indices.

For example, if [p0, p1, p2] gets sorted to [p2, p0, p1], the returned array is [2, 0, 1]

Parameters
fctA function that takes two Elements and returns true if the first element should come before the second in the sorted list.

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