ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/PFTauIDMod.cc
Revision: 1.1
Committed: Sun Jul 18 21:15:19 2010 UTC (14 years, 9 months ago) by ceballos
Content type: text/plain
Branch: MAIN
Log Message:
adding PF taus

File Contents

# User Rev Content
1 ceballos 1.1 // $Id: PFTauIDMod.cc,v 1.9 2010/07/06 08:33:16 sixie 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)->Charge() != 0){
49     nTrk++;
50     tauChargedSystem.AddDaughter(tau->SignalPFCand(j));
51     }
52     }
53    
54     if (tauSystem.Pt() <= fPtMin)
55     continue;
56    
57     if (nTrk != 1 && nTrk != 3)
58     continue;
59    
60     if(!tau->LeadChargedHadronPFCand())
61     continue;
62    
63     if(tau->LeadChargedHadronPFCand()->Pt() <= fPtLeadChargedHadronPFCandMin)
64     continue;
65    
66     if (TMath::Abs(tau->Charge()) != 1)
67     continue;
68    
69     if (tau->IsoChargedHadronPtSum() >= fIsoChargedHadronPtSumMax)
70     continue;
71    
72     if (tau->IsoGammaEtSum() >= fIsoGammaEtSumMax)
73     continue;
74    
75     if (tauChargedSystem.Mass() <= fSignalMassMin || tauChargedSystem.Mass() >= fSignalMassMax)
76     continue;
77    
78     // add good tau to output collection
79     GoodTaus->Add(tau);
80     }
81    
82     // sort according to pt
83     GoodTaus->Sort();
84    
85     // add to event for other modules to use
86     AddObjThisEvt(GoodTaus);
87     }
88    
89     //------------------------------------------------------------------------------
90     void PFTauIDMod::SlaveBegin()
91     {
92     // Run startup code on the computer (slave) doing the actual analysis. Here,
93     // we just request the Tau collection branch.
94    
95     ReqBranch(fPFTausName, fPFTaus);
96     }