#include <EventFilter/CSCRawToDigi/interface/CSCAnodeData2006.h>
Public Member Functions | |
virtual void | add (const CSCWireDigi &, int layer) |
CSCAnodeData2006 (const CSCALCTHeader &, const unsigned short *buf) | |
fill from a real datastream | |
CSCAnodeData2006 (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 | |
int | index (int afeb, int tbin, int layer) const |
the index into theDataFrames | |
void | init () |
CSCAnodeDataFrame2006 & | rawHit (int afeb, int tbin, int layer, int halfLayer) |
nonconst version | |
const CSCAnodeDataFrame2006 & | rawHit (int afeb, int tbin, int layer, int halfLayer) const |
Private Attributes | |
int | nAFEBs_ |
in 2007 format the max number of frames is 1860 | |
int | nTimeBins_ |
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 42 of file CSCAnodeData2006.h.
CSCAnodeData2006::CSCAnodeData2006 | ( | const CSCALCTHeader & | header | ) |
a blank one, for Monte Carlo
for digi->raw packing
Definition at line 9 of file CSCAnodeData2006.cc.
References LogTrace, nAFEBs_, nTimeBins_, rawHit(), sizeInWords(), and theDataFrames.
00010 : nAFEBs_(header.nLCTChipRead()), nTimeBins_(header.NTBins()) 00011 { 00012 LogTrace ("CSCAnodeData|CSCRawToDigi") << "Making Anode data " 00013 << sizeInWords() << " AFEB " << nAFEBs_ 00014 << " TBINS " << nTimeBins_; 00015 bzero(theDataFrames, sizeInWords()*2); 00016 for(int afeb = 0; afeb < nAFEBs_; ++afeb) { 00017 for(int tbin = 0; tbin < nTimeBins_; ++tbin) { 00018 for(int layer = 1; layer <= 6; ++layer) { 00019 for(int halfLayer = 0; halfLayer < 2; ++halfLayer) { 00020 rawHit(afeb, tbin, layer, halfLayer) 00021 = CSCAnodeDataFrame2006(afeb, tbin, 0); 00022 } 00023 } 00024 } 00025 } 00026 }
CSCAnodeData2006::CSCAnodeData2006 | ( | const CSCALCTHeader & | header, | |
const unsigned short * | buf | |||
) |
fill from a real datastream
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
dont memcpy if not 2006 or 2007
Definition at line 29 of file CSCAnodeData2006.cc.
References CSCALCTHeader::check(), LogTrace, nAFEBs_, nTimeBins_, sizeInWords(), and theDataFrames.
00031 : nAFEBs_(header.nLCTChipRead()), 00032 nTimeBins_(header.NTBins()) 00033 { 00034 00038 LogTrace ("CSCAnodeData|CSCRawToDigi") << "nAFEBs = " << nAFEBs_ << " nTimeBins = " 00039 << nTimeBins_ << " nFrames = " << sizeInWords(); 00040 LogTrace ("CSCAnodeData|CSCRawToDigi") << header << " HEADER CHECK " << header.check(); 00041 00042 memcpy(theDataFrames, buf, sizeInWords()*2); 00043 }
void CSCAnodeData2006::add | ( | const CSCWireDigi & | digi, | |
int | layer | |||
) | [virtual] |
Implements CSCAnodeDataFormat.
Definition at line 78 of file CSCAnodeData2006.cc.
References CSCAnodeDataFrame2006::addHit(), CSCWireDigi::getBeamCrossingTag(), CSCWireDigi::getWireGroup(), LogTrace, nAFEBs_, nTimeBins_, and rawHit().
00079 { 00080 00081 int wireGroup = digi.getWireGroup(); 00082 int bxn=digi.getBeamCrossingTag(); 00083 int alctBoard = (wireGroup-1) / 16; 00084 int localGroup = (wireGroup-1) % 16; 00085 00086 // crash if there's a bad wire number, but don't freak out 00087 // if a time bin is out of range 00088 // assert(alctBoard < nAFEBs_); 00089 if(alctBoard > nAFEBs_) 00090 { 00091 edm::LogError("CSCAnodeData|CSCRawToDigi") << "Bad Wire Number for this digi."; 00092 return; 00093 } 00094 00095 if(bxn >= 0 && bxn < nTimeBins_) 00096 { 00097 // 12 16-bit words per time bin, two per layer 00098 // wiregroups 0-7 go on the first line, 8-15 go on the 2nd. 00099 unsigned halfLayer = (localGroup > 7); 00100 unsigned bitNumber = localGroup % 8; 00101 // and pack it in the 8 bits allocated 00102 rawHit(alctBoard, bxn, layer, halfLayer).addHit(bitNumber); 00103 } 00104 else 00105 { 00106 LogTrace("CSCAnodeData|CSCRawToDigi")<< "warning: not saving anode data in bx " << bxn 00107 << ": out of range "; 00108 } 00109 }
virtual unsigned short* CSCAnodeData2006::data | ( | ) | [inline, virtual] |
Implements CSCAnodeDataFormat.
Definition at line 50 of file CSCAnodeData2006.h.
References theDataFrames.
00050 {return theDataFrames;}
the index into theDataFrames
Definition at line 72 of file CSCAnodeData2006.h.
References nTimeBins_, HLT_VtxMuL3::result, and sizeInWords().
Referenced by rawHit().
00072 { 00073 int result = (layer-1)*2 + 12*tbin + afeb*12*nTimeBins_; 00074 assert(result < sizeInWords()); 00075 return result; 00076 }
void CSCAnodeData2006::init | ( | ) | [private] |
CSCAnodeDataFrame2006& CSCAnodeData2006::rawHit | ( | int | afeb, | |
int | tbin, | |||
int | layer, | |||
int | halfLayer | |||
) | [inline, private] |
nonconst version
Definition at line 67 of file CSCAnodeData2006.h.
References index(), and theDataFrames.
00067 { 00068 return (CSCAnodeDataFrame2006 &)(theDataFrames[index(afeb, tbin, layer)+halfLayer]); 00069 }
const CSCAnodeDataFrame2006& CSCAnodeData2006::rawHit | ( | int | afeb, | |
int | tbin, | |||
int | layer, | |||
int | halfLayer | |||
) | const [inline, private] |
Definition at line 62 of file CSCAnodeData2006.h.
References index(), and theDataFrames.
Referenced by add(), CSCAnodeData2006(), and wireDigis().
00062 { 00063 return (const CSCAnodeDataFrame2006 &)(theDataFrames[index(afeb, tbin, layer)+halfLayer]); 00064 }
virtual unsigned short int CSCAnodeData2006::sizeInWords | ( | ) | const [inline, virtual] |
the amount of the input binary buffer read, in 16-bit words
Implements CSCAnodeDataFormat.
Definition at line 52 of file CSCAnodeData2006.h.
References nAFEBs_, and nTimeBins_.
Referenced by CSCAnodeData2006(), and index().
00052 {return nAFEBs_ * nTimeBins_ * 6 * 2;}
std::vector< CSCWireDigi > CSCAnodeData2006::wireDigis | ( | int | layer | ) | const [virtual] |
input layer is from 1 to 6
Implements CSCAnodeDataFormat.
Definition at line 46 of file CSCAnodeData2006.cc.
References CSCAnodeDataFrame2006::data(), debug, CSCAnodeDataFrame2006::isHit(), j, LogTrace, nAFEBs_, nTimeBins_, and rawHit().
00046 { 00047 std::vector<CSCWireDigi> digis; 00048 uint32_t tbinbits=0; 00049 uint16_t wireGroup=0; 00050 for(int afeb = 0; afeb < nAFEBs_; ++afeb) { 00051 for(int halfLayer = 0; halfLayer <2; ++halfLayer) { 00052 for (int j=0;j<8;++j) { 00053 for(int tbin = 0; tbin < nTimeBins_; ++tbin) { 00054 const CSCAnodeDataFrame2006 & frame = rawHit(afeb,tbin,layer, halfLayer); 00055 // see if there's anything in 1st 8 bits. Usually zero 00056 if(frame.data() != 0) { 00057 if(frame.isHit(j)) { 00058 tbinbits=tbinbits + (1<<tbin); 00059 } 00060 } 00061 }//end of tbin loop 00062 if (tbinbits !=0 ) { 00063 wireGroup = (afeb*16+halfLayer*8+j)+1; 00064 CSCWireDigi digi(wireGroup, tbinbits); 00065 if (debug) 00066 LogTrace ("CSCAnodeData|CSCRawToDigi") << "Layer " << layer << " " << digi; 00067 digis.push_back(digi); 00068 tbinbits=0; 00069 } 00070 } 00071 } 00072 } 00073 00074 return digis; 00075 }
int CSCAnodeData2006::nAFEBs_ [private] |
in 2007 format the max number of frames is 1860
Definition at line 81 of file CSCAnodeData2006.h.
Referenced by add(), CSCAnodeData2006(), sizeInWords(), and wireDigis().
int CSCAnodeData2006::nTimeBins_ [private] |
Definition at line 82 of file CSCAnodeData2006.h.
Referenced by add(), CSCAnodeData2006(), index(), sizeInWords(), and wireDigis().
unsigned short CSCAnodeData2006::theDataFrames[2700] [private] |
we don't know the size at first. Max should be 7 boards * 32 bins * 6 layers * 2
Definition at line 79 of file CSCAnodeData2006.h.
Referenced by CSCAnodeData2006(), data(), and rawHit().