CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
EcalRawToDigi.cc File Reference
#include "EventFilter/EcalRawToDigi/plugins/EcalRawToDigi.h"
#include "EventFilter/EcalRawToDigi/interface/EcalElectronicsMapper.h"
#include "EventFilter/EcalRawToDigi/interface/DCCDataUnpacker.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h"
#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h"
#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h"

Go to the source code of this file.

Functions

void printStatusRecords (const DCCDataUnpacker *unpacker, const EcalElectronicsMapping *mapping)
 

Function Documentation

void printStatusRecords ( const DCCDataUnpacker unpacker,
const EcalElectronicsMapping mapping 
)

Definition at line 190 of file EcalRawToDigi.cc.

References gather_cfg::cout, EcalElectronicsId::dccId(), DCCDataUnpacker::electronicsMapper(), DCCDataUnpacker::getChannelValue(), EcalElectronicsMapper::getDCCId(), EcalElectronicsMapping::getElectronicsId(), i, EBDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, EcalElectronicsId::stripId(), EcalElectronicsId::towerId(), EBDetId::unhashIndex(), EEDetId::unhashIndex(), and EcalElectronicsId::xtalId().

192 {
193  // Endcap
194  std::cout << "===> ENDCAP" << std::endl;
195  for (int i = 0; i < EEDetId::kSizeForDenseIndexing; ++i) {
196  const EEDetId id = EEDetId::unhashIndex(i);
197  if (!id.null()) {
198  // channel status
199  const uint16_t code = unpacker->getChannelValue(id);
200 
201  if (code) {
202  const EcalElectronicsId ei = mapping->getElectronicsId(id);
203 
204  // convert DCC ID (1 - 54) to FED ID (601 - 654)
205  const int fed_id = unpacker->electronicsMapper()->getDCCId(ei.dccId());
206 
207  std::cout
208  << " id " << id.rawId()
209  << " -> (" << id.ix() << ", " << id.iy() << ", " << id.zside() << ") "
210  << "(" << ei.dccId() << " : " << fed_id << ", " << ei.towerId() << ", " << ei.stripId() << ", " << ei.xtalId() << ") "
211  << "status = " << code
212  << std::endl;
213  }
214  }
215  }
216  std::cout << "<=== ENDCAP" << std::endl;
217 
218  std::cout << "===> BARREL" << std::endl;
219  for (int i = 0; i < EBDetId::kSizeForDenseIndexing; ++i) {
220  const EBDetId id = EBDetId::unhashIndex(i);
221  if (!id.null()) {
222  // channel status
223  const uint16_t code = unpacker->getChannelValue(id);
224 
225  if (code) {
226  const EcalElectronicsId ei = mapping->getElectronicsId(id);
227 
228  // convert DCC ID (1 - 54) to FED ID (601 - 654)
229  const int fed_id = unpacker->electronicsMapper()->getDCCId(ei.dccId());
230 
231  std::cout
232  << " id " << id.rawId()
233  << " -> (" << id.ieta() << ", " << id.iphi() << ", " << id.zside() << ") "
234  << "(" << ei.dccId() << " : " << fed_id << ", " << ei.towerId() << ", " << ei.stripId() << ", " << ei.xtalId() << ") "
235  << "status = " << code
236  << std::endl;
237  }
238  }
239  }
240  std::cout << "<=== BARREL" << std::endl;
241 }
int i
Definition: DBlmapReader.cc:9
int xtalId() const
get the channel id
int stripId() const
get the tower id
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
int towerId() const
get the tower id
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:99
const EcalElectronicsMapper * electronicsMapper() const
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
unsigned int getDCCId(unsigned int aSMId) const
uint16_t getChannelValue(const DetId &id) const
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:114
tuple cout
Definition: gather_cfg.py:121