#include <CastorDigiToRaw.h>
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_ |
CastorCtdcPacker | ctdcpacker_ |
CastorPacker | packer_ |
edm::InputTag | trigTag_ |
bool | usingctdc_ |
CastorDigiToRaw is the EDProducer subclass which runs the Castor Unpack algorithm.
Definition at line 26 of file CastorDigiToRaw.h.
CastorDigiToRaw::CastorDigiToRaw | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 15 of file CastorDigiToRaw.cc.
: castorTag_(conf.getUntrackedParameter("CASTOR",edm::InputTag())), calibTag_(conf.getUntrackedParameter("CALIB",edm::InputTag())), trigTag_(conf.getUntrackedParameter("TRIG",edm::InputTag())), usingctdc_(conf.getUntrackedParameter<bool>("CastorCtdc",false)) { produces<FEDRawDataCollection>(); }
CastorDigiToRaw::~CastorDigiToRaw | ( | ) | [virtual] |
Definition at line 26 of file CastorDigiToRaw.cc.
{ }
void CastorDigiToRaw::produce | ( | edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 29 of file CastorDigiToRaw.cc.
References CastorCollections::castorCont, castorTag_, ctdcpacker_, edm::EventID::event(), edm::EventSetup::get(), edm::Event::getByLabel(), edm::EventBase::id(), edm::InputTag::label(), FEDNumbering::MAXCASTORFEDID, FEDNumbering::MINCASTORFEDID, CastorCtdcPacker::pack(), CastorPacker::pack(), packer_, edm::Handle< T >::product(), edm::Event::put(), runTheMatrix_dev::raw, usingctdc_, and cms::Exception::what().
{ CastorCollections colls; // Step A: Get Inputs edm::Handle<CastorDigiCollection> castor; if (!castorTag_.label().empty()) { e.getByLabel(castorTag_,castor); colls.castorCont=castor.product(); } // get the mapping edm::ESHandle<CastorDbService> pSetup; es.get<CastorDbRecord>().get( pSetup ); const CastorElectronicsMap* readoutMap=pSetup->getCastorMapping(); // Step B: Create empty output std::auto_ptr<FEDRawDataCollection> raw=std::auto_ptr<FEDRawDataCollection>(new FEDRawDataCollection()); const int ifed_first=FEDNumbering::MINCASTORFEDID; //690 const int ifed_last=FEDNumbering::MAXCASTORFEDID; //693 int orbitN=e.id().event(); int bcnN=2000; // Step C: pack all requested FEDs for (int ifed=ifed_first; ifed<=ifed_last; ++ifed) { FEDRawData& fed = raw->FEDData(ifed); try { if ( usingctdc_ ) { ctdcpacker_.pack(ifed,ifed-ifed_first, e.id().event(), orbitN, bcnN, colls, *readoutMap, fed); } else { packer_.pack(ifed,ifed-ifed_first, e.id().event(), orbitN, bcnN, colls, *readoutMap, fed); } } catch (cms::Exception& e) { edm::LogWarning("Unpacking error") << e.what(); } catch (...) { edm::LogWarning("Unpacking exception"); } } e.put(raw); }
edm::InputTag CastorDigiToRaw::calibTag_ [private] |
Definition at line 36 of file CastorDigiToRaw.h.
edm::InputTag CastorDigiToRaw::castorTag_ [private] |
Definition at line 36 of file CastorDigiToRaw.h.
Referenced by produce().
CastorCtdcPacker CastorDigiToRaw::ctdcpacker_ [private] |
Definition at line 35 of file CastorDigiToRaw.h.
Referenced by produce().
CastorPacker CastorDigiToRaw::packer_ [private] |
Definition at line 34 of file CastorDigiToRaw.h.
Referenced by produce().
edm::InputTag CastorDigiToRaw::trigTag_ [private] |
Definition at line 36 of file CastorDigiToRaw.h.
bool CastorDigiToRaw::usingctdc_ [private] |
Definition at line 37 of file CastorDigiToRaw.h.
Referenced by produce().