ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/PhotonCleaningMod.cc
Revision: 1.7
Committed: Mon Nov 2 13:39:23 2009 UTC (15 years, 6 months ago) by ceballos
Content type: text/plain
Branch: MAIN
CVS Tags: 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
Changes since 1.6: +2 -2 lines
Log Message:
using supercluster direction for photons

File Contents

# Content
1 // $Id: PhotonCleaningMod.cc,v 1.6 2009/11/02 12:28:25 sixie Exp $
2
3 #include "MitPhysics/Mods/interface/PhotonCleaningMod.h"
4 #include "MitCommon/MathTools/interface/MathUtils.h"
5 #include "MitAna/DataTree/interface/ElectronCol.h"
6 #include "MitAna/DataTree/interface/PhotonCol.h"
7 #include "MitPhysics/Init/interface/ModNames.h"
8
9 using namespace mithep;
10
11 ClassImp(mithep::PhotonCleaningMod)
12
13 //--------------------------------------------------------------------------------------------------
14 PhotonCleaningMod::PhotonCleaningMod(const char *name, const char *title) :
15 BaseMod(name,title),
16 fCleanElectronsName(ModNames::gkCleanElectronsName),
17 fGoodPhotonsName(ModNames::gkGoodPhotonsName),
18 fCleanPhotonsName(ModNames::gkCleanPhotonsName),
19 fMinDeltaRToElectron(0.3)
20 {
21 // Constructor.
22 }
23
24 //--------------------------------------------------------------------------------------------------
25 void PhotonCleaningMod::Process()
26 {
27 // Process entries of the tree.
28
29 // get input collections
30 const PhotonCol *GoodPhotons = GetObjThisEvt<PhotonCol>(fGoodPhotonsName);
31 const ElectronCol *CleanElectrons = GetObjThisEvt<ElectronCol>(fCleanElectronsName);
32
33 // create output collection
34 PhotonOArr *CleanPhotons = new PhotonOArr;
35 CleanPhotons->SetName(fCleanPhotonsName);
36
37 // remove any photon that overlaps in eta, phi with an isolated electron.
38 UInt_t n = GoodPhotons->GetEntries();
39 for (UInt_t i=0; i<n; ++i) {
40 const Photon *ph = GoodPhotons->At(i);
41
42 Bool_t isElectronOverlap = false;
43
44 // check for overlap with an electron
45 if (CleanElectrons) {
46 UInt_t n2 = CleanElectrons->GetEntries();
47 for (UInt_t j=0; j<n2; j++) {
48 Double_t deltaR = MathUtils::DeltaR(CleanElectrons->At(j)->SCluster()->Eta(),
49 CleanElectrons->At(j)->SCluster()->Phi(),
50 ph->SCluster()->Eta(), ph->SCluster()->Phi());
51 if (deltaR < fMinDeltaRToElectron) {
52 isElectronOverlap = kTRUE;
53 break;
54 }
55 }
56 }
57
58 if (isElectronOverlap)
59 continue;
60
61 CleanPhotons->Add(ph);
62 }
63
64 // sort according to pt
65 CleanPhotons->Sort();
66
67 // add to event for other modules to use
68 AddObjThisEvt(CleanPhotons);
69 }