/* * PndEmcClusterSorterTask.cxx */ #include #include "PndEmcCluster.h" #include "PndEmcPrecluster.h" #include "PndEmcClusterRingSorter.h" #include "TClonesArray.h" ClassImp(PndEmcClusterSorterTask); PndEmcClusterSorterTask::PndEmcClusterSorterTask() { } PndEmcClusterSorterTask::~PndEmcClusterSorterTask() { } void PndEmcClusterSorterTask::AddNewDataToTClonesArray(FairTimeStamp* data) { FairRootManager* ioman = FairRootManager::Instance(); TClonesArray* myArray = ioman->GetTClonesArray(fOutputBranch); if (fVerbose > 1){ std::cout << "-I- PndEmcClusterSorterTask::AddNewDataToTClonesArray Data: " ; if (fClusterType==0) std::cout << "(Type=" << fClusterType << ") " << *(PndEmcCluster*)(data) << std::endl; else if (fClusterType==1) std::cout << "(Type=" << fClusterType << ") " << *(PndEmcPrecluster*)(data) << std::endl; } if (fClusterType==0) new ((*myArray)[myArray->GetEntries()]) PndEmcCluster(*(PndEmcCluster*)(data)); // <-- Here (set to use PndEmcCluster) else if (fClusterType==1) new ((*myArray)[myArray->GetEntries()]) PndEmcPrecluster(*(PndEmcPrecluster*)(data)); // <-- and here (set to use PndEmcPrecluster) } FairRingSorter* PndEmcClusterSorterTask::InitSorter(Int_t numberOfCells, Double_t widthOfCells) const{ return new PndEmcClusterRingSorter(numberOfCells, widthOfCells); }