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.73 by degrutto, Wed May 16 15:13:51 2012 UTC vs.
Revision 1.77 by dlopes, Mon Aug 27 21:34:22 2012 UTC

# Line 206 | Line 206 | HbbAnalyzerNew::produce(edm::Event& iEve
206    edm::Handle<double> rho25Handle;
207    iEvent.getByLabel(edm::InputTag("kt6PFJets25", "rho"),rho25Handle);  
208    auxInfo->puInfo.rho25 = *rho25Handle;
209 +  edm::Handle<double> rho25HandleIso;
210 +  iEvent.getByLabel(edm::InputTag("kt6PFJetsForIsolation", "rho"),rho25HandleIso);  
211 +  auxInfo->puInfo.rho25Iso = *rho25HandleIso;
212  
213    edm::Handle<double> rhoNeutralHandle;
214    iEvent.getByLabel(edm::InputTag("kt6PFJetsCentralNeutral", "rho"),rhoNeutralHandle);  
# Line 221 | Line 224 | HbbAnalyzerNew::produce(edm::Event& iEve
224        std::vector< PileupSummaryInfo> pu = (*puHandle);
225        for (std::vector<PileupSummaryInfo>::const_iterator it= pu.begin(); it!=pu.end(); ++it){
226           int bx = (*it).getBunchCrossing();
227 +         if(bx == 0) { auxInfo->puInfo.truePU = (*it).getTrueNumInteractions();}
228          unsigned int num = (*it).getPU_NumInteractions();
229          //      std::cout <<" PU PUSHING "<<bx<<" " <<num<<std::endl;
230          auxInfo->puInfo.pus[bx]  =num;
# Line 387 | Line 391 | HbbAnalyzerNew::produce(edm::Event& iEve
391  
392    /////// end generator block    
393  
394 + /// photon used in isolation
395 +  edm::Handle<edm::View<reco::PFCandidate> > photonIsoH;
396 +  iEvent.getByLabel("pfAllPhotons",photonIsoH);
397 +  edm::View<reco::PFCandidate> photonsForIso = *photonIsoH;
398  
399    edm::Handle<edm::View<pat::Muon> > muonHandle;
400    iEvent.getByLabel(muoLabel_,muonHandle);
# Line 921 | Line 929 | BTagSFContainer btagSFs;
929      //  if(!runOnMC_)  
930      setJecUnc(fj,jecUnc);
931  
932 +    if(runOnMC_){
933 +
934 +      //BTV scale factors
935 +     // fillScaleFactors(sj, btagSFs);
936 +
937 +      //PAT genJet matching
938 +      //genJet
939 +      const reco::GenJet *gJ = filterjet_iter->genJet();
940 +      //physical parton for mother info ONLY
941 +      if( (filterjet_iter->genParton()) ){
942 +        fj.bestMCid = filterjet_iter->genParton()->pdgId();
943 +        if( (filterjet_iter->genParton()->mother()) )
944 +          fj.bestMCmomid=filterjet_iter->genParton()->mother()->pdgId();
945 +      }
946 +      TLorentzVector gJp4;
947 +      if(gJ){
948 +        gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy());
949 +        fj.bestMCp4 = gJp4;
950 +        if(verbose_){
951 +          std::clog << "filter genJet matched Pt = " << gJp4.Pt() << std::endl;
952 +          std::clog << "filter genJet matched eta = " << gJp4.Eta() << std::endl;
953 +          std::clog << "filter genJet matched deltaR = " << gJp4.DeltaR(fj.p4) << std::endl;
954 +          std::clog << "filter genJet matched mother id = " << fj.bestMCmomid << std::endl;
955 +        }
956 +      }
957 +    }
958 +
959      hbbInfo->filterJets.push_back(fj);
960      
961  
# Line 1357 | Line 1392 | BTagSFContainer btagSFs;
1392    }
1393    
1394    edm::Handle<edm::View<pat::MET> > metPFHandle;
1395 <  iEvent.getByLabel("patMETs",metPFHandle);
1395 >  iEvent.getByLabel("patMETsPFlow",metPFHandle);
1396    edm::View<pat::MET> metsPF = *metPFHandle;
1397    
1398    if(metsPF.size()){
# Line 1495 | Line 1530 | BTagSFContainer btagSFs;
1530      ef.pfChaIso=elec->chargedHadronIso();
1531      ef.pfChaPUIso=elec->puChargedHadronIso();//userIso(5);
1532      ef.pfPhoIso=elec->photonIso();
1533 +    ef.pfPhoIsoDoubleCounted=0;
1534 +
1535 + /* Check if there are photons sharing the super cluster*/
1536 +    for(size_t k=0;k<photonsForIso.size();k++) {
1537 +       if(deltaR(elec->eta(),elec->phi(),photonsForIso[k].eta(),photonsForIso[k].phi()) < 0.05 && abs(photonsForIso[k].pt()-elec->pt())/(photonsForIso[k].pt()+elec->pt()) < 0.05 ) {
1538 +          std::cout << "Double counting of supercluster!" << std::endl;
1539 +          ef.pfPhoIsoDoubleCounted+=photonsForIso[k].pt();
1540 +     }
1541 +    }
1542      ef.pfNeuIso=elec->neutralHadronIso();
1543  
1544      //
# Line 1515 | Line 1559 | BTagSFContainer btagSFs;
1559      ef.HoE = elec->hadronicOverEm();
1560      ef.convDist = elec->convDist();
1561      ef.convDcot = elec->convDcot();
1562 <    if(elec->gsfTrack().isNonnull()) ef.innerHits = elec->gsfTrack()->trackerExpectedHitsInner().numberOfHits();  
1562 >    if(elec->gsfTrack().isNonnull())
1563 >    {
1564 >     ef.innerHits = elec->gsfTrack()->trackerExpectedHitsInner().numberOfHits();  
1565 >    }
1566      ef.isEB = elec->isEB();
1567      ef.isEE = elec->isEE();
1568   /* 2012 ELEID*/

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines