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.16 by dkralph, Tue Oct 23 11:24:27 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();
137      tmplep.isoPF04 = musel.isoPF04;
138      tmplep.chisoPF04 = musel.chisoPF04;
139      tmplep.gaisoPF04 = musel.gaisoPF04;
140      tmplep.neisoPF04 = musel.neisoPF04;
141      // tmplep.isoPF03 = computePFMuonIso(mu,vtx,pfCandidates,0.3);
142      // tmplep.isoPF04 = computePFMuonIso(mu,vtx,pfCandidates,0.4);
135        tmplep.ip3dSig = mu->Ip3dPVSignificance();
136        tmplep.is4l    = false;
137        tmplep.isEB    = (fabs(mu->Eta()) < 1.479 ? 1 : 0 );
146      tmplep.isoMVA  = musel.isoMVA;
138        tmplep.isLoose = musel.loose();
139  
140        bitset<TRIGGER_BIG_NUMBER> hltMatchBits = fillHLTMatchBits( mu->Eta(), mu->Phi(), hltTable, hltObjArr, fTrigObjs);
141        tmplep.isTight = testBits(ctrl,triggerBits,muTriggers,hltMatchBits,muTrigObjs);
142  
143 <      tmplep.bdtfail = 0;
144 <      if(triggerBits.test(kHLT_IsoMu24_eta2p1))        tmplep.bdtfail |= 1;
145 <      if(hltMatchBits.test(kHLT_IsoMu24_eta2p1_MuObj)) tmplep.bdtfail |= 2;
146 <      if(triggerBits.test(kHLT_IsoMu24))               tmplep.bdtfail |= 4;
147 <      if(hltMatchBits.test(kHLT_IsoMu24_MuObj))        tmplep.bdtfail |= 8;
143 >      tmplep.scID = 0;
144 >      if(triggerBits.test(kHLT_IsoMu24_eta2p1))        tmplep.scID |= 1;
145 >      if(hltMatchBits.test(kHLT_IsoMu24_eta2p1_MuObj)) tmplep.scID |= 2;
146 >      if(triggerBits.test(kHLT_IsoMu24))               tmplep.scID |= 4;
147 >      if(hltMatchBits.test(kHLT_IsoMu24_MuObj))        tmplep.scID |= 8;
148  
149        tmplep.status  = musel;    
150        tmplep.fsrRecoveryAttempted = false;
151 <      SelectionStatus tmpstat = PassWwMuonSel(mu,vtx,pfCandidates);
152 <      tmplep.tightCutsApplied = tmpstat.tight();
151 >      tmplep.tightCutsApplied = muon2012CutBasedIDTightVersionWithOldIsoThatWorksOn2011(ctrl,mu,vtx,pfCandidates,puEnergyDensity,eraMu);
152 >      tmplep.d0      = mu->HasTrackerTrk() ? mu->TrackerTrk()->D0Corrected(*vtx) : 0;
153 >      tmplep.dz      = mu->HasTrackerTrk() ? mu->TrackerTrk()->DzCorrected(*vtx) : 0;
154 >
155        lepvec.push_back(tmplep);
156        if( ctrl.debug ) cout << endl;
157      }
# Line 170 | Line 163 | EventData apply_HZZ4L_EMU_selection(Cont
163          const mithep::Electron *ele = (mithep::Electron*)((*electronArr)[i]);
164  
165          SelectionStatus denomSel;
166 <        denomSel |= electronPreSelectionNoD0DzIP(ctrl,ele,vtx);
167 <        if( !(denomSel.getStatus() & SelectionStatus::PRESELECTION) ) continue;
166 >        denomSel |= electronPreSelectionNoD0IP(ctrl,ele,vtx);
167 >        if( !denomSel.passPre() ) continue;
168          
169          SelectionStatus elesel;
170          elesel |= (*ElectronPreSelector)(ctrl,ele,vtx);
# Line 188 | Line 181 | EventData apply_HZZ4L_EMU_selection(Cont
181          tmplep.type    = 11;
182          tmplep.index   = i;
183          tmplep.charge  = ele->Charge();
191        tmplep.isoTrk  = ele->TrackIsolationDr03();
192        tmplep.isoEcal = ele->EcalRecHitIsoDr03();
193        tmplep.isoHcal = ele->HcalTowerSumEtDr03();
194        tmplep.isoPF04 = elesel.isoPF04;
195        tmplep.chisoPF04 = elesel.chisoPF04;
196        tmplep.gaisoPF04 = elesel.gaisoPF04;
197        tmplep.neisoPF04 = elesel.neisoPF04;
198        // tmplep.isoPF03 = computePFEleIso(ele,vtx,pfCandidates,0.3);
199        // tmplep.isoPF04 = computePFEleIso(ele,vtx,pfCandidates,0.4);
184          tmplep.ip3dSig = ele->Ip3dPVSignificance();
185          tmplep.is4l    = false;
186          tmplep.isEB    = ele->IsEB();
187 <        tmplep.scID    = ele->SCluster()->GetUniqueID();
187 >        // tmplep.scID    = ele->SCluster()->GetUniqueID();
188  
189          bitset<TRIGGER_BIG_NUMBER> hltMatchBits = fillHLTMatchBits( ele->Eta(), ele->Phi(), hltTable, hltObjArr, fTrigObjs);
190          tmplep.isTight = testBits(ctrl,triggerBits,eleTriggers,hltMatchBits,eleTrigObjs);
191  
208        tmplep.isTight = elesel.tight();
192          tmplep.isLoose = elesel.loose();
193          tmplep.status  = elesel;
211        tmplep.idMVA   = elesel.idMVA;
212        tmplep.isoMVA  = elesel.isoMVA;
194          tmplep.fsrRecoveryAttempted = false;
195 <        SelectionStatus tmpstat = electronTagSelection(ele,vtx,pfCandidates);
196 <        tmplep.tightCutsApplied   = tmpstat.tight();
195 >        tmplep.tightCutsApplied = electron2012CutBasedIDMediumVersionThatWorksOn2011(ctrl,ele,vtx,pfCandidates,fConversions,puEnergyDensity,eraEle);
196 >        tmplep.d0      = ele->BestTrk()->D0Corrected(*vtx);
197 >        tmplep.dz      = ele->BestTrk()->DzCorrected(*vtx);
198 >
199          lepvec.push_back(tmplep);
200          if( ctrl.debug ) cout << endl;
201        }
# Line 249 | Line 232 | EventData apply_HZZ4L_EMU_selection(Cont
232      //********************************************************
233      // Step 3: Good Leptons
234      //********************************************************
252    vector<double> pt_of_leptons_to_erase;
235      for (int i=0; i<lepvec.size(); i++ ) {
254      bool already_pushed=false;
236        if( !(lepvec[i].status.loose()) ) {
237 <        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
237 >        failingLeptons.push_back(lepvec[i]);
238        } else {
239          passingLeptons.push_back(lepvec[i]);
240        }
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      }
241      }
242  
243      //******************************************************************************

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines