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/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 185 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().

187 {
188  // Endcap
189  std::cout << "===> ENDCAP" << std::endl;
190  for (int i = 0; i < EEDetId::kSizeForDenseIndexing; ++i) {
191  const EEDetId id = EEDetId::unhashIndex(i);
192  if (!id.null()) {
193  // channel status
194  const uint16_t code = unpacker->getChannelValue(id);
195 
196  if (code) {
197  const EcalElectronicsId ei = mapping->getElectronicsId(id);
198 
199  // convert DCC ID (1 - 54) to FED ID (601 - 654)
200  const int fed_id = unpacker->electronicsMapper()->getDCCId(ei.dccId());
201 
202  std::cout
203  << " id " << id.rawId()
204  << " -> (" << id.ix() << ", " << id.iy() << ", " << id.zside() << ") "
205  << "(" << ei.dccId() << " : " << fed_id << ", " << ei.towerId() << ", " << ei.stripId() << ", " << ei.xtalId() << ") "
206  << "status = " << code
207  << std::endl;
208  }
209  }
210  }
211  std::cout << "<=== ENDCAP" << std::endl;
212 
213  std::cout << "===> BARREL" << std::endl;
214  for (int i = 0; i < EBDetId::kSizeForDenseIndexing; ++i) {
215  const EBDetId id = EBDetId::unhashIndex(i);
216  if (!id.null()) {
217  // channel status
218  const uint16_t code = unpacker->getChannelValue(id);
219 
220  if (code) {
221  const EcalElectronicsId ei = mapping->getElectronicsId(id);
222 
223  // convert DCC ID (1 - 54) to FED ID (601 - 654)
224  const int fed_id = unpacker->electronicsMapper()->getDCCId(ei.dccId());
225 
226  std::cout
227  << " id " << id.rawId()
228  << " -> (" << id.ieta() << ", " << id.iphi() << ", " << id.zside() << ") "
229  << "(" << ei.dccId() << " : " << fed_id << ", " << ei.towerId() << ", " << ei.stripId() << ", " << ei.xtalId() << ") "
230  << "status = " << code
231  << std::endl;
232  }
233  }
234  }
235  std::cout << "<=== BARREL" << std::endl;
236 }
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