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.14 by khahn, Tue Nov 1 19:15:53 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 115 | Line 178 | unsigned fails_HZZ4L_selection(ControlFl
178      }
179      if ( !muonfail ) {
180        SimpleLepton tmplep;
181 <      tmplep.vec.SetPtEtaPhiM(mu->pt,
181 >
182 >      float pt = mu->pt;
183 >      if( ctrl.do_escale_up   ) pt*=(1.01);
184 >      if( ctrl.do_escale_down ) pt*=(0.99);
185 >
186 >      tmplep.vec.SetPtEtaPhiM(pt,
187                                mu->eta,
188                                mu->phi,
189                                105.658369e-3);
190 +
191        tmplep.type    = 13;
192        tmplep.index   = i;
193        tmplep.charge  = mu->q;
194        tmplep.isoTrk  = mu->trkIso03;
195        tmplep.isoEcal = mu->emIso03;
196        tmplep.isoHcal = mu->hadIso03;
197 +      tmplep.isoPF03 = mu->pfIso03;
198        tmplep.isoPF04 = mu->pfIso04;
199        tmplep.ip3dSig = mu->ip3dSig;
200        tmplep.is4l    = false;
# Line 140 | Line 210 | unsigned fails_HZZ4L_selection(ControlFl
210    for(Int_t i=0; i<electronArr->GetEntries(); i++) {
211      const mithep::TElectron *ele = (mithep::TElectron*)((*electronArr)[i]);
212  
213 +    if( !(isEleFO(ctrl,ele) ) ) continue;
214 +    if( ele->pt < 7 ) continue; //move this to ID
215 +
216      Bool_t isMuonOverlap = kFALSE;
217      for (int k=0; k<lepvec.size(); ++k) {
218        TVector3 tmplep;
# Line 151 | Line 224 | unsigned fails_HZZ4L_selection(ControlFl
224        }
225      }
226  
227 <    unsigned FAIL=0;
228 <    CICStruct ciccuts = getCiCCuts(ctrl.eleSeleScheme);
227 >    unsigned FAIL=0, isEleTight=0;
228 >
229      unsigned  failsCIC=0;
230 +    CICStruct ciccuts_tight, ciccuts_medium, ciccuts_loose;
231      if(ctrl.eleSele=="cic") {
232 <      failsCIC = failsCicSelection(ctrl, ele, ciccuts, ctrl.kinematics);
232 >      if( ctrl.eleSeleScheme == "mediumloose" ) {
233 >        ciccuts_medium = getCiCCuts("medium");
234 >        unsigned failsCICMedium = failsCicSelection(ctrl, ele, ciccuts_medium, ctrl.kinematics);
235 >        ciccuts_loose = getCiCCuts("loose");
236 >        unsigned failsCICLoose = failsCicSelection(ctrl, ele, ciccuts_loose, ctrl.kinematics);
237 >        failsCIC = ( failsCICLoose > 0 && failsCICMedium > 0 );
238 >        if( !failsCICMedium ) isEleTight=1;
239 >      }
240 >      else {
241 >        ciccuts_tight = getCiCCuts(ctrl.eleSeleScheme);
242 >        failsCIC = failsCicSelection(ctrl, ele, ciccuts_tight, ctrl.kinematics);
243 >        if( !failsCIC ) isEleTight=1;
244 >      }
245        FAIL = failsCIC;
246      }
247 +
248      LikStruct likcuts;
249      unsigned failsLike=0;
250      if(ctrl.eleSele=="lik") {
# Line 165 | Line 252 | unsigned fails_HZZ4L_selection(ControlFl
252        failsLike = failsLikelihoodSelection(ele, likcuts, ctrl.kinematics);
253        FAIL = failsLike;
254      }
255 <    unsigned  failsBDT=0;
255 >    unsigned failsBDT=0;
256      if(ctrl.eleSele=="bdt") {
257 <      failsBDT = failsBDTSelection(ctrl,ele);
257 >      if( ctrl.eleSeleScheme == "mediumloose" ) {
258 >        unsigned failsBDTMedium = failsBDTSelection(ctrl,"medium",ele);
259 >        unsigned failsBDTLoose  = failsBDTSelection(ctrl,"loose",ele);
260 >        failsBDT = ( failsBDTLoose > 0 && failsBDTMedium > 0 );
261 >        if( !failsBDTMedium ) isEleTight=1;
262 >      } else {
263 >        failsBDT = failsBDTSelection(ctrl,"tight",ele);
264 >        if( !failsBDT ) isEleTight=1;
265 >      }
266        FAIL = failsBDT;
267      }
173    unsigned  failsSi=0;
174    if(ctrl.eleSele=="si") {
175      failsSi = failsSiMVAElectronSelection(ctrl, ele, 0.95, ctrl.kinematics);
176      FAIL = failsSi;
177    }
178
179
268  
269  
270      if( ctrl.debug ){
# Line 193 | Line 281 | unsigned fails_HZZ4L_selection(ControlFl
281      }
282      if ( !FAIL && !isMuonOverlap ) {
283        SimpleLepton tmplep;
284 <      tmplep.vec.SetPtEtaPhiM( ele->pt,
284 >
285 >      float pt = ele->pt;
286 >      if( ctrl.do_escale_up   ) pt*=(1.02);
287 >      if( ctrl.do_escale_down ) pt*=(0.98);
288 >
289 >      tmplep.vec.SetPtEtaPhiM( pt,
290                                 ele->eta,
291                                 ele->phi,
292                                 0.51099892e-3 );
# Line 203 | Line 296 | unsigned fails_HZZ4L_selection(ControlFl
296        tmplep.isoTrk  = ele->trkIso03;
297        tmplep.isoEcal = ele->emIso03;
298        tmplep.isoHcal = ele->hadIso03;
299 +      tmplep.isoPF03 = ele->pfIso03;
300        tmplep.isoPF04 = ele->pfIso04;
301        tmplep.ip3dSig = ele->ip3dSig;
302        tmplep.is4l    = false;
303 +      tmplep.isTight = isEleTight;
304        tmplep.isEB    = ele->isEB;
305        lepvec.push_back(tmplep);
306        if( ctrl.debug ) { cout << "\telectron passes ... " << endl; }
# Line 214 | Line 309 | unsigned fails_HZZ4L_selection(ControlFl
309    
310    sort( lepvec.begin(), lepvec.end(), SimpleLepton::lep_pt_sort );
311  
312 +  for( int i=0; i<lepvec.size(); i++ ) {
313 +    //
314 +    //  check for a matched btagged jet
315 +    //
316 +    lepvec[i].tche = -1;
317 +    lepvec[i].tchp = -1;
318 +    lepvec[i].csv = -1;
319 +    lepvec[i].csvMva = -1;
320 +
321 +    if( jetArr != NULL ) {
322 +      for(int k=0; k<jetArr->GetEntries(); k++) {
323 +        const mithep::TJet *jet = (mithep::TJet*)((*jetArr)[k]);      
324 +        TVector3 jvec;
325 +        jvec.SetPtEtaPhi(jet->pt, jet->eta, jet->phi);
326 +        if( jvec.DrEtaPhi( lepvec[i].vec.Vect()) < 0.2 ) {
327 +          lepvec[i].tche = jet->tche;
328 +          lepvec[i].tchp = jet->tchp;
329 +          lepvec[i].csv = jet->csv;
330 +          lepvec[i].csvMva = jet->csvMva;
331 +        }
332 +      }
333 +    }
334 +  }
335 +
336    int nmu=0, nele=0;
337    for( int i=0; i<lepvec.size(); i++ ) {
338      if( abs(lepvec[i].type) == 11 ) nele++;
# Line 306 | Line 425 | unsigned fails_HZZ4L_selection(ControlFl
425    Double_t BestZ2Mass = -1;
426    if( ctrl.debug ) cout << "looking for a Z2 ... out of " << lepvec.size() << " leptons" <<endl;
427    for(int i = 0; i < lepvec.size(); ++i) {
428 +    if( abs(lepvec[i].type) == 11 &&
429 +        ctrl.eleSeleScheme == "mediumloose" &&
430 +        !(lepvec[i].isTight) ) continue;
431 +
432      for(int j = i+1; j < lepvec.size(); ++j) {
433 +      if( abs(lepvec[j].type) == 11 &&
434 +          ctrl.eleSeleScheme == "mediumloose" &&
435 +          !(lepvec[j].isTight) ) continue;
436 +
437        //            cout << "i: " << i << "\tj: " << j << endl;
438        if (i == Z1LeptonPlusIndex || i == Z1LeptonMinusIndex) {
439          //            cout << "\ti matches a Z1 index, skipping ..." << endl;
# Line 346 | Line 473 | unsigned fails_HZZ4L_selection(ControlFl
473              if (!(dilepton.M() > 12.0)) continue;
474              if (!(fourLepton.M() > 100.0)) continue;
475  
476 <            
476 >            /*
477              //for 4e and 4mu, require at least 1 of the other opp sign lepton pairs have mass > 12
478              if (fabs(lepvec[i].type) == fabs(lepvec[Z1LeptonPlusIndex].type)) {
479                TLorentzVector pair1 = Z1LeptonPlus+leptonMinus;
# Line 354 | Line 481 | unsigned fails_HZZ4L_selection(ControlFl
481                if( ctrl.debug ) cout << "pair1: " << pair1.M() << "\tpair2: "<< pair2.M() << endl;
482                if (!(pair1.M() > 12 || pair2.M() > 12)) continue;
483              }
484 <            
484 >            */
485 >
486              //Disambiguiation is done by choosing the pair with the largest ptMax and largest ptMin
487              if (Z2LeptonPlusIndex < 0) {
488                if (lepvec[i].charge > 0) {
# Line 433 | Line 561 | unsigned fails_HZZ4L_selection(ControlFl
561          //***************************************************************
562          bool failiso=false;
563  
564 <        if( ctrl.isoScheme = "pf" ) {
564 >        if( ctrl.isoScheme == "pf" ) {
565  
566            for( int i=0; i<lepvec.size(); i++ ) {
567 +
568              if( !(lepvec[i].is4l) ) continue;
569 +
570              if( abs(lepvec[i].type) == 11 ) {
571 <              if( (lepvec[i].isEB && lepvec[i].isoPF04 >0.13) ||
572 <                  (!(lepvec[i].isEB) && lepvec[i].isoPF04 >0.09) ) {
571 >              float reliso = lepvec[i].isoPF04/lepvec[i].vec.Pt();
572 >              if( lepvec[i].isEB && lepvec[i].vec.Pt() > 20 && reliso > PFISO_ELE_LOOSE_EB_HIGHPT ) {
573 >                failiso = true;
574 >                break;
575 >              }
576 >              if( lepvec[i].isEB && lepvec[i].vec.Pt() < 20 && reliso > PFISO_ELE_LOOSE_EB_LOWPT ) {
577 >                failiso = true;
578 >                break;
579 >              }
580 >              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() > 20 && reliso > PFISO_ELE_LOOSE_EE_HIGHPT ) {
581 >                failiso = true;
582 >                break;
583 >              }
584 >              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() < 20 && reliso > PFISO_ELE_LOOSE_EE_LOWPT ) {
585                  failiso = true;
586                  break;
587                }
588              }
589 +
590              if( abs(lepvec[i].type) == 13 ) {
591 <              if( lepvec[i].isEB && lepvec[i].vec.Pt() > 20 && lepvec[i].isoPF04 > 0.13 ) {
591 >
592 >              /*
593 >              float reliso = lepvec[i].isoPF03/lepvec[i].vec.Pt();
594 >              if( lepvec[i].isEB && lepvec[i].vec.Pt() > 20 && reliso > PFISO_MU_LOOSE_EB_HIGHPT ) {  //0.13
595                  failiso = true;
596                  break;
597                }
598 <              if( lepvec[i].isEB && lepvec[i].vec.Pt() < 20 && lepvec[i].isoPF04 > 0.06 ) {
598 >              if( lepvec[i].isEB && lepvec[i].vec.Pt() < 20 && reliso > PFISO_MU_LOOSE_EB_LOWPT ) { //0.06
599                  failiso = true;
600                  break;
601                }
602 <              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() > 20 && lepvec[i].isoPF04 > 0.09 ) {
602 >              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() > 20 && reliso > PFISO_MU_LOOSE_EE_HIGHPT ) { //0.09
603                  failiso = true;
604                  break;
605                }
606 <              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() < 20 && lepvec[i].isoPF04 > 0.05 ) {
606 >              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() < 20 && reliso > PFISO_MU_LOOSE_EE_LOWPT ) { //0.05
607                  failiso = true;
608                  break;
609                }
610 +              */
611              }
612            }  
613 <        } else {
613 >        } else if ( ctrl.isoScheme == "pairwise" ) {
614            float rho = info->rho;
615            for( int i=0; i<lepvec.size(); i++ ) {
616              if( !(lepvec[i].is4l) ) continue;
# Line 597 | Line 744 | unsigned fails_HZZ4L_selection(ControlFl
744            //      continue;
745          }
746          
747 <        int channel;
747 >        unsigned channel;
748          if( lepvec[Z1LeptonMinusIndex].type == 11 && lepvec[Z2LeptonMinusIndex].type == 11 ) channel=0;
749          if( lepvec[Z1LeptonMinusIndex].type == 13 && lepvec[Z2LeptonMinusIndex].type == 13 ) channel=1;
750          if( (lepvec[Z1LeptonMinusIndex].type == 11 && lepvec[Z2LeptonMinusIndex].type == 13) ||
751              (lepvec[Z1LeptonMinusIndex].type == 13 && lepvec[Z2LeptonMinusIndex].type == 11)) channel=2;
752          
753  
754 +        double w_offline=-1, werr_offline=0;
755 +        double w_online=-1, werr_online=0;
756 +
757 +        if( ctrl.mc ) {
758 +
759 +          vector< pair <double,double> > wlegs; // pair here is eff & err
760 +          vector< pair <float,float> > mvec;  // pair here is eta & pt
761 +          // now deal with medium vs loose
762 +          //      vector< pair <float,float> > evec;  // pair here is eta & pt
763 +          vector< pair< bool, pair <float,float> > > evec;  // pair here is eta & pt
764 +
765 +          for( int k=0; k<lepvec.size(); k++ ) {
766 +            if( !(lepvec[k].is4l) ) continue;
767 +            if( abs(lepvec[k].type) == 13 ) {
768 +              mvec.push_back( std::pair<float,float> (fabs(lepvec[k].vec.Eta()), lepvec[k].vec.Pt()) );
769 +              wlegs.push_back( muonPerLegOfflineEfficiencyWeight( fabs(lepvec[k].vec.Eta()),
770 +                                                                  lepvec[k].vec.Pt() ) );
771 +            } else {
772 +
773 +              // now deal with medium vs loose
774 +              //              evec.push_back( std::pair<float,float> (fabs(lepvec[k].vec.Eta()), lepvec[k].vec.Pt()) );
775 +
776 +              std::pair<float,float> tmppair(fabs(lepvec[k].vec.Eta()), lepvec[k].vec.Pt());
777 +              evec.push_back( std::pair<bool, std::pair<float,float> > (lepvec[k].isTight, tmppair) );
778 +
779 +              wlegs.push_back( elePerLegOfflineEfficiencyWeight(  fabs(lepvec[k].vec.Eta()),
780 +                                                                 lepvec[k].vec.Pt() ) );
781 +            }
782 +          }
783  
784 +          pair<double,double> offpair = getOfflineEfficiencyWeight( wlegs );
785 +          w_offline    = offpair.first;
786 +          werr_offline = offpair.second;
787 +
788 +          pair<double,double> onpair  = getOnlineEfficiencyWeight( mvec, evec );
789 +          w_online    = onpair.first;
790 +          werr_online = onpair.second;
791 +
792 +        } // if mc
793 +
794 +
795 +        if( l != NULL ) {
796 +          l->vec4l  = ZZSystem;
797 +          l->vecz1  = Z1Candidate;
798 +          l->vecz2  = Z2Candidate;
799 +          l->vecl1p = lepvec[Z1LeptonPlusIndex].vec;
800 +          l->vecl1m = lepvec[Z1LeptonMinusIndex].vec;
801 +          l->vecl2p = lepvec[Z2LeptonPlusIndex].vec;
802 +          l->vecl2m = lepvec[Z2LeptonMinusIndex].vec;
803 +        }
804          if( passtuple != NULL ) {
805            unsigned run   = info->runNum;
806            unsigned evt   = info->evtNum;
# Line 615 | Line 811 | unsigned fails_HZZ4L_selection(ControlFl
811            float mZ2      = Z2Candidate.M() ;
812            float m4l      = ZZSystem.M() ;
813            float pt4l     = ZZSystem.Pt() ;
814 +          unsigned tZ1   = abs(lepvec[Z1LeptonMinusIndex].type);
815 +          unsigned tZ2   = abs(lepvec[Z2LeptonMinusIndex].type);
816 +          float l3tche   = lepvec[Z2LeptonMinusIndex].tche;
817 +          float l4tche   = lepvec[Z2LeptonPlusIndex].tche;
818 +          float l3tchp   = lepvec[Z2LeptonMinusIndex].tchp;
819 +          float l4tchp   = lepvec[Z2LeptonPlusIndex].tchp;
820 +          float l3csv    = lepvec[Z2LeptonMinusIndex].csv;
821 +          float l4csv    = lepvec[Z2LeptonPlusIndex].csv;
822 +          float l3csvMva = lepvec[Z2LeptonMinusIndex].csvMva;
823 +          float l4csvMva = lepvec[Z2LeptonPlusIndex].csvMva;
824 +
825 +
826 +          passtuple->SetBranchAddress("channel",  &channel);
827            passtuple->SetBranchAddress("run",  &run);
828            passtuple->SetBranchAddress("evt",  &evt);
829            passtuple->SetBranchAddress("lumi", &lumi);
830            passtuple->SetBranchAddress("mZ1",  &mZ1);
831            passtuple->SetBranchAddress("mZ2",  &mZ2);
832 +          passtuple->SetBranchAddress("tZ1",  &tZ1);
833 +          passtuple->SetBranchAddress("tZ2",  &tZ2);
834            passtuple->SetBranchAddress("m4l",  &m4l);
835            passtuple->SetBranchAddress("pt4l", &pt4l);
836            passtuple->SetBranchAddress("w",    &w);
837 +          if( ctrl.mc ) {
838 +            passtuple->SetBranchAddress("woff", &w_offline );
839 +            passtuple->SetBranchAddress("werroff", &werr_offline );
840 +            passtuple->SetBranchAddress("won", &w_online );
841 +            passtuple->SetBranchAddress("werron", &werr_online );
842 +          }
843 +          if( ctrl.btag ) {
844 +          passtuple->SetBranchAddress("l3tche",    &l3tche);
845 +          passtuple->SetBranchAddress("l4tche",    &l4tche);
846 +          passtuple->SetBranchAddress("l3tchp",    &l3tchp);
847 +          passtuple->SetBranchAddress("l4tchp",    &l4tchp);
848 +          passtuple->SetBranchAddress("l3csv",     &l3csv);
849 +          passtuple->SetBranchAddress("l4csv",     &l4csv);
850 +          passtuple->SetBranchAddress("l3csvMva",  &l3csvMva);
851 +          passtuple->SetBranchAddress("l4csvMva",  &l4csvMva);
852 +          }
853 +
854 +          if( ctrl.mc )           passtuple->SetBranchAddress("gchannel",  &gchannel);
855            passtuple->Fill( );
856 +
857          }
858  
859          if( ctrl.debug ) cout  << "run: " << info->runNum  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines