CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
FakeTBHodoscopeRawInfoProducer Class Reference

#include <FakeTBHodoscopeRawInfoProducer.h>

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

Public Member Functions

 FakeTBHodoscopeRawInfoProducer (const edm::ParameterSet &ps)
 Constructor. More...
 
void produce (edm::Event &event, const edm::EventSetup &eventSetup)
 Produce digis out of raw data. More...
 
virtual ~FakeTBHodoscopeRawInfoProducer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

std::string ecalTBInfoLabel_
 
EcalTBHodoscopeGeometrytheTBHodoGeom_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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 edm::ParameterSet::getUntrackedParameter().

14  {
15 
16  produces<EcalTBHodoscopeRawInfo>();
17 
18  ecalTBInfoLabel_ = ps.getUntrackedParameter<string>("EcalTBInfoLabel","SimEcalTBG4Object");
19 
21 
22 }
T getUntrackedParameter(std::string const &, T const &) const
FakeTBHodoscopeRawInfoProducer::~FakeTBHodoscopeRawInfoProducer ( )
virtual

Destructor.

Definition at line 25 of file FakeTBHodoscopeRawInfoProducer.cc.

25  {
26 
27  delete theTBHodoGeom_;
28 
29 }

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(), ExpressReco_HICollisions_FallBack::EcalTBHodoscopeRawInfo, i, and LogDebug.

32 {
33  auto_ptr<EcalTBHodoscopeRawInfo> product(new EcalTBHodoscopeRawInfo());
34 
35  // get the vertex information from the event
36 
37  edm::Handle<PEcalTBInfo> theEcalTBInfo;
38  event.getByLabel(ecalTBInfoLabel_,theEcalTBInfo);
39 
40  double partXhodo = theEcalTBInfo->evXbeam();
41  double partYhodo = theEcalTBInfo->evYbeam();
42 
43  LogDebug("EcalTBHodo") << "TB frame vertex (X,Y) for hodoscope simulation: \n"
44  << "x = " << partXhodo << " y = " << partYhodo;
45 
46  // for each hodoscope plane determine the fibre number corresponding
47  // to the event vertex coordinates in the TB reference frame
48  // plane 0/2 = x plane 1/3 = y
49 
50  int nPlanes = (int)theTBHodoGeom_->getNPlanes();
51  product->setPlanes(nPlanes);
52 
53  for ( int iPlane = 0 ; iPlane < nPlanes ; ++iPlane) {
54 
55  float theCoord = (float)partXhodo;
56  if (iPlane == 1 || iPlane == 3) theCoord = (float)partYhodo;
57 
58  vector<int> firedChannels = theTBHodoGeom_->getFiredFibresInPlane(theCoord, iPlane);
59  unsigned int nChannels = firedChannels.size();
60 
61  EcalTBHodoscopePlaneRawHits planeHit(nChannels);
62  for ( unsigned int i = 0 ; i < nChannels ; ++i ) {
63  planeHit.addHit(firedChannels[i]);
64  }
65 
66  product->setPlane((unsigned int)iPlane, planeHit);
67 
68  }
69 
70  LogDebug("EcalTBHodo") << (*product);
71 
72  event.put(product);
73 
74 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
std::vector< int > getFiredFibresInPlane(const float &xtr, const int &plane) const

Member Data Documentation

std::string FakeTBHodoscopeRawInfoProducer::ecalTBInfoLabel_
private

Definition at line 54 of file FakeTBHodoscopeRawInfoProducer.h.

EcalTBHodoscopeGeometry* FakeTBHodoscopeRawInfoProducer::theTBHodoGeom_
private

Definition at line 52 of file FakeTBHodoscopeRawInfoProducer.h.