CTrackingSetup.C
//-----------------------------------------------------------------------------
// $Header: /asis/offline/ceres/cool/project/RCS/CTrackingSetup.C,v 3.4 1997/07/23 13:15:11 messer Exp $
//
// COOL Program Library
// Copyright (C) CERES collaboration, 1996
//
// Implementation of class CTrackingSetup.
//
//-----------------------------------------------------------------------------
#include "CTrackingSetup.h"
#include <iomanip.h>
CTrackingSetup::CTrackingSetup()
{
fieldFlag = True;
ptCut = 0.;
rich1CenterResolution = 0;
rich2CenterResolution = 0;
sidcTrackResolution = 0;
padcHitResolution = 0;
multipleScattering = 0;
butterflySigmas = 0;
int i;
for (i=0; i<3; i++)
phiDeflectionParameters[i] = 0;
for (i=0; i<3; i++)
fieldEffectParameters[i] = 0;
numberOfRuns = 0;
defaultFieldInPercent = 0;
runsWithDifferentField = 0;
fieldInPercent = 0;
maxDeltaXYRichPadc = 0;
phiMatchWindowRichSidc = 0;
thetaMatchWindowRichSidc = 0;
radiusMatchWindowSidc12 = 0;
phiMatchWindowSidc12 = 0;
phiMatchFactorSidc12 = 0;
//
// for pion analysis
//
vectorSize = 0;
radiusFactor = 0.;
phiWindow = 0.;
thetaWindow = 0.;
cutRelRadius1= 0.;
cutRelRadius2= 0.;
relRadiusAllowedDifference = 0.;
rich1AsymptoticRadius = 0.;
rich2AsymptoticRadius = 0.;
waitedPhiWindow = 0.;
pCFensterMatch = 0.;
minHits = 0;
rich1RotationAngle = 0.;
rich2RotationAngle = 0.;
padChamberRotationAngle = 0.;
//
// for photon analysis
//
minDeDxSidc2 = 0;
//
// for candidate filtering
//
houghMaxDeltaXYRich1Sidc = 0;
houghMaxDeltaXYRich2Padc = 0;
}
void CTrackingSetup::read(const char* filename)
{
CSetup::_read(filename);
_read(filename);
}
void CTrackingSetup::list(ostream& ost)
{
CSetup::_list(ost);
_list(ost);
}
void CTrackingSetup::_read(const char* filename)
{
fieldFlag = CGetDefaultValue(filename, "fieldFlag", fieldFlag);
ptCut = CGetDefaultValue(filename, "ptCut", ptCut);
rich1CenterResolution = CGetDefaultValue(filename, "rich1CenterResolution", rich1CenterResolution);
rich2CenterResolution = CGetDefaultValue(filename, "rich2CenterResolution", rich2CenterResolution);
sidcTrackResolution = CGetDefaultValue(filename, "sidcTrackResolution", sidcTrackResolution);
padcHitResolution = CGetDefaultValue(filename, "padcHitResolution", padcHitResolution);
multipleScattering = CGetDefaultValue(filename, "multipleScattering", multipleScattering);
butterflySigmas = CGetDefaultValue(filename, "butterflySigmas", butterflySigmas);
maxDeltaXYRichPadc = CGetDefaultValue(filename, "maxDeltaXYRichPadc", maxDeltaXYRichPadc);
phiMatchWindowRichSidc = CGetDefaultValue(filename, "phiMatchWindowRichSidc", phiMatchWindowRichSidc);
thetaMatchWindowRichSidc = CGetDefaultValue(filename, "thetaMatchWindowRichSidc", thetaMatchWindowRichSidc);
radiusMatchWindowSidc12 = CGetDefaultValue(filename, "radiusMatchWindowSidc12", radiusMatchWindowSidc12);
phiMatchWindowSidc12 = CGetDefaultValue(filename, "phiMatchWindowSidc12", phiMatchWindowSidc12);
phiMatchFactorSidc12 = CGetDefaultValue(filename, "phiMatchFactorSidc12", phiMatchFactorSidc12);
CGetDefaultValue(filename, "phiDeflectionParameters", phiDeflectionParameters, 3);
CGetDefaultValue(filename, "fieldEffectParameters", fieldEffectParameters, 3);
//
// variables for run-dependent field settings
//
defaultFieldInPercent = CGetDefaultValue(filename, "defaultFieldInPercent", defaultFieldInPercent);
numberOfRuns = CGetDefaultValue(filename, "numberOfRuns", numberOfRuns);
if (numberOfRuns > 0) {
delete runsWithDifferentField;
runsWithDifferentField = new int[numberOfRuns];
CGetDefaultValue(filename, "runsWithDifferentField", runsWithDifferentField, numberOfRuns);
delete fieldInPercent;
fieldInPercent = new int[numberOfRuns];
CGetDefaultValue(filename, "fieldInPercent", fieldInPercent, numberOfRuns);
}
//
// for pion analysis
//
minHits = CGetDefaultValue(filename, "minHits", minHits);
vectorSize = CGetDefaultValue(filename, "vectorSize", vectorSize);
radiusFactor = CGetDefaultValue(filename, "radiusFactor", radiusFactor);
phiWindow = CGetDefaultValue(filename, "phiWindow", phiWindow);
thetaWindow = CGetDefaultValue(filename, "thetaWindow", thetaWindow);
cutRelRadius1 = CGetDefaultValue(filename, "cutRelRadius1", cutRelRadius1);
cutRelRadius2 = CGetDefaultValue(filename, "cutRelRadius2", cutRelRadius2);
relRadiusAllowedDifference = CGetDefaultValue(filename, "relRadiusAllowedDifference", relRadiusAllowedDifference);
rich1AsymptoticRadius = CGetDefaultValue(filename, "rich1AsymptoticRadius", rich1AsymptoticRadius);
rich2AsymptoticRadius = CGetDefaultValue(filename, "rich2AsymptoticRadius", rich2AsymptoticRadius);
waitedPhiWindow = CGetDefaultValue(filename, "waitedPhiWindow", waitedPhiWindow);
pCFensterMatch= CGetDefaultValue(filename, "pCFensterMatch", pCFensterMatch);
rich1RotationAngle= CGetDefaultValue(filename, "rich1RotationAngle", rich1RotationAngle);
rich2RotationAngle= CGetDefaultValue(filename, "rich2RotationAngle", rich2RotationAngle);
padChamberRotationAngle= CGetDefaultValue(filename, "padChamberRotationAngle", padChamberRotationAngle);
//
// for photon analysis
//
minDeDxSidc2 = CGetDefaultValue(filename, "minDeDxSidc2", minDeDxSidc2);
//
// for candidate filtering
//
houghMaxDeltaXYRich1Sidc = CGetDefaultValue(filename, "houghMaxDeltaXYRich1Sidc", houghMaxDeltaXYRich1Sidc);
houghMaxDeltaXYRich2Padc = CGetDefaultValue(filename, "houghMaxDeltaXYRich2Padc", houghMaxDeltaXYRich2Padc);
}
void CTrackingSetup::_list(ostream& ost)
{
ost.setf(ios::left);
ost << setw(ListingNameWidth) << "fieldFlag:" << dec << fieldFlag << endl;
ost << setw(ListingNameWidth) << "ptCut:" << dec << ptCut << endl;
ost << setw(ListingNameWidth) << "sidcTrackResolution:" << dec << sidcTrackResolution << endl;
ost << setw(ListingNameWidth) << "padcHitResolution:" << dec << padcHitResolution << endl;
ost << setw(ListingNameWidth) << "rich1CenterResolution:" << dec << rich1CenterResolution << endl;
ost << setw(ListingNameWidth) << "rich2CenterResolution:" << dec << rich2CenterResolution << endl;
ost << setw(ListingNameWidth) << "multipleScattering:" << dec << multipleScattering << endl;
ost << setw(ListingNameWidth) << "butterflySigmas:" << dec << butterflySigmas << endl;
ost << setw(ListingNameWidth) << "phiDeflectionParameters:";
int i;
for (i = 0; i<3; i++)
ost << phiDeflectionParameters[i] << ' ';
ost << endl;
ost << setw(ListingNameWidth) << "fieldEffectParameters:";
for (i = 0; i<3; i++)
ost << fieldEffectParameters[i] << ' ';
ost << endl;
//
// variables for run-dependent field settings
//
ost << setw(ListingNameWidth) << "defaultFieldInPercent:" << dec << defaultFieldInPercent << endl;
ost << setw(ListingNameWidth) << "numberOfRuns:" << dec << numberOfRuns << endl;
if (numberOfRuns > 0) {
ost << setw(ListingNameWidth) << "runsWithDifferentField:";
int i;
for (i = 0; i<numberOfRuns; i++)
ost << runsWithDifferentField[i] << ' ';
ost << endl;
ost << setw(ListingNameWidth) << "fieldInPercent:";
for (i = 0; i<numberOfRuns; i++)
ost << fieldInPercent[i] << ' ';
ost << endl;
}
ost << setw(ListingNameWidth) << "maxDeltaXYRichPadc:" << dec << maxDeltaXYRichPadc << endl;
ost << setw(ListingNameWidth) << "phiMatchWindowRichSidc:" << dec << phiMatchWindowRichSidc << endl;
ost << setw(ListingNameWidth) << "thetaMatchWindowRichSidc:" << dec << thetaMatchWindowRichSidc << endl;
ost << setw(ListingNameWidth) << "radiusMatchWindowSidc12:" << dec << radiusMatchWindowSidc12 << endl;
ost << setw(ListingNameWidth) << "phiMatchWindowSidc12:" << dec << phiMatchWindowSidc12 << endl;
ost << setw(ListingNameWidth) << "phiMatchFactorSidc12:" << dec << phiMatchFactorSidc12 << endl;
//
// for pion analysis
//
ost << setw(ListingNameWidth) << "minHits:" << dec << minHits << endl;
ost << setw(ListingNameWidth) << "vectorSize:" << dec << vectorSize << endl;
ost << setw(ListingNameWidth) << "radiusFactor:" << dec << radiusFactor << endl;
ost << setw(ListingNameWidth) << "phiWindow:" << dec << phiWindow << endl;
ost << setw(ListingNameWidth) << "thetaWindow:" << dec << thetaWindow << endl;
ost << setw(ListingNameWidth) << "cutRelRadius1:" << dec << cutRelRadius1 << endl;
ost << setw(ListingNameWidth) << "cutRelRadius2:" << dec << cutRelRadius2 << endl;
ost << setw(ListingNameWidth) << "relRadiusAllowedDifference:" << dec << relRadiusAllowedDifference << endl;
ost << setw(ListingNameWidth) << "rich1AsymptoticRadius:" << dec << rich1AsymptoticRadius << endl;
ost << setw(ListingNameWidth) << "rich2AsymptoticRadius:" << dec << rich2AsymptoticRadius << endl;
ost << setw(ListingNameWidth) << "waitedPhiWindow:" << dec << waitedPhiWindow << endl;
ost << setw(ListingNameWidth) << "pCFensterMatch:" << dec << pCFensterMatch << endl;
ost << setw(ListingNameWidth) << "rich1RotationAngle:" << dec << rich1RotationAngle << endl;
ost << setw(ListingNameWidth) << "rich2RotationAngle:" << dec << rich2RotationAngle << endl;
ost << setw(ListingNameWidth) << "padChamberRotationAngle:" << dec << padChamberRotationAngle << endl;
//
// for photon analysis
//
ost << setw(ListingNameWidth) << "minDeDxSidc2:" << dec << minDeDxSidc2 << endl;
//
// for candidate filtering
//
ost << setw(ListingNameWidth) << "houghMaxDeltaXYRich1Sidc: " << houghMaxDeltaXYRich1Sidc << endl;
ost << setw(ListingNameWidth) << "houghMaxDeltaXYRich2Padc: " << houghMaxDeltaXYRich2Padc << endl;
ost.unsetf(ios::left);
}