ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/JetIDMod.cc
Revision: 1.17
Committed: Mon Jun 15 15:00:21 2009 UTC (15 years, 10 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_011a, Mit_011, Mit_010a, Mit_010, Mit_009c, Mit_009b
Changes since 1.16: +2 -1 lines
Log Message:
Added proper fwd defs plus split up complilation of MitAna/DataTree LinkDefs.

File Contents

# Content
1 // $Id: JetIDMod.cc,v 1.16 2009/05/09 18:35:57 ceballos Exp $
2
3 #include "MitPhysics/Mods/interface/JetIDMod.h"
4 #include "MitCommon/MathTools/interface/MathUtils.h"
5 #include "MitAna/DataTree/interface/JetCol.h"
6 #include "MitPhysics/Init/interface/ModNames.h"
7
8 using namespace mithep;
9
10 ClassImp(mithep::JetIDMod)
11
12 //--------------------------------------------------------------------------------------------------
13 JetIDMod::JetIDMod(const char *name, const char *title) :
14 BaseMod(name,title),
15 fJetsName(ModNames::gkPubJetsName),
16 fGoodJetsName(ModNames::gkGoodJetsName),
17 fUseJetCorrection(kTRUE),
18 fJetPtCut(35.0),
19 fJetEtaMaxCut(5.0)
20 {
21 // Constructor.
22 }
23
24 //--------------------------------------------------------------------------------------------------
25 void JetIDMod::Process()
26 {
27 // Process entries of the tree.
28
29 const JetCol *inJets = GetObjThisEvt<JetCol>(fJetsName);
30 if (!inJets) {
31 SendError(kAbortModule, "Process",
32 "Pointer to input jet collection %s is null.",
33 fJetsName.Data());
34 return;
35 }
36
37 JetOArr *GoodJets = new JetOArr;
38 GoodJets->SetName(fGoodJetsName);
39
40 // loop over jets
41 for (UInt_t i=0; i<inJets->GetEntries(); ++i) {
42 const Jet *jet = inJets->At(i);
43
44 if (jet->AbsEta() > fJetEtaMaxCut)
45 continue;
46
47 Double_t jetpt;
48 if (fUseJetCorrection)
49 jetpt = jet->Pt();
50 else
51 jetpt = jet->RawMom().Pt();
52
53 if (jetpt < fJetPtCut)
54 continue;
55
56 // add good jet to collection
57 GoodJets->Add(jet);
58 }
59
60 // sort according to pt
61 GoodJets->Sort();
62
63 // add to event for other modules to use
64 AddObjThisEvt(GoodJets);
65 }
66