1 | #include "HeadersFAD.h"
|
---|
2 |
|
---|
3 | #include <string.h>
|
---|
4 |
|
---|
5 | #include <iomanip>
|
---|
6 |
|
---|
7 | using namespace std;
|
---|
8 |
|
---|
9 | void FAD::EventHeader::print(std::ostream &out) const
|
---|
10 | {
|
---|
11 | out << "Delimiter: " << hex << fStartDelimiter;
|
---|
12 | out << (fStartDelimiter==kDelimiterStart?" (ok)":" (WRONG)") << endl;
|
---|
13 | out << " (Crate=" << dec << Crate() << ", Board=" << Board() << ", Version=" << (fVersion>>8) << "." << (fVersion&0xff) << ", DNA=" << hex << fDNA <<")" << endl;
|
---|
14 |
|
---|
15 | out << dec;
|
---|
16 | out << "PkgLength: " << fPackageLength << endl;
|
---|
17 |
|
---|
18 | out << "RunNumber: " << fRunNumber << endl;
|
---|
19 | out << "Time: " << setprecision(3) << fixed << fTimeStamp/10000. << "s" << endl;
|
---|
20 | out << "EvtCounter: " << fEventCounter << " of " << fNumTriggersToGenerate << endl;
|
---|
21 | out << "Trigger: Type=" << hex << fTriggerType << dec << " Counter=" << fTriggerCounter << " Crc=";
|
---|
22 | if ((fTriggerCrc&0xff00)==0x0100)
|
---|
23 | out << "<timeout>";
|
---|
24 | else
|
---|
25 | out << "0x" << hex << fTriggerCrc;
|
---|
26 | out << " (" << hex << setw(4) << fTriggerCrc << "|" << setw(4) << fTriggerType << "|" << setw(8) << fTriggerCounter << ")" << dec << endl;
|
---|
27 | out << " N/40 = " << dec << GetTriggerLogic() << endl;
|
---|
28 | out << " TRG =";
|
---|
29 |
|
---|
30 | if (IsTriggerPhys())
|
---|
31 | out << " phys";
|
---|
32 | if (HasTriggerPed())
|
---|
33 | out << " ped";
|
---|
34 | if (HasTriggerLPext())
|
---|
35 | out << " LPext";
|
---|
36 | if (HasTriggerLPint())
|
---|
37 | out << " LPint";
|
---|
38 | if (HasTIMsource())
|
---|
39 | out << " TIM";
|
---|
40 | if (HasTriggerExt1())
|
---|
41 | out << " ext1";
|
---|
42 | if (HasTriggerExt2())
|
---|
43 | out << " ext2";
|
---|
44 | out << endl;
|
---|
45 |
|
---|
46 | out << " LPset = " << GetTriggerLPset() << endl;
|
---|
47 |
|
---|
48 | out << "RefClock: " << dec << fFreqRefClock << " (approx. " << fFreqRefClock*2.048 << "MHz)" << endl;
|
---|
49 | out << "PhaseShift: " << fAdcClockPhaseShift << endl;
|
---|
50 | out << "Prescaler: " << fTriggerGeneratorPrescaler << endl;
|
---|
51 |
|
---|
52 | out << "DAC: " << dec;
|
---|
53 | for (int i=0; i<kNumDac; i++)
|
---|
54 | out << " " << fDac[i];
|
---|
55 | out << endl;
|
---|
56 |
|
---|
57 | out << "Temp: " << dec;
|
---|
58 | for (int i=0; i<kNumTemp; i++)
|
---|
59 | out << " " << GetTemp(i);
|
---|
60 | out << endl;
|
---|
61 |
|
---|
62 | out << "Status=" << hex << fStatus << endl;
|
---|
63 | // PllLock -> 1111
|
---|
64 | out << " RefClk locked (PLLLCK): ";
|
---|
65 | if ((PLLLCK()&15)==15)
|
---|
66 | out << "all";
|
---|
67 | else
|
---|
68 | if (PLLLCK()==0)
|
---|
69 | out << "none";
|
---|
70 | else
|
---|
71 | out
|
---|
72 | << "0:" << ((PLLLCK()&1)?"yes":"no") << " "
|
---|
73 | << "1:" << ((PLLLCK()&2)?"yes":"no") << " "
|
---|
74 | << "2:" << ((PLLLCK()&4)?"yes":"no") << " "
|
---|
75 | << "3:" << ((PLLLCK()&8)?"yes":"no") << endl;
|
---|
76 | // if (IsRefClockTooHigh())
|
---|
77 | // out << " (too high)";
|
---|
78 | if (IsRefClockTooLow())
|
---|
79 | out << " (too low)";
|
---|
80 | out << endl;
|
---|
81 | out << " Domino wave (Denable): " << (HasDenable()?"enabled":"disabled") << endl;
|
---|
82 | out << " DRS sampling (Dwrite): " << (HasDwrite()?"enabled":"disabled") << endl;
|
---|
83 | out << " Dig.clock manager (DCM): " << (IsDcmLocked()?"locked":"unlocked");
|
---|
84 | out << " / " << (IsDcmReady()?"ready":"not ready") << endl;
|
---|
85 | out << " SPI Serial Clock (SCLK): " << (HasSpiSclk()?"enabled":"disabled") << endl;
|
---|
86 | out << " Busy enabled: ";
|
---|
87 | if (HasBusyOn())
|
---|
88 | out << "constantly enabled" << endl;
|
---|
89 | else
|
---|
90 | out << (HasBusyOff()?"constantly disabled":"normal") << endl;
|
---|
91 | out << " Trigger line enabled: " << (HasTriggerEnabled()?"enabled":"disabled") << endl;
|
---|
92 | out << " Continous trigger enabled: " << (HasContTriggerEnabled()?"enabled":"disabled") << endl;
|
---|
93 | out << " Data transmission socket: " << (IsInSock17Mode()?"Socket 1-7":"Sockets 0") << endl;
|
---|
94 | }
|
---|
95 |
|
---|
96 | void FAD::ChannelHeader::print(std::ostream &out) const
|
---|
97 | {
|
---|
98 | out << "Chip=" << dec << Chip() << " Ch=" << Channel() << ":";
|
---|
99 | out << " StartCell=" << fStartCell;
|
---|
100 | out << " ROI=" << fRegionOfInterest << endl;
|
---|
101 | }
|
---|