19 |
// For PMTs 4,8,39,41 (counting 0..47) no charge was calculated |
// For PMTs 4,8,39,41 (counting 0..47) no charge was calculated |
20 |
// calibration arrays now including correct brackets to avoid |
// calibration arrays now including correct brackets to avoid |
21 |
// compiler warnings |
// compiler warnings |
22 |
|
//06-aug-2009: charge_layer_trk_raw and charge_layer_std_raw |
23 |
|
// added: These are the "raw" values before doing the 2nd-order |
24 |
|
// correction |
25 |
//***************************************************** |
//***************************************************** |
26 |
#include <ToFNuclei.h> |
#include <ToFNuclei.h> |
27 |
|
|
54 |
|
|
55 |
void ToFNuclei::Clear(){ |
void ToFNuclei::Clear(){ |
56 |
// |
// |
57 |
ncount_trk = 0.; |
ncount_trk = 0; |
58 |
charge_trk = 0.; |
charge_trk = 0.; |
59 |
memset (charge_layer_trk,0,6*sizeof(Float_t)); // |
memset (charge_layer_trk,0,6*sizeof(Float_t)); // |
60 |
|
memset (charge_layer_trk_raw,0,6*sizeof(Float_t)); // |
61 |
memset (charge_PMT_trk,0,48*sizeof(Float_t)); // |
memset (charge_PMT_trk,0,48*sizeof(Float_t)); // |
62 |
memset (layerinfo_trk,0,6*sizeof(Int_t)); // |
memset (layerinfo_trk,0,6*sizeof(Int_t)); // |
63 |
ncount_std = 0.; |
ncount_std = 0; |
64 |
charge_std = 0.; |
charge_std = 0.; |
65 |
memset (charge_layer_std,0,6*sizeof(Float_t)); // |
memset (charge_layer_std,0,6*sizeof(Float_t)); // |
66 |
|
memset (charge_layer_std_raw,0,6*sizeof(Float_t)); // |
67 |
memset (charge_PMT_std,0,48*sizeof(Float_t)); // |
memset (charge_PMT_std,0,48*sizeof(Float_t)); // |
68 |
memset (layerinfo_std,0,6*sizeof(Int_t)); // |
memset (layerinfo_std,0,6*sizeof(Int_t)); // |
69 |
}; |
}; |
401 |
|
|
402 |
Int_t Layerinfo[6] = {0, 0, 0, 0, 0, 0 }; |
Int_t Layerinfo[6] = {0, 0, 0, 0, 0, 0 }; |
403 |
|
|
404 |
Float_t adc[48],adc_c[48],PMTcharge_arr[48]; |
//Float_t adc[48],adc_c[48],PMTcharge_arr[48]; |
405 |
|
Float_t adc[48],PMTcharge_arr[48]; |
406 |
|
|
407 |
//------------------------------------------------------------------ |
//------------------------------------------------------------------ |
408 |
|
|
413 |
// New!! If "beta_in" != 100. then overwrite beta_mean with beta_in |
// New!! If "beta_in" != 100. then overwrite beta_mean with beta_in |
414 |
if (beta_in != 100.) beta_mean=beta_in; |
if (beta_in != 100.) beta_mean=beta_in; |
415 |
|
|
416 |
Float_t def = track->GetTrkTrack()->al[4]; |
//Float_t def = track->GetTrkTrack()->al[4]; |
417 |
Float_t rig = 1./def; |
//Float_t rig = 1./def; |
418 |
|
|
419 |
Int_t ncount=0; |
Int_t ncount=0; |
420 |
Float_t charge_chi=1000.; |
Float_t charge_chi=1000.; |
428 |
Int_t ich,jj,kk; |
Int_t ich,jj,kk; |
429 |
|
|
430 |
for (ich=0; ich<48; ich++) adc[ich] = 4095.; |
for (ich=0; ich<48; ich++) adc[ich] = 4095.; |
431 |
for (ich=0; ich<48; ich++) adc_c[ich] = 1000.; |
// for (ich=0; ich<48; ich++) adc_c[ich] = 1000.; |
432 |
for (ich=0; ich<48; ich++) PMTcharge_arr[ich] = 1000.; |
for (ich=0; ich<48; ich++) PMTcharge_arr[ich] = 1000.; |
433 |
|
|
434 |
|
|
436 |
if ((beta_mean < 0.05) || (beta_mean > 2.0)) { |
if ((beta_mean < 0.05) || (beta_mean > 2.0)) { |
437 |
for (Int_t jj=0; jj<48;jj++) charge_PMT_trk[jj] = 1001.; |
for (Int_t jj=0; jj<48;jj++) charge_PMT_trk[jj] = 1001.; |
438 |
for (Int_t jj=0; jj<6;jj++) charge_layer_trk[jj] = 1001.; |
for (Int_t jj=0; jj<6;jj++) charge_layer_trk[jj] = 1001.; |
439 |
for (Int_t jj=0; jj<6;jj++) layerinfo_trk[jj] = 1001.; |
for (Int_t jj=0; jj<6;jj++) charge_layer_trk_raw[jj] = 1001.; |
440 |
|
for (Int_t jj=0; jj<6;jj++) layerinfo_trk[jj] = 1001; |
441 |
charge_trk = 1001.; |
charge_trk = 1001.; |
442 |
ncount_trk = 0; |
ncount_trk = 0; |
443 |
} |
} |
462 |
Float_t dEdx = track->GetToFTrack()->dedx[ipmt]; |
Float_t dEdx = track->GetToFTrack()->dedx[ipmt]; |
463 |
ym = dEdx*betahelp; |
ym = dEdx*betahelp; |
464 |
Int_t pmtadc = track->GetToFTrack()->pmtadc[ipmt]; |
Int_t pmtadc = track->GetToFTrack()->pmtadc[ipmt]; |
465 |
Int_t adcflag = track->GetToFTrack()->adcflag[ipmt]; |
// Int_t adcflag = track->GetToFTrack()->adcflag[ipmt]; |
466 |
L2->GetToFLevel2()->GetPMTIndex(pmtadc,jj,kk); |
L2->GetToFLevel2()->GetPMTIndex(pmtadc,jj,kk); |
467 |
if (adcflag==0) adc_c[pmtadc] = dEdx; |
// if (adcflag==0) adc_c[pmtadc] = dEdx; |
468 |
|
|
469 |
|
|
470 |
if (adc[pmtadc] == 4095) adc_c[pmtadc] = 0.; |
// if (adc[pmtadc] == 4095) adc_c[pmtadc] = 0.; |
471 |
if (adc[pmtadc] == 4095) PMTcharge_arr[pmtadc] = 0.; |
if (adc[pmtadc] == 4095) PMTcharge_arr[pmtadc] = 0.; |
472 |
|
|
473 |
if ((adc[pmtadc]>PMTsat[pmtadc]) && (adc[pmtadc]<4095)) adc_c[pmtadc] = 1000.; |
// if ((adc[pmtadc]>PMTsat[pmtadc]) && (adc[pmtadc]<4095)) adc_c[pmtadc] = 1000.; |
474 |
|
|
475 |
if (adc[pmtadc] < PMTsat[pmtadc]) { |
if (adc[pmtadc] < PMTsat[pmtadc]) { |
476 |
//---------------------------------------------------------------------------------------- |
//---------------------------------------------------------------------------------------- |
573 |
|
|
574 |
|
|
575 |
//========================================================================== |
//========================================================================== |
576 |
|
//============= Layercharge without 2nd-order correction ================= |
577 |
|
//========================================================================== |
578 |
|
|
579 |
|
for (Int_t jj=0; jj<6;jj++) charge_layer_trk_raw[jj] = Layercharge[jj]; |
580 |
|
|
581 |
|
//========================================================================== |
582 |
//========================= 2nd-order correction ======================= |
//========================= 2nd-order correction ======================= |
583 |
//========================================================================== |
//========================================================================== |
584 |
|
|
596 |
if ((ic>0)&&(ic<=5)) c_corr = c_corr/(1.*ic) ; |
if ((ic>0)&&(ic<=5)) c_corr = c_corr/(1.*ic) ; |
597 |
if (ic>5) c_corr = c_corr/6. ; |
if (ic>5) c_corr = c_corr/6. ; |
598 |
|
|
599 |
|
//cout<<"beta "<<xb<<" layer "<<ii<<" ic "<<ic<<" => "<<c_corr<<endl; |
600 |
|
//cout<<xb<<" "<<ic<<" "<<c_corr<<endl; |
601 |
|
|
602 |
Layercharge[ii] = Layercharge[ii]/c_corr; |
Layercharge[ii] = Layercharge[ii]/c_corr; |
603 |
|
|
604 |
} |
} |
950 |
|
|
951 |
//--------------------------------------------------------------------- |
//--------------------------------------------------------------------- |
952 |
|
|
953 |
Float_t xv[6],yv[6]; |
//Float_t xv[6],yv[6]; |
954 |
Int_t iz; |
Int_t iz; |
955 |
|
|
956 |
Float_t x1[9],y1[9]; |
Float_t x1[9],y1[9]; |
960 |
|
|
961 |
Int_t Layerinfo[6] = {0, 0, 0, 0, 0, 0 }; |
Int_t Layerinfo[6] = {0, 0, 0, 0, 0, 0 }; |
962 |
|
|
963 |
Float_t adc[48],adc_c[48],PMTcharge_arr[48]; |
//Float_t adc[48],adc_c[48],PMTcharge_arr[48]; |
964 |
|
Float_t adc[48],PMTcharge_arr[48]; |
965 |
|
|
966 |
Float_t beta_mean = fabs(track->beta[12]); |
Float_t beta_mean = fabs(track->beta[12]); |
967 |
|
|
979 |
Int_t ich,jj,kk; |
Int_t ich,jj,kk; |
980 |
|
|
981 |
for (ich=0; ich<48; ich++) adc[ich] = 4095.; |
for (ich=0; ich<48; ich++) adc[ich] = 4095.; |
982 |
for (ich=0; ich<48; ich++) adc_c[ich] = 1000.; |
// for (ich=0; ich<48; ich++) adc_c[ich] = 1000.; |
983 |
for (ich=0; ich<48; ich++) PMTcharge_arr[ich] = 1000.; |
for (ich=0; ich<48; ich++) PMTcharge_arr[ich] = 1000.; |
984 |
|
|
985 |
|
|
986 |
if ((beta_mean < 0.05) || (beta_mean > 2.0)) { |
if ((beta_mean < 0.05) || (beta_mean > 2.0)) { |
987 |
for (Int_t jj=0; jj<48;jj++) charge_PMT_std[jj] = 1001.; |
for (Int_t jj=0; jj<48;jj++) charge_PMT_std[jj] = 1001.; |
988 |
for (Int_t jj=0; jj<6;jj++) charge_layer_std[jj] = 1001.; |
for (Int_t jj=0; jj<6;jj++) charge_layer_std[jj] = 1001.; |
989 |
for (Int_t jj=0; jj<6;jj++) layerinfo_std[jj] = 1001.; |
for (Int_t jj=0; jj<6;jj++) charge_layer_std_raw[jj] = 1001.; |
990 |
|
for (Int_t jj=0; jj<6;jj++) layerinfo_std[jj] = 1001; |
991 |
charge_std = 1001.; |
charge_std = 1001.; |
992 |
ncount_std = 0; |
ncount_std = 0; |
993 |
} |
} |
1014 |
Float_t dEdx = track->dedx[ipmt]; |
Float_t dEdx = track->dedx[ipmt]; |
1015 |
ym = dEdx*betahelp; |
ym = dEdx*betahelp; |
1016 |
Int_t pmtadc = track->pmtadc[ipmt]; |
Int_t pmtadc = track->pmtadc[ipmt]; |
1017 |
Int_t adcflag = track->adcflag[ipmt]; |
// Int_t adcflag = track->adcflag[ipmt]; |
1018 |
L2->GetToFLevel2()->GetPMTIndex(pmtadc,jj,kk); |
L2->GetToFLevel2()->GetPMTIndex(pmtadc,jj,kk); |
1019 |
if (adcflag==0) adc_c[pmtadc] = dEdx; |
// if (adcflag==0) adc_c[pmtadc] = dEdx; |
1020 |
|
|
1021 |
if (adc[pmtadc] == 4095) adc_c[pmtadc] = 0.; |
// if (adc[pmtadc] == 4095) adc_c[pmtadc] = 0.; |
1022 |
if (adc[pmtadc] == 4095) PMTcharge_arr[pmtadc] = 0.; |
if (adc[pmtadc] == 4095) PMTcharge_arr[pmtadc] = 0.; |
1023 |
|
|
1024 |
if ((adc[pmtadc]>PMTsat[pmtadc]) && (adc[pmtadc]<4095)) adc_c[pmtadc] = 1000.; |
// if ((adc[pmtadc]>PMTsat[pmtadc]) && (adc[pmtadc]<4095)) adc_c[pmtadc] = 1000.; |
1025 |
|
|
1026 |
if (adc[pmtadc] < PMTsat[pmtadc]) { |
if (adc[pmtadc] < PMTsat[pmtadc]) { |
1027 |
|
|
1147 |
//for (Int_t ilay=0; ilay<6; ilay ++) cout<<Layercharge[ilay]<<" "; |
//for (Int_t ilay=0; ilay<6; ilay ++) cout<<Layercharge[ilay]<<" "; |
1148 |
|
|
1149 |
//========================================================================== |
//========================================================================== |
1150 |
|
//============= Layercharge without 2nd-order correction ================= |
1151 |
|
//========================================================================== |
1152 |
|
|
1153 |
|
for (Int_t jj=0; jj<6;jj++) charge_layer_std_raw[jj] = Layercharge[jj]; |
1154 |
|
|
1155 |
|
//========================================================================== |
1156 |
//========================= 2nd-order correction ======================= |
//========================= 2nd-order correction ======================= |
1157 |
//========================================================================== |
//========================================================================== |
1158 |
|
|