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.53 by fabstoec, Thu Jul 12 17:04:56 2012 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"
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;
19 < class TH2D;
28 > #include "MitPhysics/Utils/interface/RhoUtilities.h"
29  
30   namespace mithep
31   {
# Line 24 | 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                     SetMuonIDType(TString type)        { fMuonIDType         = type;  }
40 <      void                     SetTrackIsolationCut(Double_t cut) { fTrackIsolationCut  = cut;   }
41 <      void                     SetCaloIsolationCut(Double_t cut)  { fCaloIsolationCut   = cut;   }
42 <      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 >      Bool_t             PassMuonIsoDeltaR(const Muon *mu, const Vertex *vertex,
54 >                                           const PileupEnergyDensityCol *PileupEnergyDensity) const;
55 >      void               SetPrintMVADebugInfo(Bool_t b)       { fPrintMVADebugInfo = b;     }
56 >      void               SetApplyD0Cut(Bool_t b)              { fApplyD0Cut        = b;     }
57 >      void               SetApplyDZCut(Bool_t b)              { fApplyDZCut        = b;     }
58 >      void               SetCaloIsoCut(Double_t cut)          { fCaloIsolationCut  = cut;   }
59 >      void               SetClassType(const char *type)       { fMuonClassType     = type;  }
60 >      void               SetCleanMuonsName(const char *name)  { fCleanMuonsName    = name;  }  
61 >      void               SetOldMuonsName(const char *n)       { fNonIsolatedMuonsName  = n; }  
62 >      void               SetOldElectronsName(const char *n)   { fNonIsolatedElectronsName  = n; }  
63 >      void               SetCleanName(const char *name)       { SetCleanMuonsName(name);    }  
64 >      void               SetCombIsoCut(Double_t cut)          { fCombIsolationCut  = cut;   }
65 >      void               SetCombRelativeIsoCut(Double_t cut)  { fCombRelativeIsolationCut  = cut; }
66 >      void               SetPFIsoCut(Double_t cut)            { fPFIsolationCut  = cut;     }
67 >      void               SetD0Cut(Double_t cut)               { fD0Cut             = cut;   }
68 >      void               SetDZCut(Double_t cut)               { fDZCut             = cut;   }
69 >      void               SetWhichVertex(Int_t d)              { fWhichVertex = d;           }
70 >      void               SetEtaCut(Double_t cut)              { fEtaCut            = cut;   }
71 >      void               SetIDType(const char *type)          { fMuonIDType        = type;  }
72 >      void               SetInputName(const char *name)       { fMuonBranchName    = name;  }  
73 >      void               SetIsoType(const char *type)         { fMuonIsoType       = type;  }
74 >      void               SetOutputName(const char *name)      { SetCleanMuonsName(name);    }  
75 >      void               SetPtMin(Double_t pt)                { fMuonPtMin         = pt;    }
76 >      void               SetTrackIsoCut(Double_t cut)         { fTrackIsolationCut = cut;   }
77 >      void               SetIntRadius(Double_t dr)            { fIntRadius = dr;            }
78 >      void               SetPFNoPileUpName(const char *n)     { fPFNoPileUpName  = n;       }
79 >      void               SetPFPileUpName(const char *n)       { fPFPileUpName  = n;         }
80 >      void               SetRhoType(RhoUtilities::RhoType type)
81 >        { fTheRhoType = type; };
82 >
83 >      void               SetVertexName(const char* name) { fVertexName = name; }
84 >
85 >      enum EMuIdType {
86 >        kIdUndef = 0,       //not defined
87 >        kWMuId,             //"WMuId"
88 >        kZMuId,             //"ZMuId"
89 >        kTight,             //"Tight"
90 >        kLoose,             //"Loose"
91 >        kWWMuIdV1,          //"WWMuIdV1"
92 >        kWWMuIdV2,          //"WWMuIdV2"
93 >        kWWMuIdV3,          //"WWMuIdV3"
94 >        kWWMuIdV4,          //"WWMuIdV4"
95 >        kNoId,              //"NoId"        
96 >        kCustomId,          //"Custom"
97 >        kMVAID_BDTG_IDIso   //"BDTG ID + Iso03, Iso04 Combined"
98 >      };
99 >      enum EMuIsoType {
100 >        kIsoUndef = 0,                      //"not defined"
101 >        kTrackCalo,                         //"TrackCalo"
102 >        kTrackCaloCombined,                 //"TrackCaloCombined"
103 >        kTrackCaloSliding,                  //"TrackCaloSliding"
104 >        kTrackCaloSlidingNoCorrection,      //"TrackCaloSlidingNoCorrection"
105 >        kCombinedRelativeConeAreaCorrected, //"CombinedRelativeConeAreaCorrected"        
106 >        kCombinedRelativeEffectiveAreaCorrected,
107 >        kCustomIso,                         //"Custom"
108 >        kPFIso,                             //"PFIso"
109 >        kPFRadialIso,                       //"PFRadialIso"
110 >        kPFIsoBetaPUCorrected,              //"PFISo with PUcorrection using delta Beta
111 >        kPFIsoEffectiveAreaCorrected,       //"PFIso with EffectiveArea Pileup Correction"
112 >        kPFIsoNoL,                          //"PFIsoNoL"
113 >        kNoIso,                             //"NoIso"
114 >        kMVAIso_BDTG_IDIso,                 //"BDTG ID + Iso03, Iso04 Combined"
115 >        kIsoRingsV0_BDTG_Iso,               //"BDTG Iso Rings"
116 >        kIsoDeltaR                          //"BGDT Iso dR"              
117 >      };
118 >      enum EMuClassType {
119 >        kClassUndef = 0,    //not defined
120 >        kAll,               //"All"
121 >        kGlobal,            //"Global"
122 >        kGlobalTracker,     //"GlobalTracker"
123 >        kSta,               //"Standalone"
124 >        kTrackerMuon,       //"TrackerMuon"
125 >        kCaloMuon,          //"CaloMuon"
126 >        kTrackerBased,      //"TrackerMuon or CaloMuon"
127 >        kGlobalOnly         //"GlobalOnly"
128 >      };
129 >
130      protected:
131 <      bool                     fPrintDebug;               //flag for printing debug output
132 <      TString                  fMuonName;                 //name of muon collection
133 <      TString                  fCleanMuonsName ;           //name of good muons collection  
134 <      TString                  fMuonIDType;               //Type of electron ID we impose
135 <      TString                  fMuonIsoType;              //Type of electron Isolation we impose
136 <      MuonCol                 *fMuons;                    //!Muon branch
137 <
138 <      double                   fTrackIsolationCut;        //Cut value for track isolation
139 <      double                   fCaloIsolationCut;         //Cut value for calo isolation
140 <
141 <      int                      fNEventsProcessed;         // Number of events processed
142 <
143 <      void                     Begin();
144 <      void                     Process();
145 <      void                     SlaveBegin();
146 <      void                     SlaveTerminate();
147 <      void                     Terminate();
148 <    
149 <    
150 <      ClassDef(MuonIDMod,1) // TAM example analysis module
131 >      void               Process();
132 >      void               SlaveBegin();
133 >      void               Terminate();
134 >
135 >      Bool_t             fPrintMVADebugInfo;   //print MVA debug information
136 >      TString            fMuonBranchName;      //name of muon collection (input)
137 >      TString            fCleanMuonsName;      //name of exported "good muon" collection
138 >      TString            fNonIsolatedMuonsName;    //name of imported "old muon" collection
139 >      TString            fNonIsolatedElectronsName;//name of imported "old electron" collection
140 >      TString            fVertexName;          //name of vertex collection
141 >      TString            fBeamSpotName;        //name of beamspot collection
142 >      TString            fTrackName;           //name of track collection
143 >      TString            fPFCandidatesName;    //name of pfcandidates collection
144 >      TString            fPFNoPileUpName;  //name of pfnpu collection
145 >      TString            fPFPileUpName;    //name of pfpu collection
146 >      TString            fMuonIDType;          //type of muon id scheme we impose
147 >      TString            fMuonIsoType;         //type of muon isolations scheme we impose
148 >      TString            fMuonClassType;       //type of muon class we impose
149 >      Double_t           fTrackIsolationCut;   //cut value for track isolation
150 >      Double_t           fCaloIsolationCut;    //cut value for calo isolation
151 >      Double_t           fCombIsolationCut;    //cut value for combined isolation
152 >      Double_t           fCombRelativeIsolationCut; //cut value for combined relative isolation
153 >      Double_t           fPFIsolationCut;      //cut value for combined isolation
154 >      Double_t           fMuonPtMin;           //min muon pt
155 >      Bool_t             fApplyD0Cut;          //=true then apply d0 cut (def=1)
156 >      Bool_t             fApplyDZCut;          //=true then apply dz cut (def=1)
157 >      Double_t           fD0Cut;               //max d0
158 >      Double_t           fDZCut;               //max dz
159 >      Int_t              fWhichVertex;         //vertex to use (-2: beamspot, -1: closest in Z)
160 >      Double_t           fEtaCut;              //max eta, absolute value
161 >      EMuIdType          fMuIDType;            //!muon id type (imposed)
162 >      EMuIsoType         fMuIsoType;           //!muon iso type (imposed)
163 >      EMuClassType       fMuClassType;         //!muon class type (imposed)
164 >      const MuonCol     *fMuons;               //!muon collection
165 >      const VertexCol   *fVertices;            //!vertices branch
166 >      const BeamSpotCol *fBeamSpot;            //!beamspot branch
167 >      const TrackCol    *fTracks;              //!track branch    
168 >      const PFCandidateCol *fPFCandidates;     //!pfcandidate branch
169 >      const PFCandidateCol *fPFNoPileUpCands;  //!pfnpu collection
170 >      const PFCandidateCol *fPFPileUpCands;    //!pfpu collection
171 >      Double_t           fIntRadius;           //!min IntRadius cut in pf isolation
172 >      MuonCol            *fNonIsolatedMuons;    //!pointer to old muon collection
173 >      ElectronCol        *fNonIsolatedElectrons;//!pointer to old electron collection
174 >      TString             fPileupEnergyDensityName;
175 >      const PileupEnergyDensityCol *fPileupEnergyDensity;
176 >      MuonTools          *fMuonTools;           // interface to tools for muon ID
177 >      MuonIDMVA          *fMuonIDMVA;           // helper class for MuonMVA
178 >
179 >      RhoUtilities::RhoType fTheRhoType;
180 >      
181 >    ClassDef(MuonIDMod, 1) // Muon identification module
182    };
183   }
184   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines