ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/PhotonCleaningMod.cc
Revision: 1.6
Committed: Mon Nov 2 12:28:25 2009 UTC (15 years, 6 months ago) by sixie
Content type: text/plain
Branch: MAIN
Changes since 1.5: +4 -2 lines
Log Message:
Use supercluster to do photon cleaning against electrons.

File Contents

# User Rev Content
1 sixie 1.6 // $Id: PhotonCleaningMod.cc,v 1.5 2009/06/15 15:00:21 loizides Exp $
2 sixie 1.1
3     #include "MitPhysics/Mods/interface/PhotonCleaningMod.h"
4     #include "MitCommon/MathTools/interface/MathUtils.h"
5 loizides 1.5 #include "MitAna/DataTree/interface/ElectronCol.h"
6     #include "MitAna/DataTree/interface/PhotonCol.h"
7 sixie 1.1 #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 loizides 1.3 const PhotonCol *GoodPhotons = GetObjThisEvt<PhotonCol>(fGoodPhotonsName);
31     const ElectronCol *CleanElectrons = GetObjThisEvt<ElectronCol>(fCleanElectronsName);
32 sixie 1.1
33     // create output collection
34     PhotonOArr *CleanPhotons = new PhotonOArr;
35     CleanPhotons->SetName(fCleanPhotonsName);
36    
37 loizides 1.4 // remove any photon that overlaps in eta, phi with an isolated electron.
38 loizides 1.3 UInt_t n = GoodPhotons->GetEntries();
39     for (UInt_t i=0; i<n; ++i) {
40 sixie 1.1 const Photon *ph = GoodPhotons->At(i);
41    
42     Bool_t isElectronOverlap = false;
43    
44 loizides 1.4 // check for overlap with an electron
45 sixie 1.1 if (CleanElectrons) {
46 loizides 1.3 UInt_t n2 = CleanElectrons->GetEntries();
47     for (UInt_t j=0; j<n2; j++) {
48 sixie 1.6 Double_t deltaR = MathUtils::DeltaR(CleanElectrons->At(j)->SCluster()->Eta(),
49     CleanElectrons->At(j)->SCluster()->Phi(),
50     ph->Eta(), ph->Phi());
51 sixie 1.1 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 loizides 1.2 // sort according to pt
65     CleanPhotons->Sort();
66    
67 sixie 1.1 // add to event for other modules to use
68     AddObjThisEvt(CleanPhotons);
69     }