ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/grimes/VHbbAnalysisCode/src/MuonInfoPlotSet.cpp
Revision: 1.1
Committed: Tue Feb 14 01:43:16 2012 UTC (13 years, 2 months ago) by grimes
Branch: MAIN
Log Message:
Only added the directory structure in the last commit, this is now the files.

File Contents

# User Rev Content
1 grimes 1.1 #include "TrkUpgradeAnalysis/VHbb/interface/MuonInfoPlotSet.h"
2    
3     #include <stdexcept>
4    
5     #include <TDirectory.h>
6     #include <TH1F.h>
7    
8    
9     trkupgradeanalysis::MuonInfoPlotSet::MuonInfoPlotSet()
10     : histogramHaveBeenBooked_(false)
11     {
12     // No operation besides the initialiser list.
13     }
14    
15     void trkupgradeanalysis::MuonInfoPlotSet::book( TDirectory* pDirectory )
16     {
17     if( histogramHaveBeenBooked_ ) throw std::runtime_error( "trkupgradeanalysis::MuonInfoPlotSet::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    
25    
26     pGlobalChi2_=new TH1F( "globalChi2","Global chi2", 60, 0, 20 );
27     pGlobalChi2_->SetDirectory(pDirectory);
28    
29     pNumberOfPixelHits_=new TH1F( "numberOfPixelHits", "Number of pixel hits", 11, -0.5, 10.5 );
30     pNumberOfPixelHits_->SetDirectory(pDirectory);
31    
32     pNumberOfGlobalHits_=new TH1F( "numberOfGlobalHits", "Number of global hits", 31, -0.5, 30.5 );
33     pNumberOfGlobalHits_->SetDirectory(pDirectory);
34    
35     pNumberOfHits_=new TH1F( "numberOfHits", "Number of hits", 31, -0.5, 30.5 );
36     pNumberOfHits_->SetDirectory(pDirectory);
37    
38     pCategory_=new TH1F( "category", "Category", 60, 0, 20 );
39     pCategory_->SetDirectory(pDirectory);
40    
41     pNumberOfMatches_=new TH1F( "numberOfMatches", "Number of matches", 16, -0.5, 15.5 );
42     pNumberOfMatches_->SetDirectory(pDirectory);
43    
44     pIPDB_=new TH1F( "ipDb", "ipDb, whatever that means", 60, 0, 2 );
45     pIPDB_->SetDirectory(pDirectory);
46    
47     pEta_=new TH1F( "eta", "Eta", 60, -3, 3 );
48     pEta_->SetDirectory(pDirectory);
49    
50     pPt_=new TH1F( "pT", "pT", 60, 0, 250 );
51     pPt_->SetDirectory(pDirectory);
52    
53     histogramHaveBeenBooked_=true;
54     }
55    
56     void trkupgradeanalysis::MuonInfoPlotSet::fill( const VHbbEvent::MuonInfo& muon )
57     {
58     if( !histogramHaveBeenBooked_ ) throw std::runtime_error( "trkupgradeanalysis::MuonInfoPlotSet::book() - histograms have not been booked" );
59    
60     pGlobalChi2_->Fill( muon.globChi2 );
61     pNumberOfPixelHits_->Fill( muon.nPixelHits );
62     pNumberOfGlobalHits_->Fill( muon.globNHits );
63     pNumberOfHits_->Fill( muon.nHits );
64     pCategory_->Fill( muon.cat );
65     pNumberOfMatches_->Fill( muon.nMatches );
66     pIPDB_->Fill( muon.ipDb );
67     pEta_->Fill( muon.p4.Eta() );
68     pPt_->Fill( muon.p4.Pt() );
69     }
70