15 #include <phparameter/PHParameters.h>
25 #include <gsl/gsl_cdf.h>
26 #include <gsl/gsl_randist.h>
27 #include <gsl/gsl_rng.h>
42 , m_DigiAlgorithm(kNo_digitization)
43 , m_SimTowers(nullptr)
44 , m_RawTowers(nullptr)
45 , m_RawTowerGeom(nullptr)
48 , m_SimTowerNodePrefix(
"SIM")
49 , m_RawTowerNodePrefix(
"RAW")
50 , m_PhotonElecYieldVisibleGeV(NAN)
51 , m_PhotonElecADC(NAN)
52 , m_PedestalCentralADC(NAN)
53 , m_PedestalWidthADC(NAN)
54 , m_pedestalFile(
false)
55 , m_ZeroSuppressionADC(-1000)
56 , m_ZeroSuppressionFile(
false)
58 , m_SiPMEffectivePixel(40000 * 4)
87 cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
88 <<
"DST Node missing, doing nothing." << endl;
96 catch (std::exception &
e)
98 cout << e.what() << endl;
108 cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
109 <<
"Process event entered. "
110 <<
"Digitalization method: ";
114 cout <<
"directly pass the energy of sim tower to digitalized tower";
118 cout <<
"simple digitization with photon statistics, ADC conversion and pedestal";
126 double deadChanEnergy = 0;
129 it != all_towers.second; ++
it)
133 const int eta =
it->second->get_bineta();
134 const int phi =
it->second->get_binphi();
135 const int twr =
it->second->get_binl();
165 if (sim_tower) deadChanEnergy += sim_tower->
get_energy();
171 cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
172 <<
" apply dead tower " << key << endl;
199 cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
212 cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
222 cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
224 <<
", dead channel masked energy = " << deadChanEnergy <<
" GeV"
246 const int sum_ADC = signal_ADC + (
int) pedestal;
264 cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
274 cout <<
"None" << endl;
276 cout <<
"output based on "
277 <<
"sum_ADC = " << sum_ADC <<
", zero_sup = "
285 cout <<
"None" << endl;
309 const double prob_activated_per_pixel = gsl_cdf_poisson_Q(0, poission_param_per_pixel);
315 const int sum_ADC = signal_ADC + (
int) pedestal;
333 cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
343 cout <<
"None" << endl;
345 cout <<
"output based on "
346 <<
"sum_ADC = " << sum_ADC <<
", zero_sup = "
354 cout <<
"None" << endl;
367 cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
368 <<
"Run Node missing, doing nothing." << endl;
369 throw std::runtime_error(
370 "Failed to find Run node in RawTowerZDCDigitizer::CreateNodes");
373 string TowerGeomNodeName =
"TOWERGEOM_" +
m_Detector;
374 m_RawTowerGeom = findNode::getClass<RawTowerZDCGeomContainer>(topNode, TowerGeomNodeName);
377 cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
378 <<
" " << TowerGeomNodeName <<
" Node missing, doing bail out!"
380 throw std::runtime_error(
"Failed to find " + TowerGeomNodeName +
" node in RawTowerZDCDigitizer::CreateNodes");
388 const string deadMapName =
"DEADMAP_" +
m_Detector;
389 m_DeadMap = findNode::getClass<RawTowerZDCDeadMap>(topNode, deadMapName);
392 cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
393 <<
" use dead map: ";
400 cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
401 <<
"DST Node missing, doing nothing." << endl;
402 throw std::runtime_error(
"Failed to find DST node in RawTowerZDCDigitizer::CreateNodes");
406 m_SimTowers = findNode::getClass<RawTowerZDCContainer>(dstNode, SimTowerNodeName);
409 cout <<
Name() <<
"::" << m_Detector <<
"::" << __PRETTY_FUNCTION__
410 <<
" " << SimTowerNodeName <<
" Node missing, doing bail out!"
412 throw std::runtime_error(
"Failed to find " + SimTowerNodeName +
" node in RawTowerZDCDigitizer::CreateNodes");
421 dstNode->addNode(DetNode);
426 m_RawTowers = findNode::getClass<RawTowerZDCContainer>(DetNode, RawTowerNodeName);
431 RawTowerNodeName,
"PHObject");
432 DetNode->addNode(towerNode);