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.45 by paus, Sun Oct 23 01:53:16 2011 UTC vs.
Revision 1.49 by paus, Sat May 12 13:33:53 2012 UTC

# Line 9 | Line 9
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
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
18 > // Quality Variables 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)
# Line 26 | Line 26
26   //    XXXXX = NJet  - Sum of Jets inside Cone
27   //
28   // Muon Quality Variables
29 < //  Extracted from the Muon Tracking Associator
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
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 :
# Line 37 | Line 37
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
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
44 > //   NSegments : Number of segments in muon using Segment+Track Arbitration
45   //   NChambers : Number of muon chambers traversed in propagated track
46   //   NMatches  : Number of muon chambers with matches
47   //   LastHit   : Returns farest (from center) station with a recorded segment
48   //   LastStation  : Returns farest station using Segment+Track Arbitration
49   //
50 < //  Muon Id Methods: Please see Muon Id Note(as of now unpublished):
50 > //  Muon Id Methods: Please see Muon Id Note(as of now unpublished):
51   //      https://www.cmsaf.mit.edu/twiki/pub/CmsHep/HepWAnalysis/MuonID-ingo.pdf
52   //   TMOneStation : Returns bool whether muon passes "Tracker Muon One StationId"
53   //    -Matching criteria for one of all segments matched to muon
54   //   TMLastStation : Returns bool whether muon passes "LastStation Id" criteria
55 < //    -Matching criteria for last most segment
55 > //    -Matching criteria for last most segment
56   //
57   // Authors: J.Bendavid, C.Loizides, C.Paus, P.Harris
58   //--------------------------------------------------------------------------------------------------
# Line 76 | Line 76 | namespace mithep {
76          kSta,               //"Standalone"
77          kAny                //any "best" of the above
78        };
79 <      
79 >
80        const Track   *BestTrk()                       const;
81        const Track   *GlobalTrk()                     const { return fGlobalTrkRef.Obj();       }
82        const Track   *StandaloneTrk()                 const { return fStaTrkRef.Obj();          }
# Line 132 | Line 132 | namespace mithep {
132        Bool_t         IsGlobalMuon()                  const { return fIsGlobalMuon;             }
133        Bool_t         IsTrackerMuon()                 const { return fIsTrackerMuon;            }
134        Bool_t         IsStandaloneMuon()              const { return fIsStandaloneMuon;         }
135 +      Bool_t         IsPFMuon()                      const { return fIsPFMuon;                 }
136        Bool_t         IsCaloMuon()                    const { return fIsCaloMuon;               }
137        Double_t       IsoR03SumPt()                   const { return fIsoR03SumPt;              }
138        Double_t       IsoR03EmEt()                    const { return fIsoR03EmEt;               }
139        Double_t       IsoR03HadEt()                   const { return fIsoR03HadEt;              }
140        Double_t       IsoR03HoEt()                    const { return fIsoR03HoEt;               }
141        UShort_t       IsoR03NTracks()                 const { return fIsoR03NTracks;            }
142 <      UShort_t       IsoR03NJets()                   const { return fIsoR03NJets;              }
142 >      UShort_t       IsoR03NJets()                   const { return fIsoR03NJets;              }
143        Double_t       IsoR05SumPt()                   const { return fIsoR05SumPt;              }
144        Double_t       IsoR05EmEt()                    const { return fIsoR05EmEt;               }
145        Double_t       IsoR05HadEt()                   const { return fIsoR05HadEt;              }
# Line 149 | Line 150 | namespace mithep {
150        UInt_t         NChambers()                     const { return fNTraversedChambers;       }
151        UInt_t         NSegments()                     const { return fStationMask.NBitsSet();   }
152        UInt_t         NMatches()                      const { return fNMatches;                 }
153 +      Int_t          NTrkLayersHit()                 const { return fNTrkLayersHit;            }
154 +      Int_t          NTrkLayersNoHit()               const { return fNTrkLayersNoHit;          }
155 +      Int_t          NPxlLayersHit()                 const { return fNPxlLayersHit;            }
156 +      Int_t          NTrkLostHitsIn()                const { return fNTrkLostHitsIn;           }
157 +      Int_t          NTrkLostHitsOut()               const { return fNTrkLostHitsOut;          }
158        Int_t          LastHit()                       const;
159 <      Int_t          LastStation(Double_t iMaxD, Double_t iMaxP)               const;
159 >      Int_t          LastStation(Double_t iMaxD,
160 >                                 Double_t iMaxP)     const;
161        Int_t          LastStation(Int_t iMax=8)       const;
162        Int_t          ObjId()                         const { return ObjType()*1000+Is();       }
163        EObjType       ObjType()                       const { return kMuon;                     }
# Line 164 | Line 171 | namespace mithep {
171        Bool_t         TMOneStation(Double_t iDYMin = 3, Double_t iPYMin = 3,
172                                    Double_t iDXMin = 3, Double_t iPXMin = 3,UInt_t iN = 1)  const;
173        void           SetCharge(Char_t x)                   { fCharge = x; ClearCharge();       }
174 <      void           SetGlobalTrk(const Track *t)          
174 >      void           SetGlobalTrk(const Track *t)
175                         { fGlobalTrkRef = t; ClearMom(); ClearCharge(); }
176 <      void           SetStandaloneTrk(const Track *t)      
176 >      void           SetStandaloneTrk(const Track *t)
177                         { fStaTrkRef = t;    ClearMom(); ClearCharge(); }
178 <      void           SetTrackerTrk(const Track *t)        
178 >      void           SetTrackerTrk(const Track *t)
179                         { fTrkTrkRef = t;    ClearMom(); ClearCharge(); }
180        void           SetDX(Int_t iStation, Double_t iDX);
181        void           SetDY(Int_t iStation, Double_t iDY);
# Line 192 | Line 199 | namespace mithep {
199        void           SetPVBSCompatibility(Double_t x)      { fPVBSCompatibility = x;           }
200        void           SetTrkKink(Double_t x)                { fTrkKink = x;                     }
201        void           SetGlbKink(Double_t x)                { fGlbKink = x;                     }
202 +      void           SetValidFraction(Double_t x)          { fValidFraction = x;               }
203        void           SetEmEnergy(Double_t emEnergy)        { fEmEnergy = emEnergy;             }
204        void           SetEmS9Energy(Double_t emS9Energy)    { fEmS9Energy = emS9Energy;         }
205        void           SetHadEnergy(Double_t hadEnergy)      { fHadEnergy = hadEnergy;           }
# Line 201 | Line 209 | namespace mithep {
209        void           SetIsGlobalMuon(Bool_t b)             { fIsGlobalMuon = b;                }
210        void           SetIsTrackerMuon(Bool_t b)            { fIsTrackerMuon = b;               }
211        void           SetIsStandaloneMuon(Bool_t b)         { fIsStandaloneMuon = b;            }
212 +      void           SetIsPFMuon(Bool_t b)                 { fIsPFMuon = b;                    }
213        void           SetIsCaloMuon(Bool_t b)               { fIsCaloMuon = b;                  }
214        void           SetIsoR03SumPt(Double_t isoR03SumPt)  { fIsoR03SumPt = isoR03SumPt;       }
215        void           SetIsoR03EmEt(Double_t isoR03EmEt)    { fIsoR03EmEt = isoR03EmEt;         }
# Line 217 | Line 226 | namespace mithep {
226        void           SetNValidHits(UShort_t iNValidHits)   { fNValidHits  = iNValidHits;       }
227        void           SetNChambers(UShort_t iNTraCh)        { fNTraversedChambers = iNTraCh;    }
228        void           SetNSegments(Int_t iStation, Int_t nSegments);
229 <      void           SetNMatches(UShort_t iNMatCh)         { fNMatches = iNMatCh;              }
229 >      void           SetNMatches(UShort_t i)               { fNMatches = i;                    }
230 >      void           SetNTrkLayersHit(Int_t i)             { fNTrkLayersHit = i;               }
231 >      void           SetNTrkLayersNoHit(Int_t i)           { fNTrkLayersNoHit = i;             }
232 >      void           SetNPxlLayersHit(Int_t i)             { fNPxlLayersHit = i;               }
233 >      void           SetNTrkLostHitsIn(Int_t i)            { fNTrkLostHitsIn = i;              }
234 >      void           SetNTrkLostHitsOut(Int_t i)           { fNTrkLostHitsOut = i;             }
235        void           SetPtEtaPhi(Double_t pt, Double_t eta, Double_t phi);
236        void           SetPullX(Int_t iStation, Double_t iPullX);
237        void           SetPullY(Int_t iStation, Double_t iPullY);
# Line 225 | Line 239 | namespace mithep {
239        void           SetTrackDist(Int_t iStation, Double_t iDist);
240        void           SetTrackDistErr(Int_t iStation, Double_t iDistErr);
241  
242 +      // Some structural tools
243 +      void           Mark(UInt_t i=1)                const;
244 +
245      protected:
246        Double_t       GetCharge()                     const;
247 <      Double_t       GetMass()                       const { return 105.658369e-3;             }  
247 >      Double_t       GetMass()                       const { return 105.658369e-3;             }
248        void           GetMom()                        const;
249  
250        Vect3C         fMom;                 //stored three-momentum
# Line 236 | Line 253 | namespace mithep {
253        Ref<Track>     fStaTrkRef;           //standalone muon track reference
254        Ref<Track>     fTrkTrkRef;           //tracker track reference
255        Double32_t     fIsoR03SumPt;         //[0,0,14]isolation size R=0.3 sum pt
256 <      Double32_t     fIsoR03EmEt;          //[0,0,14]isolation size R=0.3 em  trans energy
256 >      Double32_t     fIsoR03EmEt;          //[0,0,14]isolation size R=0.3 em  trans energy
257        Double32_t     fIsoR03HadEt;         //[0,0,14]isolation size R=0.3 had trans energy
258        Double32_t     fIsoR03HoEt;          //[0,0,14]isolation size R=0.3 ho  trans energy
259        UShort_t       fIsoR03NTracks;       //isolation size R=0.3 number of tracks
260        UShort_t       fIsoR03NJets;         //isolation size R=0.3 number of jets
261        Double32_t     fIsoR05SumPt;         //[0,0,14]isolation size R=0.5 sum pt
262 <      Double32_t     fIsoR05EmEt;          //[0,0,14]isolation size R=0.5 em  trans energy
262 >      Double32_t     fIsoR05EmEt;          //[0,0,14]isolation size R=0.5 em  trans energy
263        Double32_t     fIsoR05HadEt;         //[0,0,14]isolation size R=0.5 had trans energy
264        Double32_t     fIsoR05HoEt;          //[0,0,14]isolation size R=0.5 ho  trans energy
265        UShort_t       fIsoR05NTracks;       //isolation size R=0.5 number of tracks
266 <      UShort_t       fIsoR05NJets;         //isolation size R=0.5 number of jets      
266 >      UShort_t       fIsoR05NJets;         //isolation size R=0.5 number of jets
267        Double32_t     fEmEnergy;            //[0,0,14]energy deposit in ecal
268        Double32_t     fHadEnergy;           //[0,0,14]energy deposit in hcal
269        Double32_t     fHoEnergy;            //[0,0,14]energy deposit in outer hcal
270 <      Double32_t     fEmS9Energy;          //[0,0,14]energy deposit in 3x3 ecal
270 >      Double32_t     fEmS9Energy;          //[0,0,14]energy deposit in 3x3 ecal
271        Double32_t     fHadS9Energy;         //[0,0,14]energy deposit in 3x3 hcal
272        Double32_t     fHoS9Energy;          //[0,0,14]energy deposit in 3x3 outer hcal
273        Double32_t     fD0PV;                //[0,0,14]transverse impact parameter to signal PV
# Line 262 | Line 279 | namespace mithep {
279        Double32_t     fIp3dPVBS;            //[0,0,14]3d impact parameter to signal PV w/ bs constraint
280        Double32_t     fIp3dPVBSErr;         //[0,0,14]3d impact parameter uncertainty to signal PV w/ bs constraint
281        Double32_t     fPVCompatibility;     //[0,0,14]chi^2 compatibility with signal PV (ndof=2)
282 <      Double32_t     fPVBSCompatibility;   //[0,0,14]chi^2 compatibility with signal PV w/ bs constraint (ndof=2)      
282 >      Double32_t     fPVBSCompatibility;   //[0,0,14]chi^2 compatibility with signal PV w/ bs constraint (ndof=2)
283        Double32_t     fD0PVUB;              //[0,0,14]transverse impact parameter to signal PVUB (unbiased primary vertex - refit removing lepton track)
284        Double32_t     fD0PVUBErr;           //[0,0,14]transverse impact parameter uncertainty to signal PVUB
285        Double32_t     fIp3dPVUB;            //[0,0,14]3d impact parameter to signal PVUB
# Line 273 | Line 290 | namespace mithep {
290        Double32_t     fIp3dPVUBBSErr;       //[0,0,14]3d impact parameter uncertainty to signal PVUB w/ bs constraint
291        Double32_t     fTrkKink;             //[0,0,14]kink algorithm output (tracker track)
292        Double32_t     fGlbKink;             //[0,0,14]kink algorithm output (global track)
293 +      Double32_t     fValidFraction;       //valid tracker hits divided by expected tracker hits
294        UShort_t       fNValidHits;          //number of Valid hits in global fit
295        UShort_t       fNTraversedChambers;  //number of traversed chambers
296        UShort_t       fNMatches;            //number of muon chambers with matches
297 +      Int_t          fNTrkLayersHit;       //number of tracker layers of track
298 +      Int_t          fNTrkLayersNoHit;     //number of missing tracker layers of track
299 +      Int_t          fNPxlLayersHit;       //number of pixel layers of track
300 +      Int_t          fNTrkLostHitsIn;      //number of expected hits before the first hit in the trajectory
301 +      Int_t          fNTrkLostHitsOut;     //number of expected hits after the last hit in the trajectory
302        MuonQuality    fQuality;             //muon quality
303        BitMask8       fStationMask;         //bitmap of station with tracks, 0-3 DT, 4-7 CSCs
304        Double32_t     fDX[8];               //[0,0,14]uncertainty in x in given muon chamber
# Line 288 | Line 311 | namespace mithep {
311        Bool_t         fIsGlobalMuon;        //GlobalMuon algo flag
312        Bool_t         fIsTrackerMuon;       //TrackerMuon algo flag
313        Bool_t         fIsStandaloneMuon;    //StandaloneMuon algo flag
314 +      Bool_t         fIsPFMuon;            //particle flow muon flag
315        Bool_t         fIsCaloMuon;          //CaloMuon algo flag
316  
317 <    ClassDef(Muon, 8) // Muon class
317 >    ClassDef(Muon, 9) // Muon class
318    };
319   }
320  
321   //--------------------------------------------------------------------------------------------------
322 + inline void mithep::Muon::Mark(UInt_t ib) const
323 + {
324 +  // mark myself
325 +  mithep::DataObject::Mark(ib);
326 +  // mark my dependencies if they are there
327 +  if (fGlobalTrkRef.IsValid())
328 +    fGlobalTrkRef.Obj()->Mark(ib);
329 +  if (fStaTrkRef.IsValid())
330 +    fStaTrkRef.Obj()->Mark(ib);
331 +  if (fTrkTrkRef.IsValid())
332 +    fTrkTrkRef.Obj()->Mark(ib);
333 + }
334 +
335 + //--------------------------------------------------------------------------------------------------
336   inline const mithep::Track *mithep::Muon::BestTrk() const
337   {
338    // Return "best" track.
# Line 320 | Line 358 | inline Double_t mithep::Muon::GetCharge(
358      return mithep::ChargedParticle::GetCharge();
359    else
360      return fCharge;
323
361   }
362  
363   //--------------------------------------------------------------------------------------------------
# Line 331 | Line 368 | inline void mithep::Muon::GetMom() const
368    // information has better resolution apparently in some cases than the global fit.)
369    // If momentum is unfilled, fall back to old method of getting momentum from best track
370    // (for backwards compatibility.)
371 <  
372 <  if (fMom.Rho()>0.0) {
371 >
372 >  if (fMom.Rho()>0.0)
373      fCachedMom.SetCoordinates(fMom.Rho(),fMom.Eta(),fMom.Phi(),GetMass());
374 <  }
338 <  else {
374 >  else
375      mithep::ChargedParticle::GetMom();
340  }
341  
376   }
377  
378   //--------------------------------------------------------------------------------------------------
379 < inline Double_t mithep::Muon::GetDX(Int_t iStation) const
379 > inline Double_t mithep::Muon::GetDX(Int_t iStation) const
380   {
381    // Return uncertainty in x in given chamber.
382  
383    assert(iStation >= 0 && iStation < 8);
384 <  return fDX[iStation];
384 >  return fDX[iStation];
385   }
386  
387   //--------------------------------------------------------------------------------------------------
388 < inline Double_t mithep::Muon::GetDY(Int_t iStation) const
388 > inline Double_t mithep::Muon::GetDY(Int_t iStation) const
389   {
390    // Return uncertainty in y in given chamber.
391  
392    assert(iStation >= 0 && iStation < 8);
393 <  return fDY[iStation];
393 >  return fDY[iStation];
394   }
395  
396   //--------------------------------------------------------------------------------------------------
397 < inline Double_t mithep::Muon::GetPullX(Int_t iStation) const
397 > inline Double_t mithep::Muon::GetPullX(Int_t iStation) const
398   {
399    // Return pull in x in given chamber.
400  
401    assert(iStation >= 0 && iStation < 8);
402 <  return fPullX[iStation];
402 >  return fPullX[iStation];
403   }
404  
405   //--------------------------------------------------------------------------------------------------
406 < inline Double_t mithep::Muon::GetPullY(Int_t iStation) const
406 > inline Double_t mithep::Muon::GetPullY(Int_t iStation) const
407   {
408    // Return pull in y in given chamber.
409 <  
409 >
410    assert(iStation >= 0 && iStation < 8);
411 <  return fPullY[iStation];
411 >  return fPullY[iStation];
412   }
413  
414   //--------------------------------------------------------------------------------------------------
415 < inline Double_t mithep::Muon::GetTrackDist(Int_t iStation) const
415 > inline Double_t mithep::Muon::GetTrackDist(Int_t iStation) const
416   {
417    // Return track distance in given chamber.
418  
419    assert(iStation >= 0 && iStation < 8);
420 <  return fTrackDist[iStation];
420 >  return fTrackDist[iStation];
421   }
422  
423   //--------------------------------------------------------------------------------------------------
424 < inline Double_t mithep::Muon::GetTrackDistErr(Int_t iStation) const
424 > inline Double_t mithep::Muon::GetTrackDistErr(Int_t iStation) const
425   {
426    // Return error of track distance in given chamber.
427  
428    assert(iStation >= 0 && iStation < 8);
429 <  return fTrackDistErr[iStation];
429 >  return fTrackDistErr[iStation];
430   }
431  
432   //--------------------------------------------------------------------------------------------------
433 < inline Int_t mithep::Muon::GetNSegments(Int_t iStation) const
433 > inline Int_t mithep::Muon::GetNSegments(Int_t iStation) const
434   {
435    // Return number of segments in chamber.
436  
437    assert(iStation >= 0 && iStation < 8);
438 <  return fNSegments[iStation];
438 >  return fNSegments[iStation];
439   }
440  
441   //--------------------------------------------------------------------------------------------------
# Line 411 | Line 445 | inline Bool_t mithep::Muon::Has(EClassTy
445  
446    switch (type) {
447      case kAny:
448 <      if (HasTrk())
448 >      if (HasTrk())
449          return kTRUE;
450        break;
451      case kGlobal:
452 <      if (HasGlobalTrk())
452 >      if (HasGlobalTrk())
453          return kTRUE;
454        break;
455      case kTracker:
456 <      if (HasTrackerTrk())
456 >      if (HasTrackerTrk())
457          return kTRUE;
458        break;
459      case kSta:
460 <      if (HasStandaloneTrk())
460 >      if (HasStandaloneTrk())
461          return kTRUE;
462        break;
463      case kNone:
464 <      if (!HasTrk())
464 >      if (!HasTrk())
465          return kTRUE;
466        break;
467      default:
# Line 467 | Line 501 | inline Int_t mithep::Muon::LastHit() con
501  
502    Int_t lId = -1;
503    for (Int_t i0 = 0; i0 < 8; ++i0) {
504 <    if (GetDX(i0) < 99999 || GetDY(i0) < 99999)
504 >    if (GetDX(i0) < 99999 || GetDY(i0) < 99999)
505        lId = i0;
506    }
507    return lId;
# Line 478 | Line 512 | inline Int_t mithep::Muon::LastStation(I
512   {
513    // Return the last station, or -1 of no one found.
514  
515 <  Int_t lId = -1;
516 <  if(TMath::Abs(iMax) > 8)
515 >  Int_t lId = -1;
516 >  if(TMath::Abs(iMax) > 8)
517      iMax = 8;
518    for (Int_t i0 = 0; i0 < iMax; ++i0) {
519      if (StationBit(i0) && ((lId % 4) < (i0 % 4)))
# Line 495 | Line 529 | inline Int_t mithep::Muon::LastStation(D
529  
530    Int_t lId = -1;
531    for (Int_t i0 = 0; i0 < 8; ++i0) {
532 <    if ((lId % 4) > (i0 % 4))
532 >    if ((lId % 4) > (i0 % 4))
533        continue;
534      if (GetTrackDist(i0) < iMaxD &&
535 <        GetTrackDist(i0)/GetTrackDistErr(i0) < iMaxP)
535 >        GetTrackDist(i0)/GetTrackDistErr(i0) < iMaxP)
536        lId = i0;
537    }
538    return lId;
# Line 527 | Line 561 | inline Bool_t mithep::Muon::PromptTight(
561        break;
562    }
563  
564 <  if (lTrack == 0)
564 >  if (lTrack == 0)
565      return kFALSE;
566 <  if (lTrack->NHits() < 11)        
566 >  if (lTrack->NHits() < 11)
567      return kFALSE;
568 <  if (lTrack->Chi2()/lTrack->Ndof() > 10.)                        
568 >  if (lTrack->Chi2()/lTrack->Ndof() > 10.)
569      return kFALSE;
570 <  if (lTrack->D0() > 0.2)                                          
570 >  if (lTrack->D0() > 0.2)
571      return kFALSE;
572 <  if ((LastHit() % 4) == 0)                                  
572 >  if ((LastHit() % 4) == 0)
573      return kFALSE;
574    return kTRUE;
575   }
# Line 544 | Line 578 | inline Bool_t mithep::Muon::PromptTight(
578   inline Bool_t mithep::Muon::TMOneStation(Double_t iDYMin, Double_t iPYMin,
579                                           Double_t iDXMin, Double_t iPXMin, UInt_t iN) const
580   {
581 <  // Check if the muon is matched to at least one station (chamber).
581 >  // Check if the muon is matched to at least one station (chamber).
582  
583    if (NSegments() < iN)
584      return kFALSE; //second last one
585  
586 <  Bool_t pGoodX  = kFALSE;
586 >  Bool_t pGoodX  = kFALSE;
587    Bool_t pBadY   = kFALSE;
588    for (Int_t i0 = 0; i0 < 8; ++i0) {
589      if ((TMath::Abs(GetDX(i0))    < iDXMin  ||
590 <         TMath::Abs(GetPullX(i0)) < iPXMin))
591 <      pGoodX = kTRUE;
590 >         TMath::Abs(GetPullX(i0)) < iPXMin))
591 >      pGoodX = kTRUE;
592      if (pGoodX &&
593 <        (TMath::Abs(GetDY(i0))    < iDYMin  ||
594 <         TMath::Abs(GetPullY(i0)) < iPYMin))  
593 >        (TMath::Abs(GetDY(i0))    < iDYMin  ||
594 >         TMath::Abs(GetPullY(i0)) < iPYMin))
595        return kTRUE;
596 <    if (TMath::Abs(GetDY(i0)) < 999999)
596 >    if (TMath::Abs(GetDY(i0)) < 999999)
597        pBadY = kTRUE;
598 <    if (i0 == 3 && pGoodX && !pBadY)            
598 >    if (i0 == 3 && pGoodX && !pBadY)
599        return kTRUE;
600    }
601    return kFALSE;
# Line 571 | Line 605 | inline Bool_t mithep::Muon::TMOneStation
605   inline Bool_t mithep::Muon::TMLastStation(Double_t iDYMin, Double_t iPYMin,
606                                            Double_t iDXMin, Double_t iPXMin, UInt_t iN) const
607   {
608 <  // Check if the muon is matched to its last station (chamber).
609 <  
610 <  if (NSegments() < iN)
608 >  // Check if the muon is matched to its last station (chamber).
609 >
610 >  if (NSegments() < iN)
611      return kFALSE; //second last one
612  
613    Int_t lLast = LastStation(-3.,-3.); // last required station
614 <  if (lLast < 0)                                  
614 >  if (lLast < 0)
615      return kFALSE;
616 <  if (GetDX(lLast) > 9999.)                
616 >  if (GetDX(lLast) > 9999.)
617      return kFALSE;
618    lLast = LastStation(); //no requirements
619 <  if (lLast < 0)                                  
619 >  if (lLast < 0)
620      return kFALSE;
621    if (!(TMath::Abs(GetDX(lLast))    < iDXMin  ||
622 <        TMath::Abs(GetPullX(lLast)) < iPXMin))  
622 >        TMath::Abs(GetPullX(lLast)) < iPXMin))
623      return kFALSE;
624 <  if (lLast == 3)
624 >  if (lLast == 3)
625      lLast = LastStation(3);
626 <  if (lLast < 0)                                  
626 >  if (lLast < 0)
627      return kFALSE;
628    if (!(TMath::Abs(GetDY(lLast))    < iDYMin ||
629 <        TMath::Abs(GetPullY(lLast)) < iPYMin))  
629 >        TMath::Abs(GetPullY(lLast)) < iPYMin))
630      return kFALSE;
631    return kTRUE;
632   }
633  
634   //--------------------------------------------------------------------------------------------------
635 < inline void mithep::Muon::SetDX(Int_t iStation, Double_t iDX)
635 > inline void mithep::Muon::SetDX(Int_t iStation, Double_t iDX)
636   {
637    // Return uncertainty in x in given chamber.
638  
# Line 625 | Line 659 | inline void mithep::Muon::SetPullX(Int_t
659   }
660  
661   //--------------------------------------------------------------------------------------------------
662 < inline void mithep::Muon::SetPullY(Int_t iStation, Double_t iPullY)
662 > inline void mithep::Muon::SetPullY(Int_t iStation, Double_t iPullY)
663   {
664    // Set pull in y in given chamber.
665  
# Line 634 | Line 668 | inline void mithep::Muon::SetPullY(Int_t
668   }
669  
670   //--------------------------------------------------------------------------------------------------
671 < inline void mithep::Muon::SetTrackDist(Int_t iStation, Double_t iDist)
671 > inline void mithep::Muon::SetTrackDist(Int_t iStation, Double_t iDist)
672  
673   {
674    // Set track distance in given chamber.
# Line 653 | Line 687 | inline void mithep::Muon::SetTrackDistEr
687   }
688  
689   //--------------------------------------------------------------------------------------------------
690 < inline void mithep::Muon::SetNSegments(Int_t iStation, Int_t nSegments)
690 > inline void mithep::Muon::SetNSegments(Int_t iStation, Int_t nSegments)
691   {
692    // Set number of segments in chamber.
693  
# Line 665 | Line 699 | inline void mithep::Muon::SetNSegments(I
699   inline void mithep::Muon::SetPtEtaPhi(Double_t pt, Double_t eta, Double_t phi)
700   {
701    // Set three-vector
702 <  
702 >
703    fMom.Set(pt,eta,phi);
704    ClearMom();
705   }
706   #endif
673
674
675
676
677

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines