@@ -600,7 +600,6 @@ double VTableCalculator::calc( int ntel, float* r, float* s, float* w, double* m
600600 // fill width/length/energy into a 1D and 2D histogram
601601 // (chi2 is here an external weight (from e.g. spectral weighting))
602602 // ============================================================================================================
603- // PRELIMINARY_START
604603 if ( fEnergy )
605604 {
606605 if ( w[tel] < Oh[is][ir]->GetXaxis ()->GetXmin () || w[tel] > Oh[is][ir]->GetXaxis ()->GetXmax () )
@@ -609,7 +608,6 @@ double VTableCalculator::calc( int ntel, float* r, float* s, float* w, double* m
609608 cout << Oh[is][ir]->GetXaxis ()->GetXmin () << " \t " << Oh[is][ir]->GetXaxis ()->GetXmax () << endl;
610609 }
611610 }
612- // PRELIMINARY_END
613611 // ============================================================================================================
614612 Oh[is][ir]->Fill ( w[tel], chi2 );
615613 }
@@ -666,6 +664,10 @@ double VTableCalculator::calc( int ntel, float* r, float* s, float* w, double* m
666664 vector< double > sigma2_tel;
667665 vector< double > sigma2_tel_noRadiusWeigth;
668666 vector< double > sigma_tel;
667+ energy_tel.reserve ( ntel );
668+ sigma2_tel.reserve ( ntel );
669+ sigma2_tel_noRadiusWeigth.reserve ( ntel );
670+ sigma_tel.reserve ( ntel );
669671
670672 // reset everything
671673 for ( tel = 0 ; tel < ntel; tel++ )
@@ -1016,7 +1018,7 @@ bool VTableCalculator::readHistograms()
10161018 return false ;
10171019}
10181020
1019- double VTableCalculator::interpolate ( TH2F* h, double x, double y, bool iError )
1021+ double VTableCalculator::interpolate ( TH2F* h, float x, float y, bool iError )
10201022{
10211023 if (!h )
10221024 {
@@ -1046,33 +1048,33 @@ double VTableCalculator::interpolate( TH2F* h, double x, double y, bool iError )
10461048 i_y--;
10471049 }
10481050
1049- double e1 = 0 .;
1050- double e2 = 0 .;
1051- double v = 0 .;
1051+ float e1 = 0 .;
1052+ float e2 = 0 .;
1053+ float v = 0 .;
10521054
10531055 // first interpolate on distance axis, then on size axis
10541056 if (!iError )
10551057 {
1056- e1 = VStatistics::interpolate ( h->GetBinContent ( i_x, i_y ), h->GetYaxis ()->GetBinCenter ( i_y ),
1057- h->GetBinContent ( i_x, i_y + 1 ), h->GetYaxis ()->GetBinCenter ( i_y + 1 ),
1058- y, false , 0.5 , 1 .e -5 );
1059- e2 = VStatistics::interpolate ( h->GetBinContent ( i_x + 1 , i_y ), h->GetYaxis ()->GetBinCenter ( i_y ),
1060- h->GetBinContent ( i_x + 1 , i_y + 1 ), h->GetYaxis ()->GetBinCenter ( i_y + 1 ),
1061- y, false , 0.5 , 1 .e -5 );
1062- v = VStatistics::interpolate ( e1 , h->GetXaxis ()->GetBinCenter ( i_x ),
1063- e2 , h->GetXaxis ()->GetBinCenter ( i_x + 1 ),
1064- x, false , 0.5 , 1 .e -5 );
1058+ e1 = VStatistics::interpolate ( static_cast < float >( h->GetBinContent ( i_x, i_y ) ), static_cast < float >( h->GetYaxis ()->GetBinCenter ( i_y ) ),
1059+ static_cast < float >( h->GetBinContent ( i_x, i_y + 1 ) ), static_cast < float >( h->GetYaxis ()->GetBinCenter ( i_y + 1 ) ),
1060+ y, false , static_cast < float >( 0.5 ), static_cast < float >( 1 .e -5 ) );
1061+ e2 = VStatistics::interpolate ( static_cast < float >( h->GetBinContent ( i_x + 1 , i_y ) ), static_cast < float >( h->GetYaxis ()->GetBinCenter ( i_y ) ),
1062+ static_cast < float >( h->GetBinContent ( i_x + 1 , i_y + 1 ) ), static_cast < float >( h->GetYaxis ()->GetBinCenter ( i_y + 1 ) ),
1063+ y, false , static_cast < float >( 0.5 ), static_cast < float >( 1 .e -5 ) );
1064+ v = VStatistics::interpolate ( e1 , static_cast < float >( h->GetXaxis ()->GetBinCenter ( i_x ) ),
1065+ e2 , static_cast < float >( h->GetXaxis ()->GetBinCenter ( i_x + 1 ) ),
1066+ x, false , static_cast < float >( 0.5 ), static_cast < float >( 1 .e -5 ) );
10651067 }
10661068 else
10671069 {
1068- e1 = VStatistics::interpolate ( h->GetBinError ( i_x, i_y ), h->GetYaxis ()->GetBinCenter ( i_y ),
1069- h->GetBinError ( i_x, i_y + 1 ), h->GetYaxis ()->GetBinCenter ( i_y + 1 ),
1070+ e1 = VStatistics::interpolate ( static_cast < float >( h->GetBinError ( i_x, i_y ) ), static_cast < float >( h->GetYaxis ()->GetBinCenter ( i_y ) ),
1071+ static_cast < float >( h->GetBinError ( i_x, i_y + 1 ) ), static_cast < float >( h->GetYaxis ()->GetBinCenter ( i_y + 1 ) ),
10701072 y, false );
1071- e2 = VStatistics::interpolate ( h->GetBinError ( i_x + 1 , i_y ), h->GetYaxis ()->GetBinCenter ( i_y ),
1072- h->GetBinError ( i_x + 1 , i_y + 1 ), h->GetYaxis ()->GetBinCenter ( i_y + 1 ),
1073+ e2 = VStatistics::interpolate ( static_cast < float >( h->GetBinError ( i_x + 1 , i_y ) ), static_cast < float >( h->GetYaxis ()->GetBinCenter ( i_y ) ),
1074+ static_cast < float >( h->GetBinError ( i_x + 1 , i_y + 1 ) ), static_cast < float >( h->GetYaxis ()->GetBinCenter ( i_y + 1 ) ),
10731075 y, false );
10741076
1075- v = VStatistics::interpolate ( e1 , h->GetXaxis ()->GetBinCenter ( i_x ), e2 , h->GetXaxis ()->GetBinCenter ( i_x + 1 ), x, false );
1077+ v = VStatistics::interpolate ( e1 , static_cast < float >( h->GetXaxis ()->GetBinCenter ( i_x ) ) , e2 , static_cast < float >( h->GetXaxis ()->GetBinCenter ( i_x + 1 ) ), x, false );
10761078 }
10771079 // final check on consistency of results
10781080 // (don't expect to reconstruct anything below 1 GeV)
0 commit comments