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.7 by bendavid, Sat Dec 17 20:00:40 2011 UTC vs.
Revision 1.8 by bendavid, Sat Dec 17 22:29:30 2011 UTC

# Line 279 | Line 279 | void PhotonTreeWriter::Process()
279      if (fEnableJets) {
280        for (UInt_t ijet=0; ijet<fPFJets->GetEntries();++ijet) {
281          const Jet *jet = fPFJets->At(ijet);
282 <        if (jet->AbsEta()<4.7 && MathUtils::DeltaR(jet,p1)>0.3 && MathUtils::DeltaR(jet,p2)>0.3) {
282 >        if (jet->AbsEta()<4.7 && MathUtils::DeltaR(jet,p1)>0.5 && MathUtils::DeltaR(jet,p2)>0.5) {
283            if (!jet1) jet1 = jet;
284            else if (!jet2) jet2 = jet;
285            else if (!jetcentral && 0) jetcentral = jet;
# Line 397 | Line 397 | void PhotonTreeWriter::Process()
397      fDiphotonEvent->costhetaele =  _costhetaele;    
398      fDiphotonEvent->evtcat = _evtcat;
399  
400 <    fDiphotonEvent->photons[0].SetVars(phHard,conv1,ele1,pfsc1,phgen1,fPhfixph,fPhfixele);
401 <    fDiphotonEvent->photons[1].SetVars(phSoft,conv2,ele2,pfsc2,phgen2,fPhfixph,fPhfixele);
400 >    fDiphotonEvent->photons[0].SetVars(phHard,conv1,ele1,pfsc1,phgen1,fPhfixph,fPhfixele,fTracks,fPV,_tRho,fElectrons,fApplyElectronVeto);
401 >    fDiphotonEvent->photons[1].SetVars(phSoft,conv2,ele2,pfsc2,phgen2,fPhfixph,fPhfixele,fTracks,fPV,_tRho,fElectrons,fApplyElectronVeto);
402      
403      Float_t ph1ecor    = fDiphotonEvent->photons[0].Ecor();
404      Float_t ph1ecorerr = fDiphotonEvent->photons[0].Ecorerr();
# Line 476 | Line 476 | void PhotonTreeWriter::Process()
476        fDiphotonEvent->mtele = TMath::Sqrt(2.0*fPFMet->At(0)->Pt()*ele->Pt()*(1.0-fDiphotonEvent->cosphimetele));      
477      }
478      
479 <    fSinglePhoton->SetVars(ph,conv,ele,pfsc,phgen,fPhfixph,fPhfixele);
479 >    fSinglePhoton->SetVars(ph,conv,ele,pfsc,phgen,fPhfixph,fPhfixele,fTracks,fPV,_tRho,fElectrons,fApplyElectronVeto);
480      hCiCTupleSingle->Fill();
481      
482    }
# Line 637 | Line 637 | Float_t PhotonTreeWriter::GetEventCat(Ph
637    return ( ph1IsHR9 && ph2IsHR9 ? 2. : 3.);
638   }
639  
640 < void PhotonTreeWriterPhoton::SetVars(const Photon *p, const DecayParticle *c, const Electron *ele, const SuperCluster *pfsc, const MCParticle *m, PhotonFix &phfixph, PhotonFix &phfixele) {
640 > void PhotonTreeWriterPhoton::SetVars(const Photon *p, const DecayParticle *c, const Electron *ele, const SuperCluster *pfsc, const MCParticle *m, PhotonFix &phfixph, PhotonFix &phfixele, const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho, const ElectronCol* els, Bool_t applyElectronVeto) {
641    
642        const SuperCluster *s = 0;
643        if (p) {
# Line 695 | Line 695 | void PhotonTreeWriterPhoton::SetVars(con
695          esmearing = p->EnergySmearing();
696          idmva = p->IdMva();
697          hcalisodr03 = p->HcalTowerSumEtDr03();
698 <        ecalisodr03 = p->EcalRecHitIsoDr03();
698 >        ecalisodr03 = p->EcalRecHitIsoDr03();        
699          trkisohollowdr03 = p->HollowConeTrkIsoDr03();
700 +        hcalisodr04 = p->HcalTowerSumEtDr04();
701 +        ecalisodr04 = p->EcalRecHitIsoDr04();        
702 +        trkisohollowdr04 = p->HollowConeTrkIsoDr04();
703 +        
704 +        
705 +        const Vertex *vtx = vtxCol->At(0);
706 +        if (p->HasPV()) vtx = p->PV();
707 +        
708 +        UInt_t wVtxInd = 0;
709 +        
710 +        trackiso1 = IsolationTools::CiCTrackIsolation(p,vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, NULL, NULL, (!applyElectronVeto ? els : NULL) );//Question Ming:whyfPV->At(0) instead of selected vertex using ranking method?
711 +          
712 +        // track iso worst vtx
713 +        trackiso2 = IsolationTools::CiCTrackIsolation(p,vtx, 0.4, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, &wVtxInd,vtxCol, (!applyElectronVeto ? els : NULL) );
714 +        
715 +        combiso1 = ecalisodr03+hcalisodr04+trackiso1 - 0.17*_tRho;
716 +        combiso2 = ecalisodr04+hcalisodr04+trackiso2 - 0.52*_tRho;        
717 +        
718        }
719        else {
720          hasphoton = kFALSE;
# Line 714 | Line 732 | void PhotonTreeWriterPhoton::SetVars(con
732          eerrsmeared = -99.;
733          esmearing = 0.;
734          idmva = -99.;
735 +        hcalisodr03 = -99;
736 +        ecalisodr03 = -99;
737 +        trkisohollowdr03 = -99;
738 +        hcalisodr04 = -99;
739 +        ecalisodr04 = -99;
740 +        trkisohollowdr04 = -99;        
741 +        trackiso1 = -99.;
742 +        trackiso2 = -99.;
743 +        combiso1 = -99.;
744 +        combiso2 = -99.;
745 +        
746 +        
747 +        
748        }
749        
750        

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines