1 #ifndef FACT_HeadersFAD 2 #define FACT_HeadersFAD 122 kRefClkTooLow = 1<< 8,
127 kTriggerLine = 1<< 3,
128 kContTrigger = 1<< 2,
223 *
this = std::vector<uint16_t>(ptr, ptr+
sizeof(
EventHeader)/2);
226 void operator=(
const std::vector<uint16_t> &vec)
236 for (
int i=0;
i<8;
i+=2)
237 std::swap(reinterpret_cast<uint8_t*>(&fDNA)[
i],
238 reinterpret_cast<uint8_t*>(&fDNA)[i+1]);
241 std::vector<uint16_t>
HtoN()
const 250 for (
int i=0;
i<8;
i+=2)
251 std::swap(reinterpret_cast<uint8_t*>(&h.
fDNA)[
i],
252 reinterpret_cast<uint8_t*>(&h.
fDNA)[
i+1]);
260 (fStatus&~(kSock17|kBusyOn)) == (h.
fStatus&~(kSock17|kBusyOn)) &&
265 memcmp(fDac, h.
fDac,
sizeof(fDac))==0;
269 float GetTemp(
int i)
const {
return fTempDrs[
i]/16.; }
271 uint8_t PLLLCK()
const {
return fStatus>>12; }
273 bool HasDenable()
const {
return fStatus&kDenable; }
274 bool HasDwrite()
const {
return fStatus&kDwrite; }
276 bool IsRefClockTooLow()
const {
return fStatus&kRefClkTooLow; }
277 bool IsDcmLocked()
const {
return fStatus&kDcmLocked; }
278 bool IsDcmReady()
const {
return fStatus&kDcmReady; }
279 bool HasSpiSclk()
const {
return fStatus&kSpiSclk; }
280 bool HasBusyOn()
const {
return fStatus&kBusyOn; }
281 bool HasBusyOff()
const {
return fStatus&kBusyOff; }
282 bool HasTriggerEnabled()
const {
return fStatus&kTriggerLine; }
283 bool HasContTriggerEnabled()
const {
return fStatus&kContTrigger; }
284 bool IsInSock17Mode()
const {
return fStatus&kSock17; }
286 int GetTriggerLogic()
const {
return (fTriggerType>>2)&0x3f; }
287 bool HasTriggerExt1()
const {
return fTriggerType&
kExt1; }
288 bool HasTriggerExt2()
const {
return fTriggerType&
kExt2; }
289 bool HasTIMsource()
const {
return fTriggerType&kTIM; }
290 bool HasTriggerLPext()
const {
return fTriggerType&
kLPext; }
291 bool HasTriggerLPint()
const {
return fTriggerType&
kLPint; }
292 bool HasTriggerPed()
const {
return fTriggerType&
kPedestal; }
293 bool IsTriggerPhys()
const {
return !(fTriggerType&kAll); }
294 int GetTriggerLPset()
const {
return (fTriggerType&kLPset)>>11; }
296 uint16_t Crate()
const {
return fBoardId>>8; }
297 uint16_t Board()
const {
return fBoardId&0xff; }
299 uint16_t Id()
const {
return Crate()*10+Board(); }
301 void Enable(Bits pos,
bool enable=
true)
310 void print(std::ostream &out)
const;
326 void operator=(
const std::vector<uint16_t> &vec)
331 std::vector<uint16_t>
HtoN()
const 338 void print(std::ostream &out)
const;
340 uint16_t Chip()
const {
return fId>>4; }
341 uint16_t Channel()
const {
return fId&0xf; }
std::vector< uint16_t > htoncpy(const S &s)
Commandline parsing, resource file parsing and database access.
void ntohcpy(const std::vector< uint16_t > &vec, S &s)
ostream & operator<<(ostream &out, TPointStar &set)