some more minor bug fixing leading towards ADDRUN

This commit is contained in:
nemu 2009-03-13 10:26:12 +00:00
parent 3eaa9e433f
commit 9f3fb85928
4 changed files with 28 additions and 30 deletions

View File

@ -371,7 +371,7 @@ bool PRunAsymmetry::PrepareData()
// get T0's of the to be added run
int t0Add[2] = {0, 0};
// check if the t0's are given in the msr-file
if (fRunInfo->fT0[0] == -1) { // t0's are NOT in the msr-file
if (i >= fRunInfo->fT0.size()) { // t0's are NOT in the msr-file
// check if the t0's are in the data file
if (addRunData->fT0s.size() != 0) { // t0's in the run data
// keep the proper t0's. For asymmetry runs, forward/backward are holding the histo no
@ -384,25 +384,6 @@ bool PRunAsymmetry::PrepareData()
}
} else { // t0's in the msr-file
// check if t0's are given in the data file
if (addRunData->fT0s.size() != 0) {
// compare t0's of the msr-file with the one in the data file
if (fabs(t0Add[0]-addRunData->fT0s[fRunInfo->fForwardHistoNo-1])>5.0) { // given in bins!!
cout << endl << "PRunAsymmetry::PrepareData(): **WARNING**: forward histo";
cout << endl << " t0 from the msr-file is " << fRunInfo->fT0[0];
cout << endl << " t0 from the data file is " << addRunData->fT0s[fRunInfo->fForwardHistoNo-1];
cout << endl << " This is quite a deviation! Is this done intentionally??";
cout << endl << " addrun: " << fRunInfo->fRunName[i].Data();
cout << endl;
}
if (fabs(t0Add[1]-addRunData->fT0s[fRunInfo->fBackwardHistoNo-1])>5.0) { // given in bins!!
cout << endl << "PRunAsymmetry::PrepareData(): **WARNING**: backward histo";
cout << endl << " t0 from the msr-file is " << fRunInfo->fT0[1];
cout << endl << " t0 from the data file is " << addRunData->fT0s[fRunInfo->fBackwardHistoNo-1];
cout << endl << " This is quite a deviation! Is this done intentionally??";
cout << endl << " addrun: " << fRunInfo->fRunName[i].Data();
cout << endl;
}
}
if (2*i+1 < fRunInfo->fT0.size()) {
t0Add[0] = fRunInfo->fT0[2*i];
t0Add[1] = fRunInfo->fT0[2*i+1];
@ -415,6 +396,25 @@ bool PRunAsymmetry::PrepareData()
t0Add[0] = fRunInfo->fT0[0];
t0Add[1] = fRunInfo->fT0[1];
}
if (addRunData->fT0s.size() != 0) {
// compare t0's of the msr-file with the one in the data file
if (fabs(t0Add[0]-addRunData->fT0s[fRunInfo->fForwardHistoNo-1])>5.0) { // given in bins!!
cout << endl << "PRunAsymmetry::PrepareData(): **WARNING**: forward histo";
cout << endl << " t0 from the msr-file is " << fRunInfo->fT0[2*i];
cout << endl << " t0 from the data file is " << addRunData->fT0s[fRunInfo->fForwardHistoNo-1];
cout << endl << " This is quite a deviation! Is this done intentionally??";
cout << endl << " addrun: " << fRunInfo->fRunName[i].Data();
cout << endl;
}
if (fabs(t0Add[1]-addRunData->fT0s[fRunInfo->fBackwardHistoNo-1])>5.0) { // given in bins!!
cout << endl << "PRunAsymmetry::PrepareData(): **WARNING**: backward histo";
cout << endl << " t0 from the msr-file is " << fRunInfo->fT0[2*i+1];
cout << endl << " t0 from the data file is " << addRunData->fT0s[fRunInfo->fBackwardHistoNo-1];
cout << endl << " This is quite a deviation! Is this done intentionally??";
cout << endl << " addrun: " << fRunInfo->fRunName[i].Data();
cout << endl;
}
}
}
// add forward run

View File

@ -494,8 +494,6 @@ bool PRunDataHandler::ReadNexusFile()
*/
bool PRunDataHandler::ReadWkmFile()
{
// cout << endl << "PRunDataHandler::ReadWkmFile(): Sorry, not yet implemented ...";
PDoubleVector histoData;
PRawRunData runData;
@ -511,7 +509,7 @@ bool PRunDataHandler::ReadWkmFile()
// open file
ifstream f;
// open dump-file
// open wkm-file
f.open(fRunPathName.Data(), ifstream::in);
if (!f.is_open()) {
cout << endl << "Couldn't open run data (" << fRunPathName.Data() << ") file for reading, sorry ...";

View File

@ -379,7 +379,7 @@ bool PRunSingleHisto::PrepareData()
// get T0's of the to be added run
int t0Add;
// check if the t0's are given in the msr-file
if (fRunInfo->fT0[i] == -1) { // t0's are NOT in the msr-file
if (i >= fRunInfo->fT0.size()) { // t0's are NOT in the msr-file
// check if the t0's are in the data file
if (addRunData->fT0s.size() != 0) { // t0's in the run data
// keep the proper t0's. For single histo runs, forward is holding the histo no

View File

@ -41,20 +41,20 @@ void skewedGaussian()
FILE *fp;
char fln[256];
const Double_t w = 1.0; // weight of the skewed Gaussian
const Double_t B0 = 2500.0; // skewed Gaussian B0 (G)
const Double_t w = 0.8; // weight of the skewed Gaussian
const Double_t B0 = 130.0; // skewed Gaussian B0 (G)
const Double_t sm = 4.5; // skewed Gaussian sigma- (G)
const Double_t sp = 4.5; // skewed Gaussian sigma+ (G)
const Double_t B0ext = 110.0; // external field Gaussian B0 (G)
const Double_t B0ext = 30.0; // external field Gaussian B0 (G)
const Double_t sext = 1.2; // external field Gaussian sigma (G)
sprintf(fln, "skewedGauss-B%0.2lf-sm%0.2lf-sp%0.2lf-w%0.1lf-Bext%0.2lf-sext%0.2lf.dat",
B0, sm, sp, w, B0ext, sext);
const Int_t noOfPoints = 1000;
const Int_t noOfPoints = 2000;
const Double_t res = 10.0*(sp+sm)/(Double_t)noOfPoints;
const Double_t res = 0.1;
fp = fopen(fln, "w");
@ -65,7 +65,7 @@ void skewedGaussian()
fprintf(fp, "# B, pB\n");
Double_t b, pb;
for (Int_t i=0; i<noOfPoints; i++) {
b = B0-10.0*sm + res * i;
b = res * i;
pb = w*PofB(b, B0, sm, sp) + (1.0-w)*PofBext(b, B0ext, sext);
fprintf(fp, "%lf, %lf\n", b, pb);
}