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.8 by loizides, Mon Mar 23 14:48:08 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 91 | Line 93 | void MuonTools::DeleteHistos()
93   Double_t MuonTools::GetCaloCompatability(const Muon *iMuon,
94                                           Bool_t iEMSpecial, Bool_t iCorrectedHCAL) const
95   {
96 <  // Get calo compatibility value for given muon.
96 >  // Get calo compatibility value for given muon based on calorimeter templates.
97 >  // If iEMSpecial is true, then a use different arrangement of ECAL for compatibility.
98  
99    Double_t lEta = iMuon->Eta();
100    Double_t aEta = TMath::Abs(lEta);
# Line 313 | Line 316 | Bool_t MuonTools::IsGood(const mithep::M
316   //--------------------------------------------------------------------------------------------------
317   Double_t MuonTools::GetSegmentCompatability(const mithep::Muon *iMuon) const
318   {
319 <  // Get segment compatability for given muon.
319 >  // Get segment compatability for given muon based on likelihood of well defined
320 >  // track through chambers.
321  
322    Int_t lNStationsCrossed = 0;
323    Int_t lNStationsSegment = 0;
# Line 424 | 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