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/Collections.h" |
23 |
|
#include "MitCommon/MathTools/interface/MathUtils.h" |
24 |
|
#include "TH2D.h" |
25 |
|
|
31 |
|
~MuonTools(); |
32 |
|
|
33 |
|
enum ESelType { |
34 |
< |
kAllArbitrated, // todo by phil |
35 |
< |
kPromptTight, // |
36 |
< |
kTMLastStationLoose, // |
37 |
< |
kTMLastStationTight, // |
38 |
< |
kTMOneStationLoose, // |
39 |
< |
kTMOneStationTight, // |
40 |
< |
kTM2DCompatibilityLoose, // |
41 |
< |
kTM2DCompatibilityTight // |
34 |
> |
kAllArbitrated, //All arbitration (DT/CSC/RPC Hits) put on at least one |
35 |
> |
// segments given a global Muon |
36 |
> |
kPromptTight, //Standard global muon identification |
37 |
> |
kTMLastStationLoose, //Loose matching requirements on lastmost muon station of reco |
38 |
> |
kTMLastStationTight, //Tight matching requirements on lastmost muon station of reco |
39 |
> |
kTMOneStationLoose, //Loose matching requirements on at least one muon station of reco |
40 |
> |
kTMOneStationTight, //Tight matching requirements on at least one muon station of reco |
41 |
> |
kTM2DCompatibilityLoose, //Loose requirement on sum of compatabiliity variables |
42 |
> |
// ===> 1.2 Segment compatability + 0.8 calo compatability > 0.8 |
43 |
> |
kTM2DCompatibilityTight //Tight requirement on sum of compatabiliity variables |
44 |
> |
// ===> 1.2 Segment compatability + 0.8 calo compatability > 1.2 |
45 |
|
}; |
46 |
|
|
47 |
|
Bool_t Init(const char *mutemp, const char *pitemp); |
48 |
|
Bool_t IsGood(const mithep::Muon *iMuon, ESelType iSel) const; |
49 |
+ |
Double_t GetCaloCompatability(const mithep::Muon *iMuon, |
50 |
+ |
Bool_t iEMSpecial, Bool_t iCorrectedHCAL) const; |
51 |
+ |
Double_t GetSegmentCompatability(const mithep::Muon *iMuon) const; |
52 |
|
|
53 |
|
protected: |
54 |
|
void DeleteHistos(); |
55 |
< |
Double_t GetCaloCompatability(const mithep::Muon *iMuon, |
56 |
< |
Bool_t iEMSpecial, Bool_t iCorrectedHCAL) const; |
57 |
< |
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 |
< |
|
55 |
> |
Bool_t Overflow(const TH2D *iHist, Double_t lVal0, Double_t lVal1) const; |
56 |
> |
Double_t SigWeight(Double_t iVal0, Double_t iVal1) const; |
57 |
> |
|
58 |
|
private: |
59 |
|
Bool_t fIsInit; //!=true if histograms are loaded |
60 |
< |
TH2D *fmuon_em_etaEmi; //!todo by phil |
61 |
< |
TH2D *fmuon_had_etaEmi; //! |
62 |
< |
TH2D *fmuon_had_etaTmi; //! |
63 |
< |
TH2D *fmuon_em_etaB; //! |
64 |
< |
TH2D *fmuon_had_etaB; //! |
65 |
< |
TH2D *fmuon_ho_etaB; //! |
66 |
< |
TH2D *fmuon_had_etaTpl; //! |
67 |
< |
TH2D *fmuon_em_etaEpl; //! |
68 |
< |
TH2D *fmuon_had_etaEpl; //! |
69 |
< |
TH2D *fpion_em_etaEmi; //! |
70 |
< |
TH2D *fpion_had_etaEmi; //! |
71 |
< |
TH2D *fpion_had_etaTmi; //! |
72 |
< |
TH2D *fpion_em_etaB; //! |
73 |
< |
TH2D *fpion_had_etaB; //! |
74 |
< |
TH2D *fpion_ho_etaB; //! |
75 |
< |
TH2D *fpion_had_etaTpl; //! |
76 |
< |
TH2D *fpion_em_etaEpl; //! |
77 |
< |
TH2D *fpion_had_etaEpl; //! |
60 |
> |
TH2D *fmuon_em_etaEmi; //!Neg Endcap EM Calo Deposit Template for Muons |
61 |
> |
TH2D *fmuon_had_etaEmi; //!Neg Endcap Hadronic Calo Deposit Template for Muons |
62 |
> |
TH2D *fmuon_had_etaTmi; //!Neg Transition Hadronic Calo Deposit Template for Muons |
63 |
> |
TH2D *fmuon_em_etaB; //!Barrel EM Calo Deposit Template for Muons |
64 |
> |
TH2D *fmuon_had_etaB; //!Barrel Hadronic Calo Deposit Template for Muons |
65 |
> |
TH2D *fmuon_ho_etaB; //!Barrel HO Calo Deposit Template for Muons |
66 |
> |
TH2D *fmuon_had_etaTpl; //!Plus Transition Hadronic Calo Deposit Template for Muons |
67 |
> |
TH2D *fmuon_em_etaEpl; //!Plus Endcap EM Calo Deposit Template for Muons |
68 |
> |
TH2D *fmuon_had_etaEpl; //!Plus Endcap Hadronic Calo Deposit Template for Muons |
69 |
> |
TH2D *fpion_em_etaEmi; //!Neg Endcap EM Calo Deposit Template for Pions |
70 |
> |
TH2D *fpion_had_etaEmi; //!Neg Endcap Hadronic Calo Deposit Template for Pions |
71 |
> |
TH2D *fpion_had_etaTmi; //!Neg Transition Hadronic Calo Deposit Template for Pions |
72 |
> |
TH2D *fpion_em_etaB; //!Barrel EM Calo Deposit Template for Pions |
73 |
> |
TH2D *fpion_had_etaB; //!Barrel Hadronic Calo Deposit Template for Pions |
74 |
> |
TH2D *fpion_ho_etaB; //!Barrel HO Calo Deposit Template for Pions |
75 |
> |
TH2D *fpion_had_etaTpl; //!Plus Transition Hadronic Calo Deposit Template for Pions |
76 |
> |
TH2D *fpion_em_etaEpl; //!Plus Endcap EM Calo Deposit Template for Pions |
77 |
> |
TH2D *fpion_had_etaEpl; //!Plus Endcap Hadronic Calo Deposit Template for Pions |
78 |
|
|
79 |
|
TH2D *LoadHisto(const char *fname, TFile *file) const; |
80 |
|
}; |
83 |
|
//-------------------------------------------------------------------------------------------------- |
84 |
|
inline Double_t mithep::MuonTools::SigWeight(Double_t iVal0, Double_t iVal1) const |
85 |
|
{ |
86 |
< |
// todo |
86 |
> |
// Returns weighted uncertainty given segment matching uncertainty (iVal0) and |
87 |
> |
// segment matching pull (iVal1). |
88 |
|
|
89 |
< |
if (iVal1 < 1.) |
89 |
> |
if (iVal1 < 1.) //if pull defined and within range |
90 |
|
return 1.; |
91 |
< |
if (iVal0 < 3. && iVal1 > 3.) { |
91 |
> |
if (iVal0 < 3. && iVal1 > 3.) { //if pull not well defined and uncertainty defined |
92 |
|
Double_t lVal = TMath::Max(iVal0,1.); |
93 |
|
return 1./TMath::Power(lVal,0.25); |
94 |
|
} |
95 |
|
|
96 |
< |
Double_t lVal = TMath::Max(iVal1,1.); |
96 |
> |
Double_t lVal = TMath::Max(iVal1,1.); //if pull > 1 and pull < 3 return 1/pull^4 |
97 |
|
return 1./TMath::Power(lVal,0.25); |
98 |
|
} |
94 |
– |
|
99 |
|
//-------------------------------------------------------------------------------------------------- |
100 |
|
inline Bool_t mithep::MuonTools::Overflow(const TH2D *iHist, Double_t lVal0, Double_t lVal1) const |
101 |
|
{ |