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

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