CMS 3D CMS Logo

FakeTBHodoscopeRawInfoProducer Class Reference

#include <SimG4CMS/EcalTestBeam/interface/FakeTBHodoscopeRawInfoProducer.h>

Inheritance diagram for FakeTBHodoscopeRawInfoProducer:

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

List of all members.

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_
EcalTBHodoscopeGeometrytheTBHodoGeom_


Detailed Description

Definition at line 29 of file FakeTBHodoscopeRawInfoProducer.h.


Constructor & Destructor Documentation

FakeTBHodoscopeRawInfoProducer::FakeTBHodoscopeRawInfoProducer ( const edm::ParameterSet ps  ) 

Constructor.

Definition at line 14 of file FakeTBHodoscopeRawInfoProducer.cc.

References ecalTBInfoLabel_, edm::ParameterSet::getUntrackedParameter(), and theTBHodoGeom_.

00014                                                                                         {
00015   
00016   produces<EcalTBHodoscopeRawInfo>();
00017 
00018   ecalTBInfoLabel_ = ps.getUntrackedParameter<string>("EcalTBInfoLabel","SimEcalTBG4Object");
00019 
00020   theTBHodoGeom_ = new EcalTBHodoscopeGeometry();
00021 
00022 }

FakeTBHodoscopeRawInfoProducer::~FakeTBHodoscopeRawInfoProducer (  )  [virtual]

Destructor.

Definition at line 25 of file FakeTBHodoscopeRawInfoProducer.cc.

References theTBHodoGeom_.

00025                                                                 {
00026 
00027   delete theTBHodoGeom_;
00028 
00029 }


Member Function Documentation

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(), ecalTBInfoLabel_, EcalTBHodoscopeGeometry::getFiredFibresInPlane(), EcalTBHodoscopeGeometry::getNPlanes(), i, int, LogDebug, theEcalTBInfo, and theTBHodoGeom_.

00032 {
00033   auto_ptr<EcalTBHodoscopeRawInfo> product(new EcalTBHodoscopeRawInfo());
00034 
00035   // get the vertex information from the event
00036 
00037   edm::Handle<PEcalTBInfo> theEcalTBInfo;
00038   event.getByLabel(ecalTBInfoLabel_,theEcalTBInfo);
00039 
00040   double partXhodo = theEcalTBInfo->evXbeam();
00041   double partYhodo = theEcalTBInfo->evYbeam();
00042 
00043   LogDebug("EcalTBHodo") << "TB frame vertex (X,Y) for hodoscope simulation: \n" 
00044                          << "x = " << partXhodo << " y = " << partYhodo;
00045   
00046   // for each hodoscope plane determine the fibre number corresponding 
00047   // to the event vertex coordinates in the TB reference frame
00048   // plane 0/2 = x plane 1/3 = y
00049   
00050   int nPlanes = (int)theTBHodoGeom_->getNPlanes();
00051   product->setPlanes(nPlanes);
00052   
00053   for ( int iPlane = 0 ; iPlane < nPlanes ; ++iPlane) {
00054     
00055     float theCoord = (float)partXhodo;
00056     if (iPlane == 1 || iPlane == 3) theCoord = (float)partYhodo;
00057     
00058     vector<int> firedChannels = theTBHodoGeom_->getFiredFibresInPlane(theCoord, iPlane);
00059     unsigned int nChannels = firedChannels.size();
00060     
00061     EcalTBHodoscopePlaneRawHits planeHit(nChannels);
00062     for ( unsigned int i = 0 ; i < nChannels ; ++i ) {
00063       planeHit.addHit(firedChannels[i]);
00064     }
00065     
00066     product->setPlane((unsigned int)iPlane, planeHit);
00067     
00068   }
00069 
00070   LogDebug("EcalTBHodo") << (*product);
00071   
00072   event.put(product);
00073   
00074 }


Member Data Documentation

std::string FakeTBHodoscopeRawInfoProducer::ecalTBInfoLabel_ [private]

Definition at line 54 of file FakeTBHodoscopeRawInfoProducer.h.

Referenced by FakeTBHodoscopeRawInfoProducer(), and produce().

EcalTBHodoscopeGeometry* FakeTBHodoscopeRawInfoProducer::theTBHodoGeom_ [private]

Definition at line 52 of file FakeTBHodoscopeRawInfoProducer.h.

Referenced by FakeTBHodoscopeRawInfoProducer(), produce(), and ~FakeTBHodoscopeRawInfoProducer().


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