210 |
|
|
211 |
/*z ed energia con loop*/ |
/*z ed energia con loop*/ |
212 |
// cout<<"Zdaloop"<<endl; |
// cout<<"Zdaloop"<<endl; |
213 |
Zdaloop(); // out: 1)chi2, 2)z, 3)Etot, 4)Pskip |
// Zdaloop(); // out: 1)chi2, 2)z, 3)Etot, 4)Pskip |
214 |
|
|
215 |
|
|
216 |
/*energia rilasciata da z migliore*/ |
/*energia rilasciata da z migliore*/ |
629 |
badplane = 0.;//azzero contatore piani scartati consecutivi |
badplane = 0.;//azzero contatore piani scartati consecutivi |
630 |
}; |
}; |
631 |
}; |
}; |
632 |
|
|
633 |
if(badplane > 2) out[1] =79.; |
if(badplane > 2){ |
634 |
|
out[1] =79.; |
635 |
|
break; |
636 |
|
}; |
637 |
|
|
638 |
};//fine loop piani |
};//fine loop piani |
639 |
//chi2,frammentato,pskip |
//chi2,frammentato,pskip |
640 |
out[0]=sum; |
out[0]=sum; |
641 |
out[2]=badplanetot; |
out[2]=badplanetot; |
642 |
|
|
643 |
if(out[1] ==79.)cout<<"frammentato !!!!!"<<endl; |
// if(out[1] ==79.)cout<<"frammentato !!!!!"<<endl; |
644 |
|
|
645 |
};//end chiquadro |
};//end chiquadro |
646 |
|
|
708 |
matrixchi2[inucl][iene][0]=1000;//valore chi2 per questo z a questa energia |
matrixchi2[inucl][iene][0]=1000;//valore chi2 per questo z a questa energia |
709 |
matrixchi2[inucl][iene][1]=1000;//energia per questo chi2 |
matrixchi2[inucl][iene][1]=1000;//energia per questo chi2 |
710 |
matrixchi2[inucl][iene][2]=1000;//piani saltati nel chi2 |
matrixchi2[inucl][iene][2]=1000;//piani saltati nel chi2 |
711 |
|
break; |
712 |
} |
} |
713 |
}//fine loop energia |
}//fine loop energia |
714 |
|
|
715 |
|
|
716 |
};//fine loop z |
};//fine loop z |
717 |
|
|
718 |
for (Int_t nu=0; nu<colmax; nu++){ |
// for (Int_t nu=0; nu<colmax; nu++){ |
719 |
for (Int_t en=0; en<rowmax; en++){ |
// for (Int_t en=0; en<rowmax; en++){ |
720 |
|
for (Int_t nu=(int)(Zstart); nu<max; nu++){ |
721 |
|
for (Int_t en=0; en<1000; en++){ |
722 |
if((matrixchi2[nu][en][0]<bestchi2[0]) && (matrixchi2[nu][en][0] !=0.)){ |
if((matrixchi2[nu][en][0]<bestchi2[0]) && (matrixchi2[nu][en][0] !=0.)){ |
723 |
bestchi2[0]= matrixchi2[nu][en][0];// chi2 |
bestchi2[0]= matrixchi2[nu][en][0];// chi2 |
724 |
bestchi2[1]= (Float_t)nu; // z |
bestchi2[1]= (Float_t)nu; // z |
728 |
} |
} |
729 |
} |
} |
730 |
//==========================// |
//==========================// |
731 |
Int_t testz = (Int_t)bestchi2[1]; |
// Int_t testz = (Int_t)bestchi2[1]; |
732 |
|
// Enetrack(&testz, &bestchi2[2], &estremi[0][0],&estremi[1][0], dEplan);//calcola rilascio energetico sui piani |
733 |
Enetrack(&testz, &bestchi2[2], &estremi[0][0],&estremi[1][0], dEplan);//calcola rilascio energetico sui piani |
// for(Int_t i=0;i<=estremi[1][0];i++){ |
734 |
for(Int_t i=0;i<=estremi[1][0];i++){ |
// cout<<"dEplan "<<dEplan[i]*10<<endl; |
735 |
cout<<"dEplan "<<dEplan[i]*10<<endl; |
// cout<<"calorimetro "<<calorimetro[i][1]<<endl; |
736 |
cout<<"calorimetro "<<calorimetro[i][1]<<endl; |
// } |
|
} |
|
737 |
//==========================// |
//==========================// |
738 |
};//endloopze |
};//endloopze |
739 |
|
|
762 |
|
|
763 |
Long64_t work[200]; |
Long64_t work[200]; |
764 |
Int_t ind = 0; |
Int_t ind = 0; |
765 |
Int_t l = 0; |
// Int_t l = 0; |
766 |
Int_t RN = 0; |
Int_t RN = 0; |
767 |
Float_t sum4 = 0.; |
Float_t sum4 = 0.; |
768 |
Float_t qm = 0.; |
Float_t qm = 0.; |
771 |
// |
// |
772 |
//Int_t uplim = TMath::Max(3,N); |
//Int_t uplim = TMath::Max(3,N); |
773 |
// |
// |
774 |
while ( l < 4 && ind < 44 ){ |
while ( RN < 4 && ind < 44 ){ |
775 |
qm = TMath::KOrdStat(44,ordplane,ind,work); |
qm = TMath::KOrdStat(44,ordplane,ind,work); |
776 |
if (qm >= 0.7 ){ |
if (qm >= 0.7 ){ |
777 |
if ( l < 4 ){ |
if ( RN < 4 ){ |
778 |
sum4 += qm; |
sum4 += qm; |
779 |
RN++; |
RN++; |
780 |
}; |
}; |
781 |
l++; |
// l++; |
782 |
if ( debug ) printf(" value no %i qm %f sum4 %f \n",l,qm,sum4); |
// if ( debug ) printf(" value no %i qm %f sum4 %f \n",l,qm,sum4); |
783 |
}; |
}; |
784 |
ind++; |
ind++; |
785 |
}; |
}; |
787 |
sum4 /= (Float_t)RN; |
sum4 /= (Float_t)RN; |
788 |
Float_t Zmean = (sqrt((sum4*MIP)/(4.*spessore[2]))); |
Float_t Zmean = (sqrt((sum4*MIP)/(4.*spessore[2]))); |
789 |
if(Zmean ==0.) Zmean=1.; |
if(Zmean ==0.) Zmean=1.; |
790 |
|
if ( Zmean < 1. ) Zmean = 1.; |
791 |
|
// |
792 |
|
// Zmean = 1.; |
793 |
|
|
794 |
// cout<<"sum4="<<sum4<<endl; |
// cout<<"sum4="<<sum4<<endl; |
795 |
// cout<<"Zmean="<<Zmean<<endl; |
// cout<<"Zmean="<<Zmean<<endl; |
805 |
bestchi2[3]=0.; |
bestchi2[3]=0.; |
806 |
Float_t zero=0.; |
Float_t zero=0.; |
807 |
|
|
808 |
cout<<"inizio media troncata"<<endl; |
// cout<<"inizio media troncata"<<endl; |
809 |
cout<<"input: step "<<Integrale<<", zero "<<zero<<", zmin "<<zmin<<", zmax"<<zmin<<endl; |
// cout<<"input: step "<<Integrale<<", zero "<<zero<<", zmin "<<zmin<<", zmax"<<zmin<<endl; |
810 |
|
|
811 |
|
|
812 |
// step energia zstart zstop |
// step energia zstart zstop |
813 |
loopze(Integrale,zero,zmin,zmin); |
loopze(Integrale,zero,zmin,zmin); |
814 |
|
|
815 |
cout<<"fine media troncata"<<endl; |
// cout<<"fine media troncata"<<endl; |
816 |
cout<<"output: chi2 "<<bestchi2[0]<<", z"<<bestchi2[1]<<", Etot "<<bestchi2[2]<<", Pskip "<<bestchi2[3]<<endl; |
// cout<<"output: chi2 "<<bestchi2[0]<<", z"<<bestchi2[1]<<", Etot "<<bestchi2[2]<<", Pskip "<<bestchi2[3]<<endl; |
817 |
|
|
818 |
|
|
819 |
|
|
854 |
//primo loop |
//primo loop |
855 |
// energia ezero, zstart zstop Si attrav 1 piano energie piani out |
// energia ezero, zstart zstop Si attrav 1 piano energie piani out |
856 |
|
|
857 |
cout<<"inizio primo loop"<<endl; |
// cout<<"inizio primo loop"<<endl; |
858 |
cout<<"input: step "<<Integrale<<", zero "<<zero<<", zmin "<<zmin<<", zmax"<<zmax<<endl; |
// cout<<"input: step "<<Integrale<<", zero "<<zero<<", zmin "<<zmin<<", zmax"<<zmax<<endl; |
859 |
|
|
860 |
loopze(Integrale,zero,zmin,zmax); |
loopze(Integrale,zero,zmin,zmax); |
861 |
|
|
862 |
cout<<"fine primo loop"<<endl; |
// cout<<"fine primo loop"<<endl; |
863 |
cout<<"output: chi2 "<<bestchi2[0]<<", z"<<bestchi2[1]<<", Etot "<<bestchi2[2]<<", Pskip "<<bestchi2[3]<<endl; |
// cout<<"output: chi2 "<<bestchi2[0]<<", z"<<bestchi2[1]<<", Etot "<<bestchi2[2]<<", Pskip "<<bestchi2[3]<<endl; |
864 |
|
|
865 |
//secondo loop |
//secondo loop |
866 |
for(Int_t i=0;i<4;i++) bestchitemp[i]=bestchi2[i]; |
for(Int_t i=0;i<4;i++) bestchitemp[i]=bestchi2[i]; |
878 |
if(zmin<1)zmin=1; |
if(zmin<1)zmin=1; |
879 |
zmax=bestchitemp[1]+1;// |
zmax=bestchitemp[1]+1;// |
880 |
|
|
881 |
cout<<"inizio secondo loop"<<endl; |
// cout<<"inizio secondo loop"<<endl; |
882 |
cout<<"input: step "<<step<<", zero "<<zero<<", zmin "<<zmin<<", zmax"<<zmax<<endl; |
// cout<<"input: step "<<step<<", zero "<<zero<<", zmin "<<zmin<<", zmax"<<zmax<<endl; |
883 |
|
|
884 |
loopze(step,zero,zmin,zmax); // |
loopze(step,zero,zmin,zmax); // |
885 |
|
|
886 |
cout<<"fine secondo loop"<<endl; |
// cout<<"fine secondo loop"<<endl; |
887 |
cout<<"output: chi2 "<<bestchi2[0]<<", z"<<bestchi2[1]<<", Etot "<<bestchi2[2]<<", Pskip "<<bestchi2[3]<<endl; |
// cout<<"output: chi2 "<<bestchi2[0]<<", z"<<bestchi2[1]<<", Etot "<<bestchi2[2]<<", Pskip "<<bestchi2[3]<<endl; |
888 |
|
|
889 |
|
|
890 |
// cout<<"z loop ok"<<endl; |
// cout<<"z loop ok"<<endl; |