CMS 3D CMS Logo

DTDigiToRawModule Class Reference

#include <EventFilter/DTRawToDigi/plugins/DTDigiToRawModule.h>

Inheritance diagram for DTDigiToRawModule:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 DTDigiToRawModule (const edm::ParameterSet &pset)
 Constructor.
virtual void produce (edm::Event &, const edm::EventSetup &)
virtual ~DTDigiToRawModule ()
 Destructor.

Private Attributes

int dduID
bool debug
bool digibyType
std::string digicoll
int maxFEDid_
int minFEDid_
DTDigiToRawpacker
bool useStandardFEDid_


Detailed Description

Definition at line 11 of file DTDigiToRawModule.h.


Constructor & Destructor Documentation

DTDigiToRawModule::DTDigiToRawModule ( const edm::ParameterSet pset  ) 

Constructor.

Definition at line 23 of file DTDigiToRawModule.cc.

References GenMuonPlsPt100GeV_cfg::cout, dduID, debug, digibyType, digicoll, lat::endl(), edm::ParameterSet::getUntrackedParameter(), maxFEDid_, minFEDid_, packer, and useStandardFEDid_.

00023                                                               {
00024   produces<FEDRawDataCollection>();
00025   
00026   dduID = ps.getUntrackedParameter<int>("dduID", 770);
00027   debug = ps.getUntrackedParameter<bool>("debugMode", false);
00028   digicoll = ps.getUntrackedParameter<string>("digiColl", "dtunpacker");
00029   digibyType = ps.getUntrackedParameter<bool>("digibytype", true);
00030   
00031   useStandardFEDid_ = ps.getUntrackedParameter<bool>("useStandardFEDid", true);
00032   minFEDid_ = ps.getUntrackedParameter<int>("minFEDid", 731);
00033   maxFEDid_ = ps.getUntrackedParameter<int>("maxFEDid", 735);
00034   
00035   packer = new DTDigiToRaw(ps);
00036   if (debug) cout << "[DTDigiToRawModule]: constructor" << endl;
00037 }

DTDigiToRawModule::~DTDigiToRawModule (  )  [virtual]

Destructor.

Definition at line 39 of file DTDigiToRawModule.cc.

References GenMuonPlsPt100GeV_cfg::cout, debug, lat::endl(), and packer.

00039                                      {
00040   delete packer;
00041   if (debug) cout << "[DTDigiToRawModule]: destructor" << endl;
00042 }


Member Function Documentation

void DTDigiToRawModule::produce ( edm::Event e,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDProducer.

Definition at line 45 of file DTDigiToRawModule.cc.

References evf::compute_crc(), DTDigiToRaw::createFedBuffers(), FEDRawData::data(), digibyType, digicoll, edm::EventID::event(), edm::EventSetup::get(), edm::Event::getByLabel(), edm::Event::getByType(), FEDNumbering::getDTFEDIds(), id, edm::Event::id(), maxFEDid_, minFEDid_, packer, edm::Event::put(), FEDTrailer::set(), DTDigiToRaw::SetdduID(), FEDRawData::size(), and useStandardFEDid_.

00045                                                                    {
00046 
00047   auto_ptr<FEDRawDataCollection> fed_buffers(new FEDRawDataCollection);
00048   
00049   // Take digis from the event
00050   Handle<DTDigiCollection> digis;
00051   if (digibyType) {
00052     e.getByType(digis);
00053   }
00054   else {
00055     e.getByLabel(digicoll, digis);
00056   }
00057   
00058   // Load DTMap
00059   edm::ESHandle<DTReadOutMapping> map;
00060   iSetup.get<DTReadOutMappingRcd>().get( map );
00061   
00062   // Create the packed data
00063   int FEDIDmin = 0, FEDIDMax = 0;
00064   if (useStandardFEDid_){
00065     FEDIDmin = FEDNumbering::getDTFEDIds().first;
00066     FEDIDMax = FEDNumbering::getDTFEDIds().second;
00067   }
00068   else {
00069     FEDIDmin = minFEDid_;
00070     FEDIDMax = maxFEDid_;
00071   }
00072   
00073   for (int id=FEDIDmin; id<=FEDIDMax; ++id){
00074     
00075     packer->SetdduID(id);
00076     FEDRawData* rawData = packer->createFedBuffers(*digis, map);
00077 
00078     FEDRawData& fedRawData = fed_buffers->FEDData(id);
00079     fedRawData = *rawData;
00080     delete rawData;
00081 
00082     FEDHeader dtFEDHeader(fedRawData.data());
00083     dtFEDHeader.set(fedRawData.data(), 0, e.id().event(), 0, id);
00084     
00085     FEDTrailer dtFEDTrailer(fedRawData.data()+(fedRawData.size()-8));
00086     dtFEDTrailer.set(fedRawData.data()+(fedRawData.size()-8), fedRawData.size()/8, evf::compute_crc(fedRawData.data(),fedRawData.size()), 0, 0);
00087 
00088   }
00089   // Put the raw data to the event
00090   e.put(fed_buffers);
00091   
00092 }


Member Data Documentation

int DTDigiToRawModule::dduID [private]

Definition at line 25 of file DTDigiToRawModule.h.

Referenced by DTDigiToRawModule().

bool DTDigiToRawModule::debug [private]

Definition at line 26 of file DTDigiToRawModule.h.

Referenced by DTDigiToRawModule(), and ~DTDigiToRawModule().

bool DTDigiToRawModule::digibyType [private]

Definition at line 27 of file DTDigiToRawModule.h.

Referenced by DTDigiToRawModule(), and produce().

std::string DTDigiToRawModule::digicoll [private]

Definition at line 28 of file DTDigiToRawModule.h.

Referenced by DTDigiToRawModule(), and produce().

int DTDigiToRawModule::maxFEDid_ [private]

Definition at line 32 of file DTDigiToRawModule.h.

Referenced by DTDigiToRawModule(), and produce().

int DTDigiToRawModule::minFEDid_ [private]

Definition at line 31 of file DTDigiToRawModule.h.

Referenced by DTDigiToRawModule(), and produce().

DTDigiToRaw* DTDigiToRawModule::packer [private]

Definition at line 23 of file DTDigiToRawModule.h.

Referenced by DTDigiToRawModule(), produce(), and ~DTDigiToRawModule().

bool DTDigiToRawModule::useStandardFEDid_ [private]

Definition at line 30 of file DTDigiToRawModule.h.

Referenced by DTDigiToRawModule(), and produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:18:51 2009 for CMSSW by  doxygen 1.5.4