2 TH1 *h2fast, *h2full, *h3fast, *h3full;
6 void testPmtSignal(
float pmtGain=1.5e+6,
float cathodeNoise=0.0,
float dynodeNoise=0.0) {
7 gROOT->Macro(
"LoadLogger.C");
8 gSystem->Load(
"StChain");
9 gSystem->Load(
"StMcEvent");
10 gSystem->Load(
"StEmcSimulatorMaker");
11 cout <<
"loaded libraries" << endl;
13 gStyle->SetOptStat(0);
17 float maxEnergy = 60.0;
18 float photoElectronsPerMIP = 63.0;
19 float energyPerMIP = 0.0198;
20 float samplingFraction = 14.1;
21 float totalGain = (maxAdc / maxEnergy) * (energyPerMIP / photoElectronsPerMIP) * samplingFraction;
22 p.setTotalGain(totalGain);
23 p.setPedestalMean(30.0);
24 p.setPedestalRMS(1.5);
26 h1fast =
new TH2D(
"h1fast",
"<ADC> / photoElectrons",50, 0.0, 16000.0, 50, 0.0, 4000.0);
27 h1full =
new TH2D(
"h1full",
"<ADC> / photoElectrons",50, 0.0, 16000.0, 50, 0.0, 4000.0);
29 h2fast =
new TH1D(
"h2fast",
"ADC distributions for 400 photoElectrons",50, 125.0, 175.0);
30 h2full =
new TH1D(
"h2full",
"ADC distributions for 400 photoElectrons",50, 125.0, 175.0);
32 h3fast =
new TH1D(
"h3fast",
"ADC distributions for 8000 photoElectrons",50, 2350.0, 2550.0);
33 h3full =
new TH1D(
"h3full",
"ADC distributions for 8000 photoElectrons",50, 2350.0, 2550.0);
35 for(
int i=0; i<16000; i++) {
36 if(i%1000 == 0) cout <<
"processing " << i << endl;
37 h1fast->Fill(i, p.getAdc(i, StPmtSignal::kFastSimulator));
38 h1full->Fill(i, p.getAdc(i, StPmtSignal::kFullSimulator));
40 h2fast->Fill(p.getAdc(400, StPmtSignal::kFastSimulator));
41 h2full->Fill(p.getAdc(400, StPmtSignal::kFullSimulator));
43 h3fast->Fill(p.getAdc(8000, StPmtSignal::kFastSimulator));
44 h3full->Fill(p.getAdc(8000, StPmtSignal::kFullSimulator));
47 h1fast->SetXTitle(
"nPhotoElectrons");
48 h1fast->SetYTitle(
"ADC");
50 h2fast->SetXTitle(
"ADC");
51 h3fast->SetXTitle(
"ADC");
53 h1full->SetLineColor(kRed);
54 h2full->SetLineColor(kRed);
55 h3full->SetLineColor(kRed);
57 c =
new TCanvas(
"c",
"",900,300);
62 h1full->Draw(
"box same");
64 leg =
new TLegend(0.1,0.7,0.5,0.9);
65 leg->AddEntry(h1fast,
"fastSimulator");
66 leg->AddEntry(h1full,
"fullSimulator");
69 TVirtualPad * pad = c->cd(2);