ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/TauIDMod.cc
Revision: 1.4
Committed: Thu Apr 9 08:45:49 2009 UTC (16 years, 1 month ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.3: +5 -6 lines
Log Message:
Cleanup

File Contents

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