ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/TauIDMod.cc
Revision: 1.9
Committed: Tue Jul 6 08:33:16 2010 UTC (14 years, 10 months ago) by sixie
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_029c, Mit_029b, Mit_029a, Mit_028a, Mit_028, Mit_027, Mit_027a, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, HEAD
Changes since 1.8: +2 -2 lines
Log Message:
added null pointer protections

File Contents

# User Rev Content
1 sixie 1.9 // $Id: TauIDMod.cc,v 1.8 2009/06/15 15:00:21 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 sixie 1.9 if (!tau->SourceCaloJet() || 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     }