ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/Selection/src/ReferenceSelection.cc
Revision: 1.25
Committed: Sun Jan 20 06:55:17 2013 UTC (12 years, 3 months ago) by anlevin
Content type: text/plain
Branch: MAIN
Changes since 1.24: +2 -1 lines
Log Message:
added mass errors calculation

File Contents

# User Rev Content
1 khahn 1.1 #include "ReferenceSelection.h"
2    
3     extern vector<SimpleLepton> failingLeptons;
4     extern vector<SimpleLepton> passingLeptons;
5    
6 khahn 1.3 extern map<unsigned,float> evtrhoMap;
7 anlevin 1.19 extern bool passes_HLT;
8 anlevin 1.18 extern map<TString, map<TString,int>* > counts;
9 dkralph 1.21 extern ElectronMomentumCorrection electron_momentum_correction;
10     extern MuCorr *muCorr;
11 dkralph 1.23 extern TrigInfo ti;
12 khahn 1.1
13 anlevin 1.24
14     //we need to store the fsr photons because they are used to veto jets in the vbf selection
15     //the leptons in the lepton pair include the fsr photons
16     struct ZCandidate
17     {
18     pair<SimpleLepton,SimpleLepton> lepton_pair;
19     unsigned int which_lepton_has_fsr; //0 means neither lepton has an fsr photon, 1 means the first lepton in the pair has the fsr photon, 2 means second lepton in the pair has the fsr photon
20     PFCandidate fsr_photon;
21     };
22    
23 dkralph 1.21 //----------------------------------------------------------------------------------------
24 khahn 1.7 void updateSimpleLepton(SimpleLepton &tmplep);
25 khahn 1.1 //--------------------------------------------------------------------------------------------------
26     EventData apply_HZZ4L_reference_selection(ControlFlags &ctrl, // input control
27 dkralph 1.21 const EventHeader *info, // input event info
28     const Array<Vertex> * vtxArr ,
29     const Array<PFCandidate> *pfCandidates,
30     const Array<PileupEnergyDensity> *puEnergyDensity,
31     const Array<Electron> *electronArr, // input electrons
32 khahn 1.1 SelectionStatus (*ElectronPreSelector)( ControlFlags &,
33 dkralph 1.21 const Electron*,
34     const Vertex *),
35 khahn 1.1 SelectionStatus (*ElectronIDSelector)( ControlFlags &,
36 dkralph 1.21 const Electron*,
37     const Vertex *),
38 khahn 1.1 SelectionStatus (*ElectronIsoSelector)( ControlFlags &,
39 dkralph 1.21 const Electron*,
40     const Vertex *,
41     const Array<PFCandidate> *,
42     const Array<PileupEnergyDensity> *,
43     ElectronTools::EElectronEffectiveAreaTarget,
44     vector<const PFCandidate*>),
45     const Array<Muon> *muonArr, // input muons
46 khahn 1.1 SelectionStatus (*MuonPreSelector)( ControlFlags &,
47 dkralph 1.21 const Muon*,
48     const Vertex *,
49     const Array<PFCandidate> *),
50 khahn 1.1 SelectionStatus (*MuonIDSelector)( ControlFlags &,
51 dkralph 1.21 const Muon*,
52     // const Vertex &),
53     const Vertex *,
54     const Array<PFCandidate> *),
55 khahn 1.1 SelectionStatus (*MuonIsoSelector)( ControlFlags &,
56 dkralph 1.21 const Muon*,
57     const Vertex *,
58     const Array<PFCandidate> *,
59     const Array<PileupEnergyDensity> *,
60     MuonTools::EMuonEffectiveAreaTarget,
61     vector<const PFCandidate*>)
62 dkralph 1.9 )
63 khahn 1.1 //--------------------------------------------------------------------------------------------------
64 dkralph 1.21 {
65 khahn 1.1 EventData ret;
66     failingLeptons.clear();
67     passingLeptons.clear();
68    
69 dkralph 1.21 MuonTools::EMuonEffectiveAreaTarget eraMu;
70     ElectronTools::EElectronEffectiveAreaTarget eraEle;
71 dkralph 1.9 getEATargets(ctrl,eraMu,eraEle);
72 khahn 1.1
73     if( ctrl.debug ) {
74     cout << "presel nlep: " << muonArr->GetEntries() + electronArr->GetEntries()
75     << "\tnmuon: " << muonArr->GetEntries()
76     << "\tnelectron: " << electronArr->GetEntries()
77     << endl;
78     }
79    
80 dkralph 1.21 // correct muon momentum
81     if(ctrl.correct_muon_momentum) {
82     assert(muCorr->corr2011 && muCorr->corr2012);
83 dkralph 1.23 if(ctrl.debug) cout << "mu corr: " << endl;
84 anlevin 1.16 for(int i=0; i<muonArr->GetEntries(); i++) {
85 dkralph 1.21 const Muon *const_mu = (Muon*)((*muonArr)[i]);
86     Muon *mu = const_cast<Muon*>(const_mu);
87 anlevin 1.24 double ptBefore = mu->Pt();
88 dkralph 1.21 correct_muon_momentum(ctrl,muCorr,mu,info->RunNum());
89 dkralph 1.23 if(ctrl.debug) cout << " " << setw(12) << ptBefore << " --> " << setw(12) << mu->Pt() << " (" << fabs(ptBefore-mu->Pt())/ptBefore << ")" << endl;
90 anlevin 1.16 }
91     }
92 khahn 1.1
93 dkralph 1.21 const Vertex * vtx;
94 khahn 1.3 bool goodVertex = setPV( ctrl, vtxArr, vtx );
95 dkralph 1.21 if(!goodVertex) {
96 dkralph 1.9 if(ctrl.debug) cout << "found bad vertex" << endl;
97 khahn 1.3 ret.status.setStatus(SelectionStatus::FAIL);
98     return ret;
99     }
100 dkralph 1.21 if(ctrl.debug)
101     cout << "vtx :: ntrks: " << vtx->NTracksFit() << endl;
102 khahn 1.3
103     //***********************************************************
104 khahn 1.11 // Trigger Selection
105 khahn 1.3 //***********************************************************
106 anlevin 1.19 if( passes_HLT ) {
107 dkralph 1.23 increment(counts,"trigger");
108 anlevin 1.19 } else {
109 dkralph 1.21 if(ctrl.debug) cout << "fails trigger" << endl;
110 anlevin 1.19 ret.status.setStatus(SelectionStatus::FAIL);
111     return ret;
112 khahn 1.3 }
113 khahn 1.11
114 khahn 1.1 //***********************************************************
115     // Lepton Selection
116     //***********************************************************
117     vector<SimpleLepton> lepvec;
118 dkralph 1.21 vector<const PFCandidate*> photonsToVeto;
119 khahn 1.1
120     if( ctrl.debug ) cout << "\tnMuons: " << muonArr->GetEntries() << endl;
121     for(int i=0; i<muonArr->GetEntries(); i++)
122     {
123 dkralph 1.23 const Muon *mu = (Muon*)((*muonArr)[i]);
124    
125     SelectionStatus musel;
126     musel |= (*MuonPreSelector)(ctrl,mu,vtx,pfCandidates);
127 anlevin 1.22
128 dkralph 1.23 if(ctrl.fakeScheme == "none") { // regular selection
129     if( !musel.passPre() ) continue;
130     } else { // fake denominator selection
131     SelectionStatus denomSel;
132     denomSel |= muonReferencePreSelection(ctrl,mu,vtx,pfCandidates);
133     if(ctrl.muSele != "none") { // don't apply *any* preselection, to get a super hi stat fake sample for BDT training
134     if( !denomSel.passPre() ) continue;
135     }
136     }
137 khahn 1.1
138 dkralph 1.23 if(ctrl.debug) cout << "muon:: pt: " << mu->Pt() << "\teta: " << mu->Eta() << endl;
139 khahn 1.1
140     musel |= (*MuonIDSelector)(ctrl,mu,vtx,pfCandidates );
141    
142 dkralph 1.23 // NOTE: if we do FSR this is *changed* later on
143     musel |= (*MuonIsoSelector)(ctrl,mu,vtx,pfCandidates,puEnergyDensity,eraMu,photonsToVeto);
144     if(ctrl.debug) cout << "mu status after iso (before fsr) " << musel.getStatus() << endl;
145 khahn 1.1
146     SimpleLepton tmplep;
147 dkralph 1.21 tmplep.vec.SetPtEtaPhiM(mu->Pt(), mu->Eta(), mu->Phi(), MUON_MASS);
148 khahn 1.1 tmplep.type = 13;
149     tmplep.index = i;
150     tmplep.charge = mu->Charge();
151     tmplep.ip3dSig = mu->Ip3dPVSignificance();
152     tmplep.is4l = false;
153     tmplep.isEB = (fabs(mu->Eta()) < 1.479 ? 1 : 0 );
154     tmplep.isLoose = musel.loose();
155 dkralph 1.21 tmplep.isTight = mu->IsPFMuon() || mu->IsGlobalMuon();
156     tmplep.status = musel;
157     tmplep.fsrRecoveryAttempted = false; // NOTE: this is *used* inside FSR.cc
158 khahn 1.1 lepvec.push_back(tmplep);
159     if( ctrl.debug ) cout << endl;
160     }
161    
162     if( ctrl.debug ) { cout << "\tnElectron: " << electronArr->GetEntries() << endl; }
163     for(int i=0; i<electronArr->GetEntries(); i++)
164     {
165 dkralph 1.21 const Electron *const_ele = (Electron*)((*electronArr)[i]);
166     Electron *ele = const_cast<Electron*>(const_ele);
167 anlevin 1.19
168 dkralph 1.23 if(ctrl.debug) cout << setprecision(8) << "el:: scEt " << setw(12) << ele->SCluster()->Et() << " P: "
169     << setw(12) << ele->P() << " pT: " << setw(12) << ele->Pt() << " scEta " << setw(12) << ele->SCluster()->Eta() << setprecision(5) << endl;
170    
171 dkralph 1.21 // evaluate MVA *before* regression correction (but cut on mvaVal *after*)
172     double mvaVal = getElectronIDMVAval(ctrl, ele, vtx);
173    
174 anlevin 1.25 float combination_perr = electron_momentum_correction.correct_electron_momentum(ctrl, ele, info, puEnergyDensity->At(0)->RhoKt6PFJets(), vtxArr->GetEntries());
175 dkralph 1.23
176     if(ctrl.debug) cout << setprecision(8) << " corr el: scEt " << setw(12) << ele->SCluster()->Et() << " P: "
177     << setw(12) << ele->P() << " pT: " << setw(12) << ele->Pt() << " scEta " << setw(12) << ele->SCluster()->Eta() << setprecision(5) << endl;
178 khahn 1.1
179     SelectionStatus elesel;
180 dkralph 1.23 elesel |= (*ElectronPreSelector)(ctrl,ele,vtx);
181    
182     if(ctrl.fakeScheme == "none") { // regular selection
183     if( !elesel.passPre() ) continue;
184     } else { // fake denominator selection
185     SelectionStatus denomSel;
186     denomSel |= electronReferencePreSelection(ctrl,ele,vtx);
187     if(ctrl.eleSele != "none") { // don't apply *any* preselection, to get a super hi stat fake sample for BDT training
188     if( !denomSel.passPre() ) continue;
189     }
190     }
191 khahn 1.1
192 dkralph 1.21
193     elesel |= passElectronIDMVA(ctrl, mvaVal, ele);
194 anlevin 1.17
195 dkralph 1.23 // NOTE: if we do FSR this is *changed* later on
196     elesel |= (*ElectronIsoSelector)(ctrl,ele,vtx,pfCandidates,puEnergyDensity,eraEle,photonsToVeto);
197     if( ctrl.debug ) cout << "el status after iso (no fsr) " << hex << elesel.getStatus() << dec << endl;
198 anlevin 1.19
199 dkralph 1.21 SimpleLepton tmplep;
200     tmplep.vec.SetPtEtaPhiM( ele->Pt(), ele->Eta(), ele->Phi(), ELECTRON_MASS );
201     tmplep.type = 11;
202     tmplep.index = i;
203 anlevin 1.25 tmplep.perr = combination_perr;
204 dkralph 1.21 tmplep.charge = ele->Charge();
205     tmplep.ip3dSig = ele->Ip3dPVSignificance();
206     tmplep.is4l = false;
207     tmplep.isEB = ele->IsEB();
208     tmplep.scID = ele->SCluster()->GetUniqueID();
209     tmplep.isTight = elesel.tight();
210     tmplep.isLoose = elesel.loose();
211     tmplep.status = elesel;
212     tmplep.fsrRecoveryAttempted = false; // NOTE: this is *used* inside FSR.cc
213     lepvec.push_back(tmplep);
214 khahn 1.1 if( ctrl.debug ) cout << endl;
215 khahn 1.7 }
216 khahn 1.1
217     //********************************************************
218     // Dump Stuff
219     //********************************************************
220     sort( lepvec.begin(), lepvec.end(), SimpleLepton::lep_pt_sort );
221     int nmu=0, nele=0;
222     for( int i=0; i<lepvec.size(); i++ ) {
223 khahn 1.3 if(ctrl.debug) {
224 dkralph 1.21 bitset<16> tmpbits(lepvec[i].status.getStatus());
225     cout << "lepvec :: evt: " << setw(8) << info->EvtNum() << " index: " << setw(3) << i << " type: " << setw(4) << lepvec[i].type
226     << " pt: " << setw(11) << lepvec[i].vec.Pt() << " eta: " << setw(11) << lepvec[i].vec.Eta() << " status: " << tmpbits;
227     if(!ctrl.doFSR)
228     cout << "\tpf: " << lepvec[i].status.isoPF04 << "\tch: " << lepvec[i].status.chisoPF04 << "\tga: " << lepvec[i].status.gaisoPF04
229     << "\tne: " << lepvec[i].status.neisoPF04 << endl;
230 khahn 1.8 if( abs(lepvec[i].type) == 11 ) {
231 dkralph 1.21 const Electron *tmpele = (Electron*)((*electronArr)[lepvec[i].index]);
232 khahn 1.8 cout << "\tSCeta: " << tmpele->SCluster()->Eta()
233 dkralph 1.21 << "\tidMVA: " << lepvec[i].status.idMVA;
234 khahn 1.8 }
235 khahn 1.3 cout << endl;
236     }
237 khahn 1.1 if( abs(lepvec[i].type) == 11 ) nele++;
238     else nmu++;
239     }
240     if( ctrl.debug ) {
241     cout << "postsel nlep: " << lepvec.size()
242     << "\tnmuon: " << nmu
243     << "\tnelectron: " << nele
244     << endl;
245     }
246    
247     //********************************************************
248 dkralph 1.21 // Step 2: Lepton Cross-Cleaning: remove electrons that are next to 'good'ish muons
249 khahn 1.1 //********************************************************
250     vector<vector<SimpleLepton>::iterator> electrons_to_erase;
251     for (vector<SimpleLepton>::iterator it1=lepvec.begin();
252     it1 != lepvec.end(); it1++ ) {
253     if ( abs(it1->type) != 11 ) continue;
254     TVector3 evec = it1->vec.Vect();
255    
256 khahn 1.3 bool erase_this_electron=false;
257 khahn 1.1 for (vector<SimpleLepton>::iterator it2=lepvec.begin();
258     it2 != lepvec.end(); it2++ ) {
259 dkralph 1.23 if ( it2 == it1 ) continue;
260     if ( abs(it2->type) != 13 ) continue;
261     if( !it2->status.passPre() ) continue;
262     if( !it2->isTight ) continue; // NOTE: isTight is set to it2->isPFMuon || it2->isGlobalMuon
263 anlevin 1.19
264 khahn 1.1 TVector3 mvec = it2->vec.Vect();
265     if ( evec.DrEtaPhi(mvec) < 0.05 ) {
266 khahn 1.3 erase_this_electron=true;
267     break;
268 khahn 1.1 }
269     }
270 khahn 1.3 if( erase_this_electron ) {
271     if( ctrl.debug ) cout << "erasing electron with pt " << it1->vec.Pt() << endl;
272     electrons_to_erase.push_back(it1);
273     }
274 khahn 1.1 }
275     for( int i=0; i<electrons_to_erase.size(); i++ ) {
276     lepvec.erase(electrons_to_erase[i]);
277     }
278    
279 dkralph 1.23 // fill passing and failing leptons for fakes
280     // (NOTE: isolation hasn't been corrected post-fsr, so this isn't strictly correct)
281     // also note: sip cut not applied
282     for (int i=0; i<lepvec.size(); i++ ) {
283     if( lepvec[i].isLoose )
284     passingLeptons.push_back(lepvec[i]);
285     else
286     failingLeptons.push_back(lepvec[i]);
287     }
288    
289 khahn 1.1 //********************************************************
290 dkralph 1.23 // Step 3: Good Leptons (remove non-id-and-pre'd leptons, and apply |ip3ds| < 4)
291 khahn 1.1 //********************************************************
292 khahn 1.3 vector<double> pt_of_leptons_to_erase;
293     for (int i=0; i<lepvec.size(); i++ ) {
294     bool already_pushed=false;
295 khahn 1.7 if( !(lepvec[i].status.looseIDAndPre()) ) {
296 khahn 1.3 pt_of_leptons_to_erase.push_back(lepvec[i].vec.Pt());
297     already_pushed = true;
298 khahn 1.1 if(ctrl.debug)
299 khahn 1.3 cout << "pushing failed lepton type: " << lepvec[i].type
300     << "\tpt: " << lepvec[i].vec.Pt()
301     << "\teta: " << lepvec[i].vec.Eta()
302 khahn 1.1 << endl;
303 dkralph 1.23 // failingLeptons.push_back(lepvec[i]); // these should pass preselection
304 khahn 1.1 } else {
305 dkralph 1.23 // passingLeptons.push_back(lepvec[i]);
306 khahn 1.3 }
307     if( !already_pushed && fabs(lepvec[i].ip3dSig)>4 )
308 dkralph 1.13 pt_of_leptons_to_erase.push_back(lepvec[i].vec.Pt());
309 khahn 1.3 }
310 dkralph 1.13 for( int i=0; i<pt_of_leptons_to_erase.size(); i++ ) {
311 khahn 1.3 for( vector<SimpleLepton>::iterator it=lepvec.begin();
312     it != lepvec.end(); it++ ) {
313     SimpleLepton flep = *it;
314     if( flep.vec.Pt() != pt_of_leptons_to_erase[i] ) continue;
315     if(ctrl.debug) cout << "erasing lepton : "
316     << flep.vec.Pt() << "\t"
317     << flep.type << "\t"
318     << endl;
319     lepvec.erase(it);
320     break;
321 khahn 1.1 }
322     }
323 khahn 1.3 if( ctrl.debug ) cout << "good leptons : " << lepvec.size() << endl;
324    
325 khahn 1.1 //********************************************************
326 dkralph 1.21 // Ghost Removal
327     //********************************************************
328     vector<vector<SimpleLepton>::iterator> leptons_to_erase;
329     for (vector<SimpleLepton>::iterator it1=lepvec.begin(); it1 != lepvec.end(); it1++ ) {
330     TVector3 lep1 = it1->vec.Vect();
331    
332     bool erase_this_lepton=false;
333     for (vector<SimpleLepton>::iterator it2=it1+1; it2 != lepvec.end(); it2++ ) {
334     TVector3 lep2 = it2->vec.Vect();
335    
336     if ( lep1.DrEtaPhi(lep2) <= 0.02 ) {
337     erase_this_lepton=true;
338     break;
339     }
340     }
341     if( erase_this_lepton ) {
342     if( ctrl.debug ) cout << "erasing ghost with pt " << it1->vec.Pt() << endl;
343     leptons_to_erase.push_back(it1);
344     }
345     }
346     for( int i=0; i<leptons_to_erase.size(); i++ ) {
347     lepvec.erase(leptons_to_erase[i]);
348     }
349    
350     //********************************************************
351 khahn 1.1 // Step 4: Z candidate preselection
352     //********************************************************
353 dkralph 1.23 vector<pair<int,int> > ZCandidates; // indices in lepvec of the two leptons
354 anlevin 1.24 vector<ZCandidate > ZCandidatesLeptons; // fsr-corrected leptons that form the Z
355 dkralph 1.21 vector<pair<SelectionStatus,SelectionStatus> > ZCandidatesSelectionStatus;
356 khahn 1.1 for(int i = 0; i < lepvec.size(); ++i) {
357     for(int j = i+1; j < lepvec.size(); ++j) {
358     if( abs(lepvec[i].type) != abs(lepvec[j].type) ) continue;
359     if( lepvec[i].charge == lepvec[j].charge ) continue;
360 khahn 1.7
361     TLorentzVector Zvec = (lepvec[i].vec+lepvec[j].vec);
362    
363 anlevin 1.24 // copies of lepvec that have 1) the photons added to the momenta and 2) the fsrRecoveryAttempted flag set
364 khahn 1.8 vector<SimpleLepton> lepvec_i = lepvec;
365     vector<SimpleLepton> lepvec_j = lepvec;
366    
367 anlevin 1.24 ZCandidate cand;
368     cand.which_lepton_has_fsr = 0; //default value for when neither photon has an fsr photon
369    
370 dkralph 1.13 if( ctrl.doFSR ) {
371 dkralph 1.21 if(ctrl.debug) cout << endl << "----------------> FSR ("<<i<<","<<j<<") <----------------------" << endl;
372 khahn 1.8 photonsToVeto.clear();
373 dkralph 1.23 float old_pt_i = lepvec[i].vec.Pt();
374 khahn 1.8 float old_pt_j = lepvec[j].vec.Pt();
375     float old_M = Zvec.M();
376 anlevin 1.22
377 dkralph 1.23 const ChargedParticle *lepton(NULL);
378 dkralph 1.21 if(ctrl.debug) cout << "i: " << i << endl;
379 dkralph 1.23 if(abs(lepvec[i].type) == 13) lepton = dynamic_cast<const ChargedParticle *>((*muonArr)[lepvec[i].index]);
380     else lepton = dynamic_cast<const ChargedParticle *>((*electronArr)[lepvec[i].index]);
381     pair<TLorentzVector,int> photon_i = findFsrPhoton(ctrl, ret, lepton, i, lepvec_i, pfCandidates, electronArr, &Zvec);
382     if(photon_i.second>=0 && ctrl.debug) cout << " FSR :: oldpt: " << old_pt_i << "\tnewpt: " << lepvec_i[i].vec.Pt() << "\tindex: " << i << endl;
383 khahn 1.7
384 dkralph 1.23 lepton = NULL;
385 dkralph 1.21 if(ctrl.debug) cout << "j: " << j << endl;
386 dkralph 1.23 if( abs(lepvec[j].type) == 13 ) lepton = dynamic_cast<const ChargedParticle *>((*muonArr)[lepvec[j].index]);
387     else lepton = dynamic_cast<const ChargedParticle *>((*electronArr)[lepvec[j].index]);
388     pair<TLorentzVector,int> photon_j = findFsrPhoton(ctrl, ret, lepton, j, lepvec_j, pfCandidates, electronArr, &Zvec);
389     if(photon_j.second>=0 && ctrl.debug) cout << " FSR :: oldpt: " << old_pt_j << "\tnewpt: " << lepvec_j[j].vec.Pt() << "\tindex: " << j << endl;
390    
391     bool useI(false),useJ(false);
392     if(photon_i.second >= 0) { // photon for i
393     if(photon_j.second < 0) {
394     useI = true;
395     } else { // both have photons
396     TLorentzVector lep_i(lepvec_i[i].vec),lep_j(lepvec_j[j].vec);
397     float oldM = (lep_i + lep_j).M();
398     float newM_i = (lep_i + photon_i.first + lep_j).M();
399     float newM_j = (lep_i + lep_j + photon_j.first).M();
400     if(ctrl.debug) cout << " two FSRs " << setw(12) << oldM << setw(12) << newM_i << setw(12) << newM_j << endl;
401     if(fabs(newM_i - Z_MASS) < fabs(newM_j - Z_MASS)) { // if mass with photon i is closer to z pole than with photon j
402     useI = true;
403     } else {
404     useJ = true;
405     }
406 anlevin 1.22 }
407 dkralph 1.23 } else if(photon_j.second >= 0) { // photon for j
408     useJ = true;
409 anlevin 1.22 }
410    
411 dkralph 1.23 assert(!(useI && useJ));
412     if(useI) {
413 anlevin 1.24 cand.fsr_photon = *((const PFCandidate*) pfCandidates->At(photon_i.second));
414     cand.which_lepton_has_fsr = 1;
415 dkralph 1.23 lepvec_i[i].vec += photon_i.first;
416     lepvec_i[i].fsrRecoveryAttempted = true;
417     photonsToVeto.push_back((const PFCandidate*)(pfCandidates->At(photon_i.second)));
418     } else if(useJ) {
419 anlevin 1.24 cand.fsr_photon = *((const PFCandidate*) pfCandidates->At(photon_j.second));
420     cand.which_lepton_has_fsr = 2;
421 dkralph 1.23 lepvec_j[j].vec += photon_j.first;
422     lepvec_j[j].fsrRecoveryAttempted = true;
423     photonsToVeto.push_back((const PFCandidate*)(pfCandidates->At(photon_j.second)));
424     }
425    
426     // recompute isolation excluding the fsr photons
427 khahn 1.8 if( abs(lepvec[i].type) == 11 ) {
428 dkralph 1.21 const Electron *el = (Electron*)((*electronArr)[lepvec_i[i].index]);
429 dkralph 1.23 lepvec_i[i].status |= (*ElectronIsoSelector)(ctrl,el,vtx,pfCandidates,puEnergyDensity,eraEle,photonsToVeto);
430 khahn 1.8
431     } else {
432 dkralph 1.21 const Muon *mu = (Muon*)((*muonArr)[lepvec_i[i].index]);
433 dkralph 1.23 lepvec_i[i].status |= (*MuonIsoSelector)(ctrl,mu,vtx,pfCandidates,puEnergyDensity,eraMu,photonsToVeto);
434 khahn 1.8 }
435     updateSimpleLepton(lepvec_i[i]);
436    
437     if( abs(lepvec[j].type) == 11 ) {
438 dkralph 1.21 const Electron *el = (Electron*)((*electronArr)[lepvec_j[j].index]);
439 dkralph 1.23 lepvec_j[j].status |= (*ElectronIsoSelector)(ctrl,el,vtx,pfCandidates,puEnergyDensity,eraEle,photonsToVeto);
440 khahn 1.8 } else {
441 dkralph 1.21 const Muon *mu = (Muon*)((*muonArr)[lepvec_j[j].index]);
442 dkralph 1.23 lepvec_j[j].status |= (*MuonIsoSelector)(ctrl,mu,vtx,pfCandidates,puEnergyDensity,eraMu,photonsToVeto);
443 khahn 1.8 }
444     updateSimpleLepton(lepvec_j[j]);
445    
446     float new_M = (lepvec_i[i].vec+lepvec_j[j].vec).M();
447     float new_pt_i = lepvec_i[i].vec.Pt();
448     float new_pt_j = lepvec_j[j].vec.Pt();
449 dkralph 1.23 if( ctrl.debug && ret.fsrPhotons.size() > 0) {
450 dkralph 1.21 cout << " ----> post FSR Z:";
451 dkralph 1.23 cout << " oldM: " << setprecision(8) << old_M << "\tnewM:" << setprecision(8) << new_M << endl;
452     cout << " old_pt_i: " << setprecision(8) << old_pt_i << "\tnew_pt_i:" << setprecision(8) << new_pt_i << endl;
453     cout << " old_pt_j: " << setprecision(8) << old_pt_j << "\tnew_pt_j:" << setprecision(8) << new_pt_j << endl;
454 khahn 1.8 }
455    
456 khahn 1.7 } // doFSR
457 dkralph 1.23
458     // apply isolation criteria with recomputed isolation
459 dkralph 1.21 if( !(lepvec_i[i].status.loose()) || !(lepvec_j[j].status.loose()) ) {
460     if(ctrl.debug) {
461     bitset<16> tmpbits_i(lepvec_i[i].status.getStatus()),tmpbits_j(lepvec_j[j].status.getStatus());
462     cout << " leptons fail selection (i: " << tmpbits_i << ", j: " << tmpbits_j << ")" << endl;
463     }
464     continue;
465     }
466 dkralph 1.23
467 dkralph 1.21 ZCandidates.push_back(pair<int,int> (i,j) );
468 anlevin 1.24 cand.lepton_pair = pair<SimpleLepton,SimpleLepton> (lepvec_i[i],lepvec_j[j]);
469    
470     ZCandidatesLeptons.push_back(cand );
471 dkralph 1.23 if( ctrl.debug ) cout << "Z candidate ("<< i << "," << j << ")" << "\tmass: " << (lepvec_i[i].vec+lepvec_j[j].vec).M() << endl;
472 khahn 1.1 }
473     }
474 dkralph 1.23
475 anlevin 1.24 if( ZCandidates.size() > 0 ) {
476 khahn 1.1 ret.status.selectionBits.flip(PASS_ZCANDIDATE);
477 dkralph 1.21 if( ctrl.debug ) cout << "event has >0 Z candidates (" << ZCandidates.size() << " of em)" << endl;
478 khahn 1.1 } else {
479     ret.status.setStatus(SelectionStatus::FAIL);
480     return ret;
481     }
482    
483 khahn 1.3 //
484 dkralph 1.23 // Select Z1
485 khahn 1.3 //
486     int best_Z1_index;
487     float best_Z1_mass = 9999.;
488     TLorentzVector Z1vec;
489     for( int i=0; i<ZCandidates.size(); i++ ) {
490 anlevin 1.24 TLorentzVector tmpZ1vec = (ZCandidatesLeptons[i].lepton_pair.first.vec) + (ZCandidatesLeptons[i].lepton_pair.second.vec);
491 khahn 1.3 if( fabs(tmpZ1vec.M()-Z_MASS) < fabs(best_Z1_mass-Z_MASS) ) {
492     best_Z1_index=i;
493     best_Z1_mass=tmpZ1vec.M();
494     Z1vec = tmpZ1vec;
495     }
496     }
497 anlevin 1.24 ret.Z1leptons.push_back(ZCandidatesLeptons[best_Z1_index].lepton_pair.first);
498     ret.Z1leptons.push_back(ZCandidatesLeptons[best_Z1_index].lepton_pair.second);
499     if(ZCandidatesLeptons[best_Z1_index].which_lepton_has_fsr != 0){
500     SimpleLepton photon;
501     photon.vec.SetPtEtaPhiM( ZCandidatesLeptons[best_Z1_index].fsr_photon.Pt(), ZCandidatesLeptons[best_Z1_index].fsr_photon.Eta(), ZCandidatesLeptons[best_Z1_index].fsr_photon.Phi(), 0);
502     ret.fsrPhotons.push_back(photon);
503     }
504    
505 dkralph 1.23 if(ctrl.debug)
506     cout << "best mZ1: " << best_Z1_mass << " from (" << ZCandidates[best_Z1_index].first << "," << ZCandidates[best_Z1_index].second << ")" << endl;
507 khahn 1.8
508 khahn 1.3 //******************************************************************************
509     // Step 6.3 : require Z1 with 40<m<120
510     //******************************************************************************
511     if( Z1vec.M() > 40. && Z1vec.M() < 120. ) {
512     ret.status.selectionBits.flip(PASS_GOODZ1);
513     } else {
514     ret.status.setStatus(SelectionStatus::FAIL);
515     return ret;
516     }
517    
518     //******************************************************************************
519     // Step 6.3 : 4 good leptons
520     //******************************************************************************
521     if( lepvec.size() >= 4 ) {
522 dkralph 1.23 if( ctrl.debug) cout << "four leps" << endl;
523 khahn 1.3 ret.status.selectionBits.flip(PASS_4L);
524     } else {
525     ret.status.setStatus(SelectionStatus::FAIL);
526     return ret;
527     }
528    
529 khahn 1.1 //********************************************************
530     // Step 5: ZZ candidates
531     //********************************************************
532     int nZZCandidates=0;
533 dkralph 1.21 vector<pair<int,int> > ZZCandidates;
534     if(ctrl.debug) cout << "looping over " << ZCandidates.size() << " Z candidates: " << endl;
535 khahn 1.3 for(int z2index=0; z2index<ZCandidates.size(); ++z2index) {
536     int z1index = best_Z1_index;
537 dkralph 1.23 if ( z2index == z1index ) { if(ctrl.debug) cout << " Z2 fails z2i = z1i" << endl; continue; }
538     if( ZCandidates[z1index].first == ZCandidates[z2index].first ) { if(ctrl.debug) cout << " Z2 fails icheck1" << endl; continue; }
539     if( ZCandidates[z1index].first == ZCandidates[z2index].second ) { if(ctrl.debug) cout << " Z2 fails icheck2" << endl; continue; }
540     if( ZCandidates[z1index].second == ZCandidates[z2index].first ) { if(ctrl.debug) cout << " Z2 fails icheck3" << endl; continue; }
541     if( ZCandidates[z1index].second == ZCandidates[z2index].second ) { if(ctrl.debug) cout << " Z2 fails icheck4" << endl; continue; }
542 anlevin 1.14
543 dkralph 1.21 ZZCandidates.push_back(pair<int,int> (z1index,z2index));
544 khahn 1.1 }
545 dkralph 1.23 if(ZZCandidates.size() > 0) {
546 khahn 1.1 ret.status.selectionBits.flip(PASS_ZZCANDIDATE);
547 dkralph 1.23 if(ctrl.debug) {
548     cout << ZZCandidates.size() << " zz cands" << endl;
549 khahn 1.3 cout << "-------------------------------------------------------" << endl;
550 dkralph 1.23 // for( int l=0; l<lepvec.size(); l++ ) lepvec[l].print();
551     for(unsigned ican=0; ican<ZCandidatesLeptons.size(); ican++) {
552 anlevin 1.24 ZCandidatesLeptons[ican].lepton_pair.first.print();
553     ZCandidatesLeptons[ican].lepton_pair.second.print();
554 dkralph 1.23 }
555     cout << "-------------------------------------------------------" << endl;
556     if(ctrl.debug)
557     for(unsigned iph=0; iph<ret.fsrPhotons.size(); iph++)
558     cout << " fsr photon "
559     << setw(12) << ret.fsrPhotons[iph].vec.Pt()
560     << " eta: " << setw(12) << ret.fsrPhotons[iph].vec.Eta()
561     << " phi: " << setw(12) << ret.fsrPhotons[iph].vec.Phi() << endl;
562 dkralph 1.21 }
563 khahn 1.1 } else {
564 dkralph 1.23 if(ctrl.debug) cout << "no zz cands" << endl;
565 khahn 1.1 ret.status.setStatus(SelectionStatus::FAIL);
566     return ret;
567     }
568    
569 khahn 1.3 //
570 dkralph 1.23 // Select z2
571 khahn 1.3 //
572     int best_Z2_index;
573 anlevin 1.24 float best_Z2_pt_sum = -1.;
574 khahn 1.1 for( int i=0; i<ZZCandidates.size(); i++ ) {
575 khahn 1.3 int z2index = ZZCandidates[i].second;
576 anlevin 1.24 double pt_sum = ZCandidatesLeptons[z2index].lepton_pair.first.vec.Pt() +
577     ZCandidatesLeptons[z2index].lepton_pair.second.vec.Pt();
578     if( pt_sum > best_Z2_pt_sum ) {
579 khahn 1.3 best_Z2_index=z2index;
580 anlevin 1.24 best_Z2_pt_sum=pt_sum;
581 khahn 1.1 }
582     }
583 anlevin 1.24 ret.Z2leptons.push_back(ZCandidatesLeptons[best_Z2_index].lepton_pair.first); // push back the *fsr-corrected* leptons
584     ret.Z2leptons.push_back(ZCandidatesLeptons[best_Z2_index].lepton_pair.second);
585     if(ZCandidatesLeptons[best_Z2_index].which_lepton_has_fsr != 0){
586     SimpleLepton photon;
587     photon.vec.SetPtEtaPhiM( ZCandidatesLeptons[best_Z2_index].fsr_photon.Pt(), ZCandidatesLeptons[best_Z2_index].fsr_photon.Eta(), ZCandidatesLeptons[best_Z2_index].fsr_photon.Phi(), 0);
588     ret.fsrPhotons.push_back(photon);
589     }
590    
591 khahn 1.8
592 anlevin 1.24 int theZ1type = abs(ZCandidatesLeptons[best_Z1_index].lepton_pair.first.type);
593     int theZ2type = abs(ZCandidatesLeptons[best_Z2_index].lepton_pair.first.type);
594 khahn 1.8
595 dkralph 1.21 if(ctrl.debug) cout << "best mZ2: " << (ret.Z2leptons[0].vec+ret.Z2leptons[1].vec).M() << " from ("
596     << ZCandidates[best_Z2_index].first << "," << ZCandidates[best_Z2_index].second << ")" << endl;
597    
598 dkralph 1.23 increment(counts,"sfOsHiPt",theZ1type,theZ2type);
599 khahn 1.1
600 dkralph 1.21 if(ctrl.debug) cout << "ZZ :: evt: " << info->EvtNum()
601     << "\tmZ1: " << (ret.Z1leptons[0].vec+ret.Z1leptons[1].vec).M()
602     << "\tmZ2: " << (ret.Z2leptons[0].vec+ret.Z2leptons[1].vec).M()
603     << endl;
604    
605 khahn 1.7
606 khahn 1.1 //******************************************************************************
607 khahn 1.3 // Step 6.4 : require Z2 with 4<m<120
608 khahn 1.1 //******************************************************************************
609 anlevin 1.24 TLorentzVector Z2vec = (ZCandidatesLeptons[best_Z2_index].lepton_pair.first.vec) +
610     (ZCandidatesLeptons[best_Z2_index].lepton_pair.second.vec);
611 khahn 1.3 if( Z2vec.M() > 4 && Z2vec.M() < 120 ) {
612     ret.status.selectionBits.flip(PASS_GOODZ2);
613 dkralph 1.23 increment(counts,"4<mZ2<120",theZ1type,theZ2type);
614 khahn 1.1 } else {
615     ret.status.setStatus(SelectionStatus::FAIL);
616     return ret;
617     }
618    
619 dkralph 1.21
620 khahn 1.1 //******************************************************************************
621 khahn 1.3 // Step 6.1 : any two leptons 20/10
622 khahn 1.1 //******************************************************************************
623 khahn 1.8 vector<SimpleLepton> zzleptons;
624 anlevin 1.24 zzleptons.push_back( ZCandidatesLeptons[best_Z1_index].lepton_pair.first );
625     zzleptons.push_back( ZCandidatesLeptons[best_Z1_index].lepton_pair.second );
626     zzleptons.push_back( ZCandidatesLeptons[best_Z2_index].lepton_pair.first );
627     zzleptons.push_back( ZCandidatesLeptons[best_Z2_index].lepton_pair.second );
628 anlevin 1.19 int nlep_above_10=0,nlep_above_20=0;
629 khahn 1.3 for( int i=0; i<zzleptons.size(); i++ ) {
630 khahn 1.8 if( zzleptons[i].vec.Pt() > 10 ) nlep_above_10++;
631     if( zzleptons[i].vec.Pt() > 20 ) nlep_above_20++;
632 khahn 1.1 }
633 khahn 1.3 if( nlep_above_10 > 1 && nlep_above_20 > 0 ) {
634     ret.status.selectionBits.flip(PASS_ZZ_20_10);
635 dkralph 1.23 increment(counts,"pt>20,10",theZ1type,theZ2type);
636 khahn 1.3 if( ctrl.debug ) cout << "passess 20/10 ..." << endl;
637 khahn 1.1 } else {
638     ret.status.setStatus(SelectionStatus::FAIL);
639     return ret;
640     }
641 khahn 1.3
642 dkralph 1.21
643    
644    
645 khahn 1.1 //******************************************************************************
646 khahn 1.7 // Step 6.5 : resonance killing (4/4)
647 khahn 1.1 //******************************************************************************
648 anlevin 1.24
649     //the resonance killing is done based on the leptons without fsr recovered to them
650     vector<SimpleLepton > zzleptons_nofsr;
651    
652     //add all of the leptons to a vector and remove the fsr photon if there is one
653     if(ZCandidatesLeptons[best_Z1_index].which_lepton_has_fsr == 1){
654     SimpleLepton no_fsr_lepton = ZCandidatesLeptons[best_Z1_index].lepton_pair.first;
655     TLorentzVector photon_vec;
656     photon_vec.SetPtEtaPhiM(ZCandidatesLeptons[best_Z1_index].fsr_photon.Pt(),ZCandidatesLeptons[best_Z1_index].fsr_photon.Eta(),ZCandidatesLeptons[best_Z1_index].fsr_photon.Phi(),0);
657     no_fsr_lepton.vec = no_fsr_lepton.vec - photon_vec;
658     zzleptons_nofsr.push_back( no_fsr_lepton );
659     ret.Z1leptons_without_fsr.push_back(no_fsr_lepton);
660     }
661     else {
662     zzleptons_nofsr.push_back( ZCandidatesLeptons[best_Z1_index].lepton_pair.first);
663     ret.Z1leptons_without_fsr.push_back(ZCandidatesLeptons[best_Z1_index].lepton_pair.first);
664     }
665    
666     if(ZCandidatesLeptons[best_Z1_index].which_lepton_has_fsr == 2){
667     SimpleLepton no_fsr_lepton = ZCandidatesLeptons[best_Z1_index].lepton_pair.second;
668     TLorentzVector photon_vec;
669     photon_vec.SetPtEtaPhiM(ZCandidatesLeptons[best_Z1_index].fsr_photon.Pt(),ZCandidatesLeptons[best_Z1_index].fsr_photon.Eta(),ZCandidatesLeptons[best_Z1_index].fsr_photon.Phi(),0);
670     no_fsr_lepton.vec = no_fsr_lepton.vec - photon_vec;
671     zzleptons_nofsr.push_back( no_fsr_lepton );
672     ret.Z1leptons_without_fsr.push_back(no_fsr_lepton);
673     }
674     else{
675     zzleptons_nofsr.push_back( ZCandidatesLeptons[best_Z1_index].lepton_pair.second);
676     ret.Z1leptons_without_fsr.push_back(ZCandidatesLeptons[best_Z1_index].lepton_pair.second);
677     }
678    
679     if(ZCandidatesLeptons[best_Z2_index].which_lepton_has_fsr == 1){
680     SimpleLepton no_fsr_lepton = ZCandidatesLeptons[best_Z2_index].lepton_pair.first;
681     TLorentzVector photon_vec;
682     photon_vec.SetPtEtaPhiM(ZCandidatesLeptons[best_Z2_index].fsr_photon.Pt(),ZCandidatesLeptons[best_Z2_index].fsr_photon.Eta(),ZCandidatesLeptons[best_Z2_index].fsr_photon.Phi(),0);
683     no_fsr_lepton.vec = no_fsr_lepton.vec - photon_vec;
684     zzleptons_nofsr.push_back( no_fsr_lepton );
685     ret.Z2leptons_without_fsr.push_back(no_fsr_lepton);
686     }
687     else {
688     zzleptons_nofsr.push_back( ZCandidatesLeptons[best_Z2_index].lepton_pair.first);
689     ret.Z2leptons_without_fsr.push_back(ZCandidatesLeptons[best_Z2_index].lepton_pair.first);
690     }
691    
692     if(ZCandidatesLeptons[best_Z2_index].which_lepton_has_fsr == 2){
693     SimpleLepton no_fsr_lepton = ZCandidatesLeptons[best_Z2_index].lepton_pair.second;
694     TLorentzVector photon_vec;
695     photon_vec.SetPtEtaPhiM(ZCandidatesLeptons[best_Z2_index].fsr_photon.Pt(),ZCandidatesLeptons[best_Z2_index].fsr_photon.Eta(),ZCandidatesLeptons[best_Z2_index].fsr_photon.Phi(),0);
696     no_fsr_lepton.vec = no_fsr_lepton.vec - photon_vec;
697     zzleptons_nofsr.push_back( no_fsr_lepton );
698     ret.Z2leptons_without_fsr.push_back(no_fsr_lepton);
699     }
700     else{
701     zzleptons_nofsr.push_back( ZCandidatesLeptons[best_Z2_index].lepton_pair.second);
702     ret.Z2leptons_without_fsr.push_back( ZCandidatesLeptons[best_Z2_index].lepton_pair.second);
703     }
704    
705 khahn 1.3 bool resonance = false;
706 anlevin 1.24 for( int i=0; i<zzleptons_nofsr.size(); i++ ) {
707     for( int j=i+1; j<zzleptons_nofsr.size(); j++ ) {
708     if( zzleptons_nofsr[i].charge == zzleptons_nofsr[j].charge ) continue; // 4/4
709    
710     if( (zzleptons_nofsr[i].vec+zzleptons_nofsr[j].vec).M() <= 4. ) {
711 khahn 1.3 resonance = true;
712     break;
713 khahn 1.1 }
714     }
715     }
716 khahn 1.3 if( !resonance ) {
717 khahn 1.1 ret.status.selectionBits.flip(PASS_RESONANCE);
718 dkralph 1.23 increment(counts,"mll>4",theZ1type,theZ2type);
719 khahn 1.1 if( ctrl.debug ) cout << "\tpasses resonance killing ... " << endl;
720     } else {
721     ret.status.setStatus(SelectionStatus::FAIL);
722     return ret;
723 dkralph 1.21 }
724    
725    
726 khahn 1.3
727 khahn 1.1 //******************************************************************************
728 khahn 1.3 // Step 6.6 : m(4l) > 70 , m(4l) > 100
729 khahn 1.1 //******************************************************************************
730 anlevin 1.24 TLorentzVector zzvec = (ZCandidatesLeptons[best_Z1_index].lepton_pair.first.vec) +
731     (ZCandidatesLeptons[best_Z1_index].lepton_pair.second.vec) +
732     (ZCandidatesLeptons[best_Z2_index].lepton_pair.first.vec) +
733     (ZCandidatesLeptons[best_Z2_index].lepton_pair.second.vec);
734 khahn 1.3
735 dkralph 1.21 if(ctrl.debug)
736     cout << "forming zz from: "
737 anlevin 1.24 << setw(9) << (ZCandidatesLeptons[best_Z1_index].lepton_pair.first.vec).Pt()
738     << setw(9) << (ZCandidatesLeptons[best_Z1_index].lepton_pair.second.vec).Pt()
739     << setw(9) << (ZCandidatesLeptons[best_Z2_index].lepton_pair.first.vec).Pt()
740     << setw(9) << (ZCandidatesLeptons[best_Z2_index].lepton_pair.second.vec).Pt() << endl;
741 dkralph 1.21
742 dkralph 1.13 if( zzvec.M() > 70. ) {
743     if(ctrl.debug) cout << "passes mzz > 70, mzz: " << zzvec.M() << endl;
744 khahn 1.3 ret.status.selectionBits.flip(PASS_m4l_GT_70);
745 dkralph 1.23 increment(counts,"m4l>70",theZ1type,theZ2type);
746 khahn 1.3 } else {
747     ret.status.setStatus(SelectionStatus::FAIL);
748     return ret;
749 khahn 1.1 }
750 dkralph 1.21
751     if( (ret.Z2leptons[0].vec+ret.Z2leptons[1].vec).M() > 12 ){
752     if(ctrl.debug) cout << "passes mZ2 > 12" << endl;
753 dkralph 1.23 increment(counts,"mZ2>12",theZ1type,theZ2type);
754 anlevin 1.20 } else {
755     ret.status.setStatus(SelectionStatus::FAIL);
756     return ret;
757     }
758    
759 dkralph 1.21 if( zzvec.M() > 100 ) {
760     if(ctrl.debug) cout << "passes mzz > 100, mzz: " << zzvec.M() << endl;
761 dkralph 1.23 increment(counts,"m4l>100",theZ1type,theZ2type);
762 dkralph 1.21 } else {
763 anlevin 1.24 ret.status.setStatus(SelectionStatus::FAIL);
764     //return ret;
765 dkralph 1.23 // cout << "NOTE: failed m4l>100 (" << zzvec.M() << "), but saving to ntuple anyway" << endl;
766 dkralph 1.21 }
767 khahn 1.4
768     //***************************************************************
769     // finish
770     //***************************************************************
771 khahn 1.1
772 anlevin 1.24 TLorentzVector theZ1 = (ZCandidatesLeptons[best_Z1_index].lepton_pair.first.vec) +
773     (ZCandidatesLeptons[best_Z1_index].lepton_pair.second.vec);
774     TLorentzVector theZ2 = (ZCandidatesLeptons[best_Z2_index].lepton_pair.first.vec) +
775     (ZCandidatesLeptons[best_Z2_index].lepton_pair.second.vec);
776 khahn 1.1 TLorentzVector theZZ = theZ1 + theZ2;
777 khahn 1.3
778 dkralph 1.23 // if(ret.fsrPhotons.size() > 0) {
779     // if(ctrl.debug)
780     // cout << " fsr photon! pt: "
781     // << setw(12) << ret.fsrPhotons[0].vec.Pt()
782     // << " eta: " << setw(12) << ret.fsrPhotons[0].vec.Eta()
783     // << " phi: " << setw(12) << ret.fsrPhotons[0].vec.Phi() << endl;
784     // }
785     // if(ret.fsrPhotons.size() > 1) {
786     // if(ctrl.debug)
787     // cout << " fsr photon! pt: "
788     // << setw(12) << ret.fsrPhotons[1].vec.Pt()
789     // << " eta: " << setw(12) << ret.fsrPhotons[1].vec.Eta()
790     // << " phi: " << setw(12) << ret.fsrPhotons[1].vec.Phi() << endl;
791     // }
792 khahn 1.1 if( ctrl.debug ) cout << "run: " << info->RunNum()
793     << "\tevt: " << info->EvtNum()
794     << "\tZ1channel: " << theZ1type
795     << "\tZ2channel: " << theZ2type
796     << "\tmZ1: " << theZ1.M()
797     << "\tmZ2: " << theZ2.M()
798     << "\tm4l: " << theZZ.M()
799     << endl;
800 khahn 1.3
801 dkralph 1.21 ret.status.setStatus(SelectionStatus::EVTPASS);
802 khahn 1.3
803 khahn 1.1 return ret;
804     }
805 khahn 1.7 //----------------------------------------------------------------------------
806     void updateSimpleLepton(SimpleLepton &tmplep)
807     //----------------------------------------------------------------------------
808     {
809     tmplep.isTight = tmplep.status.tight();
810     tmplep.isLoose = tmplep.status.loose();
811     }