46{
48
51 }
52
53
55 std::vector<float>::const_iterator pBegin(rProp.begin());
56 std::vector<float>::const_iterator pEnd(rProp.end());
58
60 {
62 return StatusCode::FAILURE;
63 }
64
65
69 }
70
72
76 }
78
79 int sinceFilled=0;
80
82 if (rProp[i]>0) sinceFilled=0;
83 else sinceFilled+=1;
84 }
85
87 if (rProp[i]>0){
88
89 sinceFilled=0;
92
93 sinceFilled+=1;
95 } else {
96
97 sinceFilled+=1;
99 }
100 }
101 }
102
103
104 float nonZeroElementCount(
static_cast<float>(std::count_if(pBegin, pEnd,
IsNonZero)));
105 if(nonZeroElementCount<1.0)
106 {
108 return StatusCode::FAILURE;
109 }
110 float elementSum(static_cast<float>(std::accumulate(pBegin, pEnd,0.0)));
112
113
114 float maxElement(*(std::max_element(pBegin, pEnd)));
115 float inv_maxElement = maxElement != 0 ? 1. / maxElement : 1;
116
117
121 {
122 if (rProp[i]<0.0)
123 {
124 ATH_MSG_ERROR(
"All IntensityPattern elements must be >=0. Please fix element #" << i );
125 return StatusCode::FAILURE;
126 }
128 }
129
132 }
133
134
135
136 if (denominator != 0) {
138 }
139
140
141
142
145
148 1);
149 } else {
151 std::make_unique<std::discrete_distribution<unsigned int>>(
153 }
154 return StatusCode::SUCCESS;
155}
#define ATH_CHECK
Evaluate an expression and check for errors.
static bool IsNonZero(float lumi)
Gaudi::Property< std::uint64_t > m_seed
seed for FastReseededPRNG. Non-zero switches to using FastReseededPRNG.
std::unique_ptr< std::discrete_distribution< unsigned int > > m_t0Dist
as with m_biRandom, but for FastReseededPRNG
ServiceHandle< IAthRNGSvc > m_randomSvc
the service managing our random seeds/sequences