CMS 3D CMS Logo

Public Member Functions | Private Attributes

FakeTBEventHeaderProducer Class Reference

#include <FakeTBEventHeaderProducer.h>

Inheritance diagram for FakeTBEventHeaderProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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_

Detailed Description

Definition at line 27 of file FakeTBEventHeaderProducer.h.


Constructor & Destructor Documentation

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]

Destructor.

Definition at line 22 of file FakeTBEventHeaderProducer.cc.

{
}

Member Function Documentation

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);
  
}

Member Data Documentation

Definition at line 50 of file FakeTBEventHeaderProducer.h.