CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
FakeTBHodoscopeRawInfoProducer Class Reference

#include <FakeTBHodoscopeRawInfoProducer.h>

Inheritance diagram for FakeTBHodoscopeRawInfoProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase 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) override
 Produce digis out of raw data. More...
 
virtual ~FakeTBHodoscopeRawInfoProducer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::EDGetTokenT< PEcalTBInfoecalTBInfo_
 
EcalTBHodoscopeGeometrytheTBHodoGeom_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase 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::stream::EDProducerBase
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)
explicit

Constructor.

Definition at line 12 of file FakeTBHodoscopeRawInfoProducer.cc.

12  {
13 
14  ecalTBInfo_ = consumes<PEcalTBInfo>(edm::InputTag("EcalTBInfoLabel","SimEcalTBG4Object"));
15  produces<EcalTBHodoscopeRawInfo>();
16 
18 }
edm::EDGetTokenT< PEcalTBInfo > ecalTBInfo_
FakeTBHodoscopeRawInfoProducer::~FakeTBHodoscopeRawInfoProducer ( )
virtual

Destructor.

Definition at line 20 of file FakeTBHodoscopeRawInfoProducer.cc.

20  {
21 
22  delete theTBHodoGeom_;
23 
24 }

Member Function Documentation

void FakeTBHodoscopeRawInfoProducer::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
override

Produce digis out of raw data.

Definition at line 26 of file FakeTBHodoscopeRawInfoProducer.cc.

References EcalTBHodoscopePlaneRawHits::addHit(), PEcalTBInfo::evXbeam(), PEcalTBInfo::evYbeam(), objects.autophobj::float, mps_fire::i, createfilelist::int, LogDebug, eostools::move(), and ecaldqm::nChannels.

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

Member Data Documentation

edm::EDGetTokenT<PEcalTBInfo> FakeTBHodoscopeRawInfoProducer::ecalTBInfo_
private

Definition at line 44 of file FakeTBHodoscopeRawInfoProducer.h.

EcalTBHodoscopeGeometry* FakeTBHodoscopeRawInfoProducer::theTBHodoGeom_
private

Definition at line 42 of file FakeTBHodoscopeRawInfoProducer.h.