SimCalorimetry
CastorSim
src
CastorElectronicsSim.cc
Go to the documentation of this file.
1
#include "
DataFormats/HcalDigi/interface/CastorDataFrame.h
"
2
#include "
SimCalorimetry/CastorSim/src/CastorAmplifier.h
"
3
#include "
SimCalorimetry/CastorSim/src/CastorCoderFactory.h
"
4
#include "
SimCalorimetry/CastorSim/src/CastorElectronicsSim.h
"
5
6
#include "CLHEP/Random/RandFlat.h"
7
8
CastorElectronicsSim::CastorElectronicsSim
(
CastorAmplifier
*amplifier,
const
CastorCoderFactory
*coderFactory)
9
: theAmplifier(amplifier), theCoderFactory(coderFactory), theStartingCapId(0) {}
10
11
CastorElectronicsSim::~CastorElectronicsSim
() {}
12
13
template
<
class
Digi>
14
void
CastorElectronicsSim::convert
(
CaloSamples
&
frame
,
Digi
&
result
, CLHEP::HepRandomEngine *engine) {
15
result
.setSize(
frame
.size());
16
theAmplifier
->
amplify
(
frame
, engine);
17
theCoderFactory
->
coder
(
frame
.id())->fC2adc(
frame
,
result
,
theStartingCapId
);
18
}
19
20
void
CastorElectronicsSim::analogToDigital
(CLHEP::HepRandomEngine *engine,
CaloSamples
&lf,
CastorDataFrame
&
result
) {
21
convert<CastorDataFrame>(lf,
result
, engine);
22
}
23
24
void
CastorElectronicsSim::newEvent
(CLHEP::HepRandomEngine *engine) {
25
// pick a new starting Capacitor ID
26
theStartingCapId
= CLHEP::RandFlat::shootInt(engine, 4);
27
theAmplifier
->
setStartingCapId
(
theStartingCapId
);
28
}
CastorDataFrame.h
CastorElectronicsSim::theAmplifier
CastorAmplifier * theAmplifier
Definition:
CastorElectronicsSim.h:33
TrendClient_cfi.Digi
Digi
Definition:
TrendClient_cfi.py:7
CastorElectronicsSim.h
CastorElectronicsSim::theCoderFactory
const CastorCoderFactory * theCoderFactory
Definition:
CastorElectronicsSim.h:34
CastorCoderFactory::coder
std::unique_ptr< CastorCoder > coder(const DetId &detId) const
user gets control of the pointer
Definition:
CastorCoderFactory.cc:7
CastorElectronicsSim::theStartingCapId
int theStartingCapId
Definition:
CastorElectronicsSim.h:36
CastorAmplifier::setStartingCapId
void setStartingCapId(int capId)
Definition:
CastorAmplifier.h:23
CastorElectronicsSim::~CastorElectronicsSim
~CastorElectronicsSim()
Definition:
CastorElectronicsSim.cc:11
CastorDataFrame
Definition:
CastorDataFrame.h:15
CastorElectronicsSim::analogToDigital
void analogToDigital(CLHEP::HepRandomEngine *, CaloSamples &linearFrame, CastorDataFrame &result)
Definition:
CastorElectronicsSim.cc:20
CastorElectronicsSim::newEvent
void newEvent(CLHEP::HepRandomEngine *)
Things that need to be initialized every event.
Definition:
CastorElectronicsSim.cc:24
CaloSamples
Definition:
CaloSamples.h:14
CastorAmplifier
Definition:
CastorAmplifier.h:13
CastorAmplifier::amplify
virtual void amplify(CaloSamples &linearFrame, CLHEP::HepRandomEngine *) const
Definition:
CastorAmplifier.cc:19
CastorCoderFactory
Definition:
CastorCoderFactory.h:8
amptDefault_cfi.frame
frame
Definition:
amptDefault_cfi.py:12
CastorElectronicsSim::convert
void convert(CaloSamples &frame, Digi &result, CLHEP::HepRandomEngine *)
Definition:
CastorElectronicsSim.cc:14
CastorAmplifier.h
CastorCoderFactory.h
mps_fire.result
result
Definition:
mps_fire.py:303
CastorElectronicsSim::CastorElectronicsSim
CastorElectronicsSim(CastorAmplifier *amplifier, const CastorCoderFactory *coderFactory)
Definition:
CastorElectronicsSim.cc:8
Generated for CMSSW Reference Manual by
1.8.16