#include "musrTH.hh" #include "musrAnalysis.hh" #include "TCanvas.h" 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 "<Sumw2(); histArray2D[i] = hTemp; // std::cout<<"histogram hTemp defined, name="<Sumw2(); histArray1D[i] = hTemp; // std::cout<<"histogram hTemp defined, name="<cd(); tempC->Update(); char chopt[1000]; strcpy(chopt,option); Int_t i_first=0, i_last=musrAnalysis::nrConditions; if (idHist>=0) {i_first=idHist; i_last=idHist+1;} for (Int_t i=i_first; i=0) {i_first=idHist; i_last=idHist+1;} for (Int_t i=i_first; i::const_iterator it = drawList.begin(); it != drawList.end(); ++it) { int iii = *it; std::cout<<" Drawing histog"<::const_iterator it = drawList.begin(); it != drawList.end(); ++it) { int iii = *it; DrawTH2D(option, iii); } } //============================================================================================== void musrTH::SetBinLabel1D(Int_t iBin,std::string slabel) { for (Int_t i=0; iGetXaxis()->SetBinLabel(iBin,slabel.c_str()); } } //============================================================================================== Double_t musrTH::GetBinContent1D(Int_t i, Int_t jBin) { // std::cout<<"musrTH::GetBinContent1D: i="<first; Int_t iDecayHistoBin = it->second; // if (iDecayHistoBin==-123456789) {iHumanBinForAllTheRest=iHumanBin; continue;} Double_t value = decayMapHistos->GetBinContent1D(i,iDecayHistoBin); Double_t value2 = histArray1D[i]-> GetBinContent(iHumanBin); //decayMapHistos->GetBinContent1D(i,iDecayHistoBin); histArray1D[i]-> SetBinContent(iHumanBin,value+value2); } // // if (iHumanBinForAllTheRest != -1) { // for (Int_t j=1; j<= (decayMapHistos->GetNbinsX1D()); j++) { for (Int_t j=(decayMapHistos->GetXmin1D()); j<= (decayMapHistos->GetXmax1D()); j++) { Double_t value = decayMapHistos->GetBinContent1D(i,j); Bool_t thisBinWasAssigned=false; if (value!=0) { for (humanDecayMultimapType::const_iterator it = myMultimap.begin(); it!=myMultimap.end(); ++it) { Int_t iDecayHistoBin = it->second; if (iDecayHistoBin==j) thisBinWasAssigned=true; } } if ((!thisBinWasAssigned)&&(value!=0)&&(j!=-1001)) { // in case of pileup histo, -1001 is assigned // if there was no pileup muon. Avoid printing error in this case. std::cout<<"musrHT.cxx: "< GetBinContent(XXXX); } } } } //============================================================================================== void musrTH::AssignFunction(TF1* function, char* functOption, Double_t xMin, Double_t xMax) { funct = function; strcpy(funct_option,functOption); funct_xMin = xMin; funct_xMax = xMax; std::cout<<"musrTH::AssignFunction: "<GetName()<<", option="<GetName()<<"\", funct_xMin="<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(),"rotFrameTime20")==0) { if (funct->GetParameter(0)==0) { funct->SetParameter(0,omega); std::cout<<" FUNKCE rotFrameTime20"<<"omega initialy at "<GetNumberFreeParameters(); Int_t n_ppp = funct->GetNpar(); for (Int_t i=0; iGetParameter(i); std::cout<Fit(funct,"LL","",funct_xMin,funct_xMax); } // if (strcmp(funct->GetName(),"simpleExpoPLUSconst")==0) { // N0_FromLastFit=funct->GetParameter(0); std::cout<<"N0_FromLastFit="<GetBinWidth(2); std::cout<<"BinWidth_FromLastFit="<SetLineWidth(2); // funct->SetLineColor(2); } //============================================================================================== //void musrTH::FillHumanDecayArray(musrTH* decayMapHistos, const int nBins, const int* iBins) { // for (Int_t i=0; iGetBinContent1D(i,jBin); // histArray1D[i]-> SetBinContent(j+1,value); // } // } //} //==============================================================================================