typedef double G4double;
されてるじゃないか

添え字の型がおかしいぞボケ!ってエラー出てるんだから
theEdepPerDetector[copy_number]のcopy_numberを整数型にしろ