#include <EventFilter/SiPixelRawToDigi/plugins/SiPixelDigiToRaw.h>
Public Member Functions | |
virtual void | beginJob (const edm::EventSetup &) |
initialisation. Retrieves cabling map from EventSetup. | |
virtual void | endJob () |
dummy end of job | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
get data, convert to raw event, attach again to Event | |
SiPixelDigiToRaw (const edm::ParameterSet &) | |
ctor | |
virtual | ~SiPixelDigiToRaw () |
dtor | |
Private Attributes | |
edm::ParameterSet | config_ |
unsigned long | eventCounter_ |
SiPixelFedCablingMap * | fedCablingMap_ |
Definition at line 14 of file SiPixelDigiToRaw.h.
SiPixelDigiToRaw::SiPixelDigiToRaw | ( | const edm::ParameterSet & | pset | ) | [explicit] |
ctor
Definition at line 20 of file SiPixelDigiToRaw.cc.
References edm::ParameterSet::getUntrackedParameter(), and label.
00020 : 00021 eventCounter_(0), 00022 fedCablingMap_(0), 00023 config_(pset) 00024 // src_( pset.getParameter<edm::InputTag>( "src" ) ) 00025 { 00026 00027 // Define EDProduct type 00028 string label = pset.getUntrackedParameter<string>("ProductLabel","sourceXXL"); 00029 produces<FEDRawDataCollection>(); 00030 00031 }
SiPixelDigiToRaw::~SiPixelDigiToRaw | ( | ) | [virtual] |
void SiPixelDigiToRaw::beginJob | ( | const edm::EventSetup & | setup | ) | [virtual] |
initialisation. Retrieves cabling map from EventSetup.
Reimplemented from edm::EDProducer.
Definition at line 38 of file SiPixelDigiToRaw.cc.
dummy end of job
Reimplemented from edm::EDProducer.
Definition at line 27 of file SiPixelDigiToRaw.h.
void SiPixelDigiToRaw::produce | ( | edm::Event & | ev, | |
const edm::EventSetup & | es | |||
) | [virtual] |
get data, convert to raw event, attach again to Event
Implements edm::EDProducer.
Definition at line 43 of file SiPixelDigiToRaw.cc.
References config_, GenMuonPlsPt100GeV_cfg::cout, debug, reco_application_tbsim_simpleTBanalysis_cfg::digiCollection, lat::endl(), eventCounter_, edm::EventSetup::get(), edm::Event::getByLabel(), edm::ParameterSet::getUntrackedParameter(), edm::Event::id(), edm::MessageDrop::instance(), it, label, LogDebug, edm::ESHandle< T >::product(), edm::Event::put(), FEDRawData::size(), and size.
00045 { 00046 using namespace sipixelobjects; 00047 00048 eventCounter_++; 00049 edm::LogInfo("SiPixelDigiToRaw") << "[SiPixelDigiToRaw::produce] " 00050 << "event number: " 00051 << eventCounter_; 00052 00053 edm::Handle< edm::DetSetVector<PixelDigi> > digiCollection; 00054 static string label = config_.getUntrackedParameter<string>("InputLabel","source"); 00055 static string instance = config_.getUntrackedParameter<string>("InputInstance",""); 00056 ev.getByLabel( label, instance, digiCollection); 00057 00058 PixelDataFormatter::Digis digis; 00059 typedef vector< edm::DetSet<PixelDigi> >::const_iterator DI; 00060 00061 static int allDigiCounter = 0; 00062 static int allWordCounter = 0; 00063 int digiCounter = 0; 00064 for (DI di=digiCollection->begin(); di != digiCollection->end(); di++) { 00065 digiCounter += (di->data).size(); 00066 digis[ di->id] = di->data; 00067 // digis.push_back(*di); 00068 } 00069 allDigiCounter += digiCounter; 00070 00071 edm::ESHandle<SiPixelFedCablingMap> map; 00072 es.get<SiPixelFedCablingMapRcd>().get( map ); 00073 00074 static bool debug = edm::MessageDrop::instance()->debugEnabled; 00075 if (debug) cout << map->version() << endl; 00076 00077 PixelDataFormatter formatter(map.product()); 00078 00079 // create product (raw data) 00080 std::auto_ptr<FEDRawDataCollection> buffers( new FEDRawDataCollection ); 00081 00082 const vector<const PixelFEDCabling *> cabling = map->fedList(); 00083 00084 typedef vector<const PixelFEDCabling *>::const_iterator FI; 00085 for (FI it = cabling.begin(); it != cabling.end(); it++) { 00086 LogDebug("SiPixelDigiToRaw")<<" PRODUCE DATA FOR FED_id: " << (**it).id(); 00087 FEDRawData * rawData = formatter.formatData( ev.id().event(),(**it).id(), digis); 00088 FEDRawData& fedRawData = buffers->FEDData( (**it).id() ); 00089 fedRawData = *rawData; 00090 LogDebug("SiPixelDigiToRaw")<<"size of data in fedRawData: "<<fedRawData.size(); 00091 delete rawData; 00092 } 00093 allWordCounter += formatter.nWords(); 00094 if (debug) cout << "Words/Digis this ev: "<<digiCounter<<"(fm:"<<formatter.nDigis()<<")/" 00095 <<formatter.nWords() 00096 <<" all: "<< allDigiCounter <<"/"<<allWordCounter<<endl; 00097 00098 00099 ev.put( buffers ); 00100 00101 }
edm::ParameterSet SiPixelDigiToRaw::config_ [private] |
unsigned long SiPixelDigiToRaw::eventCounter_ [private] |
Definition at line 35 of file SiPixelDigiToRaw.h.