CMS 3D CMS Logo

FakeTBHodoscopeRawInfoProducer.cc
Go to the documentation of this file.
1 /*
2  * \file FakeTBHodoscopeRawInfoProducer.cc
3  *
4  *
5  */
6 
8 
9 using namespace cms;
10 using namespace std;
11 
13  ecalTBInfo_ = consumes<PEcalTBInfo>(edm::InputTag("EcalTBInfoLabel", "SimEcalTBG4Object"));
14  produces<EcalTBHodoscopeRawInfo>();
15 
16  theTBHodoGeom_ = new EcalTBHodoscopeGeometry();
17 }
18 
20 
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 }
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:114
edm::Handle
Definition: AssociativeIterator.h:50
PEcalTBInfo::evYbeam
double evYbeam() const
Definition: PEcalTBInfo.h:35
FakeTBHodoscopeRawInfoProducer::produce
void produce(edm::Event &event, const edm::EventSetup &eventSetup) override
Produce digis out of raw data.
Definition: FakeTBHodoscopeRawInfoProducer.cc:21
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
edm::ParameterSet
Definition: ParameterSet.h:47
EcalTBHodoscopeRawInfo
Definition: EcalTBHodoscopeRawInfo.h:13
EcalTBHodoscopePlaneRawHits::addHit
void addHit(unsigned int i)
Definition: EcalTBHodoscopePlaneRawHits.h:41
createfilelist.int
int
Definition: createfilelist.py:10
edm::EventSetup
Definition: EventSetup.h:57
FakeTBHodoscopeRawInfoProducer.h
FakeTBHodoscopeRawInfoProducer::FakeTBHodoscopeRawInfoProducer
FakeTBHodoscopeRawInfoProducer(const edm::ParameterSet &ps)
Constructor.
Definition: FakeTBHodoscopeRawInfoProducer.cc:12
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
PEcalTBInfo::evXbeam
double evXbeam() const
Definition: PEcalTBInfo.h:34
FakeTBHodoscopeRawInfoProducer::~FakeTBHodoscopeRawInfoProducer
~FakeTBHodoscopeRawInfoProducer() override
Destructor.
Definition: FakeTBHodoscopeRawInfoProducer.cc:19
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21