93 int irow_min = topol->
nrows();
98 float chargeBefore = 0;
99 float chargeAfter = 0;
103 for (
std::map<
int,
float, std::less<int> >::const_iterator im = hit_signal.begin(); im != hit_signal.end(); ++im) {
104 int chan = (*im).first;
110 chargeBefore += (*im).second;
112 if (pixelWithCharge.first < irow_min)
113 irow_min = pixelWithCharge.first;
114 if (pixelWithCharge.first > irow_max)
115 irow_max = pixelWithCharge.first;
116 if (pixelWithCharge.second < icol_min)
117 icol_min = pixelWithCharge.second;
118 if (pixelWithCharge.second > icol_max)
119 icol_max = pixelWithCharge.second;
124 float trajectoryScaleToPosition = hitEntryPoint.
z() / direction.
z();
126 if ((hitEntryPoint.
z() > 0 && direction.
z() < 0) || (hitEntryPoint.
z() < 0 && direction.
z() > 0)) {
127 trajectoryScaleToPosition *= -1;
130 LocalPoint hitPosition = hitEntryPoint + trajectoryScaleToPosition * direction;
133 std::pair<int, int> hitPixel =
134 std::pair<int, int>(
int(floor(hitPositionPixel.
x())),
int(floor(hitPositionPixel.
y())));
141 std::pair<int, int> entryPixel =
142 std::pair<int, int>(
int(floor(hitEntryPointPixel.
x())),
int(floor(hitEntryPointPixel.
y())));
143 std::pair<int, int> exitPixel =
144 std::pair<int, int>(
int(floor(hitExitPointPixel.
x())),
int(floor(hitExitPointPixel.
y())));
146 int hitcol_min, hitcol_max, hitrow_min, hitrow_max;
147 if (entryPixel.first > exitPixel.first) {
148 hitrow_min = exitPixel.first;
149 hitrow_max = entryPixel.first;
151 hitrow_min = entryPixel.first;
152 hitrow_max = exitPixel.first;
155 if (entryPixel.second > exitPixel.second) {
156 hitcol_min = exitPixel.second;
157 hitcol_max = entryPixel.second;
159 hitcol_min = entryPixel.second;
160 hitcol_max = exitPixel.second;
167 <<
"Particle ID is: " <<
hit.particleType() <<
"\n" 168 <<
"Process type: " <<
hit.processType() <<
"\n" 171 <<
"Hit entry x/y/z: " <<
hit.entryPoint().
x() <<
" " <<
hit.entryPoint().
y() <<
" " 172 <<
hit.entryPoint().
z() <<
" " 173 <<
"Hit exit x/y/z: " <<
hit.exitPoint().
x() <<
" " <<
hit.exitPoint().
y() <<
" " 174 <<
hit.exitPoint().
z() <<
" " 176 <<
"Pixel Pos - X: " << hitPositionPixel.
x() <<
" Y: " << hitPositionPixel.
y() <<
"\n" 177 <<
"Cart.Cor. - X: " << CMSSWhitPosition.
x() <<
" Y: " << CMSSWhitPosition.
y() <<
"\n" 178 <<
"Z=0 Pos - X: " << hitPosition.
x() <<
" Y: " << hitPosition.
y() <<
"\n" 180 <<
"Origin of the template:" 182 <<
"Pixel Pos - X: " << originPixel.x() <<
" Y: " << originPixel.y() <<
"\n" 183 <<
"Cart.Cor. - X: " << origin.
x() <<
" Y: " << origin.
y() <<
"\n" 187 <<
"Entry - X: " <<
hit.entryPoint().
x() <<
" Y: " <<
hit.entryPoint().
y()
188 <<
" Z: " <<
hit.entryPoint().
z() <<
"\n" 189 <<
"Exit - X: " <<
hit.exitPoint().
x() <<
" Y: " <<
hit.exitPoint().
y()
190 <<
" Z: " <<
hit.exitPoint().
z() <<
"\n" 192 <<
"Entry - X Pixel: " << hitEntryPointPixel.
x() <<
" Y Pixel: " << hitEntryPointPixel.
y()
194 <<
"Exit - X Pixel: " << hitExitPointPixel.
x() <<
" Y Pixel: " << hitExitPointPixel.
y()
197 <<
"row min: " << irow_min <<
" col min: " << icol_min <<
"\n";
200 if (!(irow_min <= hitrow_max && irow_max >= hitrow_min && icol_min <= hitcol_max && icol_max >= hitcol_min)) {
205 float cmToMicrons = 10000.f;
207 track[0] = (hitPosition.
x() - origin.
x()) * cmToMicrons;
208 track[1] = (hitPosition.
y() - origin.
y()) * cmToMicrons;
210 track[3] = direction.x();
211 track[4] = direction.y();
212 track[5] = direction.z();
216 for (
int row = 0; row <
TXSIZE; ++row) {
218 pixrewgt[row][
col] = 0;
222 for (
int row = 0; row <
TXSIZE; ++row) {
237 for (
int row = rowmin; row < rowmax; ++row) {
238 for (
int col = colmin;
col < colmax; ++
col) {
246 std::cout <<
"Cluster before reweighting: " << std::endl;
266 LogDebug(
"PixelDigitizer ") <<
"Cluster Charge Reweighting did not work properly.";
272 std::cout <<
"Cluster after reweighting: " << std::endl;
276 for (
int row = rowmin; row < rowmax; ++row) {
277 for (
int col = colmin;
col < colmax; ++
col) {
288 if (chargeBefore != 0. && chargeAfter == 0.) {
294 std::cout <<
"Charges (before->after): " << chargeBefore <<
" -> " << chargeAfter << std::endl;
295 std::cout <<
"Charge loss: " << (1 - chargeAfter / chargeBefore) * 100 <<
" %" << std::endl << std::endl;
static std::pair< int, int > channelToPixel(int ch)
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
virtual int ncolumns() const =0
std::vector< bool > xdouble
virtual int nrows() const =0
std::map< int, SiPixelDigitizerAlgorithm::Amplitude, std::less< int > > signal_map_type
const bool UseReweighting
const SiPixel2DTemplateDBObject * dbobject_den
static int pixelToChannel(int row, int col)
U second(std::pair< T, U > const &p)
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
virtual bool isItBigPixelInX(int ixbin) const =0
virtual bool isItBigPixelInY(int iybin) const =0
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
boost::multi_array< float, 2 > array_2d
const SiPixel2DTemplateDBObject * dbobject_num
void printCluster(array_2d &cluster)
int PixelTempRewgt2D(int id_gen, int id_rewgt, array_2d &cluster)
std::vector< bool > ydouble
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
short getTemplateID(const uint32_t &detid) const
std::vector< float > track