File indexing completed on 2024-04-06 12:04:20
0001 #include "DataFormats/HGCalDigi/interface/HGCalRawDataEmulatorInfo.h"
0002 #include <iostream>
0003 #include <cassert>
0004 #include <string>
0005 #include <chrono>
0006 #include <random>
0007
0008 int main(int argc, char** argv) {
0009 std::cout << "Basic test of MC truth for the HGCalRawDataEmulatorInfo classes" << std::endl;
0010
0011
0012 unsigned seed1 = std::chrono::system_clock::now().time_since_epoch().count();
0013 std::minstd_rand0 myrand(seed1);
0014
0015
0016 HGCalSlinkEmulatorInfo slink_info;
0017 for (unsigned long u = 0; u < 128; u++) {
0018 for (size_t cb = 0; cb < 10; ++cb) {
0019 std::vector<bool> enabledCh;
0020 for (size_t ch = 0; ch < 37; ++ch)
0021 enabledCh.emplace_back(myrand());
0022 bool obit = myrand() % 2;
0023 bool bbit = myrand() % 2;
0024 bool ebit = myrand() % 2;
0025 bool tbit = myrand() % 2;
0026 bool hbit = myrand() % 2;
0027 bool sbit = myrand() % 2;
0028 HGCalECONDEmulatorInfo econd_info(obit, bbit, ebit, tbit, hbit, sbit);
0029 econd_info.addERxChannelsEnable(enabledCh);
0030 assert(econd_info.bitO() == obit);
0031 assert(econd_info.bitB() == bbit);
0032 assert(econd_info.bitE() == ebit);
0033 assert(econd_info.bitT() == tbit);
0034 assert(econd_info.bitH() == hbit);
0035 assert(econd_info.bitS() == sbit);
0036 slink_info.captureBlockEmulatedInfo(cb).addECONDEmulatedInfo(u, econd_info);
0037 }
0038 }
0039
0040 slink_info.clear();
0041 std::cout << "\t ...... OK" << std::endl;
0042
0043 return 0;
0044 }