CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions
EcalRawToDigi.cc File Reference
#include <iostream>
#include "EventFilter/EcalRawToDigi/interface/DCCRawDataDefinitions.h"
#include <DataFormats/FEDRawData/interface/FEDRawData.h>
#include <DataFormats/FEDRawData/interface/FEDNumbering.h>
#include <DataFormats/FEDRawData/interface/FEDRawDataCollection.h>
#include <DataFormats/EcalDigi/interface/EcalDigiCollections.h>
#include <DataFormats/EcalRawData/interface/EcalRawDataCollections.h>
#include "Geometry/EcalMapping/interface/EcalMappingRcd.h"
#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h"
#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h"
#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h"
#include <DataFormats/Common/interface/Handle.h>
#include <FWCore/Framework/interface/Event.h>
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include <FWCore/MessageLogger/interface/MessageLogger.h>
#include <FWCore/ParameterSet/interface/ParameterSet.h>
#include <FWCore/Framework/interface/ESWatcher.h>
#include "FWCore/Utilities/interface/ESGetToken.h"
#include "DataFormats/EcalRawData/interface/EcalListOfFEDS.h"
#include <sys/time.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 "FWCore/Framework/interface/MakerMacros.h"

Go to the source code of this file.

Classes

class  EcalRawToDigi
 

Functions

void printStatusRecords (const DCCDataUnpacker *unpacker, const EcalElectronicsMapping *mapping)
 
static const
edm::ParameterSetDescriptionFillerPluginFactory::PMaker
< edm::ParameterSetDescriptionFiller
< EcalRawToDigi > > 
s_filler__LINE__ ("EcalRawToDigi")
 
static const
edm::MakerPluginFactory::PMaker
< edm::WorkerMaker
< EcalRawToDigi > > 
s_maker__LINE__ ("EcalRawToDigi")
 

Function Documentation

void printStatusRecords ( const DCCDataUnpacker unpacker,
const EcalElectronicsMapping mapping 
)

Definition at line 297 of file EcalRawToDigi.cc.

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

297  {
298  // Endcap
299  std::cout << "===> ENDCAP" << std::endl;
300  for (int i = 0; i < EEDetId::kSizeForDenseIndexing; ++i) {
301  const EEDetId id = EEDetId::unhashIndex(i);
302  if (!id.null()) {
303  // channel status
304  const uint16_t code = unpacker->getChannelValue(id);
305 
306  if (code) {
307  const EcalElectronicsId ei = mapping->getElectronicsId(id);
308 
309  // convert DCC ID (1 - 54) to FED ID (601 - 654)
310  const int fed_id = unpacker->electronicsMapper()->getDCCId(ei.dccId());
311 
312  std::cout << " id " << id.rawId() << " -> (" << id.ix() << ", " << id.iy() << ", " << id.zside() << ") "
313  << "(" << ei.dccId() << " : " << fed_id << ", " << ei.towerId() << ", " << ei.stripId() << ", "
314  << ei.xtalId() << ") "
315  << "status = " << code << std::endl;
316  }
317  }
318  }
319  std::cout << "<=== ENDCAP" << std::endl;
320 
321  std::cout << "===> BARREL" << std::endl;
322  for (int i = 0; i < EBDetId::kSizeForDenseIndexing; ++i) {
323  const EBDetId id = EBDetId::unhashIndex(i);
324  if (!id.null()) {
325  // channel status
326  const uint16_t code = unpacker->getChannelValue(id);
327 
328  if (code) {
329  const EcalElectronicsId ei = mapping->getElectronicsId(id);
330 
331  // convert DCC ID (1 - 54) to FED ID (601 - 654)
332  const int fed_id = unpacker->electronicsMapper()->getDCCId(ei.dccId());
333 
334  std::cout << " id " << id.rawId() << " -> (" << id.ieta() << ", " << id.iphi() << ", " << id.zside() << ") "
335  << "(" << ei.dccId() << " : " << fed_id << ", " << ei.towerId() << ", " << ei.stripId() << ", "
336  << ei.xtalId() << ") "
337  << "status = " << code << std::endl;
338  }
339  }
340  }
341  std::cout << "<=== BARREL" << std::endl;
342 }
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:65
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:110
tuple cout
Definition: gather_cfg.py:144
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< EcalRawToDigi > > s_filler__LINE__ ( "EcalRawToDigi"  )
static
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< EcalRawToDigi > > s_maker__LINE__ ( "EcalRawToDigi"  )
static