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

BfldDbiPlaneMap.h

Go to the documentation of this file.
00001 // $Id: BfldDbiPlaneMap.h,v 1.10 2008/03/14 05:14:13 rhatcher Exp $
00002 
00003 #ifndef BFLDDBIPLANEMAP_H
00004 #define BFLDDBIPLANEMAP_H
00005 
00007 // BfldDbiPlaneMap
00008 //
00009 // Package: BField
00010 //
00011 // Concept: DBI table to record when what maps to use for which planes
00012 //          in the detector (at any given VldContext)
00013 //
00014 //
00015 // Author: R. Hatcher 2003-05-29
00016 //
00018 
00019 #include "DatabaseInterface/DbiTableRow.h"
00020 #include "LeakChecker/Lea.h"
00021 
00022 #include "Plex/PlexPlaneId.h"
00023 #include "Validity/VldContext.h"
00024 
00025 class DbiValidityRec;
00026 
00027 class BfldDbiPlaneMap;
00028 std::ostream& operator<<(std::ostream& os, const BfldDbiPlaneMap& pi);
00029 
00030 class BfldDbiPlaneMap : public DbiTableRow
00031 {
00032 
00033 public:
00034 
00035 // Constructors and destructors.
00036 
00037    BfldDbiPlaneMap();
00038    virtual ~BfldDbiPlaneMap(){ LEA_DTOR; };
00039 
00040    // enums and their types
00041    typedef enum EMapIndex {
00042      kFullSteelA,    // full map in the steel
00043      kFullSteelB,
00044      kPowerOffA,     // full map with power off
00045      kPowerOffB,
00046      kDetailSteelA,  // detail of the steel
00047      kDetailSteelB,
00048      kDetailGapA,    // detail of gap region (inter-steel plane)
00049      kDetailGapB,
00050      kFullGapA,      // full map of gap region
00051      kFullGapB,
00052      kEndOfList
00053    } MapIndex_t;
00054 
00055    typedef enum EMapShape {
00056      kCircle,
00057      kSquare,
00058      kDiamond  // square in UV space
00059    } MapShape_t;
00060 
00061 // State testing member functions
00062 
00063    PlexPlaneId  GetPlaneId() const      { return fPlaneId; }
00064    Int_t        GetMapVariant(UInt_t indx=0) const;
00065    Double_t     GetScale(UInt_t indx=0) const;
00066    Double_t     GetDetailSize() const   { return fDetailSize; }
00067    MapShape_t   GetDetailShape() const  { return fDetailShape; }
00068    Int_t        GetBHCurveIndex() const { return fBHCurve; }
00069    Double_t     GetBHFactor() const     { return fBHFactor; }
00070    Double_t     GetBHCutoff() const     { return fBHCutoff; }
00071    Double_t     GetSlotFactor() const   { return fSlotFactor; }
00072    Double_t     GetSlotCutoff() const   { return fSlotCutoff; }
00073    Double_t     GetBdotScale() const    { return fBdotScale; }
00074 
00075    Bool_t       IsInDetail(Double_t x, Double_t y) const;
00076 
00077    Bool_t       IsNull(UInt_t indx) const;
00078    Bool_t       IsPairNull(UInt_t indx) const;
00079 
00080    virtual DbiTableRow* CreateTableRow() const { return new BfldDbiPlaneMap; }
00081 
00082 // I/O  member functions
00083 
00084    virtual void Fill(DbiResultSet& rs,
00085                      const DbiValidityRec* vrec);
00086    virtual void Store(DbiOutRowStream& ors,
00087                       const DbiValidityRec* vrec) const;
00088 
00089    virtual void Print(Option_t *option = "") const;
00090    virtual std::ostream& FormatToOStream(std::ostream& os,
00091                                          Option_t *option="") const;
00092 
00093    virtual   Int_t GetAggregateNo() const;
00094    virtual  UInt_t GetIndex(UInt_t defIndex) const;
00095 
00096    // trust proper use of "const" to avoid misuse of these methods
00097    void SetPlaneId(PlexPlaneId plnid)       { fPlaneId     = plnid; }
00098    void SetMapVariant(UInt_t indx, Int_t imap);
00099    void SetScale(UInt_t indx, Double_t scale);
00100    void SetDetailSize(Double_t rinscribed)  { fDetailSize  = rinscribed; }
00101    void SetDetailShape(Int_t ishape);
00102    void SetBHCurveIndex(UInt_t bhcurve)     { fBHCurve     = bhcurve; }
00103    void SetBHFactor(Double_t bhfactor)      { fBHFactor    = bhfactor; }
00104    void SetBHCutoff(Double_t bhcutoff)      { fBHCutoff    = bhcutoff; }
00105    void SetSlotFactor(Double_t slotfactor)  { fSlotFactor  = slotfactor; }
00106    void SetSlotCutoff(Double_t slotcutoff)  { fSlotCutoff  = slotcutoff; }
00107    void SetBdotScale(Double_t bdotscale)    { fBdotScale   = bdotscale; }
00108 
00109    static const char* GetTableDescr();
00110    static void        SetDefensiveUnpkg(Bool_t defensive) 
00111      { fgDefensiveUnpkg = defensive; }
00112    static Bool_t      GetDefensiveUnpkg() { return fgDefensiveUnpkg; }
00113 
00114 private:  
00115 
00116 // Constructors and destructors.
00117 
00118    BfldDbiPlaneMap(const BfldDbiPlaneMap& from)
00119      : DbiTableRow(from) { LEA_CTOR; *this = from; }
00120 
00121 // Data members
00122 
00123    PlexPlaneId              fPlaneId;
00124    Int_t                    fMapVariant[kEndOfList]; // map index
00125    Double_t                 fScale[kEndOfList];      // linear scale factor
00126    Double_t                 fDetailSize;            // inscribed size of detail region
00127    MapShape_t               fDetailShape;           // shape of detail region
00128    Int_t                    fBHCurve;               // chemistry index
00129    Double_t                 fBHFactor;              // alt BH correction factor
00130    Double_t                 fBHCutoff;              // alt BH correction factor
00131    Double_t                 fSlotFactor;            // alt correction factor
00132    Double_t                 fSlotCutoff;            // alt correction factor
00133    Double_t                 fBdotScale;             // scale factor for BDot
00134 
00135 // class-wide static
00136 
00137    static Bool_t fgDefensiveUnpkg;
00138 
00139 ClassDef(BfldDbiPlaneMap,0)
00140 
00141 };
00142 
00143 inline Int_t BfldDbiPlaneMap::GetMapVariant(UInt_t indx) const {
00144   if ( indx < kEndOfList ) return fMapVariant[indx];
00145   // MSGMAX("Bfld",Msg::kWarning,10)
00146   //  << "GetMapVariant indx=" << indx << " must be [0,1]." << endl;
00147   return 0;
00148 }
00149 inline Double_t BfldDbiPlaneMap::GetScale(UInt_t indx) const {
00150   if ( indx < kEndOfList ) return fScale[indx];
00151   // MSGMAX("Bfld",Msg::kWarning,10)
00152   //  << "GetScale indx=" << indx << " must be [0,1]." << endl;
00153   return 0.0;
00154 }
00155 
00156 inline Bool_t BfldDbiPlaneMap::IsNull(UInt_t indx) const
00157 {
00158   // no info  non-zero map/scale combination
00159   if ( indx >= kEndOfList ) return true;
00160   return ( ( fMapVariant[indx] * fScale[indx] ) == 0 );
00161 }
00162 
00163 inline Bool_t BfldDbiPlaneMap::IsPairNull(UInt_t indx) const
00164 {
00165   // no info  non-zero map/scale combination for A+B pair
00166   if ( indx >= kEndOfList-1 ) return true;
00167   return ( ( fMapVariant[indx]   * fScale[indx]   ) == 0 &&
00168            ( fMapVariant[indx+1] * fScale[indx+1] ) == 0    );
00169 }
00170 
00171 inline void BfldDbiPlaneMap::SetMapVariant(UInt_t indx, Int_t imap) {
00172   if ( indx < kEndOfList ) { fMapVariant[indx] = imap; return; }
00173   // MSGMAX("Bfld",Msg::kWarning,10)
00174   //  << "SetMapVariant indx=" << indx 
00175   //  << " must be [0," << kEndOfList << "]." << endl;
00176 }
00177 inline void BfldDbiPlaneMap::SetScale(UInt_t indx, Double_t scale) {
00178   if ( indx < kEndOfList ) { fScale[indx] = scale; return; }
00179   // MSGMAX("Bfld",Msg::kWarning,10)
00180   //  << "SetScale indx=" << indx 
00181   //  << " must be [0," << kEndOfList << "]." << endl;
00182 }
00183 
00184 #endif  // BFLDDBIPLANEMAP_H

Generated on Mon Feb 15 11:06:25 2010 for loon by  doxygen 1.3.9.1