ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbbAnalysis/HbbAnalyzer/plugins/HbbAnalyzerNew.cc
(Generate patch)

Comparing UserCode/VHbbAnalysis/HbbAnalyzer/plugins/HbbAnalyzerNew.cc (file contents):
Revision 1.33 by tboccali, Tue Sep 13 10:10:06 2011 UTC vs.
Revision 1.45 by tboccali, Mon Sep 19 14:46:12 2011 UTC

# Line 17 | Line 17 | Implementation:
17   //
18   //
19  
20 +
21 + //uncomment to save also jet collections 1 and 4
22 + //#define ENABLE_SIMPLEJETS1
23 + //#define ENABLE_SIMPLEJETS4
24 +
25   #include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"
26   #include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h"
27   #include "JetMETCorrections/Objects/interface/JetCorrector.h"
# Line 26 | Line 31 | Implementation:
31   #include "VHbbAnalysis/HbbAnalyzer/interface/HbbAnalyzerNew.h"
32   #include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h"
33  
34 + #include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h"
35 +
36   #define GENPTOLOR(a) TLorentzVector((a).px(), (a).py(), (a).pz(), (a).energy())
37   #define GENPTOLORP(a) TLorentzVector((a)->px(), (a)->py(), (a)->pz(), (a)->energy())
38  
# Line 60 | Line 67 | HbbAnalyzerNew::HbbAnalyzerNew(const edm
67    tauLabel_(iConfig.getParameter<edm::InputTag>("tauTag")),
68    metLabel_(iConfig.getParameter<edm::InputTag>("metTag")),
69    phoLabel_(iConfig.getParameter<edm::InputTag>("photonTag")),
63  dimuLabel_(iConfig.getParameter<edm::InputTag>("dimuTag")),
64  dielecLabel_(iConfig.getParameter<edm::InputTag>("dielecTag")),
70    hltResults_(iConfig.getParameter<edm::InputTag>("hltResultsTag")),
71    runOnMC_(iConfig.getParameter<bool>("runOnMC")), verbose_(iConfig.getUntrackedParameter<bool>("verbose")) {
72  
# Line 92 | Line 97 | void
97   HbbAnalyzerNew::produce(edm::Event& iEvent, const edm::EventSetup& iSetup){
98    using namespace edm;
99    using namespace reco;
100 <  
100 >
101 >
102    // JEC Uncertainty
103  
104    //  JetCorrectionUncertainty *jecUnc=0;
# Line 106 | Line 112 | HbbAnalyzerNew::produce(edm::Event& iEve
112    
113    std::auto_ptr<VHbbEvent> hbbInfo( new VHbbEvent() );  
114    std::auto_ptr<VHbbEventAuxInfo> auxInfo( new VHbbEventAuxInfo() );
115 <  
115 >
116 >
117 >  if (runOnMC_){
118 >    Handle<GenEventInfoProduct> evt_info;
119 >    iEvent.getByType(evt_info);
120 >    auxInfo->weightMCProd = evt_info->weight();
121 >  }
122 >  else
123 >    { auxInfo->weightMCProd =1.;}
124    //
125    // ??
126 <  
126 >  
127    // trigger
128  
129    // trigger
# Line 162 | Line 176 | HbbAnalyzerNew::produce(edm::Event& iEve
176    edm::Handle<double> rhoHandle;
177    iEvent.getByLabel(edm::InputTag("kt6PFJets", "rho"),rhoHandle);  
178    auxInfo->puInfo.rho = *rhoHandle;
179 <  
179 >  
180 >  edm::Handle<double> rho25Handle;
181 >  iEvent.getByLabel(edm::InputTag("kt6PFJets25", "rho"),rho25Handle);  
182 >  auxInfo->puInfo.rho25 = *rho25Handle;
183 >
184    edm::Handle<std::vector< PileupSummaryInfo> > puHandle;
185  
186    if (runOnMC_){
# Line 368 | Line 386 | HbbAnalyzerNew::produce(edm::Event& iEve
386    iEvent.getByLabel(tauLabel_,tauHandle);
387    edm::View<pat::Tau> taus = *tauHandle;
388  
371  edm::Handle<CandidateView> dimuons;
372  iEvent.getByLabel(dimuLabel_,dimuons);
373
374  edm::Handle<CandidateView> dielectrons;
375  iEvent.getByLabel(dielecLabel_,dielectrons);
389  
390    //BTAGGING SCALE FACTOR FROM DATABASE
391    //Combined Secondary Vertex Loose
392    edm::ESHandle<BtagPerformance> bTagSF_CSVL_;
393    iSetup.get<BTagPerformanceRecord>().get("BTAGCSVL",bTagSF_CSVL_);
381  const BtagPerformance & bTagSF_CSVL = *(bTagSF_CSVL_.product());
394    //Combined Secondary Vertex Medium
395    edm::ESHandle<BtagPerformance> bTagSF_CSVM_;
396    iSetup.get<BTagPerformanceRecord>().get("BTAGCSVM",bTagSF_CSVM_);
385  const BtagPerformance & bTagSF_CSVM = *(bTagSF_CSVM_.product());
397    //Combined Secondary Vertex Tight
398    edm::ESHandle<BtagPerformance> bTagSF_CSVT_;
399    iSetup.get<BTagPerformanceRecord>().get("BTAGCSVT",bTagSF_CSVT_);
389  const BtagPerformance & bTagSF_CSVT = *(bTagSF_CSVT_.product());
400  
401    edm::ESHandle<BtagPerformance> mistagSF_CSVL_;
402    iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVL",mistagSF_CSVL_);
393  const BtagPerformance & mistagSF_CSVL = *(mistagSF_CSVL_.product());
403    //Combined Secondary Vertex Medium
404    edm::ESHandle<BtagPerformance> mistagSF_CSVM_;
405    iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVM",mistagSF_CSVM_);
397  const BtagPerformance & mistagSF_CSVM = *(mistagSF_CSVM_.product());
406    //Combined Secondary Vertex Tight
407    edm::ESHandle<BtagPerformance> mistagSF_CSVT_;
408    iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVT",mistagSF_CSVT_);
401  const BtagPerformance & mistagSF_CSVT = *(mistagSF_CSVT_.product());
409  
410   BTagSFContainer btagSFs;
411    btagSFs.BTAGSF_CSVL = (bTagSF_CSVL_.product());
# Line 408 | Line 415 | BTagSFContainer btagSFs;
415    btagSFs.MISTAGSF_CSVM = (mistagSF_CSVM_.product());
416    btagSFs.MISTAGSF_CSVT = (mistagSF_CSVT_.product());
417  
418 + #ifdef ENABLE_SIMPLEJETS1
419    for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets1.begin(); jet_iter!=simplejets1.end(); ++jet_iter){
420      //     if(jet_iter->pt()>50)
421      //       njetscounter++;
422      VHbbEvent::SimpleJet sj;
423 +    //    std::cout <<" sj1"<<std::endl;
424      fillSimpleJet(sj,jet_iter);
425      //    if(!runOnMC_)
426  
# Line 427 | Line 436 | BTagSFContainer btagSFs;
436        //genJet
437        const reco::GenJet *gJ = jet_iter->genJet();
438        //physical parton for mother info ONLY
439 <      if( (jet_iter->genParton())
440 <          and (jet_iter->genParton()->mother()) )
441 <        sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId();
439 >      if( (jet_iter->genParton()) ){
440 >        sj.bestMCid = jet_iter->genParton()->pdgId();
441 >        if( (jet_iter->genParton()->mother()) )
442 >          sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId();
443 >      }
444        TLorentzVector gJp4;
445        if(gJ){
446          gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy());
447 <        sj. bestMCp4mom = gJp4;
447 >        sj.bestMCp4 = gJp4;
448          if(verbose_){
449            std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl;
450            std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl;
# Line 446 | Line 457 | BTagSFContainer btagSFs;
457      hbbInfo->simpleJets.push_back(sj);
458      
459    }
460 + #endif //ENABLE_SIMPLEJETS1
461  
462    for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets3.begin(); jet_iter!=simplejets3.end(); ++jet_iter){
463      //     if(jet_iter->pt()>50)
464      //       njetscounter++;
465      VHbbEvent::SimpleJet sj;
466 +    //    std::cout <<" sj3"<<std::endl;
467      fillSimpleJet(sj,jet_iter);
468      //    if(!runOnMC_)  
469    setJecUnc(sj,jecUnc);
# Line 466 | Line 479 | BTagSFContainer btagSFs;
479        //genJet
480        const reco::GenJet *gJ = jet_iter->genJet();
481        //physical parton for mother info ONLY
482 <      if( (jet_iter->genParton())
483 <          and (jet_iter->genParton()->mother()) )
484 <        sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId();
482 >      if( (jet_iter->genParton()) ){
483 >        sj.bestMCid = jet_iter->genParton()->pdgId();
484 >        if( (jet_iter->genParton()->mother()) )
485 >          sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId();
486 >      }
487        TLorentzVector gJp4;
488        if(gJ){
489          gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy());
490 <        sj. bestMCp4mom = gJp4;
490 >        sj.bestMCp4 = gJp4;
491          if(verbose_){
492            std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl;
493            std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl;
# Line 486 | Line 501 | BTagSFContainer btagSFs;
501      
502    }
503  
504 + #ifdef ENABLE_SIMPLEJETS4
505    for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets4.begin(); jet_iter!=simplejets4.end(); ++jet_iter){
506      //     if(jet_iter->pt()>50)
507      //       njetscounter++;
508      VHbbEvent::SimpleJet sj;
509 +    //    std::cout <<" sj4"<<std::endl;
510      fillSimpleJet(sj,jet_iter);
511      //    if(!runOnMC_)  
512      setJecUnc(sj,jecUnc);
# Line 505 | Line 522 | BTagSFContainer btagSFs;
522        //genJet
523        const reco::GenJet *gJ = jet_iter->genJet();
524        //physical parton for mother info ONLY
525 <      if( (jet_iter->genParton())
526 <          and (jet_iter->genParton()->mother()) )
527 <        sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId();
525 >      if( (jet_iter->genParton()) ){
526 >        sj.bestMCid = jet_iter->genParton()->pdgId();
527 >        if( (jet_iter->genParton()->mother()) )
528 >          sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId();
529 >      }
530        TLorentzVector gJp4;
531        if(gJ){
532          gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy());
533 <        sj. bestMCp4mom = gJp4;
533 >        sj.bestMCp4 = gJp4;
534          if(verbose_){
535            std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl;
536            std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl;
# Line 524 | Line 543 | BTagSFContainer btagSFs;
543      hbbInfo->simpleJets4.push_back(sj);
544      
545    }
546 <
546 > #endif //ENABLE SIMPLEJETS4
547 >
548    
549    for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets2.begin(); jet_iter!=simplejets2.end(); ++jet_iter){
550      
551      VHbbEvent::SimpleJet sj;
552 +    //    std::cout <<" sj2"<<std::endl;
553      fillSimpleJet(sj,jet_iter);    
554      //  if(!runOnMC_)  
555   setJecUnc(sj,jecUnc);
# Line 575 | Line 596 | BTagSFContainer btagSFs;
596      */
597      Particle::LorentzVector p4Jet = jet_iter->p4();
598  
578
599      if(runOnMC_){
600  
601        //BTV scale factors
# Line 585 | Line 605 | BTagSFContainer btagSFs;
605        //genJet
606        const reco::GenJet *gJ = jet_iter->genJet();
607        //physical parton for mother info ONLY
608 <      if( (jet_iter->genParton())
609 <          and (jet_iter->genParton()->mother()) )
610 <        sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId();
608 >      if( (jet_iter->genParton()) ){
609 >        sj.bestMCid = jet_iter->genParton()->pdgId();
610 >        if( (jet_iter->genParton()->mother()) )
611 >          sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId();
612 >      }
613        TLorentzVector gJp4;
614        if(gJ){
615          gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy());
616 <        sj. bestMCp4mom = gJp4;
616 >        sj.bestMCp4 = gJp4;
617          if(verbose_){
618            std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl;
619            std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl;
# Line 671 | Line 693 | BTagSFContainer btagSFs;
693                              << "," << subjet_iter->bDiscriminator("combinedSecondaryVertexBJetTags") << "\n";}
694  
695      VHbbEvent::SimpleJet sj;
696 +    //    std::cout <<" sub jet "<<std::endl;
697      fillSimpleJet(sj,subjet_iter);
698      //  if(!runOnMC_)  
699      setJecUnc(sj,jecUnc);
# Line 722 | Line 745 | BTagSFContainer btagSFs;
745      if (verbose_)     std::cout <<" METTC "<<     hbbInfo->tcmet.metSig <<" " <<     hbbInfo->tcmet.sumEt<<std::endl;
746    }
747    
748 +  edm::Handle<edm::View<reco::MET> > pfMETNoPUHandle;
749 +  iEvent.getByLabel("pfMETNoPU",pfMETNoPUHandle);
750 +  edm::View<reco::MET> metspfMETNoPU = *pfMETNoPUHandle;
751 +  if(metspfMETNoPU.size()){
752 +    hbbInfo->metNoPU.sumEt=(metspfMETNoPU[0]).sumEt();
753 +    hbbInfo->metNoPU.metSig=(metspfMETNoPU[0]).significance();
754 +    hbbInfo->metNoPU.eLong=(metspfMETNoPU[0]).e_longitudinal();
755 +    hbbInfo->metNoPU.p4=GENPTOLOR((metspfMETNoPU[0]));
756 +    if (verbose_)     std::cout <<" pfMETNoPU "<<     hbbInfo->metNoPU.metSig <<" " <<     hbbInfo->metNoPU.sumEt<<std::endl;
757 +  }
758  
759    edm::Handle<edm::View<reco::MET> > mHTHandle;
760    iEvent.getByLabel("patMETsHT",mHTHandle);
# Line 734 | Line 767 | BTagSFContainer btagSFs;
767      if (verbose_)     std::cout <<" METHT "<<     hbbInfo->mht.metSig <<" " <<     hbbInfo->mht.sumEt<<std::endl;
768    }
769    
770 <  edm::Handle<edm::View<pat::MET> > metHandle;
770 >  edm::Handle<edm::View<reco::MET> > metHandle;
771    iEvent.getByLabel(metLabel_,metHandle);
772 <  edm::View<pat::MET> mets = *metHandle;
772 >  edm::View<reco::MET> mets = *metHandle;
773    
774    if(mets.size()){
775      hbbInfo->calomet.sumEt=(mets[0]).sumEt();
# Line 774 | Line 807 | BTagSFContainer btagSFs;
807      mf.eIso=mu->ecalIso();
808      mf.hIso=mu->hcalIso();
809      mf.pfChaIso=mu->chargedHadronIso();
810 +    mf.pfChaPUIso=mu->userIso(5);
811      mf.pfPhoIso=mu->photonIso();
812      mf.pfNeuIso=mu->neutralHadronIso();
813      Geom::Phi<double> deltaphi(mu->phi()-atan2(mf.p4.Px(), mf.p4.Py()));
814      double acop = deltaphi.value();
815      mf.acop=acop;
816  
817 +    mf.nMatches = mu->numberOfMatches();
818 +
819 +
820      mf.ipDb=mu->dB();
821      mf.ipErrDb=mu->edB();
822      mf.cat=0;
# Line 802 | Line 839 | BTagSFContainer btagSFs;
839        const reco::HitPattern& q = gTrack->hitPattern();
840        mf.globChi2=gTrack.get()->normalizedChi2();
841        mf.globNHits=q.numberOfValidMuonHits();
842 <      mf. validMuStations = q. muonStationsWithValidHits();
842 >      mf.validMuStations = q.muonStationsWithValidHits();
843      }else{
844        mf.globChi2=-99;
845        mf.globNHits=-99;
# Line 861 | Line 898 | BTagSFContainer btagSFs;
898      ef.eIso=elec->ecalIso();
899      ef.hIso=elec->hcalIso();
900      ef.pfChaIso=elec->chargedHadronIso();
901 +    ef.pfChaPUIso=elec->userIso(5);
902      ef.pfPhoIso=elec->photonIso();
903      ef.pfNeuIso=elec->neutralHadronIso();
904  
905 <    Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->calomet.p4.Py(),hbbInfo->calomet.p4.Px()));
905 >    Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px()));
906      ef.acop = deltaphi.value();
907      //
908      // fill eleids
# Line 923 | Line 961 | BTagSFContainer btagSFs;
961      tf.tIso=tau->trackIso();
962      tf.eIso=tau->ecalIso();
963      tf.hIso=tau->hcalIso();
964 <    Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->calomet.p4.Py(),hbbInfo->calomet.p4.Px()));
964 >    Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px()));
965      double acop = deltaphi.value();
966      tf.acop=acop;
967      tf.idbyIso=tau->tauID("byIsolation");
# Line 945 | Line 983 | BTagSFContainer btagSFs;
983    std::sort(hbbInfo->tauInfo.begin(), hbbInfo->tauInfo.end(), ptComparatorTau);
984  
985  
948  // dimuons and dielectrons
949
950  for( size_t i = 0; i < dimuons->size(); i++ ) {
951    VHbbEvent::DiMuonInfo df;
952    const Candidate & dimuonCand = (*dimuons)[ i ];
953    df.p4= GENPTOLOR(dimuonCand);
954    const Candidate * lep0 = dimuonCand.daughter( 0 );
955    const Candidate * lep1 = dimuonCand.daughter( 1 );
956    // needed to access specific methods of pat::Muon
957    const pat::Muon & muonDau0 = dynamic_cast<const pat::Muon &>(*lep0->masterClone());
958    const pat::Muon & muonDau1 = dynamic_cast<const pat::Muon &>(*lep1->masterClone());
959    
960    df.daughter1.p4=GENPTOLOR(muonDau0);
961    df.daughter2.p4=GENPTOLOR(muonDau1);
986      
963    df.daughter1.tIso= muonDau0.trackIso();
964    df.daughter2.tIso= muonDau1.trackIso();
965
966    df.daughter1.eIso= muonDau0.ecalIso();
967    df.daughter2.eIso= muonDau1.ecalIso();
968
969    df.daughter1.hIso= muonDau0.hcalIso();
970    df.daughter2.hIso= muonDau1.hcalIso();
971
972    df.daughter1.ipDb=muonDau0.dB();
973    df.daughter2.ipDb=muonDau1.dB();
974
975    df.daughter1.ipErrDb=muonDau0.edB();
976    df.daughter2.ipErrDb=muonDau1.edB();
977
978    df.daughter1.cat=0;
979    if(muonDau0.isGlobalMuon()) df.daughter1.cat|=1;
980    if(muonDau0.isTrackerMuon()) df.daughter1.cat|=2;
981    if(muonDau0.isStandAloneMuon()) df.daughter1.cat|=4;
982    df.daughter2.cat=0;
983    if(muonDau1.isGlobalMuon()) df.daughter2.cat|=1;
984    if(muonDau1.isTrackerMuon()) df.daughter2.cat|=2;
985    if(muonDau1.isStandAloneMuon()) df.daughter2.cat|=4;
986
987    TrackRef trkMu1Ref = muonDau0.get<TrackRef>();
988    TrackRef trkMu2Ref = muonDau1.get<TrackRef>();
989
990    if(trkMu1Ref.isNonnull() && trkMu2Ref.isNonnull()){
991      const Track* MuTrk1 = muonDau0.get<TrackRef>().get();
992      const Track* MuTrk2 = muonDau1.get<TrackRef>().get();
993      df.daughter1.zPVPt=MuTrk1->dz(RecVtxFirst.position());
994      df.daughter1.zPVProb=MuTrk1->dz(RecVtx.position());
995      df.daughter2.zPVPt=MuTrk2->dz(RecVtxFirst.position());
996      df.daughter2.zPVProb=MuTrk2->dz(RecVtx.position());
997
998      df.daughter1.nHits = MuTrk1->numberOfValidHits();
999      df.daughter2.nHits = MuTrk2->numberOfValidHits();
1000
1001      df.daughter1.chi2 = MuTrk1->normalizedChi2();
1002      df.daughter2.chi2 = MuTrk2->normalizedChi2();
1003
1004      TrackRef iTrack1 = muonDau0.innerTrack();
1005      const reco::HitPattern& p1 = iTrack1->hitPattern();
1006      TrackRef iTrack2 = muonDau1.innerTrack();
1007      const reco::HitPattern& p2 = iTrack2->hitPattern();
1008
1009      df.daughter1.nPixelHits = p1.pixelLayersWithMeasurement();
1010      df.daughter2.nPixelHits = p2.pixelLayersWithMeasurement();
1011
1012      if(muonDau0.isGlobalMuon()){
1013        TrackRef gTrack = muonDau0.globalTrack();
1014        const reco::HitPattern& q = gTrack->hitPattern();
1015        df.daughter1.globNHits=q.numberOfValidMuonHits();
1016        df.daughter1.globChi2=gTrack.get()->normalizedChi2();
1017        df.daughter1.validMuStations = q. muonStationsWithValidHits();
1018      }
1019      if(muonDau1.isGlobalMuon()){
1020        TrackRef gTrack = muonDau1.globalTrack();
1021        const reco::HitPattern& q = gTrack->hitPattern();
1022        df.daughter2.globNHits=q.numberOfValidMuonHits();
1023        df.daughter2.globChi2=gTrack.get()->normalizedChi2();
1024        df.daughter2.validMuStations = q. muonStationsWithValidHits();
1025      }
987    
1027    }
1028      
1029    hbbInfo->diMuonInfo.push_back(df);
1030  }
1031
1032  for( size_t i = 0; i < dielectrons->size(); i++ ) {
1033    VHbbEvent::DiElectronInfo df;
1034    const Candidate & dielecCand = (*dielectrons)[ i ];
1035
1036    df.p4=GENPTOLOR(dielecCand);
1037
1038    // accessing the daughters of the dimuon candidate
1039    const Candidate * lep0 = dielecCand.daughter( 0 );
1040    const Candidate * lep1 = dielecCand.daughter( 1 );
1041    // needed to access specific methods of pat::Muon
1042    const pat::Electron & elecDau0 = dynamic_cast<const pat::Electron &>(*lep0->masterClone());
1043    const pat::Electron & elecDau1 = dynamic_cast<const pat::Electron &>(*lep1->masterClone());
1044
1045    df.daughter1.p4 = GENPTOLOR(elecDau0);
1046    df.daughter2.p4= GENPTOLOR(elecDau1);
1047
1048    df.daughter1.tIso = elecDau0.trackIso();
1049    df.daughter2.tIso = elecDau1.trackIso();
1050
1051    df.daughter1.eIso = elecDau0.ecalIso();
1052    df.daughter2.eIso = elecDau1.ecalIso();
1053
1054    df.daughter1.hIso = elecDau0.hcalIso();
1055    df.daughter2.hIso = elecDau1.hcalIso();
1056    
1057    // ids
1058    /*df.daughter1.id95 = elecDau0.electronID("simpleEleId95cIso");
1059    df.daughter1.id85 = elecDau0.electronID  ("simpleEleId85cIso");
1060    df.daughter1.id70 = elecDau0.electronID  ("simpleEleId70cIso");
1061    df.daughter1.id95r = elecDau0.electronID ("simpleEleId95relIso");
1062    df.daughter1.id85r = elecDau0.electronID ("simpleEleId85relIso");
1063    df.daughter1.id70r = elecDau0.electronID ("simpleEleId70relIso");
1064
1065
1066    df.daughter2.id95 = elecDau1.electronID("simpleEleId95cIso");
1067    df.daughter2.id85 = elecDau1.electronID  ("simpleEleId85cIso");
1068    df.daughter2.id70 = elecDau1.electronID  ("simpleEleId70cIso");
1069    df.daughter2.id95r = elecDau1.electronID ("simpleEleId95relIso");
1070    df.daughter2.id85r = elecDau1.electronID ("simpleEleId85relIso");
1071    df.daughter2.id70r = elecDau1.electronID ("simpleEleId70relIso");
1072 */
1073    hbbInfo->diElectronInfo.push_back(df);
1074    
1075  }
988     if (verbose_){
989       std::cout <<" Pushing hbbInfo "<<std::endl;
990       std::cout <<" SimpleJets1 = "<<hbbInfo->simpleJets.size()<<std::endl<<
# Line 1299 | Line 1211 | void HbbAnalyzerNew ::fillSimpleJet (VHb
1211      sj.jpb=jet_iter->bDiscriminator("jetBProbabilityBJetTags");
1212      sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags");
1213      sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags");
1214 <    sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags");
1214 >   sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags");
1215      sj.charge=jet_iter->jetCharge();
1216      sj.ntracks=jet_iter->associatedTracks().size();
1217      sj.p4=GENPTOLORP(jet_iter);
1218 +    //    std::cout << " ECCO "<<sj.csv<< " "<< sj.p4.Pt()<<std::endl;
1219      sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter)));
1220      sj.SF_CSVL=1;
1221      sj.SF_CSVM=1;
# Line 1318 | Line 1231 | void HbbAnalyzerNew ::fillSimpleJet (VHb
1231        sj.neutralHadronEFraction = jet_iter-> neutralHadronEnergyFraction ();
1232        sj.chargedEmEFraction = jet_iter-> chargedEmEnergyFraction ();
1233        sj.neutralEmEFraction = jet_iter-> neutralEmEnergyFraction ();
1234 <      sj. nConstituents = jet_iter->getPFConstituents().size();
1234 >      sj.nConstituents = jet_iter->getPFConstituents().size();
1235        
1236      }
1237      //

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines