ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/grimes/VHbbAnalysisCode/src/ElectronInfoPlotSet.cpp
Revision: 1.2
Committed: Wed Aug 15 22:37:47 2012 UTC (12 years, 8 months ago) by grimes
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +9 -10 lines
Log Message:
Long overdue commit with several new files

File Contents

# User Rev Content
1 grimes 1.1 #include "TrkUpgradeAnalysis/VHbb/interface/ElectronInfoPlotSet.h"
2    
3     #include <stdexcept>
4    
5     #include <TDirectory.h>
6     #include <TH1F.h>
7    
8    
9     trkupgradeanalysis::ElectronInfoPlotSet::ElectronInfoPlotSet()
10 grimes 1.2 : histogramHaveBeenBooked_(false), leptonPlotSet_(false)
11 grimes 1.1 {
12     // No operation besides the initialiser list.
13     }
14    
15     void trkupgradeanalysis::ElectronInfoPlotSet::book( TDirectory* pDirectory )
16     {
17     if( histogramHaveBeenBooked_ ) throw std::runtime_error( "trkupgradeanalysis::ElectronInfoPlotSet::book() - histograms have already been booked" );
18    
19     //
20     // Note that the root file which TDirectory is part of takes ownership of all
21     // of these objects, so I don't need to (and shouldn't) delete them when I'm
22     // finished.
23     //
24 grimes 1.2 leptonPlotSet_.book(pDirectory);
25 grimes 1.1
26 grimes 1.2 pID95_=new TH1F( "id95", "id95", 9, -0.5, 8.5 );
27     pID95_->SetDirectory(pDirectory);
28 grimes 1.1
29     histogramHaveBeenBooked_=true;
30     }
31    
32 grimes 1.2 void trkupgradeanalysis::ElectronInfoPlotSet::fill( const VHbbEvent::ElectronInfo& electron, const VHbbEventAuxInfo* pAuxInfo )
33 grimes 1.1 {
34     if( !histogramHaveBeenBooked_ ) throw std::runtime_error( "trkupgradeanalysis::ElectronInfoPlotSet::book() - histograms have not been booked" );
35    
36 grimes 1.2 leptonPlotSet_.fill( electron, pAuxInfo );
37    
38     pID95_->Fill( electron.id95 );
39    
40 grimes 1.1 }
41