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 "DataFormats/EcalRawData/interface/EcalListOfFEDS.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 180 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().

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