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 
17 
18 #include <iostream>
19 #include <iomanip>
20 
21 using namespace edm;
22 using namespace std;
23 
24 namespace test{
25 
26  static const unsigned int GTEVMId= 812;
27  static const unsigned int GTPEId= 814;
29  private:
30  public:
32  }
33 
34 
35  void analyze(const Event & e, const EventSetup& c){
36  cout << "--- Run: " << e.id().run()
37  << " LS: " << e.luminosityBlock()
38  << " Event: " << e.id().event()
39  << " Type: " << e.experimentType() << endl;
41  e.getByLabel("source",rawdata);
42  const FEDRawData& data = rawdata->FEDData(GTEVMId);
43  size_t size=data.size();
44 
45  if (size>0 ) {
46  cout << "FED# " << setw(4) << GTEVMId << " " << setw(8) << size << " bytes " << endl;
48  {
49  cout << "FED# " << setw(4) << GTEVMId << " is the real GT EVM block " << endl;
50  cout << "Event # " << evf::evtn::get(data.data(),true) << endl;
51  cout << "LS # " << evf::evtn::getlbn(data.data()) << endl;
52  cout << "ORBIT # " << evf::evtn::getorbit(data.data()) << endl;
53  cout << "GPS LOW # " << evf::evtn::getgpslow(data.data()) << endl;
54  cout << "GPS HI # " << evf::evtn::getgpshigh(data.data()) << endl;
55  cout << "BX FROM FDL 0-xing # " << evf::evtn::getfdlbx(data.data()) << endl;
56  cout << "PRESCALE INDEX FROM FDL 0-xing # " << evf::evtn::getfdlpsc(data.data()) << endl;
57  }
58  }
59 
60  const FEDRawData& data2 = rawdata->FEDData(GTPEId);
61  size=data2.size();
62 
63  if (size>0 ) {
64  cout << "FED# " << setw(4) << GTPEId << " " << setw(8) << size << " bytes " << endl;
66  {
67  cout << "FED# " << setw(4) << GTPEId << " is the real GTPE block " << endl;
68  cout << "Event # " << evf::evtn::gtpe_get(data2.data()) << endl;
69  cout << "LS # " << evf::evtn::gtpe_getlbn(data2.data()) << endl;
70  cout << "ORBIT # " << evf::evtn::gtpe_getorbit(data2.data()) << endl;
71  cout << "BX # " << evf::evtn::gtpe_getbx(data2.data()) << endl;
72  }
73  }
74 
75 // CPPUNIT_ASSERT(trailer.check()==true);
76 // CPPUNIT_ASSERT(trailer.lenght()==(int)data.size()/8);
77  }
78  };
79 DEFINE_FWK_MODULE(GlobalNumbersAnalysis);
80 }
81 
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
unsigned int getgpshigh(const unsigned char *)
unsigned int getfdlbx(const unsigned char *)
bool gtpe_board_sense(const unsigned char *p)
unsigned int get(const unsigned char *, bool)
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
DEFINE_FWK_MODULE(HiMixingModule)
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:390
bool evm_board_sense(const unsigned char *p, size_t size)
unsigned int getorbit(const unsigned char *)
unsigned int gtpe_getorbit(const unsigned char *)
edm::EventID id() const
Definition: EventBase.h:56
unsigned int gtpe_getbx(const unsigned char *)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
static const unsigned int GTPEId
edm::EventAuxiliary::ExperimentType experimentType() const
Definition: EventBase.h:61
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.