ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Muon.h
(Generate patch)

Comparing UserCode/MitAna/DataTree/interface/Muon.h (file contents):
Revision 1.18 by loizides, Thu Nov 27 16:15:06 2008 UTC vs.
Revision 1.31 by loizides, Fri Jul 17 13:01:13 2009 UTC

# Line 3 | Line 3
3   //
4   // Muon
5   //
6 < // Details to be worked out... TODO by Phil
6 > // Classified into 3 Types
7 > //  Standalone  : Muon fit from hits in the muon chambers
8 > //  Tracker     : Tracker matched track to muon chambers with segments
9 > //  Global      : Combined track and muon chambers fit
10 > //
11 > //  In the muon class all three muon classes exist and can be determined by checking
12 > //  whether a fit track exists for such a Muon (eg HasTrackerTrk() == kTRUE). When
13 > //  BestTrk function is called the global fit is returned, if that does not
14 > //  exist the tracker fit is returned upon that failure the standalone muon
15 > //  is subsequently returned. To consult more see:
16 > //  http://cmsdoc.cern.ch/cms/Physics/muon/MPOG/Notes/MuonReco.pdf
17 > //
18 > // Quality Varaibles for Selection
19 > //  Isolation : decomposed to IsoRNNXXXXX
20 > //    NN = 03,05 to denote R =0.3,0.5 in Isolation Cone
21 > //    XXXXX = SumPt - Sum of Pt of Tracks in Cone (using all Pt Tracks)
22 > //    XXXXX = EmEt  - Sum of Et of Em component of Calo Towers  (Veto=0.08)
23 > //    XXXXX = HadEt - Sum of Et of Had component of Calo Towers (Veto=0.1)
24 > //    XXXXX = HoEt  - Sum of Pt of Ho component of Calo Towers  (Veto=0.1)
25 > //    XXXXX = NTrk  - Number of Tracks within Cone (using all Pt Tracks)
26 > //    XXXXX = NJet  - Sum of Jets inside Cone
27 > //
28 > // Muon Quality Variables
29 > //  Extracted from the Muon Tracking Associator
30 > //   For more se https://twiki.cern.ch/twiki/bin/view/CMS/TrackAssociator
31 > //  Energy Variables : Energy within (5x5 Ecal Crystal/Hcal/Ho) along Track
32 > //   using calo towers
33 > //  S9 Energy Variables : Energy using reconstructed hits calo towers default
34 > //  Segment Variables :
35 > //   Segment variables are stored in array of 8:
36 > //     0-3: Correspond to segments in 4 DT chambers  in->outward(3 has no Y res)
37 > //     4-7: Correspond to segments in 4 CSC chambers in->out
38 > //    If value undetermined 999999 is returned.
39 > //   Variables:
40 > //    DX,DY,PullX,PullY: Uncertainties/Pulls of propagated track
41 > //     with respect to local muon segment
42 > //   TrackDist,TrackDistErr: Summed Dist/Err (in X,Y) of segment with respect
43 > //    to propagated track
44 > //   NSegments : Number of segments in muon using Segment+Track Arbitration
45 > //   NChambers : Number of muon chambers traversed in propagated track
46 > //   LastHit   : Returns farest (from center) station with a recorded segment
47 > //   LastStation  : Returns farest station using Segment+Track Arbitration
48 > //
49 > //  Muon Id Methods: Please see Muon Id Note(as of now unpublished):
50 > //      https://www.cmsaf.mit.edu/twiki/pub/CmsHep/HepWAnalysis/MuonID-ingo.pdf
51 > //   TMOneStation : Returns bool whether muon passes "Tracker Muon One StationId"
52 > //    -Matching criteria for one of all segments matched to muon
53 > //   TMLastStation : Returns bool whether muon passes "LastStation Id" criteria
54 > //    -Matching criteria for last most segment
55   //
56   // Authors: J.Bendavid, C.Loizides, C.Paus, P.Harris
57   //--------------------------------------------------------------------------------------------------
# Line 11 | Line 59
59   #ifndef MITANA_DATATREE_MUON_H
60   #define MITANA_DATATREE_MUON_H
61  
14 #include <TRef.h>
62   #include "MitAna/DataTree/interface/Track.h"
63   #include "MitAna/DataTree/interface/ChargedParticle.h"
64  
65   namespace mithep {
66    class Muon : public ChargedParticle {
67      public:
68 <      Muon() {}
22 <      ~Muon() {}
68 >      Muon();
69  
70        enum EClassType {
71          kNone,              //no track assigned
72          kGlobal,            //"Global"
73 <        kTrackerOnly,       //"TrackerOnly"
73 >        kTracker,           //"Tracker"
74          kSta,               //"Standalone"
75          kAny                //any "best" of the above
76        };
77        
78 <      const Track   *BestTrk()             const;
79 <      const Track   *GlobalTrk()           const;
80 <      const Track   *StandaloneTrk()       const;
81 <      const Track   *TrackerTrk()          const;
82 <      const Track   *Trk()                 const { return BestTrk();          }
83 <      Double_t       IsoR03SumPt()         const { return fIsoR03SumPt;       }
84 <      Double_t       IsoR03EmEt()          const { return fIsoR03EmEt;        }
85 <      Double_t       IsoR03HadEt()         const { return fIsoR03HadEt;       }
86 <      Double_t       IsoR03HoEt()          const { return fIsoR03HoEt;        }
87 <      Int_t          IsoR03NTracks()       const { return fIsoR03NTracks;     }
88 <      Int_t          IsoR03NJets()         const { return fIsoR03NJets;       }
89 <      Double_t       IsoR05SumPt()         const { return fIsoR05SumPt;       }
90 <      Double_t       IsoR05EmEt()          const { return fIsoR05EmEt;        }
91 <      Double_t       IsoR05HadEt()         const { return fIsoR05HadEt;       }
92 <      Double_t       IsoR05HoEt()          const { return fIsoR05HoEt;        }
93 <      Int_t          IsoR05NTracks()       const { return fIsoR05NTracks;     }
94 <      Int_t          IsoR05NJets()         const { return fIsoR05NJets;       }            
95 <      Double_t       EmEnergy()            const { return fEmEnergy;          }
96 <      Double_t       HadEnergy()           const { return fHadEnergy;         }
97 <      Double_t       HoEnergy()            const { return fHoEnergy;          }
98 <      Double_t       EmS9Energy()          const { return fEmS9Energy;        }
99 <      Double_t       HadS9Energy()         const { return fHadS9Energy;       }
100 <      Double_t       HoS9Energy()          const { return fHoS9Energy;        }
101 <      Double_t       Mass()                const { return 105.658369e-3;             }  
102 <      Int_t          NChambers()           const { return fNTraversedChambers;       }
103 <      Int_t          NSegments()           const { return fStationMask.NBitsSet();   }
104 <      Bool_t         StationBit(Int_t bit) const { return fStationMask.TestBit(bit); }
105 <      Double_t       GetDX(Int_t iStation)             const;
106 <      Double_t       GetDY(Int_t iStation)             const;
107 <      Double_t       GetPullX(Int_t iStation)          const;
108 <      Double_t       GetPullY(Int_t iStation)          const;
109 <      Double_t       GetTrackDist(Int_t iStation)      const;
110 <      Double_t       GetTrackDistErr(Int_t iStation)   const;
111 <      Int_t          GetNSegments(Int_t iStation)      const;
112 <      Bool_t         Has(EClassType type)              const;
113 <      EClassType     Is()                              const;
114 <      Int_t          LastHit()                         const;
78 >      const Track   *BestTrk()                       const;
79 >      const Track   *GlobalTrk()                     const { return fGlobalTrkRef.Obj();       }
80 >      const Track   *StandaloneTrk()                 const { return fStaTrkRef.Obj();          }
81 >      const Track   *TrackerTrk()                    const { return fTrkTrkRef.Obj();          }
82 >      const Track   *Trk()                           const { return BestTrk();                 }
83 >      Double_t       EmEnergy()                      const { return fEmEnergy;                 }
84 >      Double_t       EmS9Energy()                    const { return fEmS9Energy;               }
85 >      Double_t       GetDX(Int_t iStation)           const;
86 >      Double_t       GetDY(Int_t iStation)           const;
87 >      Double_t       GetPullX(Int_t iStation)        const;
88 >      Double_t       GetPullY(Int_t iStation)        const;
89 >      Double_t       GetTrackDist(Int_t iStation)    const;
90 >      Double_t       GetTrackDistErr(Int_t iStation) const;
91 >      Int_t          GetNSegments(Int_t iStation)    const;
92 >      Bool_t         Has(EClassType type)            const;
93 >      Bool_t         HasTrk()                        const;
94 >      Bool_t         HasGlobalTrk()                  const { return fGlobalTrkRef.IsValid();   }
95 >      Bool_t         HasStandaloneTrk()              const { return fStaTrkRef.IsValid();      }
96 >      Bool_t         HasTrackerTrk()                 const { return fTrkTrkRef.IsValid();      }
97 >      Double_t       HadEnergy()                     const { return fHadEnergy;                }
98 >      Double_t       HadS9Energy()                   const { return fHadS9Energy;              }
99 >      Double_t       HoEnergy()                      const { return fHoEnergy;                 }
100 >      Double_t       HoS9Energy()                    const { return fHoS9Energy;               }
101 >      EClassType     Is()                            const;
102 >      Bool_t         IsGlobalMuon()                  const { return fIsGlobalMuon;             }
103 >      Bool_t         IsTrackerMuon()                 const { return fIsTrackerMuon;            }
104 >      Bool_t         IsStandaloneMuon()              const { return fIsStandaloneMuon;         }
105 >      Bool_t         IsCaloMuon()                    const { return fIsCaloMuon;               }
106 >      Double_t       IsoR03SumPt()                   const { return fIsoR03SumPt;              }
107 >      Double_t       IsoR03EmEt()                    const { return fIsoR03EmEt;               }
108 >      Double_t       IsoR03HadEt()                   const { return fIsoR03HadEt;              }
109 >      Double_t       IsoR03HoEt()                    const { return fIsoR03HoEt;               }
110 >      UShort_t       IsoR03NTracks()                 const { return fIsoR03NTracks;            }
111 >      UShort_t       IsoR03NJets()                   const { return fIsoR03NJets;              }
112 >      Double_t       IsoR05SumPt()                   const { return fIsoR05SumPt;              }
113 >      Double_t       IsoR05EmEt()                    const { return fIsoR05EmEt;               }
114 >      Double_t       IsoR05HadEt()                   const { return fIsoR05HadEt;              }
115 >      Double_t       IsoR05HoEt()                    const { return fIsoR05HoEt;               }
116 >      UShort_t       IsoR05NTracks()                 const { return fIsoR05NTracks;            }
117 >      UShort_t       IsoR05NJets()                   const { return fIsoR05NJets;              }
118 >      UInt_t         NChambers()                     const { return fNTraversedChambers;       }
119 >      UInt_t         NSegments()                     const { return fStationMask.NBitsSet();   }
120 >      Int_t          LastHit()                       const;
121        Int_t          LastStation(Double_t iMaxD, Double_t iMaxP)               const;
122        Int_t          LastStation(Int_t iMax=8)                                 const;
123 +      Int_t          ObjId()                         const { return ObjType()*1000+Is();       }
124 +      EObjType       ObjType()                       const { return kMuon;                     }
125 +      void           Print(Option_t *opt="")         const;
126        Bool_t         PromptTight(EClassType type)                              const;
127 <      Bool_t         TMLastStation(Double_t iDYMin = 3., Double_t iPYMin = 3.,
128 <                                   Double_t iDXMin = 3., Double_t iPXMin = 3.,Int_t iN = 2) const;
129 <      Bool_t         TMOneStation(Double_t iDYMin = 3., Double_t iPYMin = 3.,
130 <                                  Double_t iDXMin = 3., Double_t iPXMin = 3.,Int_t iN = 1)  const;
131 <      void           SetGlobalTrk(Track* t)                { fGlobalTrackRef = t;            }
132 <      void           SetStandaloneTrk(Track* t)            { fStandaloneTrackRef = t;        }
133 <      void           SetTrackerTrk(Track* t)               { fTrackerTrackRef = t;           }
134 <      void           SetIsoR03SumPt(Double_t isoR03SumPt)  { fIsoR03SumPt = isoR03SumPt;     }
135 <      void           SetIsoR03EmEt(Double_t isoR03EmEt)    { fIsoR03EmEt = isoR03EmEt;       }
136 <      void           SetIsoR03HadEt(Double_t isoR03HadEt)  { fIsoR03HadEt = isoR03HadEt;     }
137 <      void           SetIsoR03HoEt(Double_t isoR03HoEt)    { fIsoR03HoEt = isoR03HoEt;       }
83 <      void           SetIsoR03NTracks(Int_t isoR03NTracks) { fIsoR03NTracks = isoR03NTracks; }
84 <      void           SetIsoR03NJets(Int_t isoR03NJets)     { fIsoR03NJets = isoR03NJets;     }
85 <      void           SetIsoR05SumPt(Double_t isoR05SumPt)  { fIsoR05SumPt = isoR05SumPt;     }
86 <      void           SetIsoR05EmEt(Double_t isoR05EmEt)    { fIsoR05EmEt = isoR05EmEt;       }
87 <      void           SetIsoR05HadEt(Double_t isoR05HadEt)  { fIsoR05HadEt = isoR05HadEt;     }
88 <      void           SetIsoR05HoEt(Double_t isoR05HoEt)    { fIsoR05HoEt = isoR05HoEt;       }
89 <      void           SetIsoR05NTracks(Int_t isoR05NTracks) { fIsoR05NTracks = isoR05NTracks; }
90 <      void           SetIsoR05NJets(Int_t isoR05NJets)     { fIsoR05NJets = isoR05NJets;     }      
91 <      void           SetEmEnergy(Double_t EmEnergy)        { fEmEnergy = EmEnergy;           }
92 <      void           SetHadEnergy(Double_t HadEnergy)      { fHadEnergy = HadEnergy;         }
93 <      void           SetHoEnergy(Double_t HoEnergy)        { fHoEnergy = HoEnergy;           }
94 <      void           SetEmS9Energy(Double_t EmS9Energy)    { fEmS9Energy = EmS9Energy;       }
95 <      void           SetHadS9Energy(Double_t HadS9Energy)  { fHadS9Energy = HadS9Energy;     }
96 <      void           SetHoS9Energy(Double_t HoS9Energy)    { fHoS9Energy = HoS9Energy;       }
97 <      void           SetNChambers(Int_t iNTraCh)           { fNTraversedChambers = iNTraCh;  }
98 <      void           SetStationMask(UInt_t iStMask)        { fStationMask.SetBits(iStMask);  }
127 >      Bool_t         StationBit(Int_t bit)           const { return fStationMask.TestBit(bit); }
128 >      Bool_t         TMLastStation(Double_t iDYMin = 3, Double_t iPYMin = 3,
129 >                                   Double_t iDXMin = 3, Double_t iPXMin = 3,UInt_t iN = 2) const;
130 >      Bool_t         TMOneStation(Double_t iDYMin = 3, Double_t iPYMin = 3,
131 >                                  Double_t iDXMin = 3, Double_t iPXMin = 3,UInt_t iN = 1)  const;
132 >      void           SetGlobalTrk(const Track *t)          
133 >                       { fGlobalTrkRef = t; ClearMom(); ClearCharge(); }
134 >      void           SetStandaloneTrk(const Track *t)      
135 >                       { fStaTrkRef = t;    ClearMom(); ClearCharge(); }
136 >      void           SetTrackerTrk(const Track *t)        
137 >                       { fTrkTrkRef = t;    ClearMom(); ClearCharge(); }
138        void           SetDX(Int_t iStation, Double_t iDX);
139        void           SetDY(Int_t iStation, Double_t iDY);
140 +      void           SetEmEnergy(Double_t EmEnergy)        { fEmEnergy = EmEnergy;             }
141 +      void           SetEmS9Energy(Double_t EmS9Energy)    { fEmS9Energy = EmS9Energy;         }
142 +      void           SetHadEnergy(Double_t HadEnergy)      { fHadEnergy = HadEnergy;           }
143 +      void           SetHadS9Energy(Double_t HadS9Energy)  { fHadS9Energy = HadS9Energy;       }
144 +      void           SetHoEnergy(Double_t HoEnergy)        { fHoEnergy = HoEnergy;             }
145 +      void           SetHoS9Energy(Double_t HoS9Energy)    { fHoS9Energy = HoS9Energy;         }
146 +      void           SetIsGlobalMuon(Bool_t b)             { fIsGlobalMuon = b;                }
147 +      void           SetIsTrackerMuon(Bool_t b)            { fIsTrackerMuon = b;               }
148 +      void           SetIsStandaloneMuon(Bool_t b)         { fIsStandaloneMuon = b;            }
149 +      void           SetIsCaloMuon(Bool_t b)               { fIsCaloMuon = b;                  }
150 +      void           SetIsoR03SumPt(Double_t isoR03SumPt)  { fIsoR03SumPt = isoR03SumPt;       }
151 +      void           SetIsoR03EmEt(Double_t isoR03EmEt)    { fIsoR03EmEt = isoR03EmEt;         }
152 +      void           SetIsoR03HadEt(Double_t isoR03HadEt)  { fIsoR03HadEt = isoR03HadEt;       }
153 +      void           SetIsoR03HoEt(Double_t isoR03HoEt)    { fIsoR03HoEt = isoR03HoEt;         }
154 +      void           SetIsoR03NTracks(UShort_t isoR03NTrk) { fIsoR03NTracks = isoR03NTrk;      }
155 +      void           SetIsoR03NJets(UShort_t isoR03NJets)  { fIsoR03NJets = isoR03NJets;       }
156 +      void           SetIsoR05SumPt(Double_t isoR05SumPt)  { fIsoR05SumPt = isoR05SumPt;       }
157 +      void           SetIsoR05EmEt(Double_t isoR05EmEt)    { fIsoR05EmEt = isoR05EmEt;         }
158 +      void           SetIsoR05HadEt(Double_t isoR05HadEt)  { fIsoR05HadEt = isoR05HadEt;       }
159 +      void           SetIsoR05HoEt(Double_t isoR05HoEt)    { fIsoR05HoEt = isoR05HoEt;         }
160 +      void           SetIsoR05NTracks(UShort_t isoR05NTrk) { fIsoR05NTracks = isoR05NTrk;      }
161 +      void           SetIsoR05NJets(UShort_t isoR05NJets)  { fIsoR05NJets = isoR05NJets;       }
162 +      void           SetNChambers(UShort_t iNTraCh)        { fNTraversedChambers = iNTraCh;    }
163 +      void           SetNSegments(Int_t iStation, Int_t NSegments);
164        void           SetPullX(Int_t iStation, Double_t iPullX);
165        void           SetPullY(Int_t iStation, Double_t iPullY);
166 +      void           SetStationMask(UInt_t iStMask)        { fStationMask.SetBits(iStMask);    }
167        void           SetTrackDist(Int_t iStation, Double_t iDist);
168        void           SetTrackDistErr(Int_t iStation, Double_t iDistErr);
105      void           SetNSegments(Int_t iStation, Int_t NSegments);
169  
170      protected:
171 <      TRef           fGlobalTrackRef;      //global combined track reference
172 <      TRef           fStandaloneTrackRef;  //standalone muon track reference
173 <      TRef           fTrackerTrackRef;     //tracker track reference
174 <      Double32_t     fIsoR03SumPt;         //isolation size R=0.3 sum pt
175 <      Double32_t     fIsoR03EmEt;          //isolation size R=0.3 em  trans energy
176 <      Double32_t     fIsoR03HadEt;         //isolation size R=0.3 had trans energy
177 <      Double32_t     fIsoR03HoEt;          //isolation size R=0.3 ho  trans energy
178 <      Int_t          fIsoR03NTracks;       //isolation size R=0.3 number of tracks
179 <      Int_t          fIsoR03NJets;         //isolation size R=0.3 number of jets
180 <      Double32_t     fIsoR05SumPt;         //isolation size R=0.5 sum pt
181 <      Double32_t     fIsoR05EmEt;          //isolation size R=0.5 em  trans energy
182 <      Double32_t     fIsoR05HadEt;         //isolation size R=0.5 had trans energy
183 <      Double32_t     fIsoR05HoEt;          //isolation size R=0.5 ho  trans energy
184 <      Int_t          fIsoR05NTracks;       //isolation size R=0.5 number of tracks
185 <      Int_t          fIsoR05NJets;         //isolation size R=0.5 number of jets      
186 <      Double32_t     fEmEnergy;            //energy deposit in ecal
187 <      Double32_t     fHadEnergy;           //energy deposit in hcal
188 <      Double32_t     fHoEnergy;            //energy deposit in outer hcal
189 <      Double32_t     fEmS9Energy;          //?
190 <      Double32_t     fHadS9Energy;         //?
191 <      Double32_t     fHoS9Energy;          //?
192 <      Int_t          fNTraversedChambers;  //number of tranversed chambers
171 >      Double_t       GetMass()                       const { return 105.658369e-3;             }  
172 >
173 >      Ref<Track>     fGlobalTrkRef;        //global combined track reference
174 >      Ref<Track>     fStaTrkRef;           //standalone muon track reference
175 >      Ref<Track>     fTrkTrkRef;           //tracker track reference
176 >      Double32_t     fIsoR03SumPt;         //[0,0,14]isolation size R=0.3 sum pt
177 >      Double32_t     fIsoR03EmEt;          //[0,0,14]isolation size R=0.3 em  trans energy
178 >      Double32_t     fIsoR03HadEt;         //[0,0,14]isolation size R=0.3 had trans energy
179 >      Double32_t     fIsoR03HoEt;          //[0,0,14]isolation size R=0.3 ho  trans energy
180 >      UShort_t       fIsoR03NTracks;       //isolation size R=0.3 number of tracks
181 >      UShort_t       fIsoR03NJets;         //isolation size R=0.3 number of jets
182 >      Double32_t     fIsoR05SumPt;         //[0,0,14]isolation size R=0.5 sum pt
183 >      Double32_t     fIsoR05EmEt;          //[0,0,14]isolation size R=0.5 em  trans energy
184 >      Double32_t     fIsoR05HadEt;         //[0,0,14]isolation size R=0.5 had trans energy
185 >      Double32_t     fIsoR05HoEt;          //[0,0,14]isolation size R=0.5 ho  trans energy
186 >      UShort_t       fIsoR05NTracks;       //isolation size R=0.5 number of tracks
187 >      UShort_t       fIsoR05NJets;         //isolation size R=0.5 number of jets      
188 >      Double32_t     fEmEnergy;            //[0,0,14]energy deposit in ecal
189 >      Double32_t     fHadEnergy;           //[0,0,14]energy deposit in hcal
190 >      Double32_t     fHoEnergy;            //[0,0,14]energy deposit in outer hcal
191 >      Double32_t     fEmS9Energy;          //[0,0,14]energy deposit in 3x3 ecal
192 >      Double32_t     fHadS9Energy;         //[0,0,14]energy deposit in 3x3 hcal
193 >      Double32_t     fHoS9Energy;          //[0,0,14]energy deposit in 3x3 outer hcal
194 >      UShort_t       fNTraversedChambers;  //number of traversed chambers
195        BitMask8       fStationMask;         //bitmap of station with tracks, 0-3 DT, 4-7 CSCs
196 <      Double32_t     fDX[8];               //uncertainty in x in given muon chamber
197 <      Double32_t     fDY[8];               //uncertainty in y in given muon chamber
198 <      Double32_t     fPullX[8];            //pull in x in given muon chamber
199 <      Double32_t     fPullY[8];            //pull in y in given muon chamber
200 <      Double32_t     fTrackDist[8];        //dist. to track in trans. plane in given muon chamber
201 <      Double32_t     fTrackDistErr[8];     //error of dist. to track in trans. plane in chamber
196 >      Double32_t     fDX[8];               //[0,0,14]uncertainty in x in given muon chamber
197 >      Double32_t     fDY[8];               //[0,0,14]uncertainty in y in given muon chamber
198 >      Double32_t     fPullX[8];            //[0,0,14]pull in x in given muon chamber
199 >      Double32_t     fPullY[8];            //[0,0,14]pull in y in given muon chamber
200 >      Double32_t     fTrackDist[8];        //[0,0,14]dist. to track in trans. plane in muon chamber
201 >      Double32_t     fTrackDistErr[8];     //[0,0,14]error of dist. to track in trans. plane
202        Int_t          fNSegments[8];        //number of segments in given muon chamber
203 +      Bool_t         fIsGlobalMuon;        //GlobalMuon algo flag
204 +      Bool_t         fIsTrackerMuon;       //TrackerMuon algo flag
205 +      Bool_t         fIsStandaloneMuon;    //StandaloneMuon algo flag
206 +      Bool_t         fIsCaloMuon;          //CaloMuon algo flag
207  
208      ClassDef(Muon, 1) // Muon class
209    };
# Line 145 | Line 214 | inline const mithep::Track *mithep::Muon
214   {
215    // Return "best" track.
216  
217 <  if (GlobalTrk())
217 >  if (HasGlobalTrk())
218      return GlobalTrk();
219 <  else if (TrackerTrk())
219 >  else if (HasTrackerTrk())
220      return TrackerTrk();
221 <  else if (StandaloneTrk())
221 >  else if (HasStandaloneTrk())
222      return StandaloneTrk();
223  
224 +  Error("BestTrk", "No track reference found, returning NULL pointer.");
225    return 0;
226   }
227  
228   //--------------------------------------------------------------------------------------------------
159 inline const mithep::Track *mithep::Muon::GlobalTrk() const
160 {
161  // Return global combined track.
162
163  return static_cast<const Track*>(fGlobalTrackRef.GetObject());
164 }
165
166 //--------------------------------------------------------------------------------------------------
167 inline const mithep::Track *mithep::Muon::StandaloneTrk() const
168 {
169  // Return standalone track.
170
171  return static_cast<const Track*>(fStandaloneTrackRef.GetObject());
172 }
173
174 //--------------------------------------------------------------------------------------------------
175 inline const mithep::Track *mithep::Muon::TrackerTrk() const
176 {
177  // Return tracker track.
178
179  return static_cast<const Track*>(fTrackerTrackRef.GetObject());
180 }
181
182 //--------------------------------------------------------------------------------------------------
229   inline Double_t mithep::Muon::GetDX(Int_t iStation) const
230   {
231    // Return uncertainty in x in given chamber.
# Line 249 | Line 295 | inline Bool_t mithep::Muon::Has(EClassTy
295  
296    switch (type) {
297      case kAny:
298 <      if (BestTrk())
298 >      if (HasTrk())
299          return kTRUE;
300        break;
301      case kGlobal:
302 <      if (GlobalTrk())
302 >      if (HasGlobalTrk())
303          return kTRUE;
304        break;
305 <    case kTrackerOnly:
306 <      if (TrackerTrk())
305 >    case kTracker:
306 >      if (HasTrackerTrk())
307          return kTRUE;
308        break;
309      case kSta:
310 <      if (StandaloneTrk())
310 >      if (HasStandaloneTrk())
311          return kTRUE;
312        break;
313      case kNone:
314 <      if (!BestTrk())
314 >      if (!HasTrk())
315          return kTRUE;
316        break;
317      default:
# Line 276 | Line 322 | inline Bool_t mithep::Muon::Has(EClassTy
322   }
323  
324   //--------------------------------------------------------------------------------------------------
325 + inline Bool_t mithep::Muon::HasTrk() const
326 + {
327 +  // Return true if the muon has assigned any kind of track.
328 +
329 +  return (HasGlobalTrk() || HasTrackerTrk() || HasStandaloneTrk());
330 + }
331 +
332 + //--------------------------------------------------------------------------------------------------
333   inline mithep::Muon::EClassType mithep::Muon::Is() const
334   {
335    // Return the "best" classification of the muon according to the assigned tracks.
336  
337 <  if (GlobalTrk())
337 >  if (HasGlobalTrk())
338      return kGlobal;
339 <  else if (TrackerTrk())
340 <    return kTrackerOnly;
341 <  else if (StandaloneTrk())
339 >  else if (HasTrackerTrk())
340 >    return kTracker;
341 >  else if (HasStandaloneTrk())
342      return kSta;
343  
344    return kNone;
# Line 347 | Line 401 | inline Bool_t mithep::Muon::PromptTight(
401      case kGlobal:
402        lTrack = GlobalTrk();
403        break;
404 <    case kTrackerOnly:
404 >    case kTracker:
405        lTrack = TrackerTrk();
406        break;
407      case kSta:
# Line 372 | Line 426 | inline Bool_t mithep::Muon::PromptTight(
426  
427   //--------------------------------------------------------------------------------------------------
428   inline Bool_t mithep::Muon::TMOneStation(Double_t iDYMin, Double_t iPYMin,
429 <                                         Double_t iDXMin, Double_t iPXMin, Int_t iN) const
429 >                                         Double_t iDXMin, Double_t iPXMin, UInt_t iN) const
430   {
431    // Check if the muon is matched to at least one station (chamber).
432  
# Line 380 | Line 434 | inline Bool_t mithep::Muon::TMOneStation
434      return kFALSE; //second last one
435  
436    Bool_t pGoodX  = kFALSE;
437 +  Bool_t pBadY   = kFALSE;
438    for (Int_t i0 = 0; i0 < 8; ++i0) {
439      if ((TMath::Abs(GetDX(i0))    < iDXMin  ||
440           TMath::Abs(GetPullX(i0)) < iPXMin))
# Line 388 | Line 443 | inline Bool_t mithep::Muon::TMOneStation
443          (TMath::Abs(GetDY(i0))    < iDYMin  ||
444           TMath::Abs(GetPullY(i0)) < iPYMin))  
445        return kTRUE;
391  Bool_t pBadY   = kFALSE;
446      if (TMath::Abs(GetDY(i0)) < 999999)
447        pBadY = kTRUE;
448      if (i0 == 3 && pGoodX && !pBadY)            
# Line 399 | Line 453 | inline Bool_t mithep::Muon::TMOneStation
453  
454   //--------------------------------------------------------------------------------------------------
455   inline Bool_t mithep::Muon::TMLastStation(Double_t iDYMin, Double_t iPYMin,
456 <                                          Double_t iDXMin, Double_t iPXMin, Int_t iN) const
456 >                                          Double_t iDXMin, Double_t iPXMin, UInt_t iN) const
457   {
458    // Check if the muon is matched to its last station (chamber).
459    
# Line 465 | Line 519 | inline void mithep::Muon::SetPullY(Int_t
519  
520   //--------------------------------------------------------------------------------------------------
521   inline void mithep::Muon::SetTrackDist(Int_t iStation, Double_t iDist)
522 +
523   {
524    // Set track distance in given chamber.
525  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines