ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/JetIDMod.cc
Revision: 1.13
Committed: Tue Mar 3 21:47:34 2009 UTC (16 years, 2 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_008pre1
Changes since 1.12: +5 -3 lines
Log Message:
Update JetId mod to use new Jet correction interface

File Contents

# Content
1 // $Id: JetIDMod.cc,v 1.12 2009/01/24 12:42:08 ceballos 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::gkSC5JetBrn),
15 fGoodJetsName(ModNames::gkGoodJetsName),
16 fUseJetCorrection(kTRUE),
17 fJetPtCut(35.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 jetpt;
41 if (fUseJetCorrection)
42 jetpt = jet->Pt();
43 else
44 jetpt = jet->RawMom().Pt();
45
46 if (jetpt < fJetPtCut)
47 continue;
48
49 // add good jet to collection
50 GoodJets->Add(jet);
51 }
52
53 // sort according to pt
54 GoodJets->Sort();
55
56 // add to event for other modules to use
57 AddObjThisEvt(GoodJets);
58 }
59
60 //--------------------------------------------------------------------------------------------------
61 void JetIDMod::SlaveBegin()
62 {
63 // Run startup code on the computer (slave) doing the actual analysis. Here,
64 // we just request the jet collection branch.
65
66 ReqBranch(fJetBranchName, fJets);
67 }