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

Last change on this file since 11913 was 11888, checked in by tbretz, 13 years ago
Added decoding of the trigger type.
File size: 3.5 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 << " N/40 = " << GetTriggerLogic() << endl;
26 out << " TRG =";
27
28 if (IsTriggerPhys())
29 out << " phys";
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 << 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.