// ------------------------------------------------------------------------- // ----- AsyUnpack source file ----- // ----- Created 12/04/12 by P. Russotto ----- // ------------------------------------------------------------------------- #include "TWUnpack.h" #include "FairLogger.h" #include "TClonesArray.h" using std::cout; using std::endl; Bool_t TWDebug = false; TWUnpack::TWUnpack() :FairTask() { //init calibration } // ------------------------------------------------------------------------- TWUnpack::TWUnpack(const char* name, Int_t iVerbose) : FairTask(name, iVerbose), // fTWall_evt(0), fRootTWEvent(0), fRootTWEventCopy(0), ffBufferClone(0) { } // ------------------------------------------------------------------------- TWUnpack::~TWUnpack() { } // ------------------------------------------------------------------------- InitStatus TWUnpack::Init() { fLogger->Info(MESSAGE_ORIGIN," TWallUnpack::Init()------------------Start "); // fTWall_evt= new TTWALLEvent(); FairRootManager* ioman = FairRootManager::Instance(); if ( ! ioman ) Fatal("Init", "No FairRootManager"); ffBufferClone =(TClonesArray*) ioman->GetObject("EVTBUFFERCLONE"); ffBuffer = (TEvtBuffer*)ffBufferClone; fRootTWEvent= new TRootTWEvent(); ioman->Register("TOFWALLEVENT", "TOFWALL EVENT TREE", fRootTWEvent, kFALSE); fRootTWEventCopy= new TClonesArray("TRootTWEvent"); fRootTWEventCopy=(TClonesArray*)fRootTWEvent; ioman->Register("TOFWALLEVENTCLONE", "TOFWALL EVENT TREE CLONE", fRootTWEventCopy, kFALSE); fLogger->Info(MESSAGE_ORIGIN," TWallUnpack::Init()------------------End "); cout << " ...return to continue..."<< endl; getchar(); } // ------------------------------------------------------------------------- void TWUnpack::SetParTask() { } // ------------------------------------------------------------------------- void TWUnpack::Finish() { // if(fIsLastEvent) // fLogger->Info(MESSAGE_ORIGIN," Finish all events in file"); } // ------------------------------------------------------------------------- void TWUnpack::Reset() { } // ------------------------------------------------------------------------- void TWUnpack::Exec(Option_t* opt) { if(TWDebug) cout<<"TofWall event"<ProcessCurrentEventMBS(ffBuffer->TWBuffer,ffBuffer->TWnrlw); } // ------------------------------------------------------------------------- ClassImp(TWUnpack)