self-explaining text of matchsvdmt.C function ://-------------------------------------------------------------------- // Created: 02.09.97 by Olya Igonkina // see http://www-hera-b.desy.de/subgroup/software/arte/MARPLE/ // MARPLE function for matching of segments // reconstructed in the SVD and Main Tracker area //-------------------------------------------------------------------- #include "marple/marple.hh" #include "marple/RcMatchBuilder.hh" #include "arte/RSEG_cmp.hh" #include "arte/ArteMessage.hh" //definition of constants for SVD-MT matching ( see \Ref{RcMatchConst}) // flag, z_plane, z_min, z_max, use_pair_cut, n_pair_left, n_pair_right, // use_delta_cut, delta_x, delta_y, delta_tx, delta_ty, delta_pe, chi2 RcMatchConst rcSvdMtConst = { 11110, 160., -30., 700., 0, 2, 2, 1, 1, 1.5, 0.01, 0.01, 1.e+10, 1.e+10 }; RcMatchConst rcSvdMtSoftConst = { 11110, 160., -30., 700., 1, 2, 1, 1, 3., 6., 0.015, 0.02, 1.e+10, 1.e+10 }; // Constants optimized on SUSI : //RcMatchConst rcSvdMtConst = { // 11110, 160., -10., 300., 1, 2, 1, // 1, 1., 2., 0.005, 0.008, 1.e+10, 100 //}; extern "C" void FORTRAN_ROUTINE(matchsvdmt)() { RcMatchBuilder< RcSegPoint, RcSegPoint> SvdMtMatch; //-------------------------------------------------------------------- // put constants to the MatchBuilder //-------------------------------------------------------------------- if( MARPLE_SOFT ) SvdMtMatch.setConst(rcSvdMtSoftConst); else SvdMtMatch.setConst(rcSvdMtConst); //-------------------------------------------------------------------- // create vector of segments from SVD //-------------------------------------------------------------------- int iErr =0; for( ArteTable<RSEG>::iterator irseg = ArteTable<RSEG>::begin(); irseg != ArteTable<RSEG>::end(); ++irseg ) { if( (*irseg)->fit != 0 ) continue; if( ((*irseg)->cmp & Rsegc::bitsign) != 0 ) continue; if( (*irseg)->cmp != Rsegc::vxd && (*irseg)->cmp != 65537) continue; if( SvdMtMatch.ptToMatchConst()->geomAccept(HepDouble((*irseg)->ze)) ) { RcSegPoint * ptToPoint = new RcSegPoint( (*irseg) , 1); // endPoint // prolongate to the plane of matching ptToPoint->prolongate( SvdMtMatch.ptToMatchConst()->z_plane, iErr); if( iErr ) { delete ptToPoint; }else{ SvdMtMatch.addPointLeft( *ptToPoint); } ptToPoint = 0; } } //-------------------------------------------------------------------- // create vector of Main Tracker segments //-------------------------------------------------------------------- for( ArteTable<RSEG>::iterator irseg2 = ArteTable<RSEG>::begin(); irseg2 != ArteTable<RSEG>::end(); ++irseg2 ) { if( (*irseg2)->fit != 0 ) continue; if( ((*irseg2)->cmp & Rsegc::bitsign) != 0 ) continue; if( (*irseg2)->cmp & Rsegc::magt && SvdMtMatch.ptToMatchConst()->geomAccept(HepDouble((*irseg2)->zf)) ) { RcSegPoint * ptToPoint = new RcSegPoint( (*irseg2),0 );// firstPoint (*ptToPoint).prolongate( SvdMtMatch.ptToMatchConst()->z_plane, iErr); if( iErr ) { delete ptToPoint; }else{ SvdMtMatch.addPointRight( *ptToPoint); } ptToPoint = 0; } } //-------------------------------------------------------------------- // do Matching //-------------------------------------------------------------------- SvdMtMatch.doMatch(); //-------------------------------------------------------------------- // print result of matching //-------------------------------------------------------------------- SvdMtMatch.stat(); if( MARPLE_DEBUG >= 20) { SvdMtMatch.fillMatch(8112); SvdMtMatch.fillDeltas(8212,8312); }else if( MARPLE_DEBUG >= 10 ){ SvdMtMatch.fillDeltas(8212); } //-------------------------------------------------------------------- // save found relation to the table //-------------------------------------------------------------------- if( MARPLE_MAKERSEG ) SvdMtMatch.saveRSEG(iErr); SvdMtMatch.saveRelation(iErr); if( iErr ) { arteMsg << "MARPLE: some relations were not saved "; arteMsg.allp();} // refit information //SvdMtMatch.refitLeftFound( iErr); //SvdMtMatch.refitRightFound( iErr); // and update RSEG tables //SvdMtMatch.updateARTELeftFound( iErr); //SvdMtMatch.updateARTERightFound( iErr); //-------------------------------------------------------------------- // clean everything //-------------------------------------------------------------------- SvdMtMatch.deleteAll(); }
generated by doc++