CFittedRing.h
//-----------------------------------------------------------------------------
// $Header: /asis/offline/ceres/cool/project/RCS/CFittedRing.h,v 2.6 1997/10/14 15:51:39 messer Exp messer $
//
// COOL Program Library
// Copyright (C) CERES collaboration, 1996
//
// Declarations for CFittedRing class.
//
//-----------------------------------------------------------------------------
#ifndef CFITTEDRING_H
#define CFITTEDRING_H
#include <iostream.h>
#include "cool.h"
#include "CRing.h"
#include "CRingCandidate.h"
#include "CCollection.h"
#include "CRichLikeLookupItem.h"
#include "CMCGeantTrack.h"
#include "CSortedList.h"
class CRich;
class CPad;
class CRichLikeHit;
class CFittedRing : public CRing{
public:
CFittedRing();
~CFittedRing();
public:
//
// Note:
// - chi2 is not divided by the degrees-of-freedom and is only
// available when evalChi2() was invoked when the object was created.
// The value refers to the radius passed as argument and the actual
// hits assigned to this ring.
// - KolmogorovTestValue is only available when evalKolmogorovTestValue()
// was invoked when the object was created
// - ActiveCircumference is only available when evalActiveCircumference()
// was invoked when the object was created
// - variance refers to the result of the fitting procedure
// - analogRingSum and numberOfPads are valid only when evalRingSum()
// was invoked.
//
CRichPadCoord getPadCenter() const { return getCenter(); }
CRichPolarCoord getPolarCenter() const { return polarCenter; }
double getVariance() const { return variance; }
double getChi2() const { return chi2; }
double getActiveCircumference() const { return activeCircumference; }
double getKolmogorovTestValue() const { return kolmogorovTestValue; }
int getNumberOfHits() const { return numberOfHits; }
int getNumberOfPads() const { return numberOfPads; }
double getAnalogRingSum() const { return analogRingSum; }
CRingCandidate* getRingCandidate() const { return ringCandidate; }
inline double getHough1Amplitude() const;
inline double getHough2Amplitude() const;
const CSortedList<CRichLikeHit> &getHits() const { return hits; }
void setCenter(CRichPadCoord, CRichPolarCoord);
void setVariance(double val) { variance = val; }
void setNumberOfPads(int numPad) { numberOfPads = numPad; }
void setAnalogRingSum(double ringSum) { analogRingSum = ringSum; }
void setRingCandidate(CRingCandidate* newCand) { ringCandidate = newCand; }
void evalActiveCircumference(const CCollection<CRichLikeLookupItem>& list);
void evalKolmogorovTestValue(const CCollection<CRichLikeLookupItem>& list);
void evalRingSum(const CCollection<CRichLikeLookupItem>& list,
const CCollection<CPad>& pads,
double halfMaskWidth);
void evalChi2(double r);
void printProperties(ostream& = cout) const;
void addHit(CRichLikeHit* hit);
void clearHitInformation();
public:
void getMCGeantTracks(CRich&, RWTPtrOrderedVector<CMCGeantTrack>&);
protected:
CRichPolarCoord polarCenter;
int numberOfHits;
double chi2; // only valid after evalChi2()
double variance; // from ring fit
double activeCircumference; // only valid after evalActiveCircumference()
double kolmogorovTestValue; // only valid after evalKolmogorovTestValue()
int numberOfPads; // only valid after evalRingSum()
double analogRingSum; // only valid after evalRingSum()
CRingCandidate *ringCandidate; // candidate from which this ring was made
CSortedList<CRichLikeHit> hits; // list of hits used for this ring
protected:
double evalActiveSegment(const CCollection<CRichLikeLookupItem>& list, double, double);
private:
void setCenter (CRichPadCoord) {} // access denied
// use setCenter(CRichPadCoord,CRichPolarCoord) instead
};
inline double CFittedRing::getHough1Amplitude() const
{
if (ringCandidate)
return ringCandidate->getHough1Amplitude();
else
return 0;
}
inline double CFittedRing::getHough2Amplitude() const
{
if (ringCandidate)
return ringCandidate->getHough2Amplitude();
else
return 0;
}
#endif /* CFITTEDRING_H */