00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012 #ifndef ALGDEMUXBEAM_H
00013 #define ALGDEMUXBEAM_H
00014
00015 #include "Algorithm/AlgBase.h"
00016 #include "Validity/VldContext.h"
00017
00018 class CandDeMuxDigitHandle;
00019 class DmxPlaneItr;
00020 class DmxStatus;
00021 class CandDeMuxDigitHandleItr;
00022
00023 class AlgDeMuxBeam : public AlgBase
00024 {
00025
00026 public:
00027
00028
00029 AlgDeMuxBeam();
00030 virtual ~AlgDeMuxBeam();
00031
00032
00033 virtual void Trace(const char *c) const;
00034
00035
00036 virtual void RunAlg(AlgConfig &acd, CandHandle &ch, CandContext &cx);
00037
00038 private:
00039
00040 Float_t fFinalShowerRegionSlope;
00041 Float_t fFinalShowerRegionIntercept;
00042 Float_t fInitialMuonRegionSlope;
00043 Float_t fInitialMuonRegionIntercept;
00044 Float_t fDigitResetCut;
00045 Int_t fMaxBadResidual;
00046 Float_t fMaxResidual;
00047 Float_t fMaxMuonRemovalFraction;
00048 Int_t fMaxStripAdjustment;
00049 Int_t fMinMuonPlanesRequired;
00050 Float_t fMinMatedChargeFrac;
00051 Int_t fMuonPlanesInSet;
00052 Float_t fMuonSlopeLimit;
00053 Int_t fMuonStartPlaneNumber;
00054 Float_t fMuonStartPlaneZPos;
00055 Int_t fPlanesInSet;
00056 Int_t fStrayCut;
00057 Int_t fStrayPlanes;
00058 Int_t fNumberOfHypotheses;
00059 Float_t fShowerMuonTransverseDifference;
00060 VldContext fVldContext;
00061
00062 void DeMuxFirstNPlanesTest(DmxPlaneItr &planeItr, DmxPlaneItr &validPlaneItr);
00063 void FindShowerWindowSolution(DmxPlaneItr &windowPlaneItr, Float_t cog,
00064 Int_t firstPlane, Int_t lastPlane);
00065 void SetFirstNPlanes(DmxPlaneItr &planeItr, Float_t slope, Float_t intercept);
00066 void SetMuonRegionWindow(DmxPlaneItr &planeItr, Float_t slope, Float_t intercept, bool setAll);
00067 void SetShowerRegionWindow(DmxPlaneItr &planeItr, Float_t slope, Float_t intercept);
00068 void UseShowerSlidingWindow(DmxPlaneItr &planeItr, DmxPlaneItr &validPlaneItr,
00069 DmxStatus *status);
00070 void UseMuonSlidingWindow(DmxPlaneItr &planeItr, DmxPlaneItr &validPlaneItr,
00071 DmxStatus *status);
00072 void UseReverseMuonSlidingWindow(DmxPlaneItr &planeItr, DmxPlaneItr &validPlaneItr,
00073 DmxStatus *status);
00074 void RegionLinearFit(Float_t &slope, Float_t &intercept, Float_t &chiSqr,
00075 Float_t *x, Float_t *y, Float_t *sigma,
00076 Float_t *residual, Int_t numPoints);
00077 void FindFitOverNPlanes(Float_t *x, Float_t *y, Float_t *sigma, Float_t *residual,
00078 Float_t &slope, Float_t &intercept, Int_t numPoints,
00079 Int_t *planeNum);
00080 Float_t FindRegionMatedChargeFraction(DmxPlaneItr &validPlaneItr);
00081 void ReconcileShowerAndMuonRegions(DmxPlaneItr &planeItr,
00082 CandDeMuxDigitHandleItr &cdhit);
00083
00084
00085 void DeMuxFirstNPlanes(DmxPlaneItr &planeItr, DmxPlaneItr &validPlaneItr,
00086 CandDeMuxDigitHandleItr &cdhit);
00087 Float_t FindDigitCoG(DmxPlaneItr &validPlaneItr, CandDeMuxDigitHandleItr &cdhit);
00088 void FindFit(DmxPlaneItr &planeItr, DmxPlaneItr &validPlaneItr,
00089 Double_t &a1, Double_t &a2, Double_t &a3,
00090 Double_t &a4, Double_t &bestChi2,
00091 Int_t leverArm, Int_t *hypotheses);
00092 void FindFitForHypothesisSet(DmxPlaneItr &planeItr, Double_t &prevChiSq,
00093 Double_t &a1, Double_t &a2, Double_t &a3,
00094 Double_t &a4, Int_t* hypotheses,
00095 Int_t leverArm);
00096 Bool_t FindPlanesToDropFromFit(DmxPlaneItr &planeItr, Double_t a1, Double_t a2,
00097 Double_t a3, Double_t a4,
00098 Int_t leverArm);
00099 void FindRMSOfPlanes(DmxPlaneItr &planeItr, Int_t leverArm, Int_t *hypsToUse,
00100 Float_t &cog, Float_t &rms);
00101
00102 ClassDef(AlgDeMuxBeam,8)
00103
00104 };
00105
00106 #endif // ALGDEMUXBEAM_H
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135