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