Revision: | 1.4 |
Committed: | Mon Jun 15 15:00:21 2009 UTC (15 years, 10 months ago) by loizides |
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, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, Mit_011, Mit_010a, Mit_010, Mit_009c, Mit_009b, HEAD |
Changes since 1.3: | +4 -1 lines |
Log Message: | Added proper fwd defs plus split up complilation of MitAna/DataTree LinkDefs. |
# | User | Rev | Content |
---|---|---|---|
1 | loizides | 1.4 | // $Id: TauCleaningMod.cc,v 1.3 2009/04/09 08:45:49 loizides Exp $ |
2 | ceballos | 1.1 | |
3 | #include "MitPhysics/Mods/interface/TauCleaningMod.h" | ||
4 | #include "MitCommon/MathTools/interface/MathUtils.h" | ||
5 | loizides | 1.4 | #include "MitAna/DataTree/interface/ElectronCol.h" |
6 | #include "MitAna/DataTree/interface/MuonCol.h" | ||
7 | #include "MitAna/DataTree/interface/CaloTauCol.h" | ||
8 | ceballos | 1.1 | #include "MitPhysics/Init/interface/ModNames.h" |
9 | |||
10 | using namespace mithep; | ||
11 | |||
12 | ClassImp(mithep::TauCleaningMod) | ||
13 | |||
14 | //-------------------------------------------------------------------------------------------------- | ||
15 | TauCleaningMod::TauCleaningMod(const char *name, const char *title) : | ||
16 | BaseMod(name,title), | ||
17 | fCleanElectronsName(ModNames::gkCleanElectronsName), | ||
18 | fCleanMuonsName(ModNames::gkCleanMuonsName), | ||
19 | fGoodTausName(ModNames::gkGoodTausName), | ||
20 | fCleanCaloTausName(ModNames::gkCleanTausName), | ||
21 | fMinDeltaRToElectron(0.3), | ||
22 | fMinDeltaRToMuon(0.3) | ||
23 | { | ||
24 | // Constructor. | ||
25 | } | ||
26 | |||
27 | //-------------------------------------------------------------------------------------------------- | ||
28 | void TauCleaningMod::Process() | ||
29 | { | ||
30 | // Process entries of the tree. | ||
31 | |||
32 | // get input collections | ||
33 | loizides | 1.3 | const CaloTauCol *GoodTaus = GetObjThisEvt<CaloTauCol>(fGoodTausName); |
34 | ceballos | 1.1 | const ElectronCol *CleanElectrons = GetObjThisEvt<ElectronCol>(fCleanElectronsName); |
35 | const MuonCol *CleanMuons = GetObjThisEvt<MuonCol>(fCleanMuonsName); | ||
36 | |||
37 | // create output collection | ||
38 | CaloTauOArr *CleanCaloTaus = new CaloTauOArr; | ||
39 | CleanCaloTaus->SetName(fCleanCaloTausName); | ||
40 | |||
41 | // remove any Tau that overlaps in eta, phi with an isolated electron. | ||
42 | UInt_t n = GoodTaus->GetEntries(); | ||
43 | for (UInt_t i=0; i<n; ++i) { | ||
44 | const CaloTau *tau = GoodTaus->At(i); | ||
45 | |||
46 | Bool_t isElectronOverlap = false; | ||
47 | |||
48 | // check for overlap with an electron | ||
49 | if (CleanElectrons) { | ||
50 | UInt_t n1 = CleanElectrons->GetEntries(); | ||
51 | for (UInt_t j=0; j<n1; j++) { | ||
52 | ceballos | 1.2 | Double_t deltaR = MathUtils::DeltaR(CleanElectrons->At(j)->Mom(), |
53 | tau->SourceCaloJet()->Mom()); | ||
54 | ceballos | 1.1 | if (deltaR < fMinDeltaRToElectron) { |
55 | isElectronOverlap = kTRUE; | ||
56 | break; | ||
57 | } | ||
58 | } | ||
59 | } | ||
60 | |||
61 | if (isElectronOverlap) | ||
62 | continue; | ||
63 | |||
64 | Bool_t isMuonOverlap = false; | ||
65 | |||
66 | // check for overlap with an Muon | ||
67 | if (CleanMuons) { | ||
68 | UInt_t n2 = CleanMuons->GetEntries(); | ||
69 | for (UInt_t j=0; j<n2; j++) { | ||
70 | ceballos | 1.2 | Double_t deltaR = MathUtils::DeltaR(CleanMuons->At(j)->Mom(), |
71 | tau->SourceCaloJet()->Mom()); | ||
72 | ceballos | 1.1 | if (deltaR < fMinDeltaRToMuon) { |
73 | isMuonOverlap = kTRUE; | ||
74 | break; | ||
75 | } | ||
76 | } | ||
77 | } | ||
78 | |||
79 | if (isMuonOverlap) | ||
80 | continue; | ||
81 | |||
82 | CleanCaloTaus->Add(tau); | ||
83 | } | ||
84 | |||
85 | // sort according to pt | ||
86 | CleanCaloTaus->Sort(); | ||
87 | |||
88 | // add to event for other modules to use | ||
89 | AddObjThisEvt(CleanCaloTaus); | ||
90 | } |