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

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