12 doTimeSamples_ = myCfg_.
getParameter<
bool >(
"doTimeSamples");
13 if(myCfg_.exists(
"keV2fC")) keV2fC_ = myCfg_.getParameter<
double>(
"keV2fC");
17 cce_ = myCfg_.getParameter<
edm::ParameterSet>(
"chargeCollectionEfficiencies").
template getParameter<std::vector<double>>(
"values");
19 std::vector<double>().
swap(cce_);
22 if(myCfg_.existsAs<
double>(
"noise_fC")) {
24 noise_fC_[0] = myCfg_.getParameter<
double>(
"noise_fC");
25 }
else if ( myCfg_.existsAs<std::vector<double> >(
"noise_fC") ) {
26 const auto&
noises = myCfg_.getParameter<std::vector<double> >(
"noise_fC");
28 noise_fC_.reserve(
noises.size());
29 for(
auto noise :
noises ) { noise_fC_.push_back( noise ); }
31 const auto&
noises = myCfg_.getParameter<
edm::ParameterSet>(
"noise_fC").
template getParameter<std::vector<double> >(
"values");
33 noise_fC_.reserve(
noises.size());
34 for(
auto noise :
noises ) { noise_fC_.push_back( noise ); }
41 myFEelectronics_->SetNoiseValues(noise_fC_);
48 const std::unordered_set<DetId>& validIds,
50 CLHEP::HepRandomEngine* engine) {
51 if(digitizationType==0) runSimple(digiColl,simData,theGeom,validIds,engine);
52 else runDigitizer(digiColl,simData,theGeom,validIds,digitizationType,engine);
59 const std::unordered_set<DetId>& validIds,
60 CLHEP::HepRandomEngine* engine) {
68 for(
const auto&
id : validIds ) {
71 HGCSimHitDataAccumulator::iterator it = simData.find(
id);
72 HGCCellInfo& cell = ( simData.end() == it ? zeroData : it->second );
85 float totalCharge=rawCharge;
90 totalCharge +=
std::max( (
float)CLHEP::RandGaussQ::shoot(engine,0.0,cell.
size*noise_fC_[cell.
thickness-1]) , 0.f );
91 if(totalCharge<0.
f) totalCharge=0.f;
93 chargeColl[
i]= totalCharge;
97 DFr rawDataFrame(
id );
99 myFEelectronics_->runShaper(rawDataFrame, chargeColl, toa, cell.
thickness, engine, cce_[cell.
thickness-1]);
101 myFEelectronics_->runShaper(rawDataFrame, chargeColl, toa, cell.
thickness, engine);
104 updateOutput(coll,rawDataFrame);
110 const DFr& rawDataFrame) {
112 if(rawDataFrame.size()<=itIdx+2)
return;
114 DFr dataFrame( rawDataFrame.id() );
116 bool putInEvent(
false);
117 for(
int it=0;it<5; it++) {
118 dataFrame.setSample(it, rawDataFrame[itIdx-2+it]);
119 if(it==2) putInEvent = rawDataFrame[itIdx-2+it].threshold();
123 coll->push_back(dataFrame);
T getParameter(std::string const &) const
void runSimple(std::unique_ptr< DColl > &coll, hgc::HGCSimHitDataAccumulator &simData, const CaloSubdetectorGeometry *theGeom, const std::unordered_set< DetId > &validIds, CLHEP::HepRandomEngine *engine)
a trivial digitization: sum energies and digitize without noise
void updateOutput(std::unique_ptr< DColl > &coll, const DFr &rawDataFrame)
prepares the output according to the number of time samples to produce
void addCellMetadata(HGCCellInfo &info, const HcalGeometry *geom, const DetId &detid)
std::array< HGCSimHitData, 2 > hit_info
void swap(Association< C > &lhs, Association< C > &rhs)
std::array< HGCSimData_t, nSamples > HGCSimHitData
std::unordered_map< uint32_t, HGCCellInfo > HGCSimHitDataAccumulator
void run(std::unique_ptr< DColl > &digiColl, hgc::HGCSimHitDataAccumulator &simData, const CaloSubdetectorGeometry *theGeom, const std::unordered_set< DetId > &validIds, uint32_t digitizationType, CLHEP::HepRandomEngine *engine)
steer digitization mode
HGCDigitizerBase(const edm::ParameterSet &ps)
CTOR.
models the behavior of the front-end electronics