#include <PlexMuxBoxId.h>
Inheritance diagram for PlexMuxBoxId:

Public Member Functions | |
| PlexMuxBoxId () | |
| PlexMuxBoxId (const Detector::Detector_t detector, const ElecType::Elec_t electronics, Char_t eastwest, Char_t racklevel, UInt_t rackbay, UInt_t inrack) | |
| PlexMuxBoxId (const PlexMuxBoxId &muxid) | |
| PlexMuxBoxId & | operator= (const PlexMuxBoxId &muxid) |
| virtual | ~PlexMuxBoxId () |
| PlexMuxBoxId (const UInt_t encoded) | |
| UInt_t | GetEncoded () const |
| virtual const char * | AsString (Option_t *option="") const |
| Detector::Detector_t | GetDetector () const |
| ElecType::Elec_t | GetElecType () const |
| Char_t | GetEastWest () const |
| Char_t | GetRackLevel () const |
| UShort_t | GetRackBay () const |
| UShort_t | GetInRack () const |
| UInt_t | GetNumericMuxBox () const |
| Bool_t | IsValid () const |
| void | Print (Option_t *option="") const |
| void | SetDetector (Detector::Detector_t detector) |
| void | SetElecType (ElecType::Elec_t elec) |
| void | SetEastWest (Char_t eastwest) |
| void | SetRackLevel (Char_t racklevel) |
| void | SetRackBay (UInt_t rackbay) |
| void | SetInRack (UInt_t inrack) |
| void | ConvertToVersion2 () const |
Static Public Member Functions | |
| UInt_t | ConvertEncodedToVersion2 (UInt_t encoded) |
Protected Attributes | |
| UInt_t | fEncoded |
Friends | |
| Bool_t | operator< (const PlexMuxBoxId &lhs, const PlexMuxBoxId &rhs) |
| Bool_t | operator<= (const PlexMuxBoxId &lhs, const PlexMuxBoxId &rhs) |
| Bool_t | operator== (const PlexMuxBoxId &lhs, const PlexMuxBoxId &rhs) |
| Bool_t | operator!= (const PlexMuxBoxId &lhs, const PlexMuxBoxId &rhs) |
| Bool_t | operator> (const PlexMuxBoxId &lhs, const PlexMuxBoxId &rhs) |
| Bool_t | operator>= (const PlexMuxBoxId &lhs, const PlexMuxBoxId &rhs) |
|
|
Definition at line 31 of file PlexMuxBoxId.cxx. References defaultMuxBoxId. 00032 : fEncoded(defaultMuxBoxId) 00033 { 00034 // Default ctor constructs meaningless value 00035 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 38 of file PlexMuxBoxId.cxx. References defaultMuxBoxId, fEncoded, SetDetector(), SetEastWest(), SetElecType(), SetInRack(), SetRackBay(), and SetRackLevel(). 00042 : fEncoded(defaultMuxBoxId) 00043 { 00044 // Normal ctor 00045 00046 fEncoded = maskPlexMuxVersion; 00047 SetDetector(detector); 00048 SetElecType(elec); 00049 SetEastWest(eastwest); 00050 SetRackLevel(racklevel); 00051 SetRackBay(rackbay); 00052 SetInRack(inrack); 00053 }
|
|
|
Definition at line 65 of file PlexMuxBoxId.cxx. 00066 : fEncoded(muxid.fEncoded) 00067 //ju -bad for derived classes : fEncoded(muxid.fEncoded&zeroPlexMuxUnused) 00068 { 00069 // copy ctor (trim irrelevant bits) 00070 }
|
|
|
Definition at line 37 of file PlexMuxBoxId.h. 00037 { ; } // no owned data members
|
|
|
Definition at line 56 of file PlexMuxBoxId.cxx. References ConvertToVersion2(). 00057 : fEncoded(encoded) 00058 { 00059 // constructor from pre-encoded value 00060 ConvertToVersion2(); 00061 //ju -bad for derived classes: fEncoded &= zeroPlexMuxUnused; 00062 }
|
|
|
Reimplemented in PlexPinDiodeId, and PlexPixelSpotId. Definition at line 82 of file PlexMuxBoxId.cxx. References ElecType::AsString(), Detector::AsString(), GetDetector(), GetEastWest(), GetElecType(), GetInRack(), GetNumericMuxBox(), GetRackBay(), and GetRackLevel(). Referenced by PlexPixelSpotId::AsString(), PlexPinDiodeId::AsString(), and Print(). 00083 {
00084 // Return unpacked PlexMuxBoxId as a string
00085 // User should copy result because it points to a
00086 // statically allocated string.
00087 // Internally uses a circular list of buffers to avoid problems
00088 // using AsString multiple times in a cout-like situation.
00089
00090 const int nbuffers = 8; // use a circular list of strings
00091 static char newstring[nbuffers][64];
00092 static int ibuffer = nbuffers;
00093 ibuffer = (ibuffer+1)%nbuffers; // each time move to next buffer
00094
00095 string opt = option;
00096 bool numeric_mux = (opt.find("N") != string::npos);
00097 bool extended = (opt.find("e") != string::npos);
00098
00099 const char* efmt =
00100 "MUXB-%c%c-%c%c%2.2d:%2.2d";
00101 if (extended) efmt =
00102 "MUXB-%c%c-%c%c bay %2.2d: inrack %2.2d ";
00103
00104 const char detc = Detector::AsString(GetDetector())[0];
00105 const char elec = ElecType::AsString(GetElecType())[0];
00106
00107 if (numeric_mux) {
00108 // numeric mux box location
00109 sprintf(newstring[ibuffer],"SPOT-%c%c%3.3d",
00110 detc,elec,GetNumericMuxBox());
00111 } else {
00112 // unpacked MUX box location
00113 Char_t eastwest = GetEastWest();
00114 Char_t racklevel = GetRackLevel();
00115 Int_t rackbay = GetRackBay();
00116 Int_t inrack = GetInRack();
00117 sprintf(newstring[ibuffer],efmt,
00118 detc,elec,
00119 eastwest,racklevel,rackbay,inrack);
00120 }
00121
00122 return newstring[ibuffer];
00123 }
|
|
|
Definition at line 148 of file PlexMuxBoxId.cxx. References maskPlexMuxVersion. Referenced by ConvertToVersion2(). 00149 {
00150 // VERY DANGEROUS!
00151 // conversion for bit layout for rearranged bits
00152 if (encoded & maskPlexMuxVersion) return encoded; // nothing to do
00153
00154 // this funkiness should work for both old
00155 // PlexPixelSpotId and PlexPinDiodeId layouts
00156
00157 // MSB LSB
00158 // 3 2 1 0
00159 // 10987654321098765432109876543210
00160 // -dddeeWELLBBBBBIII-----iiiiiiiig old pin diode
00161 // -dddeeWELLBBBBBIIIttppppppppssss old pixel spot id
00162 // ^- remove this bit
00163 // 77776666555544443333222211110000
00164 // v- insert this bit
00165 // vdddeeWELLBBBBBIIII----iiiiiiiig new pin diode
00166 // vdddeeWELLBBBBBIIIIttpppppppssss new pixel spot id
00167
00168 // 76543210
00169 UInt_t unchanged = encoded & 0x7FFE07FF;
00170 UInt_t newmiddle = ((encoded & 0x0001F000) >> 1 );
00171
00172 return maskPlexMuxVersion|unchanged|newmiddle;
00173 }
|
|
|
|
Definition at line 160 of file PlexMuxBoxId.h. References ConvertToVersion2(), and fEncoded. Referenced by AsString(), PlotPmt(), Coroner::RecordDeadStrips(), and SimDetector::SortDigiPE(). 00161 {
00162 ConvertToVersion2();
00163 Int_t bitField = ( fEncoded & maskPlexMuxDetector) >> shftPlexMuxDetector;
00164 return (Detector::Detector_t) bitField;
00165 }
|
|
|
|
|
Reimplemented in PlexPinDiodeId, and PlexPixelSpotId. Definition at line 157 of file PlexMuxBoxId.h. References ConvertToVersion2(), and fEncoded. 00158 { ConvertToVersion2(); return fEncoded&zeroPlexMuxUnused; }
|
|
|
|
Definition at line 207 of file PlexMuxBoxId.h. References ConvertToVersion2(), and fEncoded. Referenced by AsString(), LISummarySorter::GetMuxBoxInfo(), LIPlexMaps::MakeCalAdcToPe(), and LIPlexMaps::ReadDbGains(). 00208 {
00209 ConvertToVersion2();
00210 return ( fEncoded & maskPlexMuxNumeric ) >> shftPlexMuxNumeric;
00211 }
|
|
|
|
|
Reimplemented in PlexPinDiodeId, and PlexPixelSpotId. Definition at line 291 of file PlexMuxBoxId.h. References fEncoded. 00291 {
00292 return ( fEncoded & zeroPlexMuxVersion ) != defaultMuxBoxId;
00293 }
|
|
|
Definition at line 73 of file PlexMuxBoxId.cxx. References fEncoded. 00074 {
00075 // assignment (trim irrelevant bits)
00076 //ju -bad for derived classes: fEncoded = muxid.fEncoded&zeroPlexMuxUnused;
00077 fEncoded = muxid.fEncoded;
00078 return *this;
00079 }
|
|
|
Reimplemented in PlexPinDiodeId, and PlexPixelSpotId. Definition at line 126 of file PlexMuxBoxId.cxx. References AsString(), and option. 00127 {
00128 // Print the (decoded) value
00129
00130 printf("%s\n",AsString(option));
00131 }
|
|
|
Definition at line 213 of file PlexMuxBoxId.h. References ConvertToVersion2(), and fEncoded. Referenced by PlexMuxBoxId(). 00214 {
00215 ConvertToVersion2();
00216 fEncoded = ( fEncoded & ~maskPlexMuxDetector ) |
00217 ( ( detector << shftPlexMuxDetector ) & maskPlexMuxDetector );
00218 }
|
|
|
Definition at line 227 of file PlexMuxBoxId.h. References ConvertToVersion2(), and fEncoded. Referenced by PlexMuxBoxId(). 00228 {
00229 ConvertToVersion2();
00230 int iew = 0;
00231 switch (eastwest) {
00232 case 'e':
00233 case 'E':
00234 case '-':
00235 iew = 1;
00236 break;
00237 case 'w':
00238 case 'W':
00239 case '+':
00240 iew = 2;
00241 break;
00242 default:
00243 iew = 0;
00244 }
00245 fEncoded = ( fEncoded & ~maskPlexMuxEastWest ) |
00246 ( ( iew << shftPlexMuxEastWest ) & maskPlexMuxEastWest );
00247 }
|
|
|
Definition at line 220 of file PlexMuxBoxId.h. References ConvertToVersion2(), and fEncoded. Referenced by PlexMuxBoxId(). 00221 {
00222 ConvertToVersion2();
00223 fEncoded = ( fEncoded & ~maskPlexMuxElecType ) |
00224 ( ( elec << shftPlexMuxElecType ) & maskPlexMuxElecType );
00225 }
|
|
|
Definition at line 284 of file PlexMuxBoxId.h. References ConvertToVersion2(), and fEncoded. Referenced by PlexMuxBoxId(). 00285 {
00286 ConvertToVersion2();
00287 fEncoded = ( fEncoded & ~maskPlexMuxInRack ) |
00288 ( ( inrack << shftPlexMuxInRack ) & maskPlexMuxInRack );
00289 }
|
|
|
Definition at line 277 of file PlexMuxBoxId.h. References ConvertToVersion2(), and fEncoded. Referenced by PlexMuxBoxId(). 00278 {
00279 ConvertToVersion2();
00280 fEncoded = ( fEncoded & ~maskPlexMuxBay ) |
00281 ( ( rackbay << shftPlexMuxBay ) & maskPlexMuxBay );
00282 }
|
|
|
Definition at line 249 of file PlexMuxBoxId.h. References ConvertToVersion2(), and fEncoded. Referenced by PlexMuxBoxId(). 00250 {
00251 ConvertToVersion2();
00252 int irl = 0;
00253 switch (racklevel) {
00254 case 'l':
00255 case 'L':
00256 case 'b':
00257 case 'B':
00258 irl = 0;
00259 break;
00260 case 'm':
00261 case 'M':
00262 irl = 1;
00263 break;
00264 case 't':
00265 case 'T':
00266 case 'u':
00267 case 'U':
00268 irl = 2;
00269 break;
00270 default:
00271 irl = 3;
00272 }
00273 fEncoded = ( fEncoded & ~maskPlexMuxLevel ) |
00274 ( ( irl << shftPlexMuxLevel ) & maskPlexMuxLevel );
00275 }
|
|
||||||||||||
|
Definition at line 145 of file PlexMuxBoxId.h. 00146 { lhs.ConvertToVersion2(); rhs.ConvertToVersion2();
00147 return (lhs.fEncoded&zeroPlexMuxUnused) != (rhs.fEncoded&zeroPlexMuxUnused); }
|
|
||||||||||||
|
Definition at line 133 of file PlexMuxBoxId.h. 00134 { lhs.ConvertToVersion2(); rhs.ConvertToVersion2();
00135 return (lhs.fEncoded&zeroPlexMuxUnused) < (rhs.fEncoded&zeroPlexMuxUnused); }
|
|
||||||||||||
|
Definition at line 137 of file PlexMuxBoxId.h. 00138 { lhs.ConvertToVersion2(); rhs.ConvertToVersion2();
00139 return (lhs.fEncoded&zeroPlexMuxUnused) <= (rhs.fEncoded&zeroPlexMuxUnused); }
|
|
||||||||||||
|
Definition at line 141 of file PlexMuxBoxId.h. 00142 { lhs.ConvertToVersion2(); rhs.ConvertToVersion2();
00143 return (lhs.fEncoded&zeroPlexMuxUnused) == (rhs.fEncoded&zeroPlexMuxUnused); }
|
|
||||||||||||
|
Definition at line 149 of file PlexMuxBoxId.h. 00150 { lhs.ConvertToVersion2(); rhs.ConvertToVersion2();
00151 return (lhs.fEncoded&zeroPlexMuxUnused) > (rhs.fEncoded&zeroPlexMuxUnused); }
|
|
||||||||||||
|
Definition at line 153 of file PlexMuxBoxId.h. 00154 { lhs.ConvertToVersion2(); rhs.ConvertToVersion2();
00155 return (lhs.fEncoded&zeroPlexMuxUnused) >= (rhs.fEncoded&zeroPlexMuxUnused); }
|
|
|
Definition at line 78 of file PlexMuxBoxId.h. Referenced by ConvertToVersion2(), GetDetector(), GetEastWest(), GetElecType(), GetEncoded(), GetInRack(), GetNumericMuxBox(), GetRackBay(), GetRackLevel(), PlexPixelSpotId::IsSamePixel(), PlexPixelSpotId::IsSameTube(), IsValid(), operator!=(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), PlexMuxBoxId(), SetDetector(), SetEastWest(), SetElecType(), SetInRack(), SetRackBay(), and SetRackLevel(). |
1.3.9.1