5 void trighistcombiner(
const char* filelistname=
"trigevent.list")
8 const int nTriggers = 12;
9 int triggers[nTriggers] = {117001,137221,137222,137822,117300,137571,137575,137585,137586,137611,137501,137622};
10 gROOT->Macro(
"LoadLogger.C");
11 gROOT->Macro(
"loadMuDst.C");
12 gSystem->Load(
"StDaqLib");
13 gSystem->Load(
"StDetectorDbMaker");
14 gSystem->Load(
"St_db_Maker");
15 gSystem->Load(
"StEmcRawMaker");
16 gSystem->Load(
"StEmcADCtoEMaker");
17 gSystem->Load(
"StTriggerUtilities");
18 gSystem->Load(
"StTriggerStudyMaker");
20 TFile outfile(
"trighists.root",
"RECREATE");
22 const char* dbTime =
"2006-03-14 15:09:26";
25 StEmcGeom* mEmcGeom = StEmcGeom::instance(
"bemc");
28 ifstream filelist(filelistname);
32 TH1F* zverttrig[nTriggers];
33 TH1F* bbcttrig[nTriggers];
44 if(!filelist.good())
break;
45 TFile inputfile(file,
"READ");
46 if(!inputfile.IsOpen())
continue;
48 zvertall = (TH1F*)inputfile.Get(
"zvertall");
49 bbctall = (TH1F*)inputfile.Get(
"bbctall");
50 jp1et = (TH1F*)inputfile.Get(
"jp1et");
51 jp2et = (TH1F*)inputfile.Get(
"jp2et");
52 jp1et0 = (TH1F*)inputfile.Get(
"jp1et0");
53 jp0et0 = (TH1F*)inputfile.Get(
"jp0et0");
54 jp1eff = (TH1F*)jp0et0->Clone(
"jp1eff");
55 jp2eff = (TH1F*)jp1et->Clone(
"jp2eff");
58 for(
int i = 0; i < nTriggers; i++){
59 trigmap[triggers[i]] = i;;
61 sprintf(namez,
"zvert%i",triggers[i]);
62 zverttrig[i] = (TH1F*)inputfile.Get(namez);
64 sprintf(nameb,
"bbct%i",triggers[i]);
65 bbcttrig[i] = (TH1F*)inputfile.Get(nameb);
69 dumhist = (TH1F*)inputfile.Get(
"zvertall");
70 zvertall->Add(dumhist);
72 dumhist = (TH1F*)inputfile.Get(
"bbctall");
73 bbctall->Add(dumhist);
75 dumhist = (TH1F*)inputfile.Get(
"jp1et");
78 dumhist = (TH1F*)inputfile.Get(
"jp2et");
81 dumhist = (TH1F*)inputfile.Get(
"jp0et0");
84 dumhist = (TH1F*)inputfile.Get(
"jp1et0");
87 for(
int i = 0; i < nTriggers; i++){
89 sprintf(namez,
"zvert%i",triggers[i]);
90 dumhist = (TH1F*)inputfile.Get(namez);
91 zverttrig[i]->Add(dumhist);
94 sprintf(nameb,
"bbct%i",triggers[i]);
95 dumhist = (TH1F*)inputfile.Get(nameb);
96 bbcttrig[i]->Add(dumhist);
104 for(
int i = 1; i <= jp1eff->GetNbinsX(); i++){
105 float jp1et0c = jp1et0->GetBinContent(i);
106 float jp0et0c = jp0et0->GetBinContent(i);
107 float jp1etc = jp1et->GetBinContent(i);
108 float jp2etc = jp2et->GetBinContent(i);
109 float jp1efferr = TMath::Sqrt(jp1et0c/(jp0et0c*jp0et0c) + (jp1et0c*jp1et0c)/(jp0et0c*jp0et0c*jp0et0c));
110 float jp2efferr = TMath::Sqrt(jp2etc/(jp1etc*jp1etc) + (jp2etc*jp2etc)/(jp1etc*jp1etc*jp1etc));
111 jp1eff->SetBinContent(i,jp1et0c/jp0et0c);
112 jp1eff->SetBinError(i,jp1efferr);
113 jp2eff->SetBinContent(i,jp2etc/jp1etc);
114 jp2eff->SetBinError(i,jp2efferr);
117 jp1eff->SetTitle(
"JP1 Efficiency");
118 jp2eff->SetTitle(
"JP2 Efficiency");
119 jp1eff->GetYaxis()->SetRangeUser(0,1.2);
120 jp2eff->GetYaxis()->SetRangeUser(0,1.2);
131 for(
int i = 0; i < nTriggers; i++){
132 zverttrig[i]->Write();
133 bbcttrig[i]->Write();
void loadTables(const char *sqlTime, const char *flavor="ofl")
load directly from DB, no Maker needed