/[PAMELA software]/PamCut/CollectionActions/EvRateCorrHistoAction/EvRateCorrHistoAction.cpp
ViewVC logotype

Annotation of /PamCut/CollectionActions/EvRateCorrHistoAction/EvRateCorrHistoAction.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Wed Aug 5 13:57:22 2009 UTC (15 years, 5 months ago) by pam-fi
Branch: MAIN
CVS Tags: Root_V8, MergedToHEAD_1, nuclei_reproc, MergedFromV8_1, BeforeMergingFromV8_1, V9, HEAD
Branch point for: V8
Added some new actions.

1 pam-fi 1.1 /*
2     * EvRateCorrHistoAction.cpp
3     *
4     * Created on: 15-giu-2009
5     * Author: mori
6     */
7    
8     /*! @file EvRateCorrHistoAction.cpp The EvRateCorrHistoAction class implementation file. */
9    
10     #include "EvRateCorrHistoAction.h"
11    
12     EvRateCorrHistoAction::EvRateCorrHistoAction(const char *actionName, TString outFileName, TString mode) :
13     CollectionAction(actionName), _outFileName(outFileName), _histo(), _mode(mode) {
14    
15     _histo.SetName(GetName());
16     _histo.SetTitle("Event rate on S11 Vs. Event rate on S12");
17     _histo.GetXaxis()->SetTitle("Event rate on S12 (Hz)");
18     _histo.GetYaxis()->SetTitle("Event rate on S11 (Hz)");
19     _histo.SetBins(100, 0., 4000., 100, 0., 4000.);
20     }
21    
22     void EvRateCorrHistoAction::OnGood(PamLevel2 *event) {
23    
24     int totRateS11 = 0;
25     for (int i = 0; i < 16; i++)
26     totRateS11 += event->GetTrigLevel2()->pmtcount1[i];
27     int totRateS12 = 0;
28     for (int i = 16; i < 24; i++) // First 8 PMTs of S12
29     totRateS12 += event->GetTrigLevel2()->pmtcount1[i];
30     for (int i = 0; i < 4; i++) // Last 4 PMTs of S12
31     totRateS12 += event->GetTrigLevel2()->pmtcount2[i];
32     _histo.Fill((float) totRateS12 / 12., (float) totRateS11 / 16.);
33     }
34    
35     void EvRateCorrHistoAction::Finalize() {
36    
37     TFile outFile(_outFileName, _mode);
38     outFile.cd();
39     _histo.Write();
40     outFile.Close();
41     }

  ViewVC Help
Powered by ViewVC 1.1.23