1 |
// $Id: TauIDMod.cc,v 1.7 2009/04/09 11:24:58 loizides Exp $
|
2 |
|
3 |
#include "MitPhysics/Mods/interface/TauIDMod.h"
|
4 |
#include "MitPhysics/Init/interface/ModNames.h"
|
5 |
#include "MitAna/DataTree/interface/CaloTauCol.h"
|
6 |
|
7 |
using namespace mithep;
|
8 |
|
9 |
ClassImp(mithep::TauIDMod)
|
10 |
|
11 |
//------------------------------------------------------------------------------
|
12 |
TauIDMod::TauIDMod(const char *name, const char *title) :
|
13 |
BaseMod(name,title),
|
14 |
fCaloTausName(Names::gkCaloTauBrn),
|
15 |
fGoodTausName(ModNames::gkGoodTausName),
|
16 |
fPtMin(10.0),
|
17 |
fJetPtMin(20.0),
|
18 |
fLeadTrackPtMin(6.0),
|
19 |
fNSignalTracksMax(3),
|
20 |
fNIsoTracksMax(0),
|
21 |
fSignalTracksMassMax(2.0),
|
22 |
fIsoTrackPtSumMax(5.0),
|
23 |
fEnergyFractionEmMax(0.95),
|
24 |
fHCalEtOverPtMin(0.1),
|
25 |
fCaloTaus(0)
|
26 |
{
|
27 |
// Constructor.
|
28 |
}
|
29 |
|
30 |
//------------------------------------------------------------------------------
|
31 |
void TauIDMod::Process()
|
32 |
{
|
33 |
// Process entries of the tree.
|
34 |
|
35 |
LoadBranch(fCaloTausName);
|
36 |
|
37 |
CaloTauOArr *GoodTaus = new CaloTauOArr;
|
38 |
GoodTaus->SetName(fGoodTausName);
|
39 |
|
40 |
for (UInt_t i=0; i<fCaloTaus->GetEntries(); ++i) {
|
41 |
const CaloTau *tau = fCaloTaus->At(i);
|
42 |
|
43 |
if (tau->Pt() <= fPtMin)
|
44 |
continue;
|
45 |
|
46 |
if (tau->SourceCaloJet()->Pt() <= fJetPtMin)
|
47 |
continue;
|
48 |
|
49 |
if (tau->NSignalTracks() == 0 || tau->NSignalTracks() > fNSignalTracksMax)
|
50 |
continue;
|
51 |
|
52 |
if (!tau->LeadTrack() || tau->LeadTrack()->Pt() < fLeadTrackPtMin)
|
53 |
continue;
|
54 |
|
55 |
if (tau->NIsoTracks() > fNIsoTracksMax)
|
56 |
continue;
|
57 |
|
58 |
if (tau->SignalTracksMass() > fSignalTracksMassMax)
|
59 |
continue;
|
60 |
|
61 |
if (tau->IsoTrackPtSum() > fIsoTrackPtSumMax)
|
62 |
continue;
|
63 |
|
64 |
if (tau->SourceCaloJet()->EnergyFractionEm() > fEnergyFractionEmMax)
|
65 |
continue;
|
66 |
|
67 |
if (tau->LeadTrack3x3HCalEt()/tau->LeadTrack()->Pt() < fHCalEtOverPtMin)
|
68 |
continue;
|
69 |
|
70 |
// always apply these requirements
|
71 |
if (TMath::Abs(tau->Charge()) != 1)
|
72 |
continue;
|
73 |
|
74 |
if (TMath::Abs(TMath::Abs(tau->Eta())-1.53) < 0.02)
|
75 |
continue;
|
76 |
|
77 |
// add good tau to output collection
|
78 |
GoodTaus->Add(tau);
|
79 |
}
|
80 |
|
81 |
// sort according to pt
|
82 |
GoodTaus->Sort();
|
83 |
|
84 |
// add to event for other modules to use
|
85 |
AddObjThisEvt(GoodTaus);
|
86 |
}
|
87 |
|
88 |
//------------------------------------------------------------------------------
|
89 |
void TauIDMod::SlaveBegin()
|
90 |
{
|
91 |
// Run startup code on the computer (slave) doing the actual analysis. Here,
|
92 |
// we just request the Tau collection branch.
|
93 |
|
94 |
ReqBranch(fCaloTausName, fCaloTaus);
|
95 |
}
|