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

PlexSEIdAltLItem.h

Go to the documentation of this file.
00001 
00002 // $Id: PlexSEIdAltLItem.h,v 1.8 2005/02/02 11:45:48 tagg Exp $
00003 //
00004 // PlexSEIdAltLItem
00005 //
00006 // PlexSEIdAltLItem is a strip-end alternative list (vector) item
00007 //
00008 // Author:  R. Hatcher 2001.10.22
00009 //
00011 
00012 #ifndef PLEXSEIDALTLITEM_H
00013 #define PLEXSEIDALTLITEM_H
00014 
00015 #include "Plex/PlexStripEndId.h"
00016 #include "Plex/PlexPixelSpotId.h"
00017 #include "LeakChecker/Lea.h"
00018 
00019 #include <iosfwd>
00020 
00021 // put operator<< declaration here so CINT dictionary generator can see it
00022 class PlexSEIdAltLItem;
00023 std::ostream& operator<<(std::ostream& os, const PlexSEIdAltLItem& item);
00024 
00025 class PlexSEIdAltLItem {
00026 
00027   // make operator<< a friend so it can look at PlexSEIdAltLItem's privates
00028   friend std::ostream& operator<<(std::ostream& os, const PlexSEIdAltLItem& item);
00029 
00030 public:
00031 
00032    PlexSEIdAltLItem() :   // null ctor
00033      fStripEndId(),
00034      fPixelSpotId(),
00035      fWeight(0), fPE(0), fSigLin(0), fSigCorr(0), fTime(-1) { LEA_CTOR; };
00036 
00037    PlexSEIdAltLItem(const PlexStripEndId& seid, 
00038                     const PlexPixelSpotId& spotid, 
00039                     Float_t wgt=0,
00040                     Float_t pe=0, Float_t siglin=0, Float_t sigcorr=0,
00041                     Double_t time=0) : // basic ctor
00042      fStripEndId(seid),
00043      fPixelSpotId(spotid),
00044      fWeight(wgt), fPE(pe), 
00045      fSigLin(siglin), fSigCorr(sigcorr),
00046      fTime(time) { LEA_CTOR; };
00047 
00048    PlexSEIdAltLItem(const PlexSEIdAltLItem& that) // copy ctor
00049      { LEA_CTOR; *this = that; }
00050 
00051    virtual ~PlexSEIdAltLItem() { LEA_DTOR; } // dtor
00052 
00053    PlexStripEndId  GetSEId() const { return fStripEndId; }
00054    PlexPixelSpotId GetPixelSpotId() const { return fPixelSpotId; }
00055    Float_t         GetWeight() const { return fWeight; }
00056    Bool_t          IsZeroWeight() const { return fWeight == 0; }
00057    Float_t         GetPE() const { return fPE; }
00058    Float_t         GetSigLin() const { return fSigLin; }
00059    Float_t         GetSigCorr() const { return fSigCorr; }
00060    Double_t        GetTime() const { return fTime; }
00061 
00062    void            SetWeight(Float_t wgt) { fWeight = wgt; }
00063    void            AddToWeight(Float_t wgtadd) { fWeight += wgtadd; }
00064                     
00065    void            SetPE(Float_t pe) { fPE = pe; }
00066    void            SetSigLin(Float_t siglin) { fSigLin = siglin; }
00067    void            SetSigCorr(Float_t sigcorr) { fSigCorr = sigcorr; }
00068    void            SetTime(Double_t time) { fTime = time; }
00069 
00070    void            AddToTime(Double_t tadd) { fTime += tadd; }
00071 
00072    friend Bool_t   operator==(const PlexSEIdAltLItem &lhs,
00073                               const PlexSEIdAltLItem &rhs);
00074 
00075    // sort (by default) based on weight
00076    friend Bool_t   operator<(const PlexSEIdAltLItem &lhs,
00077                              const PlexSEIdAltLItem &rhs);
00078 
00079    virtual void    Print(Option_t *option="") const;
00080 
00081 protected:
00082 
00083    PlexStripEndId    fStripEndId;  // which strip-end
00084    PlexPixelSpotId   fPixelSpotId; // which pixel-spot
00085    Float_t           fWeight;      // stored demux weight
00086    Float_t           fPE;          // ADC value converted to photoelectrons
00087    Float_t           fSigLin;      // correct for time depend & linearity by LI
00088    Float_t           fSigCorr;     // correct for strip-to-strip variations
00089    Double_t          fTime;        // timestamp, corrected for offsets and scale differences. 
00090 
00091 private:
00092 
00093    ClassDef(PlexSEIdAltLItem,3)
00094 };
00095 
00096 #ifndef __CINT__
00097 inline Bool_t operator==(const PlexSEIdAltLItem& lhs, 
00098                          const PlexSEIdAltLItem& rhs)
00099 {
00100    return lhs.fStripEndId == rhs.fStripEndId;
00101 }
00102 
00103 inline Bool_t operator<(const PlexSEIdAltLItem& lhs, 
00104                          const PlexSEIdAltLItem& rhs)
00105 {
00106    return lhs.fWeight < rhs.fWeight;
00107 }
00108 
00109 #endif /* __CINT__ */
00110 #endif // PLEXSEIDALTLITEM_H

Generated on Mon Feb 15 11:07:23 2010 for loon by  doxygen 1.3.9.1