/[PAMELA software]/tof/flight/ToFNuclei/src/ToFNuclei.cpp
ViewVC logotype

Diff of /tof/flight/ToFNuclei/src/ToFNuclei.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by pamelats, Wed May 6 09:21:42 2009 UTC revision 1.6 by pamelats, Thu Aug 6 11:24:34 2009 UTC
# Line 19  Line 19 
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    
# Line 54  void ToFNuclei::Clear(){ Line 57  void ToFNuclei::Clear(){
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  };  };
# Line 430  Float_t charge_chi=1000.; Line 435  Float_t charge_chi=1000.;
435  if ((beta_mean < 0.05)  || (beta_mean > 2.0)) {  if ((beta_mean < 0.05)  || (beta_mean > 2.0)) {
436    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.;
437    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.;
438      for (Int_t jj=0; jj<6;jj++) charge_layer_trk_raw[jj] = 1001.;
439    for (Int_t jj=0; jj<6;jj++) layerinfo_trk[jj] = 1001.;    for (Int_t jj=0; jj<6;jj++) layerinfo_trk[jj] = 1001.;
440    charge_trk = 1001.;    charge_trk = 1001.;
441    ncount_trk = 0;    ncount_trk = 0;
# Line 566  Layercharge[ilay] = xhelp; Line 572  Layercharge[ilay] = xhelp;
572    
573    
574  //==========================================================================  //==========================================================================
575    //============= Layercharge without 2nd-order correction   =================
576    //==========================================================================
577    
578      for (Int_t jj=0; jj<6;jj++) charge_layer_trk_raw[jj] = Layercharge[jj];
579    
580    //==========================================================================
581  //=========================   2nd-order correction   =======================  //=========================   2nd-order correction   =======================
582  //==========================================================================  //==========================================================================
583    
# Line 583  Float_t c_corr = corr[0]+corr[1]*xb+corr Line 595  Float_t c_corr = corr[0]+corr[1]*xb+corr
595  if ((ic>0)&&(ic<=5)) c_corr = c_corr/(1.*ic) ;  if ((ic>0)&&(ic<=5)) c_corr = c_corr/(1.*ic) ;
596  if (ic>5) c_corr = c_corr/6. ;  if (ic>5) c_corr = c_corr/6. ;
597    
598    //cout<<"beta "<<xb<<" layer "<<ii<<" ic "<<ic<<" => "<<c_corr<<endl;
599    //cout<<xb<<"  "<<ic<<"  "<<c_corr<<endl;
600    
601  Layercharge[ii] = Layercharge[ii]/c_corr;  Layercharge[ii] = Layercharge[ii]/c_corr;
602    
603                              }                              }
# Line 969  if (beta_in != 100.) beta_mean=beta_in; Line 984  if (beta_in != 100.) beta_mean=beta_in;
984  if ((beta_mean < 0.05)  || (beta_mean > 2.0)) {  if ((beta_mean < 0.05)  || (beta_mean > 2.0)) {
985    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.;
986    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.;
987      for (Int_t jj=0; jj<6;jj++) charge_layer_std_raw[jj] = 1001.;
988    for (Int_t jj=0; jj<6;jj++) layerinfo_std[jj] = 1001.;    for (Int_t jj=0; jj<6;jj++) layerinfo_std[jj] = 1001.;
989    charge_std = 1001.;    charge_std = 1001.;
990    ncount_std = 0;    ncount_std = 0;
# Line 1129  Layercharge[ilay] = xhelp; Line 1145  Layercharge[ilay] = xhelp;
1145  //for (Int_t ilay=0; ilay<6; ilay ++) cout<<Layercharge[ilay]<<" ";  //for (Int_t ilay=0; ilay<6; ilay ++) cout<<Layercharge[ilay]<<" ";
1146    
1147  //==========================================================================  //==========================================================================
1148    //============= Layercharge without 2nd-order correction   =================
1149    //==========================================================================
1150    
1151      for (Int_t jj=0; jj<6;jj++) charge_layer_std_raw[jj] = Layercharge[jj];
1152    
1153    //==========================================================================
1154  //=========================   2nd-order correction   =======================  //=========================   2nd-order correction   =======================
1155  //==========================================================================  //==========================================================================
1156    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.23