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

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

edm::EDGetTokenT< PEcalTBInfoecalTBInfo_
 
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 25 of file FakeTBHodoscopeRawInfoProducer.h.

Constructor & Destructor Documentation

◆ FakeTBHodoscopeRawInfoProducer()

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

Constructor.

Definition at line 12 of file FakeTBHodoscopeRawInfoProducer.cc.

12  {
13  ecalTBInfo_ = consumes<PEcalTBInfo>(edm::InputTag("EcalTBInfoLabel", "SimEcalTBG4Object"));
14  produces<EcalTBHodoscopeRawInfo>();
15 
17 }

◆ ~FakeTBHodoscopeRawInfoProducer()

FakeTBHodoscopeRawInfoProducer::~FakeTBHodoscopeRawInfoProducer ( )
override

Destructor.

Definition at line 19 of file FakeTBHodoscopeRawInfoProducer.cc.

19 { delete theTBHodoGeom_; }

Member Function Documentation

◆ produce()

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

Produce digis out of raw data.

Definition at line 21 of file FakeTBHodoscopeRawInfoProducer.cc.

21  {
22  unique_ptr<EcalTBHodoscopeRawInfo> product(new EcalTBHodoscopeRawInfo());
23 
24  // get the vertex information from the event
25 
26  edm::Handle<PEcalTBInfo> theEcalTBInfo;
27  event.getByToken(ecalTBInfo_, theEcalTBInfo);
28 
29  double partXhodo = theEcalTBInfo->evXbeam();
30  double partYhodo = theEcalTBInfo->evYbeam();
31 
32  LogDebug("EcalTBHodo") << "TB frame vertex (X,Y) for hodoscope simulation: \n"
33  << "x = " << partXhodo << " y = " << partYhodo;
34 
35  // for each hodoscope plane determine the fibre number corresponding
36  // to the event vertex coordinates in the TB reference frame
37  // plane 0/2 = x plane 1/3 = y
38 
39  int nPlanes = (int)theTBHodoGeom_->getNPlanes();
40  product->setPlanes(nPlanes);
41 
42  for (int iPlane = 0; iPlane < nPlanes; ++iPlane) {
43  float theCoord = (float)partXhodo;
44  if (iPlane == 1 || iPlane == 3)
45  theCoord = (float)partYhodo;
46 
47  vector<int> firedChannels = theTBHodoGeom_->getFiredFibresInPlane(theCoord, iPlane);
48  unsigned int nChannels = firedChannels.size();
49 
51  for (unsigned int i = 0; i < nChannels; ++i) {
52  planeHit.addHit(firedChannels[i]);
53  }
54 
55  product->setPlane((unsigned int)iPlane, planeHit);
56  }
57 
58  LogDebug("EcalTBHodo") << (*product);
59 
60  event.put(std::move(product));
61 }

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

Member Data Documentation

◆ ecalTBInfo_

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

Definition at line 39 of file FakeTBHodoscopeRawInfoProducer.h.

◆ theTBHodoGeom_

EcalTBHodoscopeGeometry* FakeTBHodoscopeRawInfoProducer::theTBHodoGeom_
private

Definition at line 37 of file FakeTBHodoscopeRawInfoProducer.h.

mps_fire.i
i
Definition: mps_fire.py:428
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
EcalTBHodoscopePlaneRawHits
Definition: EcalTBHodoscopePlaneRawHits.h:13
EcalTBHodoscopeGeometry
Definition: EcalTBHodoscopeGeometry.h:9
ecaldqm::nChannels
Definition: EcalDQMCommonUtils.h:113
edm::Handle
Definition: AssociativeIterator.h:50
PEcalTBInfo::evYbeam
double evYbeam() const
Definition: PEcalTBInfo.h:35
EcalTBHodoscopeGeometry::getFiredFibresInPlane
static std::vector< int > getFiredFibresInPlane(float xtr, int plane)
Definition: EcalTBHodoscopeGeometry.cc:328
FakeTBHodoscopeRawInfoProducer::ecalTBInfo_
edm::EDGetTokenT< PEcalTBInfo > ecalTBInfo_
Definition: FakeTBHodoscopeRawInfoProducer.h:39
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
EcalTBHodoscopeRawInfo
Definition: EcalTBHodoscopeRawInfo.h:13
createfilelist.int
int
Definition: createfilelist.py:10
eostools.move
def move(src, dest)
Definition: eostools.py:511
EcalTBHodoscopeGeometry::getNPlanes
static int getNPlanes()
Definition: EcalTBHodoscopeGeometry.cc:26
FakeTBHodoscopeRawInfoProducer::theTBHodoGeom_
EcalTBHodoscopeGeometry * theTBHodoGeom_
Definition: FakeTBHodoscopeRawInfoProducer.h:37
edm::InputTag
Definition: InputTag.h:15
PEcalTBInfo::evXbeam
double evXbeam() const
Definition: PEcalTBInfo.h:34