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

Comparing UserCode/MitPhysics/SelMods/src/HwwExampleAnalysisMod.cc (file contents):
Revision 1.19 by ceballos, Tue Oct 11 13:43:24 2011 UTC vs.
Revision 1.20 by ceballos, Thu Oct 20 19:21:56 2011 UTC

# Line 31 | Line 31 | HwwExampleAnalysisMod::HwwExampleAnalysi
31    fMet(0),
32    fVertices(0),
33    fPFCandidates(0),
34 +  fPFJetName0("AKt5PFJets"),
35 +  fPFJet0(0),
36    fNEventsSelected(0)
37   {
38    // Constructor.
# Line 53 | Line 55 | void HwwExampleAnalysisMod::SlaveBegin()
55    // Load Branches
56    ReqBranch(fMuonBranchName,   fMuons);
57    ReqBranch(fPFCandidatesName, fPFCandidates);
58 +  ReqBranch(fPFJetName0,       fPFJet0);
59  
60    //Create your histograms here
61  
# Line 128 | Line 131 | void HwwExampleAnalysisMod::Process()
131    // Process entries of the tree. For this module, we just load the branches and  
132    LoadBranch(fMuonBranchName);
133    LoadBranch(fPFCandidatesName);
134 +  LoadBranch(fPFJetName0);
135  
136    //Obtain all the good objects from the event cleaning module
137    fVertices = GetObjThisEvt<VertexOArr>(fVertexName);
# Line 170 | Line 174 | void HwwExampleAnalysisMod::Process()
174    ObjArray<Muon> *SoftMuons = new ObjArray<Muon>;
175    for (UInt_t i=0; i<fMuons->GetEntries(); ++i) {
176      const Muon *mu = fMuons->At(i);
177 <    if(!MuonTools::PassSoftMuonCut(mu, fVertices, 0.1)) continue;
177 >    if(!MuonTools::PassSoftMuonCut(mu, fVertices, 0.2)) continue;
178      
179      bool isCleanMuon = kFALSE;
180      for (UInt_t j=0; j<CleanMuons->GetEntries(); j++) {
# Line 296 | Line 300 | void HwwExampleAnalysisMod::Process()
300      }
301    }
302    double maxBtag = -99999.;
299  double imaxBtag = -1;
303    for(UInt_t i=0; i<sortedJetsLowPt.size(); i++){
304      if(sortedJetsLowPt[i]->TrackCountingHighEffBJetTagsDisc() > maxBtag){
305 <      maxBtag  = sortedJetsLowPt[i]->TrackCountingHighEffBJetTagsDisc();
306 <      imaxBtag = i;
305 >      double dZAverageJetPt = 0.0;
306 >      double sumJetPt = 0.0;
307 >      double jetPt = 0.0;
308 >      for(UInt_t iPF=0; iPF<fPFJet0->GetEntries(); iPF++){                                                            
309 >        const PFJet *jet = fPFJet0->At(iPF);                                                                    
310 >        if(MathUtils::DeltaR(jet->Mom(),sortedJetsLowPt[i]->Mom()) < 0.01){
311 >          jetPt = jet->Pt();
312 >          for (UInt_t npf=0; npf<jet->NPFCands();npf++) {
313 >            const PFCandidate *pf = jet->PFCand(npf);
314 >            if(pf->BestTrk()) {
315 >              dZAverageJetPt = dZAverageJetPt + pf->Pt()*pf->Pt()*pf->BestTrk()->DzCorrected(*fVertices->At(0));
316 >              sumJetPt = sumJetPt + pf->Pt()*pf->Pt();
317 >            }
318 >          }
319 >          if(sumJetPt > 0) dZAverageJetPt = TMath::Abs(dZAverageJetPt)/sumJetPt;
320 >          break;
321 >        }
322 >      } // loop over PF jets
323 >      if(dZAverageJetPt < 2.0 && jetPt > 10){
324 >        maxBtag  = sortedJetsLowPt[i]->TrackCountingHighEffBJetTagsDisc();
325 >      }
326      }
327    }
328  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines