//-------------------------------------------------------------------------- // Description: // ----------- // Class StntupleExampleModule : adds user branch named "MyClcBlock" to STNTUPLE // and fills it with CLC data // // // comments for the users: // ----------------------- // - to create a separate branch with the user data one starts from // describing an object to be stored on this branch - equivalent of HBOOK's // "data block" (see Stntuple/obj/TCmuDataBlock.hh for the example) // - `beginJob' entry point of the module calls AddDataBlock method // (this is a method of the base class StntupleModule) which creates // the branch and appends it to the STNTUPLE tree // - as CLC data block is a "standalone" block (filling it doesn't require // any information stored on other branches), it is filled with the event // data in InitStntupleModule::event and `event' entry point of // StntupleExampleModule doesn't do anything // - the rest is being done automatically by the STNTUPLE infrastructure // code // // Nov 2000 P.Murat //------------------------------------------------------------------------ #ifdef __GNUG__ #pragma implementation #endif #include #include #include #include #include #include "TTree.h" #include #include "StntupleExampleModule.hh" //------------------------------------------------------------------------------ // constructors //------------------------------------------------------------------------------ StntupleExampleModule::StntupleExampleModule(const char* name, const char* desc): StntupleModule (name,desc) { } //------------------------------------------------------------------------------ StntupleExampleModule::StntupleExampleModule(const StntupleExampleModule&) : StntupleModule ("x","x") { } //------------------------------------------------------------------------------ StntupleExampleModule::~StntupleExampleModule() { } //------------------------------------------------------------------------------ AppResult StntupleExampleModule::beginJob(AbsEvent* event) { // add data block with TClcDataBlock object to STNTUPLE tree. New branch will // be called "MyClcBlock", the data block will be filled with the event // data by IniStntupleModule // *** never ever split CLC data! *** AddDataBlock("MyClcDataBlock","TClcDataBlock", fBufferSize.value(), 0, fCompressionLevel.value()); return AppResult::OK; } //------------------------------------------------------------------------------ AppResult StntupleExampleModule::event(AbsEvent* event) { // event entry point: standard MyClcDataBlock is filled with the event data in // InitStntupleModule, so this routine is empty return AppResult::OK; }