28.9.2011 Kamil Sedlak

1) implemented a new command /gun/turtleMomentumScalingFactor in the musrSim
   (see the manual)
2) some small changes in the musrSimAna
This commit is contained in:
2011-09-28 10:01:31 +00:00
parent c10cb1791c
commit 0c995ad9d8
9 changed files with 54 additions and 7 deletions

View File

@ -5,15 +5,16 @@
musrTH::musrTH(char* dimension, char* histoName, char* histoTitle, Int_t nrOfBinsX, Double_t minBoundaryX, Double_t maxBoundaryX, Int_t nrOfBinsY, Double_t minBoundaryY, Double_t maxBoundaryY, Double_t* variableName1, Double_t* variableName2) {
//musrTH::musrTH(char* dimension, char* histoName, char* histoTitle, Int_t nrOfBins, Double_t minBoundary, Double_t maxBoundary, Double_t* variableName1, Double_t* varibleName2) {
std::cout<<" Defining "<<dimension<<" histogram "<<histoName<<" \""<<histoTitle<<"\" "
<<nrOfBinsX<<" "<<minBoundaryX<<" "<<maxBoundaryX
<<nrOfBinsY<<" "<<minBoundaryY<<" "<<maxBoundaryY
<<" "<<variableName1<<" "<<variableName2<<std::endl;
<<nrOfBinsX<<" "<<minBoundaryX<<" "<<maxBoundaryX<<" "
<<nrOfBinsY<<" "<<minBoundaryY<<" "<<maxBoundaryY<<" "
<<variableName1<<" "<<variableName2<<std::endl;
strcpy(histogramName,histoName);
variableToBeFilled_X = variableName1;
variableToBeFilled_Y = variableName2;
funct = NULL;
bool_rotating_reference_frame=false;
bool_exp_decay_correction=false;
rot_ref_frequency=0;
rot_ref_phase=0;
strcpy(funct_option,"");
@ -49,6 +50,11 @@ void musrTH::FillTH1D(Double_t vaha, Bool_t* cond){
if (bool_rotating_reference_frame) {
// Double_t var = *variableToBeFilled_X;
Double_t waha = vaha*exp((*variableToBeFilled_X)/2.19703)*cos(2*musrAnalysis::pi*rot_ref_frequency*(*variableToBeFilled_X)+rot_ref_phase);
// std::cout<<"rot_ref_frequency="<<rot_ref_frequency<<std::endl;
if (cond[i]) histArray1D[i]->Fill(*variableToBeFilled_X,waha);
}
else if (bool_exp_decay_correction) {
Double_t waha = vaha*exp((*variableToBeFilled_X)/2.19703);
if (cond[i]) histArray1D[i]->Fill(*variableToBeFilled_X,waha);
}
else {
@ -219,16 +225,18 @@ void musrTH::ListHistograms() {
//==============================================================================================
void musrTH::FitHistogramsIfRequired(Double_t omega) {
if (funct==NULL) return;
if (bool_rotating_reference_frame) omega = fabs(omega) - 2*musrAnalysis::pi*rot_ref_frequency;
if (bool_rotating_reference_frame) omega = fabs(omega) - 2*musrAnalysis::pi*fabs(rot_ref_frequency);
std::cout<<"============================================================================================================"<<std::endl;
std::cout<<"Fitting \""<<funct->GetName()<<"\", funct_xMin="<<funct_xMin<<" funct_xMax="<<funct_xMax<<" omega="<<omega<<std::endl;
if (strcmp(funct->GetName(),"funct1")==0) {funct->FixParameter(0,omega);}
if (strcmp(funct->GetName(),"funct2")==0) {funct->FixParameter(0,omega);}
if (strcmp(funct->GetName(),"funct3")==0) {funct->FixParameter(0,omega);}
if (strcmp(funct->GetName(),"funct4")==0) {funct->FixParameter(0,omega);}
if (strcmp(funct->GetName(),"TFieldCosPLUSbg")==0) {funct->FixParameter(0,omega);}
if (strcmp(funct->GetName(),"TFieldCos")==0) {funct->FixParameter(0,omega);}
if (strcmp(funct->GetName(),"rotFrameTime20")==0) {
if (funct->GetParameter(0)==0) {
funct->SetParameter(0,omega); std::cout<<" FUNKCE rotFrameTime20"<<"omega initialy at "<<omega<<std::endl;
funct->SetParameter(0,omega); std::cout<<" FUNKCE rotFrameTime20, omega initialy at "<<omega<<std::endl;
}
}