#include <EvtNT3.hh>
Inheritance diagram for EvtNT3:
Public Member Functions | |
bool | AR (double xmass2, double ymass2, double zmax, TH2F *h2) |
bool | AR (double xmass2, double ymass2) |
bool | AR1 (double costheta, double mass) |
bool | AR2 (double costheta, double mass) |
bool | AR3 (double costheta, double mass) |
int | calculateBins (int entries) |
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 | setDTfile (const char *name) |
void | setFile (const char *dtfile) |
void | setHdt (TH2F *H2) |
void | setHmc (TH2F *H2) |
void | setHTitle (const char *htitle) |
void | setHwt (TH2F *H2) |
void | setMCfile (const char *name) |
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) |
Private Attributes | |
TChain * | chainDT |
TChain * | chainMC |
double | costheta1 |
double | costheta2 |
double | costheta3 |
TFile * | dataf |
const char * | datafile |
TH2F * | DT1 |
TH2F * | DT2 |
TH2F * | DT3 |
int | entriesDT |
int | entriesMC |
double | m12 |
double | m12_low |
double | m12_up |
double | m13 |
double | m13_low |
double | m13_up |
double | m23 |
double | m23_low |
double | m23_up |
double | max |
double | max1 |
double | max2 |
double | max3 |
TH2F * | MC1 |
TH2F * | MC2 |
TH2F * | MC3 |
TFile * | mcf |
const char * | mcfile |
int | Ncos |
int | Nmass |
TH2F * | WT1 |
TH2F * | WT2 |
TH2F * | WT3 |
|
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 }
|
|
00142 { 00143 bool accept=false; 00144 accept= EvtHis2F::AR(costheta,mass,max1,WT1); 00145 //--- debugging 00146 // std::cout<<"Max_mass= "<<getZmax()<<std::endl; 00147 00148 return accept; 00149 }
|
|
00151 { 00152 bool accept=false; 00153 accept= EvtHis2F::AR(costheta,mass,max2,WT2); 00154 00155 return accept; 00156 }
|
|
00159 { 00160 bool accept=false; 00161 accept= EvtHis2F::AR(costheta,mass,max3,WT3); 00162 00163 return accept; 00164 }
|
|
00133 { 00134 int bins,ncell; 00135 ncell=30; //at lease to require each cell to have 30 events 00136 bins=entries/ncell/Ncos; 00137 if(bins>100){bins=100;} 00138 return bins; 00139 }
|
|
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 from EvtHis2F. 00025 { 00026 max=0; 00027 Ncos=20; 00028 chainMC = new TChain("mc"); 00029 chainDT = new TChain("data"); 00030 00031 chainMC->SetDirectory(0); 00032 chainDT->SetDirectory(0); 00033 00034 chainMC->Add(mcfile); 00035 chainDT->Add(datafile); 00036 //--MC 00037 chainMC->SetBranchAddress("costheta1",&costheta1); 00038 chainMC->SetBranchAddress("costheta2",&costheta2); 00039 chainMC->SetBranchAddress("costheta3",&costheta3); 00040 chainMC->SetBranchAddress("m12",&m12); 00041 chainMC->SetBranchAddress("m13",&m13); 00042 chainMC->SetBranchAddress("m23",&m23); 00043 //--Data 00044 chainDT->SetBranchAddress("costheta1",&costheta1); 00045 chainDT->SetBranchAddress("costheta2",&costheta2); 00046 chainDT->SetBranchAddress("costheta3",&costheta3); 00047 chainDT->SetBranchAddress("m12",&m12); 00048 chainDT->SetBranchAddress("m13",&m13); 00049 chainDT->SetBranchAddress("m23",&m23); 00050 00051 entriesMC=(Int_t)chainMC->GetEntries(); 00052 entriesDT=(Int_t)chainDT->GetEntries(); 00053 00054 m12_low=chainDT->GetMinimum("m12"); 00055 m13_low=chainDT->GetMinimum("m13"); 00056 m23_low=chainDT->GetMinimum("m23"); 00057 00058 m12_up =chainDT->GetMaximum("m12"); 00059 m13_up =chainDT->GetMaximum("m13"); 00060 m23_up =chainDT->GetMaximum("m23"); 00061 00062 Int_t ny=calculateBins(entriesDT); //bins in mass axisis (Y-axisis) 00063 00064 MC1 = new TH2F("myMC1","",Ncos,-1.0,1.0,ny,m23_low,m23_up); // costheta1 vs. m23 00065 MC2 = new TH2F("myMC2","",Ncos,-1.0,1.0,ny,m13_low,m13_up); // costheta2 vs. m13 00066 MC3 = new TH2F("myMC3","",Ncos,-1.0,1.0,ny,m12_low,m12_up); // costheta3 vs. m12 00067 00068 DT1 = new TH2F("myDT1","",Ncos,-1.0,1.0,ny,m23_low,m23_up); // costheta1 vs. m23 00069 DT2 = new TH2F("myDT2","",Ncos,-1.0,1.0,ny,m13_low,m13_up); // costheta2 vs. m13 00070 DT3 = new TH2F("myDT3","",Ncos,-1.0,1.0,ny,m12_low,m12_up); // costheta3 vs. m12 00071 00072 WT1 = new TH2F("myWT1","",Ncos,-1.0,1.0,ny,m23_low,m23_up); // costheta1 vs. m23 00073 WT2 = new TH2F("myWT2","",Ncos,-1.0,1.0,ny,m13_low,m13_up); // costheta2 vs. m13 00074 WT3 = new TH2F("myWT3","",Ncos,-1.0,1.0,ny,m12_low,m12_up); // costheta3 vs. m12 00075 00076 MC1->SetDirectory(0); 00077 MC2->SetDirectory(0); 00078 MC3->SetDirectory(0); 00079 00080 DT1->SetDirectory(0); 00081 DT2->SetDirectory(0); 00082 DT3->SetDirectory(0); 00083 00084 WT1->SetDirectory(0); 00085 WT2->SetDirectory(0); 00086 WT3->SetDirectory(0); 00087 00088 //filling MC histogram 00089 for(Int_t j=0;j<entriesMC;j++) { 00090 chainMC->GetEntry(j); 00091 MC1->Fill(costheta1,m23); 00092 MC2->Fill(costheta2,m13); 00093 MC3->Fill(costheta3,m12); 00094 } 00095 00096 //filling data histogram 00097 for(Int_t j=0;j<entriesDT;j++) { 00098 chainDT->GetEntry(j); 00099 DT1->Fill(costheta1,m23); 00100 DT2->Fill(costheta2,m13); 00101 DT3->Fill(costheta3,m12); 00102 } 00103 //--------debugging --------- 00104 // showFrame(MC1); 00105 // showFrame(MC2); 00106 // showFrame(MC3); 00107 00108 EvtHis2F::init(MC1,DT1,WT1); 00109 WT1 = EvtHis2F::getHwt(); 00110 max1 = EvtHis2F::getZmax(); 00111 00112 EvtHis2F::init(MC2,DT2,WT2); 00113 WT2 = EvtHis2F::getHwt(); 00114 max2 = EvtHis2F::getZmax(); 00115 00116 EvtHis2F::init(MC3,DT3,WT3); 00117 WT3 = EvtHis2F::getHwt(); 00118 max3 = EvtHis2F::getZmax(); 00119 00120 //------------ 00121 00122 /* 00123 show(WT1); 00124 std::cout<<"================================================="<<std::endl; 00125 show(WT2); 00126 std::cout<<"================================================="<<std::endl; 00127 show(WT3); 00128 */ 00129 00130 }
|
|
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 {datafile=name;}
|
|
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");}
|
|
00036 {mcfile=name;}
|
|
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 from EvtHis2F. |
|
Reimplemented from EvtHis2F. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Reimplemented from EvtHis2F. |
|
Reimplemented from EvtHis2F. |
|
Reimplemented from EvtHis2F. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Reimplemented from EvtHis2F. |
|
Reimplemented from EvtHis2F. |
|
Reimplemented from EvtHis2F. |