ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/TauIDMod.cc
Revision: 1.8
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_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, Mit_011, Mit_010a, Mit_010, Mit_009c, Mit_009b
Changes since 1.7: +2 -1 lines
Log Message:
Added proper fwd defs plus split up complilation of MitAna/DataTree LinkDefs.

File Contents

# User Rev Content
1 loizides 1.8 // $Id: TauIDMod.cc,v 1.7 2009/04/09 11:24:58 loizides Exp $
2 ceballos 1.1
3     #include "MitPhysics/Mods/interface/TauIDMod.h"
4     #include "MitPhysics/Init/interface/ModNames.h"
5 loizides 1.8 #include "MitAna/DataTree/interface/CaloTauCol.h"
6 ceballos 1.1
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 ceballos 1.5 fPtMin(10.0),
17     fJetPtMin(20.0),
18     fLeadTrackPtMin(6.0),
19 ceballos 1.1 fNSignalTracksMax(3),
20     fNIsoTracksMax(0),
21     fSignalTracksMassMax(2.0),
22 ceballos 1.3 fIsoTrackPtSumMax(5.0),
23 ceballos 1.5 fEnergyFractionEmMax(0.95),
24     fHCalEtOverPtMin(0.1),
25 loizides 1.4 fCaloTaus(0)
26 ceballos 1.1 {
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 ceballos 1.5 if (tau->Pt() <= fPtMin)
44 ceballos 1.1 continue;
45    
46 ceballos 1.5 if (tau->SourceCaloJet()->Pt() <= fJetPtMin)
47 ceballos 1.1 continue;
48    
49     if (tau->NSignalTracks() == 0 || tau->NSignalTracks() > fNSignalTracksMax)
50     continue;
51    
52 ceballos 1.5 if (!tau->LeadTrack() || tau->LeadTrack()->Pt() < fLeadTrackPtMin)
53     continue;
54    
55 ceballos 1.1 if (tau->NIsoTracks() > fNIsoTracksMax)
56     continue;
57    
58     if (tau->SignalTracksMass() > fSignalTracksMassMax)
59     continue;
60    
61     if (tau->IsoTrackPtSum() > fIsoTrackPtSumMax)
62     continue;
63    
64 ceballos 1.3 if (tau->SourceCaloJet()->EnergyFractionEm() > fEnergyFractionEmMax)
65     continue;
66    
67 ceballos 1.5 if (tau->LeadTrack3x3HCalEt()/tau->LeadTrack()->Pt() < fHCalEtOverPtMin)
68     continue;
69    
70 loizides 1.7 // always apply these requirements
71 ceballos 1.2 if (TMath::Abs(tau->Charge()) != 1)
72 ceballos 1.1 continue;
73    
74 ceballos 1.5 if (TMath::Abs(TMath::Abs(tau->Eta())-1.53) < 0.02)
75     continue;
76    
77 loizides 1.4 // add good tau to output collection
78 ceballos 1.1 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     }