/****************************************************************************** * $Id: CbmRichSelectRings.cxx,v 1.1 2006/09/13 14:53:31 hoehne Exp $ * * Class : CbmRichSelectRings * Description: Implementation of the SelectRings class. This * takes a particular Ring Selection to distinguish good and fake rings * * Author : Simeon Lebedev * E-mail : salebedev@jinr.ru * ******************************************************************************* * $Log: CbmRichSelectRings.cxx,v $ * Revision 1.1 2006/09/13 14:53:31 hoehne * initial version * * * *******************************************************************************/ #include "TClonesArray.h" #include "CbmHit.h" #include "CbmRootManager.h" #include "CbmRichSelectRings.h" #include "CbmRichRing.h" #include "CbmRichRingSelect.h" // ----- Default constructor ------------------------------------------- CbmRichSelectRings::CbmRichSelectRings() : CbmTask("RICH Select Rings") { fSelect = NULL; fRichHitArray = NULL; fProjArray = NULL; fRingArray = NULL; fVerbose = 1; } // ------------------------------------------------------------------------- // ----- Standard constructor ------------------------------------------ CbmRichSelectRings::CbmRichSelectRings(CbmRichRingSelect* select, Int_t verbose) : CbmTask("RICH Select Rings") { fSelect = select; fRichHitArray = NULL; fProjArray = NULL; fRingArray = NULL; fVerbose = verbose; } // ------------------------------------------------------------------------- // ----- Constructor with name and title ------------------------------- CbmRichSelectRings::CbmRichSelectRings(const char* name, const char* title, CbmRichRingSelect* select, Int_t verbose) : CbmTask(name) { fSelect = select; fRichHitArray = NULL; fProjArray = NULL; fRingArray = NULL; fVerbose = verbose; } // ------------------------------------------------------------------------- // ----- Destructor ---------------------------------------------------- CbmRichSelectRings::~CbmRichSelectRings() { } // ------------------------------------------------------------------------- // ----- Public method Init (abstract in base class) -------------------- InitStatus CbmRichSelectRings::Init() { // Check for Ring Selection if (! fSelect) { cout << "-E- CbmRichSelectRings::Init: No ring finder selected!" << endl; return kERROR; } // Get and check CbmRootManager CbmRootManager* ioman = CbmRootManager::Instance(); if (! ioman) { cout << "-E- CbmRichSelectRings::Init: " << "RootManager not instantised!" << endl; return kFATAL; } // Get RICH hit Array fRichHitArray = (TClonesArray*) ioman->GetObject("RichHit"); if ( ! fRichHitArray) { cout << "-W- CbmRichSelectRings::Init: No Rich Hit array!" << endl; } // Get RICH Ring Array of projected tracks fProjArray = (TClonesArray*) ioman->GetObject("RichProjection"); if ( ! fProjArray) { cout << "-W- CbmRichSelectRings::Init: No Rich Ring Array of projected tracks!" << endl; } // Get RICH Ring Array of projected tracks fRingArray = (TClonesArray*) ioman->GetObject("RichRing"); if ( ! fRingArray) { cout << "-W- CbmRichSelectRings::Init: No Rich Ring Array!" << endl; } // Set verbosity of ring finder fSelect->SetVerbose(fVerbose); // Call the Init method of the ring finder fSelect->Init(); return kSUCCESS; } // ------------------------------------------------------------------------- // ----- Public method Exec -------------------------------------------- void CbmRichSelectRings::Exec(Option_t* opt) { if ( !fRingArray ) { cout<<"-E- CbmRichSelectRings::ExecC: No Ring Array"<GetEntriesFast(); for (Int_t iRing=0; iRingAt(iRing); fSelect->DoSelect(pRing, fProjArray); } } // ------------------------------------------------------------------------- // ----- Public method Finish ------------------------------------------ void CbmRichSelectRings::Finish() { } // ------------------------------------------------------------------------- ClassImp(CbmRichSelectRings)