source: trunk/FACT++/src/HeadersFAD.cc@ 11217

Last change on this file since 11217 was 11157, checked in by tbretz, 13 years ago
Fixed output for data transmission socket.
File size: 2.9 KB
Line 
1#include "HeadersFAD.h"
2
3#include <string.h>
4
5#include <iomanip>
6
7#include "Converter.h"
8
9using namespace std;
10
11void FAD::EventHeader::print(std::ostream &out) const
12{
13 out << "Delimiter: " << hex << fStartDelimiter;
14 out << (fStartDelimiter==kDelimiterStart?" (ok)":" (WRONG)") << endl;
15 out << " (Crate=" << dec << Crate() << ", Board=" << Board() << ", Version=" << (fVersion>>8) << "." << (fVersion&0xff) << ", DNA=" << hex << fDNA <<")" << endl;
16
17 out << dec;
18 out << "PkgLength: " << fPackageLength << endl;
19
20 out << "RunNumber: " << fRunNumber << endl;
21 out << "Time: " << fTimeStamp/10000. << "s" << endl;
22 out << "EvtCounter: " << fEventCounter << " of " << fNumTriggersToGenerate << endl;
23 out << "Trigger: Type=" << fTriggerType << " Id=" << fTriggerId << " Crc=0x" << hex << fTriggerCrc << endl;
24
25 out << "RefClock: " << dec << fFreqRefClock << endl;
26 out << "PhaseShift: " << fAdcClockPhaseShift << endl;
27 out << "Prescaler: " << fTriggerGeneratorPrescaler << endl;
28
29 out << "DAC: " << dec;
30 for (int i=0; i<kNumDac; i++)
31 out << " " << fDac[i];
32 out << endl;
33
34 out << "Temp: " << dec;
35 for (int i=0; i<kNumTemp; i++)
36 out << " " << GetTemp(i);
37 out << endl;
38
39 out << "Status=" << hex << fStatus << endl;
40 // PllLock -> 1111
41 out << " RefClk locked (PLLLCK): ";
42 if ((PLLLCK()&15)==15)
43 out << "all";
44 else
45 if (PLLLCK()==0)
46 out << "none";
47 else
48 out
49 << "0:" << ((PLLLCK()&1)?"yes":"no") << " "
50 << "1:" << ((PLLLCK()&2)?"yes":"no") << " "
51 << "2:" << ((PLLLCK()&4)?"yes":"no") << " "
52 << "3:" << ((PLLLCK()&8)?"yes":"no") << endl;
53// if (IsRefClockTooHigh())
54// out << " (too high)";
55 if (IsRefClockTooLow())
56 out << " (too low)";
57 out << endl;
58 out << " Domino wave (Denable): " << (HasDenable()?"enabled":"disabled") << endl;
59 out << " DRS sampling (Dwrite): " << (HasDwrite()?"enabled":"disabled") << endl;
60 out << " Dig.clock manager (DCM): " << (IsDcmLocked()?"locked":"unlocked");
61 out << " / " << (IsDcmReady()?"ready":"not ready") << endl;
62 out << " SPI Serial Clock (SCLK): " << (HasSpiSclk()?"enabled":"disabled") << endl;
63 out << " Busy enabled: " << (HasBusy()?"enabled":"disabled") << endl;
64 out << " Trigger line enabled: " << (HasTriggerEnabled()?"enabled":"disabled") << endl;
65 out << " Continous trigger enabled: " << (HasContTriggerEnabled()?"enabled":"disabled") << endl;
66 out << " Data transmission socket: " << (IsInSock17Mode()?"Socket 1-7":"Sockets 0") << endl;
67}
68
69void FAD::ChannelHeader::print(std::ostream &out) const
70{
71 out << "Chip=" << dec << Chip() << " Ch=" << Channel() << ":";
72 out << " StartCell=" << fStartCell;
73 out << " ROI=" << fRegionOfInterest << endl;
74}
Note: See TracBrowser for help on using the repository browser.