Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,13 @@ FastSingleTrackerRecHit PixelTemplateSmearerBase::smearHit(const PSimHit& simHit
<< " cotalpha=" << cotalpha << ", cotbeta=" << cotbeta;

const PixelTopology* theSpecificTopology = &(detUnit->specificType().specificTopology());
const RectangularPixelTopology* rectPixelTopology = static_cast<const RectangularPixelTopology*>(theSpecificTopology);

const int nrows = theSpecificTopology->nrows();
const int ncolumns = theSpecificTopology->ncolumns();

const Local3DPoint lp = simHit.localPosition();
//Transform local position to measurement position
const MeasurementPoint mp = rectPixelTopology->measurementPosition(lp);
const MeasurementPoint mp = theSpecificTopology->measurementPosition(lp);
float mpy = mp.y();
float mpx = mp.x();
//Get the center of the struck pixel in measurement position
Expand All @@ -359,7 +358,7 @@ FastSingleTrackerRecHit PixelTemplateSmearerBase::smearHit(const PSimHit& simHit

const MeasurementPoint mpCenter(pixelCenterX, pixelCenterY);
//Transform the center of the struck pixel back into local position
const Local3DPoint lpCenter = rectPixelTopology->localPosition(mpCenter);
const Local3DPoint lpCenter = theSpecificTopology->localPosition(mpCenter);

//Get the relative position of struck point to the center of the struck pixel
float xtrk = lp.x() - lpCenter.x();
Expand Down Expand Up @@ -408,8 +407,8 @@ FastSingleTrackerRecHit PixelTemplateSmearerBase::smearHit(const PSimHit& simHit

double xsizeProbability = random->flatShoot();
double ysizeProbability = random->flatShoot();
bool hitbigx = rectPixelTopology->isItBigPixelInX((int)mpx); // pixel we hit in x
bool hitbigy = rectPixelTopology->isItBigPixelInY((int)mpy); // pixel we hit in y
bool hitbigx = theSpecificTopology->isItBigPixelInX((int)mpx); // pixel we hit in x
bool hitbigy = theSpecificTopology->isItBigPixelInY((int)mpy); // pixel we hit in y

if (hitbigx)
if (xsizeProbability < nx2_frac)
Expand Down Expand Up @@ -521,14 +520,14 @@ FastSingleTrackerRecHit PixelTemplateSmearerBase::smearHit(const PSimHit& simHit
lastPixelInX = (lastPixelInX < nrows) ? lastPixelInX : nrows - 1;
lastPixelInY = (lastPixelInY < ncolumns) ? lastPixelInY : ncolumns - 1;

edgex = rectPixelTopology->isItEdgePixelInX(firstPixelInX) || rectPixelTopology->isItEdgePixelInX(lastPixelInX);
edgey = rectPixelTopology->isItEdgePixelInY(firstPixelInY) || rectPixelTopology->isItEdgePixelInY(lastPixelInY);
edgex = theSpecificTopology->isItEdgePixelInX(firstPixelInX) || theSpecificTopology->isItEdgePixelInX(lastPixelInX);
edgey = theSpecificTopology->isItEdgePixelInY(firstPixelInY) || theSpecificTopology->isItEdgePixelInY(lastPixelInY);
edge = edgex || edgey;

// bigx = rectPixelTopology->isItBigPixelInX( firstPixelInX ) || rectPixelTopology->isItBigPixelInX( lastPixelInX );
// bigy = rectPixelTopology->isItBigPixelInY( firstPixelInY ) || rectPixelTopology->isItBigPixelInY( lastPixelInY );
bool hasBigPixelInX = rectPixelTopology->containsBigPixelInX(firstPixelInX, lastPixelInX);
bool hasBigPixelInY = rectPixelTopology->containsBigPixelInY(firstPixelInY, lastPixelInY);
// bigx = theSpecificTopology->isItBigPixelInX( firstPixelInX ) || theSpecificTopology->isItBigPixelInX( lastPixelInX );
// bigy = theSpecificTopology->isItBigPixelInY( firstPixelInY ) || theSpecificTopology->isItBigPixelInY( lastPixelInY );
bool hasBigPixelInX = theSpecificTopology->containsBigPixelInX(firstPixelInX, lastPixelInX);
bool hasBigPixelInY = theSpecificTopology->containsBigPixelInY(firstPixelInY, lastPixelInY);

//Variables for SiPixelTemplate pixel hit error output
float sigmay, sigmax, sy1, sy2, sx1, sx2;
Expand Down