9 |
|
|
10 |
#include "EvRateS11VsCutoffHistoAction.h" |
#include "EvRateS11VsCutoffHistoAction.h" |
11 |
|
|
12 |
EvRateS11VsCutoffHistoAction::EvRateS11VsCutoffHistoAction(const char *actionName, TString outFileName) : |
EvRateS11VsCutoffHistoAction::EvRateS11VsCutoffHistoAction(const char *actionName, TString outFileName, TString mode) : |
13 |
CollectionAction(actionName), _outFileName(outFileName), _histo() { |
CollectionAction(actionName), _outFileName(outFileName), _histo(), _mode(mode) { |
14 |
|
|
15 |
_histo.SetName("histo"); |
_histo.SetName(GetName()); |
16 |
_histo.SetTitle("Event rate on S11 Vs. Stoermer cutoff"); |
_histo.SetTitle("Event rate on S11 Vs. Stoermer cutoff"); |
17 |
_histo.GetXaxis()->SetTitle("Stoermer cutoff (GV)"); |
_histo.GetXaxis()->SetTitle("Stoermer cutoff (GV)"); |
18 |
_histo.GetYaxis()->SetTitle("Event rate on S11 (Hz)"); |
_histo.GetYaxis()->SetTitle("Event rate on S11 (Hz)"); |
19 |
_histo.SetBins(1000, 0., 16., 1000, 0., 4000.); |
_histo.SetBins(100, 0., 16., 1000, 0., 4000.); |
20 |
} |
} |
21 |
|
|
22 |
void EvRateS11VsCutoffHistoAction::OnGood(PamLevel2 *event){ |
void EvRateS11VsCutoffHistoAction::OnGood(PamLevel2 *event) { |
23 |
|
|
24 |
int totRate = 0; |
int totRate = 0; |
25 |
for (int i = 0; i < 16; i++) |
for (int i = 0; i < 16; i++) |
26 |
totRate += event->GetTrigLevel2()->pmtcount1[i]; |
totRate += event->GetTrigLevel2()->pmtcount1[i]; |
27 |
_histo.Fill(event->GetOrbitalInfo()->GetCutoffSVL(),(float)totRate/16.); |
_histo.Fill(event->GetOrbitalInfo()->GetCutoffSVL(), (float) totRate / 16.); |
28 |
|
|
29 |
} |
} |
30 |
|
|
31 |
void EvRateS11VsCutoffHistoAction::Finalize(){ |
void EvRateS11VsCutoffHistoAction::Finalize() { |
32 |
|
|
33 |
TFile outFile(_outFileName, "RECREATE"); |
TFile outFile(_outFileName, _mode); |
34 |
outFile.cd(); |
outFile.cd(); |
35 |
_histo.Write(); |
_histo.Write(); |
36 |
//outFile.Close(); |
outFile.Close(); |
37 |
} |
} |