CMS 3D CMS Logo

CSCALCTHeader2006.cc
Go to the documentation of this file.
3 
4 #ifdef LOCAL_UNPACK
5 static int activeFEBsForChamberType[11] = {0, 7, 7, 0xf, 7, 0x7f, 0xf, 0x3f, 0xf, 0x3f, 0xf};
6 static int nTBinsForChamberType[11] = {7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7};
7 #else
8 constexpr int activeFEBsForChamberType[11] = {0, 7, 7, 0xf, 7, 0x7f, 0xf, 0x3f, 0xf, 0x3f, 0xf};
9 constexpr int nTBinsForChamberType[11] = {7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7};
10 #endif
11 
12 CSCALCTHeader2006::CSCALCTHeader2006(int chamberType) { //constructor for digi->raw packing based on header2006
13  // we count from 1 to 10, ME11, ME12, ME13, ME1A, ME21, ME22, ....
14  init();
15  flag_0 = 0xC;
16  flag_1 = 0;
17  reserved_1 = 0;
18  fifoMode = 1;
19  // examiner demands this
20  l1aMatch = 1;
23  nTBins = nTBinsForChamberType[chamberType];
25  //memcpy(theOriginalBuffer, &header2006, header2006.sizeForPacking());
26 }
27 
29  l1Acc = dmb.l1a();
30  cscID = dmb.dmbID();
31  nTBins = 16;
32  bxnCount = dmb.bxn();
33 }
34 
35 unsigned short CSCALCTHeader2006::nLCTChipRead() const {
36  int count = 0;
37  for (int i = 0; i < 7; ++i) {
38  if ((lctChipRead >> i) & 1)
39  ++count;
40  }
41  return count;
42 }
43 
44 std::vector<CSCALCTDigi> CSCALCTs2006::ALCTDigis() const {
45  std::vector<CSCALCTDigi> result;
46  result.reserve(2);
47 
48  CSCALCTDigi digi0(
50  CSCALCTDigi digi1(
52  result.push_back(digi0);
53  result.push_back(digi1);
54  return result;
55 }
56 
57 void CSCALCTs2006::add(const std::vector<CSCALCTDigi>& digis) {
58  //FIXME doesn't do any sorting
59  if (!digis.empty())
60  addALCT0(digis[0]);
61  if (digis.size() > 1)
62  addALCT1(digis[1]);
63 }
64 
66  alct0_valid = digi.isValid();
67  alct0_quality = digi.getQuality();
68  alct0_accel = digi.getAccelerator();
70  alct0_key_wire = digi.getKeyWG();
71  // probably not right
72  alct0_bxn_low = digi.getBX();
73 }
74 
76  alct1_valid = digi.isValid();
77  alct1_quality = digi.getQuality();
78  alct1_accel = digi.getAccelerator();
80  alct1_key_wire = digi.getKeyWG();
81  // probably not right
82  alct1_bxn_low = digi.getBX();
83 }
CSCALCTs2006::ALCTDigis
std::vector< CSCALCTDigi > ALCTDigis() const
Definition: CSCALCTHeader2006.cc:44
CSCALCTDigi::getBX
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:73
mps_fire.i
i
Definition: mps_fire.py:428
CSCALCTHeader2006::cscID
unsigned cscID
chamber ID number
Definition: CSCALCTHeader2006.h:37
CSCALCTHeader2006::fifoMode
unsigned fifoMode
see the FIFO_MODE enum
Definition: CSCALCTHeader2006.h:44
nTBinsForChamberType
constexpr int nTBinsForChamberType[11]
Definition: CSCALCTHeader2006.cc:9
CSCDMBHeader::l1a
unsigned l1a() const
Definition: CSCDMBHeader.h:39
CSCALCTs2006::alct0_valid
unsigned alct0_valid
Definition: CSCALCTHeader2006.h:95
CSCALCTs2006::alct1_pattern
unsigned alct1_pattern
Definition: CSCALCTHeader2006.h:113
CSCALCTs2006::add
void add(const std::vector< CSCALCTDigi > &digis)
should try to sort, but doesn't for now
Definition: CSCALCTHeader2006.cc:57
CSCALCTHeader2006::lctChipRead
unsigned lctChipRead
LCT chips read out in raw hit dump.
Definition: CSCALCTHeader2006.h:68
CSCALCTs2006::alct0_key_wire
unsigned alct0_key_wire
Definition: CSCALCTHeader2006.h:99
CSCALCTHeader2006::l1Acc
unsigned l1Acc
l1 accept counter
Definition: CSCALCTHeader2006.h:35
CSCALCTHeader2006::setEventInformation
void setEventInformation(const CSCDMBHeader &)
Definition: CSCALCTHeader2006.cc:28
CSCALCTs2006::alct0_pattern
unsigned alct0_pattern
Definition: CSCALCTHeader2006.h:98
CSCALCTHeader2006::bxnCount
unsigned bxnCount
full bunch crossing number
Definition: CSCALCTHeader2006.h:61
CSCALCTHeader2006::activeFEBs
unsigned activeFEBs
LCT chips with ADB hits.
Definition: CSCALCTHeader2006.h:70
CSCALCTHeader2006::flag_0
unsigned flag_0
should be '01100', so it'll be a 6xxx in the ASCII dump
Definition: CSCALCTHeader2006.h:41
CSCALCTs2006::alct0_quality
unsigned alct0_quality
Definition: CSCALCTHeader2006.h:96
CSCALCTDigi::getKeyWG
uint16_t getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:67
CSCDMBHeader.h
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
CSCALCTDigi::getCollisionB
uint16_t getCollisionB() const
Definition: CSCALCTDigi.h:61
CSCALCTDigi::getQuality
uint16_t getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:46
CSCALCTHeader2006.h
CSCALCTs2006::alct0_bxn_low
unsigned alct0_bxn_low
Definition: CSCALCTHeader2006.h:100
CSCALCTHeader2006::CSCALCTHeader2006
CSCALCTHeader2006()
this struct contains all 2006 ALCT Header words except ALCTs
Definition: CSCALCTHeader2006.h:12
CSCALCTHeader2006::init
void init()
Definition: CSCALCTHeader2006.h:18
CSCALCTs2006::alct1_accel
unsigned alct1_accel
Definition: CSCALCTHeader2006.h:112
CSCALCTs2006::alct1_valid
unsigned alct1_valid
2nd LCT lower 15 bits
Definition: CSCALCTHeader2006.h:110
CSCDMBHeader::bxn
unsigned bxn() const
Definition: CSCDMBHeader.h:37
CSCALCTs2006::alct1_quality
unsigned alct1_quality
Definition: CSCALCTHeader2006.h:111
CSCALCTs2006::alct1_key_wire
unsigned alct1_key_wire
Definition: CSCALCTHeader2006.h:114
CSCALCTs2006::addALCT0
void addALCT0(const CSCALCTDigi &digi)
Definition: CSCALCTHeader2006.cc:65
CSCALCTHeader2006::reserved_1
unsigned reserved_1
reserved, set to 0
Definition: CSCALCTHeader2006.h:56
CSCALCTHeader2006::nTBins
unsigned nTBins
Definition: CSCALCTHeader2006.h:46
CSCALCTs2006::alct1_bxn_low
unsigned alct1_bxn_low
Definition: CSCALCTHeader2006.h:115
CSCALCTs2006::alct1_bxn_high
unsigned alct1_bxn_high
Definition: CSCALCTHeader2006.h:118
CSCDMBHeader
Definition: CSCDMBHeader.h:15
CSCALCTHeader2006::l1aMatch
unsigned l1aMatch
exteran L1A arrived in L1A window
Definition: CSCALCTHeader2006.h:48
CSCALCTHeader2006::flag_1
unsigned flag_1
DDU+LCT special word flags.
Definition: CSCALCTHeader2006.h:58
CSCALCTDigi::getAccelerator
uint16_t getAccelerator() const
Definition: CSCALCTDigi.h:53
CSCALCTDigi
Definition: CSCALCTDigi.h:17
CSCALCTs2006::alct0_accel
unsigned alct0_accel
Definition: CSCALCTHeader2006.h:97
CSCALCTDigi::isValid
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
activeFEBsForChamberType
constexpr int activeFEBsForChamberType[11]
Definition: CSCALCTHeader2006.cc:8
CSCDMBHeader::dmbID
unsigned dmbID() const
Definition: CSCDMBHeader.h:36
CSCALCTHeader2006::nLCTChipRead
unsigned short nLCTChipRead() const
Definition: CSCALCTHeader2006.cc:35
mps_fire.result
result
Definition: mps_fire.py:311
CSCALCTs2006::alct0_bxn_high
unsigned alct0_bxn_high
Definition: CSCALCTHeader2006.h:104
CSCALCTs2006::addALCT1
void addALCT1(const CSCALCTDigi &digi)
Definition: CSCALCTHeader2006.cc:75