TList* KVGroup::GetDetectorsInLayer(UInt_t lay) { // lay=1 : create and fill list with detectors closest to target // lay=GetNumberOfDetectorLayers() : detectors furthest from target TList* dets = new TList; TIter next(GetDetectors()); KVDetector* d; while ((d = (KVDetector*)next())) { if (lay == (UInt_t)d->GetAlignedDetectors()->GetEntries()) dets->Add(d); } return dets; }
UInt_t KVGroup::GetNumberOfDetectorLayers() { // The number of detector layers is the maximum number of detectors in the // group which are placed one in front of the other, i.e. we interrogate // each detector as to how many detectors there are in front of it UInt_t max = 0; TIter next(GetDetectors()); KVDetector* d; while ((d = (KVDetector*)next())) { UInt_t e = d->GetAlignedDetectors()->GetEntries(); if (e > max) max = e; } return max; }