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.9 by khahn, Fri Oct 14 11:38:10 2011 UTC vs.
Revision 1.13 by khahn, Sun Oct 30 15:12:30 2011 UTC

# Line 7 | Line 7
7   #include "HZZLikelihoodElectronSelection.h"
8   #include "HZZBDTElectronSelection.h"
9   #include "RunLumiRangeMap.h"
10 + #include "EfficiencyWeightsInterface.h"
11  
12   RunLumiRangeMap rlrm;
13  
14 + // #include "TH2D.h"
15 + // 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"));
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::TEventInfo *info,     // input event inof
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 );
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 inof
86 >                               mithep::TEventInfo *info,     // input event info
87                                 TClonesArray *electronArr,    // input electrons
88                                 TClonesArray *muonArr,        // input muons
89                                 double eventweight,           // weight
90 <                               LabVectors  *l ) {
91 <
92 <  fails_HZZ4L_selection( ctrl, info, electronArr, muonArr, eventweight, NULL, l );
93 <
40 < };
90 >                               TTree * passtuple,
91 >                               LabVectors * l ) {
92 >  fails_HZZ4L_selection( ctrl, info, electronArr, muonArr, eventweight, passtuple, l, NULL );
93 > }
94  
95  
96   unsigned fails_HZZ4L_selection(ControlFlags &ctrl,           // input control
97 <                               mithep::TEventInfo *info,     // input event inof
97 >                               mithep::TEventInfo *info,     // input event info
98                                 TClonesArray *electronArr,    // input electrons
99                                 TClonesArray *muonArr,        // input muons
100                                 double eventweight,           // weight
101                                 TTree * passtuple,
102 <                               LabVectors * l) {       // output ntuple
102 >                               LabVectors * l=NULL,
103 >                               TClonesArray *jetArr=NULL ) {       // output ntuple
104  
105    unsigned evtfail = 0x0;
106 +  unsigned gchannel=0xdeaddead;
107 +
108 + //   if( ctrl.mc && ginfo != NULL ) {
109 + //     gchannel = getGenChannel(ginfo);
110 + //   }
111  
112  
113    if( ctrl.debug ) {
# Line 77 | Line 136 | unsigned fails_HZZ4L_selection(ControlFl
136    //********************************************************
137    if( !ctrl.mc ) {
138      //  if( !(passHLT(info->triggerBits, info->runNum, channel) )  ) {
139 <    if( !(passHLT(info->triggerBits, info->runNum, 999) )  ) {
140 <      evtfail |= (1<<EVTFAIL_TRIGGER);
141 <      return evtfail;
142 <    }  
139 > //     if( !(passHLT(info->triggerBits, info->runNum, 999) )  ) {
140 > //       evtfail |= (1<<EVTFAIL_TRIGGER);
141 > //       return evtfail;
142 > //     }        
143    } else {
144      if( !(passHLTMC(info->triggerBits)) ) {
145        evtfail |= (1<<EVTFAIL_TRIGGER);
# Line 106 | Line 165 | unsigned fails_HZZ4L_selection(ControlFl
165    //----------------------------------------------------
166    for(Int_t i=0; i<muonArr->GetEntries(); i++) {
167      const mithep::TMuon *mu = (mithep::TMuon*)((*muonArr)[i]);      
168 <    unsigned muonfail = passMuonSelectionZZ(mu);
168 >    unsigned muonfail;
169 >    if( ctrl.muSele == "ksWW" )
170 >      muonfail = passMuonSelection(mu);
171 >    else
172 >      muonfail = passMuonSelectionZZ(mu);
173      if( ctrl.debug ) {
174        cout << "muon:: pt: " << mu->pt
175             << "\teta: " << mu->eta
# Line 125 | Line 188 | unsigned fails_HZZ4L_selection(ControlFl
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;
# Line 140 | Line 204 | unsigned fails_HZZ4L_selection(ControlFl
204    for(Int_t i=0; i<electronArr->GetEntries(); i++) {
205      const mithep::TElectron *ele = (mithep::TElectron*)((*electronArr)[i]);
206  
207 +    if( !(isEleFO(ctrl,ele) ) ) continue;
208 +    if( ele->pt < 7 ) continue; //move this to ID
209 +
210      Bool_t isMuonOverlap = kFALSE;
211      for (int k=0; k<lepvec.size(); ++k) {
212        TVector3 tmplep;
# Line 151 | Line 218 | unsigned fails_HZZ4L_selection(ControlFl
218        }
219      }
220  
221 <    unsigned FAIL=0;
222 <    CICStruct ciccuts = getCiCCuts(ctrl.eleSeleScheme);
221 >    unsigned FAIL=0, isEleTight=0;
222 >
223      unsigned  failsCIC=0;
224 +    CICStruct ciccuts_tight, ciccuts_medium, ciccuts_loose;
225      if(ctrl.eleSele=="cic") {
226 <      failsCIC = failsCicSelection(ctrl, ele, ciccuts, ctrl.kinematics);
226 >      if( ctrl.eleSeleScheme == "mediumloose" ) {
227 >        ciccuts_medium = getCiCCuts("medium");
228 >        unsigned failsCICMedium = failsCicSelection(ctrl, ele, ciccuts_medium, ctrl.kinematics);
229 >        ciccuts_loose = getCiCCuts("loose");
230 >        unsigned failsCICLoose = failsCicSelection(ctrl, ele, ciccuts_loose, ctrl.kinematics);
231 >        failsCIC = ( failsCICLoose > 0 && failsCICMedium > 0 );
232 >        if( !failsCICMedium ) isEleTight=1;
233 >      }
234 >      else {
235 >        ciccuts_tight = getCiCCuts(ctrl.eleSeleScheme);
236 >        failsCIC = failsCicSelection(ctrl, ele, ciccuts_tight, ctrl.kinematics);
237 >        if( !failsCIC ) isEleTight=1;
238 >      }
239        FAIL = failsCIC;
240      }
241 +
242      LikStruct likcuts;
243      unsigned failsLike=0;
244      if(ctrl.eleSele=="lik") {
# Line 165 | Line 246 | unsigned fails_HZZ4L_selection(ControlFl
246        failsLike = failsLikelihoodSelection(ele, likcuts, ctrl.kinematics);
247        FAIL = failsLike;
248      }
249 <    unsigned  failsBDT=0;
249 >    unsigned failsBDT=0;
250      if(ctrl.eleSele=="bdt") {
251 <      failsBDT = failsBDTSelection(ctrl,ele);
251 >      if( ctrl.eleSeleScheme == "mediumloose" ) {
252 >        unsigned failsBDTMedium = failsBDTSelection(ctrl,"medium",ele);
253 >        unsigned failsBDTLoose  = failsBDTSelection(ctrl,"loose",ele);
254 >        failsBDT = ( failsBDTLoose > 0 && failsBDTMedium > 0 );
255 >        if( !failsBDTMedium ) isEleTight=1;
256 >      } else {
257 >        failsBDT = failsBDTSelection(ctrl,"tight",ele);
258 >        if( !failsBDT ) isEleTight=1;
259 >      }
260        FAIL = failsBDT;
261      }
173    unsigned  failsSi=0;
174    if(ctrl.eleSele=="si") {
175      failsSi = failsSiMVAElectronSelection(ctrl, ele, 0.95, ctrl.kinematics);
176      FAIL = failsSi;
177    }
178
179
262  
263  
264      if( ctrl.debug ){
# Line 203 | Line 285 | unsigned fails_HZZ4L_selection(ControlFl
285        tmplep.isoTrk  = ele->trkIso03;
286        tmplep.isoEcal = ele->emIso03;
287        tmplep.isoHcal = ele->hadIso03;
288 +      tmplep.isoPF03 = ele->pfIso03;
289        tmplep.isoPF04 = ele->pfIso04;
290        tmplep.ip3dSig = ele->ip3dSig;
291        tmplep.is4l    = false;
292 +      tmplep.isTight = isEleTight;
293        tmplep.isEB    = ele->isEB;
294        lepvec.push_back(tmplep);
295        if( ctrl.debug ) { cout << "\telectron passes ... " << endl; }
# Line 214 | Line 298 | unsigned fails_HZZ4L_selection(ControlFl
298    
299    sort( lepvec.begin(), lepvec.end(), SimpleLepton::lep_pt_sort );
300  
301 +  for( int i=0; i<lepvec.size(); i++ ) {
302 +    //
303 +    //  check for a matched btagged jet
304 +    //
305 +    lepvec[i].tche = -1;
306 +    lepvec[i].tchp = -1;
307 +    lepvec[i].csv = -1;
308 +    lepvec[i].csvMva = -1;
309 +
310 +    if( jetArr != NULL ) {
311 +      for(int k=0; k<jetArr->GetEntries(); k++) {
312 +        const mithep::TJet *jet = (mithep::TJet*)((*jetArr)[k]);      
313 +        TVector3 jvec;
314 +        jvec.SetPtEtaPhi(jet->pt, jet->eta, jet->phi);
315 +        if( jvec.DrEtaPhi( lepvec[i].vec.Vect()) < 0.2 ) {
316 +          lepvec[i].tche = jet->tche;
317 +          lepvec[i].tchp = jet->tchp;
318 +          lepvec[i].csv = jet->csv;
319 +          lepvec[i].csvMva = jet->csvMva;
320 +        }
321 +      }
322 +    }
323 +  }
324 +
325    int nmu=0, nele=0;
326    for( int i=0; i<lepvec.size(); i++ ) {
327      if( abs(lepvec[i].type) == 11 ) nele++;
# Line 306 | Line 414 | unsigned fails_HZZ4L_selection(ControlFl
414    Double_t BestZ2Mass = -1;
415    if( ctrl.debug ) cout << "looking for a Z2 ... out of " << lepvec.size() << " leptons" <<endl;
416    for(int i = 0; i < lepvec.size(); ++i) {
417 +    if( abs(lepvec[i].type) == 11 &&
418 +        ctrl.eleSeleScheme == "mediumloose" &&
419 +        !(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;
# Line 346 | Line 462 | unsigned fails_HZZ4L_selection(ControlFl
462              if (!(dilepton.M() > 12.0)) continue;
463              if (!(fourLepton.M() > 100.0)) continue;
464  
465 <            
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;
# Line 354 | Line 470 | unsigned fails_HZZ4L_selection(ControlFl
470                if( ctrl.debug ) cout << "pair1: " << pair1.M() << "\tpair2: "<< pair2.M() << endl;
471                if (!(pair1.M() > 12 || pair2.M() > 12)) continue;
472              }
473 <            
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) {
# Line 433 | Line 550 | unsigned fails_HZZ4L_selection(ControlFl
550          //***************************************************************
551          bool failiso=false;
552  
553 <        if( ctrl.isoScheme = "pf" ) {
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 <              if( (lepvec[i].isEB && lepvec[i].isoPF04 >0.13) ||
561 <                  (!(lepvec[i].isEB) && lepvec[i].isoPF04 >0.09) ) {
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 <              if( lepvec[i].isEB && lepvec[i].vec.Pt() > 20 && lepvec[i].isoPF04 > 0.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 && lepvec[i].isoPF04 > 0.06 ) {
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 && lepvec[i].isoPF04 > 0.09 ) {
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 && lepvec[i].isoPF04 > 0.05 ) {
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 {
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;
# Line 597 | Line 731 | unsigned fails_HZZ4L_selection(ControlFl
731            //      continue;
732          }
733          
734 <        int channel;
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.) );
761 +            }
762 +          }
763  
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;
# Line 615 | Line 790 | unsigned fails_HZZ4L_selection(ControlFl
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 +          }
832 +
833 +          if( ctrl.mc )           passtuple->SetBranchAddress("gchannel",  &gchannel);
834            passtuple->Fill( );
835 +
836          }
837  
838          if( ctrl.debug ) cout  << "run: " << info->runNum  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines