1 #include "FWCore/Framework/interface/EDProducer.h"
2 #include "FWCore/Framework/interface/Event.h"
3 #include "DataFormats/Common/interface/Handle.h"
4 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
6 #include "FWCore/Framework/interface/EventSetup.h"
7 #include "FWCore/ParameterSet/interface/ParameterSet.h"
9 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
10 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
12 #include "HGCal/DataFormats/interface/HGCalTBTrackCollection.h"
23 class FNALTelescopeRawToTracks :
public edm::EDProducer
26 explicit FNALTelescopeRawToTracks(
const edm::ParameterSet& ps);
27 virtual void produce(edm::Event& e,
const edm::EventSetup& c);
28 virtual void beginJob();
29 void fillDescription(edm::ParameterSetDescription &desc);
32 edm::InputTag dataTag_;
33 std::vector<int> fedIds_;
37 FNALTelescopeRawToTracks::FNALTelescopeRawToTracks(edm::ParameterSet
const& conf):
38 dataTag_(conf.getParameter<edm::InputTag>(
"InputLabel")),
39 fedIds_(conf.getUntrackedParameter<std::vector<int> >(
"fedIds"))
41 produces<HGCalTBTrackCollection>();
42 consumes<FEDRawDataCollection>(dataTag_);
45 void FNALTelescopeRawToTracks::beginJob()
49 void FNALTelescopeRawToTracks::produce(edm::Event& e,
const edm::EventSetup& c)
51 edm::Handle<FEDRawDataCollection> rawraw;
52 e.getByLabel(dataTag_, rawraw);
54 std::auto_ptr<HGCalTBTrackCollection> tracks = std::auto_ptr<HGCalTBTrackCollection>(
new HGCalTBTrackCollection);
56 for(
auto fedId_ : fedIds_) {
58 const FEDRawData& fed = rawraw->FEDData(fedId_);
59 if(fed.size() == 0)
continue;
61 const float* pdata = (
const float*)(fed.data());
67 tracks->push_back(track);
78 void FNALTelescopeRawToTracks::fillDescription(edm::ParameterSetDescription &desc)
80 desc.setComment(
"TEST");
81 desc.add<edm::InputTag>(
"InputLabel");
82 desc.addUntracked<std::vector<int> >(
"fedIds", std::vector<int>(99));
85 #include "FWCore/PluginManager/interface/ModuleDef.h"
86 #include "FWCore/Framework/interface/MakerMacros.h"
DEFINE_FWK_MODULE(Pedestals)
static size_t getSizeof(void)
std::vector< HGCalTBTrack > HGCalTBTrackCollection