Commit 9825ca28 authored by Jérémie Dudouet's avatar Jérémie Dudouet
Browse files

Correction the gamma search:

Bug in the Two gamma coinc (3 were required)
Now, Each requested energy must be present in the final results
The energy difference is added to sort the transitions
parent fce6c5ee
......@@ -159,7 +159,7 @@ void CXGammaSearch::SetCalMode()
{
if(fNGammas<=1)
cout<<"Soory, I cannot determine coincidence between one or less gamma ray..."<<endl;
else if(fNGammas==1)
else if(fNGammas==2)
{
FindGammaRays(true);
FindInDoubleCoincidence();
......@@ -245,10 +245,11 @@ void CXGammaSearch::FindGammaRays(Bool_t Bash)
{
gatetrig[ig] = true;
GoodGammas.push_back(Link);
goto cnt;
}
if(gatetrig[ig])
continue;
}
cnt:;
}
Int_t NGatesTrig=0;
......@@ -257,6 +258,10 @@ cnt:;
if(NGatesTrig>=fNGammas)
{
// cout<<NGatesTrig<<" "<<fNGammas<<endl;
// cout<<GoodGammas.size()<<endl;
// cout<<Form("%s (Z=%d, A=%d, N=%d)",Nuc.GetSymbol().Data(),Nuc.GetZ(),Nuc.GetA(),Nuc.GetN())<<endl;
if(!Bash)
PrintInListBox(Form("%s (Z=%d, A=%d, N=%d)",Nuc.GetSymbol().Data(),Nuc.GetZ(),Nuc.GetA(),Nuc.GetN()),kInfo);
......@@ -286,11 +291,9 @@ cnt:;
avect.push_back(agammatrans);
if(!Bash)
{
TString GammaTitle = Form(" => %6.1f keV : %5s (%6.1f keV) --> %5s (%6.1f keV)",Energy,spinI.Data(),ELevI,spinF.Data(),ELevF);
PrintInListBox(GammaTitle.Data(),kPrint);
}
TString GammaTitle = Form(" => %6.1f keV : %5s (%6.1f keV) --> %5s (%6.1f keV)",Energy,spinI.Data(),ELevI,spinF.Data(),ELevF);
// cout<<GammaTitle<<endl;
if(!Bash) PrintInListBox(GammaTitle.Data(),kPrint);
}
fListOfGoodGammas.push_back(avect);
......@@ -306,7 +309,6 @@ cnt:;
MapSubwindows();
MapWindow();
Layout();
}
void CXGammaSearch::FindInDoubleCoincidence(Bool_t Bash)
......@@ -318,6 +320,7 @@ void CXGammaSearch::FindInDoubleCoincidence(Bool_t Bash)
std::vector<int> Index_Nuclei;
std::vector<string> Nuclei_ID;
std::vector<Float_t> DeltaE;
Int_t Number_Analysed_Gammas=0;
Int_t Count=0;
......@@ -330,7 +333,7 @@ void CXGammaSearch::FindInDoubleCoincidence(Bool_t Bash)
vector < GammaTransition > avec = fListOfGoodGammas[inuc];
if(avec.size()<3)
if(avec.size()<2)
continue;
CXNucleus Nuc(((GammaTransition)avec[0]).NucName.Data());
......@@ -354,6 +357,9 @@ void CXGammaSearch::FindInDoubleCoincidence(Bool_t Bash)
Bool_t Det = fSp->IsDet(Mat_LS,Dim_LS);
TString TransitionName[Dim_LS];
Float_t ETrans[Dim_LS];
Float_t EI[Dim_LS];
Float_t EF[Dim_LS];
//get the coordinates of the gammas
for(Int_t ig=0 ; ig<Dim_LS ; ig++)
......@@ -366,14 +372,42 @@ void CXGammaSearch::FindInDoubleCoincidence(Bool_t Bash)
{
Flag[ig] = Mat_E[ig][0];
TransitionName[ig] = Form(" %6.1f keV : %5s (%6.1f keV) --> %5s (%6.1f keV) ",GT.EGamma,GT.SpinI.Data(),GT.EI,GT.SpinF.Data(),GT.EF);
ETrans[ig] = GT.EGamma;
EI[ig] = GT.EI;
EF[ig] = GT.EF;
}
}
}
Bool_t gatetrig[fNGammas];
Float_t Gates[fNGammas];
Float_t Width[fNGammas];
for(int ig=0 ; ig<fNGammas ; ig++) {
Gates[ig] = fEnergies[ig]->GetNumber();
Width[ig] = fWidths[ig]->GetNumber();
}
for(Int_t j=0 ; j<Dim_LS ; j++)
{
for(Int_t m=0 ; m<j ; m++)
{
memset(gatetrig,0,sizeof(fNGammas));
Int_t NGatesTrig=0;
for(int ig=0 ; ig<fNGammas ; ig++) {
if(TMath::Abs(ETrans[j]-Gates[ig])<Width[ig])
gatetrig[ig] = true;
if(TMath::Abs(ETrans[m]-Gates[ig])<Width[ig])
gatetrig[ig] = true;
}
for(int ii=0 ; ii<fNGammas ; ii++)
NGatesTrig += gatetrig[ii];
if(NGatesTrig != 2)
continue;
Float_t Prob = TMath::Abs(Mat_P[j][m]);
if(Flag[j]>0 && Flag[m]>0 && Prob>0.01)
{
......@@ -381,6 +415,11 @@ void CXGammaSearch::FindInDoubleCoincidence(Bool_t Bash)
Tab_P.push_back(Prob);
Index_Nuclei.push_back(Count);
if(EI[j]>EI[m])
DeltaE.push_back(EF[j]-EI[m]);
else
DeltaE.push_back(EF[m]-EI[j]);
TString Name_Output = Form("%s# --> %s# --> %s, Prob = %1.3f", Nuc.GetSymbol().Data(),TransitionName[j].Data(),TransitionName[m].Data(),Prob);
if (Det==false)
......@@ -397,7 +436,7 @@ void CXGammaSearch::FindInDoubleCoincidence(Bool_t Bash)
}
std::vector<int> Index_Sorted;
Index_Sorted = Sort_Index(Index_Nuclei,Tab_P);
Index_Sorted = Sort_Index(Index_Nuclei,Tab_P, DeltaE);
if(!Bash)
{
......@@ -405,7 +444,7 @@ void CXGammaSearch::FindInDoubleCoincidence(Bool_t Bash)
{
TString Name = Nuclei_ID.at(Index_Sorted[j]);
TObjArray *arr = Name.Tokenize("#");
TString NucName = arr->First()->GetName();
TString NucName = Form("%s : Energy Diff = %1.3f",arr->First()->GetName(),DeltaE[Index_Sorted[j]]);
TString Transition1 = arr->At(1)->GetName();
TString Transition2 = arr->At(2)->GetName();
......@@ -427,6 +466,7 @@ void CXGammaSearch::FindInTripleCoincidence()
std::vector<int> Index_Nuclei;
std::vector<string> Nuclei_ID;
std::vector<Float_t> DeltaE;
Int_t Number_Analysed_Gammas=0;
Int_t Count=0;
......@@ -463,6 +503,9 @@ void CXGammaSearch::FindInTripleCoincidence()
Bool_t Det = fSp->IsDet(Mat_LS,Dim_LS);
TString TransitionName[Dim_LS];
Float_t ETrans[Dim_LS];
Float_t EI[Dim_LS];
Float_t EF[Dim_LS];
//get the coordinates of the gammas
for(Int_t ig=0 ; ig<Dim_LS ; ig++)
......@@ -475,16 +518,46 @@ void CXGammaSearch::FindInTripleCoincidence()
{
Flag[ig] = Mat_E[ig][0];
TransitionName[ig] = Form(" %6.1f keV : %5s (%6.1f keV) --> %5s (%6.1f keV) ",GT.EGamma,GT.SpinI.Data(),GT.EI,GT.SpinF.Data(),GT.EF);
ETrans[ig] = GT.EGamma;
EI[ig] = GT.EI;
EF[ig] = GT.EF;
}
}
}
Bool_t gatetrig[fNGammas];
Float_t Gates[fNGammas];
Float_t Width[fNGammas];
for(int ig=0 ; ig<fNGammas ; ig++) {
Gates[ig] = fEnergies[ig]->GetNumber();
Width[ig] = fWidths[ig]->GetNumber();
}
for(Int_t j=0 ; j<Dim_LS ; j++)
{
for(Int_t m=0 ; m<j ; m++)
{
for(Int_t k=0 ; k<m ; k++)
{
memset(gatetrig,0,sizeof(fNGammas));
Int_t NGatesTrig=0;
for(int ig=0 ; ig<fNGammas ; ig++) {
if(TMath::Abs(ETrans[j]-Gates[ig])<Width[ig])
gatetrig[ig] = true;
if(TMath::Abs(ETrans[m]-Gates[ig])<Width[ig])
gatetrig[ig] = true;
if(TMath::Abs(ETrans[k]-Gates[ig])<Width[ig])
gatetrig[ig] = true;
}
for(int ii=0 ; ii<fNGammas ; ii++)
NGatesTrig += gatetrig[ii];
if(NGatesTrig != 3)
continue;
Float_t Prob = TMath::Abs(Mat_P[j][m]*Mat_P[j][k]*Mat_P[m][k]);
if(Flag[j]>0 && Flag[m]>0 && Flag[k]>0 && Prob>0.01 )
......@@ -493,6 +566,25 @@ void CXGammaSearch::FindInTripleCoincidence()
Tab_P.push_back(Prob);
Index_Nuclei.push_back(Count);
if(EI[j]>EI[m] && EI[j]>EI[k]) {
if(EI[m]>EI[k])
DeltaE.push_back(EF[j]-EI[m] + EF[m]-EI[k]);
else
DeltaE.push_back(EF[j]-EI[k] + EF[k]-EI[m]);
}
else if(EI[m]>EI[j] && EI[m]>EI[k]) {
if(EI[j]>EI[k])
DeltaE.push_back(EF[m]-EI[j] + EF[j]-EI[k]);
else
DeltaE.push_back(EF[m]-EI[k] + EF[k]-EI[j]);
}
else if(EI[k]>EI[j] && EI[k]>EI[m]) {
if(EI[j]>EI[m])
DeltaE.push_back(EF[k]-EI[j] + EF[j]-EI[m]);
else
DeltaE.push_back(EF[k]-EI[m] + EF[m]-EI[j]);
}
TString Name_Output = Form("%s# --> %s# --> %s# --> %s, Prob = %1.3f", Nuc.GetSymbol().Data(),TransitionName[j].Data(),TransitionName[m].Data(),TransitionName[k].Data(),Prob);
if (Det==false)
......@@ -510,14 +602,14 @@ void CXGammaSearch::FindInTripleCoincidence()
}
std::vector<int> Index_Sorted;
Index_Sorted = Sort_Index(Index_Nuclei,Tab_P);
Index_Sorted = Sort_Index(Index_Nuclei,Tab_P, DeltaE);
for(Int_t j=(Int_t)Tab_P.size()-1 ; j>=0 ; j--)
{
TString Name = Nuclei_ID.at(Index_Sorted[j]);
TObjArray *arr = Name.Tokenize("#");
TString NucName = arr->First()->GetName();
TString NucName = Form("%s : Energy Diff = %1.3f",arr->First()->GetName(),DeltaE[Index_Sorted[j]]);
TString Transition1 = arr->At(1)->GetName();
TString Transition2 = arr->At(2)->GetName();
TString Transition3 = arr->At(3)->GetName();
......@@ -531,17 +623,29 @@ void CXGammaSearch::FindInTripleCoincidence()
PrintInListBox(Form("Done... %d corresponding nuclei found",((Int_t)Tab_P.size())),kInfo);
}
std::vector<int> CXGammaSearch::Sort_Index(std::vector<int> Index_Nuclei, std::vector<float> Tab_P)
std::vector<int> CXGammaSearch::Sort_Index(std::vector<int> Index_Nuclei, std::vector<float> Tab_P, std::vector<float> Tab_DeltaE)
{
std::vector<int> vecX;
for(unsigned int i=1 ; i<Index_Nuclei.size() ; i++)
for(unsigned int j=0 ; j<Index_Nuclei.size()-1 ; j++)
if(Tab_P[j]>Tab_P[j+1])
{
if(Tab_P[j]>Tab_P[j+1]) {
swap(Index_Nuclei[j],Index_Nuclei[j+1]);
swap(Tab_P[j],Tab_P[j+1]);
swap(Tab_DeltaE[j],Tab_DeltaE[j+1]);
}
for(unsigned int i=1 ; i<Index_Nuclei.size() ; i++)
for(unsigned int j=0 ; j<Index_Nuclei.size()-1 ; j++) {
if(TMath::Abs(Tab_P[j]-Tab_P[j+1])<1e-4) {
if(Tab_DeltaE[j]<Tab_DeltaE[j+1]) {
swap(Index_Nuclei[j],Index_Nuclei[j+1]);
swap(Tab_P[j],Tab_P[j+1]);
swap(Tab_DeltaE[j],Tab_DeltaE[j+1]);
}
}
}
for(uint i=0 ; i<Tab_P.size() ; i++)
vecX.push_back(Index_Nuclei[i]);
......
......@@ -91,7 +91,7 @@ protected:
void FindInDoubleCoincidence(Bool_t Bash = false);
void FindInTripleCoincidence();
std::vector<int> Sort_Index(std::vector<int> Index_Nuclei, std::vector<float> Tab_P);
std::vector<int> Sort_Index(std::vector<int> Index_Nuclei, std::vector<float> Tab_P, std::vector<float> Tab_DeltaE);
LevelScheme *ImportRAWENSDF(const char *NucSymbol);
TMatrixD Fill_TS_Matrix(LevelScheme *fLevelScheme);
TMatrixD Get_E_Matrix(LevelScheme *fLevelScheme);
......
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