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

Last change on this file since 11812 was 11651, checked in by tbretz, 13 years ago
Renamed TriggerId to TriggerCounter
File size: 3.0 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: " << setprecision(3) << fixed << fTimeStamp/10000. << "s" << endl;
22 out << "EvtCounter: " << fEventCounter << " of " << fNumTriggersToGenerate << endl;
23 out << "Trigger: Type=" << fTriggerType << " Counter=" << fTriggerCounter << " 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: ";
64 if (HasBusyOn())
65 out << "constantly enabled" << endl;
66 else
67 out << (HasBusyOff()?"constantly disabled":"normal") << endl;
68 out << " Trigger line enabled: " << (HasTriggerEnabled()?"enabled":"disabled") << endl;
69 out << " Continous trigger enabled: " << (HasContTriggerEnabled()?"enabled":"disabled") << endl;
70 out << " Data transmission socket: " << (IsInSock17Mode()?"Socket 1-7":"Sockets 0") << endl;
71}
72
73void FAD::ChannelHeader::print(std::ostream &out) const
74{
75 out << "Chip=" << dec << Chip() << " Ch=" << Channel() << ":";
76 out << " StartCell=" << fStartCell;
77 out << " ROI=" << fRegionOfInterest << endl;
78}
Note: See TracBrowser for help on using the repository browser.