CMS 3D CMS Logo

EcalUnpackerWorker Class Reference

#include <EventFilter/EcalRawToDigi/interface/EcalUnpackerWorker.h>

List of all members.

Public Member Functions

 EcalUnpackerWorker (const edm::ParameterSet &conf)
void setHandles (const EcalUnpackerWorkerRecord &iRecord)
void update (const edm::Event &e) const
template<class DID>
void work (EcalDigiCollection::const_iterator &beginDigi, EcalDigiCollection::const_iterator &endDigi, std::auto_ptr< EcalUncalibratedRecHitCollection > &uncalibRecHits, std::auto_ptr< EcalRecHitCollection > &calibRechits) const
std::auto_ptr
< EcalRecHitCollection
work (const uint32_t &i, const FEDRawDataCollection &) const
void write (edm::Event &e) const
 ~EcalUnpackerWorker ()

Private Attributes

edm::ESHandle
< EcalADCToGeVConstant
agc
edm::ESHandle< EcalRegionCablingcabling
edm::ESHandle< EcalChannelStatuschStatus
const edm::Eventevt
edm::ESHandle< EcalGainRatiosgains
edm::ESHandle
< EcalWeightXtalGroups
grps
edm::ESHandle
< EcalIntercalibConstants
ical
edm::ESHandle< EcalLaserDbServicelaser
EcalElectronicsMappermyMap_
edm::ESHandle< EcalPedestalspeds
std::auto_ptr
< EcalRawDataCollection
productDccHeaders
std::auto_ptr< EBDigiCollectionproductDigisEB
std::auto_ptr< EEDigiCollectionproductDigisEE
std::auto_ptr< EBSrFlagCollectionproductEBSrFlags
std::auto_ptr< EESrFlagCollectionproductEESrFlags
std::auto_ptr
< EcalElectronicsIdCollection
productInvalidBlockLengths
std::auto_ptr< EBDetIdCollectionproductInvalidChIds
std::auto_ptr< EEDetIdCollectionproductInvalidEEChIds
std::auto_ptr< EEDetIdCollectionproductInvalidEEGains
std::auto_ptr< EEDetIdCollectionproductInvalidEEGainsSwitch
std::auto_ptr< EBDetIdCollectionproductInvalidGains
std::auto_ptr< EBDetIdCollectionproductInvalidGainsSwitch
std::auto_ptr
< EcalElectronicsIdCollection
productInvalidMemBlockSizes
std::auto_ptr
< EcalElectronicsIdCollection
productInvalidMemChIds
std::auto_ptr
< EcalElectronicsIdCollection
productInvalidMemGains
std::auto_ptr
< EcalElectronicsIdCollection
productInvalidMemTtIds
std::auto_ptr
< EcalElectronicsIdCollection
productInvalidTTIds
std::auto_ptr
< EcalPnDiodeDigiCollection
productPnDiodeDigis
std::auto_ptr
< EcalTrigPrimDigiCollection
productTps
EcalRecHitAbsAlgorechitMaker_
EcalUncalibRecHitRecWeightsAlgo
< EBDataFrame > * 
uncalibMaker_barrel_
EcalUncalibRecHitRecWeightsAlgo
< EEDataFrame > * 
uncalibMaker_endcap_
DCCDataUnpackerunpacker_
std::vector< intv_chstatus_
edm::ESHandle< EcalTBWeightswgts

Friends

class EcalRawToRecHitByproductProducer


Detailed Description

Definition at line 34 of file EcalUnpackerWorker.h.


Constructor & Destructor Documentation

EcalUnpackerWorker::EcalUnpackerWorker ( const edm::ParameterSet conf  ) 

DCCDataUnpacker

EcalUncalibRecHitRecWeightsAlgo

EcalRecHitAbsAlgo

Definition at line 17 of file EcalUnpackerWorker.cc.

References edm::ParameterSet::getParameter(), EcalElectronicsMapper::makeMapFromVectors(), myMap_, productDccHeaders, productDigisEB, productDigisEE, productEBSrFlags, productEESrFlags, productInvalidBlockLengths, productInvalidChIds, productInvalidEEChIds, productInvalidEEGains, productInvalidEEGainsSwitch, productInvalidGains, productInvalidGainsSwitch, productInvalidMemBlockSizes, productInvalidMemChIds, productInvalidMemGains, productInvalidMemTtIds, productInvalidTTIds, productPnDiodeDigis, productTps, rechitMaker_, DCCDataUnpacker::setDccHeadersCollection(), DCCDataUnpacker::setEBDigisCollection(), DCCDataUnpacker::setEBSrFlagsCollection(), 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::setPnDiodeDigisCollection(), uncalibMaker_barrel_, uncalibMaker_endcap_, unpacker_, and v_chstatus_.

00017                                                                   {
00019   edm::ParameterSet DCCpset = conf.getParameter<edm::ParameterSet>("DCCDataUnpacker");
00020   edm::ParameterSet EEMpset = conf.getParameter<edm::ParameterSet>("ElectronicsMapper");
00021 
00022   uint numbXtalTSamples_ = EEMpset.getParameter<uint>("numbXtalTSamples");
00023   uint numbTriggerTSamples_ = EEMpset.getParameter<uint>("numbTriggerTSamples");
00024   
00025   if( numbXtalTSamples_ <6 || numbXtalTSamples_>64 || (numbXtalTSamples_-2)%4 ){
00026     edm::LogError("EcalRawToRecHit|Worker")<<"Unsuported number of xtal time samples : "<<numbXtalTSamples_
00027                                            <<"\n Valid Number of xtal time samples are : 6,10,14,18,...,62"; 
00028   }
00029   
00030   if( numbTriggerTSamples_ !=1 && numbTriggerTSamples_ !=4 && numbTriggerTSamples_ !=8  ){
00031     edm::LogError("EcalRawToRecHit|Worker")<<"Unsuported number of trigger time samples : "<<numbTriggerTSamples_
00032                                            <<"\n Valid number of trigger time samples are :  1, 4 or 8"; 
00033   }
00034   
00035   myMap_ = new EcalElectronicsMapper(numbXtalTSamples_, numbTriggerTSamples_);
00036   std::vector<int> oFl = DCCpset.getParameter<std::vector<int> >("orderedFedList");
00037   std::vector<int> oDl = DCCpset.getParameter<std::vector<int> >("orderedDCCIdList");
00038   bool readResult = myMap_->makeMapFromVectors(oFl,oDl);
00039   
00040   if(!readResult){
00041     edm::LogError("EcalRawToRecHit|Worker")<<"\n unable to configure EcalElectronicsMapper from vectors.";
00042   }
00043     
00044   unpacker_ = new DCCDataUnpacker(myMap_,
00045                                   DCCpset.getParameter<bool>("headerUnpacking"),
00046                                   DCCpset.getParameter<bool>("srpUnpacking"),
00047                                   DCCpset.getParameter<bool>("tccUnpacking"),
00048                                   DCCpset.getParameter<bool>("feUnpacking"),
00049                                   DCCpset.getParameter<bool>("memUnpacking"),
00050                                   DCCpset.getParameter<bool>("syncCheck"),
00051                                   DCCpset.getParameter<bool>("feIdCheck"));
00052   
00053   unpacker_->setEBDigisCollection(&productDigisEB);
00054   unpacker_->setEEDigisCollection(&productDigisEE);
00055   unpacker_->setDccHeadersCollection(&productDccHeaders); 
00056   unpacker_->setInvalidGainsCollection(&productInvalidGains); 
00057   unpacker_->setInvalidGainsSwitchCollection(&productInvalidGainsSwitch);
00058   unpacker_->setInvalidChIdsCollection(&productInvalidChIds);
00059   unpacker_->setInvalidEEGainsCollection(&productInvalidEEGains);
00060   unpacker_->setInvalidEEGainsSwitchCollection(&productInvalidEEGainsSwitch);
00061   unpacker_->setInvalidEEChIdsCollection(&productInvalidEEChIds);
00062   unpacker_->setEBSrFlagsCollection(&productEBSrFlags);
00063   unpacker_->setEESrFlagsCollection(&productEESrFlags);
00064   unpacker_->setEcalTpsCollection(&productTps);
00065   unpacker_->setInvalidTTIdsCollection(&productInvalidTTIds);
00066   unpacker_->setInvalidBlockLengthsCollection(&productInvalidBlockLengths);
00067   unpacker_->setPnDiodeDigisCollection(&productPnDiodeDigis);
00068   unpacker_->setInvalidMemTtIdsCollection(& productInvalidMemTtIds);
00069   unpacker_->setInvalidMemBlockSizesCollection(& productInvalidMemBlockSizes);
00070   unpacker_->setInvalidMemChIdsCollection(& productInvalidMemChIds);
00071   unpacker_->setInvalidMemGainsCollection(& productInvalidMemGains);
00072 
00074   uncalibMaker_barrel_ = new EcalUncalibRecHitRecWeightsAlgo<EBDataFrame>();
00075   uncalibMaker_endcap_ = new EcalUncalibRecHitRecWeightsAlgo<EEDataFrame>();
00076     
00078   rechitMaker_ = new EcalRecHitSimpleAlgo();
00079   
00080   v_chstatus_ = conf.getParameter<std::vector<int> >("ChannelStatusToBeExcluded");
00081 }

EcalUnpackerWorker::~EcalUnpackerWorker (  ) 

Definition at line 83 of file EcalUnpackerWorker.cc.

00083                                        {
00084   //free all the memory
00085   //wil matter if worker is re-created by eventsetup
00086   /*
00087   delete uncalibMaker_barrel;
00088   delete uncalibMaker_endcap;
00089   delete rechitMaker_;
00090   delete myMap_;
00091   delete unpacker_;
00092   */
00093 }


Member Function Documentation

void EcalUnpackerWorker::setHandles ( const EcalUnpackerWorkerRecord iRecord  ) 

Definition at line 95 of file EcalUnpackerWorker.cc.

References agc, cabling, chStatus, gains, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), grps, ical, laser, myMap_, peds, EcalElectronicsMapper::setEcalElectronicsMapping(), and wgts.

00095                                                                            {
00096   
00097   iRecord.getRecord<EcalPedestalsRcd>().get(peds);
00098   iRecord.getRecord<EcalGainRatiosRcd>().get(gains);
00099   iRecord.getRecord<EcalWeightXtalGroupsRcd>().get(grps);
00100   iRecord.getRecord<EcalTBWeightsRcd>().get(wgts);
00101 
00102   iRecord.getRecord<EcalIntercalibConstantsRcd>().get(ical);
00103   iRecord.getRecord<EcalADCToGeVConstantRcd>().get(agc);
00104   iRecord.getRecord<EcalChannelStatusRcd>().get(chStatus);
00105   iRecord.getRecord<EcalLaserDbRecord>().get(laser);
00106 
00107   iRecord.getRecord<EcalRegionCablingRecord>().get(cabling);
00108 
00109   //the mapping is set as long as the mapping is valid.
00110   myMap_->setEcalElectronicsMapping(cabling->mapping());
00111 }

void EcalUnpackerWorker::update ( const edm::Event e  )  const

keep the event

DCCDataUnpacker

Definition at line 117 of file EcalUnpackerWorker.cc.

References evt, productDccHeaders, productDigisEB, productDigisEE, productEBSrFlags, productEESrFlags, productInvalidBlockLengths, productInvalidChIds, productInvalidEEChIds, productInvalidEEGains, productInvalidEEGainsSwitch, productInvalidGains, productInvalidGainsSwitch, productInvalidMemBlockSizes, productInvalidMemChIds, productInvalidMemGains, productInvalidMemTtIds, productInvalidTTIds, productPnDiodeDigis, and productTps.

00117                                                       {
00119   evt=&e;
00120 
00121   const bool reserveMem =false;
00122 
00124   productDigisEB.reset(new EBDigiCollection);
00125   productDigisEE.reset(new EEDigiCollection);
00126   productDccHeaders.reset(new EcalRawDataCollection);
00127   productInvalidGains.reset(new EBDetIdCollection);
00128   productInvalidGainsSwitch.reset(new EBDetIdCollection);
00129   productInvalidChIds.reset(new EBDetIdCollection);
00130   productInvalidEEGains.reset(new EEDetIdCollection);
00131   productInvalidEEGainsSwitch.reset(new EEDetIdCollection);
00132   productInvalidEEChIds.reset(new EEDetIdCollection);
00133   productEBSrFlags.reset(new EBSrFlagCollection);
00134   productEESrFlags.reset(new EESrFlagCollection);
00135   productTps.reset(new EcalTrigPrimDigiCollection);
00136   productInvalidTTIds.reset(new EcalElectronicsIdCollection);
00137   productInvalidBlockLengths.reset(new EcalElectronicsIdCollection);
00138   productPnDiodeDigis.reset(new EcalPnDiodeDigiCollection);
00139   productInvalidMemTtIds.reset(new EcalElectronicsIdCollection);
00140   productInvalidMemBlockSizes.reset(new EcalElectronicsIdCollection);
00141   productInvalidMemChIds.reset(new EcalElectronicsIdCollection);
00142   productInvalidMemGains.reset(new EcalElectronicsIdCollection);
00143 
00144   if (reserveMem){
00145     productDigisEB->reserve(1700);
00146     productDigisEE->reserve(1700); 
00147   }
00148     
00149  }

template<class DID>
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 100 of file EcalUnpackerWorker.h.

References agc, chStatus, EcalEndcap, EcalCondObjectContainer< T >::end(), evt, find(), EcalCondObjectContainer< T >::find(), EcalMGPAGainRatio::gain12Over6(), EcalMGPAGainRatio::gain6Over1(), gains, EcalWeightSet::getChi2WeightsAfterGainSwitch(), EcalWeightSet::getChi2WeightsBeforeGainSwitch(), EcalChannelStatusCode::getStatusCode(), EcalWeightSet::getWeightsAfterGainSwitch(), EcalWeightSet::getWeightsBeforeGainSwitch(), grps, ical, EcalXtalGroupId::id(), MyWatcher::lap(), laser, LogDebug, EcalRecHitAbsAlgo::makeRecHit(), EcalUncalibRecHitRecWeightsAlgo< C >::makeRecHit(), peds, rechitMaker_, res, EcalRecHitAbsAlgo::setADCToGeVConstant(), edm::Event::time(), uncalibMaker_barrel_, uncalibMaker_endcap_, v_chstatus_, weights, wgts, and wset.

00103                                                                                          {
00104     MyWatcher watcher("<Worker>");
00105     LogDebug("EcalRawToRecHit|Worker")<<"ready to work on digis."<<watcher.lap();
00106 
00107     EcalDigiCollection::const_iterator itdg = beginDigi;
00108     /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"iterator check." ;
00109     EcalTBWeights::EcalTBWeightMap const & wgtsMap = wgts->getMap();
00110     /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"weight map check."<<watcher.lap();
00111 
00112 
00113     
00114     //for the uncalibrated rechits
00115     const EcalPedestals::Item* aped = 0;
00116     const EcalMGPAGainRatio* aGain = 0;
00117     const EcalXtalGroupId * gid = 0;
00118     double pedVec[3];
00119     double gainRatios[3];
00120     // use a fake TDC iD for now until it become available in raw data
00121     EcalTBWeights::EcalTDCId tdcid(1);
00122     const EcalWeightSet::EcalWeightMatrix* weights[2];
00123     const EcalWeightSet::EcalChi2WeightMatrix* chi2mat[2];
00124 
00125     //for the calibrated rechits.
00126     const EcalIntercalibConstantMap& icalMap=ical->getMap();  
00127     if (DID::subdet()==EcalEndcap){ 
00128       rechitMaker_->setADCToGeVConstant(float(agc->getEEValue())); 
00129       /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"ADCtoGeV constant set in EE: "<<agc->getEEValue() 
00130                                               <<watcher.lap(); 
00131     } 
00132     else{ 
00133       rechitMaker_->setADCToGeVConstant(float(agc->getEBValue())); 
00134       /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"ADCtoGeV constant set in EB: "<<agc->getEBValue() 
00135                                               <<watcher.lap(); 
00136     } 
00137 
00138     for(; itdg != endDigi; ++itdg) 
00139       {
00140         /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"starting dealing with one digi." 
00141                                                 <<watcher.lap();
00142         DID detid(itdg->id());
00143 
00144         //check if the channel is masked
00145         EcalChannelStatusMap::const_iterator chit = chStatus->find(itdg->id());
00146         EcalChannelStatusCode chStatusCode = 1;
00147         if ( chit != chStatus->end() ) {
00148           chStatusCode = *chit;
00149         } else {
00150           edm::LogError("EcalRawToRecHit|Worker") << "No channel status found for xtal " << detid << "! something wrong with EcalChannelStatus in your DB? ";
00151           continue;
00152         }
00153         if ( v_chstatus_.size() > 0) {
00154           std::vector<int>::const_iterator res = std::find( v_chstatus_.begin(), v_chstatus_.end(), chStatusCode.getStatusCode() );
00155           if ( res != v_chstatus_.end() ) {
00156             continue;
00157           }
00158         }
00159         
00160 
00161         //get the uncalibrated rechit
00162         EcalUncalibratedRecHit EURH;
00163         {
00164           unsigned int hashedIndex = detid.hashedIndex();
00165           // ### pedestal and gain first and groupid
00166           if (DID::subdet()==EcalEndcap){
00167             /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"EndCap id, getting pedestals, gains and group id.\n"
00168                                                     <<"detid: "<<detid<<"\n has hashed index: "<<hashedIndex
00169                                                     <<watcher.lap();
00170             aped=&peds->endcap(hashedIndex);
00171             aGain=&gains->endcap(hashedIndex);
00172             gid=&grps->endcap(hashedIndex);}
00173           else {
00174             /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"Barrel id, getting pedestals, gains and group id.\n"
00175                                                     <<"detid: "<<detid<<"\n has hashed index: "<<hashedIndex
00176                                                     <<watcher.lap();
00177             aped=&peds->barrel(hashedIndex);
00178             aGain=&gains->barrel(hashedIndex);
00179             gid=&grps->barrel(hashedIndex);}
00180           
00181           pedVec[0]=aped->mean_x12;pedVec[1]=aped->mean_x6;pedVec[2]=aped->mean_x1;
00182           gainRatios[0]=1.;gainRatios[1]=aGain->gain12Over6();gainRatios[2]=aGain->gain6Over1()*aGain->gain12Over6();
00183           /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"peds and gains loaded.";
00184           
00185         
00186           // now lookup the correct weights in the map
00187           EcalTBWeights::EcalTBWeightMap::const_iterator wit;
00188           wit = wgtsMap.find( std::make_pair(*gid,tdcid) );
00189           if( wit == wgtsMap.end() ) {
00190             edm::LogError("EcalUncalibRecHitError") << "No weights found for EcalGroupId: " << gid->id() << " and  EcalTDCId: " << tdcid
00191                                                     << "\n  skipping digi with id: " << detid
00192                                                     <<watcher.lap();
00193             /*R*/ LogDebug("EcalUncalibRecHitError") << "No weights found for EcalGroupId: " << gid->id() << " and  EcalTDCId: " << tdcid
00194                                                      << "\n  skipping digi with id: " << detid
00195                                                      <<watcher.lap();
00196             continue;
00197           }
00198           const EcalWeightSet& wset = wit->second; // this is the EcalWeightSet
00199           
00200           const EcalWeightSet::EcalWeightMatrix& mat1 = wset.getWeightsBeforeGainSwitch();
00201           const EcalWeightSet::EcalWeightMatrix& mat2 = wset.getWeightsAfterGainSwitch();
00202           const EcalWeightSet::EcalChi2WeightMatrix& mat3 = wset.getChi2WeightsBeforeGainSwitch();
00203           const EcalWeightSet::EcalChi2WeightMatrix& mat4 = wset.getChi2WeightsAfterGainSwitch();
00204           
00205           weights[0]=&mat1;
00206           weights[1]=&mat2;
00207           
00208           chi2mat[0]=&mat3;
00209           chi2mat[1]=&mat4;
00210           /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"weights loaded."
00211                                                   <<"creating an unaclibrated rechit."
00212                                                   <<watcher.lap();
00213         if (DID::subdet()==EcalEndcap)
00214           EURH = uncalibMaker_endcap_->makeRecHit(*itdg, pedVec, gainRatios, weights, chi2mat);
00215         else
00216           EURH = uncalibMaker_barrel_->makeRecHit(*itdg, pedVec, gainRatios, weights, chi2mat);
00217         uncalibRecHits->push_back(EURH);
00218         /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"created."
00219                                                 <<watcher.lap();
00220         }//uncalib rechits
00221     
00222         //######### get the rechit #########
00223         {
00224           // first intercalibration constants
00225           EcalIntercalibConstantMap::const_iterator icalit=icalMap.find(detid);
00226           EcalIntercalibConstant icalconst = 1;
00227           if( icalit!=icalMap.end() ){
00228             icalconst = (*icalit);
00229           } else {
00230             edm::LogError("EcalRecHitError") << "No intercalib const found for xtal " << detid<< "! something wrong with EcalIntercalibConstants in your DB? ";
00231             LogDebug("EcalRecHitError") << "No intercalib const found for xtal " << detid<< "! something wrong with EcalIntercalibConstants in your DB? ";
00232           }
00233           /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"intercalibration constant loaded."
00234                                                   <<watcher.lap();
00235 
00236           // get laser coefficient
00237           float lasercalib = laser->getLaserCorrection( detid, evt->time());
00238           /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"laser correction diode."
00239                                                   <<watcher.lap();
00240       
00241           // make the rechit and put in the output collection
00242           /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"creating a rechit."
00243                                                   <<watcher.lap();
00244           calibRechits->push_back(EcalRecHit( rechitMaker_->makeRecHit(EURH, icalconst * lasercalib) ));
00245           /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"created."
00246                                                   <<watcher.lap();
00247         }//get the rechit
00248 
00249       }//loop over digis
00250   }

std::auto_ptr< EcalRecHitCollection > EcalUnpackerWorker::work ( const uint32_t &  i,
const FEDRawDataCollection rawdata 
) const

Definition at line 152 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(), FEDRawData::size(), size, DCCDataUnpacker::unpack(), and unpacker_.

Referenced by EcalRawToRecHitLazyUnpacker::fill().

00152                                                                                                                              {
00153   MyWatcher watcher("Worker");
00154   LogDebug("EcalRawToRecHit|Worker")<<"is going to work on index: "<<index
00155                                     <<"for fed Id: "<<EcalRegionCabling::fedIndex(index)<<watcher.lap();
00156 
00157   int fedIndex = EcalRegionCabling::fedIndex(index);
00158 
00159   const FEDRawData & fedData = rawdata.FEDData(fedIndex);
00160 
00161   //remember where the iterators were before unpacking
00162   /*R*/ LogDebug("EcalRawToRecHit|Worker")
00163     <<"size of digi collections before unpacking: "
00164     <<(*unpacker_->ebDigisCollection())->size()
00165     <<" "<<(*unpacker_->eeDigisCollection())->size()
00166     <<watcher.lap();
00167 
00168   EcalDigiCollection::const_iterator beginDigiEB =  (*unpacker_->ebDigisCollection())->end();
00169   EcalDigiCollection::const_iterator beginDigiEE =  (*unpacker_->eeDigisCollection())->end();
00170   
00171   //###### get the digi #######
00172   // unpack first
00173   int smId =0;
00174   int length = fedData.size();
00175   if ( length >= EMPTYEVENTSIZE ){
00176     if(myMap_->setActiveDCC(fedIndex)){
00177       smId = myMap_->getActiveSM();
00178       uint64_t * pData = (uint64_t *)(fedData.data());
00179       /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"calling the unpacker: "<<length<<" "<<smId<<" "<<fedIndex
00180                                               <<watcher.lap();
00181       unpacker_->unpack( pData, static_cast<uint>(length),smId,fedIndex);
00182       /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"unpacking done."
00183                                               <<watcher.lap();
00184     }
00185     else{
00186       edm::LogInfo("EcalUnpackerWorker")<<"cannot set: "<<fedIndex<<" to be an active DCC.";
00187       /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"cannot set: "<<fedIndex<<" to be an active DCC.";
00188       return std::auto_ptr< EcalRecHitCollection >(new EcalRecHitCollection);
00189     }
00190   }
00191   else {
00192     edm::LogInfo("EcalUnpackerWorker")<<"empty event on this FED: "<<fedIndex<<" length: "<<length;
00193     /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"empty event on this FED: "<<fedIndex<<" length: "<<length;
00194     return std::auto_ptr< EcalRecHitCollection >(new EcalRecHitCollection);
00195   }
00196 
00197   /*R*/ LogDebug("EcalRawToRecHit|Worker")
00198     <<"size of digi collections after unpacking: "
00199     <<(*unpacker_->ebDigisCollection())->size()
00200     <<" "<<(*unpacker_->eeDigisCollection())->size()
00201     <<watcher.lap();
00202   EcalDigiCollection::const_iterator endDigiEB = (*unpacker_->ebDigisCollection())->end();
00203   EcalDigiCollection::const_iterator endDigiEE = (*unpacker_->eeDigisCollection())->end();
00204 
00205   //collection for the rechits: uncalib and final
00206   std::auto_ptr< EcalRecHitCollection > ecalrechits( new EcalRecHitCollection );
00207   std::auto_ptr< EcalUncalibratedRecHitCollection > uncalibRecHits( new EcalUncalibratedRecHitCollection );
00208   
00209   /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"going to work on EE rechits from: "<<endDigiEE-beginDigiEE<<" digis."
00210                                             <<"\ngoing to work on EB rechits from: "<<endDigiEB-beginDigiEB<<" digis."
00211                                           <<watcher.lap();
00212   // EB
00213   //make the uncalibrated rechits on the fly
00214   if (beginDigiEB!=endDigiEB){
00215     work<EBDetId>(beginDigiEB, endDigiEB, uncalibRecHits, ecalrechits);
00216   }
00217   /*R*/ LogDebug("EcalRawToRecHit|Worker")<<uncalibRecHits->size()<<" uncalibrated rechit created so far\n"
00218                                           <<ecalrechits->size()<<" rechit created so far."
00219                                           <<watcher.lap();
00220   
00221   // EE
00222   if (beginDigiEE!=endDigiEE){
00223     work<EEDetId>(beginDigiEE, endDigiEE, uncalibRecHits, ecalrechits);
00224   } 
00225   /*R*/ LogDebug("EcalRawToRecHit|Worker")<<uncalibRecHits->size()<<" uncalibrated rechit created eventually\n"
00226                                           <<ecalrechits->size()<<" rechit created eventually"
00227                                           <<watcher.lap();
00228 
00229   return ecalrechits;
00230 }

void EcalUnpackerWorker::write ( edm::Event e  )  const

Definition at line 113 of file EcalUnpackerWorker.cc.

00113                                                 {
00114   //write the collection in the event as requested.
00115 }


Friends And Related Function Documentation

friend class EcalRawToRecHitByproductProducer [friend]

Definition at line 61 of file EcalUnpackerWorker.h.


Member Data Documentation

edm::ESHandle<EcalADCToGeVConstant> EcalUnpackerWorker::agc [private]

Definition at line 93 of file EcalUnpackerWorker.h.

Referenced by setHandles(), and work().

edm::ESHandle<EcalRegionCabling> EcalUnpackerWorker::cabling [private]

Definition at line 80 of file EcalUnpackerWorker.h.

Referenced by setHandles().

edm::ESHandle<EcalChannelStatus> EcalUnpackerWorker::chStatus [private]

Definition at line 94 of file EcalUnpackerWorker.h.

Referenced by setHandles(), and work().

const edm::Event* EcalUnpackerWorker::evt [mutable, private]

Definition at line 53 of file EcalUnpackerWorker.h.

Referenced by update(), and work().

edm::ESHandle<EcalGainRatios> EcalUnpackerWorker::gains [private]

Definition at line 86 of file EcalUnpackerWorker.h.

Referenced by setHandles(), and work().

edm::ESHandle<EcalWeightXtalGroups> EcalUnpackerWorker::grps [private]

Definition at line 87 of file EcalUnpackerWorker.h.

Referenced by setHandles(), and work().

edm::ESHandle<EcalIntercalibConstants> EcalUnpackerWorker::ical [private]

Definition at line 92 of file EcalUnpackerWorker.h.

Referenced by setHandles(), and work().

edm::ESHandle<EcalLaserDbService> EcalUnpackerWorker::laser [private]

Definition at line 96 of file EcalUnpackerWorker.h.

Referenced by setHandles(), and work().

EcalElectronicsMapper* EcalUnpackerWorker::myMap_ [private]

Definition at line 57 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), setHandles(), and work().

edm::ESHandle<EcalPedestals> EcalUnpackerWorker::peds [private]

Definition at line 85 of file EcalUnpackerWorker.h.

Referenced by setHandles(), and work().

std::auto_ptr<EcalRawDataCollection> EcalUnpackerWorker::productDccHeaders [mutable, private]

Definition at line 62 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr<EBDigiCollection> EcalUnpackerWorker::productDigisEB [mutable, private]

Definition at line 58 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr<EEDigiCollection> EcalUnpackerWorker::productDigisEE [mutable, private]

Definition at line 59 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr<EBSrFlagCollection> EcalUnpackerWorker::productEBSrFlags [mutable, private]

Definition at line 69 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr<EESrFlagCollection> EcalUnpackerWorker::productEESrFlags [mutable, private]

Definition at line 70 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr<EcalElectronicsIdCollection> EcalUnpackerWorker::productInvalidBlockLengths [mutable, private]

Definition at line 73 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr< EBDetIdCollection> EcalUnpackerWorker::productInvalidChIds [mutable, private]

Definition at line 65 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr<EEDetIdCollection> EcalUnpackerWorker::productInvalidEEChIds [mutable, private]

Definition at line 68 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr< EEDetIdCollection> EcalUnpackerWorker::productInvalidEEGains [mutable, private]

Definition at line 66 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr<EEDetIdCollection> EcalUnpackerWorker::productInvalidEEGainsSwitch [mutable, private]

Definition at line 67 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr< EBDetIdCollection> EcalUnpackerWorker::productInvalidGains [mutable, private]

Definition at line 63 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr< EBDetIdCollection> EcalUnpackerWorker::productInvalidGainsSwitch [mutable, private]

Definition at line 64 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr<EcalElectronicsIdCollection> EcalUnpackerWorker::productInvalidMemBlockSizes [mutable, private]

Definition at line 76 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr<EcalElectronicsIdCollection> EcalUnpackerWorker::productInvalidMemChIds [mutable, private]

Definition at line 77 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr<EcalElectronicsIdCollection> EcalUnpackerWorker::productInvalidMemGains [mutable, private]

Definition at line 78 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr<EcalElectronicsIdCollection> EcalUnpackerWorker::productInvalidMemTtIds [mutable, private]

Definition at line 75 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr<EcalElectronicsIdCollection> EcalUnpackerWorker::productInvalidTTIds [mutable, private]

Definition at line 72 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr<EcalPnDiodeDigiCollection> EcalUnpackerWorker::productPnDiodeDigis [mutable, private]

Definition at line 74 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

std::auto_ptr<EcalTrigPrimDigiCollection> EcalUnpackerWorker::productTps [mutable, private]

Definition at line 71 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and update().

EcalRecHitAbsAlgo* EcalUnpackerWorker::rechitMaker_ [private]

Definition at line 90 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and work().

EcalUncalibRecHitRecWeightsAlgo<EBDataFrame>* EcalUnpackerWorker::uncalibMaker_barrel_ [private]

Definition at line 82 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and work().

EcalUncalibRecHitRecWeightsAlgo<EEDataFrame>* EcalUnpackerWorker::uncalibMaker_endcap_ [private]

Definition at line 83 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and work().

DCCDataUnpacker* EcalUnpackerWorker::unpacker_ [private]

Definition at line 55 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and work().

std::vector<int> EcalUnpackerWorker::v_chstatus_ [private]

Definition at line 95 of file EcalUnpackerWorker.h.

Referenced by EcalUnpackerWorker(), and work().

edm::ESHandle<EcalTBWeights> EcalUnpackerWorker::wgts [private]

Definition at line 88 of file EcalUnpackerWorker.h.

Referenced by setHandles(), and work().


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