CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 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 24 of file FakeTBHodoscopeRawInfoProducer.cc.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 41 of file FakeTBHodoscopeRawInfoProducer.cc.

References ecalTBInfo_, HLT_FULL_cff::InputTag, and theTBHodoGeom_.

41  {
42  ecalTBInfo_ = consumes<PEcalTBInfo>(edm::InputTag("EcalTBInfoLabel", "SimEcalTBG4Object"));
43  produces<EcalTBHodoscopeRawInfo>();
44 
46 }
edm::EDGetTokenT< PEcalTBInfo > ecalTBInfo_
FakeTBHodoscopeRawInfoProducer::~FakeTBHodoscopeRawInfoProducer ( )
override

Destructor.

Definition at line 48 of file FakeTBHodoscopeRawInfoProducer.cc.

References theTBHodoGeom_.

48 { delete theTBHodoGeom_; }

Member Function Documentation

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

Member Data Documentation

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

Definition at line 38 of file FakeTBHodoscopeRawInfoProducer.cc.

Referenced by FakeTBHodoscopeRawInfoProducer(), and produce().

EcalTBHodoscopeGeometry* FakeTBHodoscopeRawInfoProducer::theTBHodoGeom_
private