ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/TauCleaningMod.cc
Revision: 1.2
Committed: Wed Apr 8 17:48:13 2009 UTC (16 years, 1 month ago) by ceballos
Content type: text/plain
Branch: MAIN
Changes since 1.1: +5 -3 lines
Log Message:
adding some additional requirements

File Contents

# User Rev Content
1 ceballos 1.2 // $Id: TauCleaningMod.cc,v 1.1 2009/04/08 10:11:44 ceballos Exp $
2 ceballos 1.1
3     #include "MitPhysics/Mods/interface/TauCleaningMod.h"
4     #include "MitCommon/MathTools/interface/MathUtils.h"
5     #include "MitPhysics/Init/interface/ModNames.h"
6    
7     using namespace mithep;
8    
9     ClassImp(mithep::TauCleaningMod)
10    
11     //--------------------------------------------------------------------------------------------------
12     TauCleaningMod::TauCleaningMod(const char *name, const char *title) :
13     BaseMod(name,title),
14     fCleanElectronsName(ModNames::gkCleanElectronsName),
15     fCleanMuonsName(ModNames::gkCleanMuonsName),
16     fGoodTausName(ModNames::gkGoodTausName),
17     fCleanCaloTausName(ModNames::gkCleanTausName),
18     fMinDeltaRToElectron(0.3),
19     fMinDeltaRToMuon(0.3)
20     {
21     // Constructor.
22     }
23    
24     //--------------------------------------------------------------------------------------------------
25     void TauCleaningMod::Process()
26     {
27     // Process entries of the tree.
28    
29     // get input collections
30     const CaloTauCol *GoodTaus = GetObjThisEvt<CaloTauCol>(fGoodTausName);
31     const ElectronCol *CleanElectrons = GetObjThisEvt<ElectronCol>(fCleanElectronsName);
32     const MuonCol *CleanMuons = GetObjThisEvt<MuonCol>(fCleanMuonsName);
33    
34     // create output collection
35     CaloTauOArr *CleanCaloTaus = new CaloTauOArr;
36     CleanCaloTaus->SetName(fCleanCaloTausName);
37    
38     // remove any Tau that overlaps in eta, phi with an isolated electron.
39     UInt_t n = GoodTaus->GetEntries();
40     for (UInt_t i=0; i<n; ++i) {
41     const CaloTau *tau = GoodTaus->At(i);
42    
43     Bool_t isElectronOverlap = false;
44    
45     // check for overlap with an electron
46     if (CleanElectrons) {
47     UInt_t n1 = CleanElectrons->GetEntries();
48     for (UInt_t j=0; j<n1; j++) {
49 ceballos 1.2 Double_t deltaR = MathUtils::DeltaR(CleanElectrons->At(j)->Mom(),
50     tau->SourceCaloJet()->Mom());
51 ceballos 1.1 if (deltaR < fMinDeltaRToElectron) {
52     isElectronOverlap = kTRUE;
53     break;
54     }
55     }
56     }
57    
58     if (isElectronOverlap)
59     continue;
60    
61     Bool_t isMuonOverlap = false;
62    
63     // check for overlap with an Muon
64     if (CleanMuons) {
65     UInt_t n2 = CleanMuons->GetEntries();
66     for (UInt_t j=0; j<n2; j++) {
67 ceballos 1.2 Double_t deltaR = MathUtils::DeltaR(CleanMuons->At(j)->Mom(),
68     tau->SourceCaloJet()->Mom());
69 ceballos 1.1 if (deltaR < fMinDeltaRToMuon) {
70     isMuonOverlap = kTRUE;
71     break;
72     }
73     }
74     }
75    
76     if (isMuonOverlap)
77     continue;
78    
79     CleanCaloTaus->Add(tau);
80     }
81    
82     // sort according to pt
83     CleanCaloTaus->Sort();
84    
85     // add to event for other modules to use
86     AddObjThisEvt(CleanCaloTaus);
87     }