ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/SelMods/src/PhotonPlusIsoTrackSelMod.cc
Revision: 1.3
Committed: Wed Jun 17 14:52:59 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, HEAD
Changes since 1.2: +2 -2 lines
Log Message:
Adjust counters

File Contents

# Content
1 // $Id: PhotonPlusIsoTrackSelMod.cc,v 1.2 2009/06/15 15:00:22 loizides Exp $
2
3 #include "MitPhysics/SelMods/interface/PhotonPlusIsoTrackSelMod.h"
4 #include "MitPhysics/Utils/interface/IsolationTools.h"
5 #include "MitCommon/MathTools/interface/MathUtils.h"
6 #include "MitAna/DataTree/interface/PhotonCol.h"
7 #include "MitAna/DataTree/interface/TrackCol.h"
8 #include <TH1D.h>
9
10 using namespace mithep;
11
12 ClassImp(mithep::PhotonPlusIsoTrackSelMod)
13
14 //--------------------------------------------------------------------------------------------------
15 mithep::PhotonPlusIsoTrackSelMod::PhotonPlusIsoTrackSelMod(const char *name, const char *title) :
16 BaseSelMod(name,title),
17 fPhotonColName("SetMe"),
18 fTrackerTrackColName("SetMe"),
19 fGsfTrackColName("SetMe"),
20 fPhotonPtMin(0),
21 fPhotonPtMax(5000),
22 fPhotonEtaMin(-10),
23 fPhotonEtaMax(10),
24 fTrackPtMin(0),
25 fTrackPtMax(5000),
26 fTrackEtaMin(-10),
27 fTrackEtaMax(10),
28 fPhotonCol(0),
29 fTrackerTrackCol(0),
30 fGsfTrackCol(0)
31 {
32 // Constructor.
33 }
34
35 //--------------------------------------------------------------------------------------------------
36 void mithep::PhotonPlusIsoTrackSelMod::Process()
37 {
38 // Process entries of the tree.
39
40 //load the track branches
41 LoadBranch(GetTrackerTrackColName());
42 LoadBranch(GetGsfTrackColName());
43
44 fNAccCounters->Fill(0);
45
46 fPhotonCol = GetObjThisEvt<Collection<Photon> >(GetPhotonColName());
47 if (!fPhotonCol ) {
48 this->SendError(kAbortModule, "Process",
49 "Could not obtain collection with name %s!", GetPhotonColName());
50 return;
51 }
52
53 if (!fPhotonCol && !fGsfTrackCol) {
54 this->SendError(kAbortModule, "Process",
55 "Could not obtain either collections with names %s , %s!",
56 GetTrackerTrackColName(), GetGsfTrackColName());
57 return;
58 }
59
60 fNAccCounters->Fill(1);
61
62 UInt_t PhotonCounter = 0;
63 for(UInt_t i=0;i<fPhotonCol->GetEntries();++i) {
64 if (fPhotonCol->At(i)->Pt() >= fPhotonPtMin &&
65 fPhotonCol->At(i)->Pt() <= fPhotonPtMax &&
66 fPhotonCol->At(i)->Eta() >= fPhotonEtaMin &&
67 fPhotonCol->At(i)->Eta() <= fPhotonEtaMax)
68 PhotonCounter++;
69 }
70 if (PhotonCounter == 0) {
71 this->SkipEvent();
72 return;
73 }
74
75 fNAccCounters->Fill(2);
76
77 UInt_t TrackCounter = 0;
78 for(UInt_t i=0;i<fTrackerTrackCol->GetEntries();++i) {
79 const Track *trk = fTrackerTrackCol->At(i);
80 if (trk->Pt() >= fTrackPtMin &&
81 trk->Pt() <= fTrackPtMax &&
82 trk->Eta() >= fTrackEtaMin &&
83 trk->Eta() <= fTrackEtaMax) {
84 Double_t iso = IsolationTools::TrackIsolation(trk,0.3, 0.015,1.0,1000.0,fTrackerTrackCol);
85 if (iso < 10.0) {
86 //require that the track is not the same object as one of the leptons
87 if (MathUtils::DeltaR(trk->Phi(), trk->Eta(),
88 fPhotonCol->At(0)->Phi(), fPhotonCol->At(0)->Eta()) >= 0.3)
89 TrackCounter++;
90 }
91 }
92 }
93
94 for(UInt_t i=0;i<fGsfTrackCol->GetEntries();++i) {
95 const Track *trk = fGsfTrackCol->At(i);
96 if (trk->Pt() >= fTrackPtMin &&
97 trk->Pt() <= fTrackPtMax &&
98 trk->Eta() >= fTrackEtaMin &&
99 trk->Eta() <= fTrackEtaMax) {
100 Double_t iso = IsolationTools::TrackIsolation(trk,0.3, 0.015,1.0,1000.0,fTrackerTrackCol);
101 if (iso < 10.0) {
102 if (MathUtils::DeltaR(trk->Phi(), trk->Eta(),
103 fPhotonCol->At(0)->Phi(), fPhotonCol->At(0)->Eta()) >= 0.3)
104 TrackCounter++;
105 }
106 }
107 }
108
109 if (TrackCounter == 0) {
110 this->SkipEvent();
111 return;
112 }
113
114 fNAccCounters->Fill(3);
115 }
116
117 //--------------------------------------------------------------------------------------------------
118 void mithep::PhotonPlusIsoTrackSelMod::SlaveBegin()
119 {
120 // Setup acceptence histogram.
121 ReqBranch(GetTrackerTrackColName(), fTrackerTrackCol);
122 ReqBranch(GetGsfTrackColName(), fGsfTrackCol);
123
124 AddTH1(fNAccCounters,"hNAccCounters",";cut;#",5,-0.5,4.5);
125 if (1) {
126 TAxis *xa = fNAccCounters->GetXaxis();
127 for(Int_t i=1;i<=fNAccCounters->GetNbinsX();++i)
128 xa->SetBinLabel(i,"unused");
129 xa->SetBinLabel(1,"Enter");
130 xa->SetBinLabel(2,"Objs");
131 xa->SetBinLabel(3,"AtLeastOnePhoton");
132 xa->SetBinLabel(4,"IsolatedTrack");
133 xa->SetRangeUser(0,3);
134 }
135 }