CMS 3D CMS Logo

Phase2TrackerCommissioningDigiProducer.cc
Go to the documentation of this file.
14 
15 namespace Phase2Tracker {
16 
18  public:
22  ~Phase2TrackerCommissioningDigiProducer() override = default;
23  void produce(edm::StreamID, edm::Event& ev, const edm::EventSetup& es) const 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 
44  const edm::EventSetup& es) const {
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 }
void push_back(const T &t)
Definition: DetSet.h:66
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:48
static const uint16_t CMS_FED_ID_MAX
Definition: utils.h:20
~Phase2TrackerCommissioningDigiProducer() override=default
default constructor
Phase2TrackerCommissioningDigiProducer(const edm::ParameterSet &pset)
constructor
#define LogTrace(id)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void produce(edm::StreamID, edm::Event &ev, const edm::EventSetup &es) const override
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
static const uint16_t FED_ID_MAX
Definition: utils.h:19
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
static const uint16_t FED_ID_MIN
Definition: utils.h:18
Phase2Tracker::Phase2TrackerCommissioningDigiProducer Phase2TrackerCommissioningDigiProducer
__host__ __device__ fedId_t fedIndex(fedId_t fed)
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1