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

Comparing UserCode/MitPhysics/Utils/interface/MuonTools.h (file contents):
Revision 1.4 by loizides, Fri Nov 28 09:13:35 2008 UTC vs.
Revision 1.20 by sixie, Sat Dec 31 23:18:39 2011 UTC

# Line 15 | Line 15
15   // Authors: P.Harris, C.Loizides
16   //--------------------------------------------------------------------------------------------------
17  
18 < #ifndef MITPHYSICS_UTIL_MUONTOOLS_H
19 < #define MITPHYSICS_UTIL_MUONTOOLS_H
18 > #ifndef MITPHYSICS_UTILS_MUONTOOLS_H
19 > #define MITPHYSICS_UTILS_MUONTOOLS_H
20  
21   #include "MitAna/DataTree/interface/Muon.h"
22 + #include "MitAna/DataTree/interface/VertexCol.h"
23 + #include "MitAna/DataTree/interface/BeamSpotCol.h"
24   #include "MitCommon/MathTools/interface/MathUtils.h"
25   #include "TH2D.h"
26  
# Line 27 | Line 29 | namespace mithep {
29      public:
30        MuonTools(const char *mutemp="$CMSSW_BASE/src/MitPhysics/data/MuonCaloTemplate.root",
31                  const char *pitemp="$CMSSW_BASE/src/MitPhysics/data/PionCaloTemplate.root");
32 <      ~MuonTools();
32 >      virtual ~MuonTools();
33  
34        enum ESelType {
35 <        kAllArbitrated,          // todo by phil
36 <        kPromptTight,            //
37 <        kTMLastStationLoose,     //
38 <        kTMLastStationTight,     //
39 <        kTMOneStationLoose,      //
40 <        kTMOneStationTight,      //
41 <        kTM2DCompatibilityLoose, //
42 <        kTM2DCompatibilityTight  //
35 >        kAllArbitrated,          //All arbitration (DT/CSC/RPC Hits) put on at least one
36 >                                 //  segments given a global Muon
37 >        kPromptTight,            //Standard global muon identification
38 >        kTMLastStationLoose,     //Loose matching requirements on lastmost muon station of reco
39 >        kTMLastStationTight,     //Tight matching requirements on lastmost muon station of reco
40 >        kTMOneStationLoose,      //Loose matching requirements on at least one muon station of reco
41 >        kTMOneStationTight,      //Tight matching requirements on at least one muon station of reco
42 >        kTM2DCompatibilityLoose, //Loose requirement on sum of compatabiliity variables
43 >                                 //  ===> 1.2 Segment compatability + 0.8 calo compatability > 0.8
44 >        kTM2DCompatibilityTight  //Tight requirement on sum of compatabiliity variables
45 >                                 //  ===> 1.2 Segment compatability + 0.8 calo compatability > 1.2
46        };
47  
48 <      Bool_t      Init(const char *mutemp, const char *pitemp);
49 <      Bool_t      IsGood(const mithep::Muon *iMuon, ESelType iSel) const;
48 >      enum EMuonEffectiveAreaType {
49 >        kMuChargedIso03,
50 >        kMuNeutralIso03,
51 >        kMuChargedIso04,
52 >        kMuNeutralIso04,
53 >        kMuHadEnergy,
54 >        kMuHoEnergy,
55 >        kMuEmEnergy,
56 >        kMuHadS9Energy,
57 >        kMuHoS9Energy,
58 >        kMuEmS9Energy
59 >      };
60 >
61 >      Bool_t          Init(const char *mutemp, const char *pitemp);
62 >      Bool_t          IsGood(const mithep::Muon *iMuon, ESelType iSel) const;
63 >      Double_t        GetCaloCompatability(const mithep::Muon *iMuon,
64 >                                         Bool_t iEMSpecial, Bool_t iCorrectedHCAL) const;
65 >      Double_t        GetSegmentCompatability(const mithep::Muon *iMuon)             const;
66 >      static Bool_t   PassD0Cut(const Muon *mu, const VertexCol *vertices, Double_t fD0Cut, Int_t nVertex = 0);
67 >      static Bool_t   PassD0Cut(const Muon *mu, const BeamSpotCol *beamspots, Double_t fD0Cut);
68 >      static Bool_t   PassDZCut(const Muon *mu, const VertexCol *vertices, Double_t fDZCut, Int_t nVertex = 0);
69 >      static Bool_t   PassSoftMuonCut(const Muon *mu, const VertexCol *vertices, const Double_t fDZCut = 0.2,
70 >                                    const Bool_t applyIso = kTRUE);
71 >      static Double_t MuonEffectiveArea(EMuonEffectiveAreaType type, Double_t Eta);
72  
73      protected:
74        void        DeleteHistos();
75 <      Double_t    GetCaloCompatability(const mithep::Muon *iMuon,
76 <                                       Bool_t iEMSpecial, Bool_t iCorrectedHCAL) const;
77 <      Double_t    GetSegmentCompatability(const mithep::Muon *iMuon)             const;
51 <      Bool_t      Overflow(const TH2D *iHist, Double_t lVal0, Double_t lVal1)    const;
52 <      Double_t    SigWeight(Double_t iVal0, Double_t iVal1)                      const;
53 <
75 >      Bool_t      Overflow(const TH2D *iHist, Double_t lVal0, Double_t lVal1)    const;
76 >      Double_t    SigWeight(Double_t iVal0, Double_t iVal1)                      const;
77 >  
78      private:
79        Bool_t      fIsInit;              //!=true if histograms are loaded
80 <      TH2D       *fmuon_em_etaEmi;      //!todo by phil
81 <      TH2D       *fmuon_had_etaEmi;     //!
82 <      TH2D       *fmuon_had_etaTmi;     //!
83 <      TH2D       *fmuon_em_etaB;        //!
84 <      TH2D       *fmuon_had_etaB;       //!
85 <      TH2D       *fmuon_ho_etaB;        //!
86 <      TH2D       *fmuon_had_etaTpl;     //!
87 <      TH2D       *fmuon_em_etaEpl;      //!
88 <      TH2D       *fmuon_had_etaEpl;     //!
89 <      TH2D       *fpion_em_etaEmi;      //!
90 <      TH2D       *fpion_had_etaEmi;     //!
91 <      TH2D       *fpion_had_etaTmi;     //!
92 <      TH2D       *fpion_em_etaB;        //!
93 <      TH2D       *fpion_had_etaB;       //!
94 <      TH2D       *fpion_ho_etaB;        //!
95 <      TH2D       *fpion_had_etaTpl;     //!
96 <      TH2D       *fpion_em_etaEpl;      //!
97 <      TH2D       *fpion_had_etaEpl;     //!
80 >      TH2D       *fmuon_em_etaEmi;      //!Neg Endcap EM       Calo Deposit Template for Muons
81 >      TH2D       *fmuon_had_etaEmi;     //!Neg Endcap Hadronic Calo Deposit Template for Muons
82 >      TH2D       *fmuon_had_etaTmi;     //!Neg Transition Hadronic Calo Deposit Template for Muons
83 >      TH2D       *fmuon_em_etaB;        //!Barrel EM       Calo Deposit Template for Muons
84 >      TH2D       *fmuon_had_etaB;       //!Barrel Hadronic Calo Deposit Template for Muons
85 >      TH2D       *fmuon_ho_etaB;        //!Barrel HO       Calo Deposit Template for Muons
86 >      TH2D       *fmuon_had_etaTpl;     //!Plus Transition Hadronic Calo Deposit Template for Muons
87 >      TH2D       *fmuon_em_etaEpl;      //!Plus Endcap EM       Calo Deposit Template for Muons
88 >      TH2D       *fmuon_had_etaEpl;     //!Plus Endcap Hadronic Calo Deposit Template for Muons
89 >      TH2D       *fpion_em_etaEmi;      //!Neg  Endcap EM       Calo Deposit Template for Pions
90 >      TH2D       *fpion_had_etaEmi;     //!Neg  Endcap Hadronic Calo Deposit Template for Pions
91 >      TH2D       *fpion_had_etaTmi;     //!Neg Transition Hadronic Calo Deposit Template for Pions
92 >      TH2D       *fpion_em_etaB;        //!Barrel EM       Calo Deposit Template for Pions
93 >      TH2D       *fpion_had_etaB;       //!Barrel Hadronic Calo Deposit Template for Pions
94 >      TH2D       *fpion_ho_etaB;        //!Barrel HO       Calo Deposit Template for Pions
95 >      TH2D       *fpion_had_etaTpl;     //!Plus Transition Hadronic Calo Deposit Template for Pions
96 >      TH2D       *fpion_em_etaEpl;      //!Plus Endcap EM       Calo Deposit Template for Pions
97 >      TH2D       *fpion_had_etaEpl;     //!Plus Endcap Hadronic Calo Deposit Template for Pions
98  
99        TH2D       *LoadHisto(const char *fname, TFile *file)                      const;
100 +
101 +    ClassDef(MuonTools, 0) // Muon tools
102    };
103   }
104  
105   //--------------------------------------------------------------------------------------------------
106   inline Double_t mithep::MuonTools::SigWeight(Double_t iVal0, Double_t iVal1) const
107   {
108 <  // todo
108 >  // Returns weighted uncertainty given segment matching uncertainty (iVal0) and
109 >  // segment matching pull (iVal1).
110  
111 <  if (iVal1 < 1.)
111 >  if (iVal1 < 1.)  //if pull defined and within range
112      return 1.;
113 <  if (iVal0 < 3. && iVal1 > 3.) {
113 >  if (iVal0 < 3. && iVal1 > 3.) {       //if pull not well defined and uncertainty defined
114      Double_t lVal = TMath::Max(iVal0,1.);
115      return 1./TMath::Power(lVal,0.25);
116    }
117  
118 <  Double_t lVal = TMath::Max(iVal1,1.);
118 >  Double_t lVal = TMath::Max(iVal1,1.); //if pull > 1 and pull < 3 return 1/pull^4
119    return 1./TMath::Power(lVal,0.25);
120   }
94
121   //--------------------------------------------------------------------------------------------------
122   inline Bool_t mithep::MuonTools::Overflow(const TH2D *iHist, Double_t lVal0, Double_t lVal1) const
123   {
# Line 102 | Line 128 | inline Bool_t mithep::MuonTools::Overflo
128  
129    if (iHist ->GetXaxis()->FindBin(lVal0) == 0                  ||
130        iHist ->GetXaxis()->FindBin(lVal0) >  iHist->GetNbinsX() ||
131 <      iHist ->GetYaxis()->FindBin(lVal0) == 0                  ||
132 <      iHist ->GetYaxis()->FindBin(lVal0) >  iHist->GetNbinsY()) {
131 >      iHist ->GetYaxis()->FindBin(lVal1) == 0                  ||
132 >      iHist ->GetYaxis()->FindBin(lVal1) >  iHist->GetNbinsY()) {
133      return kTRUE;
134    }
135    return kFALSE;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines