Skip to content

Commit

Permalink
Implement Thomas comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dudarboh authored and tmadlener committed Nov 5, 2021
1 parent 9ba3305 commit 8a9ae13
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions source/Digitisers/src/DDPlanarDigiProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -416,25 +416,24 @@ void DDPlanarDigiProcessor::processEvent( LCEvent * evt ) {
// dd4hep::rec::Vector3D newPosTmp = oldPos + uSmear * u ;
// if( ! _isStrip ) newPosTmp = newPosTmp + vSmear * v ;

double xStripPos, yStripPos, zStripPos;
if ( _subDetName == "SET" && _isStrip){
//Find intersection of the strip with the z=centerOfSensor plane to set it as the center of the SET strip
dd4hep::rec::Vector3D simHitPosSmeared = (1./dd4hep::mm) * ( surf->localToGlobal( dd4hep::rec::Vector2D( (uL+uSmear)*dd4hep::mm, 0.) ) );
zStripPos = surf->origin()[2] / dd4hep::mm ;
double lineParam = (zStripPos - simHitPosSmeared[2])/v[2];
xStripPos = simHitPosSmeared[0] + lineParam*v[0];
yStripPos = simHitPosSmeared[1] + lineParam*v[1];
}

dd4hep::rec::Vector3D newPosTmp;
if (! _isStrip){
newPosTmp = (1./dd4hep::mm) * ( surf->localToGlobal( dd4hep::rec::Vector2D( (uL+uSmear)*dd4hep::mm, (vL+vSmear)*dd4hep::mm ) ) );
}
else if (_subDetName == "SET"){
newPosTmp = dd4hep::rec::Vector3D(xStripPos, yStripPos, zStripPos);
if (_isStrip){
if (_subDetName == "SET"){
double xStripPos, yStripPos, zStripPos;
//Find intersection of the strip with the z=centerOfSensor plane to set it as the center of the SET strip
dd4hep::rec::Vector3D simHitPosSmeared = (1./dd4hep::mm) * ( surf->localToGlobal( dd4hep::rec::Vector2D( (uL+uSmear)*dd4hep::mm, 0.) ) );
zStripPos = surf->origin()[2] / dd4hep::mm ;
double lineParam = (zStripPos - simHitPosSmeared[2])/v[2];
xStripPos = simHitPosSmeared[0] + lineParam*v[0];
yStripPos = simHitPosSmeared[1] + lineParam*v[1];
newPosTmp = dd4hep::rec::Vector3D(xStripPos, yStripPos, zStripPos);
}
else{
newPosTmp = (1./dd4hep::mm) * ( surf->localToGlobal( dd4hep::rec::Vector2D( (uL+uSmear)*dd4hep::mm, 0. ) ) );
}
}
else{
newPosTmp = (1./dd4hep::mm) * ( surf->localToGlobal( dd4hep::rec::Vector2D( (uL+uSmear)*dd4hep::mm, 0. ) ) );
newPosTmp = (1./dd4hep::mm) * ( surf->localToGlobal( dd4hep::rec::Vector2D( (uL+uSmear)*dd4hep::mm, (vL+vSmear)*dd4hep::mm ) ) );
}

streamlog_out( DEBUG1 ) << " hit at : " << oldPos
Expand Down

0 comments on commit 8a9ae13

Please sign in to comment.