132 int irow_min = topol->
nrows();
137 float chargeBefore = 0;
138 float chargeAfter = 0;
142 for (
std::map<
int,
float, std::less<int> >::const_iterator im = hit_signal.begin(); im != hit_signal.end(); ++im) {
143 int chan = (*im).first;
149 chargeBefore += (*im).second;
151 if (pixelWithCharge.first < irow_min)
152 irow_min = pixelWithCharge.first;
153 if (pixelWithCharge.first > irow_max)
154 irow_max = pixelWithCharge.first;
155 if (pixelWithCharge.second < icol_min)
156 icol_min = pixelWithCharge.second;
157 if (pixelWithCharge.second > icol_max)
158 icol_max = pixelWithCharge.second;
163 float trajectoryScaleToPosition = hitEntryPoint.
z() / direction.
z();
165 if ((hitEntryPoint.
z() > 0 && direction.
z() < 0) || (hitEntryPoint.
z() < 0 && direction.
z() > 0)) {
166 trajectoryScaleToPosition *= -1;
169 LocalPoint hitPosition = hitEntryPoint + trajectoryScaleToPosition * direction;
172 std::pair<int, int> hitPixel =
173 std::pair<int, int>(
int(floor(hitPositionPixel.
x())),
int(floor(hitPositionPixel.
y())));
180 std::pair<int, int> entryPixel =
181 std::pair<int, int>(
int(floor(hitEntryPointPixel.
x())),
int(floor(hitEntryPointPixel.
y())));
182 std::pair<int, int> exitPixel =
183 std::pair<int, int>(
int(floor(hitExitPointPixel.
x())),
int(floor(hitExitPointPixel.
y())));
185 int hitcol_min, hitcol_max, hitrow_min, hitrow_max;
186 if (entryPixel.first > exitPixel.first) {
187 hitrow_min = exitPixel.first;
188 hitrow_max = entryPixel.first;
190 hitrow_min = entryPixel.first;
191 hitrow_max = exitPixel.first;
194 if (entryPixel.second > exitPixel.second) {
195 hitcol_min = exitPixel.second;
196 hitcol_max = entryPixel.second;
198 hitcol_min = entryPixel.second;
199 hitcol_max = exitPixel.second;
206 <<
"Particle ID is: " <<
hit.particleType() <<
"\n"
207 <<
"Process type: " <<
hit.processType() <<
"\n"
210 <<
"Hit entry x/y/z: " <<
hit.entryPoint().
x() <<
" " <<
hit.entryPoint().
y() <<
" "
211 <<
hit.entryPoint().
z() <<
" "
212 <<
"Hit exit x/y/z: " <<
hit.exitPoint().
x() <<
" " <<
hit.exitPoint().
y() <<
" "
213 <<
hit.exitPoint().
z() <<
" "
215 <<
"Pixel Pos - X: " << hitPositionPixel.
x() <<
" Y: " << hitPositionPixel.
y() <<
"\n"
216 <<
"Cart.Cor. - X: " << CMSSWhitPosition.
x() <<
" Y: " << CMSSWhitPosition.
y() <<
"\n"
217 <<
"Z=0 Pos - X: " << hitPosition.
x() <<
" Y: " << hitPosition.
y() <<
"\n"
219 <<
"Origin of the template:"
221 <<
"Pixel Pos - X: " << originPixel.x() <<
" Y: " << originPixel.y() <<
"\n"
222 <<
"Cart.Cor. - X: " << origin.
x() <<
" Y: " << origin.
y() <<
"\n"
226 <<
"Entry - X: " <<
hit.entryPoint().
x() <<
" Y: " <<
hit.entryPoint().
y()
227 <<
" Z: " <<
hit.entryPoint().
z() <<
"\n"
228 <<
"Exit - X: " <<
hit.exitPoint().
x() <<
" Y: " <<
hit.exitPoint().
y()
229 <<
" Z: " <<
hit.exitPoint().
z() <<
"\n"
231 <<
"Entry - X Pixel: " << hitEntryPointPixel.
x() <<
" Y Pixel: " << hitEntryPointPixel.
y()
233 <<
"Exit - X Pixel: " << hitExitPointPixel.
x() <<
" Y Pixel: " << hitExitPointPixel.
y()
236 <<
"row min: " << irow_min <<
" col min: " << icol_min <<
"\n";
239 if (!(irow_min <= hitrow_max && irow_max >= hitrow_min && icol_min <= hitcol_max && icol_max >= hitcol_min)) {
244 float cmToMicrons = 10000.f;
246 track[0] = (hitPosition.
x() - origin.
x()) * cmToMicrons;
247 track[1] = (hitPosition.
y() - origin.
y()) * cmToMicrons;
249 track[3] = direction.x();
250 track[4] = direction.y();
251 track[5] = direction.z();
255 for (
int row = 0; row <
TXSIZE; ++row) {
257 pixrewgt[row][
col] = 0;
261 for (
int row = 0; row <
TXSIZE; ++row) {
269 for (
int row = 0; row <
TXSIZE; ++row) {
278 std::cout <<
"Cluster before reweighting: " << std::endl;
298 LogDebug(
"PixelDigitizer ") <<
"Cluster Charge Reweighting did not work properly.";
304 std::cout <<
"Cluster after reweighting: " << std::endl;
308 for (
int row = 0; row <
TXSIZE; ++row) {
312 if ((hitPixel.first + row -
THX) >= 0 && (hitPixel.first + row -
THX) < topol->
nrows() &&
322 if (chargeBefore != 0. && chargeAfter == 0.) {
328 std::cout <<
"Charges (before->after): " << chargeBefore <<
" -> " << chargeAfter << std::endl;
329 std::cout <<
"Charge loss: " << (1 - chargeAfter / chargeBefore) * 100 <<
" %" << std::endl << std::endl;