ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/kiesel/TreeWriter/treeWriter.cc
(Generate patch)

Comparing UserCode/kiesel/TreeWriter/treeWriter.cc (file contents):
Revision 1.7 by kiesel, Tue Apr 9 12:13:55 2013 UTC vs.
Revision 1.8 by kiesel, Wed Apr 10 20:46:33 2013 UTC

# Line 51 | Line 51 | TreeWriter::~TreeWriter() {
51          delete inputTree->GetCurrentFile();
52   }
53  
54 + // useful functions
55   float TreeWriter::deltaR( TLorentzVector v1, TLorentzVector v2 ) {
56          return sqrt(pow(v1.Eta() - v2.Eta(), 2) + pow(v1.Phi() - v2.Phi(), 2) );
57   }
58  
59 + // correct iso, see https://twiki.cern.ch/twiki/bin/view/CMS/CutBasedPhotonID2012
60 + float chargedHadronIso_corrected(susy::Photon gamma, float rho) {
61 +  float eta = fabs(gamma.caloPosition.Eta());
62 +  float ea;
63 +
64 +  if(eta < 1.0) ea = 0.012;
65 +  else if(eta < 1.479) ea = 0.010;
66 +  else if(eta < 2.0) ea = 0.014;
67 +  else if(eta < 2.2) ea = 0.012;
68 +  else if(eta < 2.3) ea = 0.016;
69 +  else if(eta < 2.4) ea = 0.020;
70 +  else ea = 0.012;
71 +
72 +  float iso = gamma.chargedHadronIso;
73 +  iso = max(iso - rho*ea, (float)0.);
74 +
75 +  return iso;
76 + }
77 +
78 + float neutralHadronIso_corrected(susy::Photon gamma, float rho) {
79 +  float eta = fabs(gamma.caloPosition.Eta());
80 +  float ea;
81 +
82 +  if(eta < 1.0) ea = 0.030;
83 +  else if(eta < 1.479) ea = 0.057;
84 +  else if(eta < 2.0) ea = 0.039;
85 +  else if(eta < 2.2) ea = 0.015;
86 +  else if(eta < 2.3) ea = 0.024;
87 +  else if(eta < 2.4) ea = 0.039;
88 +  else ea = 0.072;
89 +
90 +  float iso = gamma.neutralHadronIso;
91 +  iso = max(iso - rho*ea, (float)0.);
92 +
93 +  return iso;
94 + }
95 +
96 + float photonIso_corrected(susy::Photon gamma, float rho) {
97 +  float eta = fabs(gamma.caloPosition.Eta());
98 +  float ea;
99 +
100 +  if(eta < 1.0) ea = 0.148;
101 +  else if(eta < 1.479) ea = 0.130;
102 +  else if(eta < 2.0) ea = 0.112;
103 +  else if(eta < 2.2) ea = 0.216;
104 +  else if(eta < 2.3) ea = 0.262;
105 +  else if(eta < 2.4) ea = 0.260;
106 +  else ea = 0.266;
107 +
108 +  float iso = gamma.photonIso;
109 +  iso = max(iso - rho*ea, (float)0.);
110 +
111 +  return iso;
112 + }
113 +
114 +
115 +
116 +
117   float TreeWriter::getPtFromMatchedJet( susy::Photon myPhoton, susy::Event myEvent ) {
118          /**
119           * \brief Takes jet p_T as photon p_T
# Line 159 | Line 218 | void TreeWriter::Loop() {
218                                  continue;
219                          thisphoton->eta = it->momentum.Eta();
220                          thisphoton->phi = it->momentum.Phi();
221 <                        thisphoton->chargedIso = it->chargedHadronIso;
222 <                        thisphoton->neutralIso = it->neutralHadronIso;
223 <                        thisphoton->photonIso = it->photonIso;
224 <                        if ( it->r9 > 1 && skim ) // if == 1 ?
221 >                        thisphoton->chargedIso = chargedHadronIso_corrected(*it, event->rho25);
222 >                        thisphoton->neutralIso = neutralHadronIso_corrected(*it, event->rho25);
223 >                        thisphoton->photonIso = photonIso_corrected(*it, event->rho25);
224 >                        if ( it->r9 >= 1 && skim )
225                                  continue;
226                          thisphoton->r9 = it->r9;
227                          thisphoton->sigmaIetaIeta = it->sigmaIetaIeta;
# Line 199 | Line 258 | void TreeWriter::Loop() {
258                                  TLorentzVector corrP4 = scale * it->momentum;
259  
260                                  if(std::abs(corrP4.Eta()) > 3.0 && skim ) continue;
261 +                                if(corrP4.Et() < 30 && skim ) continue;
262                                  thisjet->pt = corrP4.Et();
263                                  thisjet->eta = corrP4.Eta();
264                                  thisjet->phi = corrP4.Phi();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines