CMS 3D CMS Logo

EcalElectronicsMapper Class Reference

#include <EventFilter/EcalRawToDigiDev/interface/EcalElectronicsMapper.h>

List of all members.

Public Types

enum  SMGeom_t {
  kModules = 4, kTriggerTowers = 68, kTowersInPhi = 4, kTowersInEta = 17,
  kCrystals = 1700, kPns = 10, kCrystalsInPhi = 20, kCrystalsInEta = 85,
  kCrystalsPerTower = 25, kCardsPerTower = 5, kChannelsPerCard = 5, TTMAPMASK = 100
}

Public Member Functions

 EcalElectronicsMapper (uint numbOfXtalTSamples, uint numbOfTriggerTSamples)
 Constructor.
uint getActiveDCC ()
uint getActiveSM ()
uint getDCCId (uint aSMId) const
const std::map< uint,uint > & getDCCMap () const
 Get methods for DCCId/SMId and map.
std::string getDCCMapFilePath () const
 Retrieves current path do the map file.
DetIdgetDetIdPointer (uint feChannel, uint strip, uint xtal)
uint getEBTCCBlockLength ()
uint getEETCCBlockLength ()
uint getNumChannelsInDcc (uint aDCCId)
EcalScDetIdgetSCDetIdPointer (uint smId, uint feChannel)
EcalElectronicsIdgetSCElectronicsPointer (uint smId, uint feChannel)
uint getSMId (uint aDCCId) const
EcalSrFlaggetSrFlagPointer (uint feChannel)
uint getSRPBlockLength ()
std::vector< uint > * getTccs (uint smId)
EcalTriggerPrimitiveDigigetTPPointer (uint tccId, uint tower)
EcalTrigTowerDetIdgetTTDetIdPointer (uint tccId, uint tower)
EcalElectronicsIdgetTTEleIdPointer (uint tccId, uint tower)
uint getUnfilteredTowerBlockLength ()
bool makeMapFromVectors (std::vector< int > &, std::vector< int > &)
 Read map file (returns false if an error ocurred) deprecated by HLT environment.
const EcalElectronicsMappingmapping ()
uint numbTriggerTSamples ()
uint numbXtalTSamples ()
bool setActiveDCC (uint dccId)
 Set DCC id that is going to be unpacked for the event.
bool setDCCMapFilePath (std::string)
 Receives a string with a path and checks if file is accessible.
void setEcalElectronicsMapping (const EcalElectronicsMapping *)
 ~EcalElectronicsMapper ()
 Destructor.

Private Member Functions

uint computeEBTCCBlockLength ()
uint computeEETCCBlockLength ()
uint computeUnfilteredFEBlockLength ()
void fillMaps ()

Private Attributes

uint dccId_
uint ebTccBlockLength_
uint eeTccBlockLength_
const EcalElectronicsMappingmappingBuilder_
std::map< uint, std::vector
< uint > * > 
mapSmIdToTccIds_
std::map< uint, uint > myDCCMap_
uint numbTriggerTSamples_
uint numbXtalTSamples_
std::string pathToMapFile_
EcalScDetIdscDetIds_ [NUMB_SM][NUMB_FE]
EcalElectronicsIdscEleIds_ [NUMB_SM][NUMB_FE]
uint smId_
EcalSrFlagsrFlags_ [NUMB_SM][NUMB_FE]
uint srpBlockLength_
EcalTrigTowerDetIdttDetIds_ [NUMB_TCC][NUMB_FE]
EcalElectronicsIdttEleIds_ [NUMB_TCC][NUMB_FE]
EcalTriggerPrimitiveDigittTPIds_ [NUMB_TCC][NUMB_FE]
uint unfilteredFEBlockLength_
DetIdxtalDetIds_ [NUMB_SM][NUMB_FE][NUMB_STRIP][NUMB_XTAL]

Static Private Attributes

static const uint numChannelsInDcc_ [NUMB_SM]

Friends

std::ostream & operator<< (std::ostream &o, const EcalElectronicsMapper &aEcalElectronicsMapper)
 Print current map.


Detailed Description

Definition at line 38 of file EcalElectronicsMapper.h.


Member Enumeration Documentation

enum EcalElectronicsMapper::SMGeom_t

Enumerator:
kModules 
kTriggerTowers 
kTowersInPhi 
kTowersInEta 
kCrystals 
kPns 
kCrystalsInPhi 
kCrystalsInEta 
kCrystalsPerTower 
kCardsPerTower 
kChannelsPerCard 
TTMAPMASK 

Definition at line 142 of file EcalElectronicsMapper.h.

00142                 {
00143     kModules = 4,           // Number of modules per supermodule
00144     kTriggerTowers = 68,    // Number of trigger towers per supermodule
00145     kTowersInPhi = 4,       // Number of trigger towers in phi
00146     kTowersInEta = 17,      // Number of trigger towers in eta
00147     kCrystals = 1700,       // Number of crystals per supermodule
00148     kPns = 10,              // Number of PN laser monitoring diodes per supermodule
00149     kCrystalsInPhi = 20,    // Number of crystals in phi
00150     kCrystalsInEta = 85,    // Number of crystals in eta
00151     kCrystalsPerTower = 25, // Number of crystals per trigger tower
00152     kCardsPerTower = 5,     // Number of VFE cards per trigger tower
00153     kChannelsPerCard = 5,   // Number of channels per VFE card
00154     TTMAPMASK = 100
00155   };


Constructor & Destructor Documentation

EcalElectronicsMapper::EcalElectronicsMapper ( uint  numbOfXtalTSamples,
uint  numbOfTriggerTSamples 
)

Constructor.

Definition at line 8 of file EcalElectronicsMapper.cc.

References computeEBTCCBlockLength(), computeEETCCBlockLength(), computeUnfilteredFEBlockLength(), ebTccBlockLength_, eeTccBlockLength_, mapSmIdToTccIds_, NUMB_FE, NUMB_SM, NUMB_STRIP, NUMB_TCC, NUMB_XTAL, scDetIds_, scEleIds_, srFlags_, strip(), ttDetIds_, ttTPIds_, unfilteredFEBlockLength_, and xtalDetIds_.

00009 : pathToMapFile_(""),
00010 numbXtalTSamples_(numbXtalTSamples),
00011 numbTriggerTSamples_(numbTriggerTSamples),
00012 mappingBuilder_(0)
00013 
00014 {
00015         
00016   
00017   // Reset Arrays
00018   for(uint sm=0; sm < NUMB_SM; sm++){
00019     for(uint fe=0; fe< NUMB_FE; fe++){
00020           
00021       for(uint strip=0; strip<NUMB_STRIP;strip++){
00022         for(uint xtal=0; xtal<NUMB_XTAL;xtal++){
00023                     
00024           //Reset DFrames and xtalDetIds
00025           xtalDetIds_[sm][fe][strip][xtal]=0;
00026         }
00027       }
00028       //Reset SC Det Ids
00029       scDetIds_[sm][fe]=0;
00030       scEleIds_[sm][fe]=0;
00031       srFlags_[sm][fe]=0;
00032     }
00033   }
00034   
00035   
00036   //Reset TT det Ids
00037   for( uint tccid=0; tccid < NUMB_TCC; tccid++){
00038     for(uint tpg =0; tpg<NUMB_FE;tpg++){
00039       ttDetIds_[tccid][tpg]=0;
00040       ttTPIds_[tccid][tpg]=0;
00041     }
00042   }
00043 
00044   
00045 
00046   //Fill map sm id to tcc ids
00047   std::vector<uint> * ids;
00048   ids = new std::vector<uint>;
00049   ids->push_back(1); ids->push_back(18);ids->push_back(19);ids->push_back(36);
00050   mapSmIdToTccIds_[1]= ids;
00051                 
00052   ids = new std::vector<uint>;
00053   ids->push_back(2); ids->push_back(3);ids->push_back(20);ids->push_back(21);
00054   mapSmIdToTccIds_[2]= ids;
00055                 
00056   ids = new std::vector<uint>;
00057   ids->push_back(4); ids->push_back(5);ids->push_back(22);ids->push_back(23);
00058   mapSmIdToTccIds_[3]= ids;
00059                 
00060   ids = new std::vector<uint>;
00061   ids->push_back(6); ids->push_back(7);ids->push_back(24);ids->push_back(25);
00062   mapSmIdToTccIds_[4]= ids;
00063                 
00064   ids = new std::vector<uint>;
00065   ids->push_back(8); ids->push_back(9);ids->push_back(26);ids->push_back(27);
00066   mapSmIdToTccIds_[5]= ids;
00067                 
00068   ids = new std::vector<uint>;
00069   ids->push_back(10); ids->push_back(11);ids->push_back(28);ids->push_back(29);
00070   mapSmIdToTccIds_[6]= ids;
00071                 
00072   ids = new std::vector<uint>;
00073   ids->push_back(12); ids->push_back(13);ids->push_back(30);ids->push_back(31);
00074   mapSmIdToTccIds_[7]= ids;
00075                 
00076   ids = new std::vector<uint>;
00077   ids->push_back(14); ids->push_back(15);ids->push_back(32);ids->push_back(33);
00078   mapSmIdToTccIds_[8]= ids;
00079                 
00080   ids = new std::vector<uint>;
00081   ids->push_back(16); ids->push_back(17);ids->push_back(34);ids->push_back(35);
00082   mapSmIdToTccIds_[9]= ids;
00083                 
00084   ids = new std::vector<uint>;
00085   ids->push_back(73); ids->push_back(90);ids->push_back(91);ids->push_back(108);
00086   mapSmIdToTccIds_[46]= ids;
00087                 
00088   ids = new std::vector<uint>;
00089   ids->push_back(74); ids->push_back(75);ids->push_back(92);ids->push_back(93);
00090   mapSmIdToTccIds_[47]= ids;
00091                 
00092   ids = new std::vector<uint>;
00093   ids->push_back(76); ids->push_back(77);ids->push_back(94);ids->push_back(95);
00094   mapSmIdToTccIds_[48]= ids;
00095                 
00096   ids = new std::vector<uint>;
00097   ids->push_back(78); ids->push_back(79);ids->push_back(96);ids->push_back(97);
00098   mapSmIdToTccIds_[49]= ids;
00099                 
00100   ids = new std::vector<uint>;
00101   ids->push_back(80); ids->push_back(81);ids->push_back(98);ids->push_back(99);  
00102   mapSmIdToTccIds_[50]= ids;
00103                  
00104   ids = new std::vector<uint>;
00105   ids->push_back(82); ids->push_back(83);ids->push_back(100);ids->push_back(101);
00106   mapSmIdToTccIds_[51]= ids;
00107                 
00108   ids = new std::vector<uint>;
00109   ids->push_back(84); ids->push_back(85);ids->push_back(102);ids->push_back(103);
00110   mapSmIdToTccIds_[52]= ids;
00111                 
00112   ids = new std::vector<uint>;
00113   ids->push_back(86); ids->push_back(87);ids->push_back(104);ids->push_back(105);
00114   mapSmIdToTccIds_[53]= ids;
00115                 
00116   ids = new std::vector<uint>;
00117   ids->push_back(88); ids->push_back(89);ids->push_back(106);ids->push_back(107);
00118   mapSmIdToTccIds_[54]= ids;
00119         
00120   
00121   //Compute data block sizes
00122   unfilteredFEBlockLength_= computeUnfilteredFEBlockLength();  
00123   ebTccBlockLength_       = computeEBTCCBlockLength();
00124   eeTccBlockLength_       = computeEETCCBlockLength();
00125     
00126 
00127 }

EcalElectronicsMapper::~EcalElectronicsMapper (  ) 

Destructor.

Definition at line 130 of file EcalElectronicsMapper.cc.

References it, mappingBuilder_, mapSmIdToTccIds_, NUMB_FE, NUMB_SM, NUMB_STRIP, NUMB_TCC, NUMB_XTAL, pathToMapFile_, scDetIds_, scEleIds_, srFlags_, strip(), ttDetIds_, ttTPIds_, and xtalDetIds_.

00130                                              {
00131 
00132 
00133   if( mappingBuilder_ ){ delete mappingBuilder_; }
00134  
00135 
00136   //DETETE ARRAYS
00137   for(uint sm=0; sm < NUMB_SM; sm++){
00138     for(uint fe=0; fe< NUMB_FE; fe++){
00139       for(uint strip=0; strip<NUMB_STRIP;strip++){
00140         for(uint xtal=0; xtal<NUMB_XTAL;xtal++){
00141           if(xtalDetIds_[sm][fe][strip][xtal]){ 
00142             delete xtalDetIds_[sm][fe][strip][xtal]; 
00143           }
00144         }
00145       }
00146 
00147       if(scDetIds_[sm][fe]){ 
00148         delete scDetIds_[sm][fe];
00149         delete scEleIds_[sm][fe];
00150         delete srFlags_[sm][fe];
00151       }
00152 
00153     }
00154  
00155   }
00156   
00157   for( uint tccid=0; tccid < NUMB_TCC; tccid++){
00158     for(uint tpg =0; tpg<NUMB_FE;tpg++){
00159       if(ttDetIds_[tccid][tpg]){ 
00160         delete ttDetIds_[tccid][tpg];
00161         delete ttTPIds_[tccid][tpg];
00162       }
00163     }
00164   }
00165 
00166 
00167   pathToMapFile_.clear();
00168   
00169   
00170   std::map<uint, std::vector<uint> *>::iterator it;
00171   for(it = mapSmIdToTccIds_.begin(); it != mapSmIdToTccIds_.end(); it++ ){ delete (*it).second; }
00172   
00173   mapSmIdToTccIds_.clear();
00174  
00175 }


Member Function Documentation

uint EcalElectronicsMapper::computeEBTCCBlockLength (  )  [private]

Definition at line 322 of file EcalElectronicsMapper.cc.

References numbTriggerTSamples_.

Referenced by EcalElectronicsMapper().

00322                                                    {
00323 
00324   uint nTT=68;
00325   uint tf;
00326           
00327   //TCC block size: header (8 bytes) + 17 words with 4 trigger primitives (17*8bytes)
00328   if( (nTT*numbTriggerTSamples_)<4 || (nTT*numbTriggerTSamples_)%4 ) tf=1;  
00329   else tf=0;
00330     
00331   return 1 + ((nTT*numbTriggerTSamples_)/4) + tf ;
00332 
00333 }

uint EcalElectronicsMapper::computeEETCCBlockLength (  )  [private]

Definition at line 335 of file EcalElectronicsMapper.cc.

Referenced by EcalElectronicsMapper().

00335                                                    {
00336   //Todo : implement multiple tt samples for the endcap
00337   return 9;  
00338 
00339 }

uint EcalElectronicsMapper::computeUnfilteredFEBlockLength (  )  [private]

Definition at line 315 of file EcalElectronicsMapper.cc.

References numbXtalTSamples_.

Referenced by EcalElectronicsMapper().

00315                                                           {
00316 
00317   return ((numbXtalTSamples_-2)/4+1)*25+1; 
00318 
00319 }

void EcalElectronicsMapper::fillMaps (  )  [private]

Definition at line 376 of file EcalElectronicsMapper.cc.

References EcalElectronicsMapping::dccTowerConstituents(), detId, EcalElectronicsMapping::getDetId(), EcalElectronicsMapping::getEcalScDetId(), EcalElectronicsMapping::getElectronicsId(), EcalElectronicsMapping::getTrigTowerDetId(), i, it, mappingBuilder_, mapSmIdToTccIds_, MAX_CCUID_JUMP, MIN_CCUID_JUMP, numbTriggerTSamples_, numChannelsInDcc_, muonGeometry::rawid, DetId::rawId(), scDetIds_, scEleIds_, SECTOR_EEM_CCU_JUMP, SECTOR_EEP_CCU_JUMP, EcalTriggerPrimitiveDigi::setSample(), EcalTriggerPrimitiveDigi::setSize(), srFlags_, EcalElectronicsId::stripId(), TCCID_SMID_SHIFT_EB, tp, ttDetIds_, ttEleIds_, ttTPIds_, xtalDetIds_, and EcalElectronicsId::xtalId().

Referenced by setEcalElectronicsMapping().

00376                                     {
00377 
00378  
00379   for( int smId=1 ; smId<= 54; smId++){
00380 
00381     
00382     // Fill EB arrays  
00383     if( smId > 9 && smId < 46 ){
00384          
00385       for(int feChannel =1; feChannel<=68; feChannel++){
00386                    
00387         uint tccId = smId + TCCID_SMID_SHIFT_EB;
00388                   
00389         // Builds Ecal Trigger Tower Det Id 
00390 
00391         uint rawid = (mappingBuilder_->getTrigTowerDetId(tccId, feChannel)).rawId();
00392         EcalTrigTowerDetId * ttDetId = new EcalTrigTowerDetId(rawid);
00393         ttDetIds_[tccId-1][feChannel-1] = ttDetId;
00394         EcalElectronicsId * ttEleId = new EcalElectronicsId(smId, feChannel, 1, 1);
00395         ttEleIds_[tccId-1][feChannel-1] = ttEleId;
00396         EcalTriggerPrimitiveDigi * tp     = new EcalTriggerPrimitiveDigi(*ttDetId);
00397         tp->setSize(numbTriggerTSamples_);
00398         for(uint i=0;i<numbTriggerTSamples_;i++){
00399           tp->setSample( i, EcalTriggerPrimitiveSample(0) );
00400         }
00401         ttTPIds_[tccId-1][feChannel-1]  = tp;   
00402         
00403         // Buil SRP Flag
00404         srFlags_[smId-1][feChannel-1] = new EBSrFlag(*ttDetId,0);
00405  
00406         for(uint stripId =1; stripId<=5; stripId++){
00407                     
00408           for(uint xtalId =1;xtalId<=5;xtalId++){
00409                   
00410               EcalElectronicsId eid(smId,feChannel,stripId,xtalId);
00411               EBDetId * detId = new EBDetId( (mappingBuilder_->getDetId(eid)).rawId());
00412               xtalDetIds_[smId-1][feChannel-1][stripId-1][xtalId-1] = detId;
00413                          
00414            } // close loop over xtals
00415         }// close loop over strips
00416                                 
00417       }// close loop over fechannels
00418                 
00419     }//close loop over sm ids in the EB
00420     // Fill EE arrays (Todo : waiting SC correction)
00421     
00422     else{
00423          
00424         std::vector<uint> * pTCCIds = mapSmIdToTccIds_[smId];
00425         std::vector<uint>::iterator it;
00426                 
00427         for(it= pTCCIds->begin(); it!= pTCCIds->end(); it++){
00428                         
00429           uint tccId = *it;
00430           
00431           // creating arrays of pointers for trigger objects
00432           for(uint towerInTCC =1; towerInTCC <= numChannelsInDcc_[smId-1]; towerInTCC++){
00433               
00434               // Builds Ecal Trigger Tower Det Id 
00435               EcalTrigTowerDetId ttDetId = mappingBuilder_->getTrigTowerDetId(tccId, towerInTCC);
00436               
00437               ttDetIds_[tccId-1][towerInTCC-1] = new EcalTrigTowerDetId(ttDetId.rawId());
00438               EcalTriggerPrimitiveDigi * tp   = new EcalTriggerPrimitiveDigi(ttDetId);
00439               tp->setSize(numbTriggerTSamples_);
00440               for(uint i=0;i<numbTriggerTSamples_;i++){
00441                   tp->setSample( i, EcalTriggerPrimitiveSample(0) );
00442               }
00443               
00444               ttTPIds_[tccId-1][towerInTCC-1]  = tp;
00445               
00446           }
00447         }
00448         
00449 
00450         
00451         // creating arrays of pointers for digi objects
00452         for(uint feChannel = 1; feChannel <= numChannelsInDcc_[smId-1]; feChannel++){
00453 
00454             // to avoid gap in CCU_id's
00455             if((smId==SECTOR_EEM_CCU_JUMP   || smId== SECTOR_EEP_CCU_JUMP) &&
00456                (MIN_CCUID_JUMP <= feChannel && feChannel <=MAX_CCUID_JUMP )
00457                ) continue;
00458             
00459           EcalScDetId scDetId = mappingBuilder_->getEcalScDetId(smId,feChannel);
00460           scDetIds_[smId-1][feChannel-1] = new EcalScDetId(scDetId.rawId());
00461           scEleIds_[smId-1][feChannel-1] = new EcalElectronicsId(smId,feChannel,1,1);
00462           srFlags_[smId-1][feChannel-1]  = new EESrFlag( EcalScDetId( scDetId.rawId() ) , 0 ); 
00463 
00464           std::vector<DetId> ecalDetIds = mappingBuilder_->dccTowerConstituents(smId,feChannel);
00465           std::vector<DetId>::iterator it;
00466                                   
00467           //EEDetIds    
00468           for(it = ecalDetIds.begin(); it!= ecalDetIds.end(); it++){
00469                     
00470           EcalElectronicsId ids = mappingBuilder_->getElectronicsId((*it));
00471                          
00472           int stripId    = ids.stripId();
00473           int xtalId     = ids.xtalId();
00474                  
00475           EEDetId * detId = new EEDetId((*it).rawId());
00476           xtalDetIds_[smId-1][feChannel-1][stripId-1][xtalId-1] = detId;
00477           
00478         }// close loop over tower constituents
00479           
00480         }// close loop over  FE Channels                
00481         
00482     }// closing loop over sm ids in EE
00483         
00484   }
00485   
00486 
00487 }

uint EcalElectronicsMapper::getActiveDCC (  )  [inline]

Definition at line 111 of file EcalElectronicsMapper.h.

References dccId_.

Referenced by DCCEBSRPBlock::checkSrpIdAndNumbSRFlags(), DCCEESRPBlock::checkSrpIdAndNumbSRFlags(), DCCEETCCBlock::checkTccIdAndNumbTTs(), DCCEBTCCBlock::checkTccIdAndNumbTTs(), DCCMemBlock::unpack(), DCCFEBlock::unpack(), DCCTCCBlock::unpack(), DCCSRPBlock::unpack(), DCCMemBlock::unpackMemTowerData(), DCCTowerBlock::unpackXtalData(), and DCCSCBlock::unpackXtalData().

00111 { return dccId_;                      }

uint EcalElectronicsMapper::getActiveSM (  )  [inline]

Definition at line 113 of file EcalElectronicsMapper.h.

References smId_.

Referenced by DCCEventBlock::addHeaderToCollection(), DCCEBSRPBlock::addSRFlagToCollection(), DCCEBTCCBlock::addTriggerPrimitivesToCollection(), DCCEETCCBlock::checkTccIdAndNumbTTs(), DCCEBTCCBlock::checkTccIdAndNumbTTs(), DCCSCBlock::fillEcalElectronicsError(), DCCTowerBlock::fillEcalElectronicsError(), DCCMemBlock::fillPnDiodeDigisCollection(), EcalRawToDigiDev::produce(), DCCMemBlock::unpack(), DCCFEBlock::unpack(), DCCMemBlock::unpackMemTowerData(), and EcalUnpackerWorker::work().

00113 { return smId_;                       }

uint EcalElectronicsMapper::getDCCId ( uint  aSMId  )  const

Definition at line 342 of file EcalElectronicsMapper.cc.

References it, myDCCMap_, and DCCDataUnpacker::silentMode_.

00342                                                      {
00343   //get iterator for SM id
00344   std::map<uint ,uint>::const_iterator it = myDCCMap_.find(aSMId_);
00345 
00346   //check if SMid exists and return DCC id
00347   if(it!= myDCCMap_.end()) return it->second;
00348  
00349   //error return
00350   if( ! DCCDataUnpacker::silentMode_ ){
00351     edm::LogError("EcalElectronicsMapper") << "DCC requested for SM id: " << aSMId_ << " not found";
00352   }
00353   return 0;
00354 }

const std::map<uint ,uint>& EcalElectronicsMapper::getDCCMap (  )  const [inline]

Get methods for DCCId/SMId and map.

Definition at line 92 of file EcalElectronicsMapper.h.

References myDCCMap_.

00092 { return myDCCMap_; }

std::string EcalElectronicsMapper::getDCCMapFilePath (  )  const [inline]

Retrieves current path do the map file.

Definition at line 73 of file EcalElectronicsMapper.h.

References pathToMapFile_.

00073 { return pathToMapFile_; }

DetId* EcalElectronicsMapper::getDetIdPointer ( uint  feChannel,
uint  strip,
uint  xtal 
) [inline]

Definition at line 94 of file EcalElectronicsMapper.h.

References smId_, and xtalDetIds_.

Referenced by DCCTowerBlock::unpackXtalData(), and DCCSCBlock::unpackXtalData().

00094 {  return  xtalDetIds_[smId_-1][feChannel-1][strip-1][xtal-1];}

uint EcalElectronicsMapper::getEBTCCBlockLength (  )  [inline]

Definition at line 121 of file EcalElectronicsMapper.h.

References ebTccBlockLength_.

Referenced by DCCEBTCCBlock::DCCEBTCCBlock().

00121 { return ebTccBlockLength_;           }

uint EcalElectronicsMapper::getEETCCBlockLength (  )  [inline]

Definition at line 123 of file EcalElectronicsMapper.h.

References eeTccBlockLength_.

Referenced by DCCEETCCBlock::DCCEETCCBlock().

00123 { return eeTccBlockLength_;           }

uint EcalElectronicsMapper::getNumChannelsInDcc ( uint  aDCCId  )  [inline]

Definition at line 131 of file EcalElectronicsMapper.h.

References numChannelsInDcc_.

Referenced by DCCFEBlock::unpack().

00131 {return numChannelsInDcc_[aDCCId-1];}

EcalScDetId* EcalElectronicsMapper::getSCDetIdPointer ( uint  smId,
uint  feChannel 
) [inline]

Definition at line 102 of file EcalElectronicsMapper.h.

References scDetIds_.

00102 { return  scDetIds_[smId-1][feChannel-1];}

EcalElectronicsId* EcalElectronicsMapper::getSCElectronicsPointer ( uint  smId,
uint  feChannel 
) [inline]

Definition at line 104 of file EcalElectronicsMapper.h.

References scEleIds_.

Referenced by DCCSCBlock::fillEcalElectronicsError().

00104 { return  scEleIds_[smId-1][feChannel-1];}

uint EcalElectronicsMapper::getSMId ( uint  aDCCId  )  const

Definition at line 357 of file EcalElectronicsMapper.cc.

References it, myDCCMap_, and DCCDataUnpacker::silentMode_.

Referenced by setActiveDCC().

00357                                                       {
00358   //get iterator map
00359   std::map<uint ,uint>::const_iterator it;
00360 
00361   //try to find SM id for given DCC id
00362   for(it = myDCCMap_.begin(); it != myDCCMap_.end(); it++)
00363     if(it->second == aDCCId_) 
00364       return it->first;
00365 
00366   //error return
00367   if( ! DCCDataUnpacker::silentMode_ ){
00368     edm::LogError("EcalEcalElectronicsMapper") << "SM requested DCC id: " << aDCCId_ << " not found";
00369   }
00370   return 0;
00371 }

EcalSrFlag* EcalElectronicsMapper::getSrFlagPointer ( uint  feChannel  )  [inline]

Definition at line 107 of file EcalElectronicsMapper.h.

References smId_, and srFlags_.

Referenced by DCCEESRPBlock::addSRFlagToCollection(), and DCCEBSRPBlock::addSRFlagToCollection().

00107 { return srFlags_[smId_-1][feChannel-1]; }

uint EcalElectronicsMapper::getSRPBlockLength (  )  [inline]

Definition at line 125 of file EcalElectronicsMapper.h.

References srpBlockLength_.

00125 { return srpBlockLength_;             }

std::vector<uint>* EcalElectronicsMapper::getTccs ( uint  smId  )  [inline]

Definition at line 109 of file EcalElectronicsMapper.h.

References mapSmIdToTccIds_.

Referenced by DCCEETCCBlock::checkTccIdAndNumbTTs().

00109 { return mapSmIdToTccIds_[smId];}

EcalTriggerPrimitiveDigi* EcalElectronicsMapper::getTPPointer ( uint  tccId,
uint  tower 
) [inline]

Definition at line 100 of file EcalElectronicsMapper.h.

References ttTPIds_.

Referenced by DCCEETCCBlock::addTriggerPrimitivesToCollection(), and DCCEBTCCBlock::addTriggerPrimitivesToCollection().

00100 { return ttTPIds_[tccId-1][tower-1];}

EcalTrigTowerDetId* EcalElectronicsMapper::getTTDetIdPointer ( uint  tccId,
uint  tower 
) [inline]

Definition at line 96 of file EcalElectronicsMapper.h.

References ttDetIds_.

00096 { return ttDetIds_[tccId-1][tower-1];}

EcalElectronicsId* EcalElectronicsMapper::getTTEleIdPointer ( uint  tccId,
uint  tower 
) [inline]

Definition at line 98 of file EcalElectronicsMapper.h.

References ttEleIds_.

Referenced by DCCTowerBlock::fillEcalElectronicsError().

00098 { return ttEleIds_[tccId-1][tower-1];}

uint EcalElectronicsMapper::getUnfilteredTowerBlockLength (  )  [inline]

Definition at line 119 of file EcalElectronicsMapper.h.

References unfilteredFEBlockLength_.

Referenced by DCCFEBlock::DCCFEBlock(), and DCCMemBlock::DCCMemBlock().

00119 { return unfilteredFEBlockLength_;    }

bool EcalElectronicsMapper::makeMapFromVectors ( std::vector< int > &  orderedFedUnpackList,
std::vector< int > &  orderedDCCIdList 
)

Read map file (returns false if an error ocurred) deprecated by HLT environment.

HLT friendly: load default mapping or, for non standatd mapping, use 2 vectors from cfg

Definition at line 251 of file EcalElectronicsMapper.cc.

References int, myDCCMap_, tmp, and v.

Referenced by EcalUnpackerWorker::EcalUnpackerWorker().

00253 {
00254 
00255   // in case as non standard set of DCCId:FedId pairs was provided
00256   if ( orderedFedUnpackList.size() == orderedDCCIdList.size() &&
00257        orderedFedUnpackList.size() > 0)
00258     {
00259       edm::LogInfo("EcalElectronicsMapper") << "DCCIdList/FedUnpackList lists given. Being loaded.";
00260       
00261       std::string correspondence("list of pairs DCCId:FedId :  ");
00262       char           onePair[50];
00263       for (int v=0;  v< ((int)orderedFedUnpackList.size());  v++)       {
00264         myDCCMap_[ orderedDCCIdList[v]  ] = orderedFedUnpackList[v] ;
00265         
00266         sprintf( onePair, "  %d:%d",  orderedDCCIdList[v], orderedFedUnpackList[v]);
00267         std::string                 tmp(onePair);
00268         correspondence += tmp;
00269       }
00270       edm::LogInfo("EcalElectronicsMapper") << correspondence;
00271       
00272     }
00273   else    
00274     {  // default set of DCCId:FedId for ECAL
00275 
00276       edm::LogInfo("EcalElectronicsMapper") << "No input DCCIdList/FedUnpackList lists given for ECAL unpacker"
00277                                             << "(or given with different number of elements). "
00278                                             << " Loading default association DCCIdList:FedUnpackList,"
00279                                             << "i.e.  1:601 ... 53:653,  54:654.";
00280       
00281       for (uint v=1; v<=54; v++)        {
00282         myDCCMap_[ v ] = (v+600) ;   }
00283     }
00284 
00285   return true;
00286 }

const EcalElectronicsMapping* EcalElectronicsMapper::mapping (  )  [inline]

Definition at line 133 of file EcalElectronicsMapper.h.

References mappingBuilder_.

00133 {return mappingBuilder_;} 

uint EcalElectronicsMapper::numbTriggerTSamples (  )  [inline]

Definition at line 117 of file EcalElectronicsMapper.h.

References numbTriggerTSamples_.

00117 { return numbTriggerTSamples_;        }

uint EcalElectronicsMapper::numbXtalTSamples (  )  [inline]

Definition at line 115 of file EcalElectronicsMapper.h.

References numbXtalTSamples_.

Referenced by DCCFEBlock::DCCFEBlock(), and DCCMemBlock::DCCMemBlock().

00115 { return numbXtalTSamples_;           }

bool EcalElectronicsMapper::setActiveDCC ( uint  dccId  ) 

Set DCC id that is going to be unpacked for the event.

Definition at line 183 of file EcalElectronicsMapper.cc.

References dccId_, getSMId(), and smId_.

Referenced by EcalRawToDigiDev::produce(), and EcalUnpackerWorker::work().

00183                                                   {
00184    
00185   bool ret(true);
00186         
00187   //Update active dcc and associated smId
00188   dccId_ = dccId;
00189    
00190   smId_  = getSMId(dccId_);
00191         
00192   if(!smId_) ret = false;
00193         
00194   return ret;
00195         
00196  } 

bool EcalElectronicsMapper::setDCCMapFilePath ( std::string  aPath_  ) 

Receives a string with a path and checks if file is accessible.

Definition at line 199 of file EcalElectronicsMapper.cc.

References pathToMapFile_.

00199                                                              {
00200 
00201   
00202   //try to open a dccMapFile in the given path
00203   std::ifstream dccMapFile_(aPath_.c_str());
00204 
00205   //if not successful return false
00206   if(!dccMapFile_.is_open()) return false;
00207 
00208   //else close file and accept given path
00209   dccMapFile_.close();
00210   pathToMapFile_ = aPath_;
00211 
00212   return true;
00213 }

void EcalElectronicsMapper::setEcalElectronicsMapping ( const EcalElectronicsMapping m  ) 

Definition at line 177 of file EcalElectronicsMapper.cc.

References fillMaps(), and mappingBuilder_.

Referenced by EcalUnpackerWorker::setHandles().

00177                                                                                      {
00178   mappingBuilder_= m;
00179   fillMaps();
00180 
00181 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const EcalElectronicsMapper aEcalElectronicsMapper 
) [friend]

Print current map.

Definition at line 289 of file EcalElectronicsMapper.cc.

00289                                                                               {
00290   //print class information
00291   o << "---------------------------------------------------------";
00292 
00293   if(aMapper_.pathToMapFile_.size() < 1){
00294     o << "No correct input for DCC map has been given yet...";
00295   }
00296   else{
00297     o << "DCC Map (Map file: " << aMapper_.pathToMapFile_ << " )" << "SM id\t\tDCCid ";
00298 
00299     //get DCC map and iterator
00300     std::map<uint ,uint > aMap;
00301     aMap=aMapper_.myDCCMap_;
00302     std::map<uint ,uint >::iterator iter;
00303 
00304     //print info contained in map
00305     for(iter = aMap.begin(); iter != aMap.end(); iter++)
00306       o << iter->first << "\t\t" << iter->second;
00307   }
00308 
00309   o << "---------------------------------------------------------";
00310   return o;
00311 }


Member Data Documentation

uint EcalElectronicsMapper::dccId_ [private]

Definition at line 175 of file EcalElectronicsMapper.h.

Referenced by getActiveDCC(), and setActiveDCC().

uint EcalElectronicsMapper::ebTccBlockLength_ [private]

Definition at line 183 of file EcalElectronicsMapper.h.

Referenced by EcalElectronicsMapper(), and getEBTCCBlockLength().

uint EcalElectronicsMapper::eeTccBlockLength_ [private]

Definition at line 183 of file EcalElectronicsMapper.h.

Referenced by EcalElectronicsMapper(), and getEETCCBlockLength().

const EcalElectronicsMapping* EcalElectronicsMapper::mappingBuilder_ [private]

Definition at line 197 of file EcalElectronicsMapper.h.

Referenced by fillMaps(), mapping(), setEcalElectronicsMapping(), and ~EcalElectronicsMapper().

std::map< uint, std::vector<uint> * > EcalElectronicsMapper::mapSmIdToTccIds_ [private]

Definition at line 173 of file EcalElectronicsMapper.h.

Referenced by EcalElectronicsMapper(), fillMaps(), getTccs(), and ~EcalElectronicsMapper().

std::map<uint,uint> EcalElectronicsMapper::myDCCMap_ [private]

Definition at line 171 of file EcalElectronicsMapper.h.

Referenced by getDCCId(), getDCCMap(), getSMId(), makeMapFromVectors(), and operator<<().

uint EcalElectronicsMapper::numbTriggerTSamples_ [private]

Definition at line 169 of file EcalElectronicsMapper.h.

Referenced by computeEBTCCBlockLength(), fillMaps(), and numbTriggerTSamples().

uint EcalElectronicsMapper::numbXtalTSamples_ [private]

Definition at line 167 of file EcalElectronicsMapper.h.

Referenced by computeUnfilteredFEBlockLength(), and numbXtalTSamples().

const uint EcalElectronicsMapper::numChannelsInDcc_ [static, private]

Initial value:

 {34,32,33,33,32,34,33,41,33,    
                                                                 68,68,68,68,68,68,68,68,68,68, 
                                                                 68,68,68,68,68,68,68,68,
                                                                 68,68,68,68,68,68,68,68,68,68, 
                                                                 68,68,68,68,68,68,68,68,
                                                                 34,32,33,33,32,34,33,41,33}

Definition at line 185 of file EcalElectronicsMapper.h.

Referenced by fillMaps(), and getNumChannelsInDcc().

std::string EcalElectronicsMapper::pathToMapFile_ [private]

Definition at line 165 of file EcalElectronicsMapper.h.

Referenced by getDCCMapFilePath(), operator<<(), setDCCMapFilePath(), and ~EcalElectronicsMapper().

EcalScDetId* EcalElectronicsMapper::scDetIds_[NUMB_SM][NUMB_FE] [private]

Definition at line 190 of file EcalElectronicsMapper.h.

Referenced by EcalElectronicsMapper(), fillMaps(), getSCDetIdPointer(), and ~EcalElectronicsMapper().

EcalElectronicsId* EcalElectronicsMapper::scEleIds_[NUMB_SM][NUMB_FE] [private]

Definition at line 191 of file EcalElectronicsMapper.h.

Referenced by EcalElectronicsMapper(), fillMaps(), getSCElectronicsPointer(), and ~EcalElectronicsMapper().

uint EcalElectronicsMapper::smId_ [private]

Definition at line 177 of file EcalElectronicsMapper.h.

Referenced by getActiveSM(), getDetIdPointer(), getSrFlagPointer(), and setActiveDCC().

EcalSrFlag* EcalElectronicsMapper::srFlags_[NUMB_SM][NUMB_FE] [private]

Definition at line 195 of file EcalElectronicsMapper.h.

Referenced by EcalElectronicsMapper(), fillMaps(), getSrFlagPointer(), and ~EcalElectronicsMapper().

uint EcalElectronicsMapper::srpBlockLength_ [private]

Definition at line 181 of file EcalElectronicsMapper.h.

Referenced by getSRPBlockLength().

EcalTrigTowerDetId* EcalElectronicsMapper::ttDetIds_[NUMB_TCC][NUMB_FE] [private]

Definition at line 192 of file EcalElectronicsMapper.h.

Referenced by EcalElectronicsMapper(), fillMaps(), getTTDetIdPointer(), and ~EcalElectronicsMapper().

EcalElectronicsId* EcalElectronicsMapper::ttEleIds_[NUMB_TCC][NUMB_FE] [private]

Definition at line 193 of file EcalElectronicsMapper.h.

Referenced by fillMaps(), and getTTEleIdPointer().

EcalTriggerPrimitiveDigi* EcalElectronicsMapper::ttTPIds_[NUMB_TCC][NUMB_FE] [private]

Definition at line 194 of file EcalElectronicsMapper.h.

Referenced by EcalElectronicsMapper(), fillMaps(), getTPPointer(), and ~EcalElectronicsMapper().

uint EcalElectronicsMapper::unfilteredFEBlockLength_ [private]

Definition at line 179 of file EcalElectronicsMapper.h.

Referenced by EcalElectronicsMapper(), and getUnfilteredTowerBlockLength().

DetId* EcalElectronicsMapper::xtalDetIds_[NUMB_SM][NUMB_FE][NUMB_STRIP][NUMB_XTAL] [private]

Definition at line 189 of file EcalElectronicsMapper.h.

Referenced by EcalElectronicsMapper(), fillMaps(), getDetIdPointer(), and ~EcalElectronicsMapper().


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