#include <FakeTBHodoscopeRawInfoProducer.h>
Public Member Functions | |
FakeTBHodoscopeRawInfoProducer (const edm::ParameterSet &ps) | |
Constructor. | |
void | produce (edm::Event &event, const edm::EventSetup &eventSetup) |
Produce digis out of raw data. | |
virtual | ~FakeTBHodoscopeRawInfoProducer () |
Destructor. | |
Private Attributes | |
std::string | ecalTBInfoLabel_ |
EcalTBHodoscopeGeometry * | theTBHodoGeom_ |
Definition at line 28 of file FakeTBHodoscopeRawInfoProducer.h.
FakeTBHodoscopeRawInfoProducer::FakeTBHodoscopeRawInfoProducer | ( | const edm::ParameterSet & | ps | ) |
Constructor.
Definition at line 14 of file FakeTBHodoscopeRawInfoProducer.cc.
References edm::ParameterSet::getUntrackedParameter().
{ produces<EcalTBHodoscopeRawInfo>(); ecalTBInfoLabel_ = ps.getUntrackedParameter<string>("EcalTBInfoLabel","SimEcalTBG4Object"); theTBHodoGeom_ = new EcalTBHodoscopeGeometry(); }
FakeTBHodoscopeRawInfoProducer::~FakeTBHodoscopeRawInfoProducer | ( | ) | [virtual] |
Destructor.
Definition at line 25 of file FakeTBHodoscopeRawInfoProducer.cc.
{ delete theTBHodoGeom_; }
void FakeTBHodoscopeRawInfoProducer::produce | ( | edm::Event & | event, |
const edm::EventSetup & | eventSetup | ||
) | [virtual] |
Produce digis out of raw data.
Implements edm::EDProducer.
Definition at line 31 of file FakeTBHodoscopeRawInfoProducer.cc.
References EcalTBHodoscopePlaneRawHits::addHit(), i, and LogDebug.
{ auto_ptr<EcalTBHodoscopeRawInfo> product(new EcalTBHodoscopeRawInfo()); // get the vertex information from the event edm::Handle<PEcalTBInfo> theEcalTBInfo; event.getByLabel(ecalTBInfoLabel_,theEcalTBInfo); double partXhodo = theEcalTBInfo->evXbeam(); double partYhodo = theEcalTBInfo->evYbeam(); LogDebug("EcalTBHodo") << "TB frame vertex (X,Y) for hodoscope simulation: \n" << "x = " << partXhodo << " y = " << partYhodo; // for each hodoscope plane determine the fibre number corresponding // to the event vertex coordinates in the TB reference frame // plane 0/2 = x plane 1/3 = y int nPlanes = (int)theTBHodoGeom_->getNPlanes(); product->setPlanes(nPlanes); for ( int iPlane = 0 ; iPlane < nPlanes ; ++iPlane) { float theCoord = (float)partXhodo; if (iPlane == 1 || iPlane == 3) theCoord = (float)partYhodo; vector<int> firedChannels = theTBHodoGeom_->getFiredFibresInPlane(theCoord, iPlane); unsigned int nChannels = firedChannels.size(); EcalTBHodoscopePlaneRawHits planeHit(nChannels); for ( unsigned int i = 0 ; i < nChannels ; ++i ) { planeHit.addHit(firedChannels[i]); } product->setPlane((unsigned int)iPlane, planeHit); } LogDebug("EcalTBHodo") << (*product); event.put(product); }
std::string FakeTBHodoscopeRawInfoProducer::ecalTBInfoLabel_ [private] |
Definition at line 53 of file FakeTBHodoscopeRawInfoProducer.h.
Definition at line 51 of file FakeTBHodoscopeRawInfoProducer.h.