CRichSetup.C
//-----------------------------------------------------------------------------
// $Header: CRichSetup.C,v 3.5 97/09/09 15:57:45 messer Exp $
//
// COOL Program Library
// Copyright (C) CERES collaboration, 1996
//
// Implementation of class CRichSetup.
//
//-----------------------------------------------------------------------------
#include <iostream.h>
#include <iomanip.h>
#include "CRichSetup.h"
CRichSetup::CRichSetup()
{
nSpokes = 0;
nMirrorSegments = 0;
mirrorSegmentOffset = 0;
spokeWidth = 0.;
firstSpokeAngle = 0.;
focalLength = 0.;
fudgeFocalLength = 0.;
detectorDistance = 0.;
mirrorDistance = 0.;
gammaThreshold = 0.;
radiatorLength = 0.;
asymptoticRadius = 0.;
houghMinAmp = 0;
houghMinFitHit = 0;
houghMaxFitDis = 0.;
houghChernovWidth = 0.;
houghMinDistance = 0.;
houghMaxDeltaRadius = 0.;
minHitsPerRing = 0;
maxHitRingDistance = 0;
maxChi2PerDofForRing = 0;
halfRingSumMask = 0;
int i;
for (i=0; i<2; i++)
deltaThetaCorrection[i] = 0;
for (i=0; i<10; i++) {
segmentFocalLength[i] = 0;
segmentFocalLengthCorrection[i] = 0;
}
segmentFocalLengthCorrectionOffset = 0;
useVariableFocalLength = False;
phiOffset = 0;
clusterMaxSat = 0; // cluster related cut variables
clusterMaxPads = 0;
clusterMinPads = 0;
clusterMaxSat2 = 0;
clusterMaxSatPads = 0;
clusterMinSmallSize = 0;
clusterBigClusterWidth = 0;
clusterSatTrackMaxWidth = 0;
clusterBigClusterMaxPads = 0;
clusterSatTrackMaxSatPads = 0;
clusterMaxPadsAboveThreshold = 0;
clusterMeanAmp = 0;
clusterMaxLoad = 0;
clusterMinRms2 = 0;
clusterMaxRatio = 0;
clusterMaxOccup = 0;
clusterMaxLoad2 = 0;
clusterSatPadAmp = 0;
clusterMaxRmsSize = 0;
clusterPadLineRms2 = 0;
clusterSatPadRatio = 0;
clusterLowThreshold = 0;
clusterHighThreshold = 0;
deltaPhiFactor = 0;
radiusFactor1 = 0;
radiusFactor2 = 0;
mcRingSigma = 0;
}
void CRichSetup::read(const char* filename)
{
CSetup::_read(filename);
CDetectorSetup::_read(filename);
CRichLikeSetup::_read(filename);
_read(filename);
}
void CRichSetup::_read(const char* filename)
{
nSpokes = CGetDefaultValue(filename, "nSpokes", nSpokes);
nMirrorSegments = CGetDefaultValue(filename, "nMirrorSegments", nMirrorSegments);
mirrorSegmentOffset = CGetDefaultValue(filename, "mirrorSegmentOffset", mirrorSegmentOffset);
spokeWidth = CGetDefaultValue(filename, "spokeWidth", spokeWidth);
firstSpokeAngle = CGetDefaultValue(filename, "firstSpokeAngle", firstSpokeAngle);
focalLength = CGetDefaultValue(filename, "focalLength", focalLength);
fudgeFocalLength = CGetDefaultValue(filename, "fudgeFocalLength", fudgeFocalLength);
detectorDistance = CGetDefaultValue(filename, "detectorDistance", detectorDistance);
mirrorDistance = CGetDefaultValue(filename, "mirrorDistance", mirrorDistance);
gammaThreshold = CGetDefaultValue(filename, "gammaThreshold", gammaThreshold);
radiatorLength = CGetDefaultValue(filename, "radiatorLength", radiatorLength);
asymptoticRadius = CGetDefaultValue(filename, "asymptoticRadius", asymptoticRadius);
houghMinAmp = CGetDefaultValue(filename, "houghMinAmp", houghMinAmp);
houghMinFitHit = CGetDefaultValue(filename, "houghMinFitHit", houghMinFitHit);
houghMaxFitDis = CGetDefaultValue(filename, "houghMaxFitDis", houghMaxFitDis);
houghChernovWidth = CGetDefaultValue(filename, "houghChernovWidth", houghChernovWidth);
houghMinDistance = CGetDefaultValue(filename, "houghMinDistance", houghMinDistance);
houghMaxDeltaRadius = CGetDefaultValue(filename, "houghMaxDeltaRadius", houghMaxDeltaRadius);
minHitsPerRing = CGetDefaultValue(filename, "minHitsPerRing", minHitsPerRing);
maxHitRingDistance = CGetDefaultValue(filename, "maxHitRingDistance", maxHitRingDistance);
maxChi2PerDofForRing = CGetDefaultValue(filename, "maxChi2PerDofForRing", maxChi2PerDofForRing);
halfRingSumMask = CGetDefaultValue(filename, "halfRingSumMask", halfRingSumMask);
CGetDefaultValue(filename, "deltaThetaCorrection", deltaThetaCorrection, 2);
CGetDefaultValue(filename, "segmentFocalLength", segmentFocalLength, 10);
CGetDefaultValue(filename, "segmentFocalLengthCorrection", segmentFocalLengthCorrection, 10);
segmentFocalLengthCorrectionOffset = CGetDefaultValue(filename, "segmentFocalLengthCorrectionOffset",
segmentFocalLengthCorrectionOffset);
useVariableFocalLength = CGetDefaultValue(filename, "useVariableFocalLength", useVariableFocalLength);
phiOffset = CGetDefaultValue(filename, "phiOffset", phiOffset);
clusterMaxSat = CGetDefaultValue(filename, "clusterMaxSat", clusterMaxSat);
clusterMaxPads = CGetDefaultValue(filename, "clusterMaxPads", clusterMaxPads);
clusterMinPads = CGetDefaultValue(filename, "clusterMinPads", clusterMinPads);
clusterMaxSat2 = CGetDefaultValue(filename, "clusterMaxSat2", clusterMaxSat2);
clusterMaxSatPads = CGetDefaultValue(filename, "clusterMaxSatPads", clusterMaxSatPads);
clusterMinSmallSize = CGetDefaultValue(filename, "clusterMinSmallSize", clusterMinSmallSize);
clusterBigClusterWidth = CGetDefaultValue(filename, "clusterBigClusterWidth", clusterBigClusterWidth);
clusterSatTrackMaxWidth = CGetDefaultValue(filename, "clusterSatTrackMaxWidth", clusterSatTrackMaxWidth);
clusterBigClusterMaxPads = CGetDefaultValue(filename, "clusterBigClusterMaxPads", clusterBigClusterMaxPads);
clusterSatTrackMaxSatPads = CGetDefaultValue(filename, "clusterSatTrackMaxSatPads", clusterSatTrackMaxSatPads);
clusterMaxPadsAboveThreshold = CGetDefaultValue(filename, "clusterMaxPadsAboveThreshold", clusterMaxPadsAboveThreshold);
clusterMeanAmp = CGetDefaultValue(filename, "clusterMeanAmp", clusterMeanAmp);
clusterMaxLoad = CGetDefaultValue(filename, "clusterMaxLoad", clusterMaxLoad);
clusterMinRms2 = CGetDefaultValue(filename, "clusterMinRms2", clusterMinRms2);
clusterMaxRatio = CGetDefaultValue(filename, "clusterMaxRatio", clusterMaxRatio);
clusterMaxOccup = CGetDefaultValue(filename, "clusterMaxOccup", clusterMaxOccup);
clusterMaxLoad2 = CGetDefaultValue(filename, "clusterMaxLoad2", clusterMaxLoad2);
clusterSatPadAmp = CGetDefaultValue(filename, "clusterSatPadAmp", clusterSatPadAmp);
clusterMaxRmsSize = CGetDefaultValue(filename, "clusterMaxRmsSize", clusterMaxRmsSize);
clusterPadLineRms2 = CGetDefaultValue(filename, "clusterPadLineRms2", clusterPadLineRms2);
clusterSatPadRatio = CGetDefaultValue(filename, "clusterSatPadRatio", clusterSatPadRatio);
clusterLowThreshold = CGetDefaultValue(filename, "clusterLowThreshold", clusterLowThreshold);
clusterHighThreshold = CGetDefaultValue(filename, "clusterHighThreshold", clusterHighThreshold);
deltaPhiFactor = CGetDefaultValue(filename, "deltaPhiFactor", deltaPhiFactor);
radiusFactor1 = CGetDefaultValue(filename, "radiusFactor1", radiusFactor1);
radiusFactor2 = CGetDefaultValue(filename, "radiusFactor2", radiusFactor2);
mcRingSigma = CGetDefaultValue(filename, "mcRingSigma", mcRingSigma);
}
void CRichSetup::list(ostream& ost)
{
CSetup::_list(ost);
CDetectorSetup::_list(ost);
CRichLikeSetup::_list(ost);
_list(ost);
}
void CRichSetup::_list(ostream& ost)
{
ost.setf(ios::left);
ost << setw(ListingNameWidth) << "nSpokes: " << nSpokes << endl;
ost << setw(ListingNameWidth) << "spokeWidth: " << spokeWidth << endl;
ost << setw(ListingNameWidth) << "firstSpokeAngle: " << firstSpokeAngle << endl;
ost << setw(ListingNameWidth) << "nMirrorSegments: " << nMirrorSegments << endl;
ost << setw(ListingNameWidth) << "mirrorSegmentOffset: " << mirrorSegmentOffset << endl;
ost << setw(ListingNameWidth) << "focalLength: " << focalLength << endl;
ost << setw(ListingNameWidth) << "fudgeFocalLength: " << fudgeFocalLength << endl;
ost << setw(ListingNameWidth) << "detectorDistance: " << detectorDistance << endl;
ost << setw(ListingNameWidth) << "mirrorDistance: " << mirrorDistance << endl;
ost << setw(ListingNameWidth) << "gammaThreshold: " << gammaThreshold << endl;
ost << setw(ListingNameWidth) << "radiatorLength: " << radiatorLength << endl;
ost << setw(ListingNameWidth) << "asymptoticRadius: " << asymptoticRadius << endl;
ost << setw(ListingNameWidth) << "houghMinAmp: " << houghMinAmp << endl;
ost << setw(ListingNameWidth) << "houghMinFitHit: " << houghMinFitHit << endl;
ost << setw(ListingNameWidth) << "houghMaxFitDis: " << houghMaxFitDis << endl;
ost << setw(ListingNameWidth) << "houghChernovWidth: " << houghChernovWidth << endl;
ost << setw(ListingNameWidth) << "houghMinDistance: " << houghMinDistance << endl;
ost << setw(ListingNameWidth) << "houghMaxDeltaRadius: " << houghMaxDeltaRadius << endl;
ost << setw(ListingNameWidth) << "minHitsPerRing: " << minHitsPerRing << endl;
ost << setw(ListingNameWidth) << "maxHitRingDistance: " << maxHitRingDistance << endl;
ost << setw(ListingNameWidth) << "maxChi2PerDofForRing: " << maxChi2PerDofForRing << endl;
ost << setw(ListingNameWidth) << "halfRingSumMask: " << halfRingSumMask << endl;
ost << setw(ListingNameWidth) << "deltaThetaCorrection:";
int i;
for (i = 0; i<2; i++)
ost << deltaThetaCorrection[i] << ' ';
ost << endl;
ost << setw(ListingNameWidth) << "phiOffset: " << phiOffset << endl;
ost << setw(ListingNameWidth) << "clusterMaxSat: " << clusterMaxSat << endl;
ost << setw(ListingNameWidth) << "clusterMaxPads: " << clusterMaxPads << endl;
ost << setw(ListingNameWidth) << "clusterMinPads: " << clusterMinPads << endl;
ost << setw(ListingNameWidth) << "clusterMaxSat2: " << clusterMaxSat2 << endl;
ost << setw(ListingNameWidth) << "clusterMaxSatPads: " << clusterMaxSatPads << endl;
ost << setw(ListingNameWidth) << "clusterMinSmallSize: " << clusterMinSmallSize << endl;
ost << setw(ListingNameWidth) << "clusterBigClusterWidth: " << clusterBigClusterWidth << endl;
ost << setw(ListingNameWidth) << "clusterSatTrackMaxWidth: " << clusterSatTrackMaxWidth << endl;
ost << setw(ListingNameWidth) << "clusterBigClusterMaxPads: " << clusterBigClusterMaxPads << endl;
ost << setw(ListingNameWidth) << "clusterSatTrackMaxSatPads: " << clusterSatTrackMaxSatPads << endl;
ost << setw(ListingNameWidth) << "clusterMaxPadsAboveThreshold" << clusterMaxPadsAboveThreshold << endl;
ost << setw(ListingNameWidth) << "clusterMeanAmp: " << clusterMeanAmp << endl;
ost << setw(ListingNameWidth) << "clusterMaxLoad: " << clusterMaxLoad << endl;
ost << setw(ListingNameWidth) << "clusterMinRms2: " << clusterMinRms2 << endl;
ost << setw(ListingNameWidth) << "clusterMaxRatio: " << clusterMaxRatio << endl;
ost << setw(ListingNameWidth) << "clusterMaxOccup: " << clusterMaxOccup << endl;
ost << setw(ListingNameWidth) << "clusterMaxLoad2: " << clusterMaxLoad2 << endl;
ost << setw(ListingNameWidth) << "clusterSatPadAmp: " << clusterSatPadAmp << endl;
ost << setw(ListingNameWidth) << "clusterMaxRmsSize: " << clusterMaxRmsSize << endl;
ost << setw(ListingNameWidth) << "clusterPadLineRms2: " << clusterPadLineRms2 << endl;
ost << setw(ListingNameWidth) << "clusterSatPadRatio: " << clusterSatPadRatio << endl;
ost << setw(ListingNameWidth) << "clusterLowThreshold: " << clusterLowThreshold << endl;
ost << setw(ListingNameWidth) << "clusterHighThreshold: " << clusterHighThreshold << endl;
ost << setw(ListingNameWidth) << "deltaPhiFactor: " << deltaPhiFactor << endl;
ost << setw(ListingNameWidth) << "radiusFactor1: " << radiusFactor1 << endl;
ost << setw(ListingNameWidth) << "radiusFactor2: " << radiusFactor2 << endl;
ost << setw(ListingNameWidth) << "mcRingSigma: " << mcRingSigma << endl;
for (i = 0; i<10; i++) {
ost << setw(ListingNameWidth) << "segmentFocalLength(" << i << ") : ";
ost << segmentFocalLength[i] << ' ';
ost << setw(ListingNameWidth) << "correction: ";
ost << segmentFocalLengthCorrection[i] << ' ';
ost << endl;
}
ost << setw(ListingNameWidth) << "segmentFocalLengthCorrectionOffset: "
<< segmentFocalLengthCorrectionOffset
<< endl;
ost << setw(ListingNameWidth) << "useVariableFocalLength: "
<< useVariableFocalLength
<< endl;
ost.unsetf(ios::left);
}
CBoolean CRichSetup::setSegmentFocalLength(int mirrorSegment, double focalLengthIn)
{
if ( mirrorSegment < 0 || mirrorSegment >= 10 ) return False;
segmentFocalLength[mirrorSegment] = focalLengthIn;
return True;
}
CBoolean CRichSetup::setSegmentFocalLengthCorrection(int mirrorSegment, double focalLengthCorrection )
{
if ( mirrorSegment < 0 || mirrorSegment >= 10 ) return False;
segmentFocalLengthCorrection[mirrorSegment] = focalLengthCorrection;
return True;
}