Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

PlexSEIdAltL.h

Go to the documentation of this file.
00001 
00002 // $Id: PlexSEIdAltL.h,v 1.21 2005/08/26 18:47:03 rhatcher Exp $
00003 //
00004 // PlexSEIdAltL
00005 //
00006 // PlexSEIdAltL is a vector+iterator for PlexSEIdAltLItems 
00007 //
00008 // Author:  R. Hatcher 2001.10.22
00009 //
00011 
00012 #ifndef PLEXSEIDALTL_H
00013 #define PLEXSEIDALTL_H
00014 
00015 #include <iosfwd>
00016 
00017 #include "Plex/PlexSEIdAltLItem.h"
00018 
00019 #include <vector>
00020 class PlexCalib;
00021 
00022 // put operator<< declaration here so CINT dictionary generator can see it
00023 class PlexSEIdAltL;
00024 std::ostream& operator<<(std::ostream& os, const PlexSEIdAltL& alt);
00025 
00026 class PlexSEIdAltL : public std::vector<PlexSEIdAltLItem> {
00027   
00028    // make operator<< a friend so it can access fCurrent
00029    friend std::ostream &operator<<(std::ostream& os, const PlexSEIdAltL& alt);
00030  
00031 public:
00032 
00033    PlexSEIdAltL();                        // necessary for streamer io
00034    PlexSEIdAltL(const PlexSEIdAltL &rhs);             // need deep copy
00035    virtual ~PlexSEIdAltL();
00036 #ifdef ALTL_EXPLICIT_ASSIGNMENT
00037    PlexSEIdAltL& operator=(const PlexSEIdAltL &rhs);  // need deep copy
00038 #endif
00039 
00040    typedef PlexSEIdAltL::iterator          PlexSEIdAltLIter;
00041    typedef PlexSEIdAltL::const_iterator    PlexSEIdAltLConstIter;
00042 
00043    void           AddStripEndId(const PlexStripEndId& seid, 
00044                                 const PlexPixelSpotId& spot,
00045                                 Float_t weight=0,
00046                                 const PlexCalib* calib=0,
00047                                 Int_t adc=0, Double_t time=0);
00048    void           ClearWeights();
00049    void           DropCurrent();
00050    void           DropZeroWeights();
00051    void           KeepTopWeights(UInt_t n=2, Bool_t keeporder=kFALSE);
00052 
00053    const PlexSEIdAltLItem&   GetBestItem() const;
00054          PlexSEIdAltLItem&   GetBestItem();
00055    PlexStripEndId            GetBestSEId() const;
00056    Float_t                   GetBestWeight() const;
00057    const PlexSEIdAltLItem&   GetCurrentItem() const;
00058          PlexSEIdAltLItem&   GetCurrentItem();
00059    PlexStripEndId            GetCurrentSEId() const;
00060    Float_t                   GetCurrentWeight() const; 
00061    UShort_t                  GetDemuxVetoFlag() const 
00062      { return fDemuxVetoFlag; }
00063 
00064    // in principle (for a correctly cabled detector) these are meaningful
00065    Bool_t                    IsVetoShield(Bool_t reportError=true) const;
00066    Detector::Detector_t      GetDetector(Bool_t reportError=true) const;
00067    StripEnd::StripEnd_t      GetEnd(Bool_t reportError=true) const;
00068    Int_t                     GetPlane(Bool_t reportError=true) const;
00069    PlaneView::PlaneView_t    GetPlaneView(Bool_t reportError=true) const;
00070    Int_t                     GetError(Bool_t reportError=true) const
00071       { TestConsistency(reportError); return fError; }
00072 
00073    Bool_t         SetToOppositeEnds(PlexSEIdAltL& that);
00074 
00075    inline Int_t   GetSize() const { return this->size(); } 
00076 
00077    Bool_t         IsValid()  const;
00078    inline void    Next()     const { fCurrent++; }
00079    inline void    Previous() const { fCurrent--; }
00080    inline void    SetFirst() const { fCurrent = 0; }
00081    inline void    SetLast()  const { fCurrent = GetSize()-1; }
00082 
00083    void           SetCurrentWeight(Float_t weight);
00084    void           AddToCurrentWeight(Float_t wgtadd);
00085    void           NormalizeWeights(Float_t wgtsum = 1.0);
00086 
00087    void           SetDemuxVetoFlag(UShort_t flag) { fDemuxVetoFlag = flag; }
00088 
00089    // CINT doesn't make size(), push_back() available
00090    // make alternatives available
00091    UInt_t         Size() const { return this->size(); }
00092    void Push_Back(const PlexSEIdAltLItem& item) { this->push_back(item); }
00093 
00094    void           Print(Option_t *option="") const;
00095 
00096    typedef enum EErrorMasks {
00097       kOkay         = 0x0000,
00098       kBadDetector  = 0x0001,
00099       kBadEnd       = 0x0002,
00100       kBadPlane     = 0x0004,
00101       kBadPlaneView = 0x0008,
00102       kUnchecked    = 0x0010,
00103       kBadIsVeto    = 0x0020
00104    } ErrorMask_t;
00105 
00106    typedef enum EFmtFlagBits {
00107      fmt_Index     = 0x0001,
00108      fmt_Cursor    = 0x0002,
00109      fmt_Best      = 0x0004,
00110      fmt_StripEnd  = 0x0008,
00111      fmt_PixelSpot = 0x0010,
00112      fmt_Weight    = 0x0020,
00113      fmt_PE        = 0x0040,
00114      fmt_SigLin    = 0x0080,
00115      fmt_SigCorr   = 0x0100,
00116      fmt_Time      = 0x0200
00117    } FmtFlagBits_t;
00118 
00119    static void   SetFmtFlag(const UInt_t fmtflg) { fgFmtFlag = fmtflg; }
00120    static UInt_t GetFmtFlag() { return fgFmtFlag; }
00121 
00122  protected:
00123 
00124  private:
00125 
00126    void           TestConsistency(Bool_t reportError = true) const;
00127 
00128    mutable UShort_t fCurrent;       // current position
00129            UShort_t fDemuxVetoFlag; // 0=okay, otherwise demux problem
00130    mutable UShort_t fError;         // see EErrorMasks
00131 
00132    // a global formatting flag
00133    static UInt_t fgFmtFlag;
00134 
00135    ClassDef(PlexSEIdAltL,6)
00136 };
00137 
00138 #endif // PLEXSEIDALTL_H

Generated on Sat Nov 21 22:47:21 2009 for loon by  doxygen 1.3.9.1