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

Last change on this file since 14547 was 14506, checked in by tbretz, 12 years ago
Show measured samplig freq. as rate.
File size: 3.6 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=" << hex << fTriggerType << dec << " Counter=" << fTriggerCounter << " Crc=0x" << hex << fTriggerCrc << endl;
24
25 out << " N/40 = " << dec << GetTriggerLogic() << endl;
26 out << " TRG =";
27
28 if (IsTriggerPhys())
29 out << " phys";
30 if (HasTriggerPed())
31 out << " ped";
32 if (HasTriggerLPext())
33 out << " LPext";
34 if (HasTriggerLPint())
35 out << " LPint";
36 if (HasTIMsource())
37 out << " TIM";
38 if (HasTriggerExt1())
39 out << " ext1";
40 if (HasTriggerExt2())
41 out << " ext2";
42 out << endl;
43
44 out << " LPset = " << GetTriggerLPset() << endl;
45
46 out << "RefClock: " << dec << fFreqRefClock << " (approx. " << fFreqRefClock*2.048 << "GHz)" << endl;
47 out << "PhaseShift: " << fAdcClockPhaseShift << endl;
48 out << "Prescaler: " << fTriggerGeneratorPrescaler << endl;
49
50 out << "DAC: " << dec;
51 for (int i=0; i<kNumDac; i++)
52 out << " " << fDac[i];
53 out << endl;
54
55 out << "Temp: " << dec;
56 for (int i=0; i<kNumTemp; i++)
57 out << " " << GetTemp(i);
58 out << endl;
59
60 out << "Status=" << hex << fStatus << endl;
61 // PllLock -> 1111
62 out << " RefClk locked (PLLLCK): ";
63 if ((PLLLCK()&15)==15)
64 out << "all";
65 else
66 if (PLLLCK()==0)
67 out << "none";
68 else
69 out
70 << "0:" << ((PLLLCK()&1)?"yes":"no") << " "
71 << "1:" << ((PLLLCK()&2)?"yes":"no") << " "
72 << "2:" << ((PLLLCK()&4)?"yes":"no") << " "
73 << "3:" << ((PLLLCK()&8)?"yes":"no") << endl;
74// if (IsRefClockTooHigh())
75// out << " (too high)";
76 if (IsRefClockTooLow())
77 out << " (too low)";
78 out << endl;
79 out << " Domino wave (Denable): " << (HasDenable()?"enabled":"disabled") << endl;
80 out << " DRS sampling (Dwrite): " << (HasDwrite()?"enabled":"disabled") << endl;
81 out << " Dig.clock manager (DCM): " << (IsDcmLocked()?"locked":"unlocked");
82 out << " / " << (IsDcmReady()?"ready":"not ready") << endl;
83 out << " SPI Serial Clock (SCLK): " << (HasSpiSclk()?"enabled":"disabled") << endl;
84 out << " Busy enabled: ";
85 if (HasBusyOn())
86 out << "constantly enabled" << endl;
87 else
88 out << (HasBusyOff()?"constantly disabled":"normal") << endl;
89 out << " Trigger line enabled: " << (HasTriggerEnabled()?"enabled":"disabled") << endl;
90 out << " Continous trigger enabled: " << (HasContTriggerEnabled()?"enabled":"disabled") << endl;
91 out << " Data transmission socket: " << (IsInSock17Mode()?"Socket 1-7":"Sockets 0") << endl;
92}
93
94void FAD::ChannelHeader::print(std::ostream &out) const
95{
96 out << "Chip=" << dec << Chip() << " Ch=" << Channel() << ":";
97 out << " StartCell=" << fStartCell;
98 out << " ROI=" << fRegionOfInterest << endl;
99}
Note: See TracBrowser for help on using the repository browser.