CMS 3D CMS Logo

CTPPSPixelRawToDigi.cc
Go to the documentation of this file.
1 /*
2  * adapting to CTPPS pixel detector March 2017 - F.Ferro
3  */
4 
5 
7 
11 
13 
19 
21 
23 
24 using namespace std;
25 
26 
28  : config_(conf)
29 
30 {
31 
32  FEDRawDataCollection_ = consumes <FEDRawDataCollection> (config_.getParameter<edm::InputTag>("InputLabel"));
33 
34 // Products
35  produces< edm::DetSetVector<CTPPSPixelDigi> >();
36 
37 //CablingMap could have a label //Tav
38  mappingLabel_ = config_.getParameter<std::string> ("mappingLabel"); //RPix
39 
40 }
41 
42 
44  edm::LogInfo("CTPPSPixelRawToDigi") << " CTPPSPixelRawToDigi destructor!";
45 
46 }
47 
49  const edm::EventSetup& es)
50 {
51 
53  es.get<CTPPSPixelDAQMappingRcd>().get(mappingLabel_, mapping);
54 
55 
56 
57  fedIds_ = mapping->fedIds();
58 
60  ev.getByToken(FEDRawDataCollection_, buffers);
61 
63  auto collection = std::make_unique<edm::DetSetVector<CTPPSPixelDigi>>();
64 
65  CTPPSPixelDataFormatter formatter(mapping->ROCMapping);
66 
67  bool errorsInEvent = false;
68  for (auto aFed = fedIds_.begin(); aFed != fedIds_.end(); ++aFed) {
69  int fedId = *aFed;
70 
71  edm::LogInfo("CTPPSPixelRawToDigi")<< " PRODUCE DIGI FOR FED: " << dec <<fedId << endl;
72 
74  const FEDRawData& fedRawData = buffers->FEDData( fedId );
75 
76  formatter.interpretRawData( errorsInEvent, fedId, fedRawData, *collection);
77  }
78 
81 
82 }
83 
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
std::set< unsigned int > fedIds() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
edm::ParameterSet config_
CTPPSPixelRawToDigi(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
bool ev
std::set< unsigned int > fedIds_
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
std::map< CTPPSPixelFramePosition, CTPPSPixelROCInfo > ROCMapping
const T & get() const
Definition: EventSetup.h:56
virtual void produce(edm::Event &, const edm::EventSetup &) override
get data, convert to digis attach againe to Event
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_
def move(src, dest)
Definition: eostools.py:510