Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:39

0001 #include "DataFormats/L1Trigger/interface/L1DataEmulRecord.h"
0002 
0003 L1DataEmulRecord::L1DataEmulRecord() : deAgree(false), deGlt() {
0004   for (int i = 0; i < DEnsys; i++) {
0005     deMatch[i] = false;
0006     deSysCompared[i] = false;
0007     for (int j = 0; j < 2; j++)
0008       deNCand[i][j] = 0;
0009   }
0010   deColl.clear();
0011 }
0012 
0013 L1DataEmulRecord::L1DataEmulRecord(bool evt_match,
0014                                    bool sys_comp[DEnsys],
0015                                    bool sys_match[DEnsys],
0016                                    int nCand[DEnsys][2],
0017                                    const L1DEDigiCollection& coll,
0018                                    const GltDEDigi& glt)
0019     : deAgree(evt_match), deGlt(glt) {
0020   for (int i = 0; i < DEnsys; i++) {
0021     deMatch[i] = sys_match[i];
0022     deSysCompared[i] = sys_comp[i];
0023     for (int j = 0; j < 2; j++)
0024       deNCand[i][j] = nCand[i][j];
0025   }
0026   deColl = coll;
0027 }
0028 
0029 L1DataEmulRecord::L1DataEmulRecord(bool evt_match,
0030                                    std::array<bool, DEnsys> const& sys_comp,
0031                                    std::array<bool, DEnsys> const& sys_match,
0032                                    std::array<std::array<int, 2>, DEnsys> const& nCand,
0033                                    const L1DEDigiCollection& coll,
0034                                    const GltDEDigi& glt)
0035     : deAgree(evt_match), deGlt(glt) {
0036   for (int i = 0; i < DEnsys; i++) {
0037     deMatch[i] = sys_match[i];
0038     deSysCompared[i] = sys_comp[i];
0039     for (int j = 0; j < 2; j++)
0040       deNCand[i][j] = nCand[i][j];
0041   }
0042   deColl = coll;
0043 }
0044 
0045 L1DataEmulRecord::~L1DataEmulRecord() {}
0046 
0047 void L1DataEmulRecord::get_status(bool result[]) const {
0048   for (int i = 0; i < DEnsys; i++)
0049     result[i] = deMatch[i];
0050 }
0051 
0052 void L1DataEmulRecord::set_status(bool result) { deAgree = result; }
0053 
0054 void L1DataEmulRecord::set_status(const bool result[]) {
0055   for (int i = 0; i < DEnsys; i++)
0056     deMatch[i] = result[i];
0057 }
0058 
0059 std::ostream& operator<<(std::ostream& s, const L1DataEmulRecord& cand) {
0060   s << "L1DataEmulRecord  d|e status: " << (cand.get_status() ? "agree" : "disagree");
0061   s << "\n\tsys compd? ";
0062   for (int i = 0; i < L1DataEmulRecord::DEnsys; i++)
0063     s << cand.get_isComp(i);
0064   s << "\n\tsys match? ";
0065   for (int i = 0; i < L1DataEmulRecord::DEnsys; i++)
0066     s << cand.get_status(i);
0067   s << "\n\tndata: ";
0068   for (int i = 0; i < L1DataEmulRecord::DEnsys; i++)
0069     s << cand.getNCand(i, 0) << " ";
0070   s << "\n\tnemul: ";
0071   for (int i = 0; i < L1DataEmulRecord::DEnsys; i++)
0072     s << cand.getNCand(i, 1) << " ";
0073   s << "\n\tdigis  size:" << (cand.getColl()).size();
0074   s << std::flush;
0075   L1DataEmulRecord::L1DEDigiCollection::const_iterator it;
0076   std::vector<L1DataEmulDigi> dgcoll = cand.getColl();
0077   for (it = dgcoll.begin(); it != dgcoll.end(); it++)
0078     s << "\n\t" << *it;
0079   s << cand.getGlt();
0080   return s;
0081 }