CMS 3D CMS Logo

CSCTFTBFrontBlock Class Reference

#include <EventFilter/CSCTFRawToDigi/old/CSCTFTBFrontBlock.h>

List of all members.

Public Member Functions

int BX () const
 (relative) BX assigned to this bank
 CSCTFTBFrontBlock (unsigned short *buf, int bx, const CSCTFTBEventHeader &hdr)
 CSCTFTBFrontBlock ()
CSCTFTBFrontData frontData (unsigned mpc, unsigned link) const
 return one link's data
std::vector< CSCTFTBFrontDatafrontData (unsigned mpc) const
 return one mpc's data
std::vector< std::vector
< CSCTFTBFrontData > > 
frontData () const
 return the SR data, in vector of vectors
CSCCorrelatedLCTDigi frontDigiData (unsigned mpc, unsigned link) const
CSCTFTBFrontHeader frontHeader () const
 return this SR block's header
int size () const
 size of data bank in 16-bit words
 ~CSCTFTBFrontBlock ()

Protected Member Functions

int unpackData (unsigned short *buf, const CSCTFTBEventHeader &)

Protected Attributes

CSCTFTBFrontHeader frontHeader_
int myBX_
int size_
std::vector< std::vector
< CSCTFTBFrontData > > 
srdata_
 SRData is unpacked and stored in this vector.

Friends

std::ostream & operator<< (std::ostream &stream, const CSCTFTBFrontBlock &)
 make a bit vector


Detailed Description

Definition at line 90 of file CSCTFTBFrontBlock.h.


Constructor & Destructor Documentation

CSCTFTBFrontBlock::CSCTFTBFrontBlock (  ) 

Definition at line 120 of file CSCTFTBFrontBlock.cc.

References frontHeader_, myBX_, and size_.

00121 {
00122   myBX_ = 0;
00123   size_ = 0;
00124   frontHeader_ = CSCTFTBFrontHeader();
00125 }

CSCTFTBFrontBlock::CSCTFTBFrontBlock ( unsigned short *  buf,
int  bx,
const CSCTFTBEventHeader hdr 
)

Definition at line 129 of file CSCTFTBFrontBlock.cc.

References myBX_, size_, and unpackData().

00131 {
00132 
00133   myBX_ = bx;
00134   size_ = 0;
00135 /*
00136   cout << "SR Bx Data : " << endl;
00137   cout << " Front valid pattern = " << hex << validPattern_ << dec <<endl;
00138 */
00139   unpackData(buf, thehdr);
00140 }

CSCTFTBFrontBlock::~CSCTFTBFrontBlock (  ) 

Definition at line 142 of file CSCTFTBFrontBlock.cc.

References srdata_.

00143 {
00144   std::vector<std::vector<CSCTFTBFrontData> >::iterator the_data;
00145 
00146   for(the_data = srdata_.begin(); the_data != srdata_.end() ; the_data++)
00147     {
00148       the_data->clear();
00149     }
00150   srdata_.clear();
00151 }


Member Function Documentation

int CSCTFTBFrontBlock::BX (  )  const [inline]

(relative) BX assigned to this bank

Definition at line 128 of file CSCTFTBFrontBlock.h.

References myBX_.

00128 {return myBX_;};

CSCTFTBFrontData CSCTFTBFrontBlock::frontData ( unsigned  mpc,
unsigned  link 
) const

return one link's data

Accessor to one link's data.

Definition at line 164 of file CSCTFTBFrontBlock.cc.

References size(), and srdata_.

00166 {
00167   mpc -= 1;
00168   link -= 1; 
00169   if(srdata_[mpc].size() && (link < srdata_[mpc].size())) return srdata_[mpc][link];
00170   return CSCTFTBFrontData(mpc+1);
00171 }

std::vector< CSCTFTBFrontData > CSCTFTBFrontBlock::frontData ( unsigned  mpc  )  const

return one mpc's data

Accessor to link triplet of one MPC.

Definition at line 156 of file CSCTFTBFrontBlock.cc.

References srdata_.

00157 {
00158    mpc -= 1;
00159    if(mpc < srdata_.size()) return srdata_[mpc];
00160    return std::vector<CSCTFTBFrontData>();
00161 }

std::vector<std::vector<CSCTFTBFrontData> > CSCTFTBFrontBlock::frontData (  )  const [inline]

return the SR data, in vector of vectors

Definition at line 115 of file CSCTFTBFrontBlock.h.

References srdata_.

Referenced by operator<<().

00115 {return srdata_;}

CSCCorrelatedLCTDigi CSCTFTBFrontBlock::frontDigiData ( unsigned  mpc,
unsigned  link 
) const

Definition at line 173 of file CSCTFTBFrontBlock.cc.

References frontHeader_, CSCTFTBFrontHeader::getVPBit(), CSCTFTBFrontData::lrPacked(), myBX_, CSCTFTBFrontData::patternPacked(), CSCTFTBFrontData::qualityPacked(), size(), srdata_, CSCTFTBFrontData::stripPacked(), and CSCTFTBFrontData::wireGroupPacked().

Referenced by operator<<().

00174 {
00175   mpc -= 1;
00176   link -= 1;
00177   if(srdata_[mpc].size() && (link < srdata_[mpc].size()))
00178     {
00179       CSCTFTBFrontData aFD = srdata_[mpc][link];
00180       return CSCCorrelatedLCTDigi(0, frontHeader_.getVPBit(mpc + 1, link + 1), aFD.qualityPacked(), 
00181                                   aFD.wireGroupPacked(), aFD.stripPacked(),
00182                                   aFD.patternPacked(), aFD.lrPacked(), myBX_);
00183     }
00184   return CSCCorrelatedLCTDigi();
00185 }

CSCTFTBFrontHeader CSCTFTBFrontBlock::frontHeader (  )  const [inline]

return this SR block's header

Definition at line 112 of file CSCTFTBFrontBlock.h.

References frontHeader_.

Referenced by operator<<().

00112 {return frontHeader_;}

int CSCTFTBFrontBlock::size ( void   )  const [inline]

size of data bank in 16-bit words

Definition at line 125 of file CSCTFTBFrontBlock.h.

References size_.

Referenced by frontData(), frontDigiData(), operator<<(), and CSCTFTBEventData::unpackData().

00125 {return size_;};

int CSCTFTBFrontBlock::unpackData ( unsigned short *  buf,
const CSCTFTBEventHeader hdr 
) [protected]

Definition at line 187 of file CSCTFTBFrontBlock.cc.

References data, frontHeader_, CSCTFTBEventHeader::getActiveFront(), CSCTFTBFrontHeader::getVPBit(), CSCTFTBEventHeader::getZeroSupp(), link(), CSCTFTBEventHeader::numLinks(), CSCTFTBEventHeader::numMPC(), CSCTFTBFrontHeader::size(), CSCTFTBFrontData::size(), size_, and srdata_.

Referenced by CSCTFTBFrontBlock().

00189 {
00190 //   cout << " CSCTFTBFrontBlock_unpackData-INFO: Unpacking event data" << endl;
00191    srdata_.clear();
00192    int nMPC = hdr.numMPC();
00193    int nLinks = hdr.numLinks();
00194    memcpy(&frontHeader_,buf,CSCTFTBFrontHeader::size()*sizeof(short));
00195 
00196    buf += CSCTFTBFrontHeader::size();
00197    size_ += CSCTFTBFrontHeader::size();
00198 
00199 
00200    for (int mpc = 1; mpc<=nMPC; mpc++) 
00201      {
00202        if((hdr.getActiveFront() & (1<<(mpc-1)))) 
00203          {
00204            std::vector<CSCTFTBFrontData> links_;
00205            for(int link = 1; link<=nLinks;link++)
00206              {
00207                CSCTFTBFrontData data(mpc);
00208                if(frontHeader_.getVPBit(mpc,link)||hdr.getZeroSupp()==0)
00209                  {                 
00210                    memcpy(&data,buf,CSCTFTBFrontData::size()*sizeof(short));
00211                    links_.push_back(data);
00212                    buf += CSCTFTBFrontData::size();
00213                    size_ += CSCTFTBFrontData::size();
00214                  }
00215              }
00216            srdata_.push_back(links_);
00217          }
00218      }
00219    return 0;
00220 
00221 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const CSCTFTBFrontBlock bx 
) [friend]

make a bit vector

pretty-print

Definition at line 246 of file CSCTFTBFrontBlock.cc.

00247 {
00248   std::vector<std::vector<CSCTFTBFrontData> > sr = bx.frontData();
00249   stream << bx.frontHeader();
00250   if(bx.frontHeader().validPattern())
00251     stream << "\tFront Event Data (Track Stubs):\n";
00252   for(unsigned i = 1; i <= sr.size(); ++i)
00253     {
00254       if(sr[i-1].size()) stream<<"\tFPGA: "<<i<<'\n';
00255       for (unsigned j = 1;j <= sr[i-1].size();j++)
00256         {
00257           stream<<"\t Link: "<<j<<' '<<std::dec
00258                 <<" CSCID: " << bx.frontData(i,j).CSCIDPacked() << ' '
00259                 << bx.frontDigiData(i,j);
00260         }
00261     }
00262   return stream;
00263 }


Member Data Documentation

CSCTFTBFrontHeader CSCTFTBFrontBlock::frontHeader_ [protected]

Definition at line 146 of file CSCTFTBFrontBlock.h.

Referenced by CSCTFTBFrontBlock(), frontDigiData(), frontHeader(), and unpackData().

int CSCTFTBFrontBlock::myBX_ [protected]

Definition at line 149 of file CSCTFTBFrontBlock.h.

Referenced by BX(), CSCTFTBFrontBlock(), and frontDigiData().

int CSCTFTBFrontBlock::size_ [protected]

Definition at line 148 of file CSCTFTBFrontBlock.h.

Referenced by CSCTFTBFrontBlock(), size(), and unpackData().

std::vector<std::vector<CSCTFTBFrontData> > CSCTFTBFrontBlock::srdata_ [protected]

SRData is unpacked and stored in this vector.

Definition at line 145 of file CSCTFTBFrontBlock.h.

Referenced by frontData(), frontDigiData(), unpackData(), and ~CSCTFTBFrontBlock().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:17:30 2009 for CMSSW by  doxygen 1.5.4