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

Comparing UserCode/MitPhysics/Mods/src/PhotonTreeWriter.cc (file contents):
Revision 1.35 by mingyang, Sat Oct 13 21:09:57 2012 UTC vs.
Revision 1.36 by fabstoec, Fri Oct 26 19:23:05 2012 UTC

# Line 33 | Line 33 | PhotonTreeWriter::PhotonTreeWriter(const
33    fElectronName           (Names::gkElectronBrn),
34    fGoodElectronName       (Names::gkElectronBrn),  
35    fConversionName         (Names::gkMvfConversionBrn),  
36 +  fPFConversionName              ("PFPhotonConversions"),  
37    fTrackBranchName        (Names::gkTrackBrn),
38    fPileUpDenName          (Names::gkPileupEnergyDensityBrn),
39    fPVName                 (Names::gkPVBeamSpotBrn),
# Line 57 | Line 58 | PhotonTreeWriter::PhotonTreeWriter(const
58    fGoodElectronsFromBranch(kTRUE),
59    fPFJetsFromBranch       (kTRUE),
60    // ----------------------------------------
61 +  // flag for synchronization, adds vertex variables
62 +  // should be on for synching trees
63 +  fDoSynching             (kTRUE),
64 +
65 +  // ----------------------------------------
66    // collections....
67    fPhotons                (0),
68    fPFPhotons              (0),
69    fElectrons              (0),
70    fConversions            (0),
71 +  fPFConversions                 (0),
72    fTracks                 (0),
73    fPileUpDen              (0),
74    fPV                     (0),
# Line 99 | Line 106 | PhotonTreeWriter::PhotonTreeWriter(const
106    fPhFixDataFile          (gSystem->Getenv("CMSSW_BASE") +
107                             TString("/src/MitPhysics/data/PhotonFixSTART42V13.dat")),
108    fBeamspotWidth          (5.8),
109 +
110 +  fElectronIDMVA(0),
111 +  fElectronMVAWeights_Subdet0Pt10To20(""),
112 +  fElectronMVAWeights_Subdet1Pt10To20(""),
113 +  fElectronMVAWeights_Subdet2Pt10To20(""),
114 +  fElectronMVAWeights_Subdet0Pt20ToInf(""),
115 +  fElectronMVAWeights_Subdet1Pt20ToInf(""),
116 +  fElectronMVAWeights_Subdet2Pt20ToInf(""),
117 +  fTheRhoType(RhoUtilities::DEFAULT),
118 +
119    fTupleName              ("hPhotonTree")
120   {
121    // Constructor
# Line 134 | Line 151 | void PhotonTreeWriter::Process()
151    if (fEnablePFPhotons) LoadEventObject(fPFPhotonName,   fPFPhotons);
152    LoadEventObject(fElectronName,       fElectrons);
153    LoadEventObject(fConversionName,     fConversions);
154 +  if ( fDoSynching ) LoadEventObject(fPFConversionName,     fPFConversions);
155    LoadEventObject(fTrackBranchName,    fTracks);
156    LoadEventObject(fPileUpDenName,      fPileUpDen);
157    LoadEventObject(fPVName,             fPV);    
# Line 203 | Line 221 | void PhotonTreeWriter::Process()
221  
222    fDiphotonEvent->leptonTag = -1; // disabled
223  
224 +  // ====================================================
225 +  // Vtx synching stuff...
226 +  fDiphotonEvent->vtxInd1 = -1;
227 +  fDiphotonEvent->vtxInd2 = -1;
228 +  fDiphotonEvent->vtxInd3 = -1;
229 +
230 +  fDiphotonEvent->vtxBestPtbal  = -1.;
231 +  fDiphotonEvent->vtxBestPtasym = -1.;
232 +  fDiphotonEvent->vtxBestSumpt2 = -1.;
233 +  fDiphotonEvent->vtxBestP2Conv = -1.;
234 +
235 +  fDiphotonEvent->vtxMva1 = -1.;
236 +  fDiphotonEvent->vtxMva2 = -1.;
237 +  fDiphotonEvent->vtxMva3 = -1.;
238 +
239 +  fDiphotonEvent->vtxNleg1 = -1;
240 +  fDiphotonEvent->vtxNleg2 = -1;
241 +  fDiphotonEvent->vtxNconv = -1;
242 +  // ====================================================
243 +
244 +
245    fDiphotonEvent->rho = fPileUpDen->At(0)->RhoKt6PFJets();
246    fDiphotonEvent->rho25 = fPileUpDen->At(0)->RhoRandomLowEta();
247    fDiphotonEvent->rhoold = fPileUpDen->At(0)->Rho();
# Line 508 | Line 547 | void PhotonTreeWriter::Process()
547      Double_t _phigg = -99.;    
548      Double_t _costheta = -99.;
549      PhotonTools::DiphotonR9EtaPtCats _evtcat = PhotonTools::kOctCat0;
550 +
551 +    const Vertex* realVtx = NULL;
552 +
553      if (phHard && phSoft) {
554        _dphiMetgg = MathUtils::DeltaPhi((phHard->Mom()+phSoft->Mom()).Phi(),fPFMet->At(0)->Phi());
555        _cosdphiMetgg = TMath::Cos(_dphiMetgg);
# Line 533 | Line 575 | void PhotonTreeWriter::Process()
575                                                             fDiphotonEvent->vtxZ,
576                                                             dz);
577        fDiphotonEvent->deltamvtx = deltamvtx;
578 <            
578 >      
579        _masserrwrongvtx        = TMath::Sqrt(_masserr*_masserr + deltamvtx*deltamvtx);
580        _masserrsmearedwrongvtx = TMath::Sqrt(_masserrsmeared*_masserrsmeared + deltamvtx*deltamvtx);
581 <            
581 >      
582 >
583 >
584 >      // =================================================================================
585 >      // this is for synching the Vtx stuff
586 >      if (  fDoSynching ) {
587 >        //fill conversion collection for vertex selection, adding single leg conversions if needed
588 >        //note that momentum of single leg conversions needs to be recomputed from the track
589 >        //as it is not filled properly
590 >        DecayParticleOArr vtxconversions;
591 >        if ( true ) {
592 >          vtxconversions.SetOwner(kTRUE);
593 >          for (UInt_t iconv=0; iconv<fConversions->GetEntries(); ++iconv) {
594 >            DecayParticle *conv = new DecayParticle(*fConversions->At(iconv));
595 >            vtxconversions.AddOwned(conv);
596 >          }
597 >          
598 >          for (UInt_t iconv=0; iconv<fPFConversions->GetEntries(); ++iconv) {
599 >            const DecayParticle *c = fPFConversions->At(iconv);
600 >            if (c->NDaughters()!=1) continue;
601 >            
602 >            DecayParticle *conv = new DecayParticle(*c);
603 >            const Track *trk = static_cast<const StableParticle*>(conv->Daughter(0))->Trk();
604 >            conv->SetMom(trk->Px(), trk->Py(), trk->Pz(), trk->P());
605 >            vtxconversions.AddOwned(conv);
606 >          }    
607 >        }
608 >        else {
609 >          for (UInt_t iconv=0; iconv<fConversions->GetEntries(); ++iconv) {
610 >            const DecayParticle *c = fConversions->At(iconv);
611 >            vtxconversions.Add(c);
612 >          }
613 >        }
614 >        
615 >        
616 >        const BaseVertex *bsp = dynamic_cast<const BaseVertex*>(fBeamspot->At(0));
617 >        double tmpVtxProb = 0.;
618 >        
619 >        std::vector<int>    debugInds;  // this hold the Vtx indices for the first three guys
620 >        std::vector<double> debugVals;  // this holds hte mva input/output for the best ranked
621 >        std::vector<int>    debugConv;  // this holds number of legs for frist and second photon (0 if no conversion) and total number of conversions
622 >        
623 >                
624 >        realVtx = fVtxTools.findVtxBasicRanking(phHard, phSoft, bsp, fPV,
625 >                                                &vtxconversions,kTRUE,tmpVtxProb,
626 >                                                &debugInds, &debugVals, &debugConv
627 >                                                );
628 >        
629 >        fDiphotonEvent->vtxInd1 = debugInds[0];
630 >        fDiphotonEvent->vtxInd2 = debugInds[1];
631 >        fDiphotonEvent->vtxInd3 = debugInds[2];
632 >        
633 >        fDiphotonEvent->vtxConv1Z    = debugVals[0];
634 >        fDiphotonEvent->vtxConv1DZ   = debugVals[1];
635 >        fDiphotonEvent->vtxConv1Prob = debugVals[2];
636 >
637 >        fDiphotonEvent->vtxConv2Z    = debugVals[3];
638 >        fDiphotonEvent->vtxConv2DZ   = debugVals[4];
639 >        fDiphotonEvent->vtxConv2Prob = debugVals[5];
640 >
641 >
642 >        fDiphotonEvent->vtxBestPtbal  = debugVals[6];
643 >        fDiphotonEvent->vtxBestPtasym = debugVals[7];
644 >        fDiphotonEvent->vtxBestSumpt2 = debugVals[8];
645 >        fDiphotonEvent->vtxBestP2Conv = debugVals[9];
646 >        
647 >        fDiphotonEvent->vtxMva1Z      = debugVals[10];
648 >        fDiphotonEvent->vtxMva2Z      = debugVals[11];
649 >        fDiphotonEvent->vtxMva3Z      = debugVals[12];
650 >
651 >        fDiphotonEvent->vtxMva1 = debugVals[13];
652 >        fDiphotonEvent->vtxMva2 = debugVals[14];
653 >        fDiphotonEvent->vtxMva3 = debugVals[15];
654 >        
655 >        fDiphotonEvent->vtxNleg1    = debugConv[0];
656 >        fDiphotonEvent->vtxNleg2    = debugConv[1];
657 >        fDiphotonEvent->vtxConvIdx1 = debugConv[2];
658 >        fDiphotonEvent->vtxConvIdx2 = debugConv[3];
659 >        
660 >        fDiphotonEvent->vtxNconv = debugConv[4];
661 >
662 >        if( false ) {
663 >          printf("---------------------------------------------------------------------\n");
664 >          printf("FINAL\nvtx %i: ptbal = %5f, ptasym = %5f, logsumpt2 = %5f, limpulltoconv = %5f, nconv = %i, mva = %5f\n",fDiphotonEvent->vtxInd1,fDiphotonEvent->vtxBestPtbal,fDiphotonEvent->vtxBestPtasym,fDiphotonEvent->vtxBestSumpt2,fDiphotonEvent->vtxBestP2Conv,fDiphotonEvent->vtxNconv,fDiphotonEvent->vtxMva1);
665 >          printf("---------------------------------------------------------------------\n");
666 >        }
667 >      }
668 >      
669 >      
670 >      // end of Vtx synching stuff ...
671 >      // =================================================================================
672 >
673 >
674 >
675        if (jet1 && jet2) {
676          fDiphotonEvent->zeppenfeld = TMath::Abs(_etagg - 0.5*(jet1->Eta()+jet2->Eta()));
677          fDiphotonEvent->dphidijetgg = MathUtils::DeltaPhi( (jet1->Mom()+jet2->Mom()).Phi(), _phigg );
# Line 560 | Line 695 | void PhotonTreeWriter::Process()
695        if (!fLoopOnGoodElectrons && phHard->HasPV()) {
696          selvtx = phHard->PV();
697        }
698 <    
698 >      
699        if (0) //disable for now for performance reasons
700 <      {
701 <        Met mmet = fMVAMet.GetMet(  false,
702 <                                  0.,0.,0.,
703 <                                  0.,0.,0.,
704 <                                  fPFMet->At(0),
705 <                                  &pfcands,selvtx,fPV, fPileUpDen->At(0)->Rho(),
706 <                                  &pfjets,
707 <                                  int(fPV->GetEntries()),
708 <                                  kFALSE);      
700 >        {
701 >          Met mmet = fMVAMet.GetMet(  false,
702 >                                      0.,0.,0.,
703 >                                      0.,0.,0.,
704 >                                      fPFMet->At(0),
705 >                                      &pfcands,selvtx,fPV, fPileUpDen->At(0)->Rho(),
706 >                                      &pfjets,
707 >                                      int(fPV->GetEntries()),
708 >                                      kFALSE);      
709                                    
710 <        TMatrixD *metcov = fMVAMet.GetMetCovariance();
711 <        
712 <        ThreeVector fullmet(mmet.Px() - phHard->Px() - phSoft->Px(),
713 <                            mmet.Py() - phHard->Py() - phSoft->Py(),
714 <                            0.);
715 <        
716 <        ROOT::Math::SMatrix<double,2,2,ROOT::Math::MatRepSym<double,2> > mcov;
717 <        mcov(0,0) = (*metcov)(0,0);
718 <        mcov(0,1) = (*metcov)(0,1);
719 <        mcov(1,0) = (*metcov)(1,0);
720 <        mcov(1,1) = (*metcov)(1,1);
721 <        ROOT::Math::SVector<double,2> vmet;
722 <        vmet(0) = fullmet.X();
723 <        vmet(1) = fullmet.Y();
724 <        mcov.Invert();
725 <        Double_t metsig = sqrt(ROOT::Math::Similarity(mcov,vmet));
710 >          TMatrixD *metcov = fMVAMet.GetMetCovariance();
711 >          
712 >          ThreeVector fullmet(mmet.Px() - phHard->Px() - phSoft->Px(),
713 >                              mmet.Py() - phHard->Py() - phSoft->Py(),
714 >                              0.);
715 >          
716 >          ROOT::Math::SMatrix<double,2,2,ROOT::Math::MatRepSym<double,2> > mcov;
717 >          mcov(0,0) = (*metcov)(0,0);
718 >          mcov(0,1) = (*metcov)(0,1);
719 >          mcov(1,0) = (*metcov)(1,0);
720 >          mcov(1,1) = (*metcov)(1,1);
721 >          ROOT::Math::SVector<double,2> vmet;
722 >          vmet(0) = fullmet.X();
723 >          vmet(1) = fullmet.Y();
724 >          mcov.Invert();
725 >          Double_t metsig = sqrt(ROOT::Math::Similarity(mcov,vmet));
726                                    
727 <        fDiphotonEvent->mvametsel = fullmet.Rho();
728 <        fDiphotonEvent->mvametselphi = fullmet.Phi();
729 <        fDiphotonEvent->mvametselx = fullmet.X();
730 <        fDiphotonEvent->mvametsely = fullmet.Y();
731 <        fDiphotonEvent->mvametselsig = metsig;
732 <      }
727 >          fDiphotonEvent->mvametsel = fullmet.Rho();
728 >          fDiphotonEvent->mvametselphi = fullmet.Phi();
729 >          fDiphotonEvent->mvametselx = fullmet.X();
730 >          fDiphotonEvent->mvametsely = fullmet.Y();
731 >          fDiphotonEvent->mvametselsig = metsig;
732 >        }
733        
734        if (0) //disable for now for performance reasons
735 <      {
736 <        Met mmet = fMVAMet.GetMet(  false,
737 <                                  0.,0.,0.,
738 <                                  0.,0.,0.,
739 <                                  fPFMet->At(0),
740 <                                  &pfcands,firstvtx,fPV, fPileUpDen->At(0)->Rho(),
741 <                                  &pfjets,
742 <                                  int(fPV->GetEntries()),
743 <                                  kFALSE);      
744 <                                  
745 <        TMatrixD *metcov = fMVAMet.GetMetCovariance();
746 <        
747 <        ThreeVector fullmet(mmet.Px() - phHard->Px() - phSoft->Px(),
748 <                            mmet.Py() - phHard->Py() - phSoft->Py(),
749 <                            0.);
750 <        
751 <        ROOT::Math::SMatrix<double,2,2,ROOT::Math::MatRepSym<double,2> > mcov;
752 <        mcov(0,0) = (*metcov)(0,0);
753 <        mcov(0,1) = (*metcov)(0,1);
754 <        mcov(1,0) = (*metcov)(1,0);
755 <        mcov(1,1) = (*metcov)(1,1);
756 <        ROOT::Math::SVector<double,2> vmet;
757 <        vmet(0) = fullmet.X();
758 <        vmet(1) = fullmet.Y();
759 <        mcov.Invert();
760 <        Double_t metsig = sqrt(ROOT::Math::Similarity(mcov,vmet));
761 <                                  
762 <        fDiphotonEvent->mvametfirst = fullmet.Rho();
763 <        fDiphotonEvent->mvametfirstphi = fullmet.Phi();
764 <        fDiphotonEvent->mvametfirstx = fullmet.X();
765 <        fDiphotonEvent->mvametfirsty = fullmet.Y();
766 <        fDiphotonEvent->mvametfirstsig = metsig;
767 <      }      
735 >        {
736 >          Met mmet = fMVAMet.GetMet(  false,
737 >                                      0.,0.,0.,
738 >                                      0.,0.,0.,
739 >                                      fPFMet->At(0),
740 >                                      &pfcands,firstvtx,fPV, fPileUpDen->At(0)->Rho(),
741 >                                      &pfjets,
742 >                                      int(fPV->GetEntries()),
743 >                                      kFALSE);      
744 >          
745 >          TMatrixD *metcov = fMVAMet.GetMetCovariance();
746 >          
747 >          ThreeVector fullmet(mmet.Px() - phHard->Px() - phSoft->Px(),
748 >                              mmet.Py() - phHard->Py() - phSoft->Py(),
749 >                              0.);
750 >          
751 >          ROOT::Math::SMatrix<double,2,2,ROOT::Math::MatRepSym<double,2> > mcov;
752 >          mcov(0,0) = (*metcov)(0,0);
753 >          mcov(0,1) = (*metcov)(0,1);
754 >          mcov(1,0) = (*metcov)(1,0);
755 >          mcov(1,1) = (*metcov)(1,1);
756 >          ROOT::Math::SVector<double,2> vmet;
757 >          vmet(0) = fullmet.X();
758 >          vmet(1) = fullmet.Y();
759 >          mcov.Invert();
760 >          Double_t metsig = sqrt(ROOT::Math::Similarity(mcov,vmet));
761 >          
762 >          fDiphotonEvent->mvametfirst = fullmet.Rho();
763 >          fDiphotonEvent->mvametfirstphi = fullmet.Phi();
764 >          fDiphotonEvent->mvametfirstx = fullmet.X();
765 >          fDiphotonEvent->mvametfirsty = fullmet.Y();
766 >          fDiphotonEvent->mvametfirstsig = metsig;
767 >        }      
768        
769      }
770 <
770 >    
771  
772      fDiphotonEvent->corrpfmet = -99.;
773      fDiphotonEvent->corrpfmetphi = -99.;
# Line 694 | Line 829 | void PhotonTreeWriter::Process()
829      fDiphotonEvent->costhetaele =  _costhetaele;    
830      fDiphotonEvent->evtcat = _evtcat;
831  
832 <    fDiphotonEvent->photons[0].SetVars(phHard,conv1,ele1,pfsc1,phgen1,fPhfixph,fPhfixele,fTracks,fPV,fPFCands,rho,fFillClusterArrays,fElectrons,fConversions,bsp,fApplyElectronVeto);
833 <    fDiphotonEvent->photons[1].SetVars(phSoft,conv2,ele2,pfsc2,phgen2,fPhfixph,fPhfixele,fTracks,fPV,fPFCands,rho,fFillClusterArrays,fElectrons,fConversions,bsp,fApplyElectronVeto);
832 >    fDiphotonEvent->photons[0].SetVars(phHard,conv1,ele1,pfsc1,phgen1,fPhfixph,fPhfixele,fTracks,fPV,fPFCands,rho,fFillClusterArrays,fElectrons,fConversions,bsp,fApplyElectronVeto,realVtx);
833 >    fDiphotonEvent->photons[1].SetVars(phSoft,conv2,ele2,pfsc2,phgen2,fPhfixph,fPhfixele,fTracks,fPV,fPFCands,rho,fFillClusterArrays,fElectrons,fConversions,bsp,fApplyElectronVeto,realVtx);
834      
835      Float_t ph1ecor    = fDiphotonEvent->photons[0].Ecor();
836      Float_t ph1ecorerr = fDiphotonEvent->photons[0].Ecorerr();
# Line 720 | Line 855 | void PhotonTreeWriter::Process()
855      
856      //printf("r9 = %5f, photon sigieie = %5f, seed sigieie = %5f\n",phHard->R9(),
857      //       phHard->CoviEtaiEta(),sqrt(phHard->SCluster()->Seed()->CoviEtaiEta()));
858 <
858 >    
859      // MuonStuff
860      fDiphotonEvent-> muonPt  = -99.;
861      fDiphotonEvent-> muonEta  = -99.;
# Line 757 | Line 892 | void PhotonTreeWriter::Process()
892      fDiphotonEvent-> eleMass2 = -99.;
893      fDiphotonEvent-> eleNinnerHits = -99;    
894      
895 +    fDiphotonEvent-> eleIdMva = -99.;
896 +
897      if( fApplyLeptonTag ) {
898        // perform lepton tagging
899        // the diphoton event record will have one more entry; i.e. leptonTag
# Line 812 | Line 949 | void PhotonTreeWriter::Process()
949            fDiphotonEvent-> eleIso1 = (fLeptonTagElectrons->At(0)->TrackIsolationDr03() + fLeptonTagElectrons->At(0)->EcalRecHitIsoDr03() + fLeptonTagElectrons->At(0)->HcalTowerSumEtDr03() - fPileUpDen->At(0)->RhoRandomLowEta() * TMath::Pi() * 0.3 * 0.3)/fDiphotonEvent-> elePt;
950  
951            fDiphotonEvent-> eleIso2 = -99.;
952 +
953 +          if ( fDoSynching ) {
954 +            Double_t distVtx = 999.0;
955 +            Int_t closestVtx = 0;
956 +            for(UInt_t nv=0; nv<fPV->GetEntries(); nv++){
957 +              double dz = TMath::Abs(fLeptonTagElectrons->At(0)->GsfTrk()->DzCorrected(*fPV->At(nv)));
958 +              if(dz < distVtx) {
959 +                distVtx    = dz;
960 +                closestVtx = nv;
961 +              }
962 +            }
963 +            fDiphotonEvent-> eleIdMva = fElectronIDMVA->MVAValue(fLeptonTagElectrons->At(0), fPV->At(closestVtx));
964 +          }
965 +
966            //      fDiphotonEvent-> eleIso2 = ElectronTools::ElectronEffectiveArea(ElectronTools::kEleGammaIso03,fLeptonTagElectrons->At(0)->SCluster()->Eta(), ElectronTools::kEleEAData2012) + ElectronTools::ElectronEffectiveArea(ElectronTools::kEleNeutralHadronIso03, fLeptonTagElectrons->At(0)->SCluster()->Eta(), ElectronTools::kEleEAData2012) ;
967  
968            fDiphotonEvent-> eleIso3 = (fLeptonTagElectrons->At(0)->TrackIsolationDr03() + fLeptonTagElectrons->At(0)->EcalRecHitIsoDr03() + fLeptonTagElectrons->At(0)->HcalTowerSumEtDr03() - fPileUpDen->At(0)->RhoLowEta() * TMath::Pi() * 0.3 * 0.3)/fDiphotonEvent-> elePt;
# Line 947 | Line 1098 | void PhotonTreeWriter::SlaveBegin()
1098   //   ReqEventObject(fPFNoPileUpName,     fPFNoPileUpCands,    false);
1099   //   ReqEventObject(fPFPileUpName,     fPFPileUpCands,    false);
1100  
950
951
952
953
1101    ReqEventObject(fPhotonBranchName,fPhotons,      fPhotonsFromBranch);
1102    if (fEnablePFPhotons) ReqEventObject(fPFPhotonName,fPFPhotons,      true);
1103    ReqEventObject(fTrackBranchName, fTracks,       true);
# Line 959 | Line 1106 | void PhotonTreeWriter::SlaveBegin()
1106    ReqEventObject(fPileUpDenName,   fPileUpDen,    true);
1107    ReqEventObject(fPVName,          fPV,           fPVFromBranch);
1108    ReqEventObject(fConversionName,  fConversions,  true);
1109 +  if ( fDoSynching ) ReqEventObject(fPFConversionName,     fPFConversions,  true);
1110    ReqEventObject(fBeamspotName,    fBeamspot,     true);
1111    ReqEventObject(fPFCandName,      fPFCands,      true);
1112    ReqEventObject(fSuperClusterName,fSuperClusters,true);
# Line 1014 | Line 1162 | void PhotonTreeWriter::SlaveBegin()
1162  
1163    fMVAVBF.InitializeMVA();
1164                        
1165 +
1166 +  if( fDoSynching ) {
1167 +    fVtxTools.InitP(2);
1168 +    fElectronIDMVA = new ElectronIDMVA();
1169 +    fElectronIDMVA->Initialize("BDTG method",
1170 +                               fElectronMVAWeights_Subdet0Pt10To20,
1171 +                               fElectronMVAWeights_Subdet1Pt10To20,
1172 +                               fElectronMVAWeights_Subdet2Pt10To20,
1173 +                               fElectronMVAWeights_Subdet0Pt20ToInf,
1174 +                               fElectronMVAWeights_Subdet1Pt20ToInf,
1175 +                               fElectronMVAWeights_Subdet2Pt20ToInf,
1176 +                               ElectronIDMVA::kIDEGamma2012NonTrigV1,
1177 +                               fTheRhoType);
1178 +  }
1179 +
1180 +
1181    fDiphotonEvent = new PhotonTreeWriterDiphotonEvent;
1182    fSinglePhoton  = new PhotonTreeWriterPhoton<16>;
1183    
# Line 1184 | Line 1348 | void PhotonTreeWriterPhoton<NClus>::SetV
1348                                              const PFCandidateCol* fPFCands,
1349                                              Double_t rho,
1350                                              Bool_t fillclusterarrays,
1351 <                                            const ElectronCol* els, const DecayParticleCol *convs, const BaseVertex *bs, Bool_t applyElectronVeto) {
1351 >                                            const ElectronCol* els, const DecayParticleCol *convs, const BaseVertex *bs, Bool_t applyElectronVeto, const Vertex* realVtx) {
1352    
1353    const SuperCluster *s = 0;
1354    if (p)
# Line 1249 | Line 1413 | void PhotonTreeWriterPhoton<NClus>::SetV
1413      passeleveto = PhotonTools::PassElectronVetoConvRecovery(p, els, convs, bs);  
1414      
1415      const Vertex *vtx = vtxCol->At(0);
1416 <    if (p->HasPV()) vtx = p->PV();
1417 <    
1416 >    if (p->HasPV()) vtx = p->PV();    
1417 >    if ( realVtx ) vtx = realVtx;
1418 >
1419      UInt_t wVtxInd = 0;
1420      
1421      trackiso1 = IsolationTools::CiCTrackIsolation(p,vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0,
1422 <                                                      trackCol, NULL, NULL,
1423 <                                                      (!applyElectronVeto ? els : NULL) );
1424 <        //Question Ming:whyfPV->At(0) instead of selected vertex using ranking method?
1425 <      
1422 >                                                  trackCol, NULL, NULL,
1423 >                                                  (!applyElectronVeto ? els : NULL) );
1424 >    //Question Ming:whyfPV->At(0) instead of selected vertex using ranking method?
1425 >    
1426      // track iso worst vtx
1427      trackiso2 = IsolationTools::CiCTrackIsolation(p,vtx, 0.4, 0.02, 0.0, 0.0, 0.1, 1.0,
1428 <                                                      trackCol, &wVtxInd,vtxCol,
1429 <                                                      (!applyElectronVeto ? els : NULL) );
1428 >                                                  trackCol, &wVtxInd,vtxCol,
1429 >                                                  (!applyElectronVeto ? els : NULL) );
1430      combiso1 = ecalisodr03+hcalisodr04+trackiso1 - 0.17*rho;
1431      combiso2 = ecalisodr04+hcalisodr04+trackiso2 - 0.52*rho;  
1432 <
1433 <
1432 >    
1433 >    
1434      // -----------------------------------------------------
1435      // PF-CiC4 Debug Stuff
1436      std::vector<double> debugVals;
# Line 1298 | Line 1463 | void PhotonTreeWriterPhoton<NClus>::SetV
1463      idmva_s4ratio=p->S4Ratio();
1464      idmva_GammaIso=IsolationTools::PFGammaIsolation(p,0.3,0,fPFCands);
1465      idmva_ChargedIso_selvtx=IsolationTools::PFChargedIsolation(p,vtx,0.3,0.,fPFCands);
1466 +    idmva_ChargedIso_0p2_selvtx=IsolationTools::PFChargedIsolation(p,vtx,0.2,0.,fPFCands);
1467      idmva_ChargedIso_worstvtx=IsolationTools::PFChargedIsolation(p,vtx,0.3,0.,fPFCands,&wVtxInd,vtxCol);
1468      idmva_PsEffWidthSigmaRR=p->EffSigmaRR();
1469    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines