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

@ -272,6 +272,9 @@ void musrAnalysis::ReadInInputParameters(char* charV1190FileName) {
hInfo->Fill(21, rot_ref_frequency); // value may be overwritten - just the last rot. ref. frame will be saved
hInfo->Fill(22, rot_ref_phase); // value may be overwritten - just the last rot. ref. frame will be saved
}
else if (strcmp(furtherOption,"correctexpdecay")==0) {
myTH->SetExpDecayCorrection();
}
}
else {
Double_t* pointerToVariable2 = iter2->second;
@ -587,6 +590,21 @@ void musrAnalysis::ReadInInputParameters(char* charV1190FileName) {
funct -> SetParameter(0,p0);
funct -> SetParameter(1,p1);
}
else if (strcmp(functionName,"TFieldCosPLUSbg")==0) {
funct = new TF1("TFieldCosPLUSbg","[3]*(1+[2]*cos(x*[0]+[1]))+[4]*exp(x/2.19703)");
funct -> SetParameter(0,p0);
funct -> SetParameter(1,p1);
funct -> SetParameter(2,p2);
funct -> SetParameter(3,p3);
funct -> SetParameter(4,p4);
}
else if (strcmp(functionName,"TFieldCos")==0) {
funct = new TF1("TFieldCos","[3]*(1+[2]*cos(x*[0]+[1]))");
funct -> SetParameter(0,p0);
funct -> SetParameter(1,p1);
funct -> SetParameter(2,p2);
funct -> SetParameter(3,p3);
}
else if (strcmp(functionName,"rotFrameTime20")==0) {
// funct = new TF1("rotFrameTime20","[2]*exp(-x/2.19703)*cos(x*[0]+[1]) ");
funct = new TF1("rotFrameTime20","[2]*cos(x*[0]+[1]) ");

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;
}
}

View File

@ -43,6 +43,7 @@ public:
void FitHistogramsIfRequired(Double_t omega);
void SetRotatingReferenceFrame(Double_t frequency, Double_t phase) {bool_rotating_reference_frame=true;
rot_ref_frequency=frequency; rot_ref_phase=phase;}
void SetExpDecayCorrection() {bool_exp_decay_correction=true;}
void ListHistograms();
private:
@ -57,6 +58,7 @@ private:
char funct_option[100];
Bool_t bool_rotating_reference_frame;
Double_t rot_ref_frequency, rot_ref_phase;
Bool_t bool_exp_decay_correction;
// Double_t N0_FromLastFit;
// Double_t BinWidth_FromLastFit;
// Double_t funct_p0, funct_p1, funct_p2, funct_p3, funct_p4, funct_p5, funct_p6, funct_p7, funct_p8, funct_p9;