///////////////////////////////////////////////////////////////////////////////
/// \file detection.cc
///
/// \brief This extracts the MC Photoelectron count
///
/// \author P G Jones
///
/// REVISION HISTORY:\n
/// 2014-07-21 : P G Jones - moved to rat-tools validation.\n
///
/// \details This plots the number of photoelectrons, i.e. the number of photons
/// that hit the photocathode and are absorbed.
///
///////////////////////////////////////////////////////////////////////////////
#include
#include
#include
#include
void make_plots( RAT::DU::DSReader* dsReader, TFile *out_file )
{
TH1D* hNhits = new TH1D( "nHits", "nHits", 200, 0.0, 2000.0 );
hNhits->SetXTitle( "Number of hits per event." );
hNhits->SetYTitle( "Count per 10 hit bin." );
for( size_t iEntry = 0; iEntry < dsReader->GetEntryCount(); iEntry++ )
{
const RAT::DS::Entry& rDS = dsReader->GetEntry( iEntry );
hNhits->Fill( rDS.GetMC().GetMCPECount() );
}
out_file->cd();
hNhits->Write();
}