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::EDConsumerBase 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 ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

std::string ecalTBInfoLabel_
 
EcalTBHodoscopeGeometrytheTBHodoGeom_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 27 of file FakeTBHodoscopeRawInfoProducer.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 13 of file FakeTBHodoscopeRawInfoProducer.cc.

References edm::ParameterSet::getUntrackedParameter().

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

Destructor.

Definition at line 24 of file FakeTBHodoscopeRawInfoProducer.cc.

24  {
25 
26  delete theTBHodoGeom_;
27 
28 }

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 30 of file FakeTBHodoscopeRawInfoProducer.cc.

References EcalTBHodoscopePlaneRawHits::addHit(), i, LogDebug, and ecaldqm::nChannels.

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

Member Data Documentation

std::string FakeTBHodoscopeRawInfoProducer::ecalTBInfoLabel_
private

Definition at line 52 of file FakeTBHodoscopeRawInfoProducer.h.

EcalTBHodoscopeGeometry* FakeTBHodoscopeRawInfoProducer::theTBHodoGeom_
private

Definition at line 50 of file FakeTBHodoscopeRawInfoProducer.h.