CMS 3D CMS Logo

HcalFiberPattern Class Reference

Date
2006/09/29 17:57:39
Revision
1.1
More...

#include <IORawData/CaloPatterns/interface/HcalFiberPattern.h>

List of all members.

Public Member Functions

int crate () const
int fiber () const
HcalElectronicsId getId (int fiberChan)
std::vector< HcalQIESamplegetSamples (int bunch, int npresamples, int nsamples, int fiberChan)
 HcalFiberPattern (const std::map< std::string, std::string > &params, const std::vector< uint32_t > &data)
int slot () const

Private Member Functions

HcalQIESample unpack (int bc, int fc)

Private Attributes

int crate_
int dcc_
int fiber_
std::vector< uint32_t > pattern_
int slot_
int spigot_
int tb_


Detailed Description

Date
2006/09/29 17:57:39
Revision
1.1

Author:
J. Mans - Minnesota

Definition at line 16 of file HcalFiberPattern.h.


Constructor & Destructor Documentation

HcalFiberPattern::HcalFiberPattern ( const std::map< std::string, std::string > &  params,
const std::vector< uint32_t > &  data 
)

Definition at line 10 of file HcalFiberPattern.cc.

References crate_, dcc_, fiber_, setIf(), slot_, spigot_, and tb_.

00010                                                                                                               : pattern_(data) {
00011   crate_=setIf("CRATE",params);
00012   slot_=setIf("SLOT",params);
00013   fiber_=setIf("FIBER",params);
00014   dcc_=setIf("DCC",params);
00015   spigot_=setIf("SPIGOT",params);
00016   tb_=setIf("TOPBOTTOM",params);
00017 }


Member Function Documentation

int HcalFiberPattern::crate (  )  const [inline]

Definition at line 21 of file HcalFiberPattern.h.

References crate_.

00021 { return crate_; }

int HcalFiberPattern::fiber (  )  const [inline]

Definition at line 23 of file HcalFiberPattern.h.

References fiber_.

00023 { return fiber_; }

HcalElectronicsId HcalFiberPattern::getId ( int  fiberChan  ) 

Definition at line 60 of file HcalFiberPattern.cc.

References crate_, dcc_, fiber_, HcalElectronicsId::setHTR(), slot_, spigot_, and tb_.

00060                                                        {
00061   HcalElectronicsId retval(fiberChan,fiber_,spigot_,dcc_);
00062   retval.setHTR(crate_,slot_,tb_);
00063   return retval;
00064 }

std::vector< HcalQIESample > HcalFiberPattern::getSamples ( int  bunch,
int  npresamples,
int  nsamples,
int  fiberChan 
)

Definition at line 46 of file HcalFiberPattern.cc.

References Exception, i, pattern_, and unpack().

00046                                                                                                              {
00047   if (bunch<npresamples) throw cms::Exception("InvalidArgument") << "Asked for " << npresamples << " presamples with event at bunch " << bunch;
00048   if (nsamples-npresamples+bunch>=(int)(pattern_.size()/2)) throw cms::Exception("InvalidArgument") << "Asked for " << nsamples << " with event at " << bunch << " and " << npresamples << " presamples, but only " << pattern_.size()/2 << " bunches are available";
00049 
00050   std::vector<HcalQIESample> retval;
00051   retval.reserve(nsamples);
00052 
00053   for (int i=0; i<nsamples; i++) {
00054     int bc=bunch+i-npresamples;
00055     retval.push_back(unpack(bc,fiberChan));
00056   }
00057   return retval;
00058 }

int HcalFiberPattern::slot ( void   )  const [inline]

Definition at line 22 of file HcalFiberPattern.h.

References slot_.

00022 { return slot_; }

HcalQIESample HcalFiberPattern::unpack ( int  bc,
int  fc 
) [private]

Definition at line 19 of file HcalFiberPattern.cc.

References ecalMGPA::adc(), fiber_, pattern_, w1, and w2.

Referenced by getSamples().

00019                                                      {
00020   uint32_t w1=pattern_[bc*2]; // lsw
00021   uint32_t w2=pattern_[bc*2+1]; // msw
00022 
00023   int adc=0, capid=0;
00024   bool dv=(w1&0x10000)!=0;
00025   bool er=(w1&0x20000)!=0;
00026   
00027   switch (fc) {
00028   case (0):
00029     adc=(w2&0xFE00)>>9;
00030     capid=(w1&0x0180)>>7;
00031     break;
00032   case (1):
00033     adc=(w2&0xFE)>>1;
00034     capid=(w1&0x0060)>>5;
00035     break;
00036   case (2):
00037     adc=(w1&0xFE00)>>9;
00038     capid=(w1&0x0018)>>3;
00039     break;
00040   default:
00041     break;
00042   }
00043   return HcalQIESample(adc,capid,fiber_,fc,dv,er);
00044 }


Member Data Documentation

int HcalFiberPattern::crate_ [private]

Definition at line 26 of file HcalFiberPattern.h.

Referenced by crate(), getId(), and HcalFiberPattern().

int HcalFiberPattern::dcc_ [private]

Definition at line 26 of file HcalFiberPattern.h.

Referenced by getId(), and HcalFiberPattern().

int HcalFiberPattern::fiber_ [private]

Definition at line 26 of file HcalFiberPattern.h.

Referenced by fiber(), getId(), HcalFiberPattern(), and unpack().

std::vector<uint32_t> HcalFiberPattern::pattern_ [private]

Definition at line 27 of file HcalFiberPattern.h.

Referenced by getSamples(), and unpack().

int HcalFiberPattern::slot_ [private]

Definition at line 26 of file HcalFiberPattern.h.

Referenced by getId(), HcalFiberPattern(), and slot().

int HcalFiberPattern::spigot_ [private]

Definition at line 26 of file HcalFiberPattern.h.

Referenced by getId(), and HcalFiberPattern().

int HcalFiberPattern::tb_ [private]

Definition at line 26 of file HcalFiberPattern.h.

Referenced by getId(), and HcalFiberPattern().


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