CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
FakeTBHodoscopeRawInfoProducer Class Reference
Inheritance diagram for FakeTBHodoscopeRawInfoProducer:
edm::stream::EDProducer<>

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...
 
 ~FakeTBHodoscopeRawInfoProducer () override=default
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

const edm::EDGetTokenT< PEcalTBInfoecalTBInfo_
 
std::unique_ptr< EcalTBHodoscopeGeometrytheTBHodoGeom_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 26 of file FakeTBHodoscopeRawInfoProducer.cc.

Constructor & Destructor Documentation

◆ FakeTBHodoscopeRawInfoProducer()

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

Constructor.

Definition at line 43 of file FakeTBHodoscopeRawInfoProducer.cc.

References theTBHodoGeom_.

44  : ecalTBInfo_(consumes<PEcalTBInfo>(edm::InputTag("EcalTBInfoLabel", "SimEcalTBG4Object"))) {
45  produces<EcalTBHodoscopeRawInfo>();
46 
47  theTBHodoGeom_ = std::make_unique<EcalTBHodoscopeGeometry>();
48 }
const edm::EDGetTokenT< PEcalTBInfo > ecalTBInfo_
std::unique_ptr< EcalTBHodoscopeGeometry > theTBHodoGeom_

◆ ~FakeTBHodoscopeRawInfoProducer()

FakeTBHodoscopeRawInfoProducer::~FakeTBHodoscopeRawInfoProducer ( )
overridedefault

Destructor.

Member Function Documentation

◆ produce()

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

Produce digis out of raw data.

Definition at line 50 of file FakeTBHodoscopeRawInfoProducer.cc.

References EcalTBHodoscopePlaneRawHits::addHit(), ecalTBInfo_, PEcalTBInfo::evXbeam(), PEcalTBInfo::evYbeam(), ALCARECOEcalPhiSym_cff::float, mps_fire::i, LogDebug, eostools::move(), ecaldqm::nChannels, and theTBHodoGeom_.

50  {
51  std::unique_ptr<EcalTBHodoscopeRawInfo> product(new EcalTBHodoscopeRawInfo());
52 
53  // get the vertex information from the event
54 
55  const edm::Handle<PEcalTBInfo> &theEcalTBInfo = event.getHandle(ecalTBInfo_);
56 
57  double partXhodo = theEcalTBInfo->evXbeam();
58  double partYhodo = theEcalTBInfo->evYbeam();
59 
60  LogDebug("EcalTBHodo") << "TB frame vertex (X,Y) for hodoscope simulation: \n"
61  << "x = " << partXhodo << " y = " << partYhodo;
62 
63  // for each hodoscope plane determine the fibre number corresponding
64  // to the event vertex coordinates in the TB reference frame
65  // plane 0/2 = x plane 1/3 = y
66 
67  int nPlanes = static_cast<int>(theTBHodoGeom_->getNPlanes());
68  product->setPlanes(nPlanes);
69 
70  for (int iPlane = 0; iPlane < nPlanes; ++iPlane) {
71  float theCoord = (float)partXhodo;
72  if (iPlane == 1 || iPlane == 3)
73  theCoord = (float)partYhodo;
74 
75  std::vector<int> firedChannels = theTBHodoGeom_->getFiredFibresInPlane(theCoord, iPlane);
76  unsigned int nChannels = firedChannels.size();
77 
79  for (unsigned int i = 0; i < nChannels; ++i) {
80  planeHit.addHit(firedChannels[i]);
81  }
82 
83  product->setPlane(static_cast<unsigned int>(iPlane), planeHit);
84  }
85 
86  LogDebug("EcalTBHodo") << (*product);
87 
88  event.put(std::move(product));
89 }
double evYbeam() const
Definition: PEcalTBInfo.h:35
const edm::EDGetTokenT< PEcalTBInfo > ecalTBInfo_
static constexpr int nChannels
std::unique_ptr< EcalTBHodoscopeGeometry > theTBHodoGeom_
double evXbeam() const
Definition: PEcalTBInfo.h:34
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

Member Data Documentation

◆ ecalTBInfo_

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

Definition at line 40 of file FakeTBHodoscopeRawInfoProducer.cc.

Referenced by produce().

◆ theTBHodoGeom_

std::unique_ptr<EcalTBHodoscopeGeometry> FakeTBHodoscopeRawInfoProducer::theTBHodoGeom_
private

Definition at line 38 of file FakeTBHodoscopeRawInfoProducer.cc.

Referenced by FakeTBHodoscopeRawInfoProducer(), and produce().