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

Comparing UserCode/MitHzz4l/Selection/src/Selection.cc (file contents):
Revision 1.13 by khahn, Sun Oct 30 15:12:30 2011 UTC vs.
Revision 1.20 by khahn, Thu Apr 26 06:56:30 2012 UTC

# Line 1 | Line 1
1 < #include "Selection.h"
2 < #include "PassHLT.h"
3 <
4 < #include "SiMVAElectronSelection.h"
5 <
6 < #include "HZZCiCElectronSelection.h"
7 < #include "HZZLikelihoodElectronSelection.h"
8 < #include "HZZBDTElectronSelection.h"
9 < #include "RunLumiRangeMap.h"
1 > #include "SelectionStatus.h"
2 > #include "EventData.h"
3 > #include "SimpleLepton.h"
4   #include "EfficiencyWeightsInterface.h"
5  
6 < RunLumiRangeMap rlrm;
6 > #include "ElectronSelection.h"
7 > #include "MuonSelection.h"
8 > #include "IsolationSelection.h"
9 > //#include "PassHLT.h"
10 > #include "Selection.h"
11  
12 < // #include "TH2D.h"
13 < // extern TH2D * h_mu_eff_idiso_2011a;
16 < // extern TH2D * h_mu_eff_idiso_s11;
17 < // extern TH2D * h_mu_effdata_trigger_doublemu7_2011a;
18 < // extern TH2D * h_mu_effdata_trigger_doublemu13_8_leading_2011a;
19 < // extern TH2D * h_mu_effdata_trigger_doublemu13_8_trailing_2011a;
20 <
21 < // unsigned getGenChannel(mithep::TGenInfo * ginfo) {
22 < //   int gchannel=-1;
23 < //   if( abs(ginfo->id_1_a) == EGenType::kElectron && abs(ginfo->id_1_b) == EGenType::kElectron )  gchannel=0;
24 < //   else if( abs(ginfo->id_1_a) == EGenType::kMuon && abs(ginfo->id_1_b) == EGenType::kMuon ) gchannel=1;
25 < //   else if( (abs(ginfo->id_1_a) == EGenType::kElectron && abs(ginfo->id_1_b) == EGenType::kMuon) ||
26 < //         (abs(ginfo->id_1_a) == EGenType::kMuon && abs(ginfo->id_1_b) == EGenType::kElectron) ) gchannel=2;
27 <  
28 < //   return gchannel;
29 < // };
30 <
31 < void initRunLumiRangeMap() {
32 <  rlrm.AddJSONFile(std::string("./data/Cert_136033-149442_7TeV_Apr21ReReco_Collisions10_JSON.txt"));
33 <  //  rlrm.AddJSONFile(std::string("./data/Cert_160404-173244_7TeV_PromptReco_Collisions11_JSON_v2.txt"));
34 <  rlrm.AddJSONFile(std::string("./data/Cert_160404-178078_7TeV_PromptReco_Collisions11_JSON.txt"));
35 <  rlrm.AddJSONFile(std::string("./data/Cert_160404-163869_7TeV_May10ReReco_Collisions11_JSON_v3.txt"));  
36 <  rlrm.AddJSONFile(std::string("./data/Cert_170249-172619_7TeV_ReReco5Aug_Collisions11_JSON.txt"));  
37 < };
38 <
39 < void initRunLumiRangeMap(RunLumiRangeMap &rlrm) {
40 <  cout << "adding JSONS ... "  << endl;
41 <  rlrm.AddJSONFile(std::string("./data/Cert_136033-149442_7TeV_Apr21ReReco_Collisions10_JSON.txt"));
42 <  //  rlrm.AddJSONFile(std::string("./data/Cert_160404-173244_7TeV_PromptReco_Collisions11_JSON_v2.txt"));
43 <  rlrm.AddJSONFile(std::string("./data/Cert_160404-178078_7TeV_PromptReco_Collisions11_JSON.txt"));
44 <  rlrm.AddJSONFile(std::string("./data/Cert_160404-163869_7TeV_May10ReReco_Collisions11_JSON_v3.txt"));  
45 <  rlrm.AddJSONFile(std::string("./data/Cert_170249-172619_7TeV_ReReco5Aug_Collisions11_JSON.txt"));  
46 < };
47 <
48 < // unsigned fails_HZZ4L_selection(ControlFlags &ctrl,           // input control
49 < //                             mithep::TEventInfo *info,     // input event inof
50 < //                             TClonesArray *electronArr,    // input electrons
51 < //                             TClonesArray *muonArr,        // input muons
52 < //                             double eventweight,           // weight
53 < //                             TTree * passtuple ) {
54 <
55 < //   fails_HZZ4L_selection( ctrl, info, electronArr, muonArr, eventweight, passtuple, NULL );
56 <
57 < // };
58 <
59 <
60 <
61 < // unsigned fails_HZZ4L_selection(ControlFlags &ctrl,           // input control
62 < //                             mithep::TEventInfo *info,     // input event inof
63 < //                             TClonesArray *electronArr,    // input electrons
64 < //                             TClonesArray *muonArr,        // input muons
65 < //                             double eventweight,           // weight
66 < //                             LabVectors  *l ) {
67 <
68 < //   fails_HZZ4L_selection( ctrl, info, electronArr, muonArr, eventweight, NULL, l );
69 <
70 < // };
71 <
72 <
73 < unsigned fails_HZZ4L_selection(ControlFlags &ctrl,           // input control
74 <                               mithep::TGenInfo *ginfo ,     // input gen info
75 <                               mithep::TEventInfo *info,     // input event info
76 <                               TClonesArray *electronArr,    // input electrons
77 <                               TClonesArray *muonArr,        // input muons
78 <                               double eventweight,           // weight
79 <                               TTree * passtuple ) {
80 <
81 <  fails_HZZ4L_selection( ctrl, info, electronArr, muonArr, eventweight, passtuple, NULL, NULL );
82 <
83 < };
84 <
85 < unsigned fails_HZZ4L_selection(ControlFlags &ctrl,           // input control
86 <                               mithep::TEventInfo *info,     // input event info
87 <                               TClonesArray *electronArr,    // input electrons
88 <                               TClonesArray *muonArr,        // input muons
89 <                               double eventweight,           // weight
90 <                               TTree * passtuple,
91 <                               LabVectors * l ) {
92 <  fails_HZZ4L_selection( ctrl, info, electronArr, muonArr, eventweight, passtuple, l, NULL );
93 < }
12 > #include "ExternData.h"
13 > #include "SelectionDefs.h"
14  
15  
16 < unsigned fails_HZZ4L_selection(ControlFlags &ctrl,           // input control
17 <                               mithep::TEventInfo *info,     // input event info
18 <                               TClonesArray *electronArr,    // input electrons
19 <                               TClonesArray *muonArr,        // input muons
20 <                               double eventweight,           // weight
21 <                               TTree * passtuple,
22 <                               LabVectors * l=NULL,
23 <                               TClonesArray *jetArr=NULL ) {       // output ntuple
16 > // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
17 > // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
18 > // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
19 > EventData apply_HZZ4L_selection(ControlFlags &ctrl,           // input control
20 >                                const mithep::EventHeader *info,     // input event info
21 >                                const mithep::Vertex & vtx,
22 >                                const mithep::Array<mithep::PFCandidate>  *pfCandidates,
23 >                                const mithep::Array<mithep::PileupEnergyDensity>  *puEnergyDensity,
24 >                                const mithep::Array<mithep::Electron> *electronArr,    // input electrons
25 >                                SelectionStatus (*ElectronPreSelector)( ControlFlags &,
26 >                                                                        const mithep::Electron*,
27 >                                                                        const mithep::Vertex &),
28 >                                SelectionStatus (*ElectronIDSelector)( ControlFlags &,
29 >                                                                       const mithep::Electron*,
30 >                                                                       const mithep::Vertex &),
31 >                                SelectionStatus (*ElectronIsoSelector)( ControlFlags &,
32 >                                                                        const mithep::Electron*,
33 >                                                                        const mithep::Vertex &,
34 >                                                                        const mithep::Array<mithep::PFCandidate> *,
35 >                                                                        const mithep::Array<mithep::PileupEnergyDensity> *,
36 >                                                                        mithep::ElectronTools::EElectronEffectiveAreaTarget,
37 >                                                                        vector<const mithep::Muon*>,
38 >                                                                        vector<const mithep::Electron*> ),
39 >                                const mithep::Array<mithep::Muon> *muonArr,    // input muons
40 >                                SelectionStatus (*MuonPreSelector)( ControlFlags &,
41 >                                                                    const mithep::Muon*,
42 >                                                                    const mithep::Vertex &,
43 >                                                                    const mithep::Array<mithep::PFCandidate> *),
44 >                                SelectionStatus (*MuonIDSelector)( ControlFlags &,
45 >                                                                   const mithep::Muon*,
46 >                                                                   const mithep::Vertex &),
47 >                                SelectionStatus (*MuonIsoSelector)( ControlFlags &,
48 >                                                                    const mithep::Muon*,
49 >                                                                    const mithep::Vertex &,
50 >                                                                    const mithep::Array<mithep::PFCandidate> *,
51 >                                                                    const mithep::Array<mithep::PileupEnergyDensity> *,
52 >                                                                    mithep::MuonTools::EMuonEffectiveAreaTarget,
53 >                                                                    vector<const mithep::Muon*>,
54 >                                                                    vector<const mithep::Electron*> )
55 >                                )
56 >  // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
57 > {      
58  
59 +  EventData ret;
60    unsigned evtfail = 0x0;
61 <  unsigned gchannel=0xdeaddead;
62 <
108 < //   if( ctrl.mc && ginfo != NULL ) {
109 < //     gchannel = getGenChannel(ginfo);
110 < //   }
111 <
112 <
61 >  TRandom3 r;
62 >  
63    if( ctrl.debug ) {
64 <    cout << "Run: " << info->runNum
65 <         << "\tEvt: " << info->evtNum
66 <         << "\tLumi: " << info->lumiSec
64 >    cout << "Run: " << info->RunNum()
65 >         << "\tEvt: " << info->EvtNum()
66 >         << "\tLumi: " << info->LumiSec()
67           << endl;
68    }
69  
70    if( !ctrl.mc ) {
71      // not accounting for overlap atm
72 <    RunLumiRangeMap::RunLumiPairType rl(info->runNum, info->lumiSec);      
72 >    RunLumiRangeMap::RunLumiPairType rl(info->RunNum(), info->LumiSec());      
73      if( !(rlrm.HasRunLumi(rl)) )  {
74        if( ctrl.debug ) cout << "\tfails JSON" << endl;
75 <      evtfail |= (1<<EVTFAIL_JSON);
76 <      return evtfail;
75 >      ret.status.setStatus(0);
76 >      return ret;
77      }
78    }
129  
130  
79  
80 +  mithep::MuonTools::EMuonEffectiveAreaTarget         eraMu  = mithep::MuonTools::kMuEAData2011;
81 +  mithep::ElectronTools::EElectronEffectiveAreaTarget eraEle = mithep::ElectronTools::kEleEAData2011;
82 +  if( ctrl.mc ) {
83 +    eraMu  = mithep::MuonTools::kMuEAFall11MC;
84 +    eraEle = mithep::ElectronTools::kEleEAFall11MC;
85 +  }
86    
87    
88    //********************************************************
89    // Trigger
90    //********************************************************
91 +  //
92 +  // still have to port this part to bambu
93 +  //
94 +  /*
95    if( !ctrl.mc ) {
96 <    //  if( !(passHLT(info->triggerBits, info->runNum, channel) )  ) {
97 < //     if( !(passHLT(info->triggerBits, info->runNum, 999) )  ) {
98 < //       evtfail |= (1<<EVTFAIL_TRIGGER);
141 < //       return evtfail;
142 < //     }        
143 <  } else {
144 <    if( !(passHLTMC(info->triggerBits)) ) {
96 >    //if( !(passHLT(info->triggerBits, info->runNum, channel) )  ) {
97 >    if( !(passHLT(info->triggerBits, info->runNum, 999) )  ) {
98 >      if( ctrl.debug ) cout << "\tfails trigger" << endl;
99        evtfail |= (1<<EVTFAIL_TRIGGER);
100 <      return evtfail;
101 <    }      
102 <    //    cout << "MC trigger bits: " << hex << info->triggerBits << dec << endl;
103 <  }
150 <
100 >      ret.status.setStatus(0);
101 >      return ret;
102 >    }  
103 >  }
104    if( ctrl.debug ) {
105      cout << "presel nlep: " << muonArr->GetEntries() + electronArr->GetEntries()
106           << "\tnmuon: "    << muonArr->GetEntries()
107           << "\tnelectron: " << electronArr->GetEntries()
108           << endl;
109    }
110 +  */
111  
112    //********************************************************
113    // Lepton Selection
114    //********************************************************
115    vector<SimpleLepton> lepvec;
116 <  
117 <  //    
118 <  if( ctrl.debug ) cout << "\tnMuons: " << muonArr->GetEntries() << endl;
119 <  //----------------------------------------------------
120 <  for(Int_t i=0; i<muonArr->GetEntries(); i++) {
121 <    const mithep::TMuon *mu = (mithep::TMuon*)((*muonArr)[i]);      
122 <    unsigned muonfail;
123 <    if( ctrl.muSele == "ksWW" )
124 <      muonfail = passMuonSelection(mu);
125 <    else
126 <      muonfail = passMuonSelectionZZ(mu);
127 <    if( ctrl.debug ) {
128 <      cout << "muon:: pt: " << mu->pt
129 <           << "\teta: " << mu->eta
130 <           << "\tmask: 0x" << hex << muonfail << dec
131 <           << endl;
132 <    }
133 <    if ( !muonfail ) {
134 <      SimpleLepton tmplep;
135 <      tmplep.vec.SetPtEtaPhiM(mu->pt,
136 <                              mu->eta,
137 <                              mu->phi,
138 <                              105.658369e-3);
185 <      tmplep.type    = 13;
186 <      tmplep.index   = i;
187 <      tmplep.charge  = mu->q;
188 <      tmplep.isoTrk  = mu->trkIso03;
189 <      tmplep.isoEcal = mu->emIso03;
190 <      tmplep.isoHcal = mu->hadIso03;
191 <      tmplep.isoPF03 = mu->pfIso03;
192 <      tmplep.isoPF04 = mu->pfIso04;
193 <      tmplep.ip3dSig = mu->ip3dSig;
194 <      tmplep.is4l    = false;
195 <      tmplep.isEB    = (fabs(mu->eta) < 1.479 ? 1 : 0 );
196 <      lepvec.push_back(tmplep);
197 <      if( ctrl.debug ) { cout << "muon passes ... " << endl;}
116 >
117 >  // do something hacky for vetos for now
118 >  vector<const mithep::Muon*> muonsToVeto;
119 >  vector<const mithep::Electron*> electronsToVeto;
120 >  for(Int_t i=0; i<muonArr->GetEntries(); i++)
121 >    {
122 >      const mithep::Muon *mu = (mithep::Muon*)((*muonArr)[i]);      
123 >      SelectionStatus musel;
124 >      musel |= (*MuonPreSelector)(ctrl,mu,vtx,pfCandidates);
125 >      if( !(musel.getStatus() & SelectionStatus::PRESELECTION) ) continue;
126 >      musel |= (*MuonIDSelector)(ctrl,mu,vtx );
127 >      if( musel.getStatus() == SelectionStatus::TIGHTIDANDPRE )
128 >        muonsToVeto.push_back( mu );
129 >    }
130 >  for(Int_t i=0; i<electronArr->GetEntries(); i++)
131 >    {
132 >      const mithep::Electron *ele = (mithep::Electron*)((*electronArr)[i]);      
133 >      SelectionStatus esel;
134 >      esel |= (*ElectronPreSelector)(ctrl,ele,vtx);
135 >      if( !(esel.getStatus() & SelectionStatus::PRESELECTION) ) continue;
136 >      esel |= (*ElectronIDSelector)(ctrl,ele,vtx );
137 >      if( esel.getStatus() == SelectionStatus::TIGHTIDANDPRE )
138 >        electronsToVeto.push_back( ele );
139      }
199  }
200  
201  if( ctrl.debug ) { cout << "\tnElectron: " << electronArr->GetEntries() << endl; }
140  
141 +  //    
142 +  if( ctrl.debug ) cout << "\tnMuons: " << muonArr->GetEntries() << endl;
143    //----------------------------------------------------
144 <  for(Int_t i=0; i<electronArr->GetEntries(); i++) {
145 <    const mithep::TElectron *ele = (mithep::TElectron*)((*electronArr)[i]);
146 <
147 <    if( !(isEleFO(ctrl,ele) ) ) continue;
148 <    if( ele->pt < 7 ) continue; //move this to ID
149 <
150 <    Bool_t isMuonOverlap = kFALSE;
151 <    for (int k=0; k<lepvec.size(); ++k) {
152 <      TVector3 tmplep;
153 <      tmplep.SetPtEtaPhi(ele->pt, ele->eta, ele->phi);
154 <      if ( lepvec[k].type == 13 && lepvec[k].vec.Vect().DrEtaPhi(tmplep) < 0.1 ) {
155 <        if( ctrl.debug ) cout << "-----> isMuonOverlap! " << endl;
156 <        isMuonOverlap = kTRUE;
157 <        break;
144 >  for(Int_t i=0; i<muonArr->GetEntries(); i++)
145 >    {
146 >      const mithep::Muon *mu = (mithep::Muon*)((*muonArr)[i]);      
147 >      
148 >      SelectionStatus musel;
149 >      if(ctrl.debug) cout << "musel.status  before anything: " << musel.getStatus() << endl;
150 >      musel |= (*MuonPreSelector)(ctrl,mu,vtx,pfCandidates);
151 >      if(ctrl.debug) cout << "musel.status  after presel: " << musel.getStatus() << endl;
152 >      if( !(musel.getStatus() & SelectionStatus::PRESELECTION) ) continue;
153 >      musel |= (*MuonIDSelector)(ctrl,mu,vtx );
154 >      if(ctrl.debug) cout << "musel.status  after ID: " << musel.getStatus() << endl;
155 >      musel |= (*MuonIsoSelector)(ctrl,mu,vtx,pfCandidates,puEnergyDensity,eraMu,muonsToVeto,electronsToVeto);
156 >      if(ctrl.debug) cout << "musel.status  after iso: " << musel.getStatus() << endl;
157 >
158 >      if( ctrl.debug ) {
159 >        cout << "muon:: pt: " << mu->Pt()
160 >             << "\teta: " << mu->Eta()
161 >             << "\tstatus: " << hex << musel.getStatus() << dec
162 >             << endl;
163        }
164 <    }
165 <
221 <    unsigned FAIL=0, isEleTight=0;
164 >      
165 >      if ( musel.pass() ) {
166  
167 <    unsigned  failsCIC=0;
168 <    CICStruct ciccuts_tight, ciccuts_medium, ciccuts_loose;
169 <    if(ctrl.eleSele=="cic") {
170 <      if( ctrl.eleSeleScheme == "mediumloose" ) {
171 <        ciccuts_medium = getCiCCuts("medium");
172 <        unsigned failsCICMedium = failsCicSelection(ctrl, ele, ciccuts_medium, ctrl.kinematics);
173 <        ciccuts_loose = getCiCCuts("loose");
174 <        unsigned failsCICLoose = failsCicSelection(ctrl, ele, ciccuts_loose, ctrl.kinematics);
175 <        failsCIC = ( failsCICLoose > 0 && failsCICMedium > 0 );
176 <        if( !failsCICMedium ) isEleTight=1;
177 <      }
178 <      else {
179 <        ciccuts_tight = getCiCCuts(ctrl.eleSeleScheme);
180 <        failsCIC = failsCicSelection(ctrl, ele, ciccuts_tight, ctrl.kinematics);
181 <        if( !failsCIC ) isEleTight=1;
167 >        SimpleLepton tmplep;
168 >        float pt = mu->Pt();
169 >        tmplep.vecorig->SetPtEtaPhiM(pt,
170 >                                     mu->Eta(),
171 >                                     mu->Phi(),
172 >                                     MUON_MASS);
173 >        
174 >        if( ctrl.do_escale_up ) {
175 >          pt=scale_smear_muon_Up(pt, 1,  r);
176 >        }
177 >        if( ctrl.do_escale_down ) {
178 >          pt=scale_smear_muon_Down(pt, 1,  r);
179 >        }
180 >        
181 >        tmplep.vec->SetPtEtaPhiM(pt,
182 >                                 mu->Eta(),
183 >                                 mu->Phi(),
184 >                                 MUON_MASS);
185 >        
186 >        tmplep.type    = 13;
187 >        tmplep.index   = i;
188 >        tmplep.charge  = mu->Charge();
189 >        tmplep.isoTrk  = mu->IsoR03SumPt();
190 >        tmplep.isoEcal = mu->IsoR03EmEt();
191 >        tmplep.isoHcal = mu->IsoR03HadEt();
192 >        tmplep.isoPF03 = computePFMuonIso(mu,vtx,pfCandidates,0.3);
193 >        tmplep.isoPF04 = computePFMuonIso(mu,vtx,pfCandidates,0.4);
194 >        tmplep.ip3dSig = mu->Ip3dPVSignificance();
195 >        tmplep.is4l    = false;
196 >        tmplep.isEB    = (fabs(mu->Eta()) < 1.479 ? 1 : 0 );
197 >        tmplep.isTight = musel.tight();
198 >        tmplep.isLoose = musel.loose();
199 >        lepvec.push_back(tmplep);
200 >        if( ctrl.debug ) { cout << "muon passes ... " << endl;}
201        }
202 <      FAIL = failsCIC;
203 <    }
202 >      //  }
203 >    }    
204 >  
205 >  
206 >    
207 >    //
208 >    if( ctrl.debug ) { cout << "\tnElectron: " << electronArr->GetEntries() << endl; }
209 >    // --------------------------------------------------------------------------------
210 >    for(Int_t i=0; i<electronArr->GetEntries(); i++)
211 >      {
212 >        const mithep::Electron *ele = (mithep::Electron*)((*electronArr)[i]);
213 >        
214 >        Bool_t isMuonOverlap = kFALSE;
215 >        for (int k=0; k<lepvec.size(); ++k) {
216 >          TVector3 tmplep;
217 >          tmplep.SetPtEtaPhi(ele->Pt(), ele->Eta(), ele->Phi());
218 >          if ( lepvec[k].isLoose && lepvec[k].type == 13 && lepvec[k].vec->Vect().DrEtaPhi(tmplep) < 0.1 ) {
219 >            if( ctrl.debug ) cout << "-----> isMuonOverlap! " << endl;
220 >            isMuonOverlap = kTRUE;
221 >            break;
222 >          }
223 >        }
224 >        
225 >        SelectionStatus elesel;
226 >        if( ctrl.debug ) cout << "--> status before anything: " << hex << elesel.getStatus() << dec << endl;
227 >        elesel |= (*ElectronPreSelector)(ctrl,ele,vtx);
228 >        if( ctrl.debug ) cout << "--> status after presel: " << hex << elesel.getStatus() << dec << endl;
229 >        elesel |= (*ElectronIDSelector)(ctrl,ele,vtx);
230 >        if( ctrl.debug ) cout << "--> status after ID: " << hex << elesel.getStatus() << dec << endl;
231 >        elesel |= (*ElectronIsoSelector)(ctrl,ele,vtx,pfCandidates,puEnergyDensity,eraEle,muonsToVeto,electronsToVeto);
232 >        if( ctrl.debug ) cout << "--> status after iso: " << hex << elesel.getStatus() << dec << endl;
233 >        
234 >        if( ctrl.debug ){
235 >          cout << "\tscEt: " << ele->SCluster()->Et()
236 >               << "\tscEta: " << ele->SCluster()->Eta()
237 >               << "\tstatus: " << hex << elesel.getStatus() << dec
238 >               << endl;
239 >        }
240  
241 <    LikStruct likcuts;
242 <    unsigned failsLike=0;
243 <    if(ctrl.eleSele=="lik") {
244 <      likcuts = getLikCuts(ctrl.eleSeleScheme);
245 <      failsLike = failsLikelihoodSelection(ele, likcuts, ctrl.kinematics);
246 <      FAIL = failsLike;
247 <    }
248 <    unsigned failsBDT=0;
249 <    if(ctrl.eleSele=="bdt") {
250 <      if( ctrl.eleSeleScheme == "mediumloose" ) {
251 <        unsigned failsBDTMedium = failsBDTSelection(ctrl,"medium",ele);
252 <        unsigned failsBDTLoose  = failsBDTSelection(ctrl,"loose",ele);
253 <        failsBDT = ( failsBDTLoose > 0 && failsBDTMedium > 0 );
254 <        if( !failsBDTMedium ) isEleTight=1;
255 <      } else {
256 <        failsBDT = failsBDTSelection(ctrl,"tight",ele);
257 <        if( !failsBDT ) isEleTight=1;
241 >        if ( elesel.pass() && !isMuonOverlap )
242 >          {
243 >            SimpleLepton tmplep;
244 >            
245 >            float pt = ele->Pt();
246 >            tmplep.vecorig->SetPtEtaPhiM( pt,
247 >                                          ele->Eta(),
248 >                                          ele->Phi(),
249 >                                          ELECTRON_MASS );
250 >            
251 >            if( ctrl.do_escale ) {
252 >              pt=scale_smear_electron(pt, ele->IsEB(), r);
253 >            }
254 >            if( ctrl.do_escale_up ) {
255 >              pt=scale_smear_electron_Up(pt, ele->IsEB(),  r);
256 >            }
257 >            if( ctrl.do_escale_down ) {
258 >              pt=scale_smear_electron_Down(pt, ele->IsEB(),  r);
259 >            }
260 >
261 >            
262 >            tmplep.vec->SetPtEtaPhiM( pt,
263 >                                      ele->Eta(),
264 >                                      ele->Phi(),
265 >                                      ELECTRON_MASS );
266 >            
267 >            tmplep.type    = 11;
268 >            tmplep.index   = i;
269 >            tmplep.charge  = ele->Charge();
270 >            tmplep.isoTrk  = ele->TrackIsolationDr03();
271 >            tmplep.isoEcal = ele->EcalRecHitIsoDr03();
272 >            tmplep.isoHcal = ele->HcalTowerSumEtDr03();
273 >            tmplep.isoPF03 = computePFEleIso(ele,vtx,pfCandidates,0.3);
274 >            tmplep.isoPF04 = computePFEleIso(ele,vtx,pfCandidates,0.4);
275 >            tmplep.ip3dSig = ele->Ip3dPVSignificance();
276 >            tmplep.is4l    = false;
277 >            tmplep.isEB    = ele->IsEB();
278 >            tmplep.scID    = ele->SCluster()->GetUniqueID();
279 >            tmplep.isTight = elesel.tight();
280 >            tmplep.isLoose = elesel.loose();
281 >            lepvec.push_back(tmplep);
282 >            if( ctrl.debug ) { cout << "\telectron passes ... " << endl; }
283 >          }
284        }
285 <      FAIL = failsBDT;
285 >    
286 >    
287 >    //********************************************************
288 >    // Dump Stuff
289 >    //********************************************************
290 >    sort( lepvec.begin(), lepvec.end(), SimpleLepton::lep_pt_sort );
291 >    int nmu=0, nele=0;
292 >    for( int i=0; i<lepvec.size(); i++ ) {
293 >      if(ctrl.debug) cout << "lepvec :: index: " << i
294 >                          << "\tpt: " << lepvec[i].vec->Pt()
295 >                          << "\ttype: " << lepvec[i].type
296 >                          << endl;
297 >      if( abs(lepvec[i].type) == 11 ) nele++;
298 >      else nmu++;
299      }
300 <
301 <
302 <    if( ctrl.debug ){
303 <      cout << "CIC category: " << cicCategory(ele)
266 <           << "\tlikelihood: " << ele->likelihood
267 <           << "\tFAIL:  0x"     << hex << FAIL      << dec
268 <           << "\tfailsCIC:  0x" << hex << failsCIC  << dec
269 <           << "\tfailsLike: 0x" << hex << failsLike << dec
270 <           << "\tfailsBDT:  0x" << hex << failsBDT << dec
271 <           << "\tscEt: " << ele->scEt
272 <           << "\tscEta: " << ele->scEta
273 <           << "\tncluster: " << ele->ncluster
300 >    if( ctrl.debug ) {
301 >      cout << "postsel nlep: " << lepvec.size()
302 >           << "\tnmuon: " << nmu
303 >           << "\tnelectron: " << nele
304             << endl;
305      }
306 <    if ( !FAIL && !isMuonOverlap ) {
307 <      SimpleLepton tmplep;
308 <      tmplep.vec.SetPtEtaPhiM( ele->pt,
309 <                               ele->eta,
310 <                               ele->phi,
311 <                               0.51099892e-3 );
312 <      tmplep.type    = 11;
313 <      tmplep.index   = i;
314 <      tmplep.charge  = ele->q;
315 <      tmplep.isoTrk  = ele->trkIso03;
316 <      tmplep.isoEcal = ele->emIso03;
317 <      tmplep.isoHcal = ele->hadIso03;
318 <      tmplep.isoPF03 = ele->pfIso03;
319 <      tmplep.isoPF04 = ele->pfIso04;
320 <      tmplep.ip3dSig = ele->ip3dSig;
321 <      tmplep.is4l    = false;
322 <      tmplep.isTight = isEleTight;
323 <      tmplep.isEB    = ele->isEB;
324 <      lepvec.push_back(tmplep);
325 <      if( ctrl.debug ) { cout << "\telectron passes ... " << endl; }
326 <    }
327 <  }
328 <  
329 <  sort( lepvec.begin(), lepvec.end(), SimpleLepton::lep_pt_sort );
330 <
331 <  for( int i=0; i<lepvec.size(); i++ ) {
332 <    //
333 <    //  check for a matched btagged jet
334 <    //
335 <    lepvec[i].tche = -1;
336 <    lepvec[i].tchp = -1;
337 <    lepvec[i].csv = -1;
338 <    lepvec[i].csvMva = -1;
339 <
340 <    if( jetArr != NULL ) {
341 <      for(int k=0; k<jetArr->GetEntries(); k++) {
342 <        const mithep::TJet *jet = (mithep::TJet*)((*jetArr)[k]);      
343 <        TVector3 jvec;
344 <        jvec.SetPtEtaPhi(jet->pt, jet->eta, jet->phi);
345 <        if( jvec.DrEtaPhi( lepvec[i].vec.Vect()) < 0.2 ) {
346 <          lepvec[i].tche = jet->tche;
347 <          lepvec[i].tchp = jet->tchp;
348 <          lepvec[i].csv = jet->csv;
349 <          lepvec[i].csvMva = jet->csvMva;
306 >    
307 >    
308 >    //******************************************************************************
309 >    // Z1 Selection
310 >    //******************************************************************************
311 >    int Z1LeptonPlusIndex = -1;
312 >    int Z1LeptonMinusIndex = -1;
313 >    double BestZ1Mass = -999;
314 >    if( ctrl.debug ) { cout << "looking for a Z1 ..." << endl; }
315 >    for(int i = 0; i < lepvec.size(); ++i) {
316 >      if( !(lepvec[i].isLoose) ) continue;
317 >      for(int j = i+1; j < lepvec.size(); ++j) {
318 >        if( !(lepvec[j].isLoose) ) continue;
319 >        if( ctrl.debug ) { cout << "\tconsidering leptons " << i << " & " << j << endl; }
320 >        if (!(lepvec[i].vec->Pt() > 20.0 || lepvec[j].vec->Pt() > 20.0)) continue;
321 >        if( ctrl.debug ) { cout << "\tat least one is > 20 GeV" << endl; }
322 >        if (!(lepvec[i].vec->Pt() > 10.0 && lepvec[j].vec->Pt() > 10.0)) continue;
323 >        if( ctrl.debug ) { cout << "\tthe other  is > 10 GeV" << endl; }
324 >        if (lepvec[i].charge == lepvec[j].charge) continue;          
325 >        if( ctrl.debug ) { cout << "\tthey're opposite charge" << endl; }
326 >        if (fabs(lepvec[i].type) != fabs(lepvec[j].type)) continue;  
327 >        if( ctrl.debug ) { cout << "\tthey're same flavor" << endl; }
328 >        
329 >        //Make Z1 hypothesis
330 >        TLorentzVector *leptonPlus, *leptonMinus;
331 >        if ( lepvec[i].charge > 0 ) {
332 >          leptonPlus  = lepvec[i].vec;
333 >          leptonMinus = lepvec[j].vec;
334 >        } else {
335 >          leptonPlus  = lepvec[j].vec;
336 >          leptonMinus = lepvec[i].vec;
337 >        }
338 >        
339 >        float tmpZ1Mass = (*leptonPlus + *leptonMinus).M();
340 >        if( ctrl.debug ) cout << "Z1 selection, tmpZ1Mass: " << tmpZ1Mass << endl;
341 >        if( tmpZ1Mass > 60 ) {
342 >          if (fabs(tmpZ1Mass - Z_MASS) < fabs(BestZ1Mass - Z_MASS)) {
343 >            BestZ1Mass = tmpZ1Mass;
344 >            if( ctrl.debug ) cout << "Z1 selection, new BestZ1Mass: " << BestZ1Mass
345 >                                  << "\tdM: " << fabs(BestZ1Mass - Z_MASS)
346 >                                  << endl;
347 >            if (lepvec[i].charge > 0) {
348 >              Z1LeptonPlusIndex = i;
349 >              Z1LeptonMinusIndex = j;
350 >            } else {
351 >              Z1LeptonPlusIndex = j;
352 >              Z1LeptonMinusIndex = i;
353 >            }
354 >          }
355          }
356        }
357      }
358 <  }
359 <
360 <  int nmu=0, nele=0;
361 <  for( int i=0; i<lepvec.size(); i++ ) {
362 <    if( abs(lepvec[i].type) == 11 ) nele++;
363 <    else nmu++;
364 <  }
365 <  if( ctrl.debug ) {
366 <    cout << "postsel nlep: " << lepvec.size()
367 <         << "\tnmuon: " << nmu
368 <         << "\tnelectron: " << nele
369 <         << endl;
370 <  }
371 <
372 <  //******************************************************************************
373 <  //Z1 Selection
374 <  //******************************************************************************
375 <  int Z1LeptonPlusIndex = -1;
376 <  int Z1LeptonMinusIndex = -1;
377 <  double BestZ1Mass = -999;
378 <  if( ctrl.debug ) { cout << "looking for a Z1 ..." << endl; }
379 <  for(int i = 0; i < lepvec.size(); ++i) {
380 <    for(int j = i+1; j < lepvec.size(); ++j) {
381 <      if( ctrl.debug ) { cout << "\tconsidering leptons " << i << " & " << j << endl; }
382 <      if (!(lepvec[i].vec.Pt() > 20.0 || lepvec[j].vec.Pt() > 20.0)) continue;
383 <      if( ctrl.debug ) { cout << "\tat least one is > 20 GeV" << endl; }
384 <      if (!(lepvec[i].vec.Pt() > 10.0 && lepvec[j].vec.Pt() > 10.0)) continue;
385 <      if( ctrl.debug ) { cout << "\tthe other  is > 10 GeV" << endl; }
386 <      if (lepvec[i].charge == lepvec[j].charge) continue;          
387 <      if( ctrl.debug ) { cout << "\tthey're opposite charge" << endl; }
388 <      if (fabs(lepvec[i].type) != fabs(lepvec[j].type)) continue;  
389 <      if( ctrl.debug ) { cout << "\tthey're same flavor" << endl; }
358 >    // stop if no Z1 candidate is found
359 >    if( BestZ1Mass < 0 ) {
360 >      evtfail |= (1<<EVTFAIL_Z1);
361 >      //ret.status = evtfail;
362 >      ret.status.setStatus(0);
363 >      return ret;
364 >    }
365 >    if( ctrl.debug ) cout << "\tgot a Z1 ... run: " << info->RunNum() << "\tevt: " << info->EvtNum()  << endl;
366 >    if( ctrl.debug ) cout << "\tZ1 plusindex: " << Z1LeptonPlusIndex << "\tminusindex: " << Z1LeptonMinusIndex << endl;
367 >    TLorentzVector Z1LeptonPlus  = *(lepvec[Z1LeptonPlusIndex].vec);
368 >    TLorentzVector Z1LeptonMinus = *(lepvec[Z1LeptonMinusIndex].vec);
369 >    TLorentzVector Z1Candidate   =  Z1LeptonPlus + Z1LeptonMinus;
370 >    
371 >    
372 >    //******************************************************************************
373 >    // Z1 + l
374 >    //******************************************************************************
375 >    if( lepvec.size() < 3 ) {
376 >      evtfail |= (1<<EVTFAIL_Z1_PLUSL);
377 >      //ret.status = evtfail;
378 >      ret.status.setStatus(0);
379 >      return ret;
380 >    }
381 >    
382 >    //******************************************************************************
383 >    // 4l/Z2 Selection
384 >    //******************************************************************************
385 >    Int_t Z2LeptonPlusIndex = -1;
386 >    Int_t Z2LeptonMinusIndex = -1;
387 >    Double_t BestZ2Mass = -1;
388 >    if( ctrl.debug ) cout << "looking for a Z2 ... out of " << lepvec.size() << " leptons" <<endl;
389 >    for(int i = 0; i < lepvec.size(); ++i) {
390 >      
391 >      if( ctrl.debug)  cout << "i: " << i
392 >                            << "\tpt: " << lepvec[i].vec->Pt()
393 >                            << "\ttype: " << lepvec[i].type
394 >                            << endl;
395        
396 <      //Make Z1 hypothesis
397 <      TLorentzVector leptonPlus, leptonMinus;
398 <      if ( lepvec[i].charge > 0 ) {
399 <        leptonPlus  = lepvec[i].vec;
360 <        leptonMinus = lepvec[j].vec;
361 <      } else {
362 <        leptonPlus  = lepvec[j].vec;
363 <        leptonMinus = lepvec[i].vec;
396 >      if( ctrl.eleSeleScheme == "mediumloose" &&
397 >          !(lepvec[i].isTight) ) {
398 >        if( ctrl.debug)  cout << "it's not tight, skipping ... " << endl;
399 >        continue;
400        }
401        
402 <      float tmpZ1Mass = (leptonPlus+leptonMinus).M();
403 <      if( ctrl.debug ) cout << "Z1 selection, tmpZ1Mass: " << tmpZ1Mass << endl;
404 <      if( tmpZ1Mass > 60 ) {
405 <        if (fabs(tmpZ1Mass - 91.1876) < fabs(BestZ1Mass - 91.1876)) {
406 <          BestZ1Mass = tmpZ1Mass;
407 <          if( ctrl.debug ) cout << "Z1 selection, new BestZ1Mass: " << BestZ1Mass
408 <               << "\tdM: " << fabs(BestZ1Mass - 91.1876)
409 <               << endl;
402 >      for(int j = i+1; j < lepvec.size(); ++j) {
403 >        if( ctrl.debug)  cout << "\t\tj: " << j
404 >                              << "\tpt: " << lepvec[j].vec->Pt()
405 >                              << "\ttype: " << lepvec[j].type
406 >                              << endl;
407 >        
408 >        if( ctrl.eleSeleScheme == "mediumloose" &&
409 >            !(lepvec[j].isTight) ) {
410 >          if( ctrl.debug)  cout << "it's not tight, skipping ... " << endl;
411 >          continue;
412 >        }
413 >        
414 >        
415 >        if (i == Z1LeptonPlusIndex || i == Z1LeptonMinusIndex) {
416 >          if( ctrl.debug)  cout << "\ti matches a Z1 index, skipping ..." << endl;
417 >          continue; //skip Z1 leptons
418 >        }
419 >        if (j == Z1LeptonPlusIndex || j == Z1LeptonMinusIndex) {
420 >          if( ctrl.debug)  cout << "\tj matches a Z1 index, skipping ..." << endl;
421 >          continue; //skip Z1 leptons
422 >        }
423 >        if (lepvec[i].charge == lepvec[j].charge) {
424 >          if( ctrl.debug)  cout << "\ti and j are same sign, skipping ..." << endl;
425 >          continue;         //require opp sign
426 >        }
427 >        if (fabs(lepvec[i].type) != fabs(lepvec[j].type)) {
428 >          if( ctrl.debug) cout << "\ti and j are not same flavor, skipping ..." << endl;
429 >          continue; //require same flavor
430 >        }
431 >        
432 >        
433 >        //Make Z2 hypothesis
434 >        TLorentzVector *leptonPlus, *leptonMinus;
435 >        
436 >        if (lepvec[i].charge > 0 ) {
437 >          leptonPlus  = lepvec[i].vec;
438 >          leptonMinus = lepvec[j].vec;
439 >        } else {
440 >          leptonPlus  = lepvec[j].vec;
441 >          leptonMinus = lepvec[i].vec;
442 >        }
443 >        
444 >        TLorentzVector dilepton = *leptonPlus + *leptonMinus;
445 >        TLorentzVector fourLepton = Z1Candidate + dilepton;
446 >        
447 >        if( ctrl.debug ) cout << "dilepton.M() : " << dilepton.M() << endl;
448 >        if( ctrl.debug ) cout << "fourLepton.M() : " << fourLepton.M() << endl;
449 >        
450 >        if (!(dilepton.M() > 12.0)) continue;
451 >        if (!(fourLepton.M() > 100.0)) continue;
452 >        
453 >        //for 4e and 4mu, require at least 1 of the other opp sign lepton pairs have mass > 12
454 >        if (fabs(lepvec[i].type) == fabs(lepvec[Z1LeptonPlusIndex].type)) {
455 >          TLorentzVector pair1 = Z1LeptonPlus + *leptonMinus;
456 >          TLorentzVector pair2 = Z1LeptonMinus + *leptonPlus;
457 >          if( ctrl.debug ) cout << "pair1: " << pair1.M() << "\tpair2: "<< pair2.M() << endl;
458 >          if (!(pair1.M() > 12 || pair2.M() > 12)) continue;
459 >        }
460 >      
461 >      
462 >        //Disambiguiation is done by choosing the pair with the largest ptMax and largest ptMin
463 >        if (Z2LeptonPlusIndex < 0) {
464            if (lepvec[i].charge > 0) {
465 <            Z1LeptonPlusIndex = i;
466 <            Z1LeptonMinusIndex = j;
465 >            Z2LeptonPlusIndex = i;
466 >            Z2LeptonMinusIndex = j;
467            } else {
468 <            Z1LeptonPlusIndex = j;
469 <            Z1LeptonMinusIndex = i;
468 >            Z2LeptonPlusIndex = j;
469 >            Z2LeptonMinusIndex = i;
470 >          }
471 >        } else {
472 >          Double_t BestPairPtMax = lepvec[Z2LeptonPlusIndex].vec->Pt();              
473 >          Double_t BestPairPtMin = lepvec[Z2LeptonMinusIndex].vec->Pt();
474 >          if (lepvec[Z2LeptonMinusIndex].vec->Pt() > BestPairPtMax) {
475 >            BestPairPtMax = lepvec[Z2LeptonMinusIndex].vec->Pt();
476 >            BestPairPtMin = lepvec[Z2LeptonPlusIndex].vec->Pt();
477            }
381        }
382      }
383    }
384  }
385  // stop if no Z1 candidate is found
386  if( BestZ1Mass < 0 ) {
387    evtfail |= (1<<EVTFAIL_Z1);
388    return evtfail;
389  }
390  if( ctrl.debug ) cout << "\tgot a Z1 ... run: " << info->runNum << "\tevt: " << info->evtNum  << endl;
391  if( ctrl.debug ) cout << "\tZ1 plusindex: " << Z1LeptonPlusIndex << "\tminusindex: " << Z1LeptonMinusIndex << endl;
392  TLorentzVector Z1LeptonPlus  = lepvec[Z1LeptonPlusIndex].vec;
393  TLorentzVector Z1LeptonMinus = lepvec[Z1LeptonMinusIndex].vec;
394  TLorentzVector Z1Candidate   =  Z1LeptonPlus + Z1LeptonMinus;
395  if( l != NULL ) {
396    l->vecz1 = Z1Candidate;
397    l->vecl1p = Z1LeptonPlus;
398    l->vecl1m = Z1LeptonMinus;
399  }
400  
401  //******************************************************************************
402  // Z1 + l
403  //******************************************************************************
404  if( lepvec.size() < 3 ) {
405    evtfail |= (1<<EVTFAIL_Z1_PLUSL);
406    return evtfail;
407  }
478          
479 <  //******************************************************************************
480 <  // 4l/Z2 Selection
481 <  //******************************************************************************
482 <  Int_t Z2LeptonPlusIndex = -1;
483 <  Int_t Z2LeptonMinusIndex = -1;
484 <  Double_t BestZ2Mass = -1;
485 <  if( ctrl.debug ) cout << "looking for a Z2 ... out of " << lepvec.size() << " leptons" <<endl;
486 <  for(int i = 0; i < lepvec.size(); ++i) {
487 <    if( abs(lepvec[i].type) == 11 &&
488 <        ctrl.eleSeleScheme == "mediumloose" &&
489 <        !(lepvec[i].isTight) ) continue;
420 <
421 <    for(int j = i+1; j < lepvec.size(); ++j) {
422 <      if( abs(lepvec[j].type) == 11 &&
423 <          ctrl.eleSeleScheme == "mediumloose" &&
424 <          !(lepvec[j].isTight) ) continue;
425 <
426 <      //            cout << "i: " << i << "\tj: " << j << endl;
427 <      if (i == Z1LeptonPlusIndex || i == Z1LeptonMinusIndex) {
428 <        //            cout << "\ti matches a Z1 index, skipping ..." << endl;
429 <        continue; //skip Z1 leptons
430 <      }
431 <      if (j == Z1LeptonPlusIndex || j == Z1LeptonMinusIndex) {
432 <        //            cout << "\tj matches a Z1 index, skipping ..." << endl;
433 <              continue; //skip Z1 leptons
434 <            }
435 <            if (lepvec[i].charge == lepvec[j].charge) {
436 <              //              cout << "\ti and j are same sign, skipping ..." << endl;
437 <              continue;         //require opp sign
438 <            }
439 <            if (fabs(lepvec[i].type) != fabs(lepvec[j].type)) {
440 <              //              cout << "\ti and j are not same flavor, skipping ..." << endl;
441 <              continue; //require same flavor
442 <            }
443 <            
444 <            
445 <            //Make Z2 hypothesis
446 <            TLorentzVector leptonPlus, leptonMinus;
447 <            
448 <            if (lepvec[i].charge > 0 ) {
449 <              leptonPlus  = lepvec[i].vec;
450 <              leptonMinus = lepvec[j].vec;
451 <            } else {
452 <              leptonPlus  = lepvec[j].vec;
453 <              leptonMinus = lepvec[i].vec;
454 <            }
455 <
456 <            TLorentzVector dilepton = leptonPlus+leptonMinus;
457 <            TLorentzVector fourLepton = Z1Candidate + dilepton;
458 <
459 <            if( ctrl.debug ) cout << "dilepton.M() : " << dilepton.M() << endl;
460 <            if( ctrl.debug ) cout << "fourLepton.M() : " << fourLepton.M() << endl;
461 <
462 <            if (!(dilepton.M() > 12.0)) continue;
463 <            if (!(fourLepton.M() > 100.0)) continue;
464 <
465 <            /*
466 <            //for 4e and 4mu, require at least 1 of the other opp sign lepton pairs have mass > 12
467 <            if (fabs(lepvec[i].type) == fabs(lepvec[Z1LeptonPlusIndex].type)) {
468 <              TLorentzVector pair1 = Z1LeptonPlus+leptonMinus;
469 <              TLorentzVector pair2 = Z1LeptonMinus+leptonPlus;
470 <              if( ctrl.debug ) cout << "pair1: " << pair1.M() << "\tpair2: "<< pair2.M() << endl;
471 <              if (!(pair1.M() > 12 || pair2.M() > 12)) continue;
472 <            }
473 <            */
474 <
475 <            //Disambiguiation is done by choosing the pair with the largest ptMax and largest ptMin
476 <            if (Z2LeptonPlusIndex < 0) {
477 <              if (lepvec[i].charge > 0) {
478 <                Z2LeptonPlusIndex = i;
479 <                Z2LeptonMinusIndex = j;
480 <              } else {
481 <                Z2LeptonPlusIndex = j;
482 <                Z2LeptonMinusIndex = i;
483 <              }
484 <            } else {
485 <              Double_t BestPairPtMax = lepvec[Z2LeptonPlusIndex].vec.Pt();              
486 <              Double_t BestPairPtMin = lepvec[Z2LeptonMinusIndex].vec.Pt();
487 <              if (lepvec[Z2LeptonMinusIndex].vec.Pt() > BestPairPtMax) {
488 <                BestPairPtMax = lepvec[Z2LeptonMinusIndex].vec.Pt();
489 <                BestPairPtMin = lepvec[Z2LeptonPlusIndex].vec.Pt();
490 <              }
491 <
492 <              Double_t CurrentPairPtMax = lepvec[i].vec.Pt();              
493 <              Double_t CurrentPairPtMin = lepvec[j].vec.Pt();
494 <              if (lepvec[j].vec.Pt() > CurrentPairPtMax) {
495 <                CurrentPairPtMax = lepvec[j].vec.Pt();
496 <                CurrentPairPtMin = lepvec[i].vec.Pt();
497 <              }
498 <
499 <              if (CurrentPairPtMax > BestPairPtMax) {
500 <                if (lepvec[i].charge > 0) {
501 <                  Z2LeptonPlusIndex = i;
502 <                  Z2LeptonMinusIndex = j;
503 <                } else {
504 <                  Z2LeptonPlusIndex = j;
505 <                  Z2LeptonMinusIndex = i;
506 <                }
507 <              } else if (CurrentPairPtMax  == BestPairPtMax) {
508 <                if (CurrentPairPtMin > BestPairPtMin) {
509 <                  if (lepvec[i].charge > 0) {
510 <                    Z2LeptonPlusIndex = i;
511 <                    Z2LeptonMinusIndex = j;
512 <                  } else {
513 <                    Z2LeptonPlusIndex = j;
514 <                    Z2LeptonMinusIndex = i;
515 <                  }                  
516 <                }
517 <              }
518 <            }            
519 <          }
520 <        }
521 <
522 <        // stop if no Z2 candidate is found
523 <        if (Z2LeptonPlusIndex == -1) {
524 <          evtfail |= ( 1<<EVTFAIL_4L );
525 <          return evtfail;
526 <          //      h_evtfail->Fill( evtfail );
527 <          //      cout << "evtfail: " << hex << evtfail << dec << endl;
528 <          //      continue;
529 <        }
530 <        if( ctrl.debug ) cout << "\tgot a Z2 ..." << endl;
531 <        if( ctrl.debug ) cout << "\tZ2 plusindex: " << Z2LeptonPlusIndex
532 <                              << "\tminusindex: " << Z2LeptonMinusIndex << endl;
533 <        TLorentzVector  Z2LeptonPlus  = lepvec[Z2LeptonPlusIndex].vec;
534 <        TLorentzVector  Z2LeptonMinus = lepvec[Z2LeptonMinusIndex].vec;
535 <        TLorentzVector  Z2Candidate   = Z2LeptonPlus+Z2LeptonMinus;
536 <        TLorentzVector  ZZSystem      = Z1Candidate + Z2Candidate;
537 <        if( l != NULL ) {
538 <          l->vecz2 = Z2Candidate;
539 <          l->vecl2p = Z2LeptonPlus;
540 <          l->vecl2m = Z2LeptonMinus;
541 <          l->vec4l = ZZSystem;
542 <        }
543 <        lepvec[Z1LeptonPlusIndex].is4l = true;
544 <        lepvec[Z1LeptonMinusIndex].is4l = true;
545 <        lepvec[Z2LeptonPlusIndex].is4l = true;
546 <        lepvec[Z2LeptonMinusIndex].is4l = true;
547 <
548 <        //***************************************************************
549 <        // Isolation
550 <        //***************************************************************
551 <        bool failiso=false;
552 <
553 <        if( ctrl.isoScheme == "pf" ) {
554 <
555 <          for( int i=0; i<lepvec.size(); i++ ) {
556 <
557 <            if( !(lepvec[i].is4l) ) continue;
558 <
559 <            if( abs(lepvec[i].type) == 11 ) {
560 <              float reliso = lepvec[i].isoPF04/lepvec[i].vec.Pt();
561 <              if( lepvec[i].isEB && lepvec[i].vec.Pt() > 20 && reliso > PFISO_ELE_LOOSE_EB_HIGHPT ) {
562 <                failiso = true;
563 <                break;
564 <              }
565 <              if( lepvec[i].isEB && lepvec[i].vec.Pt() < 20 && reliso > PFISO_ELE_LOOSE_EB_LOWPT ) {
566 <                failiso = true;
567 <                break;
568 <              }
569 <              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() > 20 && reliso > PFISO_ELE_LOOSE_EE_HIGHPT ) {
570 <                failiso = true;
571 <                break;
572 <              }
573 <              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() < 20 && reliso > PFISO_ELE_LOOSE_EE_LOWPT ) {
574 <                failiso = true;
575 <                break;
576 <              }
577 <            }
578 <
579 <            if( abs(lepvec[i].type) == 13 ) {
580 <
581 <              float reliso = lepvec[i].isoPF03/lepvec[i].vec.Pt();
582 <              if( lepvec[i].isEB && lepvec[i].vec.Pt() > 20 && reliso > PFISO_MU_LOOSE_EB_HIGHPT ) {  //0.13
583 <                failiso = true;
584 <                break;
585 <              }
586 <              if( lepvec[i].isEB && lepvec[i].vec.Pt() < 20 && reliso > PFISO_MU_LOOSE_EB_LOWPT ) { //0.06
587 <                failiso = true;
588 <                break;
589 <              }
590 <              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() > 20 && reliso > PFISO_MU_LOOSE_EE_HIGHPT ) { //0.09
591 <                failiso = true;
592 <                break;
593 <              }
594 <              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() < 20 && reliso > PFISO_MU_LOOSE_EE_LOWPT ) { //0.05
595 <                failiso = true;
596 <                break;
597 <              }
598 <            }
599 <          }  
600 <        } else if ( ctrl.isoScheme == "pairwise" ) {
601 <          float rho = info->rho;
602 <          for( int i=0; i<lepvec.size(); i++ ) {
603 <            if( !(lepvec[i].is4l) ) continue;
604 <            float effArea_ecal_i, effArea_hcal_i;
605 <            if( lepvec[i].isEB ) {
606 <              if( lepvec[i].type == 11 ) {
607 <                effArea_ecal_i = 0.101;
608 <                effArea_hcal_i = 0.021;
609 <              } else {
610 <                effArea_ecal_i = 0.074;
611 <                effArea_hcal_i = 0.022;
612 <              }
479 >          Double_t CurrentPairPtMax = lepvec[i].vec->Pt();              
480 >          Double_t CurrentPairPtMin = lepvec[j].vec->Pt();
481 >          if (lepvec[j].vec->Pt() > CurrentPairPtMax) {
482 >            CurrentPairPtMax = lepvec[j].vec->Pt();
483 >            CurrentPairPtMin = lepvec[i].vec->Pt();
484 >          }
485 >        
486 >          if (CurrentPairPtMax > BestPairPtMax) {
487 >            if (lepvec[i].charge > 0) {
488 >              Z2LeptonPlusIndex = i;
489 >              Z2LeptonMinusIndex = j;
490              } else {
491 <              if( lepvec[i].type == 11 ) {
492 <                effArea_ecal_i = 0.046;
616 <                effArea_hcal_i = 0.040;
617 <              } else {
618 <                effArea_ecal_i = 0.045;
619 <                effArea_hcal_i = 0.030;
620 <              }
491 >              Z2LeptonPlusIndex = j;
492 >              Z2LeptonMinusIndex = i;
493              }
494 <            float isoEcal_corr_i = lepvec[i].isoEcal - (effArea_ecal_i*rho);
495 <            float isoHcal_corr_i = lepvec[i].isoHcal - (effArea_hcal_i*rho);
496 <            for( int j=i+1; j<lepvec.size(); j++ ) {
497 <              if( !(lepvec[j].is4l) ) continue;
498 <              float effArea_ecal_j, effArea_hcal_j;
627 <              if( lepvec[j].isEB ) {
628 <                if( lepvec[j].type == 11 ) {
629 <                  effArea_ecal_j = 0.101;
630 <                  effArea_hcal_j = 0.021;
631 <                } else {
632 <                  effArea_ecal_j = 0.074;
633 <                  effArea_hcal_j = 0.022;
634 <                }
494 >          } else if (CurrentPairPtMax  == BestPairPtMax) {
495 >            if (CurrentPairPtMin > BestPairPtMin) {
496 >              if (lepvec[i].charge > 0) {
497 >                Z2LeptonPlusIndex = i;
498 >                Z2LeptonMinusIndex = j;
499                } else {
500 <                if( lepvec[j].type == 11 ) {
501 <                  effArea_ecal_j = 0.046;
502 <                  effArea_hcal_j = 0.040;
639 <                } else {
640 <                  effArea_ecal_j = 0.045;
641 <                  effArea_hcal_j = 0.030;
642 <                }
643 <              }
644 <              float isoEcal_corr_j = lepvec[j].isoEcal - (effArea_ecal_j*rho);
645 <              float isoHcal_corr_j = lepvec[j].isoHcal - (effArea_hcal_j*rho);
646 <              float RIso_i = (lepvec[i].isoTrk+isoEcal_corr_i+isoHcal_corr_i)/lepvec[i].vec.Pt();
647 <              float RIso_j = (lepvec[j].isoTrk+isoEcal_corr_j+isoHcal_corr_j)/lepvec[j].vec.Pt();          
648 <              float comboIso = RIso_i + RIso_j;
649 <              if( info->evtNum == 1038911933 ) {
650 <                float tmpdR = lepvec[i].vec.DrEtaPhi(lepvec[j].vec);
651 <                cout << "i: " << i
652 <                     << "\tdR: " << tmpdR
653 <                     << "\trho: " << rho
654 <                     << "\tRIso_i: " << RIso_i  
655 <                     << "\ttkrel: " << lepvec[i].isoTrk/lepvec[i].vec.Pt()
656 <                     << "\tecalrel: " << lepvec[i].isoEcal/lepvec[i].vec.Pt()
657 <                     << "\tecalrelcor: " << isoEcal_corr_i/lepvec[i].vec.Pt()
658 <                     << "\thcalrel: " << lepvec[i].isoHcal/lepvec[i].vec.Pt()
659 <                     << "\thcalrelcor: " << isoHcal_corr_i/lepvec[i].vec.Pt()
660 <                     << "\tpt_i: " << lepvec[i].vec.Pt()
661 <                     << "\tj: " << j
662 <                     << "\tRIso_j: " << RIso_j  
663 <                     << "\ttkrel: "  << lepvec[j].isoTrk/lepvec[j].vec.Pt()
664 <                     << "\tecalrel: " << lepvec[j].isoEcal/lepvec[j].vec.Pt()
665 <                     << "\tecalrelcor: " << isoEcal_corr_j/lepvec[j].vec.Pt()
666 <                     << "\thcalrel: " << lepvec[j].isoHcal/lepvec[j].vec.Pt()
667 <                     << "\thcalrelcor: " << isoHcal_corr_j/lepvec[j].vec.Pt()
668 <                     << "\tpt_j: " << lepvec[j].vec.Pt()
669 <                     << "\tcombo: " << comboIso
670 <                     << endl;
671 <                cout.flush();
672 <              }
673 <              if( comboIso > 0.35 ) {
674 <                if( ctrl.debug ) cout << "combo failing for indices: " << i << "," << j << endl;
675 <                failiso = true;
676 <                //            break;
677 <              }
678 <            }
679 <          }
680 <        }
681 <
682 <
683 <        if( failiso ) {
684 <          evtfail |= ( 1<<EVTFAIL_ISOLATION );
685 <          return evtfail;
686 <          //h_evtfail->Fill( evtfail, eventweight );
687 <          //      h_evtfail->Fill( evtfail );
688 <          //      cout << "evtfail: " << hex << evtfail << dec << endl;
689 <          //      continue;
690 <        }
691 <
692 <        //***************************************************************
693 <        // IP significance
694 <        //***************************************************************
695 <        bool failip = false;
696 <        for( int i=0; i<lepvec.size(); i++ ) {
697 <          if( !(lepvec[i].is4l) ) continue;
698 <          if( lepvec[i].ip3dSig > 4 ) {
699 <            failip=true;
700 <            break;
701 <          }
702 <        }
703 <        if( failip ) {
704 <          evtfail |= (1<<EVTFAIL_IP );
705 <          return evtfail;
706 <          //h_evtfail->Fill( evtfail, eventweight );
707 <          //      h_evtfail->Fill( evtfail );
708 <          //      cout << "evtfail: " << hex << evtfail << dec << endl;
709 <          //      continue;
710 <        }
711 <
712 <        //***************************************************************
713 <        // remaining kinematic cuts
714 <        //***************************************************************
715 <        double Z2massCut=0;
716 <        if      ( ctrl.kinematics == "loose" ) Z2massCut = 12;
717 <        else if ( ctrl.kinematics == "tight" ) Z2massCut = 20;
718 <        else { cout <<  "error! kinematic tightness not defined!" << endl; assert(0); }
719 <
720 <        if ( Z1Candidate.M() > 120        ||
721 <             Z2Candidate.M() < Z2massCut  ||
722 <             Z2Candidate.M() > 120        ||
723 <             !(lepvec[Z1LeptonPlusIndex].vec.Pt() > 20.0 || lepvec[Z1LeptonMinusIndex].vec.Pt() > 20.0) ||
724 <             !(lepvec[Z1LeptonPlusIndex].vec.Pt() > 10.0 && lepvec[Z1LeptonMinusIndex].vec.Pt() > 10.0)
725 <             ) {
726 <          evtfail |= (1<<EVTFAIL_KINEMATICS );
727 <          return evtfail;
728 <          //h_evtfail->Fill( evtfail, eventweight );
729 <          //      h_evtfail->Fill( evtfail );
730 <          //      cout << "evtfail: " << hex << evtfail << dec << endl;
731 <          //      continue;
732 <        }
733 <        
734 <        unsigned channel;
735 <        if( lepvec[Z1LeptonMinusIndex].type == 11 && lepvec[Z2LeptonMinusIndex].type == 11 ) channel=0;
736 <        if( lepvec[Z1LeptonMinusIndex].type == 13 && lepvec[Z2LeptonMinusIndex].type == 13 ) channel=1;
737 <        if( (lepvec[Z1LeptonMinusIndex].type == 11 && lepvec[Z2LeptonMinusIndex].type == 13) ||
738 <            (lepvec[Z1LeptonMinusIndex].type == 13 && lepvec[Z2LeptonMinusIndex].type == 11)) channel=2;
739 <        
740 <
741 <        double w_offline=-1, werr_offline=0;
742 <        double w_online=-1, werr_online=0;
743 <
744 <        if( ctrl.mc ) {
745 <
746 <          vector< pair <double,double> > wlegs; // pair here is eff & err
747 <          vector< pair <float,float> > mvec;  // pair here is eta & pt
748 <          vector< pair <float,float> > evec;  // pair here is eta & pt
749 <
750 <          for( int k=0; k<lepvec.size(); k++ ) {
751 <            if( !(lepvec[k].is4l) ) continue;
752 <            if( abs(lepvec[k].type) == 13 ) {
753 <              mvec.push_back( std::pair<float,float> (fabs(lepvec[k].vec.Eta()), lepvec[k].vec.Pt()) );
754 <              wlegs.push_back( muonPerLegOfflineEfficiencyWeight( fabs(lepvec[k].vec.Eta()),
755 <                                                                  lepvec[k].vec.Pt() ) );
756 <            } else {
757 <              evec.push_back( std::pair<float,float> (fabs(lepvec[k].vec.Eta()), lepvec[k].vec.Pt()) );
758 <              wlegs.push_back( elePerLegOfflineEfficiencyWeight(  fabs(lepvec[k].vec.Eta()),
759 <                                                                 lepvec[k].vec.Pt() ) );
760 <                      //              wlegs.push_back( pair<double,double> (1.,0.) );
500 >                Z2LeptonPlusIndex = j;
501 >                Z2LeptonMinusIndex = i;
502 >              }                  
503              }
504            }
505 +        }            
506 +      }
507 +    }
508 +  
509 +    // stop if no Z2 candidate is found
510 +    if (Z2LeptonPlusIndex == -1) {
511 +      evtfail |= ( 1<<EVTFAIL_4L );
512 +      //      ret.status = evtfail;
513 +      ret.status.setStatus(0);
514 +      return ret;
515 +    }
516 +    if( ctrl.debug ) cout << "\tgot a Z2 ..." << endl;
517 +    if( ctrl.debug ) cout << "\tZ2 plusindex: " << Z2LeptonPlusIndex
518 +                          << "\tminusindex: " << Z2LeptonMinusIndex << endl;
519 +    TLorentzVector  Z2LeptonPlus  = *(lepvec[Z2LeptonPlusIndex].vec);
520 +    TLorentzVector  Z2LeptonMinus = *(lepvec[Z2LeptonMinusIndex].vec);
521 +    TLorentzVector  Z2Candidate   = Z2LeptonPlus+Z2LeptonMinus;
522 +    TLorentzVector  ZZSystem      = Z1Candidate + Z2Candidate;
523 +    lepvec[Z1LeptonPlusIndex].is4l = true;
524 +    lepvec[Z1LeptonMinusIndex].is4l = true;
525 +    lepvec[Z2LeptonPlusIndex].is4l = true;
526 +    lepvec[Z2LeptonMinusIndex].is4l = true;
527 +  
528  
764          pair<double,double> offpair = getOfflineEfficiencyWeight( wlegs );
765          w_offline    = offpair.first;
766          werr_offline = offpair.second;
767
768          pair<double,double> onpair  = getOnlineEfficiencyWeight( mvec, evec );
769          w_online    = onpair.first;
770          werr_online = onpair.second;
771        } // if mc
772
773
774        if( l != NULL ) {
775          l->vec4l  = ZZSystem;
776          l->vecz1  = Z1Candidate;
777          l->vecz2  = Z2Candidate;
778          l->vecl1p = lepvec[Z1LeptonPlusIndex].vec;
779          l->vecl1m = lepvec[Z1LeptonMinusIndex].vec;
780          l->vecl2p = lepvec[Z2LeptonPlusIndex].vec;
781          l->vecl2m = lepvec[Z2LeptonMinusIndex].vec;
782        }
783        if( passtuple != NULL ) {
784          unsigned run   = info->runNum;
785          unsigned evt   = info->evtNum;
786          unsigned lumi  = info->lumiSec;
787          unsigned chan  = channel;
788          double   w     = eventweight;
789          float mZ1      = Z1Candidate.M() ;
790          float mZ2      = Z2Candidate.M() ;
791          float m4l      = ZZSystem.M() ;
792          float pt4l     = ZZSystem.Pt() ;
793          unsigned tZ1   = abs(lepvec[Z1LeptonMinusIndex].type);
794          unsigned tZ2   = abs(lepvec[Z2LeptonMinusIndex].type);
795          float l3tche   = lepvec[Z2LeptonMinusIndex].tche;
796          float l4tche   = lepvec[Z2LeptonPlusIndex].tche;
797          float l3tchp   = lepvec[Z2LeptonMinusIndex].tchp;
798          float l4tchp   = lepvec[Z2LeptonPlusIndex].tchp;
799          float l3csv    = lepvec[Z2LeptonMinusIndex].csv;
800          float l4csv    = lepvec[Z2LeptonPlusIndex].csv;
801          float l3csvMva = lepvec[Z2LeptonMinusIndex].csvMva;
802          float l4csvMva = lepvec[Z2LeptonPlusIndex].csvMva;
803
804
805          passtuple->SetBranchAddress("channel",  &channel);
806          passtuple->SetBranchAddress("run",  &run);
807          passtuple->SetBranchAddress("evt",  &evt);
808          passtuple->SetBranchAddress("lumi", &lumi);
809          passtuple->SetBranchAddress("mZ1",  &mZ1);
810          passtuple->SetBranchAddress("mZ2",  &mZ2);
811          passtuple->SetBranchAddress("tZ1",  &tZ1);
812          passtuple->SetBranchAddress("tZ2",  &tZ2);
813          passtuple->SetBranchAddress("m4l",  &m4l);
814          passtuple->SetBranchAddress("pt4l", &pt4l);
815          passtuple->SetBranchAddress("w",    &w);
816          if( ctrl.mc ) {
817            passtuple->SetBranchAddress("woff", &w_offline );
818            passtuple->SetBranchAddress("werroff", &werr_offline );
819            passtuple->SetBranchAddress("won", &w_online );
820            passtuple->SetBranchAddress("werron", &werr_online );
821          }
822          if( ctrl.btag ) {
823          passtuple->SetBranchAddress("l3tche",    &l3tche);
824          passtuple->SetBranchAddress("l4tche",    &l4tche);
825          passtuple->SetBranchAddress("l3tchp",    &l3tchp);
826          passtuple->SetBranchAddress("l4tchp",    &l4tchp);
827          passtuple->SetBranchAddress("l3csv",     &l3csv);
828          passtuple->SetBranchAddress("l4csv",     &l4csv);
829          passtuple->SetBranchAddress("l3csvMva",  &l3csvMva);
830          passtuple->SetBranchAddress("l4csvMva",  &l4csvMva);
831          }
529  
530 <          if( ctrl.mc )           passtuple->SetBranchAddress("gchannel",  &gchannel);
531 <          passtuple->Fill( );
530 >  
531 >    //***************************************************************
532 >    // remaining kinematic cuts
533 >    //***************************************************************
534 >    double Z2massCut=0;
535 >    if      ( ctrl.kinematics == "loose" ) Z2massCut = 12;
536 >    else if ( ctrl.kinematics == "tight" ) Z2massCut = 20;
537 >    else { cout <<  "error! kinematic tightness not defined!" << endl; assert(0); }
538 >  
539 >    if ( Z1Candidate.M() > 120        ||
540 >         Z2Candidate.M() < Z2massCut  ||
541 >         Z2Candidate.M() > 120        ||
542 >         !(lepvec[Z1LeptonPlusIndex].vec->Pt() > 20.0 || lepvec[Z1LeptonMinusIndex].vec->Pt() > 20.0) ||
543 >         !(lepvec[Z1LeptonPlusIndex].vec->Pt() > 10.0 && lepvec[Z1LeptonMinusIndex].vec->Pt() > 10.0)
544 >         ) {
545 >      evtfail |= (1<<EVTFAIL_KINEMATICS );
546 >      //      ret.status = evtfail;
547 >      ret.status.setStatus(0);
548 >      return ret;
549 >    }
550 >  
551 >    unsigned channel;
552 >    if( lepvec[Z1LeptonMinusIndex].type == 11 && lepvec[Z2LeptonMinusIndex].type == 11 ) channel=0;
553 >    if( lepvec[Z1LeptonMinusIndex].type == 13 && lepvec[Z2LeptonMinusIndex].type == 13 ) channel=1;
554 >    if( (lepvec[Z1LeptonMinusIndex].type == 11 && lepvec[Z2LeptonMinusIndex].type == 13) ||
555 >        (lepvec[Z1LeptonMinusIndex].type == 13 && lepvec[Z2LeptonMinusIndex].type == 11)) channel=2;
556 >  
557 >  
558 >  
559 >  
560 >    if( ctrl.debug ) cout  << "run: " << info->RunNum()  
561 >                           << "\tevt: " << info->EvtNum()
562 >                           << "\tZ1channel: " << lepvec[Z1LeptonMinusIndex].type
563 >                           << "\tZ2channel: " << lepvec[Z2LeptonMinusIndex].type
564 >                           << "\tmZ1: " << Z1Candidate.M()
565 >                           << "\tmZ2: " << Z2Candidate.M()
566 >                           << "\tm4l: " << ZZSystem.M()
567 >                           << "\tevtfail: " << hex << evtfail << dec
568 >      //                           << "\ttrigbits: " << hex << info->triggerBits << dec
569 >      //              << "\ttree: " << inputFiles[q][f]
570 >                           << endl;
571 >  
572  
836        }
573  
574 <        if( ctrl.debug ) cout  << "run: " << info->runNum  
575 <              << "\tevt: " << info->evtNum
576 <              << "\tZ1channel: " << lepvec[Z1LeptonMinusIndex].type
577 <              << "\tZ2channel: " << lepvec[Z2LeptonMinusIndex].type
578 <              << "\tmZ1: " << Z1Candidate.M()
579 <              << "\tmZ2: " << Z2Candidate.M()
580 <              << "\tm4l: " << ZZSystem.M()
581 <              << "\tevtfail: " << hex << evtfail << dec
582 <              << "\ttrigbits: " << hex << info->triggerBits << dec
583 <          //          << "\ttree: " << inputFiles[q][f]
584 <              << endl;
574 >    //***************************************************************
575 >    // finish
576 >    //***************************************************************
577 >
578 >    if( !evtfail ) {
579 >      ret.status.setStatus(SelectionStatus::EVTPASS);
580 >      ret.Z1leptons.push_back(lepvec[Z1LeptonMinusIndex]);
581 >      ret.Z1leptons.push_back(lepvec[Z1LeptonPlusIndex]);
582 >      ret.Z2leptons.push_back(lepvec[Z2LeptonMinusIndex]);
583 >      ret.Z2leptons.push_back(lepvec[Z2LeptonPlusIndex]);
584 >    }
585  
586 <        return evtfail;
851 <          
586 >    return ret;
587   }
588  
589  
855
856
857

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines