#ifndef COSY_Rings
#define COSY_Rings

#ifndef ROOT_TClonesArray
#include <TClonesArray.h>
#endif

#ifndef COSY_Ring
#include "Ring.h"
#endif

class Leds;

class Rings : public TClonesArray
{
private:
    Ring fCenter;

    void CalcCenters(const Leds &leds);

public:
    Rings() : TClonesArray("Ring", 1) {}

    void CalcRings(Leds &leds);

    void Print(Option_t *o=NULL) const;

    const Ring &operator()(int i) const { return *(Ring*)At(i); }
    Ring &operator()(int i) { return *(Ring*)At(i); }

    const Ring &GetCenter() const { return fCenter; }

    ClassDef(Rings, 1)
};

#endif
