PamCut: CollectionActions/EvRateS11VsCutoffHistoAction/EvRateS11VsCutoffHistoAction.cpp Source File

- Main Page
- Classes
- Files

- File List
- File Members

# CollectionActions/EvRateS11VsCutoffHistoAction/EvRateS11VsCutoffHistoAction.cpp

Go to the documentation of this file.

    00001 /*
    00002  * EvRateS11VsCutoffHistoAction.cpp
    00003  *
    00004  *  Created on: 21-mag-2009
    00005  *      Author: Nicola Mori
    00006  */
    00007
    00010 #include "EvRateS11VsCutoffHistoAction.h"
    00011
    00012 EvRateS11VsCutoffHistoAction::EvRateS11VsCutoffHistoAction(const char *actionName, TString outFileName) :
    00013   CollectionAction(actionName), _outFileName(outFileName), _histo() {
    00014
    00015   _histo.SetName("histo");
    00016   _histo.SetTitle("Event rate on S11 Vs. Stoermer cutoff");
    00017   _histo.GetXaxis()->SetTitle("Stoermer cutoff (GV)");
    00018   _histo.GetYaxis()->SetTitle("Event rate on S11 (Hz)");
    00019   _histo.SetBins(1000, 0., 16., 1000, 0., 4000.);
    00020 }
    00021
    00022 void EvRateS11VsCutoffHistoAction::OnGood(PamLevel2 *event){
    00023
    00024   int totRate = 0;
    00025   for (int i = 0; i < 16; i++)
    00026     totRate += event->GetTrigLevel2()->pmtcount1[i];
    00027   _histo.Fill(event->GetOrbitalInfo()->GetCutoffSVL(),(float)totRate/16.);
    00028
    00029 }
    00030
    00031 void EvRateS11VsCutoffHistoAction::Finalize(){
    00032
    00033   TFile outFile(_outFileName, "RECREATE");
    00034   outFile.cd();
    00035   _histo.Write();
    00036   //outFile.Close();
    00037 }