1 |
pam-fi |
1.1 |
/* |
2 |
|
|
* EvRateS11VsCutoffHistoAction.cpp |
3 |
|
|
* |
4 |
|
|
* Created on: 21-mag-2009 |
5 |
|
|
* Author: Nicola Mori |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
/*! @file EvRateS11VsCutoffHistoAction.cpp The EvRateS11VsCutoffHistoAction class implementation file. */ |
9 |
|
|
|
10 |
|
|
#include "EvRateS11VsCutoffHistoAction.h" |
11 |
|
|
|
12 |
pam-fi |
1.2 |
EvRateS11VsCutoffHistoAction::EvRateS11VsCutoffHistoAction(const char *actionName, TString outFileName, TString mode) : |
13 |
|
|
CollectionAction(actionName), _outFileName(outFileName), _histo(), _mode(mode) { |
14 |
pam-fi |
1.1 |
|
15 |
pam-fi |
1.2 |
_histo.SetName(GetName()); |
16 |
pam-fi |
1.1 |
_histo.SetTitle("Event rate on S11 Vs. Stoermer cutoff"); |
17 |
|
|
_histo.GetXaxis()->SetTitle("Stoermer cutoff (GV)"); |
18 |
|
|
_histo.GetYaxis()->SetTitle("Event rate on S11 (Hz)"); |
19 |
pam-fi |
1.4 |
_histo.SetBins(100, 0., 16., 1000, 0., 4000.); |
20 |
pam-fi |
1.1 |
} |
21 |
|
|
|
22 |
pam-fi |
1.2 |
void EvRateS11VsCutoffHistoAction::OnGood(PamLevel2 *event) { |
23 |
pam-fi |
1.1 |
|
24 |
|
|
int totRate = 0; |
25 |
|
|
for (int i = 0; i < 16; i++) |
26 |
|
|
totRate += event->GetTrigLevel2()->pmtcount1[i]; |
27 |
pam-fi |
1.2 |
_histo.Fill(event->GetOrbitalInfo()->GetCutoffSVL(), (float) totRate / 16.); |
28 |
pam-fi |
1.1 |
|
29 |
|
|
} |
30 |
|
|
|
31 |
pam-fi |
1.2 |
void EvRateS11VsCutoffHistoAction::Finalize() { |
32 |
pam-fi |
1.1 |
|
33 |
pam-fi |
1.2 |
TFile outFile(_outFileName, _mode); |
34 |
pam-fi |
1.1 |
outFile.cd(); |
35 |
|
|
_histo.Write(); |
36 |
pam-fi |
1.3 |
outFile.Close(); |
37 |
pam-fi |
1.1 |
} |