1 | #include "HeadersFAD.h"
|
---|
2 |
|
---|
3 | #include <string.h>
|
---|
4 |
|
---|
5 | #include <iomanip>
|
---|
6 |
|
---|
7 | #include "Converter.h"
|
---|
8 |
|
---|
9 | using namespace std;
|
---|
10 |
|
---|
11 | void FAD::EventHeader::print(std::ostream &out) const
|
---|
12 | {
|
---|
13 | out << "Delimiter: ";
|
---|
14 | if (fStartDelimiter==kDelimiterStart)
|
---|
15 | out << "ok";
|
---|
16 | else
|
---|
17 | out << hex << fStartDelimiter;
|
---|
18 | out << " (Crate=" << dec << (fBoardId>>8) << ", Board=" << (fBoardId&0xff) << ", Version=" << (fVersion>>8) << "." << (fVersion&0xff) << ", DNA=" << hex << fDNA <<")" << endl;
|
---|
19 |
|
---|
20 | out << dec;
|
---|
21 | out << "PkgLength: " << fPackageLength << endl;
|
---|
22 |
|
---|
23 | out << "RunNumber: " << fRunNumber << endl;
|
---|
24 | out << "Time: " << fTimeStamp/10000. << "s" << endl;
|
---|
25 | out << "EvtCounter: " << fEventCounter << " of " << fNumTriggersToGenerate << endl;
|
---|
26 | out << "Trigger: Type=" << fTriggerType << " Id=" << fTriggerId << " Crc=0x" << hex << fTriggerCrc << endl;
|
---|
27 |
|
---|
28 | out << "RefClock: " << dec << fFreqRefClock << endl;
|
---|
29 | out << "PhaseShift: " << fAdcClockPhaseShift << endl;
|
---|
30 | out << "Prescaler: " << fTriggerGeneratorPrescaler << endl;
|
---|
31 |
|
---|
32 | out << "DAC: " << dec;
|
---|
33 | for (int i=0; i<kNumDac; i++)
|
---|
34 | out << " " << fDac[i];
|
---|
35 | out << endl;
|
---|
36 |
|
---|
37 | out << "Temp: " << dec;
|
---|
38 | for (int i=0; i<kNumTemp; i++)
|
---|
39 | out << " " << GetTemp(i);
|
---|
40 | out << endl;
|
---|
41 |
|
---|
42 | out << "Status=" << hex << fStatus << endl;
|
---|
43 | // PllLock -> 1111
|
---|
44 | out << " RefClk locked (PLLLCK): " << hex << (int)PLLLCK();
|
---|
45 | if (IsRefClockTooHigh())
|
---|
46 | out << " (too high)";
|
---|
47 | if (IsRefClockTooLow())
|
---|
48 | out << " (too low)";
|
---|
49 | out << endl;
|
---|
50 | out << " Domino wave (Denable): " << (HasDenable()?"enabled":"disabled") << endl;
|
---|
51 | out << " DRS sampling (Dwrite): " << (HasDwrite()?"enabled":"disabled") << endl;
|
---|
52 | out << " Dig.clock manager (DCM): " << (IsDcmLocked()?"locked":"unlocked");
|
---|
53 | out << " / " << (IsDcmReady()?"ready":"not ready") << endl;
|
---|
54 | out << " SPI Serial Clock (SCLK): " << (HasSpiSclk()?"enabled":"disabled") << endl;
|
---|
55 | }
|
---|
56 |
|
---|
57 | void FAD::ChannelHeader::print(std::ostream &out) const
|
---|
58 | {
|
---|
59 | out << "Chip=" << dec << (fId>>4) << " Ch=" << (fId&0xf) << ":";
|
---|
60 | out << " StartCell=" << fStartCell;
|
---|
61 | out << " ROI=" << fRegionOfInterest << endl;
|
---|
62 | }
|
---|