//$Id$ // Author: Anders Vestbo //*-- Copyright © ASV #include #include "AliL3Logging.h" #include "AliL3HistogramAdaptive.h" #include "AliL3Transform.h" #include "AliL3Track.h" //_____________________________________________________________ // AliL3HistogramAdaptive // // 2D histogram class ClassImp(AliL3HistogramAdaptive) AliL3HistogramAdaptive::AliL3HistogramAdaptive() : AliL3Histogram() { } AliL3HistogramAdaptive::AliL3HistogramAdaptive(Char_t *name,Double_t minpt,Double_t maxpt,Double_t ptres, Int_t nybins,Double_t ymin,Double_t ymax) { strcpy(fName,name); fPtres = ptres; fXmin = -1*AliL3Transform::GetBFact()*AliL3Transform::GetBField()/minpt; fXmax = AliL3Transform::GetBFact()*AliL3Transform::GetBField()/minpt; fPtstep = 0.1; fMinPt = minpt; fMaxPt = maxpt; fNxbins = InitPtBins(); //cout<<"Setting "< fMaxPt) break; local_pt += delta_pt; bin++; } //cout<<"Setting "< fMaxPt) return -1; Double_t delta_pt,ptplus1,pt = fMinPt,local_pt; Bool_t found=kFALSE; Int_t bin=0; while(pt < fMaxPt + fPtstep) { local_pt = pt; delta_pt = fPtres*(local_pt+0.5*fPtstep); while(local_pt < pt + fPtstep) { ptplus1 = local_pt + delta_pt; if(ptfind >= local_pt && ptfind < ptplus1) { found=kTRUE; break; } local_pt = ptplus1; bin++; } if(found) break; pt += fPtstep; } if(bin >= fNxbins/2) cerr<<"AliL3HistogramAdaptive::FindXbin : Bin out of range : "< fYmax) return 0; return 1 + (Int_t)(fNybins*(y-fYmin)/(fYmax-fYmin)); } Double_t AliL3HistogramAdaptive::GetBinCenterX(Int_t xbin) { if(xbin < 0 || xbin > fNxbins) { cerr<<"AliL3HistogramAdaptive::GetBinCenterX : Xbin out of range "<Fill(kappa,psi,content); } } fRootHisto->Draw(option); return; #endif cerr<<"AliL3HistogramAdaptive::Draw : You need to compile with ROOT in order to draw histogram"<