/*Emacs: -*- C++ -*- */ /************************************************ * ptdrHistogramStyleAscii.C: ************************************************/ /* CVS info: $Header$ Tag : $Name$ Modified: $Date$ */ // Standard C++ and STL includes // Local project includes #include "ptdrHistogramStyleAscii.h" #include #include "TString.h" ClassImp(TPTDRHistogramStyleAscii); TH1F* TPTDRHistogramStyleAscii::AddHistogram(TString variableName, TString fileName, TString lName, Int_t nBins, Double_t min, Double_t max, Double_t weight, Int_t variableIndex) { ifstream ifs(fileName); Double_t variable; TH1F* hist = new TH1F(variableName, variableName, nBins, min, max);//bins,min,max if(min==0 && max==0) hist->SetBit(TH1::kCanRebin); vector variables; Double_t btag1,btag2,ptj1,ptj2,m12,eta2,mtop,pttop,sigmat,ht,mtb; while(ifs >> btag1 >> btag2 >> ptj1 >> ptj2 >> m12 >> eta2 >> mtop >> pttop >> sigmat >> ht >> mtb){ variables.push_back(btag1); variables.push_back(btag2); variables.push_back(ptj1); variables.push_back(ptj2); variables.push_back(m12); variables.push_back(eta2); variables.push_back(mtop); variables.push_back(pttop); variables.push_back(sigmat); variables.push_back(ht); variables.push_back(mtb); variable=variables[variableIndex]; hist->Fill(variable); if(variable>max) max=variable; if(variableSetFillStyle(hatchStyles[nHists]); if(colored){ hist->SetFillColor(nHists+101); hist->SetFillStyle(1001); } else hist->SetFillColor(1); hist->Scale(weight); hist->GetXaxis()->SetTitle("GeV/c"); hist->SetDirectory(0);//avoid removing the histograms from the memory THStack::Add(hist); legendNames.push_back(lName); nHists++; return hist; } #if 0 /* ****************************** LOG MESSAGES ****************************** */ /* - $Log$ */ /* **************************** END LOG MESSAGES **************************** */ #endif