Go to the documentation of this file.00001 #ifndef CALIBTRACKER_SIPIXELCALIBDIGIPRODUCER_H
00002 #define CALIBTRACKER_SIPIXELCALIBDIGIPRODUCER_H
00003
00004
00005
00006
00007
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <memory>
00024
00025
00026 #include "FWCore/Framework/interface/Frameworkfwd.h"
00027 #include "FWCore/Framework/interface/EDProducer.h"
00028 #include "FWCore/Framework/interface/Event.h"
00029 #include "FWCore/Framework/interface/MakerMacros.h"
00030 #include "FWCore/Framework/interface/ESHandle.h"
00031
00032 #include "FWCore/ServiceRegistry/interface/Service.h"
00033
00034 #include "FWCore/Utilities/interface/InputTag.h"
00035 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00036
00037 #include "DataFormats/Common/interface/DetSetVector.h"
00038
00039 #include "DataFormats/SiPixelDigi/interface/SiPixelCalibDigifwd.h"
00040 #include "DataFormats/SiPixelDigi/interface/SiPixelCalibDigi.h"
00041 #include "DataFormats/SiPixelDigi/interface/PixelDigi.h"
00042 #include "DataFormats/SiPixelDigi/interface/SiPixelCalibDigiError.h"
00043
00044 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00045 #include "CondFormats/SiPixelObjects/interface/SiPixelCalibConfiguration.h"
00046 #include "CondFormats/DataRecord/interface/SiPixelCalibConfigurationRcd.h"
00047 #include "CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h"
00048
00049 #include <map>
00050 #include <vector>
00051 #include <iostream>
00052
00053
00054
00055
00056 class SiPixelCalibDigiProducer : public edm::EDProducer {
00057 public:
00058 explicit SiPixelCalibDigiProducer(const edm::ParameterSet& iConfig);
00059 ~SiPixelCalibDigiProducer();
00060
00061 private:
00062
00063 virtual void beginJob(){}
00064 virtual void beginRun(const edm::Run &, const edm::EventSetup &);
00065 virtual void produce(edm::Event& iEvent, const edm::EventSetup& iSetup);
00066 virtual bool store();
00067 virtual void setPattern();
00068 virtual void fill(edm::Event &iEvent, const edm::EventSetup& iSetup);
00069 virtual void fillPixel(uint32_t detid, short row, short col,short ipoint, short adc);
00070 virtual bool checkPixel(uint32_t detid, short row, short col);
00071 virtual bool checkFED(uint32_t detid);
00072 virtual void clear();
00073 virtual void endJob() ;
00074 typedef std::pair<uint32_t,std::pair<short,short> > pixelstruct;
00075
00076 edm::InputTag src_;
00077 uint32_t iEventCounter_;
00078
00079 bool ignore_non_pattern_;
00080 bool control_pattern_size_;
00081 bool includeErrors_;
00082 int errorType;
00083 edm::ParameterSet conf_;
00084 std::string label_;
00085 std::string instance_;
00086 uint32_t number_of_pixels_per_pattern_;
00087 bool use_realeventnumber_;
00088
00089 edm::ESHandle<SiPixelCalibConfiguration> calib_;
00090 edm::ESHandle<TrackerGeometry> theGeometry_;
00091 edm::ESHandle<SiPixelFedCablingMap> theCablingMap_;
00092
00093
00094 std::map<pixelstruct,SiPixelCalibDigi> intermediate_data_;
00095 std::map<pixelstruct,SiPixelCalibDigiError> error_data_;
00096
00097 std::vector<pixelstruct> detPixelMap_;
00098 uint32_t pattern_repeat_;
00099 std::map<uint32_t,uint32_t> detid_to_fedid_;
00100
00101 std::vector<std::pair<short,short> > currentpattern_;
00102 std::pair<short,short> currentpair_;
00103 };
00104
00105
00106 #endif