ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/NonMCBackground/src/SelectionEMU.cc
(Generate patch)

Comparing UserCode/MitHzz4l/NonMCBackground/src/SelectionEMU.cc (file contents):
Revision 1.9 by dkralph, Mon Jun 25 18:08:04 2012 UTC vs.
Revision 1.15 by dkralph, Sat Jul 21 11:27:54 2012 UTC

# Line 42 | Line 42 | EventData apply_HZZ4L_EMU_selection(Cont
42                                      const mithep::Array<mithep::Vertex>       * vtxArr ,
43                                      const mithep::Array<mithep::PFCandidate>  *pfCandidates,
44                                      const mithep::Array<mithep::PileupEnergyDensity>  *puEnergyDensity,
45 +                                    const mithep::DecayParticleCol *fConversions,
46                                      const mithep::Array<mithep::Electron> *electronArr,    // input electrons
47                                      SelectionStatus (*ElectronPreSelector)( ControlFlags &,
48                                                                              const mithep::Electron*,
# Line 113 | Line 114 | EventData apply_HZZ4L_EMU_selection(Cont
114        
115  
116        SelectionStatus denomSel;
117 <      denomSel |= muonPreSelectionNoD0DzIP(ctrl,mu,vtx,pfCandidates);
117 >      denomSel |= muonPreSelectionNoD0IP(ctrl,mu,vtx,pfCandidates);
118        if( !denomSel.passPre() ) continue;
119  
120        SelectionStatus musel;
# Line 131 | Line 132 | EventData apply_HZZ4L_EMU_selection(Cont
132        tmplep.type    = 13;
133        tmplep.index   = i;
134        tmplep.charge  = mu->Charge();
134      tmplep.isoTrk  = mu->IsoR03SumPt();
135      tmplep.isoEcal = mu->IsoR03EmEt();
136      tmplep.isoHcal = mu->IsoR03HadEt();
135        tmplep.isoPF04 = musel.isoPF04;
136        tmplep.chisoPF04 = musel.chisoPF04;
137        tmplep.gaisoPF04 = musel.gaisoPF04;
138        tmplep.neisoPF04 = musel.neisoPF04;
141      // tmplep.isoPF03 = computePFMuonIso(mu,vtx,pfCandidates,0.3);
142      // tmplep.isoPF04 = computePFMuonIso(mu,vtx,pfCandidates,0.4);
139        tmplep.ip3dSig = mu->Ip3dPVSignificance();
140        tmplep.is4l    = false;
141        tmplep.isEB    = (fabs(mu->Eta()) < 1.479 ? 1 : 0 );
# Line 157 | Line 153 | EventData apply_HZZ4L_EMU_selection(Cont
153  
154        tmplep.status  = musel;    
155        tmplep.fsrRecoveryAttempted = false;
156 <      SelectionStatus tmpstat = PassWwMuonSel(mu,vtx,pfCandidates);
157 <      tmplep.tightCutsApplied = tmpstat.tight();
156 >      tmplep.tightCutsApplied = muon2012CutBasedIDTightVersionWithOldIsoThatWorksOn2011(ctrl,mu,vtx,pfCandidates,puEnergyDensity,eraMu);
157 >      // tmplep.d0      = mu->HasTrackerTrk() ? mu->TrackerTrk()->D0Corrected(*vtx) : 0;
158 >      // tmplep.dz      = mu->HasTrackerTrk() ? mu->TrackerTrk()->DzCorrected(*vtx) : 0;
159 >
160        lepvec.push_back(tmplep);
161        if( ctrl.debug ) cout << endl;
162      }
# Line 170 | Line 168 | EventData apply_HZZ4L_EMU_selection(Cont
168          const mithep::Electron *ele = (mithep::Electron*)((*electronArr)[i]);
169  
170          SelectionStatus denomSel;
171 <        denomSel |= electronPreSelectionNoD0DzIP(ctrl,ele,vtx);
172 <        if( !(denomSel.getStatus() & SelectionStatus::PRESELECTION) ) continue;
171 >        denomSel |= electronPreSelectionNoD0IP(ctrl,ele,vtx);
172 >        if( !denomSel.passPre() ) continue;
173          
174          SelectionStatus elesel;
175          elesel |= (*ElectronPreSelector)(ctrl,ele,vtx);
# Line 188 | Line 186 | EventData apply_HZZ4L_EMU_selection(Cont
186          tmplep.type    = 11;
187          tmplep.index   = i;
188          tmplep.charge  = ele->Charge();
191        tmplep.isoTrk  = ele->TrackIsolationDr03();
192        tmplep.isoEcal = ele->EcalRecHitIsoDr03();
193        tmplep.isoHcal = ele->HcalTowerSumEtDr03();
189          tmplep.isoPF04 = elesel.isoPF04;
190          tmplep.chisoPF04 = elesel.chisoPF04;
191          tmplep.gaisoPF04 = elesel.gaisoPF04;
192          tmplep.neisoPF04 = elesel.neisoPF04;
198        // tmplep.isoPF03 = computePFEleIso(ele,vtx,pfCandidates,0.3);
199        // tmplep.isoPF04 = computePFEleIso(ele,vtx,pfCandidates,0.4);
193          tmplep.ip3dSig = ele->Ip3dPVSignificance();
194          tmplep.is4l    = false;
195          tmplep.isEB    = ele->IsEB();
# Line 211 | Line 204 | EventData apply_HZZ4L_EMU_selection(Cont
204          tmplep.idMVA   = elesel.idMVA;
205          tmplep.isoMVA  = elesel.isoMVA;
206          tmplep.fsrRecoveryAttempted = false;
207 <        SelectionStatus tmpstat = electronTagSelection(ele,vtx,pfCandidates);
208 <        tmplep.tightCutsApplied   = tmpstat.tight();
207 >        tmplep.tightCutsApplied = electron2012CutBasedIDMediumVersionThatWorksOn2011(ctrl,ele,vtx,pfCandidates,fConversions,puEnergyDensity,eraEle);
208 >        // tmplep.d0      = ele->BestTrk()->D0Corrected(*vtx);
209 >        // tmplep.dz      = ele->BestTrk()->DzCorrected(*vtx);
210 >
211          lepvec.push_back(tmplep);
212          if( ctrl.debug ) cout << endl;
213        }
# Line 249 | Line 244 | EventData apply_HZZ4L_EMU_selection(Cont
244      //********************************************************
245      // Step 3: Good Leptons
246      //********************************************************
252    vector<double> pt_of_leptons_to_erase;
247      for (int i=0; i<lepvec.size(); i++ ) {
254      bool already_pushed=false;
248        if( !(lepvec[i].status.loose()) ) {
249 <        pt_of_leptons_to_erase.push_back(lepvec[i].vec.Pt());
257 <        already_pushed = true;
258 <        failingLeptons.push_back(lepvec[i]); // these should pass preselection
249 >        failingLeptons.push_back(lepvec[i]);
250        } else {
251          passingLeptons.push_back(lepvec[i]);
252        }
262 #ifndef SYNC
263      if( !already_pushed && fabs(lepvec[i].ip3dSig)>4 )  
264        pt_of_leptons_to_erase.push_back(lepvec[i].vec.Pt());
265 #endif      
266    }
267    for( int i=0; i<pt_of_leptons_to_erase.size(); i++ ) {
268      for( vector<SimpleLepton>::iterator it=lepvec.begin(); it != lepvec.end(); it++ ) {
269        SimpleLepton flep = *it;
270        if( flep.vec.Pt() != pt_of_leptons_to_erase[i] ) continue;
271        lepvec.erase(it);
272        break;
273      }
253      }
254  
255      //******************************************************************************

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines