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.2 by ceballos, Thu Oct 23 12:23:31 2008 UTC vs.
Revision 1.38 by sixie, Sat Dec 31 23:20:16 2011 UTC

# Line 3 | Line 3
3   //
4   // MuonIDMod
5   //
6 < // This Module applies electron ID criteria and exports a pointer to a collection
7 < // of Good Electrons 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"
20 <
21 < class TH1D;
22 < class TH2D;
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   namespace mithep
29   {
# Line 24 | Line 31 | namespace mithep
31    {
32      public:
33        MuonIDMod(const char *name="MuonIDMod",
34 <                     const char *title="Example analysis module with all branches");
35 <      ~MuonIDMod() {}
36 <      void                     SetPrintDebug(bool b)              { fPrintDebug         = b;     }
37 <      void                     SetMuonIDType(TString type)        { fMuonIDType         = type;  }
38 <      void                     SetTrackIsolationCut(Double_t cut) { fTrackIsolationCut  = cut;   }
39 <      void                     SetCaloIsolationCut(Double_t cut)  { fCaloIsolationCut   = cut;   }
40 <      void                     SetCleanMuonsName(TString s)       { fCleanMuonsName     = s;     }    
34 >                const char *title="Muon identification module");
35 >
36 >      Double_t           GetCaloIsoCut()                const { return fCaloIsolationCut;   }
37 >      const char        *GetClassType()                 const { return fMuonClassType;      }
38 >      const char        *GetCleanName()                 const { return GetCleanMuonsName(); }  
39 >      const char        *GetCleanMuonsName()            const { return fCleanMuonsName;     }  
40 >      Double_t           GetCombIsoCut()                const { return fCombIsolationCut;   }
41 >      const char        *GetIDType()                    const { return fMuonIDType;         }
42 >      const char        *GetInputName()                 const { return fMuonBranchName;     }  
43 >      const char        *GetIsoType()                   const { return fMuonIsoType;        }
44 >      const char        *GetOutputName()                const { return GetCleanMuonsName(); }  
45 >      Double_t           GetPtMin()                     const { return fMuonPtMin;          }
46 >      Double_t           GetTrackIsoCut()               const { return fTrackIsolationCut;  }
47 >      Bool_t             PassMuonMVA_BDTG_IdIso(const Muon *mu, const Vertex *vertex,
48 >                                                Double_t Rho) const;
49 >      void               SetApplyD0Cut(Bool_t b)              { fApplyD0Cut        = b;     }
50 >      void               SetApplyDZCut(Bool_t b)              { fApplyDZCut        = b;     }
51 >      void               SetCaloIsoCut(Double_t cut)          { fCaloIsolationCut  = cut;   }
52 >      void               SetClassType(const char *type)       { fMuonClassType     = type;  }
53 >      void               SetCleanMuonsName(const char *name)  { fCleanMuonsName    = name;  }  
54 >      void               SetOldMuonsName(const char *n)       { fNonIsolatedMuonsName  = n; }  
55 >      void               SetOldElectronsName(const char *n)   { fNonIsolatedElectronsName  = n; }  
56 >      void               SetCleanName(const char *name)       { SetCleanMuonsName(name);    }  
57 >      void               SetCombIsoCut(Double_t cut)          { fCombIsolationCut  = cut;   }
58 >      void               SetCombRelativeIsoCut(Double_t cut)  { fCombRelativeIsolationCut  = cut; }
59 >      void               SetPFIsoCut(Double_t cut)            { fPFIsolationCut  = cut;     }
60 >      void               SetD0Cut(Double_t cut)               { fD0Cut             = cut;   }
61 >      void               SetDZCut(Double_t cut)               { fDZCut             = cut;   }
62 >      void               SetWhichVertex(Int_t d)              { fWhichVertex = d;           }
63 >      void               SetEtaCut(Double_t cut)              { fEtaCut            = cut;   }
64 >      void               SetIDType(const char *type)          { fMuonIDType        = type;  }
65 >      void               SetInputName(const char *name)       { fMuonBranchName    = name;  }  
66 >      void               SetIsoType(const char *type)         { fMuonIsoType       = type;  }
67 >      void               SetOutputName(const char *name)      { SetCleanMuonsName(name);    }  
68 >      void               SetPtMin(Double_t pt)                { fMuonPtMin         = pt;    }
69 >      void               SetTrackIsoCut(Double_t cut)         { fTrackIsolationCut = cut;   }
70 >      void               SetIntRadius(Double_t dr)            { fIntRadius = dr;            }
71 >      void               SetMuonMVAWeightsSubdet0Pt10To14p5(TString s)  
72 >                         { fMuonMVAWeights_Subdet0Pt10To14p5  = s; }
73 >      void               SetMuonMVAWeightsSubdet1Pt10To14p5(TString s)  
74 >                         { fMuonMVAWeights_Subdet1Pt10To14p5  = s; }
75 >      void               SetMuonMVAWeightsSubdet0Pt14p5To20(TString s)  
76 >                         { fMuonMVAWeights_Subdet0Pt14p5To20  = s; }
77 >      void               SetMuonMVAWeightsSubdet1Pt14p5To20(TString s)
78 >                         { fMuonMVAWeights_Subdet1Pt14p5To20 = s; }
79 >      void               SetMuonMVAWeightsSubdet0Pt20ToInf(TString s)
80 >                         { fMuonMVAWeights_Subdet0Pt20ToInf = s; }
81 >      void               SetMuonMVAWeightsSubdet1Pt20ToInf(TString s)
82 >                         { fMuonMVAWeights_Subdet1Pt20ToInf = s; }
83 >
84 >      enum EMuIdType {
85 >        kIdUndef = 0,       //not defined
86 >        kWMuId,             //"WMuId"
87 >        kZMuId,             //"ZMuId"
88 >        kTight,             //"Tight"
89 >        kLoose,             //"Loose"
90 >        kWWMuIdV1,          //"WWMuIdV1"
91 >        kWWMuIdV2,          //"WWMuIdV2"
92 >        kWWMuIdV3,          //"WWMuIdV3"
93 >        kNoId,              //"NoId"        
94 >        kCustomId,          //"Custom"
95 >        kMVAID_BDTG_IDIso   //"BDTG ID + Iso03, Iso04 Combined"
96 >      };
97 >      enum EMuIsoType {
98 >        kIsoUndef = 0,                      //"not defined"
99 >        kTrackCalo,                         //"TrackCalo"
100 >        kTrackCaloCombined,                 //"TrackCaloCombined"
101 >        kTrackCaloSliding,                  //"TrackCaloSliding"
102 >        kTrackCaloSlidingNoCorrection,      //"TrackCaloSlidingNoCorrection"
103 >        kCombinedRelativeConeAreaCorrected, //"CombinedRelativeConeAreaCorrected"
104 >        kCustomIso,                         //"Custom"
105 >        kPFIso,                             //"PFIso"
106 >        kPFIsoEffectiveAreaCorrected,       //"PFIso with EffectiveArea Pileup Correction"
107 >        kPFIsoNoL,                          //"PFIsoNoL"
108 >        kNoIso,                             //"NoIso"
109 >        kMVAIso_BDTG_IDIso                  //"BDTG ID + Iso03, Iso04 Combined"
110 >      };
111 >      enum EMuClassType {
112 >        kClassUndef = 0,    //not defined
113 >        kAll,               //"All"
114 >        kGlobal,            //"Global"
115 >        kGlobalTracker,     //"GlobalTracker"
116 >        kSta,               //"Standalone"
117 >        kTrackerMuon,       //"TrackerMuon"
118 >        kCaloMuon,          //"CaloMuon"
119 >        kTrackerBased       //"TrackerMuon or CaloMuon"
120 >
121 >      };
122 >
123      protected:
124 <      bool                     fPrintDebug;               //flag for printing debug output
125 <      TString                  fMuonName;                 //name of muon collection
126 <      TString                  fCleanMuonsName ;           //name of good muons collection  
127 <      TString                  fMuonIDType;               //Type of electron ID we impose
128 <      TString                  fMuonIsoType;              //Type of electron Isolation we impose
129 <      MuonCol                 *fMuons;                    //!Muon branch
130 <
131 <      double                   fTrackIsolationCut;        //Cut value for track isolation
132 <      double                   fCaloIsolationCut;         //Cut value for calo isolation
133 <
134 <      int                      fNEventsProcessed;         // Number of events processed
135 <
136 <      void                     Begin();
137 <      void                     Process();
138 <      void                     SlaveBegin();
139 <      void                     SlaveTerminate();
140 <      void                     Terminate();
141 <    
142 <    
143 <      ClassDef(MuonIDMod,1) // TAM example analysis module
124 >      void               Process();
125 >      void               SlaveBegin();
126 >
127 >      TString            fMuonBranchName;      //name of muon collection (input)
128 >      TString            fCleanMuonsName;      //name of exported "good muon" collection
129 >      TString            fNonIsolatedMuonsName;    //name of imported "old muon" collection
130 >      TString            fNonIsolatedElectronsName;//name of imported "old electron" collection
131 >      TString            fVertexName;          //name of vertex collection
132 >      TString            fBeamSpotName;        //name of beamspot collection
133 >      TString            fTrackName;           //name of track collection
134 >      TString            fPFCandidatesName;    //name of pfcandidates collection
135 >      TString            fMuonIDType;          //type of muon id scheme we impose
136 >      TString            fMuonIsoType;         //type of muon isolations scheme we impose
137 >      TString            fMuonClassType;       //type of muon class we impose
138 >      Double_t           fTrackIsolationCut;   //cut value for track isolation
139 >      Double_t           fCaloIsolationCut;    //cut value for calo isolation
140 >      Double_t           fCombIsolationCut;    //cut value for combined isolation
141 >      Double_t           fCombRelativeIsolationCut; //cut value for combined relative isolation
142 >      Double_t           fPFIsolationCut;      //cut value for combined isolation
143 >      Double_t           fMuonPtMin;           //min muon pt
144 >      Bool_t             fApplyD0Cut;          //=true then apply d0 cut (def=1)
145 >      Bool_t             fApplyDZCut;          //=true then apply dz cut (def=1)
146 >      Double_t           fD0Cut;               //max d0
147 >      Double_t           fDZCut;               //max dz
148 >      Int_t              fWhichVertex;         //vertex to use (-2: beamspot, -1: closest in Z)
149 >      Double_t           fEtaCut;              //max eta, absolute value
150 >      EMuIdType          fMuIDType;            //!muon id type (imposed)
151 >      EMuIsoType         fMuIsoType;           //!muon iso type (imposed)
152 >      EMuClassType       fMuClassType;         //!muon class type (imposed)
153 >      const MuonCol     *fMuons;               //!muon collection
154 >      const VertexCol   *fVertices;            //!vertices branch
155 >      const BeamSpotCol *fBeamSpot;            //!beamspot branch
156 >      const TrackCol    *fTracks;              //!track branch    
157 >      const PFCandidateCol *fPFCandidates;     //!pfcandidate branch
158 >      Double_t           fIntRadius;           //!min IntRadius cut in pf isolation
159 >      MuonCol            *fNonIsolatedMuons;    //!pointer to old muon collection
160 >      ElectronCol        *fNonIsolatedElectrons;//!pointer to old electron collection
161 >      TString             fPileupEnergyDensityName;
162 >      const PileupEnergyDensityCol *fPileupEnergyDensity;
163 >      MuonTools          *fMuonTools;           // interface to tools for muon ID
164 >      MuonIDMVA          *fMuonIDMVA;           // helper class for MuonMVA
165 >      TString             fMuonMVAWeights_Subdet0Pt10To14p5;
166 >      TString             fMuonMVAWeights_Subdet1Pt10To14p5;
167 >      TString             fMuonMVAWeights_Subdet0Pt14p5To20;
168 >      TString             fMuonMVAWeights_Subdet1Pt14p5To20;
169 >      TString             fMuonMVAWeights_Subdet0Pt20ToInf;
170 >      TString             fMuonMVAWeights_Subdet1Pt20ToInf;
171 >
172 >    ClassDef(MuonIDMod, 1) // Muon identification module
173    };
174   }
175   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines