//----------------------------------------------------------- // File and Version Information: // $Id$ // // Description: // TPC-CDC Matching Routine // // // Environment: // Software developed for the Prototype Detector at FOPI // // Author List: // Felix Boehmer, E18 TUM // //----------------------------------------------------------- // This Class' Header ------------------ #include "TpcCdcMatchingTaskFelix.h" InitStatus TpcCdcMatchingTask::Init() { //Get ROOT Manager ------------------ FairRootManager* ioman= FairRootManager::Instance(); if(ioman==0) { Error("TpcCdcMatchingTask::Init","RootManager not instantiated!"); return kERROR; } // Get input ------------------------ fTpcClusterArray=(TClonesArray*) ioman->GetObject(fTpcClusterBranchName); if(fTpcClusterArray==0) { Error("TpcCdcMatchingTask::Init","TpcCluster array not found!"); return kERROR; } fTpcTrackArray=(TClonesArray*) ioman->GetObject(fTpcTrackBranchName); if(fTpcTrackArray==0) { Error("TpcCdcMatchingTask::Init","GFTrack array not found!"); return kERROR; } fCdcHitArray=(TClonesArray*) ioman->GetObject(fCdcHitBranchName); if(fCdcHitArray==0) { Error("TpcCdcMatchingTask::Init","Cdc Hits array not found!"); return kERROR; } fCdcTrackArray=(TClonesArray*) ioman->GetObject(fCdcTrackBranchName); if(fCdcTrackArray==0) { Error("TpcCdcMatchingTask::Init","CDC track array not found!"); return kERROR; } fCdcEventArray=(TClonesArray*) ioman->GetObject(fCdcEvBranchName); if(fCdcEventArray==0) { Error("TpcCdcMatchingTask::Init","CDC event not found!"); return kERROR; } fMatchingQA = new TClonesArray("TpcCdcMatchingQA"); fMatchedOutArray = new TClonesArray("GFTrack"); ioman->Register("TpcCdcMatchingQA","Tpc",,fMatchingQA, fPersistence); ioman->Register("TpcCdcCombinedPreFit","Tpc",fMatchedOut,fPersistence); return kSUCCESS; } void TpcCdcMatchingTask::Exec(Option_t* opt) { fMatchingQA->Delete(); fMatchedOut->Delete(); unsigned int nCdcTracks = fCdcTrackArray->GetEntriesFast(); unsigned int nTpcTracks = fTpcTrackArray->GetEntriesFast(); //build CDC GFTracks (this should be done externally ...) for(unsigned int ictr=0; ictr