1 |
ceballos |
1.16 |
// $Id: JetIDMod.cc,v 1.15 2009/03/23 14:23:06 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 |
bendavid |
1.14 |
fJetsName(ModNames::gkPubJetsName),
|
15 |
loizides |
1.4 |
fGoodJetsName(ModNames::gkGoodJetsName),
|
16 |
ceballos |
1.8 |
fUseJetCorrection(kTRUE),
|
17 |
ceballos |
1.16 |
fJetPtCut(35.0),
|
18 |
|
|
fJetEtaMaxCut(5.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.15 |
const JetCol *inJets = GetObjThisEvt<JetCol>(fJetsName);
|
29 |
|
|
if (!inJets) {
|
30 |
|
|
SendError(kAbortModule, "Process",
|
31 |
|
|
"Pointer to input jet collection %s is null.",
|
32 |
|
|
fJetsName.Data());
|
33 |
|
|
return;
|
34 |
|
|
}
|
35 |
loizides |
1.5 |
|
36 |
|
|
JetOArr *GoodJets = new JetOArr;
|
37 |
|
|
GoodJets->SetName(fGoodJetsName);
|
38 |
loizides |
1.1 |
|
39 |
loizides |
1.5 |
// loop over jets
|
40 |
bendavid |
1.14 |
for (UInt_t i=0; i<inJets->GetEntries(); ++i) {
|
41 |
|
|
const Jet *jet = inJets->At(i);
|
42 |
loizides |
1.5 |
|
43 |
ceballos |
1.16 |
if (jet->AbsEta() > fJetEtaMaxCut)
|
44 |
loizides |
1.5 |
continue;
|
45 |
loizides |
1.1 |
|
46 |
bendavid |
1.13 |
Double_t jetpt;
|
47 |
loizides |
1.5 |
if (fUseJetCorrection)
|
48 |
bendavid |
1.13 |
jetpt = jet->Pt();
|
49 |
|
|
else
|
50 |
|
|
jetpt = jet->RawMom().Pt();
|
51 |
loizides |
1.5 |
|
52 |
ceballos |
1.10 |
if (jetpt < fJetPtCut)
|
53 |
loizides |
1.5 |
continue;
|
54 |
loizides |
1.1 |
|
55 |
loizides |
1.5 |
// add good jet to collection
|
56 |
|
|
GoodJets->Add(jet);
|
57 |
|
|
}
|
58 |
loizides |
1.7 |
|
59 |
|
|
// sort according to pt
|
60 |
|
|
GoodJets->Sort();
|
61 |
loizides |
1.1 |
|
62 |
loizides |
1.5 |
// add to event for other modules to use
|
63 |
|
|
AddObjThisEvt(GoodJets);
|
64 |
loizides |
1.1 |
}
|
65 |
|
|
|