seed::TSeedABC


class description - source file - inheritance tree

class seed::TSeedABC : public TObject


    protected:
TBranch* CreateBranch(TClonesArray** ppCA, TTree* pTree) seed::TSeedABC* GetSeedData(const Char_t* strLabel) virtual Bool_t Init(seed::TSingleEntryTree& tree) virtual void PreFill() virtual Bool_t PreFillSeedData(list<seed::TSeedABC*>& callStack, Int_t iEventNo) void SetFillOwner(seed::TSingleEntryTree* tree, TClonesArray* *const pCA) public:
static TClass* Class() void Enable(Bool_t bEnable = kTRUE) virtual Bool_t FillSeedData(seed::TSingleEntryTree& tree, const Int_t iEventNo) virtual const Char_t* GetClassName() const virtual const Char_t* GetName() const Long_t GetNumberOfFilledObjects() const virtual TClass* IsA() const Bool_t IsEnabled() const virtual void ShowMembers(TMemberInspector& insp, char* parent) Long_t Size() const virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members


    protected:
TClonesArray* *const fPCA temporary address of currently filled/read TCA seed::TSingleEntryTree* fSET currently read seed::TSingleEntryTree = ntuple Bool_t fBEnabled true: this seed has to process / read data ULong_t fINumObjCreatedTotal number of objects put into fPCA ULong_t fINumObjCreatedEvent number of objects created during the current entry list<seed::TSeedABC*>* fCallStack call stack for FillSeedData const Char_t* fName name of the seed = name of corresponding branch

Class Description

      This is the base class for the user defined Seeds.
 To fill data from an n-tuple into a seed::TEventSample,
 seed::TEventSample::Create calls the method FillSeedData
 for all activated seeds for each event and lets them read
 data from the n-tuple and store it in a class, which is
 then written into seed::TEventSample's tree.

 To create a seed you have to derive your class from
 seed::TSeed, stating which kind of object your seed
 should handle (the data class):

    TMySeed: public TSeed< TMyDataClass > {

 This class needs to define where the data will be stored
 at in the output tree (i.e. the branch name) - usually
 you should use the name of your seed here, to make it
 clear how that data was generated.

 This branch name (called the seed's "name") is given in
 constructor, which has to be declared by you, as well as
 the virtual default destructor:

     public:
       TMySeed(seed::TEventSample pES=NULL): TSeed("TMySeed",pES){};
       virtual ~TMySeed() {};

 The next two methods are needed for the data fransfer
 from the ntuple to the objects handled by your seed
 (here, objects of type TMyDataClass):

       void Init(seed::TSingleEntryTree& tree);
       Bool_t FillSeedData(seed::TSingleEntryTree & tree,
                           const Int_t iEventNo);

 Now, add the data members to store the data you need
 from the ntuple:

     private:
       Int_t fnumObj; // number of objects in a given event
       Float_t* fPosX; // fPosX[n] gets the (n+1)-th object's fPosX for a given event
       Float_t* fPosY;
       Float_t* fPosZ;
    };

 To register your seed with seed::TSeedList (which makes
 it "available" to seed::TEventSample) you need to
 create a global, static object of this type, which will
 not be referenced directly, so you can put it into an
 unnamed namespace:

    namespace { static TMySeed globalstaticMySeed; }

 In your seed's Init method you set up the transfer from
 the ntuple, accessible via a seed::TSingleEntryTree
 (see seed::TSingleEntryTree::Transfer for how to set
 this up). In your seed's FillSeedData method you create
 new objects with NewEntry() (in this case of it creates
 an object of type TMyDataObject) and initialize it
 using your seed's members (here one would create
 fnumObj objects and initialize them with
   fPosX[0], fPosY[0], fPosZ[0]
   fPosX[1], fPosY[1], fPosZ[1] ...

 For more details see the seed documentation.


TBranch* CreateBranch(TClonesArray ** ppCA, TTree * pTree)
 creates a branch in the given tree, and sets the branch's address to
 the address of the clones array.

Bool_t Init(seed::TSingleEntryTree& tree)
 This method is called to update the mapping from ntuple data
 to TSeedABC derived classes. It should be overloaded by classes
 deriving from TSeedABC, making use of methods like
 TSingleEntryTree::TransferDouble etc.

void SetFillOwner(TSingleEntryTree * tree, TClonesArray * const * pCA)
 called before filling to signal "ownership" for this seed

Bool_t PreFillSeedData( std::list< seed::TSeedABC* >& callStack, Int_t iEventNo)
 called before TSeedABC::FillSeedData is called. Cleanup from the previous
 n-tuple entry and initialization for this entry

seed::TSeedABC* GetSeedData(const char* strLabel)
 Called from within FillSeedData, this method returns a pointer to the
 TSeedABC derived class holding the data of the seed with name
 strLabel for the current n-tuple entry. With this method cross references
 between seeds are possible. One can e.g. reference the data of a
 seed declared with
    TSeedA: public TSeed< TDataClassA >
 from within TSeedB::FillSeedData:

    TSeed< TDataClassA > * pSeedA = GetSeedData("TSeedA");

 and access its objects via
    TDataClassA a = (*pSeedDataA)[0];

 This method always fills the seed data in the order necessary to
 satisfy all dependencies (i.e. if SeedA needs SeedB, SeedB will be
 filled first). If a circular dependency is encountered, the program
 exits with an error message showing the path of the circular dependency.

Long_t Size() const
 returns the number of available objects of this seed::TSeedDataABC's seed in the currently
 selected event.

Bool_t FillSeedData(seed::TSingleEntryTree & tree, const Int_t iEventNo)
 Produces output, filling ntuple data into objects (the
 data classes) requested by TSeed::NewEntry. See the class
 documentation of TSeedABC for details.

 Has to be overloaded by deriving classes to produce output.

 Parameters
   tree:     A seed::TSingleEntryTree allowing to access the ntuple
             entry currently being transformed. If principle access
             to this object is not needed for FillSeedData, as the
             data access (transfer to members, see
             seed::TSingleEntryTree::Transfer) should be setup in
             Init.
   iEventNo: Number of the current entry, always starting at 0 even
             if seed::TEventSample::SetFirstEntry has been called


void Enable(Bool_t bEnable)
 Enables a seed for data transfer / reading



Inline Functions


               Bool_t IsEnabled() const
               Long_t GetNumberOfFilledObjects() const
        const Char_t* GetClassName() const
        const Char_t* GetName() const
                 void PreFill()
              TClass* Class()
              TClass* IsA() const
                 void ShowMembers(TMemberInspector& insp, char* parent)
                 void Streamer(TBuffer& b)
                 void StreamerNVirtual(TBuffer& b)


Last update: Wed May 8 06:14:29 2002


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.