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

Comparing UserCode/MitPhysics/Mods/interface/MuonIDMod.h (file contents):
Revision 1.5 by ceballos, Wed Nov 26 10:55:32 2008 UTC vs.
Revision 1.45 by ceballos, Fri May 4 16:36:39 2012 UTC

# Line 3 | Line 3
3   //
4   // MuonIDMod
5   //
6 < // This Module applies Muon ID criteria and exports a pointer to a collection
7 < // of Good Muons according to some specified ID scheme
6 > // This module applies muon identification criteria and exports a pointer to a collection
7 > // of "good muons" according to the specified ID scheme.
8 > //
9 > // See http://indico.cern.ch/contributionDisplay.py?contribId=1&confId=45945
10 > // See http://indico.cern.ch/getFile.py/access?contribId=1&resId=0&materialId=slides&confId=42229
11   //
12   // Authors: S.Xie
13   //--------------------------------------------------------------------------------------------------
14  
15 < #ifndef MITANA_TREEMOD_MUONIDMOD_H
16 < #define MITANA_TREEMOD_MUONIDMOD_H
15 > #ifndef MITPHYSICS_MODS_MUONIDMOD_H
16 > #define MITPHYSICS_MODS_MUONIDMOD_H
17  
18   #include "MitAna/TreeMod/interface/BaseMod.h"
19 < #include "MitAna/DataTree/interface/Collections.h"
19 > #include "MitAna/DataTree/interface/MuonFwd.h"
20 > #include "MitAna/DataTree/interface/VertexFwd.h"
21 > #include "MitAna/DataTree/interface/TrackFwd.h"
22 > #include "MitAna/DataTree/interface/PFCandidateFwd.h"
23   #include "MitPhysics/Utils/interface/MuonTools.h"
24 + #include "MitPhysics/Utils/interface/MuonIDMVA.h"
25 + #include "MitPhysics/Utils/interface/IsolationTools.h"
26 + #include "MitAna/DataTree/interface/PileupEnergyDensityCol.h"
27  
28 < class TH1D;
20 < class TH2D;
28 > #include "MitPhysics/Utils/interface/RhoUtilities.h"
29  
30   namespace mithep
31   {
# Line 25 | Line 33 | namespace mithep
33    {
34      public:
35        MuonIDMod(const char *name="MuonIDMod",
36 <                     const char *title="Example analysis module with all branches");
37 <      ~MuonIDMod() {}
38 <      void     SetPrintDebug(bool b)                { fPrintDebug                = b;   }
39 <      void     SetTrackIsolationCut(Double_t cut)   { fTrackIsolationCut         = cut; }
40 <      void     SetCaloIsolationCut(Double_t cut)    { fCaloIsolationCut          = cut; }
41 <      void     SetCombIsolationCut(Double_t cut)    { fCombIsolationCut          = cut; }
42 <      void     SetMuonPtMin(double p)               { fMuonPtMin                 = p;   }
43 <      void     SetTMOneStationLooseCut(bool b)      { fTMOneStationLooseCut      = b;   }
44 <      void     SetTMOneStationTightCut(bool b)      { fTMOneStationTightCut      = b;   }
45 <      void     SetTM2DCompatibilityLooseCut(bool b) { fTM2DCompatibilityLooseCut = b;   }
46 <      void     SetTM2DCompatibilityTightCut(bool b) { fTM2DCompatibilityTightCut = b;   }
47 <      void     SetMuonSlidingIso(bool b)            { fMuonSlidingIso            = b;   }
48 <      void     SetCleanMuonsName(TString s)         { fCleanMuonsName            = s;   }  
36 >                const char *title="Muon identification module");
37 >
38 >      Double_t           GetCaloIsoCut()                const { return fCaloIsolationCut;   }
39 >      const char        *GetClassType()                 const { return fMuonClassType;      }
40 >      const char        *GetCleanName()                 const { return GetCleanMuonsName(); }  
41 >      const char        *GetCleanMuonsName()            const { return fCleanMuonsName;     }  
42 >      Double_t           GetCombIsoCut()                const { return fCombIsolationCut;   }
43 >      const char        *GetIDType()                    const { return fMuonIDType;         }
44 >      const char        *GetInputName()                 const { return fMuonBranchName;     }  
45 >      const char        *GetIsoType()                   const { return fMuonIsoType;        }
46 >      const char        *GetOutputName()                const { return GetCleanMuonsName(); }  
47 >      Double_t           GetPtMin()                     const { return fMuonPtMin;          }
48 >      Double_t           GetTrackIsoCut()               const { return fTrackIsolationCut;  }
49 >      Bool_t             PassMuonMVA_BDTG_IdIso(const Muon *mu, const Vertex *vertex,
50 >                                                const PileupEnergyDensityCol *PileupEnergyDensity) const;
51 >      Bool_t             PassMuonIsoRingsV0_BDTG_Iso(const Muon *mu, const Vertex *vertex,
52 >                                                     const PileupEnergyDensityCol *PileupEnergyDensity) const;
53 >      void               SetPrintMVADebugInfo(Bool_t b)       { fPrintMVADebugInfo = b;     }
54 >      void               SetApplyD0Cut(Bool_t b)              { fApplyD0Cut        = b;     }
55 >      void               SetApplyDZCut(Bool_t b)              { fApplyDZCut        = b;     }
56 >      void               SetCaloIsoCut(Double_t cut)          { fCaloIsolationCut  = cut;   }
57 >      void               SetClassType(const char *type)       { fMuonClassType     = type;  }
58 >      void               SetCleanMuonsName(const char *name)  { fCleanMuonsName    = name;  }  
59 >      void               SetOldMuonsName(const char *n)       { fNonIsolatedMuonsName  = n; }  
60 >      void               SetOldElectronsName(const char *n)   { fNonIsolatedElectronsName  = n; }  
61 >      void               SetCleanName(const char *name)       { SetCleanMuonsName(name);    }  
62 >      void               SetCombIsoCut(Double_t cut)          { fCombIsolationCut  = cut;   }
63 >      void               SetCombRelativeIsoCut(Double_t cut)  { fCombRelativeIsolationCut  = cut; }
64 >      void               SetPFIsoCut(Double_t cut)            { fPFIsolationCut  = cut;     }
65 >      void               SetD0Cut(Double_t cut)               { fD0Cut             = cut;   }
66 >      void               SetDZCut(Double_t cut)               { fDZCut             = cut;   }
67 >      void               SetWhichVertex(Int_t d)              { fWhichVertex = d;           }
68 >      void               SetEtaCut(Double_t cut)              { fEtaCut            = cut;   }
69 >      void               SetIDType(const char *type)          { fMuonIDType        = type;  }
70 >      void               SetInputName(const char *name)       { fMuonBranchName    = name;  }  
71 >      void               SetIsoType(const char *type)         { fMuonIsoType       = type;  }
72 >      void               SetOutputName(const char *name)      { SetCleanMuonsName(name);    }  
73 >      void               SetPtMin(Double_t pt)                { fMuonPtMin         = pt;    }
74 >      void               SetTrackIsoCut(Double_t cut)         { fTrackIsolationCut = cut;   }
75 >      void               SetIntRadius(Double_t dr)            { fIntRadius = dr;            }
76 >      void               SetMuonMVAWeightsSubdet0Pt10To14p5(TString s)  
77 >                         { fMuonMVAWeights_Subdet0Pt10To14p5  = s; }
78 >      void               SetMuonMVAWeightsSubdet1Pt10To14p5(TString s)  
79 >                         { fMuonMVAWeights_Subdet1Pt10To14p5  = s; }
80 >      void               SetMuonMVAWeightsSubdet0Pt14p5To20(TString s)  
81 >                         { fMuonMVAWeights_Subdet0Pt14p5To20  = s; }
82 >      void               SetMuonMVAWeightsSubdet1Pt14p5To20(TString s)
83 >                         { fMuonMVAWeights_Subdet1Pt14p5To20 = s; }
84 >      void               SetMuonMVAWeightsSubdet0Pt20ToInf(TString s)
85 >                         { fMuonMVAWeights_Subdet0Pt20ToInf = s; }
86 >      void               SetMuonMVAWeightsSubdet1Pt20ToInf(TString s)
87 >                         { fMuonMVAWeights_Subdet1Pt20ToInf = s; }
88 >
89 >      void               SetRhoType(RhoUtilities::RhoType type)
90 >        { fTheRhoType = type; };
91 >
92 >      void               SetVertexName(const char* name) { fVertexName = name; }
93 >      
94 >      enum EMuIdType {
95 >        kIdUndef = 0,       //not defined
96 >        kWMuId,             //"WMuId"
97 >        kZMuId,             //"ZMuId"
98 >        kTight,             //"Tight"
99 >        kLoose,             //"Loose"
100 >        kWWMuIdV1,          //"WWMuIdV1"
101 >        kWWMuIdV2,          //"WWMuIdV2"
102 >        kWWMuIdV3,          //"WWMuIdV3"
103 >        kNoId,              //"NoId"        
104 >        kCustomId,          //"Custom"
105 >        kMVAID_BDTG_IDIso   //"BDTG ID + Iso03, Iso04 Combined"
106 >      };
107 >      enum EMuIsoType {
108 >        kIsoUndef = 0,                      //"not defined"
109 >        kTrackCalo,                         //"TrackCalo"
110 >        kTrackCaloCombined,                 //"TrackCaloCombined"
111 >        kTrackCaloSliding,                  //"TrackCaloSliding"
112 >        kTrackCaloSlidingNoCorrection,      //"TrackCaloSlidingNoCorrection"
113 >        kCombinedRelativeConeAreaCorrected, //"CombinedRelativeConeAreaCorrected"
114 >        kCombinedRelativeEffectiveAreaCorrected,
115 >        kCustomIso,                         //"Custom"
116 >        kPFIso,                             //"PFIso"
117 >        kPFRadialIso,                       //"PFRadialIso"
118 >        kPFIsoEffectiveAreaCorrected,       //"PFIso with EffectiveArea Pileup Correction"
119 >        kPFIsoNoL,                          //"PFIsoNoL"
120 >        kNoIso,                             //"NoIso"
121 >        kMVAIso_BDTG_IDIso,                 //"BDTG ID + Iso03, Iso04 Combined"
122 >        kIsoRingsV0_BDTG_Iso                //"BDTG Iso Rings"
123 >      };
124 >      enum EMuClassType {
125 >        kClassUndef = 0,    //not defined
126 >        kAll,               //"All"
127 >        kGlobal,            //"Global"
128 >        kGlobalTracker,     //"GlobalTracker"
129 >        kSta,               //"Standalone"
130 >        kTrackerMuon,       //"TrackerMuon"
131 >        kCaloMuon,          //"CaloMuon"
132 >        kTrackerBased       //"TrackerMuon or CaloMuon"
133 >
134 >      };
135 >
136      protected:
137 <      bool      fPrintDebug;                // flag for printing debug output
138 <      TString   fMuonName;                  // name of muon collection
139 <      TString   fCleanMuonsName ;           // name of good muons collection  
140 <      MuonCol   *fMuons;                    // !Muon branch
141 <
142 <      double    fTrackIsolationCut;         // Cut value for track isolation
143 <      double    fCaloIsolationCut;          // Cut value for calo isolation
144 <      double    fCombIsolationCut;          // Cut value for combined isolation
145 <      bool      fTMOneStationLooseCut;     // apply TMOneStationLooseCut?
146 <      bool      fTMOneStationTightCut;     // apply TMOneStationTightCut?
147 <      bool      fTM2DCompatibilityLooseCut; // apply TM2DCompatibilityLooseCut?
148 <      bool      fTM2DCompatibilityTightCut; // apply TM2DCompatibilityTightCut?
149 <      bool      fMuonSlidingIso;            // apply sliding iso?
150 <      double    fMuonPtMin;                 // min Pt requirement
151 <
152 <      int       fNEventsProcessed;          // Number of events processed
153 <
154 <      MuonTools myMuonTools;
155 <
156 <      void      Begin();
157 <      void      Process();
158 <      void      SlaveBegin();
159 <      void      SlaveTerminate();
160 <      void      Terminate();
161 <    
162 <    
163 <      ClassDef(MuonIDMod,1) // TAM example analysis module
137 >      void               Process();
138 >      void               SlaveBegin();
139 >
140 >      Bool_t             fPrintMVADebugInfo;   //print MVA debug information
141 >      TString            fMuonBranchName;      //name of muon collection (input)
142 >      TString            fCleanMuonsName;      //name of exported "good muon" collection
143 >      TString            fNonIsolatedMuonsName;    //name of imported "old muon" collection
144 >      TString            fNonIsolatedElectronsName;//name of imported "old electron" collection
145 >      TString            fVertexName;          //name of vertex collection
146 >      TString            fBeamSpotName;        //name of beamspot collection
147 >      TString            fTrackName;           //name of track collection
148 >      TString            fPFCandidatesName;    //name of pfcandidates collection
149 >      TString            fMuonIDType;          //type of muon id scheme we impose
150 >      TString            fMuonIsoType;         //type of muon isolations scheme we impose
151 >      TString            fMuonClassType;       //type of muon class we impose
152 >      Double_t           fTrackIsolationCut;   //cut value for track isolation
153 >      Double_t           fCaloIsolationCut;    //cut value for calo isolation
154 >      Double_t           fCombIsolationCut;    //cut value for combined isolation
155 >      Double_t           fCombRelativeIsolationCut; //cut value for combined relative isolation
156 >      Double_t           fPFIsolationCut;      //cut value for combined isolation
157 >      Double_t           fMuonPtMin;           //min muon pt
158 >      Bool_t             fApplyD0Cut;          //=true then apply d0 cut (def=1)
159 >      Bool_t             fApplyDZCut;          //=true then apply dz cut (def=1)
160 >      Double_t           fD0Cut;               //max d0
161 >      Double_t           fDZCut;               //max dz
162 >      Int_t              fWhichVertex;         //vertex to use (-2: beamspot, -1: closest in Z)
163 >      Double_t           fEtaCut;              //max eta, absolute value
164 >      EMuIdType          fMuIDType;            //!muon id type (imposed)
165 >      EMuIsoType         fMuIsoType;           //!muon iso type (imposed)
166 >      EMuClassType       fMuClassType;         //!muon class type (imposed)
167 >      const MuonCol     *fMuons;               //!muon collection
168 >      const VertexCol   *fVertices;            //!vertices branch
169 >      const BeamSpotCol *fBeamSpot;            //!beamspot branch
170 >      const TrackCol    *fTracks;              //!track branch    
171 >      const PFCandidateCol *fPFCandidates;     //!pfcandidate branch
172 >      const PFCandidateCol *fPFNoPileUpCands;  //!pfnpu collection
173 >      Double_t           fIntRadius;           //!min IntRadius cut in pf isolation
174 >      MuonCol            *fNonIsolatedMuons;    //!pointer to old muon collection
175 >      ElectronCol        *fNonIsolatedElectrons;//!pointer to old electron collection
176 >      TString             fPileupEnergyDensityName;
177 >      const PileupEnergyDensityCol *fPileupEnergyDensity;
178 >      MuonTools          *fMuonTools;           // interface to tools for muon ID
179 >      MuonIDMVA          *fMuonIDMVA;           // helper class for MuonMVA
180 >      TString             fMuonMVAWeights_Subdet0Pt10To14p5;
181 >      TString             fMuonMVAWeights_Subdet1Pt10To14p5;
182 >      TString             fMuonMVAWeights_Subdet0Pt14p5To20;
183 >      TString             fMuonMVAWeights_Subdet1Pt14p5To20;
184 >      TString             fMuonMVAWeights_Subdet0Pt20ToInf;
185 >      TString             fMuonMVAWeights_Subdet1Pt20ToInf;
186 >
187 >      RhoUtilities::RhoType fTheRhoType;
188 >      
189 >    ClassDef(MuonIDMod, 1) // Muon identification module
190    };
191   }
192   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines