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.6 by loizides, Thu Nov 27 16:30:26 2008 UTC vs.
Revision 1.49 by ceballos, Sun May 6 12:27:38 2012 UTC

# Line 4 | Line 4
4   // MuonIDMod
5   //
6   // This module applies muon identification criteria and exports a pointer to a collection
7 < // of "good muons" according to the specified ID scheme. TODO: Pointer to a presentation.
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   //--------------------------------------------------------------------------------------------------
# Line 13 | Line 16
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 + #include "MitPhysics/Utils/interface/RhoUtilities.h"
29  
30   namespace mithep
31   {
# Line 23 | Line 34 | namespace mithep
34      public:
35        MuonIDMod(const char *name="MuonIDMod",
36                  const char *title="Muon identification module");
26      ~MuonIDMod() {}
37  
38 <      void          SetMuonBranchName(const char *name)  { fMuonBranchName    = name; }  
39 <      void          SetCleanMuonsName(const char *name)  { fCleanMuonsName    = name; }  
40 <      void          SetMuonIDType(const char *type)      { fMuonIDType        = type; }
41 <      void          SetTrackIsolationCut(Double_t cut)   { fTrackIsolationCut = cut;  }
42 <      void          SetCaloIsolationCut(Double_t cut)    { fCaloIsolationCut  = cut;  }
43 <      void          SetCombIsolationCut(Double_t cut)    { fCombIsolationCut  = cut;  }
44 <      void          SetMuonPtMin(Double_t pt)            { fMuonPtMin          = pt;  }
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  
79 +      void               SetRhoType(RhoUtilities::RhoType type)
80 +        { fTheRhoType = type; };
81 +
82 +      void               SetVertexName(const char* name) { fVertexName = name; }
83 +      
84        enum EMuIdType {
85          kIdUndef = 0,       //not defined
86 +        kWMuId,             //"WMuId"
87 +        kZMuId,             //"ZMuId"
88          kTight,             //"Tight"
89          kLoose,             //"Loose"
90 <        kCustomId           //"Custom"
90 >        kWWMuIdV1,          //"WWMuIdV1"
91 >        kWWMuIdV2,          //"WWMuIdV2"
92 >        kWWMuIdV3,          //"WWMuIdV3"
93 >        kWWMuIdV4,          //"WWMuIdV4"
94 >        kNoId,              //"NoId"        
95 >        kCustomId,          //"Custom"
96 >        kMVAID_BDTG_IDIso   //"BDTG ID + Iso03, Iso04 Combined"
97        };
98        enum EMuIsoType {
99 <        kIsoUndef = 0,      //not defined
100 <        kTrackCalo,         //"TrackCalo"
101 <        kTrackCaloCombined, //"TrackCaloCombined"
102 <        kTrackCaloSliding,  //"TrackCaloSliding"
103 <        kCustomIso,         //"Custom"
104 <        kNoIso              //"NoIso"
99 >        kIsoUndef = 0,                      //"not defined"
100 >        kTrackCalo,                         //"TrackCalo"
101 >        kTrackCaloCombined,                 //"TrackCaloCombined"
102 >        kTrackCaloSliding,                  //"TrackCaloSliding"
103 >        kTrackCaloSlidingNoCorrection,      //"TrackCaloSlidingNoCorrection"
104 >        kCustomIso,                         //"Custom"
105 >        kPFIso,                             //"PFIso"
106 >        kPFRadialIso,                       //"PFRadialIso"
107 >        kPFIsoNoL,                          //"PFIsoNoL"
108 >        kNoIso,                             //"NoIso"
109 >        kMVAIso_BDTG_IDIso,                 //"BDTG ID + Iso03, Iso04 Combined"
110 >        kIsoRingsV0_BDTG_Iso,               //"BDTG Iso Rings"
111 >        kIsoDeltaR                          //"BGDT Iso dR"              
112        };
113        enum EMuClassType {
114          kClassUndef = 0,    //not defined
115          kAll,               //"All"
116          kGlobal,            //"Global"
117 +        kGlobalTracker,     //"GlobalTracker"
118          kSta,               //"Standalone"
119 <        kTrackerOnly        //"TrackerOnly"
119 >        kTrackerMuon,       //"TrackerMuon"
120 >        kCaloMuon,          //"CaloMuon"
121 >        kTrackerBased       //"TrackerMuon or CaloMuon"
122 >
123        };
124  
125      protected:
126 <      TString       fMuonBranchName;            //name of muon collection (in branch)
127 <      TString       fCleanMuonsName;            //name of exported "good muon" collection
128 <      TString       fMuonIDType;                //type of muon id scheme we impose
129 <      TString       fMuonIsoType;               //type of muon isolations scheme we impose
130 <      TString       fMuonClassType;             //type of muon class we impose
131 <      Double_t      fTrackIsolationCut;         //cut value for track isolation
132 <      Double_t      fCaloIsolationCut;          //cut value for calo isolation
133 <      Double_t      fCombIsolationCut;          //cut value for combined isolation
134 <      Double_t      fMuonPtMin;                 //min muon pt
135 <      MuonCol      *fMuons;                     //!muon branch
136 <      MuonTools    *fMuonTools;                 //!muon tool
137 <      EMuIdType     fMuIDType;                  //!
138 <      EMuIsoType    fMuIsoType;                  //!
139 <      EMuClassType  fMuClassType;            //!
140 <
141 <      void       Process();
142 <      void       SlaveBegin();
143 <    
144 <      ClassDef(MuonIDMod,1) // TAM module for muon id
126 >      void               Process();
127 >      void               SlaveBegin();
128 >      void               Terminate();
129 >
130 >      Bool_t             fPrintMVADebugInfo;   //print MVA debug information
131 >      TString            fMuonBranchName;      //name of muon collection (input)
132 >      TString            fCleanMuonsName;      //name of exported "good muon" collection
133 >      TString            fNonIsolatedMuonsName;    //name of imported "old muon" collection
134 >      TString            fNonIsolatedElectronsName;//name of imported "old electron" collection
135 >      TString            fVertexName;          //name of vertex collection
136 >      TString            fBeamSpotName;        //name of beamspot collection
137 >      TString            fTrackName;           //name of track collection
138 >      TString            fPFCandidatesName;    //name of pfcandidates collection
139 >      TString            fMuonIDType;          //type of muon id scheme we impose
140 >      TString            fMuonIsoType;         //type of muon isolations scheme we impose
141 >      TString            fMuonClassType;       //type of muon class we impose
142 >      Double_t           fTrackIsolationCut;   //cut value for track isolation
143 >      Double_t           fCaloIsolationCut;    //cut value for calo isolation
144 >      Double_t           fCombIsolationCut;    //cut value for combined isolation
145 >      Double_t           fCombRelativeIsolationCut; //cut value for combined relative isolation
146 >      Double_t           fPFIsolationCut;      //cut value for combined isolation
147 >      Double_t           fMuonPtMin;           //min muon pt
148 >      Bool_t             fApplyD0Cut;          //=true then apply d0 cut (def=1)
149 >      Bool_t             fApplyDZCut;          //=true then apply dz cut (def=1)
150 >      Double_t           fD0Cut;               //max d0
151 >      Double_t           fDZCut;               //max dz
152 >      Int_t              fWhichVertex;         //vertex to use (-2: beamspot, -1: closest in Z)
153 >      Double_t           fEtaCut;              //max eta, absolute value
154 >      EMuIdType          fMuIDType;            //!muon id type (imposed)
155 >      EMuIsoType         fMuIsoType;           //!muon iso type (imposed)
156 >      EMuClassType       fMuClassType;         //!muon class type (imposed)
157 >      const MuonCol     *fMuons;               //!muon collection
158 >      const VertexCol   *fVertices;            //!vertices branch
159 >      const BeamSpotCol *fBeamSpot;            //!beamspot branch
160 >      const TrackCol    *fTracks;              //!track branch    
161 >      const PFCandidateCol *fPFCandidates;     //!pfcandidate branch
162 >      const PFCandidateCol *fPFNoPileUpCands;  //!pfnpu collection
163 >      Double_t           fIntRadius;           //!min IntRadius cut in pf isolation
164 >      MuonCol            *fNonIsolatedMuons;    //!pointer to old muon collection
165 >      ElectronCol        *fNonIsolatedElectrons;//!pointer to old electron collection
166 >      TString             fPileupEnergyDensityName;
167 >      const PileupEnergyDensityCol *fPileupEnergyDensity;
168 >      MuonTools          *fMuonTools;           // interface to tools for muon ID
169 >      MuonIDMVA          *fMuonIDMVA;           // helper class for MuonMVA
170 >
171 >      RhoUtilities::RhoType fTheRhoType;
172 >      
173 >    ClassDef(MuonIDMod, 1) // Muon identification module
174    };
175   }
176   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines