FACT++  1.0
HeadersFAD.cc
Go to the documentation of this file.
1 #include "HeadersFAD.h"
2 
3 #include <string.h>
4 
5 #include <iomanip>
6 
7 using namespace std;
8 
9 void 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 
92 void 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 }
uint16_t fRegionOfInterest
Definition: HeadersFAD.h:95
uint16_t fAdcClockPhaseShift
Definition: HeadersFAD.h:183
uint32_t fFreqRefClock
Definition: HeadersFAD.h:180
uint32_t fRunNumber
Definition: HeadersFAD.h:190
uint16_t fStatus
Definition: HeadersFAD.h:173
int i
Definition: db_dim_client.c:21
uint16_t fStartDelimiter
Definition: HeadersFAD.h:170
STL namespace.
uint32_t fTriggerCounter
Definition: HeadersFAD.h:177
uint16_t fNumTriggersToGenerate
Definition: HeadersFAD.h:184
void print(std::ostream &out) const
uint16_t fTriggerType
Definition: HeadersFAD.h:176
uint32_t fEventCounter
Definition: HeadersFAD.h:179
uint32_t fTimeStamp
Definition: HeadersFAD.h:189
uint16_t fStartCell
Definition: HeadersFAD.h:94
uint64_t fDNA
Number of boards answered per crate.
Definition: HeadersFAD.h:187
uint16_t fTriggerGeneratorPrescaler
Definition: HeadersFAD.h:185
uint16_t fTriggerCrc
Definition: HeadersFAD.h:175
uint16_t fVersion
Definition: HeadersFAD.h:172
uint16_t fPackageLength
Definition: HeadersFAD.h:171
uint16_t fDac[kNumDac]
Definition: HeadersFAD.h:194