00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "EvtGenBase/EvtNT3.hh"
00020 #include <stdlib.h>
00021 #include <string>
00022 #include <fstream>
00023 #include <iostream>
00024
00025 void EvtNT3::init(){
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
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
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);
00063
00064 MC1 = new TH2F("myMC1","",Ncos,-1.0,1.0,ny,m23_low,m23_up);
00065 MC2 = new TH2F("myMC2","",Ncos,-1.0,1.0,ny,m13_low,m13_up);
00066 MC3 = new TH2F("myMC3","",Ncos,-1.0,1.0,ny,m12_low,m12_up);
00067
00068 DT1 = new TH2F("myDT1","",Ncos,-1.0,1.0,ny,m23_low,m23_up);
00069 DT2 = new TH2F("myDT2","",Ncos,-1.0,1.0,ny,m13_low,m13_up);
00070 DT3 = new TH2F("myDT3","",Ncos,-1.0,1.0,ny,m12_low,m12_up);
00071
00072 WT1 = new TH2F("myWT1","",Ncos,-1.0,1.0,ny,m23_low,m23_up);
00073 WT2 = new TH2F("myWT2","",Ncos,-1.0,1.0,ny,m13_low,m13_up);
00074 WT3 = new TH2F("myWT3","",Ncos,-1.0,1.0,ny,m12_low,m12_up);
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
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
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
00104
00105
00106
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
00124
00125
00126
00127
00128
00129
00130 }
00131
00132
00133 int EvtNT3::calculateBins(int entries){
00134 int bins,ncell;
00135 ncell=30;
00136 bins=entries/ncell/Ncos;
00137 if(bins>100){bins=100;}
00138 return bins;
00139 }
00140
00141
00142 bool EvtNT3::AR1(double costheta, double mass){
00143 bool accept=false;
00144 accept= EvtHis2F::AR(costheta,mass,max1,WT1);
00145
00146
00147
00148 return accept;
00149 }
00150
00151 bool EvtNT3::AR2(double costheta, double mass){
00152 bool accept=false;
00153 accept= EvtHis2F::AR(costheta,mass,max2,WT2);
00154
00155 return accept;
00156 }
00157
00158
00159 bool EvtNT3::AR3(double costheta, double mass){
00160 bool accept=false;
00161 accept= EvtHis2F::AR(costheta,mass,max3,WT3);
00162
00163 return accept;
00164 }
00165