ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/SelMods/src/JetPlusIsoTrackSelMod.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: JetPlusIsoTrackSelMod.cc,v 1.2 2009/06/15 15:00:22 loizides Exp $
2
3 #include "MitPhysics/SelMods/interface/JetPlusIsoTrackSelMod.h"
4 #include "MitPhysics/Utils/interface/IsolationTools.h"
5 #include "MitCommon/MathTools/interface/MathUtils.h"
6 #include "MitAna/DataTree/interface/JetCol.h"
7 #include "MitAna/DataTree/interface/TrackCol.h"
8 #include <TH1D.h>
9
10 using namespace mithep;
11
12 ClassImp(mithep::JetPlusIsoTrackSelMod)
13
14 //--------------------------------------------------------------------------------------------------
15 mithep::JetPlusIsoTrackSelMod::JetPlusIsoTrackSelMod(const char *name, const char *title) :
16 BaseSelMod(name,title),
17 fJetColName("SetMe"),
18 fTrackerTrackColName("SetMe"),
19 fGsfTrackColName("SetMe"),
20 fJetPtMin(0),
21 fJetPtMax(5000),
22 fJetEtaMin(-10),
23 fJetEtaMax(10),
24 fTrackPtMin(0),
25 fTrackPtMax(5000),
26 fTrackEtaMin(-10),
27 fTrackEtaMax(10),
28 fJetCol(0),
29 fTrackerTrackCol(0),
30 fGsfTrackCol(0)
31 {
32 // Constructor.
33 }
34
35 //--------------------------------------------------------------------------------------------------
36 void mithep::JetPlusIsoTrackSelMod::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 fJetCol = GetObjThisEvt<Collection<Jet> >(GetJetColName());
47 if (!fJetCol ) {
48 this->SendError(kAbortModule, "Process",
49 "Could not obtain collection with name %s!", GetJetColName());
50 return;
51 }
52
53 if (!fJetCol && !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 JetCounter = 0;
63 for(UInt_t i=0;i<fJetCol->GetEntries();++i) {
64 if (fJetCol->At(i)->Pt() >= fJetPtMin &&
65 fJetCol->At(i)->Pt() <= fJetPtMax &&
66 fJetCol->At(i)->Eta() >= fJetEtaMin &&
67 fJetCol->At(i)->Eta() <= fJetEtaMax)
68 JetCounter++;
69 }
70 if (JetCounter == 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 && trk->Pt() <= fTrackPtMax &&
81 trk->Eta() >= fTrackEtaMin && trk->Eta() <= fTrackEtaMax) {
82 Double_t iso = IsolationTools::TrackIsolation(trk,0.3, 0.015,1.0,1000.0,fTrackerTrackCol);
83 if (iso < 10.0) {
84 //require that the track is not the same object as one of the leptons
85 if (MathUtils::DeltaR(trk->Phi(), trk->Eta(),
86 fJetCol->At(0)->Phi(), fJetCol->At(0)->Eta()) >= 0.3)
87 TrackCounter++;
88 }
89 }
90 }
91 for(UInt_t i=0;i<fGsfTrackCol->GetEntries();++i) {
92 const Track *trk = fGsfTrackCol->At(i);
93 if (trk->Pt() >= fTrackPtMin &&
94 trk->Pt() <= fTrackPtMax &&
95 trk->Eta() >= fTrackEtaMin &&
96 trk->Eta() <= fTrackEtaMax) {
97 Double_t iso = IsolationTools::TrackIsolation(trk,0.3, 0.015,1.0,1000.0,fTrackerTrackCol);
98 if (iso < 10.0) {
99 if (MathUtils::DeltaR(trk->Phi(), trk->Eta(),
100 fJetCol->At(0)->Phi(), fJetCol->At(0)->Eta()) >= 0.3)
101 TrackCounter++;
102 }
103 }
104 }
105
106 if (TrackCounter == 0) {
107 this->SkipEvent();
108 return;
109 }
110
111 fNAccCounters->Fill(3);
112 }
113
114 //--------------------------------------------------------------------------------------------------
115 void mithep::JetPlusIsoTrackSelMod::SlaveBegin()
116 {
117 // Setup acceptence histogram.
118 ReqBranch(GetTrackerTrackColName(), fTrackerTrackCol);
119 ReqBranch(GetGsfTrackColName(), fGsfTrackCol);
120
121 AddTH1(fNAccCounters,"hNAccCounters",";cut;#",5,-0.5,4.5);
122 if (1) {
123 TAxis *xa = fNAccCounters->GetXaxis();
124 for(Int_t i=1;i<=fNAccCounters->GetNbinsX();++i)
125 xa->SetBinLabel(i,"unused");
126 xa->SetBinLabel(1,"Enter");
127 xa->SetBinLabel(2,"Objs");
128 xa->SetBinLabel(3,"AtLeastOneJet");
129 xa->SetBinLabel(4,"IsolatedTrack");
130 xa->SetRangeUser(0,3);
131 }
132 }