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.11 by khahn, Mon Oct 17 16:23:43 2011 UTC vs.
Revision 1.17 by khahn, Mon Nov 7 06:53:01 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 + TH1D * hpu;
14  
15 +
16 + // #include "TH2D.h"
17 + // extern TH2D * h_mu_eff_idiso_2011a;
18 + // extern TH2D * h_mu_eff_idiso_s11;
19 + // extern TH2D * h_mu_effdata_trigger_doublemu7_2011a;
20 + // extern TH2D * h_mu_effdata_trigger_doublemu13_8_leading_2011a;
21 + // extern TH2D * h_mu_effdata_trigger_doublemu13_8_trailing_2011a;
22 +
23 + // unsigned getGenChannel(mithep::TGenInfo * ginfo) {
24 + //   int gchannel=-1;
25 + //   if( abs(ginfo->id_1_a) == EGenType::kElectron && abs(ginfo->id_1_b) == EGenType::kElectron )  gchannel=0;
26 + //   else if( abs(ginfo->id_1_a) == EGenType::kMuon && abs(ginfo->id_1_b) == EGenType::kMuon ) gchannel=1;
27 + //   else if( (abs(ginfo->id_1_a) == EGenType::kElectron && abs(ginfo->id_1_b) == EGenType::kMuon) ||
28 + //         (abs(ginfo->id_1_a) == EGenType::kMuon && abs(ginfo->id_1_b) == EGenType::kElectron) ) gchannel=2;
29 +  
30 + //   return gchannel;
31 + // };
32 +
33   void initRunLumiRangeMap() {
34    rlrm.AddJSONFile(std::string("./data/Cert_136033-149442_7TeV_Apr21ReReco_Collisions10_JSON.txt"));
35    //  rlrm.AddJSONFile(std::string("./data/Cert_160404-173244_7TeV_PromptReco_Collisions11_JSON_v2.txt"));
36    rlrm.AddJSONFile(std::string("./data/Cert_160404-178078_7TeV_PromptReco_Collisions11_JSON.txt"));
37    rlrm.AddJSONFile(std::string("./data/Cert_160404-163869_7TeV_May10ReReco_Collisions11_JSON_v3.txt"));  
38    rlrm.AddJSONFile(std::string("./data/Cert_170249-172619_7TeV_ReReco5Aug_Collisions11_JSON.txt"));  
39 +  TFile * puf = new TFile("data/PileupReweighting.Summer11DYmm_To_Run2011A.root");
40 +  hpu = (TH1D*)(puf->Get("puWeights"));
41   };
42  
43 + void initRunLumiRangeMap(RunLumiRangeMap &rlrm) {
44 +  cout << "adding JSONS ... "  << endl;
45 +  rlrm.AddJSONFile(std::string("./data/Cert_136033-149442_7TeV_Apr21ReReco_Collisions10_JSON.txt"));
46 +  //  rlrm.AddJSONFile(std::string("./data/Cert_160404-173244_7TeV_PromptReco_Collisions11_JSON_v2.txt"));
47 +  rlrm.AddJSONFile(std::string("./data/Cert_160404-178078_7TeV_PromptReco_Collisions11_JSON.txt"));
48 +  rlrm.AddJSONFile(std::string("./data/Cert_160404-163869_7TeV_May10ReReco_Collisions11_JSON_v3.txt"));  
49 +  rlrm.AddJSONFile(std::string("./data/Cert_170249-172619_7TeV_ReReco5Aug_Collisions11_JSON.txt"));  
50 + };
51 +
52 + // unsigned fails_HZZ4L_selection(ControlFlags &ctrl,           // input control
53 + //                             mithep::TEventInfo *info,     // input event inof
54 + //                             TClonesArray *electronArr,    // input electrons
55 + //                             TClonesArray *muonArr,        // input muons
56 + //                             double eventweight,           // weight
57 + //                             TTree * passtuple ) {
58 +
59 + //   fails_HZZ4L_selection( ctrl, info, electronArr, muonArr, eventweight, passtuple, NULL );
60 +
61 + // };
62 +
63 +
64 +
65 + // unsigned fails_HZZ4L_selection(ControlFlags &ctrl,           // input control
66 + //                             mithep::TEventInfo *info,     // input event inof
67 + //                             TClonesArray *electronArr,    // input electrons
68 + //                             TClonesArray *muonArr,        // input muons
69 + //                             double eventweight,           // weight
70 + //                             LabVectors  *l ) {
71 +
72 + //   fails_HZZ4L_selection( ctrl, info, electronArr, muonArr, eventweight, NULL, l );
73 +
74 + // };
75 +
76 +
77   unsigned fails_HZZ4L_selection(ControlFlags &ctrl,           // input control
78 <                               mithep::TEventInfo *info,     // input event inof
78 >                               mithep::TGenInfo *ginfo ,     // input gen info
79 >                               mithep::TEventInfo *info,     // input event info
80                                 TClonesArray *electronArr,    // input electrons
81                                 TClonesArray *muonArr,        // input muons
82                                 double eventweight,           // weight
83                                 TTree * passtuple ) {
84  
85 <  fails_HZZ4L_selection( ctrl, info, electronArr, muonArr, eventweight, passtuple, NULL );
85 >  fails_HZZ4L_selection( ctrl, info, electronArr, muonArr, eventweight, passtuple, NULL, NULL );
86  
87   };
88  
89   unsigned fails_HZZ4L_selection(ControlFlags &ctrl,           // input control
90 <                               mithep::TEventInfo *info,     // input event inof
90 >                               mithep::TEventInfo *info,     // input event info
91                                 TClonesArray *electronArr,    // input electrons
92                                 TClonesArray *muonArr,        // input muons
93                                 double eventweight,           // weight
94 <                               LabVectors  *l ) {
95 <
96 <  fails_HZZ4L_selection( ctrl, info, electronArr, muonArr, eventweight, NULL, l );
97 <
41 < };
94 >                               TTree * passtuple,
95 >                               LabVectors * l ) {
96 >  fails_HZZ4L_selection( ctrl, info, electronArr, muonArr, eventweight, passtuple, l, NULL );
97 > }
98  
99  
100   unsigned fails_HZZ4L_selection(ControlFlags &ctrl,           // input control
101 <                               mithep::TEventInfo *info,     // input event inof
101 >                               mithep::TEventInfo *info,     // input event info
102                                 TClonesArray *electronArr,    // input electrons
103                                 TClonesArray *muonArr,        // input muons
104                                 double eventweight,           // weight
105                                 TTree * passtuple,
106 <                               LabVectors * l) {       // output ntuple
106 >                               LabVectors * l=NULL,
107 >                               TClonesArray *jetArr=NULL ) {       // output ntuple
108  
109    unsigned evtfail = 0x0;
110 +  unsigned gchannel=0xdeaddead;
111 +
112 + //   if( ctrl.mc && ginfo != NULL ) {
113 + //     gchannel = getGenChannel(ginfo);
114 + //   }
115  
116  
117    if( ctrl.debug ) {
# Line 59 | Line 121 | unsigned fails_HZZ4L_selection(ControlFl
121           << endl;
122    }
123  
124 +  unsigned npu; double npuw;
125    if( !ctrl.mc ) {
126      // not accounting for overlap atm
127      RunLumiRangeMap::RunLumiPairType rl(info->runNum, info->lumiSec);      
# Line 67 | Line 130 | unsigned fails_HZZ4L_selection(ControlFl
130        evtfail |= (1<<EVTFAIL_JSON);
131        return evtfail;
132      }
133 +  } else {
134 +    npu = info->nPU;
135 +    npuw = hpu->GetBinContent(hpu->FindBin(npu));
136    }
137    
138    
# Line 78 | Line 144 | unsigned fails_HZZ4L_selection(ControlFl
144    //********************************************************
145    if( !ctrl.mc ) {
146      //  if( !(passHLT(info->triggerBits, info->runNum, channel) )  ) {
147 <    if( !(passHLT(info->triggerBits, info->runNum, 999) )  ) {
148 <      evtfail |= (1<<EVTFAIL_TRIGGER);
149 <      return evtfail;
150 <    }  
147 > //     if( !(passHLT(info->triggerBits, info->runNum, 999) )  ) {
148 > //       evtfail |= (1<<EVTFAIL_TRIGGER);
149 > //       return evtfail;
150 > //     }        
151    } else {
152      if( !(passHLTMC(info->triggerBits)) ) {
153        evtfail |= (1<<EVTFAIL_TRIGGER);
# Line 109 | Line 175 | unsigned fails_HZZ4L_selection(ControlFl
175      const mithep::TMuon *mu = (mithep::TMuon*)((*muonArr)[i]);      
176      unsigned muonfail;
177      if( ctrl.muSele == "ksWW" )
178 <      muonfail = passMuonSelection(mu);
178 >      muonfail = passKSMuonSelection(mu);
179      else
180        muonfail = passMuonSelectionZZ(mu);
181      if( ctrl.debug ) {
# Line 118 | Line 184 | unsigned fails_HZZ4L_selection(ControlFl
184             << "\tmask: 0x" << hex << muonfail << dec
185             << endl;
186      }
187 +
188 + #ifdef Z2FO
189 +    if ( isMuFO(mu) ) {
190 + #else
191      if ( !muonfail ) {
192 + #endif
193        SimpleLepton tmplep;
194 <      tmplep.vec.SetPtEtaPhiM(mu->pt,
194 >
195 >      float pt = mu->pt;
196 >      if( ctrl.do_escale_up   ) pt*=(1.01);
197 >      if( ctrl.do_escale_down ) pt*=(0.99);
198 >
199 >      tmplep.vec.SetPtEtaPhiM(pt,
200                                mu->eta,
201                                mu->phi,
202                                105.658369e-3);
203 +
204        tmplep.type    = 13;
205        tmplep.index   = i;
206        tmplep.charge  = mu->q;
# Line 135 | Line 212 | unsigned fails_HZZ4L_selection(ControlFl
212        tmplep.ip3dSig = mu->ip3dSig;
213        tmplep.is4l    = false;
214        tmplep.isEB    = (fabs(mu->eta) < 1.479 ? 1 : 0 );
215 +      tmplep.isTight = (muonfail > 0 ? 0 : 1 );
216 +      tmplep.isLoose = (muonfail > 0 ? 0 : 1 );
217        lepvec.push_back(tmplep);
218        if( ctrl.debug ) { cout << "muon passes ... " << endl;}
219      }
# Line 146 | Line 225 | unsigned fails_HZZ4L_selection(ControlFl
225    for(Int_t i=0; i<electronArr->GetEntries(); i++) {
226      const mithep::TElectron *ele = (mithep::TElectron*)((*electronArr)[i]);
227  
228 +    if( !(isEleFO(ctrl,ele) ) ) continue;
229 +    if( ele->pt < 7 ) continue; //move this to ID
230 +
231      Bool_t isMuonOverlap = kFALSE;
232      for (int k=0; k<lepvec.size(); ++k) {
233        TVector3 tmplep;
234        tmplep.SetPtEtaPhi(ele->pt, ele->eta, ele->phi);
235 <      if ( lepvec[k].type == 13 && lepvec[k].vec.Vect().DrEtaPhi(tmplep) < 0.1 ) {
235 >      if ( lepvec[k].isLoose && lepvec[k].type == 13 && lepvec[k].vec.Vect().DrEtaPhi(tmplep) < 0.1 ) {
236          if( ctrl.debug ) cout << "-----> isMuonOverlap! " << endl;
237          isMuonOverlap = kTRUE;
238          break;
239        }
240      }
241  
242 <    unsigned FAIL=0, isEleTight=0;
242 >    unsigned FAIL=0, isEleTight=0, isEleLoose=0;
243  
244      unsigned  failsCIC=0;
245      CICStruct ciccuts_tight, ciccuts_medium, ciccuts_loose;
# Line 167 | Line 249 | unsigned fails_HZZ4L_selection(ControlFl
249          unsigned failsCICMedium = failsCicSelection(ctrl, ele, ciccuts_medium, ctrl.kinematics);
250          ciccuts_loose = getCiCCuts("loose");
251          unsigned failsCICLoose = failsCicSelection(ctrl, ele, ciccuts_loose, ctrl.kinematics);
252 <        failsCIC = ( failsCICLoose | failsCICMedium );
252 >        failsCIC = ( failsCICLoose > 0 && failsCICMedium > 0 );
253          if( !failsCICMedium ) isEleTight=1;
254        }
255        else {
# Line 190 | Line 272 | unsigned fails_HZZ4L_selection(ControlFl
272        if( ctrl.eleSeleScheme == "mediumloose" ) {
273          unsigned failsBDTMedium = failsBDTSelection(ctrl,"medium",ele);
274          unsigned failsBDTLoose  = failsBDTSelection(ctrl,"loose",ele);
275 <        failsBDT = ( failsBDTLoose | failsBDTMedium );
275 >        failsBDT = ( failsBDTLoose > 0 && failsBDTMedium > 0 );
276          if( !failsBDTMedium ) isEleTight=1;
277 +        if( !failsBDTLoose ) isEleLoose=1;
278        } else {
279          failsBDT = failsBDTSelection(ctrl,"tight",ele);
280          if( !failsBDT ) isEleTight=1;
281        }
282        FAIL = failsBDT;
283      }
201    unsigned  failsSi=0;
202    if(ctrl.eleSele=="si") {
203      failsSi = failsSiMVAElectronSelection(ctrl, ele, 0.95, ctrl.kinematics);
204      FAIL = failsSi;
205    }
206
207
284  
285  
286      if( ctrl.debug ){
# Line 221 | Line 297 | unsigned fails_HZZ4L_selection(ControlFl
297      }
298      if ( !FAIL && !isMuonOverlap ) {
299        SimpleLepton tmplep;
300 <      tmplep.vec.SetPtEtaPhiM( ele->pt,
300 >
301 >      float pt = ele->pt;
302 >      if( ctrl.do_escale_up   ) pt*=(1.02);
303 >      if( ctrl.do_escale_down ) pt*=(0.98);
304 >
305 >      tmplep.vec.SetPtEtaPhiM( pt,
306                                 ele->eta,
307                                 ele->phi,
308                                 0.51099892e-3 );
# Line 244 | Line 325 | unsigned fails_HZZ4L_selection(ControlFl
325    
326    sort( lepvec.begin(), lepvec.end(), SimpleLepton::lep_pt_sort );
327  
328 +  for( int i=0; i<lepvec.size(); i++ ) {
329 +    //
330 +    //  check for a matched btagged jet
331 +    //
332 +    lepvec[i].tche = -1;
333 +    lepvec[i].tchp = -1;
334 +    lepvec[i].csv = -1;
335 +    lepvec[i].csvMva = -1;
336 +
337 +    if( jetArr != NULL ) {
338 +      for(int k=0; k<jetArr->GetEntries(); k++) {
339 +        const mithep::TJet *jet = (mithep::TJet*)((*jetArr)[k]);      
340 +        TVector3 jvec;
341 +        jvec.SetPtEtaPhi(jet->pt, jet->eta, jet->phi);
342 +        if( jvec.DrEtaPhi( lepvec[i].vec.Vect()) < 0.2 ) {
343 +          lepvec[i].tche = jet->tche;
344 +          lepvec[i].tchp = jet->tchp;
345 +          lepvec[i].csv = jet->csv;
346 +          lepvec[i].csvMva = jet->csvMva;
347 +        }
348 +      }
349 +    }
350 +  }
351 +
352    int nmu=0, nele=0;
353    for( int i=0; i<lepvec.size(); i++ ) {
354      if( abs(lepvec[i].type) == 11 ) nele++;
# Line 264 | Line 369 | unsigned fails_HZZ4L_selection(ControlFl
369    double BestZ1Mass = -999;
370    if( ctrl.debug ) { cout << "looking for a Z1 ..." << endl; }
371    for(int i = 0; i < lepvec.size(); ++i) {
372 +    if( !(lepvec[i].isLoose ) ) continue;
373      for(int j = i+1; j < lepvec.size(); ++j) {
374 +      if( !(lepvec[j].isLoose ) ) continue;
375        if( ctrl.debug ) { cout << "\tconsidering leptons " << i << " & " << j << endl; }
376        if (!(lepvec[i].vec.Pt() > 20.0 || lepvec[j].vec.Pt() > 20.0)) continue;
377        if( ctrl.debug ) { cout << "\tat least one is > 20 GeV" << endl; }
# Line 336 | Line 443 | unsigned fails_HZZ4L_selection(ControlFl
443    Double_t BestZ2Mass = -1;
444    if( ctrl.debug ) cout << "looking for a Z2 ... out of " << lepvec.size() << " leptons" <<endl;
445    for(int i = 0; i < lepvec.size(); ++i) {
446 <    if( abs(lepvec[i].type) == 11 &&
447 <        ctrl.eleSeleScheme == "mediumloose" &&
446 >
447 > #ifndef Z2FO
448 >    if( ctrl.eleSeleScheme == "mediumloose" &&
449          !(lepvec[i].isTight) ) continue;
450 + #endif
451  
452      for(int j = i+1; j < lepvec.size(); ++j) {
453 <      if( abs(lepvec[j].type) == 11 &&
454 <          ctrl.eleSeleScheme == "mediumloose" &&
453 >
454 > #ifndef Z2FO
455 >      if( ctrl.eleSeleScheme == "mediumloose" &&
456            !(lepvec[j].isTight) ) continue;
457 + #endif
458  
459        //            cout << "i: " << i << "\tj: " << j << endl;
460        if (i == Z1LeptonPlusIndex || i == Z1LeptonMinusIndex) {
# Line 500 | Line 611 | unsigned fails_HZZ4L_selection(ControlFl
611  
612              if( abs(lepvec[i].type) == 13 ) {
613  
614 +              /*
615                float reliso = lepvec[i].isoPF03/lepvec[i].vec.Pt();
616 <              if( lepvec[i].isEB && lepvec[i].vec.Pt() > 20 && reliso > PFISO_MU_TIGHT_EB_HIGHPT ) {  //0.13
616 >              if( lepvec[i].isEB && lepvec[i].vec.Pt() > 20 && reliso > PFISO_MU_LOOSE_EB_HIGHPT ) {  //0.13
617                  failiso = true;
618                  break;
619                }
620 <              if( lepvec[i].isEB && lepvec[i].vec.Pt() < 20 && reliso > PFISO_MU_TIGHT_EB_LOWPT ) { //0.06
620 >              if( lepvec[i].isEB && lepvec[i].vec.Pt() < 20 && reliso > PFISO_MU_LOOSE_EB_LOWPT ) { //0.06
621                  failiso = true;
622                  break;
623                }
624 <              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() > 20 && reliso > PFISO_MU_TIGHT_EE_HIGHPT ) { //0.09
624 >              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() > 20 && reliso > PFISO_MU_LOOSE_EE_HIGHPT ) { //0.09
625                  failiso = true;
626                  break;
627                }
628 <              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() < 20 && reliso > PFISO_MU_TIGHT_EE_LOWPT ) { //0.05
628 >              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() < 20 && reliso > PFISO_MU_LOOSE_EE_LOWPT ) { //0.05
629                  failiso = true;
630                  break;
631                }
632 +              */
633              }
634            }  
635          } else if ( ctrl.isoScheme == "pairwise" ) {
# Line 653 | Line 766 | unsigned fails_HZZ4L_selection(ControlFl
766            //      continue;
767          }
768          
769 <        int channel;
769 >        unsigned channel;
770          if( lepvec[Z1LeptonMinusIndex].type == 11 && lepvec[Z2LeptonMinusIndex].type == 11 ) channel=0;
771          if( lepvec[Z1LeptonMinusIndex].type == 13 && lepvec[Z2LeptonMinusIndex].type == 13 ) channel=1;
772          if( (lepvec[Z1LeptonMinusIndex].type == 11 && lepvec[Z2LeptonMinusIndex].type == 13) ||
773              (lepvec[Z1LeptonMinusIndex].type == 13 && lepvec[Z2LeptonMinusIndex].type == 11)) channel=2;
774          
775  
776 +        double w_offline=-1, werr_offline=0;
777 +        double w_online=-1, werr_online=0;
778 +
779 +        if( ctrl.mc ) {
780 +
781 +          vector< pair <double,double> > wlegs; // pair here is eff & err
782 +          vector< pair <float,float> > mvec;  // pair here is eta & pt
783 +          // now deal with medium vs loose
784 +          //      vector< pair <float,float> > evec;  // pair here is eta & pt
785 +          vector< pair< bool, pair <float,float> > > evec;  // pair here is eta & pt
786 +
787 +          for( int k=0; k<lepvec.size(); k++ ) {
788 +            if( !(lepvec[k].is4l) ) continue;
789 +            if( abs(lepvec[k].type) == 13 ) {
790 +              mvec.push_back( std::pair<float,float> (fabs(lepvec[k].vec.Eta()), lepvec[k].vec.Pt()) );
791 +              wlegs.push_back( muonPerLegOfflineEfficiencyWeight( fabs(lepvec[k].vec.Eta()),
792 +                                                                  lepvec[k].vec.Pt() ) );
793 +            } else {
794 +
795 +              // now deal with medium vs loose
796 +              //              evec.push_back( std::pair<float,float> (fabs(lepvec[k].vec.Eta()), lepvec[k].vec.Pt()) );
797 +
798 +              std::pair<float,float> tmppair(fabs(lepvec[k].vec.Eta()), lepvec[k].vec.Pt());
799 +              evec.push_back( std::pair<bool, std::pair<float,float> > (lepvec[k].isTight, tmppair) );
800 +
801 +              wlegs.push_back( elePerLegOfflineEfficiencyWeight(  fabs(lepvec[k].vec.Eta()),
802 +                                                                 lepvec[k].vec.Pt() ) );
803 +            }
804 +          }
805  
806 +          pair<double,double> offpair = getOfflineEfficiencyWeight( wlegs );
807 +          w_offline    = offpair.first;
808 +          werr_offline = offpair.second;
809 +
810 +          pair<double,double> onpair  = getOnlineEfficiencyWeight( mvec, evec );
811 +          w_online    = onpair.first;
812 +          werr_online = onpair.second;
813 +
814 +        } // if mc
815 +
816 +
817 +        if( l != NULL ) {
818 +          l->vec4l  = ZZSystem;
819 +          l->vecz1  = Z1Candidate;
820 +          l->vecz2  = Z2Candidate;
821 +          l->vecl1p = lepvec[Z1LeptonPlusIndex].vec;
822 +          l->vecl1m = lepvec[Z1LeptonMinusIndex].vec;
823 +          l->vecl2p = lepvec[Z2LeptonPlusIndex].vec;
824 +          l->vecl2m = lepvec[Z2LeptonMinusIndex].vec;
825 +        }
826          if( passtuple != NULL ) {
827            unsigned run   = info->runNum;
828            unsigned evt   = info->evtNum;
# Line 673 | Line 835 | unsigned fails_HZZ4L_selection(ControlFl
835            float pt4l     = ZZSystem.Pt() ;
836            unsigned tZ1   = abs(lepvec[Z1LeptonMinusIndex].type);
837            unsigned tZ2   = abs(lepvec[Z2LeptonMinusIndex].type);
838 +          float l3tche   = lepvec[Z2LeptonMinusIndex].tche;
839 +          float l4tche   = lepvec[Z2LeptonPlusIndex].tche;
840 +          float l3tchp   = lepvec[Z2LeptonMinusIndex].tchp;
841 +          float l4tchp   = lepvec[Z2LeptonPlusIndex].tchp;
842 +          float l3csv    = lepvec[Z2LeptonMinusIndex].csv;
843 +          float l4csv    = lepvec[Z2LeptonPlusIndex].csv;
844 +          float l3csvMva = lepvec[Z2LeptonMinusIndex].csvMva;
845 +          float l4csvMva = lepvec[Z2LeptonPlusIndex].csvMva;
846 +
847 +
848 +          passtuple->SetBranchAddress("channel",  &channel);
849            passtuple->SetBranchAddress("run",  &run);
850            passtuple->SetBranchAddress("evt",  &evt);
851            passtuple->SetBranchAddress("lumi", &lumi);
# Line 683 | Line 856 | unsigned fails_HZZ4L_selection(ControlFl
856            passtuple->SetBranchAddress("m4l",  &m4l);
857            passtuple->SetBranchAddress("pt4l", &pt4l);
858            passtuple->SetBranchAddress("w",    &w);
859 +          if( ctrl.mc ) {
860 +            passtuple->SetBranchAddress("woff", &w_offline );
861 +            passtuple->SetBranchAddress("werroff", &werr_offline );
862 +            passtuple->SetBranchAddress("won", &w_online );
863 +            passtuple->SetBranchAddress("werron", &werr_online );
864 +            passtuple->SetBranchAddress("npu", &npu );
865 +            passtuple->SetBranchAddress("npuw", &npuw );
866 +            passtuple->SetBranchAddress("gchannel",  &gchannel);
867 +          }
868 +          if( ctrl.btag ) {
869 +          passtuple->SetBranchAddress("l3tche",    &l3tche);
870 +          passtuple->SetBranchAddress("l4tche",    &l4tche);
871 +          passtuple->SetBranchAddress("l3tchp",    &l3tchp);
872 +          passtuple->SetBranchAddress("l4tchp",    &l4tchp);
873 +          passtuple->SetBranchAddress("l3csv",     &l3csv);
874 +          passtuple->SetBranchAddress("l4csv",     &l4csv);
875 +          passtuple->SetBranchAddress("l3csvMva",  &l3csvMva);
876 +          passtuple->SetBranchAddress("l4csvMva",  &l4csvMva);
877 +          }
878 +
879            passtuple->Fill( );
880          }
881  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines