00001 #include "EventFilter/EcalRawToDigiDev/interface/DCCEETCCBlock.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003 #include "EventFilter/EcalRawToDigiDev/interface/EcalElectronicsMapper.h"
00004 #include "EventFilter/EcalRawToDigiDev/interface/DCCDataUnpacker.h"
00005
00006
00007 DCCEETCCBlock::DCCEETCCBlock ( DCCDataUnpacker * u,EcalElectronicsMapper * m, DCCEventBlock * e, bool unpack) :
00008 DCCTCCBlock(u,m,e,unpack)
00009 {
00010 blockLength_ = mapper_->getEETCCBlockLength();
00011 }
00012
00013 void DCCEETCCBlock::updateCollectors(){
00014 tps_ = unpacker_->ecalTpsCollection();
00015 }
00016
00017
00018
00019
00020 void DCCEETCCBlock::addTriggerPrimitivesToCollection(){
00021
00022
00023 data_++;
00024
00025 uint16_t * tccP_= reinterpret_cast< uint16_t * >(data_);
00026
00027 for( uint i = 1; i <= expNumbTTs_; i++){
00028
00029 pTP_ = mapper_->getTPPointer(tccId_,i);
00030
00031 if(pTP_){
00032
00033 pTP_ = mapper_->getTPPointer(tccId_,i);
00034
00035 for(uint ns = 0; ns<nTSamples_;ns++,tccP_++){
00036 pTP_->setSample(ns, *tccP_ );
00037 (*tps_)->push_back(*pTP_);
00038 }
00039 }else{ break; }
00040
00041 }
00042
00043 }
00044
00045
00046 bool DCCEETCCBlock::checkTccIdAndNumbTTs(){
00047
00048
00049 bool tccFound(false);
00050 int activeDCC = mapper_->getActiveSM();
00051 std::vector<uint> * m = mapper_->getTccs(activeDCC);
00052 std::vector<uint>::iterator it;
00053 for(it= m->begin();it!=m->end();it++){
00054 if((*it) == tccId_){
00055 tccFound=true;
00056 expNumbTTs_= 28;
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 break;
00076 }
00077
00078 }
00079
00080 if(!tccFound){
00081
00082 if( ! DCCDataUnpacker::silentMode_ ){
00083 edm::LogWarning("EcalRawToDigiDevTCC")
00084 <<"\n Error on event "<<event_->l1A()<<" with bx "<<event_->bx()<<" in fed <<"<<mapper_->getActiveDCC()
00085 <<"\n TCC id "<<tccId_<<" is not valid for this dcc "
00086 <<"\n => Skipping to next fed block...";
00087
00088 }
00089 }
00090
00091 return tccFound;
00092
00093 }
00094
00095