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