#include <FakeTBEventHeaderProducer.h>
Public Member Functions | |
FakeTBEventHeaderProducer (const edm::ParameterSet &ps) | |
Constructor. | |
void | produce (edm::Event &event, const edm::EventSetup &eventSetup) |
Produce digis out of raw data. | |
virtual | ~FakeTBEventHeaderProducer () |
Destructor. | |
Private Attributes | |
std::string | ecalTBInfoLabel_ |
Definition at line 27 of file FakeTBEventHeaderProducer.h.
FakeTBEventHeaderProducer::FakeTBEventHeaderProducer | ( | const edm::ParameterSet & | ps | ) |
Constructor.
Definition at line 15 of file FakeTBEventHeaderProducer.cc.
References edm::ParameterSet::getUntrackedParameter().
{ produces<EcalTBEventHeader>(); ecalTBInfoLabel_ = ps.getUntrackedParameter<string>("EcalTBInfoLabel","SimEcalTBG4Object"); }
FakeTBEventHeaderProducer::~FakeTBEventHeaderProducer | ( | ) | [virtual] |
void FakeTBEventHeaderProducer::produce | ( | edm::Event & | event, |
const edm::EventSetup & | eventSetup | ||
) | [virtual] |
Produce digis out of raw data.
Implements edm::EDProducer.
Definition at line 26 of file FakeTBEventHeaderProducer.cc.
References edm::EventID::event(), edm::EventBase::id(), edm::HandleBase::isValid(), PEcalTBInfo::nCrystal(), edm::Handle< T >::product(), edm::EventID::run(), and EBDetId::SMCRYSTALMODE.
{ auto_ptr<EcalTBEventHeader> product(new EcalTBEventHeader()); // get the vertex information from the event const PEcalTBInfo* theEcalTBInfo=0; edm::Handle<PEcalTBInfo> EcalTBInfo; event.getByLabel(ecalTBInfoLabel_,EcalTBInfo); if (EcalTBInfo.isValid()){ theEcalTBInfo = EcalTBInfo.product(); } else { edm::LogError("FakeTBEventHeaderProducer") << "Error! can't get the product " << ecalTBInfoLabel_.c_str() ; } if (!theEcalTBInfo) return; product->setEventNumber(event.id().event()); product->setRunNumber(event.id().run()); product->setBurstNumber(1); product->setTriggerMask(0x1); product->setCrystalInBeam(EBDetId(1,theEcalTBInfo->nCrystal(),EBDetId::SMCRYSTALMODE)); // LogDebug("FakeTBHeader") << (*product); // LogDebug("FakeTBHeader") << (*product).eventType(); // LogDebug("FakeTBHeader") << (*product).crystalInBeam(); event.put(product); }
std::string FakeTBEventHeaderProducer::ecalTBInfoLabel_ [private] |
Definition at line 50 of file FakeTBEventHeaderProducer.h.