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

PlexScintMdlId.h

Go to the documentation of this file.
00001 
00002 // $Id: PlexScintMdlId.h,v 1.12 2005/08/26 18:47:04 rhatcher Exp $
00003 //
00004 // PlexScintMdlId
00005 //
00006 // PlexScintMdlId encapsulates scint module encoding
00007 //
00008 // Author:  R. Hatcher 2002.06.26
00009 //
00011 
00012 #ifndef PLEXSCINTMDLID_H
00013 #define PLEXSCINTMDLID_H
00014 
00015 #include <iosfwd>
00016 
00017 #include "Plex/PlexPlaneId.h"
00018 
00019 class PlexScintMdlId;
00020 std::ostream& operator<<(std::ostream& os, const PlexScintMdlId& p);
00021 
00022 class PlexScintMdlId : public PlexPlaneId {
00023 
00024  public:
00025 
00026    PlexScintMdlId();                        // necessary for streamer io
00027    PlexScintMdlId(PlexPlaneId plnid, Int_t module);
00028    PlexScintMdlId(Detector::Detector_t detector,
00029                   Int_t plane, Int_t module,
00030                   PlaneView::PlaneView_t view=PlaneView::kUnknown,
00031                   PlaneCoverage::PlaneCoverage_t cover=PlaneCoverage::kUnknown);
00032 
00033    virtual ~PlexScintMdlId() { ; } // no owned data members
00034 
00035    // use these two with caution as they work on the rawest level
00036    explicit PlexScintMdlId(const UInt_t encoded);
00037    inline UInt_t            GetEncoded() const { return fEncoded; }
00038 
00039    const char              *AsString(Option_t *option="") const;
00040 
00041    UShort_t                 GetModule() const;
00042    UChar_t                  GetModuleType() const;
00043 
00044    // compactified plane,module (assuming only east/west ends)
00045    // packed tightly, not simple bit shifts
00046    // 18 bits or less (unless Far has more than 682 planes)
00047    Int_t                    BuildPlnMdlKey() const;
00048    static PlexScintMdlId    UnbuildPlnMdlKey(Detector::Detector_t det, Int_t key);
00049 
00050    void                     Print(Option_t *option="") const;
00051 
00052    void                     SetModule(UInt_t module);
00053 
00054    friend Bool_t operator< (const PlexScintMdlId &lhs, const PlexScintMdlId &rhs);
00055    friend Bool_t operator<=(const PlexScintMdlId &lhs, const PlexScintMdlId &rhs);
00056    friend Bool_t operator==(const PlexScintMdlId &lhs, const PlexScintMdlId &rhs);
00057    friend Bool_t operator!=(const PlexScintMdlId &lhs, const PlexScintMdlId &rhs);
00058    friend Bool_t operator> (const PlexScintMdlId &lhs, const PlexScintMdlId &rhs);
00059    friend Bool_t operator>=(const PlexScintMdlId &lhs, const PlexScintMdlId &rhs);
00060 
00061    // these use a pseudo-database to hold info about different
00062    // plane configurations (mostly having to do with scint modules)
00063    // this first on is not to be confused w/ ctor
00064    // Get[Mapper]StripInMdl returns -1 for nonsense input
00065    static PlexScintMdlId StripToScintMdl(const PlexPlaneId& plnid, Int_t strip);
00066    static Short_t  GetStripInMdl(const PlexPlaneId& plnid, UInt_t strip);
00067    static Short_t  GetMapperStripInMdl(const PlexPlaneId& plnid, UInt_t strip);
00068    static UShort_t GetNumStripsInPln(const PlexPlaneId& plnid);
00069    static UShort_t GetNumScintMdlsInPln(const PlexPlaneId& plnid);
00070 
00071  protected:
00072 
00073  private:
00074 
00075    // hide PlexPlaneId's version of this member function
00076    // as this doesn't make sense for a PlexScintMdlId
00077    void                     SetIsSteel(Bool_t /* isSteel */) {;}
00078 
00079    ClassDef(PlexScintMdlId,1)
00080 };
00081 
00082 #ifndef __CINT__
00083 inline PlexScintMdlId::PlexScintMdlId() { fEncoded = defaultPlexScintMdlId; }
00084 inline PlexScintMdlId::PlexScintMdlId(const UInt_t encoded) 
00085 { fEncoded = encoded; }
00086 #endif /* __CINT__ */
00087 
00088 #endif // PLEXSCINTMDLID_H

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