CMS 3D CMS Logo

Phase2TrackerCommissioningDigiProducer.cc
Go to the documentation of this file.
14 
15 namespace Phase2Tracker {
16 
18  public:
23  void produce(edm::Event& event, const edm::EventSetup& es) override;
24 
25  private:
27  };
28 } // namespace Phase2Tracker
29 
33 
34 using namespace std;
35 
37  const edm::ParameterSet& pset) {
38  produces<edm::DetSet<Phase2TrackerCommissioningDigi>>("ConditionData");
39  token_ = consumes<FEDRawDataCollection>(pset.getParameter<edm::InputTag>("ProductLabel"));
40 }
41 
43 
45  // Retrieve FEDRawData collection
47  event.getByToken(token_, buffers);
48 
49  // Analyze strip tracker FED buffers in data
50  size_t fedIndex;
52  const FEDRawData& fed = buffers->FEDData(fedIndex);
54  // construct buffer
57 
58  // fetch condition data
59  std::map<uint32_t, uint32_t> cond_data = buffer->conditionData();
60  delete buffer;
61 
62  // print cond data for debug
63  LogTrace("Phase2TrackerCommissioningDigiProducer") << "--- Condition data debug ---" << std::endl;
64  std::map<uint32_t, uint32_t>::const_iterator it;
65  for (it = cond_data.begin(); it != cond_data.end(); it++) {
66  LogTrace("Phase2TrackerCommissioningDigiProducer")
67  << std::hex << "key: " << it->first << std::hex << " value: " << it->second << " (hex) " << std::dec
68  << it->second << " (dec) " << std::endl;
69  }
70  LogTrace("Phase2TrackerCommissioningDigiProducer") << "----------------------------" << std::endl;
71  // store it into digis
74  for (it = cond_data.begin(); it != cond_data.end(); it++) {
75  cond_data_digi->push_back(Phase2TrackerCommissioningDigi(it->first, it->second));
76  }
77  std::unique_ptr<edm::DetSet<Phase2TrackerCommissioningDigi>> cdd(cond_data_digi);
78  event.put(std::move(cdd), "ConditionData");
79  }
80  }
81 }
Phase2Tracker::Phase2TrackerCommissioningDigiProducer::token_
edm::EDGetTokenT< FEDRawDataCollection > token_
Definition: Phase2TrackerCommissioningDigiProducer.cc:26
edm::DetSet::push_back
void push_back(const T &t)
Definition: DetSet.h:66
Handle.h
MessageLogger.h
sistrip::SpyUtilities::fedIndex
void fedIndex(uint32_t aFedIndex, uint16_t &aFedId, uint16_t &aFedChannel)
Definition: SiStripSpyUtilities.cc:300
EDProducer.h
Phase2Tracker::CMS_FED_ID_MAX
static const uint16_t CMS_FED_ID_MAX
Definition: utils.h:19
edm::DetSet
Definition: DetSet.h:23
edm::EDGetTokenT< FEDRawDataCollection >
Phase2TrackerCommissioningDigiProducer
Phase2Tracker::Phase2TrackerCommissioningDigiProducer Phase2TrackerCommissioningDigiProducer
Definition: Phase2TrackerCommissioningDigiProducer.cc:31
utils.h
edm::Handle< FEDRawDataCollection >
Phase2Tracker::Phase2TrackerCommissioningDigiProducer::~Phase2TrackerCommissioningDigiProducer
~Phase2TrackerCommissioningDigiProducer() override
default constructor
Definition: Phase2TrackerCommissioningDigiProducer.cc:42
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
FEDRawData
Definition: FEDRawData.h:19
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Phase2Tracker::Phase2TrackerCommissioningDigiProducer::Phase2TrackerCommissioningDigiProducer
Phase2TrackerCommissioningDigiProducer(const edm::ParameterSet &pset)
constructor
Definition: Phase2TrackerCommissioningDigiProducer.cc:36
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
Phase2Tracker::Phase2TrackerFEDBuffer
Definition: Phase2TrackerFEDBuffer.h:14
Phase2Tracker::FED_ID_MAX
static const uint16_t FED_ID_MAX
Definition: utils.h:18
FEDRawDataCollection.h
Phase2Tracker::Phase2TrackerCommissioningDigiProducer
Definition: Phase2TrackerCommissioningDigiProducer.cc:17
Phase2TrackerCommissioningDigi
Definition: Phase2TrackerCommissioningDigi.h:6
edm::EventSetup
Definition: EventSetup.h:58
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
Phase2TrackerCommissioningDigi.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
Phase2Tracker::Phase2TrackerCommissioningDigiProducer::produce
void produce(edm::Event &event, const edm::EventSetup &es) override
Definition: Phase2TrackerCommissioningDigiProducer.cc:44
Phase2TrackerFEDHeader.h
EventSetup.h
edm::EDProducer
Definition: EDProducer.h:35
Exception.h
DetSet.h
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
ParameterSet.h
Phase2Tracker::FED_ID_MIN
static const uint16_t FED_ID_MIN
Definition: utils.h:17
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
edm::InputTag
Definition: InputTag.h:15
Phase2Tracker
Definition: Phase2TrackerFEDBuffer.h:12
Phase2TrackerFEDBuffer.h
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27