ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/PhysicsMod/src/HLTExampleMod.cc
Revision: 1.2
Committed: Mon May 11 08:00:35 2009 UTC (15 years, 11 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.1: +2 -4 lines
Log Message:
Cosmetics

File Contents

# User Rev Content
1 loizides 1.2 // $Id: HLTExampleMod.cc,v 1.1 2008/11/25 14:30:54 loizides Exp $
2 loizides 1.1
3     #include "MitAna/PhysicsMod/interface/HLTExampleMod.h"
4     #include <TH1D.h>
5    
6     using namespace mithep;
7    
8     ClassImp(mithep::HLTExampleMod)
9    
10     //--------------------------------------------------------------------------------------------------
11     HLTExampleMod::HLTExampleMod(const char *name, const char *title) :
12     BaseMod(name,title),
13     fPtHist(0),
14     fEtaHist(0)
15     {
16     // Constructor.
17     }
18    
19     //--------------------------------------------------------------------------------------------------
20     void HLTExampleMod::Process()
21     {
22     // Process entries of the tree. For this module, we just load
23     // the branch and fill the histograms.
24    
25     const TriggerObjectCol *objs = GetHLTObjects(fObjsName);
26     if (!objs) // this can only happen if HLTMod::SetAbortIfNotAccepted(kFALSE) was called
27     return;
28    
29     Int_t ents=objs->GetEntries();
30     for(Int_t i=0;i<ents;++i) {
31 loizides 1.2 const TriggerObject *to = objs->At(i);
32 loizides 1.1 fPtHist->Fill(to->Pt());
33     fEtaHist->Fill(to->Eta());
34     }
35     }
36    
37     //--------------------------------------------------------------------------------------------------
38     void HLTExampleMod::SlaveBegin()
39     {
40     // Run startup code on the computer (slave) doing the actual
41     // analysis. Here, we typically initialize histograms and
42     // other analysis objects and request branches. For this module,
43     // we request a branch of the MitTree.
44    
45     fPtHist = new TH1D("hPtHist",";p_{t};#",250,0.,500.);
46     AddOutput(fPtHist);
47     fEtaHist = new TH1D("hEtaHist",";#eta;#",160,-8.,8.);
48     AddOutput(fEtaHist);
49     }