#include <EventFilter/CSCRawToDigi/interface/CSCAnodeData2007.h>
Public Member Functions | |
virtual void | add (const CSCWireDigi &, int layer) |
CSCAnodeData2007 (const CSCALCTHeader &, const unsigned short *buf) | |
fill from a real datastream | |
CSCAnodeData2007 (const CSCALCTHeader &) | |
a blank one, for Monte Carlo | |
virtual unsigned short * | data () |
virtual unsigned short int | sizeInWords () const |
the amount of the input binary buffer read, in 16-bit words | |
virtual std::vector< CSCWireDigi > | wireDigis (int layer) const |
input layer is from 1 to 6 | |
Private Member Functions | |
CSCAnodeDataFrame2007 & | findFrame (int tbin, int layer, int layerPart) |
const CSCAnodeDataFrame2007 & | findFrame (int tbin, int layer, int layerPart) const |
int | index (int tbin, int layer, int layerPart) const |
void | init (const CSCALCTHeader &) |
Private Attributes | |
unsigned short int | layerParts_ |
unsigned short int | maxWireGroups_ |
number of layer parts in the ALCT | |
unsigned short int | nAFEBs_ |
unsigned short int | nTimeBins_ |
unsigned short int | sizeInWords2007_ |
unsigned short | theDataFrames [2700] |
we don't know the size at first. Max should be 7 boards * 32 bins * 6 layers * 2 |
Definition at line 27 of file CSCAnodeData2007.h.
CSCAnodeData2007::CSCAnodeData2007 | ( | const CSCALCTHeader & | header | ) | [explicit] |
a blank one, for Monte Carlo
Definition at line 7 of file CSCAnodeData2007.cc.
References init(), sizeInWords(), and theDataFrames.
00008 : nAFEBs_(header.nLCTChipRead()), nTimeBins_(header.NTBins()) 00009 { 00010 bzero(theDataFrames, sizeInWords()*2); 00011 init(header); 00012 }
CSCAnodeData2007::CSCAnodeData2007 | ( | const CSCALCTHeader & | header, | |
const unsigned short * | buf | |||
) |
fill from a real datastream
dont memcpy if not 2006 or 2007
Definition at line 15 of file CSCAnodeData2007.cc.
References init(), sizeInWords(), and theDataFrames.
00017 : nAFEBs_(header.nLCTChipRead()), nTimeBins_(header.NTBins()) 00018 { 00019 init(header); 00020 memcpy(theDataFrames, buf, sizeInWords()*2); 00021 }
void CSCAnodeData2007::add | ( | const CSCWireDigi & | digi, | |
int | layer | |||
) | [virtual] |
Implements CSCAnodeDataFormat.
Definition at line 88 of file CSCAnodeData2007.cc.
00089 { 00090 /* 00091 int wireGroup = digi.getWireGroup(); 00092 int bxn=digi.getBeamCrossingTag(); 00093 int alctBoard = (wireGroup-1) / 16; 00094 int localGroup = (wireGroup-1) % 16; 00095 00096 // crash if there's a bad wire number, but don't freak out 00097 // if a time bin is out of range 00098 // assert(alctBoard < nAFEBs_); 00099 if(alctBoard > nAFEBs_) 00100 { 00101 edm::LogError("CSCAnodeData|CSCRawToDigi") << "Bad Wire Number for this digi."; 00102 return; 00103 } 00104 00105 if(bxn >= 0 && bxn < nTimeBins_) 00106 { 00107 // 12 16-bit words per time bin, two per layer 00108 // wiregroups 0-7 go on the first line, 8-15 go on the 2nd. 00109 unsigned halfLayer = (localGroup > 7); 00110 unsigned bitNumber = localGroup % 8; 00111 // and pack it in the 8 bits allocated 00112 rawHit(alctBoard, bxn, layer, halfLayer).addHit(bitNumber); 00113 } 00114 else 00115 { 00116 LogTrace("CSCAnodeData|CSCRawToDigi")<< "warning: not saving anode data in bx " << bxn 00117 << ": out of range "; 00118 } 00119 */ 00120 }
virtual unsigned short* CSCAnodeData2007::data | ( | ) | [inline, virtual] |
Implements CSCAnodeDataFormat.
Definition at line 35 of file CSCAnodeData2007.h.
References theDataFrames.
00035 {return theDataFrames;}
CSCAnodeDataFrame2007 & CSCAnodeData2007::findFrame | ( | int | tbin, | |
int | layer, | |||
int | layerPart | |||
) | [private] |
Definition at line 74 of file CSCAnodeData2007.cc.
References index(), and theDataFrames.
00074 { 00075 return (CSCAnodeDataFrame2007 &)(theDataFrames[index(tbin, layer, layerPart)]); 00076 }
const CSCAnodeDataFrame2007 & CSCAnodeData2007::findFrame | ( | int | tbin, | |
int | layer, | |||
int | layerPart | |||
) | const [private] |
Definition at line 69 of file CSCAnodeData2007.cc.
References index(), and theDataFrames.
Referenced by wireDigis().
00069 { 00070 return (const CSCAnodeDataFrame2007 &)(theDataFrames[index(tbin, layer, layerPart)]); 00071 }
Definition at line 79 of file CSCAnodeData2007.cc.
References layerParts_, and nTimeBins_.
Referenced by findFrame().
00080 { 00081 assert(tbin<nTimeBins_); 00082 assert(layer<=6); 00083 assert(layerPart<layerParts_); 00084 return tbin*6*layerParts_+(layer-1)*layerParts_+layerPart; 00085 }
void CSCAnodeData2007::init | ( | const CSCALCTHeader & | header | ) | [private] |
the sizes of raw words vary depending on type of the ALCT board number of layer parts for various alct board types: 1 2 3 5 6
Definition at line 24 of file CSCAnodeData2007.cc.
References CSCALCTHeader::alctHeader2007(), CSCALCTHeader2007::boardType, layerParts_, maxWireGroups_, CSCALCTHeader2007::rawBins, CSCALCTHeader2007::rawOverflow, and sizeInWords2007_.
Referenced by CSCAnodeData2007().
00024 { 00028 static unsigned short int layerParts[7] = { 3, 3, 4, 6, 6, 8,10}; 00029 static unsigned short int wireGroups[7] = {32,32,48,64,64,96,112}; 00030 00031 sizeInWords2007_=(1-header.alctHeader2007().rawOverflow)*6* 00032 header.alctHeader2007().rawBins*layerParts[header.alctHeader2007().boardType]; 00033 layerParts_ = layerParts[header.alctHeader2007().boardType]; 00034 maxWireGroups_ = wireGroups[header.alctHeader2007().boardType]; 00035 }
virtual unsigned short int CSCAnodeData2007::sizeInWords | ( | ) | const [inline, virtual] |
the amount of the input binary buffer read, in 16-bit words
Implements CSCAnodeDataFormat.
Definition at line 37 of file CSCAnodeData2007.h.
References sizeInWords2007_.
Referenced by CSCAnodeData2007().
00037 {return sizeInWords2007_;}
std::vector< CSCWireDigi > CSCAnodeData2007::wireDigis | ( | int | layer | ) | const [virtual] |
input layer is from 1 to 6
we know how many layer parts are there from ALCT header
loop over 12 bits in each word (each bit is one wiregroup) we want to stop if we reached the maxWireGroups
loop over tbins
end of the loop over bits in the data frame
end of the loop over layer parts
Implements CSCAnodeDataFormat.
Definition at line 38 of file CSCAnodeData2007.cc.
References CSCAnodeDataFrame2007::data(), findFrame(), CSCAnodeDataFrame2007::isHit(), j, layerParts_, LogTrace, maxWireGroups_, and nTimeBins_.
00038 { 00039 std::vector<CSCWireDigi> digis; 00040 uint32_t tbinbits=0; 00041 uint16_t wireGroup=0; 00042 for(int layerPart = 0; layerPart <layerParts_; ++layerPart) { 00044 for (int j=0; (j<12)&&((layerPart*12+j)<maxWireGroups_) ;++j) { 00047 for(int tbin = 0; tbin < nTimeBins_; ++tbin) { 00048 const CSCAnodeDataFrame2007 & frame = findFrame(tbin, layer, layerPart); 00049 if(frame.data() != 0) { 00050 if(frame.isHit(j)) { 00051 tbinbits=tbinbits + (1<<tbin); 00052 } 00053 } 00054 }//end of tbin loop 00055 if (tbinbits !=0 ) { 00056 wireGroup = (layerPart*12+j)+1; 00057 CSCWireDigi digi(wireGroup, tbinbits); 00058 LogTrace ("CSCAnodeData|CSCRawToDigi") << "Layer " << layer << " " << digi; 00059 digis.push_back(digi); 00060 tbinbits=0; 00061 } 00062 } 00063 } 00064 00065 return digis; 00066 }
unsigned short int CSCAnodeData2007::layerParts_ [private] |
unsigned short int CSCAnodeData2007::maxWireGroups_ [private] |
number of layer parts in the ALCT
Definition at line 58 of file CSCAnodeData2007.h.
Referenced by init(), and wireDigis().
unsigned short int CSCAnodeData2007::nAFEBs_ [private] |
Definition at line 54 of file CSCAnodeData2007.h.
unsigned short int CSCAnodeData2007::nTimeBins_ [private] |
unsigned short int CSCAnodeData2007::sizeInWords2007_ [private] |
unsigned short CSCAnodeData2007::theDataFrames[2700] [private] |
we don't know the size at first. Max should be 7 boards * 32 bins * 6 layers * 2
Definition at line 52 of file CSCAnodeData2007.h.
Referenced by CSCAnodeData2007(), data(), and findFrame().