ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/TauIDMod.cc
Revision: 1.1
Committed: Wed Apr 8 10:11:44 2009 UTC (16 years, 1 month ago) by ceballos
Content type: text/plain
Branch: MAIN
Log Message:
new tau selection

File Contents

# User Rev Content
1 ceballos 1.1 // $Id: TauIDMod.cc,v 1.4 2008/12/10 11:44:33 loizides Exp $
2    
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     fCaloTaus(0),
15     fGoodTausName(ModNames::gkGoodTausName),
16     fTauPtMin(10.0),
17     fTauJetPtMin(20.0),
18     fNSignalTracksMax(3),
19     fNIsoTracksMax(0),
20     fSignalTracksMassMax(2.0),
21     fIsoTrackPtSumMax(5.0)
22     {
23     // Constructor.
24     }
25    
26     //------------------------------------------------------------------------------
27     void TauIDMod::Process()
28     {
29     // Process entries of the tree.
30    
31     LoadBranch(fCaloTausName);
32    
33     CaloTauOArr *GoodTaus = new CaloTauOArr;
34     GoodTaus->SetName(fGoodTausName);
35    
36     for (UInt_t i=0; i<fCaloTaus->GetEntries(); ++i) {
37     const CaloTau *tau = fCaloTaus->At(i);
38    
39     if (tau->Pt() <= fTauPtMin)
40     continue;
41    
42     if (tau->SourceCaloJet()->Pt() <= fTauJetPtMin)
43     continue;
44    
45     if (tau->NSignalTracks() == 0 || tau->NSignalTracks() > fNSignalTracksMax)
46     continue;
47    
48     if (tau->NIsoTracks() > fNIsoTracksMax)
49     continue;
50    
51     if (tau->SignalTracksMass() > fSignalTracksMassMax)
52     continue;
53    
54     if (tau->IsoTrackPtSum() > fIsoTrackPtSumMax)
55     continue;
56    
57     // Always apply this requirement
58     Double_t nCharge = 0;
59     for (UInt_t j=0; j<tau->NSignalTracks(); ++j) {
60     nCharge += tau->SignalTrack(j)->Charge();
61     }
62     if (TMath::Abs(nCharge) != 1)
63     continue;
64    
65     // add good electron
66     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    
84     }