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

Comparing UserCode/MitPhysics/Utils/src/MuonTools.cc (file contents):
Revision 1.9 by loizides, Tue Apr 7 15:37:10 2009 UTC vs.
Revision 1.11 by ceballos, Thu Jun 17 13:25:54 2010 UTC

# Line 3 | Line 3
3   #include "MitPhysics/Utils/interface/MuonTools.h"
4   #include <TFile.h>
5  
6 + ClassImp(mithep::MuonTools)
7 +
8   using namespace mithep;
9  
10   //--------------------------------------------------------------------------------------------------
# Line 426 | Line 428 | TH2D *MuonTools::LoadHisto(const char *n
428    ret->SetDirectory(0);
429    return ret;
430   }
431 + //--------------------------------------------------------------------------------------------------
432 + Bool_t MuonTools::PassD0Cut(const Muon *mu, const VertexCol *vertices, Double_t fD0Cut,
433 +                            Bool_t fReverseD0Cut)
434 + {
435 +  Bool_t d0cut = kFALSE;
436 +  const Track *mt = mu->BestTrk();
437 +  if (!mt) return kFALSE;
438 +
439 +  Double_t d0_real = 1e30;
440 +  for(UInt_t i0 = 0; i0 < vertices->GetEntries(); i0++) {
441 +    if(vertices->At(i0)->NTracks() > 0){
442 +      Double_t pD0 = mt->D0Corrected(*vertices->At(i0));
443 +      d0_real = TMath::Abs(pD0);
444 +      break;
445 +    }
446 +  }
447 +  if(d0_real < fD0Cut) d0cut = kTRUE;
448 +
449 +  if     (fReverseD0Cut == kTRUE &&
450 +          d0cut == kFALSE && d0_real < 0.05)
451 +    d0cut = kTRUE;
452 +  else if(fReverseD0Cut == kTRUE)
453 +    d0cut = kFALSE;
454 +  
455 +  return d0cut;
456 + }
457 +
458 + //--------------------------------------------------------------------------------------------------
459 + Bool_t MuonTools::PassD0Cut(const Muon *mu, const BeamSpotCol *beamspots, Double_t fD0Cut,
460 +                                Bool_t fReverseD0Cut)
461 + {
462 +  Bool_t d0cut = kFALSE;
463 +  const Track *mt = mu->BestTrk();
464 +  if (!mt) return kFALSE;
465 +
466 +  // d0 cut
467 +  Double_t d0_real = 99999;
468 +  for(UInt_t i0 = 0; i0 < beamspots->GetEntries(); i0++) {
469 +    Double_t pD0 = mt->D0Corrected(*beamspots->At(i0));
470 +    if(TMath::Abs(pD0) < TMath::Abs(d0_real)) d0_real = TMath::Abs(pD0);
471 +  }
472 +  if(d0_real < fD0Cut) d0cut = kTRUE;
473 +  
474 +  if     (fReverseD0Cut == kTRUE &&
475 +          d0cut == kFALSE && d0_real < 0.05)
476 +    d0cut = kTRUE;
477 +  else if(fReverseD0Cut == kTRUE)
478 +    d0cut = kFALSE;
479 +  
480 +  return d0cut;
481 + }
482  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines