10 string line;
int nRuns;
float nTot;
12 ifstream infile(
"runList584.lis");
14 ofstream outfile(
"lumi_sl11b.csv");
15 outfile<<
"runNumber,nSBB,nBHT3,fDet,Lumi"<<endl;
17 TString iPath=
"/star/data01/pwg/stevens4/wAnalysis/xSecPaper/sl11b/7.14.11/data/R";
18 float lumiTot=0;
float lumiTotErr=0;
26 getline (infile,line);
28 cout<<
"lumiTot="<<lumiTot<<
" +/- "<<sqrt(lumiTotErr)<<endl;
32 string run = line.substr(0,8);
33 int runNum = atoi(run.data());
41 TString fullInpName=iPath; fullInpName+=run;
42 fullInpName+=
".wana.hist.root";
43 fd=
new TFile(fullInpName);
45 tmp=(TH1F*)fd->Get(Form(
"lumi_AbortGap1_coinBin%d",BTH3coinBin));
46 int nAbortGap1=tmp->Integral();
47 tmp=(TH1F*)fd->Get(Form(
"lumi_AbortGap2_coinBin%d",BTH3coinBin));
48 int nAbortGap2=tmp->Integral();
49 float nSBB=nAbortGap1*120/11+nAbortGap2*120/9;
50 tmp=(TH1F*)fd->Get(Form(
"lumi_nBTH3coin_coinBin%d",BTH3coinBin));
51 float nBHT3=tmp->Integral();
52 tmp=(TH1F*)fd->Get(
"lumi_GoodvsT");
53 float fDet=tmp->Integral();
56 float nTrig=(nBHT3-nAbortGap1*110.0/8.0-nAbortGap2*110.0/8.0)*BHT3prescale/fDet;
57 float lumi=nTrig/BHT3xs;
60 if(nBHT3>0.) lumiErr=lumi/sqrt(nBHT3);
61 else cout<<runNum<<
","<<nBHT3<<endl;
62 lumiTotErr+=lumiErr*lumiErr;
64 outfile<<runNum<<
","<<nSBB<<
","<<nBHT3<<
","<<fDet<<
","<<lumi<<
","<<lumiErr<<endl;