Skip to content

Commit

Permalink
Merge pull request #216 from JeffersonLab/tofcalchange
Browse files Browse the repository at this point in the history
fix minor bug that calculated the average speed of ligth for the single
  • Loading branch information
s6pepaul authored Oct 13, 2023
2 parents 8cc188f + 2238f19 commit 677b6bd
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions TOF_calib/src/consolidate.C
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ void consolidate(int RunNumber){
Scnt++;
}
}
double Mspeed0 = SSum/(double)Scnt;
cout<<"Mean propagation speed plane 0 is: "<<Mspeed0<<endl;
SSum = 0.;
Scnt = 0;

INF.close();
sprintf(fnam,"calibration%d/tof_speeds_plane1_run%d.dat",RunNumber,RunNumber);
cout<<"open file: "<<fnam<<endl;
Expand All @@ -185,13 +190,13 @@ void consolidate(int RunNumber){
for (int k=0;k<BARS_PER_PLANE;k++){
INF>>dum1>>Speeds[k+BARS_PER_PLANE]>>dum2;
if (TMath::Abs(Speeds[k+BARS_PER_PLANE]-15.5)<2.){
SSum += Speeds[k];
SSum += Speeds[k+BARS_PER_PLANE];
Scnt++;
}
}
INF.close();
double Mspeed = SSum/(double)Scnt;
cout<<"Mean propagation speed is: "<<Mspeed<<endl;
double Mspeed1 = SSum/(double)Scnt;
cout<<"Mean propagation speed plane 1 is: "<<Mspeed1<<endl;

sprintf(outf,"calibration%d/tofpaddles_propagation_speed_run%d.DB",RunNumber,RunNumber);
OUTF.open(outf);
Expand All @@ -202,7 +207,10 @@ void consolidate(int RunNumber){
(TMath::Abs(k+1 - BARS_PER_PLANE - BARS_PER_PLANE/2 - 0.5)<(double)NSHORTS/4.)) {
// for the single ended paddles use the mean propagation speed of
// all the other paddles.
Speeds[k] = Mspeed;
Speeds[k] = Mspeed0;
if (k>44){
Speeds[k] = Mspeed1;
}
}
OUTF<<Speeds[k]<<endl;
}
Expand Down

0 comments on commit 677b6bd

Please sign in to comment.