Commit f1d7aa52 authored by Agata Analysis's avatar Agata Analysis
Browse files

correct a bug on Doppler correction for core spectra

parent 7f61f3ea
......@@ -1524,7 +1524,6 @@ void PlotResultsSelector::Agata_Identification_Addback()
for(int i=0 ; i<fAG_Mult ; i++)
{
cout<<AddE[i]<<" ";
fAG_Id[i] = AddId[i];
fAG_E[i] = AddE[i];
fAG_X1[i] = AddX[i];
......@@ -1553,10 +1552,12 @@ void PlotResultsSelector::Agata_Identification_Addback()
Float_t R2 = fAG_X1[nbGoodAGATA]*fAG_X1[nbGoodAGATA]+fAG_Y1[nbGoodAGATA]*fAG_Y1[nbGoodAGATA]+fAG_Z1[nbGoodAGATA]*fAG_Z1[nbGoodAGATA];
fAG_CosTheta[nbGoodAGATA] = fAG_Z1[nbGoodAGATA]/sqrt(R2);
Float_t gammaslow = 1.0/sqrt(1 - BetaSlow*BetaSlow);
Float_t gammafast = 1.0/sqrt(1 - BetaFast*BetaFast);
Float_t gamma = 1.0/sqrt(1 - BetaSlow*BetaSlow);
fAG_E[nbGoodAGATA] = fAG_E[nbGoodAGATA] * gamma * ( 1.0 - BetaSlow * fAG_CosTheta[nbGoodAGATA] );
fAG_E_slow[nbGoodAGATA] = fAG_E[nbGoodAGATA] * gammaslow * ( 1.0 - BetaSlow * fAG_CosTheta[nbGoodAGATA] );
fAG_E_fast[nbGoodAGATA] = fAG_E[nbGoodAGATA] * gammafast * ( 1.0 - BetaFast * fAG_CosTheta[nbGoodAGATA] );
nbGoodAGATA++;
}
......@@ -1573,29 +1574,31 @@ void PlotResultsSelector::Agata_Identification_Core()
Int_t nbGoodHits=0;
Int_t ihit=0;
Int_t Maxhit[nbHits];
Float_t MaxE[nbHits];
memset(MaxE,0,nbHits*sizeof(Float_t));
for( Int_t i = 0; i < nbCores; i++ )
{
if( ((Double_t)coreTS[i]-(Double_t)TSHit) > fAgataHitsTimeGate)
{
while(hitID[ihit] == coreId[i])
ihit++;
continue;
}
if( ((Double_t)coreTS[i]-(Double_t)TSHit) > fAgataHitsTimeGate)
{
while(hitID[ihit] == coreId[i])
ihit++;
continue;
}
coreE0[nbGoodAGATA] = coreE0[i];
coreId[nbGoodAGATA] = coreId[i];
coreTS[nbGoodAGATA] = coreTS[i];
Float_t MaxE = 0.;
while(hitID[ihit] == coreId[i])
{
hitE[nbGoodHits] = hitE[ihit];
if(hitE[nbGoodHits]>MaxE)
if(hitE[nbGoodHits]>MaxE[nbGoodAGATA])
{
MaxE = hitE[nbGoodHits];
MaxE[nbGoodAGATA] = hitE[nbGoodHits];
Maxhit[nbGoodAGATA] = nbGoodHits;
}
hitX[nbGoodHits] = hitX[ihit];
......@@ -1616,7 +1619,6 @@ void PlotResultsSelector::Agata_Identification_Core()
nbCores = nbGoodAGATA;
nbHits = nbGoodHits;
fAG_Mult = nbCores;
for(int i=0 ; i<fAG_Mult ; i++)
......@@ -1624,12 +1626,21 @@ void PlotResultsSelector::Agata_Identification_Core()
fAG_Id[i] = coreId[i];
fAG_E[i] = coreE0[i];
fAG_X1[i] = hitX[Maxhit[i]];
fAG_Y1[i] = hitY[Maxhit[i]];
fAG_Z1[i] = hitZ[Maxhit[i]];
fAG_X1[i] = hitGX[Maxhit[i]];
fAG_Y1[i] = hitGY[Maxhit[i]];
fAG_Z1[i] = hitGZ[Maxhit[i]];
fAG_IndTS[i] = coreTS[i];
fAG_GlobTS = TSHit;
fAG_GlobTS = TSHit;
Float_t R2 = fAG_X1[i]*fAG_X1[i]+fAG_Y1[i]*fAG_Y1[i]+fAG_Z1[i]*fAG_Z1[i];
fAG_CosTheta[i] = fAG_Z1[i]/sqrt(R2);
Float_t gammaslow = 1.0/sqrt(1 - BetaSlow*BetaSlow);
Float_t gammafast = 1.0/sqrt(1 - BetaFast*BetaFast);
fAG_E_slow[i] = fAG_E[i]* gammaslow * ( 1.0 - BetaSlow * fAG_CosTheta[i] );
fAG_E_fast[i] = fAG_E[i]* gammafast * ( 1.0 - BetaFast * fAG_CosTheta[i] );
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment