1 |
// $Id: PFTauIDMod.cc,v 1.1 2010/07/18 21:15:19 ceballos Exp $
|
2 |
|
3 |
#include "MitPhysics/Mods/interface/PFTauIDMod.h"
|
4 |
#include "MitPhysics/Init/interface/ModNames.h"
|
5 |
#include "MitAna/DataTree/interface/PFTauCol.h"
|
6 |
|
7 |
using namespace mithep;
|
8 |
|
9 |
ClassImp(mithep::PFTauIDMod)
|
10 |
|
11 |
//------------------------------------------------------------------------------
|
12 |
PFTauIDMod::PFTauIDMod(const char *name, const char *title) :
|
13 |
BaseMod(name,title),
|
14 |
fPFTausName(Names::gkPFTauBrn),
|
15 |
fGoodPFTausName(ModNames::gkGoodPFTausName),
|
16 |
fPtMin(15.0),
|
17 |
fPtLeadChargedHadronPFCandMin(5.0),
|
18 |
fIsoChargedHadronPtSumMax(2.0),
|
19 |
fIsoGammaEtSumMax(3.0),
|
20 |
fSignalMassMin(0.13),
|
21 |
fSignalMassMax(2.00),
|
22 |
fPFTaus(0)
|
23 |
{
|
24 |
// Constructor.
|
25 |
}
|
26 |
|
27 |
//------------------------------------------------------------------------------
|
28 |
void PFTauIDMod::Process()
|
29 |
{
|
30 |
// Process entries of the tree.
|
31 |
|
32 |
LoadBranch(fPFTausName);
|
33 |
|
34 |
PFTauOArr *GoodTaus = new PFTauOArr;
|
35 |
GoodTaus->SetName(fGoodPFTausName);
|
36 |
|
37 |
for (UInt_t i=0; i<fPFTaus->GetEntries(); ++i) {
|
38 |
const PFTau *tau = fPFTaus->At(i);
|
39 |
|
40 |
if (tau->NSignalPFCands() == 0)
|
41 |
continue;
|
42 |
|
43 |
CompositeParticle tauSystem;
|
44 |
CompositeParticle tauChargedSystem;
|
45 |
UInt_t nTrk = 0;
|
46 |
for (UInt_t j=0; j<tau->NSignalPFCands(); ++j) {
|
47 |
tauSystem.AddDaughter(tau->SignalPFCand(j));
|
48 |
if(tau->SignalPFCand(j) != 0 &&
|
49 |
tau->SignalPFCand(j)->Charge() != 0){
|
50 |
nTrk++;
|
51 |
tauChargedSystem.AddDaughter(tau->SignalPFCand(j));
|
52 |
}
|
53 |
}
|
54 |
|
55 |
if (tauSystem.Pt() <= fPtMin)
|
56 |
continue;
|
57 |
|
58 |
if (nTrk != 1 && nTrk != 3)
|
59 |
continue;
|
60 |
|
61 |
if(!tau->LeadChargedHadronPFCand())
|
62 |
continue;
|
63 |
|
64 |
if(tau->LeadChargedHadronPFCand()->Pt() <= fPtLeadChargedHadronPFCandMin)
|
65 |
continue;
|
66 |
|
67 |
if (TMath::Abs(tau->Charge()) != 1)
|
68 |
continue;
|
69 |
|
70 |
if (tau->IsoChargedHadronPtSum() >= fIsoChargedHadronPtSumMax)
|
71 |
continue;
|
72 |
|
73 |
if (tau->IsoGammaEtSum() >= fIsoGammaEtSumMax)
|
74 |
continue;
|
75 |
|
76 |
if (tauChargedSystem.Mass() <= fSignalMassMin || tauChargedSystem.Mass() >= fSignalMassMax)
|
77 |
continue;
|
78 |
|
79 |
// add good tau to output collection
|
80 |
GoodTaus->Add(tau);
|
81 |
}
|
82 |
|
83 |
// sort according to pt
|
84 |
GoodTaus->Sort();
|
85 |
|
86 |
// add to event for other modules to use
|
87 |
AddObjThisEvt(GoodTaus);
|
88 |
}
|
89 |
|
90 |
//------------------------------------------------------------------------------
|
91 |
void PFTauIDMod::SlaveBegin()
|
92 |
{
|
93 |
// Run startup code on the computer (slave) doing the actual analysis. Here,
|
94 |
// we just request the Tau collection branch.
|
95 |
|
96 |
ReqBranch(fPFTausName, fPFTaus);
|
97 |
}
|