00001
00002
00003 #ifndef BFLDDBIPLANEMAP_H
00004 #define BFLDDBIPLANEMAP_H
00005
00007
00008
00009
00010
00011
00012
00013
00014
00015
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
00036
00037 BfldDbiPlaneMap();
00038 virtual ~BfldDbiPlaneMap(){ LEA_DTOR; };
00039
00040
00041 typedef enum EMapIndex {
00042 kFullSteelA,
00043 kFullSteelB,
00044 kPowerOffA,
00045 kPowerOffB,
00046 kDetailSteelA,
00047 kDetailSteelB,
00048 kDetailGapA,
00049 kDetailGapB,
00050 kFullGapA,
00051 kFullGapB,
00052 kEndOfList
00053 } MapIndex_t;
00054
00055 typedef enum EMapShape {
00056 kCircle,
00057 kSquare,
00058 kDiamond
00059 } MapShape_t;
00060
00061
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
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
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
00117
00118 BfldDbiPlaneMap(const BfldDbiPlaneMap& from)
00119 : DbiTableRow(from) { LEA_CTOR; *this = from; }
00120
00121
00122
00123 PlexPlaneId fPlaneId;
00124 Int_t fMapVariant[kEndOfList];
00125 Double_t fScale[kEndOfList];
00126 Double_t fDetailSize;
00127 MapShape_t fDetailShape;
00128 Int_t fBHCurve;
00129 Double_t fBHFactor;
00130 Double_t fBHCutoff;
00131 Double_t fSlotFactor;
00132 Double_t fSlotCutoff;
00133 Double_t fBdotScale;
00134
00135
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
00146
00147 return 0;
00148 }
00149 inline Double_t BfldDbiPlaneMap::GetScale(UInt_t indx) const {
00150 if ( indx < kEndOfList ) return fScale[indx];
00151
00152
00153 return 0.0;
00154 }
00155
00156 inline Bool_t BfldDbiPlaneMap::IsNull(UInt_t indx) const
00157 {
00158
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
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
00174
00175
00176 }
00177 inline void BfldDbiPlaneMap::SetScale(UInt_t indx, Double_t scale) {
00178 if ( indx < kEndOfList ) { fScale[indx] = scale; return; }
00179
00180
00181
00182 }
00183
00184 #endif // BFLDDBIPLANEMAP_H