CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
testGlobalNumbers.cc
Go to the documentation of this file.
1 
15 
18 
19 #include <iostream>
20 #include <iomanip>
21 
22 #include <time.h>
23 
24 
25 using namespace edm;
26 using namespace std;
27 
28 namespace test{
29 
30  static const unsigned int GTEVMId= 812;
31  static const unsigned int GTPEId= 814;
33  private:
34  public:
36  }
37 
38 
39  void analyze(const Event & e, const EventSetup& c){
40  cout << "--- Run: " << e.id().run()
41  << " LS: " << e.luminosityBlock()
42  << " Event: " << e.id().event()
43  << " Type: " << e.experimentType() << endl;
45  e.getByLabel("source",rawdata);
46  const FEDRawData& data = rawdata->FEDData(GTEVMId);
47  size_t size=data.size();
48 
49  if (size>0 ) {
50  cout << "FED# " << setw(4) << GTEVMId << " " << setw(8) << size << " bytes " << endl;
52  {
53  cout << "FED# " << setw(4) << GTEVMId << " is the real GT EVM block " << endl;
54  cout << "Event # " << evf::evtn::get(data.data(),true) << endl;
55  cout << "LS # " << evf::evtn::getlbn(data.data()) << endl;
56  cout << "ORBIT # " << evf::evtn::getorbit(data.data()) << endl;
57  cout << "GPS LOW # " << evf::evtn::getgpslow(data.data()) << endl;
58  cout << "GPS HI # " << evf::evtn::getgpshigh(data.data()) << endl;
59  cout << "BX FROM FDL 0-xing # " << evf::evtn::getfdlbx(data.data()) << endl;
60  cout << "PRESCALE INDEX FROM FDL 0-xing # " << evf::evtn::getfdlpsc(data.data()) << endl;
61  }
62  }
63 
64  const FEDRawData& data2 = rawdata->FEDData(GTPEId);
65  size=data2.size();
66 
67  if (size>0 ) {
68  cout << "FED# " << setw(4) << GTPEId << " " << setw(8) << size << " bytes " << endl;
70  {
71  cout << "FED# " << setw(4) << GTPEId << " is the real GTPE block " << endl;
72  cout << "Event # " << evf::evtn::gtpe_get(data2.data()) << endl;
73  cout << "LS # " << evf::evtn::gtpe_getlbn(data2.data()) << endl;
74  cout << "ORBIT # " << evf::evtn::gtpe_getorbit(data2.data()) << endl;
75  cout << "BX # " << evf::evtn::gtpe_getbx(data2.data()) << endl;
76  }
77  }
78 
79  const FEDRawData& data3 = rawdata->FEDData(FEDNumbering::MINTCDSuTCAFEDID);
80  size=data3.size();
81 
82  if (size>0 ) {
84  cout << "FED# " << setw(4) << FEDNumbering::MINTCDSuTCAFEDID << " "
85  << setw(8) << size << " bytes " << endl;
86  cout << "sizes: "
87  << " BGOSize " << std::hex << (unsigned int) record.getHeader().getSizes().size.BGOSize
88  << " reserved2;" << std::hex <<(unsigned int)record.getHeader().getSizes().size.reserved2
89  << " reserved1;" << std::hex <<(unsigned int) record.getHeader().getSizes().size.reserved1
90  << " reserved0;" << std::hex <<(unsigned int)record.getHeader().getSizes().size.reserved0
91  << " BSTSize;" << std::hex <<(unsigned int)record.getHeader().getSizes().size.BSTSize
92  << " L1AhistSize;" << std::hex <<(unsigned int)record.getHeader().getSizes().size.L1AhistSize
93  << " summarySize;" << std::hex <<(unsigned int)record.getHeader().getSizes().size.summarySize
94  << " headerSize;" << std::hex << (unsigned int)record.getHeader().getSizes().size.headerSize
95  << std::endl;
96 
97  std::cout << "macAddress; "
98  << hex << (uint64_t)record.getHeader().getData().header.macAddress;
99  std::cout << "\n";
100  std::cout << "sw; "
101  << hex << (unsigned int)record.getHeader().getData().header.sw;
102  std::cout << "\n";
103  std::cout << "fw; "
104  << hex <<(unsigned int)record.getHeader().getData().header.fw;
105  std::cout << "\n";
106  std::cout << "reserved0; "
107  << hex <<(unsigned int)record.getHeader().getData().header.reserved0;
108  std::cout << "\n";
109  std::cout << "format; "
110  << hex <<(unsigned int)record.getHeader().getData().header.format;
111  std::cout << "\n";
112  std::cout << "runNumber; "
113  << dec << (unsigned int)record.getHeader().getData().header.runNumber;
114  std::cout << "\n";
115  std::cout << "reserved1; "
116  << hex <<(unsigned int)record.getHeader().getData().header.reserved1;
117  std::cout << "\n";
118  std::cout << "activePartitions2; "
119  << hex <<(unsigned int)record.getHeader().getData().header.activePartitions2;
120  std::cout << "\n";
121  std::cout << "reserved2; "
122  << hex <<(unsigned int)record.getHeader().getData().header.reserved2;
123  std::cout << "\n";
124  std::cout << "activePartitions0; "
125  << hex << (unsigned int)record.getHeader().getData().header.activePartitions0;
126  std::cout << "\n";
127  std::cout << "activePartitions1; "
128  << hex <<(unsigned int)record.getHeader().getData().header.activePartitions1;
129  std::cout << "\n";
130  std::cout << "nibble; "
131  << dec << (unsigned int)record.getHeader().getData().header.nibble;
132  std::cout << "\n";
133  std::cout << "lumiSection; "
134  << dec << (unsigned int)record.getHeader().getData().header.lumiSection;
135  std::cout << "\n";
136  std::cout << "nibblesPerLumiSection;"
137  << hex <<(unsigned int)record.getHeader().getData().header.nibblesPerLumiSection;
138  std::cout << "\n";
139  std::cout << "triggerTypeFlags; "
140  << hex <<(unsigned int)record.getHeader().getData().header.triggerTypeFlags;
141  std::cout << "\n";
142  std::cout << "reserved5; "
143  << hex <<(unsigned int)record.getHeader().getData().header.reserved5;
144  std::cout << "\n";
145  std::cout << "inputs; "
146  << hex <<(unsigned int)record.getHeader().getData().header.inputs;
147  std::cout << "\n";
148  std::cout << "bcid; "
149  << dec << (unsigned int)record.getHeader().getData().header.bcid;
150  std::cout << "\n";
151  std::cout << "orbitLow; "
152  << dec << (unsigned int)record.getHeader().getData().header.orbitLow;
153  std::cout << "\n";
154  std::cout << "orbitHigh; "
155  << dec << (unsigned int)record.getHeader().getData().header.orbitHigh;
156  std::cout << "\n";
157  std::cout << "triggerCount; "
158  << dec << (uint64_t)record.getHeader().getData().header.triggerCount;
159  std::cout << "\n";
160  std::cout << "eventNumber; "
161  << dec << (uint64_t)record.getHeader().getData().header.eventNumber;
162  std::cout << "\n";
163  std::cout << std::endl;
164 
165  std::cout << "====================l1a history===================" << std::endl;
166  const evf::evtn::TCDSL1AHistory::l1a *history = record.getHistory().history().hist;
167  for(unsigned int i = 0; i < 16; i++){
168  std::cout << i << " " << hex << history[i].bxid << std::endl;
169  std::cout << i << " " << hex << history[i].orbitlow << std::endl;
170  std::cout << i << " " << hex << history[i].orbithigh << std::endl;
171  std::cout << i << " " << hex << (unsigned int)history[i].eventtype << std::endl;
172  }
173 
174  std::cout << " gpstimehigh; " << hex << record.getBST().getBST().gpstimehigh;
175  std::cout << " gpstimelow; " << hex << record.getBST().getBST().gpstimelow;
176  std::cout << " low0; " << record.getBST().getBST().low0;
177  std::cout << " high0; " << record.getBST().getBST().high0;
178  std::cout << " low1; " << record.getBST().getBST().low1;
179  std::cout << " high1; " << record.getBST().getBST().high1;
180  std::cout << " low2; " << record.getBST().getBST().low2;
181  std::cout << " high2; " << record.getBST().getBST().high2;
182  std::cout << " low3; " << record.getBST().getBST().low3;
183  std::cout << " high3; " << record.getBST().getBST().high3;
184  std::cout << " low4; " << record.getBST().getBST().low4;
185  std::cout << " high4; " << record.getBST().getBST().high4;
186  std::cout << " low5; " << record.getBST().getBST().low5;
187  std::cout << " status; " << record.getBST().getBST().status;
188  std::cout << std::endl;
189 
190  // char tmbuf[64], buf[64];
191  time_t nowtime = (time_t)record.getBST().getBST().gpstimehigh;
192  // uint32_t nowusec = record.getBST().getBST().gpstimelow;
193  std::cout << " value of nowtime " << hex << nowtime << dec <<std::endl;
194  std::cout << "GPS time " << ctime(&nowtime) << "."
195  << dec <<record.getBST().getBST().gpstimelow << std::endl;
196  }
197 
198 
199 // CPPUNIT_ASSERT(trailer.check()==true);
200 // CPPUNIT_ASSERT(trailer.lenght()==(int)data.size()/8);
201  }
202  };
203 DEFINE_FWK_MODULE(GlobalNumbersAnalysis);
204 }
205 
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
int i
Definition: DBlmapReader.cc:9
unsigned int getgpshigh(const unsigned char *)
unsigned int getfdlbx(const unsigned char *)
bool gtpe_board_sense(const unsigned char *p)
JetCorrectorParameters::Record record
Definition: classes.h:7
unsigned int get(const unsigned char *, bool)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
unsigned int getfdlpsc(const unsigned char *)
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
static const unsigned int GTEVMId
unsigned int getlbn(const unsigned char *)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:420
bool evm_board_sense(const unsigned char *p, size_t size)
unsigned int getorbit(const unsigned char *)
unsigned int gtpe_getorbit(const unsigned char *)
unsigned long long uint64_t
Definition: Time.h:15
edm::EventID id() const
Definition: EventBase.h:60
unsigned int gtpe_getbx(const unsigned char *)
static const unsigned int GTPEId
edm::EventAuxiliary::ExperimentType experimentType() const
Definition: EventBase.h:65
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
tuple cout
Definition: gather_cfg.py:121
unsigned int gtpe_get(const unsigned char *)
dictionary rawdata
Definition: lumiPlot.py:393
unsigned int gtpe_getlbn(const unsigned char *)
GlobalNumbersAnalysis(const ParameterSet &pset)
void analyze(const Event &e, const EventSetup &c)
unsigned int getgpslow(const unsigned char *)
tuple size
Write out results.