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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

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
 

Detailed Description

Definition at line 26 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  ecalTBInfo_ = consumes<PEcalTBInfo>(edm::InputTag("EcalTBInfoLabel", "SimEcalTBG4Object"));
14  produces<EcalTBHodoscopeRawInfo>();
15 
17 }
edm::EDGetTokenT< PEcalTBInfo > ecalTBInfo_
FakeTBHodoscopeRawInfoProducer::~FakeTBHodoscopeRawInfoProducer ( )
override

Destructor.

Definition at line 19 of file FakeTBHodoscopeRawInfoProducer.cc.

19 { 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 21 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.

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 
50  EcalTBHodoscopePlaneRawHits planeHit(nChannels);
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 }
#define LogDebug(id)
edm::EDGetTokenT< PEcalTBInfo > ecalTBInfo_
static std::vector< int > getFiredFibresInPlane(float xtr, int plane)
double evXbeam() const
Definition: PEcalTBInfo.h:34
double evYbeam() const
Definition: PEcalTBInfo.h:35
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

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

Definition at line 40 of file FakeTBHodoscopeRawInfoProducer.h.

EcalTBHodoscopeGeometry* FakeTBHodoscopeRawInfoProducer::theTBHodoGeom_
private

Definition at line 38 of file FakeTBHodoscopeRawInfoProducer.h.