Skip to content
Snippets Groups Projects
Commit e5deaab3 authored by FU Chengdong's avatar FU Chengdong
Browse files

seperate pixel and strip by resolution

parent be3226db
No related branches found
No related tags found
No related merge requests found
...@@ -110,7 +110,9 @@ StatusCode PlanarDigiAlg::execute() ...@@ -110,7 +110,9 @@ StatusCode PlanarDigiAlg::execute()
unsigned int thisSeed = _SEEDER->getSeed(this, _nEvt, 0); unsigned int thisSeed = _SEEDER->getSeed(this, _nEvt, 0);
gsl_rng_set( _rng, thisSeed ) ; gsl_rng_set( _rng, thisSeed ) ;
debug() << "seed set to " << thisSeed << endmsg; debug() << "seed set to " << thisSeed << endmsg;
auto trkhitVec = _outColHdl.createAndPut();
auto relCol = _outRelColHdl.createAndPut();
//auto STHcol = _inColHdl.get(); //auto STHcol = _inColHdl.get();
//if ( STHcol == nullptr ) { //if ( STHcol == nullptr ) {
// debug() << "Collection " << _inColHdl.fullKey() << " is unavailable in event " << _nEvt << endmsg; // debug() << "Collection " << _inColHdl.fullKey() << " is unavailable in event " << _nEvt << endmsg;
...@@ -133,9 +135,6 @@ StatusCode PlanarDigiAlg::execute() ...@@ -133,9 +135,6 @@ StatusCode PlanarDigiAlg::execute()
unsigned nCreatedHits=0; unsigned nCreatedHits=0;
unsigned nDismissedHits=0; unsigned nDismissedHits=0;
auto trkhitVec = _outColHdl.createAndPut();
auto relCol = _outRelColHdl.createAndPut();
//CellIDEncoder<TrackerHitPlaneImpl> cellid_encoder( lcio::ILDCellID0::encoder_string , trkhitVec ) ; //CellIDEncoder<TrackerHitPlaneImpl> cellid_encoder( lcio::ILDCellID0::encoder_string , trkhitVec ) ;
int nSimHits = STHcol->size() ; int nSimHits = STHcol->size() ;
...@@ -205,7 +204,10 @@ StatusCode PlanarDigiAlg::execute() ...@@ -205,7 +204,10 @@ StatusCode PlanarDigiAlg::execute()
// << endmsg; // << endmsg;
// continue; // continue;
// } // }
if( (_resU.size() > 1 && layer > _resU.size()-1) || (_resV.size() > 1 && layer > _resV.size()-1) ) {
fatal() << "layer exceeds resolution vector, please check input parameters ResolutionU and ResolutionV" << endmsg;
return StatusCode::FAILURE;
}
float resU = ( _resU.size() > 1 ? _resU.value().at( layer ) : _resU.value().at(0) ) ; float resU = ( _resU.size() > 1 ? _resU.value().at( layer ) : _resU.value().at(0) ) ;
float resV = ( _resV.size() > 1 ? _resV.value().at( layer ) : _resV.value().at(0) ) ; float resV = ( _resV.size() > 1 ? _resV.value().at( layer ) : _resV.value().at(0) ) ;
...@@ -267,7 +269,7 @@ StatusCode PlanarDigiAlg::execute() ...@@ -267,7 +269,7 @@ StatusCode PlanarDigiAlg::execute()
} }
// for 1D strip measurements: set v to 0! Only the measurement in u counts! // for 1D strip measurements: set v to 0! Only the measurement in u counts!
if( _isStrip ) localPointSmeared[1] = 0. ; if( _isStrip || (resU!=0&&resV==0) ) localPointSmeared[1] = 0. ;
// convert back to global position for TrackerHitPlaneImpl // convert back to global position for TrackerHitPlaneImpl
CLHEP::Hep3Vector globalPointSmeared = ms->getCoordinateSystem()->getGlobalPoint(localPointSmeared); CLHEP::Hep3Vector globalPointSmeared = ms->getCoordinateSystem()->getGlobalPoint(localPointSmeared);
...@@ -324,7 +326,7 @@ StatusCode PlanarDigiAlg::execute() ...@@ -324,7 +326,7 @@ StatusCode PlanarDigiAlg::execute()
else trkHit->setdV( resV ) ; else trkHit->setdV( resV ) ;
*/ */
trkHit.setType(8); trkHit.setType(8);
if( _isStrip ){ if( _isStrip || (resU!=0&&resV==0) ){
trkHit.setType( UTIL::set_bit( trkHit.getType() , UTIL::ILDTrkHitTypeBit::ONE_DIMENSIONAL ) ) ; trkHit.setType( UTIL::set_bit( trkHit.getType() , UTIL::ILDTrkHitTypeBit::ONE_DIMENSIONAL ) ) ;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment