#include <EvtHis2F.hh>
Inheritance diagram for EvtHis2F:
Public Member Functions | |
bool | AR (double xmass2, double ymass2, double zmax, TH2F *h2) |
bool | AR (double xmass2, double ymass2) |
EvtHis2F () | |
int | getBINSx () |
int | getBINSy () |
const char * | getFile () |
TH2F * | getHdt () |
TH2F * | getHmc () |
const char * | getHTitle () |
TH2F * | getHwt () |
double | getXlow () |
double | getXup () |
double | getYlow () |
double | getYup () |
double | getZmax () |
double | getZvalue (double m12_square, double m13_square) |
void | HFill (double xmass2, double ymass2) |
void | HReweight () |
void | init (TH2F *hmc, TH2F *hdt, TH2F *hwt) |
void | init () |
void | setBins (TH2F *h2) |
void | setBINSx (int bx) |
void | setBINSy (int by) |
void | setFile (const char *dtfile) |
void | setHdt (TH2F *H2) |
void | setHmc (TH2F *H2) |
void | setHTitle (const char *htitle) |
void | setHwt (TH2F *H2) |
void | setXlow (double xl) |
void | setXup (double xu) |
void | setYlow (double yl) |
void | setYup (double yu) |
void | setZmax (TH2F *H2) |
void | setZmax () |
void | show (TH2F *h2) |
void | showFrame (TH2F *h2) |
virtual | ~EvtHis2F () |
Private Attributes | |
int | BINSx |
int | BINSy |
TFile * | dataf |
const char * | datafile |
const char * | datatitle |
TDirectory | dir |
TH2F * | HDATA |
TH2F * | HMC |
TH2F * | HWT |
int | icount |
double | max1 |
double | max2 |
double | max3 |
TH2F * | WT1 |
TH2F * | WT2 |
TH2F * | WT3 |
double | xlow |
double | xup |
double | ylow |
double | yup |
double | zmax |
|
00033 {}
|
|
00025 {}
|
|
00218 {//accept: true. reject: false 00219 //call this function after initiation and filling MC histogram HMC 00220 bool accept; 00221 accept=false; 00222 setBins(h2); 00223 if(xmass2<xlow || xmass2>xup || ymass2<ylow || ymass2>yup) {return accept;} 00224 int xbin = h2->GetXaxis()->FindBin(xmass2); 00225 int ybin = h2->GetYaxis()->FindBin(ymass2); 00226 int xybin= h2->GetBin(xbin,ybin); 00227 double zvalue=h2->GetBinContent(xybin); 00228 00229 double ratio=zvalue/zmax; 00230 double rndm=EvtRandom::Flat(0.0, 1.0); 00231 // std::cout<<"zvalue, zmax , rndm "<<zvalue<<" "<<zmax<<" "<<rndm<<std::endl; 00232 if(ratio > rndm){accept=true;} else {accept=false;} 00233 return accept; 00234 }
|
|
00205 {//accept: true. reject: false 00206 //call this function after initiation and filling MC histogram HMC 00207 bool accept; 00208 accept=false; 00209 if(xmass2<xlow || xmass2>xup || ymass2<ylow || ymass2>yup) {return accept;} 00210 double zvalue=getZvalue(xmass2,ymass2); 00211 double ratio=zvalue/zmax; 00212 double rndm=EvtRandom::Flat(0.0, 1.0); 00213 // std::cout<<"zvalue, zmax , rndm "<<zvalue<<" "<<zmax<<" "<<rndm<<std::endl; 00214 if(ratio > rndm){accept=true;} else {accept=false;} 00215 return accept; 00216 }
|
|
00064 {return BINSx;}
|
|
00065 {return BINSy;}
|
|
00027 {
00028 return datafile;
00029 }
|
|
00059 {
00060 return HDATA;
00061 }
|
|
00055 {
00056 return HMC;
00057 }
|
|
00031 {
00032 return datatitle;
00033 }
|
|
00063 {
00064 return HWT;
00065 }
|
|
00066 {return xlow;}
|
|
00068 {return xup;}
|
|
00067 {return ylow;}
|
|
00069 {return yup;}
|
|
00192 {
00193 return zmax;
00194 }
|
|
00196 { 00197 int xbin = HWT->GetXaxis()->FindBin(xmass2); 00198 int ybin = HWT->GetYaxis()->FindBin(ymass2); 00199 int xybin= HWT->GetBin(xbin,ybin); 00200 double zvalue=HWT->GetBinContent(xybin); 00201 // std::cout<<"xmass, ymass, zvalue "<<xmass2<<" "<<ymass2<<" "<<zvalue<<std::endl; 00202 return zvalue; 00203 }
|
|
00129 { 00130 HMC->Fill(m12s,m13s,1.0); 00131 icount++; 00132 // if(icount==100000)show(HMC); 00133 if(icount==100000) showFrame(HMC); 00134 return; 00135 }
|
|
00137 { //reweight Dalitz Plot after get HDATA and HMC 00138 std::cout<<"Now I reweight the MC to the data Dalitz Plot"<<std::endl; 00139 double ndata=HDATA->Integral(); 00140 std::cout<<"Number events in Dalitz plot = "<<ndata<<std::endl; 00141 double nmc=HMC->Integral(); 00142 std::cout<<"Number of events in HMC reweight= "<<nmc<<std::endl; 00143 HWT->Divide(HDATA,HMC); 00144 ndata=HWT->Integral(); 00145 std::cout<<"Number of events after reweight= "<<ndata<<std::endl; 00146 double norm=nmc/ndata; 00147 HWT->Scale(norm); 00148 nmc=HMC->Integral(); 00149 std::cout<<"Number of events in HMC after scale= "<<nmc<<std::endl; 00150 }
|
|
00236 { 00237 setHmc(hmc); 00238 setHdt(hdt); 00239 setHwt(hwt); 00240 HReweight(); 00241 setZmax(); 00242 }
|
|
Reimplemented in EvtNT3. 00098 { 00099 const char* dtfile =getFile(); // get data root file as input 00100 const char* htitle =getHTitle(); // get Dalitz plot title 00101 00102 TFile dataf(dtfile); 00103 HDATA = (TH2F*)dataf.Get(htitle); 00104 00105 double ndata=HDATA->Integral(); 00106 std::cout<<"Number events in HDATA= "<<ndata<<std::endl; 00107 00108 TAxis* Xaxis=HDATA->GetXaxis(); 00109 TAxis* Yaxis=HDATA->GetYaxis(); 00110 00111 BINSx =Xaxis->GetLast(); 00112 BINSy =Yaxis->GetLast(); 00113 00114 xlow=Xaxis->GetBinLowEdge(1); 00115 ylow=Yaxis->GetBinLowEdge(1); 00116 xup =Xaxis->GetBinUpEdge(BINSx); 00117 yup =Yaxis->GetBinUpEdge(BINSy); 00118 00119 std::cout<<"BINSx,xlow,xup,BINSy,ylow,yup: "<<BINSx<<" ,"<<xlow<<", "<<xup<<", "<<BINSy<<", "<<ylow<<", "<<yup<<std::endl; 00120 HMC = new TH2F("myHMC","",BINSx,xlow,xup,BINSy,ylow,yup); 00121 HWT = new TH2F("myHWT","",BINSx,xlow,xup,BINSy,ylow,yup); 00122 HMC ->SetDirectory(0); 00123 HWT ->SetDirectory(0); 00124 HDATA->SetDirectory(0); 00125 icount=0; 00126 return; 00127 }
|
|
00152 { 00153 TAxis* Xaxis=h2->GetXaxis(); 00154 TAxis* Yaxis=h2->GetYaxis(); 00155 BINSx =Xaxis->GetLast(); 00156 BINSy =Yaxis->GetLast(); 00157 xlow=Xaxis->GetBinLowEdge(1); 00158 ylow=Yaxis->GetBinLowEdge(1); 00159 xup =Xaxis->GetBinUpEdge(BINSx); 00160 yup =Yaxis->GetBinUpEdge(BINSy); 00161 }
|
|
00056 {BINSx=bx;}
|
|
00057 {BINSy=by;}
|
|
00035 { 00036 datafile=dtfile; 00037 return; 00038 }
|
|
00050 { 00051 HDATA=(TH2F*) H2->Clone("HDATA"); 00052 return; 00053 }
|
|
00045 { 00046 HMC=(TH2F*) H2->Clone("HMC"); 00047 return; 00048 }
|
|
00040 { 00041 datatitle=htitle; 00042 return; 00043 }
|
|
00050 { HWT=(TH2F*) H2->Clone("HWT");}
|
|
00058 {xlow=xl;}
|
|
00059 {xup=xu;}
|
|
00060 {ylow=yl;}
|
|
00061 {yup=yu;}
|
|
00162 { 00163 double ymax=0; 00164 setBins(hwt); 00165 00166 for(int dx=1;dx <= BINSx;dx++){ 00167 for(int dy=1;dy <= BINSy;dy++){ 00168 int nxy=hwt->GetBin(dx,dy); 00169 double ncell=hwt->GetBinContent(nxy); 00170 if(ncell<=0) continue; 00171 if(ncell>ymax){ymax=ncell;} 00172 } 00173 } 00174 zmax=ymax; 00175 }
|
|
00177 { 00178 double ymax=0; 00179 setBins(HWT); 00180 00181 for(int dx=1;dx <= BINSx;dx++){ 00182 for(int dy=1;dy <= BINSy;dy++){ 00183 int nxy=HWT->GetBin(dx,dy); 00184 double ncell=HWT->GetBinContent(nxy); 00185 if(ncell<=0) continue; 00186 if(ncell>ymax){ymax=ncell;} 00187 } 00188 } 00189 zmax=ymax; 00190 }
|
|
00067 { 00068 TAxis* Xaxis=h2->GetXaxis(); 00069 TAxis* Yaxis=h2->GetYaxis(); 00070 00071 int bx =Xaxis->GetLast(); 00072 int by =Yaxis->GetLast(); 00073 00074 for(int i=1;i<bx+1;i++){ 00075 for(int j=1;j<by+1;j++){ 00076 int ij=h2->GetBin(i,j); 00077 double xij=h2->GetBinContent(ij); 00078 std::cout<<"i,j,cell,value "<<i<<" "<<j<<" "<<ij<<" "<<xij<<std::endl; 00079 } 00080 } 00081 }
|
|
00083 { 00084 TAxis* Xaxis=h2->GetXaxis(); 00085 TAxis* Yaxis=h2->GetYaxis(); 00086 00087 int bx =Xaxis->GetLast(); 00088 int by =Yaxis->GetLast(); 00089 00090 double x1 =Xaxis->GetBinLowEdge(1); 00091 double y1 =Yaxis->GetBinLowEdge(1); 00092 double x2 =Xaxis->GetBinUpEdge(bx); 00093 double y2 =Yaxis->GetBinUpEdge(by); 00094 std::cout<<"N_x, x_low, x_up; N_y, y_low, y_up " 00095 <<bx<<" "<<x1<<" "<<x2<<" "<<by<<" "<<y1<<" "<<y2<<std::endl; 00096 }
|
|
|
|
|
|
Reimplemented in EvtNT3. |
|
Reimplemented in EvtNT3. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Reimplemented in EvtNT3. |
|
Reimplemented in EvtNT3. |
|
Reimplemented in EvtNT3. |
|
Reimplemented in EvtNT3. |
|
Reimplemented in EvtNT3. |
|
Reimplemented in EvtNT3. |
|
|
|
|
|
|
|
|
|
|