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 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 ( )
override

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.