#include <EcalUnpackerWorker.h>
Definition at line 29 of file EcalUnpackerWorker.h.
EcalUnpackerWorker::EcalUnpackerWorker | ( | const edm::ParameterSet & | conf | ) |
Definition at line 18 of file EcalUnpackerWorker.cc.
References CalibWorker_, reco::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), EcalElectronicsMapper::makeMapFromVectors(), myMap_, productDccHeaders, productDigisEB, productDigisEE, productEBSrFlags, productEESrFlags, productInvalidBlockLengths, productInvalidChIds, productInvalidEEChIds, productInvalidEEGains, productInvalidEEGainsSwitch, productInvalidGains, productInvalidGainsSwitch, productInvalidMemBlockSizes, productInvalidMemChIds, productInvalidMemGains, productInvalidMemTtIds, productInvalidTTIds, productInvalidZSXtalIds, productPnDiodeDigis, productPSs, productTps, DCCDataUnpacker::setDccHeadersCollection(), DCCDataUnpacker::setEBDigisCollection(), DCCDataUnpacker::setEBSrFlagsCollection(), DCCDataUnpacker::setEcalPSsCollection(), DCCDataUnpacker::setEcalTpsCollection(), DCCDataUnpacker::setEEDigisCollection(), DCCDataUnpacker::setEESrFlagsCollection(), DCCDataUnpacker::setInvalidBlockLengthsCollection(), DCCDataUnpacker::setInvalidChIdsCollection(), DCCDataUnpacker::setInvalidEEChIdsCollection(), DCCDataUnpacker::setInvalidEEGainsCollection(), DCCDataUnpacker::setInvalidEEGainsSwitchCollection(), DCCDataUnpacker::setInvalidGainsCollection(), DCCDataUnpacker::setInvalidGainsSwitchCollection(), DCCDataUnpacker::setInvalidMemBlockSizesCollection(), DCCDataUnpacker::setInvalidMemChIdsCollection(), DCCDataUnpacker::setInvalidMemGainsCollection(), DCCDataUnpacker::setInvalidMemTtIdsCollection(), DCCDataUnpacker::setInvalidTTIdsCollection(), DCCDataUnpacker::setInvalidZSXtalIdsCollection(), DCCDataUnpacker::setPnDiodeDigisCollection(), DCCDataUnpacker::silentMode_, UncalibWorker_, and unpacker_.
{ edm::ParameterSet DCCpset = conf.getParameter<edm::ParameterSet>("DCCDataUnpacker"); edm::ParameterSet EEMpset = conf.getParameter<edm::ParameterSet>("ElectronicsMapper"); unsigned int numbXtalTSamples_ = EEMpset.getParameter<unsigned int>("numbXtalTSamples"); unsigned int numbTriggerTSamples_ = EEMpset.getParameter<unsigned int>("numbTriggerTSamples"); if( numbXtalTSamples_ <6 || numbXtalTSamples_>64 || (numbXtalTSamples_-2)%4 ){ edm::LogError("IncorrectConfiguration")<<"Unsuported number of xtal time samples : "<<numbXtalTSamples_ <<"\n Valid Number of xtal time samples are : 6,10,14,18,...,62"; } if( numbTriggerTSamples_ !=1 && numbTriggerTSamples_ !=4 && numbTriggerTSamples_ !=8 ){ edm::LogError("IncorrectConfiguration")<<"Unsuported number of trigger time samples : "<<numbTriggerTSamples_ <<"\n Valid number of trigger time samples are : 1, 4 or 8"; } myMap_ = new EcalElectronicsMapper(numbXtalTSamples_, numbTriggerTSamples_); std::vector<int> oFl = DCCpset.getParameter<std::vector<int> >("orderedFedList"); std::vector<int> oDl = DCCpset.getParameter<std::vector<int> >("orderedDCCIdList"); bool readResult = myMap_->makeMapFromVectors(oFl,oDl); if(!readResult){ edm::LogError("IncorrectConfiguration")<<"\n unable to configure EcalElectronicsMapper from vectors."; } unpacker_ = new DCCDataUnpacker(myMap_, DCCpset.getParameter<bool>("headerUnpacking"), DCCpset.getParameter<bool>("srpUnpacking"), DCCpset.getParameter<bool>("tccUnpacking"), DCCpset.getParameter<bool>("feUnpacking"), DCCpset.getParameter<bool>("memUnpacking"), DCCpset.getParameter<bool>("syncCheck"), DCCpset.getParameter<bool>("feIdCheck"), DCCpset.getParameter<bool>("forceKeepFRData") ); unpacker_->setEBDigisCollection(&productDigisEB); unpacker_->setEEDigisCollection(&productDigisEE); unpacker_->setDccHeadersCollection(&productDccHeaders); unpacker_->setInvalidGainsCollection(&productInvalidGains); unpacker_->setInvalidGainsSwitchCollection(&productInvalidGainsSwitch); unpacker_->setInvalidChIdsCollection(&productInvalidChIds); unpacker_->setInvalidEEGainsCollection(&productInvalidEEGains); unpacker_->setInvalidEEGainsSwitchCollection(&productInvalidEEGainsSwitch); unpacker_->setInvalidEEChIdsCollection(&productInvalidEEChIds); unpacker_->setEBSrFlagsCollection(&productEBSrFlags); unpacker_->setEESrFlagsCollection(&productEESrFlags); unpacker_->setEcalTpsCollection(&productTps); unpacker_->setEcalPSsCollection(&productPSs); unpacker_->setInvalidTTIdsCollection(&productInvalidTTIds); unpacker_->setInvalidZSXtalIdsCollection(&productInvalidZSXtalIds); unpacker_->setInvalidBlockLengthsCollection(&productInvalidBlockLengths); unpacker_->setPnDiodeDigisCollection(&productPnDiodeDigis); unpacker_->setInvalidMemTtIdsCollection(& productInvalidMemTtIds); unpacker_->setInvalidMemBlockSizesCollection(& productInvalidMemBlockSizes); unpacker_->setInvalidMemChIdsCollection(& productInvalidMemChIds); unpacker_->setInvalidMemGainsCollection(& productInvalidMemGains); DCCDataUnpacker::silentMode_ = conf.getUntrackedParameter<bool> ("silentMode",true); edm::ParameterSet UncalibPSet = conf.getParameter<edm::ParameterSet>("UncalibRHAlgo"); std::string UncaliComponentName = UncalibPSet.getParameter<std::string>("Type"); UncalibWorker_ = EcalUncalibRecHitWorkerFactory::get()->create(UncaliComponentName, UncalibPSet); edm::ParameterSet CalibPSet = conf.getParameter<edm::ParameterSet>("CalibRHAlgo"); std::string CaliComponentName = CalibPSet.getParameter<std::string>("Type"); CalibWorker_ = EcalRecHitWorkerFactory::get()->create(CaliComponentName, CalibPSet); }
EcalUnpackerWorker::~EcalUnpackerWorker | ( | ) |
Definition at line 90 of file EcalUnpackerWorker.cc.
References CalibWorker_, myMap_, UncalibWorker_, and unpacker_.
{ //delete everything that is own by the EcalUnpackerWorker delete myMap_; delete unpacker_; delete UncalibWorker_; delete CalibWorker_; }
unsigned int EcalUnpackerWorker::maxElementIndex | ( | ) | const [inline, virtual] |
Reimplemented from EcalUnpackerWorkerBase.
Definition at line 47 of file EcalUnpackerWorker.h.
{ return EcalRegionCabling::maxElementIndex();}
void EcalUnpackerWorker::set | ( | const edm::EventSetup & | es | ) | const [virtual] |
Reimplemented from EcalUnpackerWorkerBase.
Definition at line 105 of file EcalUnpackerWorker.cc.
References CalibWorker_, EcalRecHitWorkerBaseClass::set(), EcalUncalibRecHitWorkerBaseClass::set(), and UncalibWorker_.
{ UncalibWorker_->set(es); CalibWorker_->set(es); }
void EcalUnpackerWorker::setHandles | ( | const EcalUnpackerWorkerRecord & | iRecord | ) | [virtual] |
Reimplemented from EcalUnpackerWorkerBase.
Definition at line 99 of file EcalUnpackerWorker.cc.
References cabling, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), myMap_, and EcalElectronicsMapper::setEcalElectronicsMapping().
{ iRecord.getRecord<EcalRegionCablingRecord>().get(cabling); //the mapping is set as long as the mapping is valid. myMap_->setEcalElectronicsMapping(cabling->mapping()); }
void EcalUnpackerWorker::update | ( | const edm::Event & | e | ) | const [virtual] |
keep the event
Reimplemented from EcalUnpackerWorkerBase.
Definition at line 114 of file EcalUnpackerWorker.cc.
References evt, productDccHeaders, productDigisEB, productDigisEE, productEBSrFlags, productEESrFlags, productInvalidBlockLengths, productInvalidChIds, productInvalidEEChIds, productInvalidEEGains, productInvalidEEGainsSwitch, productInvalidGains, productInvalidGainsSwitch, productInvalidMemBlockSizes, productInvalidMemChIds, productInvalidMemGains, productInvalidMemTtIds, productInvalidTTIds, productInvalidZSXtalIds, productPnDiodeDigis, productPSs, and productTps.
Referenced by EcalRawToRecHitByproductProducer::produce().
{ evt=&e; const bool reserveMem =false; productDigisEB.reset(new EBDigiCollection); productDigisEE.reset(new EEDigiCollection); productDccHeaders.reset(new EcalRawDataCollection); productInvalidGains.reset(new EBDetIdCollection); productInvalidGainsSwitch.reset(new EBDetIdCollection); productInvalidChIds.reset(new EBDetIdCollection); productInvalidEEGains.reset(new EEDetIdCollection); productInvalidEEGainsSwitch.reset(new EEDetIdCollection); productInvalidEEChIds.reset(new EEDetIdCollection); productEBSrFlags.reset(new EBSrFlagCollection); productEESrFlags.reset(new EESrFlagCollection); productTps.reset(new EcalTrigPrimDigiCollection); productPSs.reset(new EcalPSInputDigiCollection); productInvalidTTIds.reset(new EcalElectronicsIdCollection); productInvalidZSXtalIds.reset(new EcalElectronicsIdCollection); productInvalidBlockLengths.reset(new EcalElectronicsIdCollection); productPnDiodeDigis.reset(new EcalPnDiodeDigiCollection); productInvalidMemTtIds.reset(new EcalElectronicsIdCollection); productInvalidMemBlockSizes.reset(new EcalElectronicsIdCollection); productInvalidMemChIds.reset(new EcalElectronicsIdCollection); productInvalidMemGains.reset(new EcalElectronicsIdCollection); if (reserveMem){ productDigisEB->reserve(1700); productDigisEE->reserve(1700); } }
std::auto_ptr< EcalRecHitCollection > EcalUnpackerWorker::work | ( | const uint32_t & | i, |
const FEDRawDataCollection & | rawdata | ||
) | const [virtual] |
Reimplemented from EcalUnpackerWorkerBase.
Definition at line 151 of file EcalUnpackerWorker.cc.
References FEDRawData::data(), DCCDataUnpacker::ebDigisCollection(), DCCDataUnpacker::eeDigisCollection(), EMPTYEVENTSIZE, end, FEDRawDataCollection::FEDData(), EcalRegionCabling::fedIndex(), EcalElectronicsMapper::getActiveSM(), MyWatcher::lap(), LogDebug, myMap_, EcalElectronicsMapper::setActiveDCC(), findQualityFiles::size, FEDRawData::size(), DCCDataUnpacker::unpack(), and unpacker_.
{ MyWatcher watcher("Worker"); LogDebug("EcalRawToRecHit|Worker")<<"is going to work on index: "<<index <<"for fed Id: "<<EcalRegionCabling::fedIndex(index)<<watcher.lap(); int fedIndex = EcalRegionCabling::fedIndex(index); const FEDRawData & fedData = rawdata.FEDData(fedIndex); //remember where the iterators were before unpacking /*R*/ LogDebug("EcalRawToRecHit|Worker") <<"size of digi collections before unpacking: " <<(*unpacker_->ebDigisCollection())->size() <<" "<<(*unpacker_->eeDigisCollection())->size() <<watcher.lap(); EcalDigiCollection::const_iterator beginDigiEB = (*unpacker_->ebDigisCollection())->end(); EcalDigiCollection::const_iterator beginDigiEE = (*unpacker_->eeDigisCollection())->end(); //###### get the digi ####### // unpack first int smId =0; int length = fedData.size(); if ( length >= EMPTYEVENTSIZE ){ if(myMap_->setActiveDCC(fedIndex)){ smId = myMap_->getActiveSM(); uint64_t * pData = (uint64_t *)(fedData.data()); /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"calling the unpacker: "<<length<<" "<<smId<<" "<<fedIndex <<watcher.lap(); unpacker_->unpack( pData, static_cast<unsigned int>(length),smId,fedIndex); /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"unpacking done." <<watcher.lap(); } else{ edm::LogInfo("EcalUnpackerWorker")<<"cannot set: "<<fedIndex<<" to be an active DCC."; /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"cannot set: "<<fedIndex<<" to be an active DCC."; return std::auto_ptr< EcalRecHitCollection >(new EcalRecHitCollection); } } else { edm::LogInfo("EcalUnpackerWorker")<<"empty event on this FED: "<<fedIndex<<" length: "<<length; /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"empty event on this FED: "<<fedIndex<<" length: "<<length; return std::auto_ptr< EcalRecHitCollection >(new EcalRecHitCollection); } /*R*/ LogDebug("EcalRawToRecHit|Worker") <<"size of digi collections after unpacking: " <<(*unpacker_->ebDigisCollection())->size() <<" "<<(*unpacker_->eeDigisCollection())->size() <<watcher.lap(); EcalDigiCollection::const_iterator endDigiEB = (*unpacker_->ebDigisCollection())->end(); EcalDigiCollection::const_iterator endDigiEE = (*unpacker_->eeDigisCollection())->end(); //collection for the rechits: uncalib and final std::auto_ptr< EcalRecHitCollection > ecalrechits( new EcalRecHitCollection ); std::auto_ptr< EcalUncalibratedRecHitCollection > uncalibRecHits( new EcalUncalibratedRecHitCollection ); /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"going to work on EE rechits from: "<<endDigiEE-beginDigiEE<<" digis." <<"\ngoing to work on EB rechits from: "<<endDigiEB-beginDigiEB<<" digis." <<watcher.lap(); // EB //make the uncalibrated rechits on the fly if (beginDigiEB!=endDigiEB){ work<EBDetId>(beginDigiEB, endDigiEB, uncalibRecHits, ecalrechits); } /*R*/ LogDebug("EcalRawToRecHit|Worker")<<uncalibRecHits->size()<<" uncalibrated rechit created so far\n" <<ecalrechits->size()<<" rechit created so far." <<watcher.lap(); // EE if (beginDigiEE!=endDigiEE){ work<EEDetId>(beginDigiEE, endDigiEE, uncalibRecHits, ecalrechits); } /*R*/ LogDebug("EcalRawToRecHit|Worker")<<uncalibRecHits->size()<<" uncalibrated rechit created eventually\n" <<ecalrechits->size()<<" rechit created eventually" <<watcher.lap(); return ecalrechits; }
void EcalUnpackerWorker::work | ( | EcalDigiCollection::const_iterator & | beginDigi, |
EcalDigiCollection::const_iterator & | endDigi, | ||
std::auto_ptr< EcalUncalibratedRecHitCollection > & | uncalibRecHits, | ||
std::auto_ptr< EcalRecHitCollection > & | calibRechits | ||
) | const [inline] |
Definition at line 87 of file EcalUnpackerWorker.h.
References CalibWorker_, evt, MyWatcher::lap(), LogDebug, EcalRecHitWorkerBaseClass::run(), EcalUncalibRecHitWorkerBaseClass::run(), and UncalibWorker_.
{ MyWatcher watcher("<Worker>"); LogDebug("EcalRawToRecHit|Worker")<<"ready to work on digis."<<watcher.lap(); EcalDigiCollection::const_iterator itdg = beginDigi; /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"iterator check." ; for(; itdg != endDigi; ++itdg) { //get the uncalibrated rechit /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"ready to make Uncalib rechit."<<watcher.lap(); if (!UncalibWorker_->run(*evt, itdg, *uncalibRecHits)) continue; EcalUncalibratedRecHit & EURH=uncalibRecHits->back(); /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"creating a rechit."<<watcher.lap(); if (!CalibWorker_->run(*evt, EURH, *calibRechits)) continue; /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"created."<<watcher.lap(); }//loop over digis }
void EcalUnpackerWorker::write | ( | edm::Event & | e | ) | const [virtual] |
Reimplemented from EcalUnpackerWorkerBase.
Definition at line 110 of file EcalUnpackerWorker.cc.
{
//write the collection in the event as requested.
}
friend class EcalRawToRecHitByproductProducer [friend] |
Definition at line 59 of file EcalUnpackerWorker.h.
edm::ESHandle<EcalRegionCabling> EcalUnpackerWorker::cabling [mutable, private] |
Definition at line 80 of file EcalUnpackerWorker.h.
Referenced by setHandles().
Definition at line 83 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), set(), work(), and ~EcalUnpackerWorker().
const edm::Event* EcalUnpackerWorker::evt [mutable, private] |
Reimplemented from EcalUnpackerWorkerBase.
Definition at line 51 of file EcalUnpackerWorker.h.
EcalElectronicsMapper* EcalUnpackerWorker::myMap_ [private] |
Definition at line 55 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), setHandles(), work(), and ~EcalUnpackerWorker().
std::auto_ptr<EcalRawDataCollection> EcalUnpackerWorker::productDccHeaders [mutable, private] |
Definition at line 60 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EBDigiCollection> EcalUnpackerWorker::productDigisEB [mutable, private] |
Definition at line 56 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EEDigiCollection> EcalUnpackerWorker::productDigisEE [mutable, private] |
Definition at line 57 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EBSrFlagCollection> EcalUnpackerWorker::productEBSrFlags [mutable, private] |
Definition at line 67 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EESrFlagCollection> EcalUnpackerWorker::productEESrFlags [mutable, private] |
Definition at line 68 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EcalElectronicsIdCollection> EcalUnpackerWorker::productInvalidBlockLengths [mutable, private] |
Definition at line 73 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr< EBDetIdCollection> EcalUnpackerWorker::productInvalidChIds [mutable, private] |
Definition at line 63 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EEDetIdCollection> EcalUnpackerWorker::productInvalidEEChIds [mutable, private] |
Definition at line 66 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr< EEDetIdCollection> EcalUnpackerWorker::productInvalidEEGains [mutable, private] |
Definition at line 64 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EEDetIdCollection> EcalUnpackerWorker::productInvalidEEGainsSwitch [mutable, private] |
Definition at line 65 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr< EBDetIdCollection> EcalUnpackerWorker::productInvalidGains [mutable, private] |
Definition at line 61 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr< EBDetIdCollection> EcalUnpackerWorker::productInvalidGainsSwitch [mutable, private] |
Definition at line 62 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EcalElectronicsIdCollection> EcalUnpackerWorker::productInvalidMemBlockSizes [mutable, private] |
Definition at line 76 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EcalElectronicsIdCollection> EcalUnpackerWorker::productInvalidMemChIds [mutable, private] |
Definition at line 77 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EcalElectronicsIdCollection> EcalUnpackerWorker::productInvalidMemGains [mutable, private] |
Definition at line 78 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EcalElectronicsIdCollection> EcalUnpackerWorker::productInvalidMemTtIds [mutable, private] |
Definition at line 75 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EcalElectronicsIdCollection> EcalUnpackerWorker::productInvalidTTIds [mutable, private] |
Definition at line 71 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EcalElectronicsIdCollection> EcalUnpackerWorker::productInvalidZSXtalIds [mutable, private] |
Definition at line 72 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EcalPnDiodeDigiCollection> EcalUnpackerWorker::productPnDiodeDigis [mutable, private] |
Definition at line 74 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EcalPSInputDigiCollection> EcalUnpackerWorker::productPSs [mutable, private] |
Definition at line 70 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
std::auto_ptr<EcalTrigPrimDigiCollection> EcalUnpackerWorker::productTps [mutable, private] |
Definition at line 69 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), EcalRawToRecHitByproductProducer::produce(), and update().
Definition at line 82 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), set(), work(), and ~EcalUnpackerWorker().
DCCDataUnpacker* EcalUnpackerWorker::unpacker_ [private] |
Definition at line 53 of file EcalUnpackerWorker.h.
Referenced by EcalUnpackerWorker(), work(), and ~EcalUnpackerWorker().