ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/JetIDMod.cc
Revision: 1.6
Committed: Fri Nov 28 13:07:38 2008 UTC (16 years, 5 months ago) by ceballos
Content type: text/plain
Branch: MAIN
Changes since 1.5: +2 -2 lines
Log Message:
fixing a bug

File Contents

# User Rev Content
1 ceballos 1.6 // $Id: JetIDMod.cc,v 1.5 2008/11/28 09:13:50 loizides Exp $
2 loizides 1.1
3     #include "MitPhysics/Mods/interface/JetIDMod.h"
4     #include "MitCommon/MathTools/interface/MathUtils.h"
5 loizides 1.4 #include "MitPhysics/Init/interface/ModNames.h"
6 loizides 1.1
7     using namespace mithep;
8    
9     ClassImp(mithep::JetIDMod)
10    
11     //--------------------------------------------------------------------------------------------------
12 loizides 1.5 JetIDMod::JetIDMod(const char *name, const char *title) :
13 loizides 1.1 BaseMod(name,title),
14 loizides 1.5 fJetBranchName(Names::gkCaloJetBrn),
15 loizides 1.4 fGoodJetsName(ModNames::gkGoodJetsName),
16 loizides 1.5 fUseJetCorrection(kFALSE),
17     fJetEtCut(15.0),
18     fJets(0)
19 loizides 1.1 {
20     // Constructor.
21     }
22    
23     //--------------------------------------------------------------------------------------------------
24     void JetIDMod::Process()
25     {
26     // Process entries of the tree.
27    
28 loizides 1.5 LoadBranch(fJetBranchName);
29    
30     JetOArr *GoodJets = new JetOArr;
31     GoodJets->SetName(fGoodJetsName);
32 loizides 1.1
33 loizides 1.5 // loop over jets
34 loizides 1.1 for (UInt_t i=0; i<fJets->GetEntries(); ++i) {
35 loizides 1.5 const Jet *jet = fJets->At(i);
36    
37     if (jet->AbsEta() > 5.0)
38     continue;
39 loizides 1.1
40 loizides 1.5 Double_t jetet = jet->Et();
41     if (fUseJetCorrection)
42     jetet *= jet->L2RelativeCorrectionScale() * jet->L3AbsoluteCorrectionScale();
43    
44 ceballos 1.6 if (jetet < fJetEtCut)
45 loizides 1.5 continue;
46 loizides 1.1
47 loizides 1.5 // add good jet to collection
48     GoodJets->Add(jet);
49     }
50 loizides 1.1
51 loizides 1.5 // add to event for other modules to use
52     AddObjThisEvt(GoodJets);
53 loizides 1.1 }
54    
55     //--------------------------------------------------------------------------------------------------
56     void JetIDMod::SlaveBegin()
57     {
58     // Run startup code on the computer (slave) doing the actual analysis. Here,
59 loizides 1.5 // we just request the jet collection branch.
60 loizides 1.1
61 loizides 1.5 ReqBranch(fJetBranchName, fJets);
62 loizides 1.1 }