CMS 3D CMS Logo

CastorDigiToRaw Class Reference

CastorDigiToRaw is the EDProducer subclass which runs the Castor Unpack algorithm. More...

#include <EventFilter/CastorRawToDigi/plugins/CastorDigiToRaw.h>

Inheritance diagram for CastorDigiToRaw:

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

List of all members.

Public Member Functions

 CastorDigiToRaw (const edm::ParameterSet &ps)
virtual void produce (edm::Event &e, const edm::EventSetup &c)
virtual ~CastorDigiToRaw ()

Private Attributes

edm::InputTag calibTag_
edm::InputTag castorTag_
CastorPacker packer_
edm::InputTag trigTag_


Detailed Description

CastorDigiToRaw is the EDProducer subclass which runs the Castor Unpack algorithm.

Author:
Alan Campbell
Version:
1st Version April 18, 2008

Definition at line 26 of file CastorDigiToRaw.h.


Constructor & Destructor Documentation

CastorDigiToRaw::CastorDigiToRaw ( const edm::ParameterSet ps  )  [explicit]

Definition at line 16 of file CastorDigiToRaw.cc.

00016                                                             :
00017   castorTag_(conf.getUntrackedParameter("CASTOR",edm::InputTag())),
00018   calibTag_(conf.getUntrackedParameter("CALIB",edm::InputTag())),
00019   trigTag_(conf.getUntrackedParameter("TRIG",edm::InputTag()))
00020 {
00021   produces<FEDRawDataCollection>();
00022 }

CastorDigiToRaw::~CastorDigiToRaw (  )  [virtual]

Definition at line 25 of file CastorDigiToRaw.cc.

00025 { }  


Member Function Documentation

void CastorDigiToRaw::produce ( edm::Event e,
const edm::EventSetup c 
) [virtual]

Implements edm::EDProducer.

Definition at line 28 of file CastorDigiToRaw.cc.

References CastorPacker::Collections::castorCont, castorTag_, edm::EventSetup::get(), edm::Event::getByLabel(), edm::Event::id(), edm::InputTag::label(), CastorPacker::pack(), packer_, edm::Handle< T >::product(), edm::Event::put(), and cms::Exception::what().

00029 {
00030   CastorPacker::Collections colls;
00031 
00032   
00033   // Step A: Get Inputs 
00034   edm::Handle<CastorDigiCollection> castor;
00035   if (!castorTag_.label().empty()) {
00036     e.getByLabel(castorTag_,castor);
00037     colls.castorCont=castor.product();
00038   }
00039   // get the mapping
00040   edm::ESHandle<CastorDbService> pSetup;
00041   es.get<CastorDbRecord>().get( pSetup );
00042   const CastorElectronicsMap* readoutMap=pSetup->getCastorMapping();
00043   // Step B: Create empty output
00044   std::auto_ptr<FEDRawDataCollection> raw=std::auto_ptr<FEDRawDataCollection>(new FEDRawDataCollection());
00045 
00046 // change to this when getCastorFEDIds is added to FEDNumbering
00047 //  const int ifed_first=FEDNumbering::getCastorFEDIds().first;
00048 //  const int ifed_last=FEDNumbering::getCastorFEDIds().second;
00049   const int ifed_first=690;
00050   const int ifed_last=693;
00051 
00052   int orbitN=e.id().event();
00053   int bcnN=2000;
00054 
00055   // Step C: pack all requested FEDs
00056   for (int ifed=ifed_first; ifed<=ifed_last; ++ifed) {
00057     FEDRawData& fed = raw->FEDData(ifed);
00058     try {
00059       packer_.pack(ifed,ifed-ifed_first, e.id().event(),
00060                    orbitN, bcnN, colls, *readoutMap, fed);
00061     } catch (cms::Exception& e) {
00062       edm::LogWarning("Unpacking error") << e.what();
00063     } catch (...) {
00064       edm::LogWarning("Unpacking exception");
00065     }
00066   }
00067 
00068   e.put(raw);
00069 }


Member Data Documentation

edm::InputTag CastorDigiToRaw::calibTag_ [private]

Definition at line 34 of file CastorDigiToRaw.h.

edm::InputTag CastorDigiToRaw::castorTag_ [private]

Definition at line 34 of file CastorDigiToRaw.h.

Referenced by produce().

CastorPacker CastorDigiToRaw::packer_ [private]

Definition at line 33 of file CastorDigiToRaw.h.

Referenced by produce().

edm::InputTag CastorDigiToRaw::trigTag_ [private]

Definition at line 34 of file CastorDigiToRaw.h.


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