#include <TCurlFinder.h>
Inheritance diagram for TCurlFinder:
Public Member Functions | |
void | clear (void) |
cleans all members of this class | |
void | clear (void) |
cleans all members of this class | |
virtual int | debugLevel (int) |
sets debug level. | |
virtual int | debugLevel (void) const |
returns debug level. | |
virtual int | debugLevel (int) |
sets debug level. | |
virtual int | debugLevel (void) const |
returns debug level. | |
int | doit (const AList< TMDCWireHit > &axialHits, const AList< TMDCWireHit > &stereoHits, AList< TTrack > &tracks, AList< TTrack > &tracks2D) |
main function | |
int | doit (const AList< TMDCWireHit > &axialHits, const AList< TMDCWireHit > &stereoHits, AList< TTrack > &tracks, AList< TTrack > &tracks2D) |
main function | |
virtual bool | doSalvage (bool) |
sets flag to salvage hits. | |
virtual bool | doSalvage (bool) |
sets flag to salvage hits. | |
virtual bool | doStereo (bool) |
sets flag to reconstruct 3D. | |
virtual bool | doStereo (bool) |
sets flag to reconstruct 3D. | |
virtual void | dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const |
dumps debug information. | |
virtual void | dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const |
dumps debug information. | |
std::string | name (void) const |
returns name. | |
std::string | name (void) const |
returns name. | |
TCurlFinder (const unsigned min_segment, const unsigned min_salvage, const double bad_distance_for_salvage, const double good_distance_for_salvage, const unsigned min_sequence, const unsigned min_fullwire, const double range_for_axial_search, const double range_for_stereo_search, const unsigned superlayer_for_stereo_search, const double range_for_axial_last2d_search, const double range_for_stereo_last2d_search, const double trace2d_distance, const double trace2d_first_distance, const double trace3d_distance, const unsigned determine_one_track, const double selector_max_impact, const double selector_max_sigma, const double selector_strange_pz, const double selector_replace_dz, const unsigned stereo_2dfind, const unsigned merge_exe, const double merge_ratio, const double merge_z_diff, const double mask_distance, const double ratio_used_wire, const double range_for_stereo1, const double range_for_stereo2, const double range_for_stereo3, const double range_for_stereo4, const double range_for_stereo5, const double range_for_stereo6, const double z_cut, const double z_diff_for_last_attend, const unsigned svd_reconstruction, const double min_svd_electrons, const unsigned on_correction, const unsigned output_2dtracks, const unsigned curl_version, const double minimum_seedLength, const double minimum_2DTrackLength, const double minimum_3DTrackLength, const double minimum_closeHitsLength, const double MIN_RADIUS_OF_STRANGE_TRACK, const double ULTIMATE_MIN_RADIUS_OF_STRANGE_TRACK) | |
TCurlFinder (void) | |
TCurlFinder (const unsigned min_segment, const unsigned min_salvage, const double bad_distance_for_salvage, const double good_distance_for_salvage, const unsigned min_sequence, const unsigned min_fullwire, const double range_for_axial_search, const double range_for_stereo_search, const unsigned superlayer_for_stereo_search, const double range_for_axial_last2d_search, const double range_for_stereo_last2d_search, const double trace2d_distance, const double trace2d_first_distance, const double trace3d_distance, const unsigned determine_one_track, const double selector_max_impact, const double selector_max_sigma, const double selector_strange_pz, const double selector_replace_dz, const unsigned stereo_2dfind, const unsigned merge_exe, const double merge_ratio, const double merge_z_diff, const double mask_distance, const double ratio_used_wire, const double range_for_stereo1, const double range_for_stereo2, const double range_for_stereo3, const double range_for_stereo4, const double range_for_stereo5, const double range_for_stereo6, const double z_cut, const double z_diff_for_last_attend, const unsigned svd_reconstruction, const double min_svd_electrons, const unsigned on_correction, const unsigned output_2dtracks, const unsigned curl_version, const double minimum_seedLength, const double minimum_2DTrackLength, const double minimum_3DTrackLength, const double minimum_closeHitsLength, const double MIN_RADIUS_OF_STRANGE_TRACK, const double ULTIMATE_MIN_RADIUS_OF_STRANGE_TRACK) | |
TCurlFinder (void) | |
std::string | version (void) const |
returns version. | |
std::string | version (void) const |
returns version. | |
~TCurlFinder (void) | |
~TCurlFinder (void) | |
Private Member Functions | |
void | assignTracks (void) |
void | assignTracks (void) |
bool | check2DCircle (TCircle *) |
bool | check2DCircle (TCircle *) |
void | check2DTracks (void) |
void | check2DTracks (void) |
bool | check3DTrack (TTrack *) |
bool | check3DTrack (TTrack *) |
unsigned | checkAppendHits (const AList< TMLink > &, AList< TMLink > &) const |
unsigned | checkAppendHits (const AList< TMLink > &, AList< TMLink > &) const |
void | checkExceptionalSegmentsType01 (void) |
Utility of #2. | |
void | checkExceptionalSegmentsType01 (void) |
Utility of #2. | |
void | checkExceptionalSegmentsType02 (void) |
void | checkExceptionalSegmentsType02 (void) |
void | checkExceptionalSegmentsType03 (void) |
void | checkExceptionalSegmentsType03 (void) |
void | checkRelation (AList< TTrack > &) |
void | checkRelation (AList< TTrack > &) |
int | checkSortSegments (void) |
Sub Main Section #2. | |
int | checkSortSegments (void) |
Sub Main Section #2. | |
void | createSegments (AList< TMLink > &) |
void | createSegments (AList< TMLink > &) |
void | createSuperLayer (void) |
void | createSuperLayer (void) |
void | debugCheckSegments (const double localId, const double layerId, const double localId2, const double layerId2) |
void | debugCheckSegments (const double localId, const double layerId, const double localId2, const double layerId2) |
void | debugCheckSegments0 (void) |
void | debugCheckSegments0 (void) |
void | debugCheckSegments1 (void) |
void | debugCheckSegments1 (void) |
void | debugCheckSegments2 (void) |
void | debugCheckSegments2 (void) |
double | distance (const TTrack &, const TMLink &) const |
double | distance (const double, const double) const |
Utility Section. | |
double | distance (const TTrack &, const TMLink &) const |
double | distance (const double, const double) const |
Utility Section. | |
TCircle * | dividing2DTrack (TCircle *) |
TCircle * | dividing2DTrack (TCircle *) |
void | dumpType1 (TTrack *) |
Dump. | |
void | dumpType1 (TTrack *) |
Dump. | |
void | dumpType2 (TTrack *) |
void | dumpType2 (TTrack *) |
void | findCloseHits (AList< TMLink > &, TTrack &, AList< TMLink > &) |
void | findCloseHits (AList< TMLink > &, TTrack &, AList< TMLink > &) |
TMLink * | findLink (const TMLink *, const AList< TMLink > &) |
TMLink * | findLink (const TMLink *, const AList< TMLink > &) |
bool | fitWDD (TCircle &, double &, int &) const |
bool | fitWDD (TCircle &, double &, int &) const |
unsigned | layerId (const double &) const |
unsigned | layerId (const double &) const |
void | linkNeighboringWires (AList< TMLink > *, const unsigned) |
Utility of #1. | |
void | linkNeighboringWires (AList< TMLink > *, const unsigned) |
Utility of #1. | |
TCircle * | make2DTrack (const AList< TMLink > &, const AList< TSegmentCurl > &, const unsigned) |
2D Track | |
TCircle * | make2DTrack (const AList< TMLink > &, const AList< TSegmentCurl > &, const unsigned) |
2D Track | |
TTrack * | make3DTrack (const TCircle *, AList< TSegmentCurl > &) |
TTrack * | make3DTrack (const TCircle *) |
TTrack * | make3DTrack (const TCircle *, AList< TSegmentCurl > &) |
TTrack * | make3DTrack (const TCircle *) |
void | makeCdcFrame (void) |
Plot. | |
void | makeCdcFrame (void) |
Plot. | |
void | makeCurlTracks (AList< TTrack > &tracks, AList< TTrack > &tracks2D) |
Sub Main Section #3. | |
void | makeCurlTracks (AList< TTrack > &tracks, AList< TTrack > &tracks2D) |
Sub Main Section #3. | |
void | makeList (AList< TMLink > &, const AList< TMLink > &, const AList< TMLink > &) |
void | makeList (AList< TMLink > &, const AList< TSegmentCurl > &, const AList< TMLink > &) |
void | makeList (AList< TMLink > &, const AList< TMLink > &, const AList< TMLink > &) |
void | makeList (AList< TMLink > &, const AList< TSegmentCurl > &, const AList< TMLink > &) |
void | makeWireHitsListsSegments (const AList< TMDCWireHit > &, const AList< TMDCWireHit > &) |
Sub Main Section #1. | |
void | makeWireHitsListsSegments (const AList< TMDCWireHit > &, const AList< TMDCWireHit > &) |
Sub Main Section #1. | |
int | makeWithMC (const AList< TMDCWireHit > &, const AList< TMDCWireHit > &, AList< TTrack > &) |
MC. | |
int | makeWithMC (const AList< TMDCWireHit > &, const AList< TMDCWireHit > &, AList< TTrack > &) |
MC. | |
void | mask3DTrack (TTrack *, AList< TMLink > &) |
void | mask3DTrack (TTrack *, AList< TMLink > &) |
unsigned | maxLocalLayerId (const unsigned) const |
unsigned | maxLocalLayerId (const unsigned) const |
TTrack * | merge3DTrack (TTrack *, AList< TTrack > &) |
TTrack * | merge3DTrack (TTrack *, AList< TTrack > &) |
unsigned | nAxialHits (const double &) const |
unsigned | nAxialHits (const double &) const |
int | nextSuperAxialLayerId (const unsigned, const int) const |
int | nextSuperAxialLayerId (const unsigned, const int) const |
int | nextSuperStereoLayerId (const unsigned, const int) const |
int | nextSuperStereoLayerId (const unsigned, const int) const |
unsigned | offset (const unsigned) const |
unsigned | offset (const unsigned) const |
void | plotCircle (const TCircle &, const int flag=1) |
void | plotCircle (const TCircle &, const int flag=1) |
void | plotSegment (const AList< TMLink > &, const int flag=1) |
void | plotSegment (const AList< TMLink > &, const int flag=1) |
void | plotTrack (const TTrack &, const int flag=1) |
void | plotTrack (const TTrack &, const int flag=1) |
void | removeStereo (TCircle &) const |
void | removeStereo (TCircle &) const |
void | salvage3DTrack (TTrack *, bool=true) |
void | salvage3DTrack (TTrack *, bool=true) |
void | searchAxialCand (AList< TMLink > &, const AList< TMLink > &, const TCircle *, const int, const unsigned, const double) |
void | searchAxialCand (AList< TMLink > &, const AList< TMLink > &, const TCircle *, const int, const unsigned, const double) |
unsigned | searchHits (AList< TMLink > &, const AList< TMLink > &, const TCircle *, const double) const |
unsigned | searchHits (const TMLink *, const TCircle *, const double) const |
unsigned | searchHits (AList< TMLink > &, const AList< TMLink > &, const TCircle *, const double) const |
unsigned | searchHits (const TMLink *, const TCircle *, const double) const |
void | searchSegment (TMLink *, AList< TMLink > &, AList< TMLink > &, TSegmentCurl *) |
void | searchSegment (TMLink *, AList< TMLink > &, AList< TMLink > &, TSegmentCurl *) |
void | searchStereoCand (AList< TMLink > &, const AList< TMLink > &, const TCircle *, const int, const unsigned, const double) |
void | searchStereoCand (AList< TMLink > &, const AList< TMLink > &, const TCircle *, const int, const unsigned, const double) |
void | setNeighboringWires (TMLink *, const TMLink *) |
void | setNeighboringWires (TMLink *, const TMLink *) |
int | trace2DTrack (TCircle *) |
int | trace2DTrack (TCircle *) |
int | trace3DTrack (TTrack *) |
int | trace3DTrack (TTrack *) |
void | writeSegment (const AList< TMLink > &, const int type=0) |
void | writeSegment (const AList< TMLink > &, const int type=0) |
Private Attributes | |
AList< TTrack > | m_2dTracks |
AList< TTrack > | m_2dTracks |
AList< TMLink > | m_allAxialHitsOriginal |
AList< TMLink > | m_allAxialHitsOriginal |
AList< TCircle > | m_allCircles |
AList< TCircle > | m_allCircles |
AList< TMLink > | m_allStereoHitsOriginal |
AList< TMLink > | m_allStereoHitsOriginal |
AList< TTrack > | m_allTracks |
AList< TTrack > | m_allTracks |
TBuilderCurl | m_builder |
AList< TCircle > | m_circles |
AList< TCircle > | m_circles |
bool | m_debugCdcFrame |
int | m_debugFileNumber |
int | m_debugPlotFlag |
THelixFitter | m_fitter |
AList< TMDCWireHit > | m_hitsOnInnerSuperLayer |
AList< TMDCWireHit > | m_hitsOnInnerSuperLayer |
TCurlFinderParameter | m_param |
AList< TMLink > | m_removedHits |
AList< TMLink > | m_removedHits |
AList< TSegmentCurl > | m_segmentList |
AList< TSegmentCurl > | m_segmentList |
AList< TTrack > | m_svdTracks |
AList< TTrack > | m_svdTracks |
AList< TTrack > | m_tracks |
AList< TTrack > | m_tracks |
TMSelector | m_trackSelector |
AList< TMLink > | m_unusedAxialHits |
AList< TMLink > | m_unusedAxialHits |
AList< TMLink > | m_unusedAxialHitsOnEachLayer [19] |
AList< TMLink > | m_unusedAxialHitsOnEachLayer [19] |
AList< TMLink > | m_unusedAxialHitsOnEachSuperLayer [5] |
AList< TMLink > | m_unusedAxialHitsOnEachSuperLayer [5] |
AList< TMLink > | m_unusedAxialHitsOriginal |
AList< TMLink > | m_unusedAxialHitsOriginal |
AList< TMLink > | m_unusedStereoHits |
AList< TMLink > | m_unusedStereoHits |
AList< TMLink > | m_unusedStereoHitsOnEachLayer [24] |
AList< TMLink > | m_unusedStereoHitsOnEachLayer [24] |
AList< TMLink > | m_unusedStereoHitsOnEachSuperLayer [6] |
AList< TMLink > | m_unusedStereoHitsOnEachSuperLayer [6] |
AList< TMLink > | m_unusedStereoHitsOriginal |
AList< TMLink > | m_unusedStereoHitsOriginal |
|
00044 : m_builder("CurlBuilder"), 00045 m_fitter("TCurlFinder Fitter"), 00046 m_debugCdcFrame(false), 00047 m_debugPlotFlag(0), 00048 m_debugFileNumber(0) { 00049 // *****NOTE***** 00050 // Do not use this!!!!! 00051 // Because parameters can not be set correctly. 00052 }
|
|
00164 { 00165 }
|
|
00103 : m_builder("CurlBuilder"), 00104 m_fitter("TCurlFinder Fitter"), 00105 m_debugCdcFrame(false), 00106 m_debugPlotFlag(0), 00107 m_debugFileNumber(0) { 00108 //...Set Parameter 00109 m_param.MIN_SEGMENT = min_segment; 00110 m_param.MIN_SALVAGE = min_salvage; 00111 m_param.BAD_DISTANCE_FOR_SALVAGE = bad_distance_for_salvage; 00112 m_param.GOOD_DISTANCE_FOR_SALVAGE = good_distance_for_salvage; 00113 m_param.MIN_SEQUENCE = min_sequence; 00114 m_param.MAX_FULLWIRE = min_fullwire; 00115 m_param.RANGE_FOR_AXIAL_SEARCH = range_for_axial_search; 00116 m_param.RANGE_FOR_STEREO_SEARCH = range_for_stereo_search; 00117 m_param.SUPERLAYER_FOR_STEREO_SEARCH = superlayer_for_stereo_search; 00118 m_param.RANGE_FOR_AXIAL_LAST2D_SEARCH = range_for_axial_last2d_search; 00119 m_param.RANGE_FOR_STEREO_LAST2D_SEARCH = range_for_stereo_last2d_search; 00120 m_param.TRACE2D_DISTANCE = trace2d_distance; 00121 m_param.TRACE2D_FIRST_SUPERLAYER = trace2d_first_distance; 00122 m_param.TRACE3D_DISTANCE = trace3d_distance; 00123 m_param.DETERMINE_ONE_TRACK = determine_one_track; 00124 // 00125 m_param.SELECTOR_MAX_IMPACT = selector_max_impact; 00126 m_param.SELECTOR_MAX_SIGMA = selector_max_sigma; 00127 m_param.SELECTOR_STRANGE_PZ = selector_strange_pz; 00128 m_param.SELECTOR_REPLACE_DZ = selector_replace_dz; 00129 // 00130 m_param.STEREO_2DFIND = stereo_2dfind; 00131 m_param.MERGE_EXE = merge_exe; 00132 m_param.MERGE_RATIO = merge_ratio; 00133 m_param.MERGE_Z_DIFF = merge_z_diff; 00134 m_param.MASK_DISTANCE = mask_distance; 00135 m_param.RATIO_USED_WIRE = ratio_used_wire; 00136 m_param.RANGE_FOR_STEREO_FIRST = range_for_stereo1; 00137 m_param.RANGE_FOR_STEREO_SECOND = range_for_stereo2; 00138 m_param.RANGE_FOR_STEREO_THIRD = range_for_stereo3; 00139 m_param.RANGE_FOR_STEREO_FORTH = range_for_stereo4; 00140 m_param.RANGE_FOR_STEREO_FIFTH = range_for_stereo5; 00141 m_param.RANGE_FOR_STEREO_SIXTH = range_for_stereo6; 00142 // 00143 m_param.Z_CUT = z_cut; 00144 m_param.Z_DIFF_FOR_LAST_ATTEND = z_diff_for_last_attend; 00145 m_param.SVD_RECONSTRUCTION = svd_reconstruction; 00146 m_param.MIN_SVD_ELECTRONS = min_svd_electrons; 00147 m_param.ON_CORRECTION = on_correction; 00148 m_param.OUTPUT_2DTRACKS = output_2dtracks; 00149 m_param.CURL_VERSION = curl_version; 00150 m_param.now(); 00151 //jialk 00152 m_param.minimum_seedLength = minimum_seedLength; 00153 m_param.minimum_2DTrackLength = minimum_2DTrackLength; 00154 m_param.minimum_3DTrackLength = minimum_3DTrackLength; 00155 m_param.minimum_closeHitsLength = minimum_closeHitsLength; 00156 m_param.MIN_RADIUS_OF_STRANGE_TRACK = MIN_RADIUS_OF_STRANGE_TRACK; 00157 m_param.ULTIMATE_MIN_RADIUS_OF_STRANGE_TRACK = ULTIMATE_MIN_RADIUS_OF_STRANGE_TRACK; 00158 00159 00160 //...Set up TBuilder... 00161 m_builder.setParam(m_param); 00162 }
|
|
|
|
|
|
|
|
|
|
01433 { 01434 // 3D trks 01435 for(int i=0,size=m_tracks.length();i<size;++i) { 01436 m_tracks[i]->assign(WireHitCurlFinder); 01437 m_tracks[i]->finder(TrackCurlFinder); 01438 // m_tracks[i]->assign(WireHitCurlFinder, TrackCurlFinder | TrackValid | Track3D); 01439 } 01440 01441 // 2D trks 01442 for(int i=0,size=m_2dTracks.length();i<size;++i) { 01443 m_2dTracks[i]->assign(WireHitCurlFinder); 01444 m_2dTracks[i]->finder(TrackCurlFinder); 01445 } 01446 }
|
|
|
|
01508 { 01509 unsigned nA(nAxialHits(fabs(circle->radius())*2.0)); 01510 01511 unsigned nMA = static_cast<unsigned>(floor(m_param.RATIO_USED_WIRE*static_cast<double>(nA))); 01512 if(nMA < 3)nMA = 3; 01513 01514 unsigned nAhits(0), nShits(0); 01515 for(unsigned i=0,size=circle->nLinks();i<size;++i){ 01516 if((circle->links()[i])->wire()->axial())++nAhits; 01517 else ++nShits; 01518 } 01519 #if DEBUG_CURL_DUMP 01520 if(nAhits < nMA){ 01521 std::cout << "(TCurlFinder) 2D:Fail...checking axial wires # = " 01522 << nAhits << " < " << nMA << std::endl; 01523 } 01524 #endif 01525 if(nAhits >= nMA)return true; 01526 return false; 01527 }
|
|
|
|
01346 { 01347 if(m_2dTracks.length() == 0)return; 01348 AList<TMLink> allWires_3Dtrks; 01349 for(int i=0;i<m_tracks.length();++i){ 01350 allWires_3Dtrks.append(m_tracks[i]->links()); 01351 } 01352 //cout << "ALL Wire(3D) " << allWires_3Dtrks.length() << endl; 01353 01354 for(int i=0;i<m_2dTracks.length();++i){ 01355 AList<TMLink> usedWires; 01356 for(int j=0;j<m_2dTracks[i]->nLinks();++j){ 01357 int ok = 1; 01358 for(int k=0;k<allWires_3Dtrks.length();++k){ 01359 if(m_2dTracks[i]->links()[j]->wire()->id() == 01360 allWires_3Dtrks[k]->wire()->id()){ 01361 ok = 0; 01362 break; 01363 } 01364 } 01365 if(ok == 0){ 01366 usedWires.append(m_2dTracks[i]->links()[j]); 01367 } 01368 } 01369 //cout << i << " : used # " << usedWires.length() 01370 // << ", all # " << m_2dTracks[i]->nLinks() << endl; 01371 m_2dTracks[i]->remove(usedWires); 01372 } 01373 }
|
|
|
|
01530 { 01531 trace3DTrack(track); 01532 unsigned nA = 0, nS = 0; 01533 for(unsigned i=0,size=track->nLinks();i<size;++i){ 01534 if(!(track->links()[i]->hit()->state() & WireHitFittingValid))continue; 01535 if(track->links()[i]->wire()->stereo())++nS; 01536 else ++nA; 01537 if(nA >= 3 && nS >= 2)return true; 01538 } 01539 m_tracks.remove(track); 01540 #if DEBUG_CURL_DUMP 01541 std::cout << "(TCurlFinder) 3D:Checked...Fail...removing this track. Valid Axial # = " 01542 << nA << ", Stereo # = " << nS << std::endl; 01543 #endif 01544 return false; 01545 }
|
|
|
|
02181 { 02182 if(cand.length() == 0)return 0; 02183 AList<TMLink> tmp; 02184 for(unsigned i = 0, size1 = cand.length(), size2 = link.length(); i < size1; ++i){ 02185 for(unsigned j = 0; j < size2; ++j){ 02186 if((cand[i])->wire()->id() == (link[j])->wire()->id()){ 02187 tmp.append(cand[i]); 02188 break; 02189 } 02190 } 02191 } 02192 cand.remove(tmp); 02193 if(cand.length() > 0)return 1; 02194 return 0; 02195 }
|
|
Utility of #2.
|
|
Utility of #2.
00988 { 00989 for(unsigned i = 0, length = m_segmentList.length(); i < length; ++i){ 00990 if(m_segmentList[i]->maxLocalLayerId() != m_segmentList[i]->layerIdOfMaxSeq() && 00991 m_segmentList[i]->maxSeq() >= m_param.MIN_SEQUENCE){ 00992 unsigned innerHits = 0; 00993 if(m_segmentList[i]->layerIdOfMaxSeq() == 0)continue; 00994 TSegmentCurl *outer = new TSegmentCurl(m_segmentList[i]->superLayerId(), 00995 m_segmentList[i]->maxLocalLayerId()); 00996 for(unsigned j = 0, size = m_segmentList[i]->size(); j < size; ++j){ 00997 if(m_segmentList[i]->layerIdOfMaxSeq()+1 <= 00998 (m_segmentList[i]->list())[j]->hit()->wire()->localLayerId() && 00999 (m_segmentList[i]->list())[j]->hit()->wire()->localLayerId() <= 01000 m_segmentList[i]->maxLocalLayerId()){ 01001 outer->append((m_segmentList[i]->list())[j]); 01002 }else if(m_segmentList[i]->layerIdOfMaxSeq()-1 >= 01003 (m_segmentList[i]->list())[j]->hit()->wire()->localLayerId()){ 01004 ++innerHits; 01005 } 01006 } 01007 if(innerHits != 0 && outer->size() != 0){ 01008 #if DEBUG_CURL_DUMP 01009 std::cout << "(TCurlFinder)removing some wires in the segment." << std::endl; 01010 #endif 01011 #if DEBUG_CURL_SEGMENT 01012 //writeSegment(m_segmentList[i]->list(),1); 01013 #endif 01014 m_segmentList[i]->remove(const_cast< AList<TMLink>& >(outer->list())); 01015 outer->removeAll(); 01016 delete outer; 01017 }else{ 01018 outer->removeAll(); 01019 delete outer; 01020 } 01021 } 01022 } 01023 }
|
|
|
|
00944 { 00945 int max = 10; 00946 int hmax = 5; 00947 AList<TSegmentCurl> removeList; 00948 for(unsigned i = 0, length = m_segmentList.length(); i < length; ++i){ 00949 int lSize = max*3+hmax*3; 00950 int lNum = 3; 00951 if(m_segmentList[i]->superLayerId() == 1 || 00952 m_segmentList[i]->superLayerId() == 3){ 00953 lSize = max*2+hmax; 00954 lNum = 2; 00955 } 00956 if(m_segmentList[i]->superLayerId() == 5 || 00957 m_segmentList[i]->superLayerId() == 7 || 00958 m_segmentList[i]->superLayerId() == 9){ 00959 lSize = max*2+hmax*2; 00960 lNum = 2; 00961 } 00962 if(m_segmentList[i]->superLayerId() == 4 || 00963 m_segmentList[i]->superLayerId() == 6 || 00964 m_segmentList[i]->superLayerId() == 8 || 00965 m_segmentList[i]->superLayerId() == 10)lSize = max*3+hmax*2; 00966 if(m_segmentList[i]->size() < lSize)continue; 00967 int nL = 0; 00968 for(unsigned j=0,size=m_segmentList[i]->maxLocalLayerId();j<size;++j){ 00969 if(m_segmentList[i]->sizeOfLayer(j) >= max)++nL; 00970 } 00971 if(nL < lNum)continue; 00972 removeList.append(m_segmentList[i]); 00973 //plotSegment(m_segmentList[i]->list(),0); 00974 #if DEBUG_CURL_SEGMENT 00975 //writeSegment(m_segmentList[i]->list(),2); 00976 #endif 00977 } 00978 if(removeList.length() >= 1){ 00979 #if DEBUG_CURL_DUMP 00980 std::cout << "(TCurlFinder)removing large segments: # = " << removeList.length() << std::endl; 00981 #endif 00982 m_segmentList.remove(removeList); 00983 HepAListDeleteAll(removeList); 00984 } 00985 }
|
|
|
|
00906 { 00907 int max = m_param.MAX_FULLWIRE; 00908 int nMinWires; 00909 if(max == 7)nMinWires = 21; 00910 else if(max == 6)nMinWires = 19; 00911 else if(max == 5)nMinWires = 18; 00912 else if(max == 4)nMinWires = 16; 00913 else if(max == 3)nMinWires = 14; 00914 else if(max == 2)nMinWires = 12; 00915 else if(max == 1)nMinWires = 10; 00916 else if(max == 0)nMinWires = 7; 00917 00918 AList<TSegmentCurl> removeList; 00919 for(unsigned i = 0, length = m_segmentList.length(); i < length; ++i){ 00920 if(m_segmentList[i]->size() >= nMinWires){ 00921 unsigned nWires = m_segmentList[i]->size(); 00922 unsigned n6Wires = 0; 00923 for(unsigned j=0;j<nWires;++j){ 00924 if(((m_segmentList[i]->list())[j])->neighbor(5))++n6Wires; 00925 if(n6Wires > max)break; 00926 } 00927 if(n6Wires <= max)continue; 00928 removeList.append(m_segmentList[i]); 00929 #if DEBUG_CURL_SEGMENT 00930 writeSegment(m_segmentList[i]->list(),3); 00931 #endif 00932 } 00933 } 00934 if(removeList.length() >= 1){ 00935 #if DEBUG_CURL_DUMP 00936 std::cout << "(TCurlFinder)removing large segments: # = " << removeList.length() << std::endl; 00937 #endif 00938 m_segmentList.remove(removeList); 00939 HepAListDeleteAll(removeList); 00940 } 00941 }
|
|
|
|
01376 { 01377 unsigned nT = list.length(); 01378 if(nT <= 1)return; 01379 for(unsigned i=0;i<nT;++i){ 01380 if(list[i]->daughter()){ 01381 int isHere = 0; 01382 for(unsigned j=0;j<nT;++j){ 01383 if(i != j && 01384 list[i]->daughter() == list[j]){ 01385 isHere = 1; 01386 break; 01387 } 01388 } 01389 if(isHere == 0){ 01390 list[i]->daughter(NULL); 01391 } 01392 } 01393 } 01394 }
|
|
Sub Main Section #2.
|
|
Sub Main Section #2.
00888 { 00889 // A sub main function ...called by "doit". 00890 #if DEBUG_CURL_DUMP 00891 std::cout << "(TCurlFinder)checking and sorting segments..." << std::endl; 00892 #endif 00893 unsigned length = m_segmentList.length(); 00894 if(length == 0)return 0; 00895 checkExceptionalSegmentsType03();//...exception #3 00896 //checkExceptionalSegmentsType02();//...exception #2 00897 checkExceptionalSegmentsType01();//...exception #1 00898 m_segmentList.sort(sortBySequentialLength); 00899 #if DEBUG_CURL_DUMP 00900 std::cout << "(TCurlFinder)...done check and sort of segments." << std::endl; 00901 #endif 00902 return 1; 00903 }
|
|
cleans all members of this class
Implements TFinderBase. |
|
cleans all members of this class
Implements TFinderBase. 00548 { 00549 // This is to clear this Class(TCurlFinder) in TrkReco.cc . 00550 // Private members are cleaned. 00551 HepAListDeleteAll(m_allAxialHitsOriginal); 00552 HepAListDeleteAll(m_allStereoHitsOriginal); 00553 HepAListDeleteAll(m_segmentList); 00554 HepAListDeleteAll(m_allCircles); 00555 HepAListDeleteAll(m_allTracks); 00556 00557 m_unusedAxialHitsOriginal.removeAll(); 00558 m_unusedStereoHitsOriginal.removeAll(); 00559 m_unusedAxialHits.removeAll(); 00560 m_unusedStereoHits.removeAll(); 00561 m_removedHits.removeAll(); 00562 m_circles.removeAll(); 00563 m_tracks.removeAll(); 00564 m_2dTracks.removeAll(); 00565 //Liuqg 060917 00566 for(int i=0;i<19;++i) 00567 m_unusedAxialHitsOnEachLayer[i].removeAll(); 00568 for(int i=0;i<24;++i) 00569 m_unusedStereoHitsOnEachLayer[i].removeAll(); 00570 for(int i=0;i<5;++i) 00571 m_unusedAxialHitsOnEachSuperLayer[i].removeAll(); 00572 for(int i=0;i<6;++i) 00573 m_unusedStereoHitsOnEachSuperLayer[i].removeAll(); 00574 m_hitsOnInnerSuperLayer.removeAll(); 00575 }
|
|
|
|
00824 { 00825 // ...makes segments from AList<TMLink> &list, in every superlayer. 00826 // These segments are add to _segmentList.(# of segments >= MIN_SEGMENT) 00827 AList<TMLink> seedStock; 00828 do{ 00829 TSegmentCurl *segment = new TSegmentCurl(list[0]->hit()->wire()->superLayerId(), 00830 maxLocalLayerId(list[0]->hit()->wire() 00831 ->superLayerId())); 00832 00833 segment->append(list[0]); 00834 TMLink *seed = list[0]; 00835 list.remove(seed); 00836 next: 00837 searchSegment(seed, list, seedStock, segment); 00838 if(seedStock.length() > 0){ 00839 seed = seedStock[0]; 00840 seedStock.remove(seed); 00841 goto next; 00842 }else if(segment->size() >= m_param.MIN_SEGMENT){ 00843 segment->update(); 00844 m_segmentList.append(segment); 00845 #if DEBUG_CURL_DUMP 00846 std::cout << "Segment # = " << m_segmentList.length() << std::endl; 00847 segment->dump(); 00848 #endif 00849 }else{ 00850 delete segment; 00851 } 00852 }while(list.length() > 0); 00853 }
|
|
|
|
00793 { 00794 //Liuqg 00795 for(int i=0;i<4;++i){ 00796 if(m_unusedAxialHitsOnEachLayer[i].length() > 0) 00797 m_unusedAxialHitsOnEachSuperLayer[0].append(m_unusedAxialHitsOnEachLayer[i]); 00798 if(m_unusedAxialHitsOnEachLayer[i+4].length() > 0) 00799 m_unusedAxialHitsOnEachSuperLayer[1].append(m_unusedAxialHitsOnEachLayer[i+4]); 00800 if(m_unusedAxialHitsOnEachLayer[i+8].length() > 0) 00801 m_unusedAxialHitsOnEachSuperLayer[2].append(m_unusedAxialHitsOnEachLayer[i+8]); 00802 if(m_unusedAxialHitsOnEachLayer[i+12].length() > 0) 00803 m_unusedAxialHitsOnEachSuperLayer[3].append(m_unusedAxialHitsOnEachLayer[i+12]); 00804 if(m_unusedAxialHitsOnEachLayer[i+16].length() > 0 && i+16 < 19) 00805 m_unusedAxialHitsOnEachSuperLayer[4].append(m_unusedAxialHitsOnEachLayer[i+16]); 00806 } 00807 for(int i=0;i<4;++i){ 00808 if(m_unusedStereoHitsOnEachLayer[i].length() > 0) 00809 m_unusedStereoHitsOnEachSuperLayer[0].append(m_unusedStereoHitsOnEachLayer[i]); 00810 if(m_unusedStereoHitsOnEachLayer[i+4].length() > 0) 00811 m_unusedStereoHitsOnEachSuperLayer[1].append(m_unusedStereoHitsOnEachLayer[i+4]); 00812 if(m_unusedStereoHitsOnEachLayer[i+8].length() > 0) 00813 m_unusedStereoHitsOnEachSuperLayer[2].append(m_unusedStereoHitsOnEachLayer[i+8]); 00814 if(m_unusedStereoHitsOnEachLayer[i+12].length() > 0) 00815 m_unusedStereoHitsOnEachSuperLayer[3].append(m_unusedStereoHitsOnEachLayer[i+12]); 00816 if(m_unusedStereoHitsOnEachLayer[i+16].length() > 0) 00817 m_unusedStereoHitsOnEachSuperLayer[4].append(m_unusedStereoHitsOnEachLayer[i+16]); 00818 if(m_unusedStereoHitsOnEachLayer[i+20].length() > 0) 00819 m_unusedStereoHitsOnEachSuperLayer[5].append(m_unusedStereoHitsOnEachLayer[i+20]); 00820 } 00821 }
|
|
|
|
03194 { 03195 #if DEBUG_CURL_DUMP 03196 unsigned nSeg = m_segmentList.length(); 03197 unsigned nFound = 0; 03198 for(unsigned i=0;i<nSeg;++i){ 03199 unsigned nWire = m_segmentList[i]->list().length(); 03200 unsigned mFound = 0; 03201 for(unsigned j=0;j<nWire;++j){ 03202 if(((m_segmentList[i]->list())[j])->wire()->layerId() == layerId && 03203 ((m_segmentList[i]->list())[j])->wire()->localId() == localId)++mFound; 03204 if(((m_segmentList[i]->list())[j])->wire()->layerId() == layerId2 && 03205 ((m_segmentList[i]->list())[j])->wire()->localId() == localId2)++mFound; 03206 } 03207 if(mFound != 0 && mFound != 2){ 03208 std::cout << "(TCurlFinder: Warning) Segment is inconsistency(0)!! mFound = " << mFound << std::endl; 03209 } 03210 if(mFound == 2)++nFound; 03211 } 03212 if(nFound != 1) 03213 std::cout << "(TCurlFinder: Warning) Segment is inconsistency(1)!! nFound = " << nFound << std::endl; 03214 #endif 03215 return; 03216 }
|
|
|
|
03219 { 03220 #if DEBUG_CURL_SEGMENT 03221 unsigned nSeg = m_segmentList.length(); 03222 unsigned nWire = 0; 03223 for(unsigned i=0;i<nSeg;++i)nWire += m_segmentList[i]->list().length(); 03224 03225 unsigned nWireOriginal = m_unusedAxialHitsOriginal.length()+ 03226 m_unusedStereoHitsOriginal.length(); 03227 03228 std::cout << "(TCurlFinder: SelfChecker) Segment Parts" << std::endl; 03229 std::cout << " MIN_SEGMENT = " << m_param.MIN_SEGMENT << std::endl; 03230 std::cout << " Wire # of Orinal List = " << nWireOriginal << std::endl; 03231 std::cout << " Wire # of Segments = " << nWire << std::endl; 03232 std::cout << " If MIN_SEGMENT <= 1, above numbers should be same." << std::endl; 03233 std::cout << " If MIN_SEGMENT > 1, former >= latter." << std::endl; 03234 #endif 03235 return; 03236 }
|
|
|
|
03112 { 03113 #if DEBUG_CURL_SEGMENT 03114 // Slow Checker(CPU time increases!!) 03115 // Neighboring wires should be included in the same segement. 03116 std::cout << "(TCurlFinder)checking consistency of segement..." << std::endl; 03117 unsigned nA = m_unusedAxialHitsOriginal.length(); 03118 if(nA >= 2){ 03119 for(unsigned i=0;i<nA-1;++i){ 03120 int superLayerId = (int)(m_unusedAxialHitsOriginal[i]->wire()->superLayerId()); 03121 int layerId = (int)(m_unusedAxialHitsOriginal[i]->wire()->layerId()); 03122 int localId = (int)(m_unusedAxialHitsOriginal[i]->wire()->localId()); 03123 int localIdP = (int)(m_unusedAxialHitsOriginal[i]->wire()->localIdForPlus()); 03124 int localIdM = (int)(m_unusedAxialHitsOriginal[i]->wire()->localIdForMinus()); 03125 for(unsigned j=i+1;j<nA;++j){ 03126 int superLayerId2 = (int)(m_unusedAxialHitsOriginal[j]->wire()->superLayerId()); 03127 int layerId2 = (int)(m_unusedAxialHitsOriginal[j]->wire()->layerId()); 03128 int localId2 = (int)(m_unusedAxialHitsOriginal[j]->wire()->localId()); 03129 if(superLayerId == superLayerId2){ 03130 if(layerId2 == layerId){ 03131 if(localIdP+1 == localId2 || localIdM-1 == localId2) 03132 debugCheckSegments(localId, layerId, 03133 localId2,layerId2); 03134 }else if(layerId2 == layerId-1 || layerId2 == layerId+1){ 03135 if(offset(layerId) == offset(layerId2)){ 03136 std::cout << "(TCurlFinder: Waring) Offset is same at the same superlayer!!" << std::endl; 03137 }else if(offset(layerId) > offset(layerId2)){ 03138 if(localId == localId2 || localIdP+1 == localId2) 03139 debugCheckSegments(localId, layerId, 03140 localId2,layerId2); 03141 }else{ 03142 if(localId == localId2 || localIdM-1 == localId2) 03143 debugCheckSegments(localId, layerId, 03144 localId2,layerId2); 03145 } 03146 } 03147 } 03148 } 03149 } 03150 } 03151 unsigned nS = m_unusedStereoHitsOriginal.length(); 03152 if(nS >= 2){ 03153 for(unsigned i=0;i<nS-1;++i){ 03154 int superLayerId = (int)(m_unusedStereoHitsOriginal[i]->wire()->superLayerId()); 03155 int layerId = (int)(m_unusedStereoHitsOriginal[i]->wire()->layerId()); 03156 int localId = (int)(m_unusedStereoHitsOriginal[i]->wire()->localId()); 03157 int localIdP = (int)(m_unusedStereoHitsOriginal[i]->wire()->localIdForPlus()); 03158 int localIdM = (int)(m_unusedStereoHitsOriginal[i]->wire()->localIdForMinus()); 03159 for(unsigned j=i+1;j<nS;++j){ 03160 int superLayerId2 = (int)(m_unusedStereoHitsOriginal[j]->wire()->superLayerId()); 03161 int layerId2 = (int)(m_unusedStereoHitsOriginal[j]->wire()->layerId()); 03162 int localId2 = (int)(m_unusedStereoHitsOriginal[j]->wire()->localId()); 03163 if(superLayerId == superLayerId2){ 03164 if(layerId2 == layerId){ 03165 if(localIdP+1 == localId2 || localIdM-1 == localId2) 03166 debugCheckSegments(localId, layerId, 03167 localId2,layerId2); 03168 }else if(layerId2 == layerId-1 || layerId2 == layerId+1){ 03169 if(offset(layerId) == offset(layerId2)){ 03170 std::cout << "(TCurlFinder: Waring) Offset is same at the same superlayer!!" << std::endl; 03171 }else if(offset(layerId) > offset(layerId2)){ 03172 if(localId == localId2 || localIdP+1 == localId2) 03173 debugCheckSegments(localId, layerId, 03174 localId2,layerId2); 03175 }else{ 03176 if(localId == localId2 || localIdM-1 == localId2) 03177 debugCheckSegments(localId, layerId, 03178 localId2,layerId2); 03179 } 03180 } 03181 } 03182 } 03183 } 03184 } 03185 std::cout << "(TCurlFinder)...done check of segement!" << std::endl; 03186 std::cout << "(TCurlFinder)...If no warning message exists, check of segement is complete!" << std::endl; 03187 std::cout << "(TCurlFinder)...Note: a segment size should be 1 or 2 to use this debugger." << std::endl; 03188 #endif 03189 return; 03190 }
|
|
|
|
03239 { 03240 #if DEBUG_CURL_SEGMENT 03241 03242 #define DEBUG_TMP_N_CURL 50 03243 03244 unsigned nSeg = m_segmentList.length(); 03245 unsigned nWire[DEBUG_TMP_N_CURL] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 03246 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 03247 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 03248 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 03249 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 03250 for(unsigned i=0;i<nSeg;++i){ 03251 if(m_segmentList[i]->list().length() < DEBUG_TMP_N_CURL) 03252 ++(nWire[m_segmentList[i]->list().length()]); 03253 else 03254 ++(nWire[DEBUG_TMP_N_CURL-1]); 03255 } 03256 std::ifstream fin("tmp.wire.data"); 03257 unsigned nTotalWire[DEBUG_TMP_N_CURL] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 03258 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 03259 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 03260 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 03261 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 03262 if(fin){ 03263 for(int i=0;i<DEBUG_TMP_N_CURL;++i)fin >> nTotalWire[i]; 03264 }else{ 03265 std::cout << "(TCurlFinder) tmp.wire.data does not exist!" << std::endl; 03266 } 03267 for(int i=0;i<DEBUG_TMP_N_CURL;++i)nTotalWire[i] += nWire[i]; 03268 std::ofstream fout("tmp.wire.data"); 03269 if(fout){ 03270 fout << nTotalWire[0]; 03271 for(int i=1;i<DEBUG_TMP_N_CURL;++i)fout << " " << nTotalWire[i]; 03272 }else{ 03273 std::cout << "(TCurlFinder) tmp.wire.data can not be made!" << std::endl; 03274 } 03275 #endif 03276 return; 03277 }
|
|
sets debug level.
|
|
returns debug level.
|
|
sets debug level.
00096 {
00097 return _debugLevel = a;
00098 }
|
|
returns debug level.
00090 {
00091 return _debugLevel;
00092 }
|
|
|
|
Utility Section.
|
|
01837 { 01838 // if(link.wire()->axial()){ Liuqg 060926 01839 if((link.wire()->superLayerId() > 1 && link.wire()->superLayerId() <5) || link.wire()->superLayerId() >8 ){ 01840 //...axial 01841 double d = distance(track.helix().center().x()-link.xyPosition().x(), 01842 track.helix().center().y()-link.xyPosition().y()); 01843 double diff = fabs(d - fabs(track.helix().radius())); 01844 return fabs(link.hit()->drift()-diff); 01845 } 01846 //...stereo 01847 HepPoint3D xc(track.helix().center()); 01848 HepPoint3D xw(link.xyPosition()); 01849 HepPoint3D xt(track.helix().x()); 01850 HepVector3D v0(xt-xc), v1(xw-xc); 01851 double vCrs(v0.x() * v1.y() - v0.y() * v1.x()); 01852 double vDot(v0.x() * v1.x() + v0.y() * v1.y()); 01853 double dPhi = atan2(vCrs, vDot); 01854 Vector a(track.helix().a()); 01855 double kappa = a[2]; 01856 double phi0 = a[1]; 01857 01858 double rho = m_param.ALPHA_SAME_WITH_HELIX/kappa; 01859 double tanLambda = a[4]; 01860 HepVector3D v = link.wire()->direction(); 01861 Vector c(3); 01862 c = HepPoint3D(link.wire()->backwardPosition()-(v*link.wire()->backwardPosition())*v); 01863 01864 HepDiagMatrix e(3,1); 01865 Matrix t(3, 3); 01866 t[0][0] = v.x() * v.x(); 01867 t[0][1] = v.x() * v.y(); 01868 t[0][2] = v.x() * v.z(); 01869 t[1][0] = t[0][1]; 01870 t[1][1] = v.y() * v.y(); 01871 t[1][2] = v.y() * v.z(); 01872 t[2][0] = t[0][2]; 01873 t[2][1] = t[1][2]; 01874 t[2][2] = v.z() * v.z(); 01875 t -= e; 01876 01877 double factor = 1.; 01878 unsigned nTrial = 0; 01879 01880 //...Cal. closest point(Newton method)... 01881 Vector x(3); 01882 Vector dXdPhi(3); 01883 Vector d2Xd2Phi(3); 01884 double fOld = 0.; // The initialization is not needed. 01885 const double convergence = 1.0e-5; 01886 while(nTrial < 100){ 01887 x = track.helix().x(dPhi); 01888 double cosPhi = cos(phi0+dPhi); 01889 double sinPhi = sin(phi0+dPhi); 01890 dXdPhi[0] = rho*sinPhi; 01891 dXdPhi[1] = - rho*cosPhi; 01892 dXdPhi[2] = - rho*tanLambda; 01893 01894 //...f = d(Distance) / d phi... 01895 double f = dot(c,dXdPhi)+dot(x,(t*dXdPhi)); 01896 01897 if(fabs(f) < convergence)break; 01898 if(nTrial > 0){ 01899 double eval = (1.-0.25*factor)*fabs(fOld)-fabs(f); 01900 if(eval <= 0.)factor *= 0.5; 01901 } 01902 //...Cal. next phi... 01903 d2Xd2Phi[0] = rho*cosPhi; 01904 d2Xd2Phi[1] = rho*sinPhi; 01905 d2Xd2Phi[2] = 0.; 01906 double df = dot(c, d2Xd2Phi)+ 01907 dot(dXdPhi, (t * dXdPhi))+ 01908 dot(x, (t * d2Xd2Phi)); 01909 dPhi -= factor * f / df; 01910 01911 fOld = f; 01912 ++nTrial; 01913 } 01914 01915 double beta = v*(track.helix().x(dPhi)-link.wire()->backwardPosition()); 01916 return fabs((link.wire()->backwardPosition()+beta*v-track.helix().x(dPhi)).mag()- 01917 link.hit()->drift()); 01918 }
|
|
Utility Section.
00238 {
00239 return sqrt(x*x+y*y);
00240 }
|
|
|
|
01397 { 01398 AList<TMLink> positive, negative; 01399 for(unsigned i = 0, size = circle->nLinks(); i < size; ++i){ 01400 if(circle->center().x()*circle->links()[i]->hit()->wire()->xyPosition().y() - 01401 circle->center().y()*circle->links()[i]->hit()->wire()->xyPosition().x() > 0.){ 01402 positive.append(circle->links()[i]); 01403 }else{ 01404 negative.append(circle->links()[i]); 01405 } 01406 } 01407 if(positive.length() > negative.length()){ 01408 circle->remove(negative); 01409 circle->property(1.,fabs(circle->radius()),circle->center()); 01410 if(negative.length() >= 3){ 01411 TCircle *new_circle = new TCircle(negative); 01412 m_allCircles.append(new_circle); 01413 new_circle->property(-1.,-1.*fabs(circle->radius()),circle->center()); 01414 return new_circle; 01415 }else{ 01416 return NULL; 01417 } 01418 }else{ 01419 circle->remove(positive); 01420 circle->property(-1.,-1.*fabs(circle->radius()),circle->center()); 01421 if(positive.length() >= 3){ 01422 TCircle *new_circle = new TCircle(positive); 01423 m_allCircles.append(new_circle); 01424 new_circle->property(1.,fabs(circle->radius()),circle->center()); 01425 return new_circle; 01426 }else{ 01427 return NULL; 01428 } 01429 } 01430 }
|
|
main function
Implements TFinderBase. |
|
main function
Implements TFinderBase. 00584 { 00585 #if (DEBUG_CURL_DUMP+DEBUG_CURL_GNUPLOT+DEBUG_CURL_MC) 00586 Belle_event_Manager &evtMgr = Belle_event_Manager::get_manager(); 00587 debugMcFlag = 1; 00588 if(evtMgr.count() != 0 && 00589 evtMgr[0].ExpMC() != 2)debugMcFlag = 0;// not MC 00590 m_debugCdcFrame = false; 00591 #endif 00592 #if !(DEBUG_CURL_MC) 00593 #if DEBUG_CURL_DUMP 00594 std::cout << "(TCurlFinder)Plot Menu : All Off = 0, Interactive = 1, All On = 2" << std::endl; 00595 cin >> m_debugPlotFlag; 00596 #endif 00597 // sub main functions #1, #2, #3 00598 //...#1 00599 makeWireHitsListsSegments(axialHits, stereoHits); 00600 #if DEBUG_CURL_SEGMENT 00601 std::cout << "(TCurlFinder)# of segment = " << m_segmentList.length() << std::endl; 00602 debugCheckSegments0(); 00603 debugCheckSegments1(); 00604 debugCheckSegments2(); 00605 #endif 00606 //...#2 00607 if(checkSortSegments() == 0)return 0; 00608 #if DEBUG_CURL_DUMP 00609 if(m_debugPlotFlag){ 00610 int noPlot = 1; 00611 if(m_debugPlotFlag == 1){ 00612 std::cout << "(TCurlFinder) Do you want to see Segment Plot? : yes = 1, no = other #" << std::endl; 00613 cin >> noPlot; 00614 } 00615 if(noPlot == 1){ 00616 for(int i=0;i<m_segmentList.length();++i) 00617 plotSegment(m_segmentList[i]->list(),0); 00618 } 00619 } 00620 #endif 00621 //...#3 00622 makeCurlTracks(tracks,tracks2D); 00623 #else 00624 makeWithMC(axialHits, stereoHits, tracks); 00625 #endif 00626 00627 //...iw 2001/01/26... 00628 unsigned n = tracks2D.length(); 00629 for (unsigned i = 0; i < n; i++) 00630 tracks2D[i]->quality(TrackQuality2D); 00631 //...iw end... 00632 return 0; 00633 }
|
|
sets flag to salvage hits.
Reimplemented in TConformalFinder0, and TConformalFinder0. |
|
sets flag to salvage hits.
Reimplemented in TConformalFinder0, and TConformalFinder0. 00108 {
00109 return a;
00110 }
|
|
sets flag to reconstruct 3D.
Reimplemented in TConformalFinder0, and TConformalFinder0. |
|
sets flag to reconstruct 3D.
Reimplemented in TConformalFinder0, and TConformalFinder0. 00102 {
00103 return a;
00104 }
|
|
dumps debug information.
Reimplemented in TConformalFinder, TConformalFinder0, TFastFinder, TPerfectFinder, TConformalFinder, TConformalFinder0, TFastFinder, and TPerfectFinder. |
|
dumps debug information.
Reimplemented in TConformalFinder, TConformalFinder0, TFastFinder, TPerfectFinder, TConformalFinder, TConformalFinder0, TFastFinder, and TPerfectFinder. 00023 { 00024 std::cout << pre; 00025 if ( msg.find("name") != std::string::npos 00026 || msg.find("version") != std::string::npos 00027 || msg.find("detail") != std::string::npos 00028 || msg == "") { 00029 std::cout << name() << "(" << version() << ")"; 00030 } 00031 if (msg.find("detail") != std::string::npos || msg.find("state") != std::string::npos) { 00032 std::cout << "Debug Level=" << _debugLevel; 00033 } 00034 std::cout << std::endl; 00035 }
|
|
Dump.
|
|
Dump.
02884 { 02885 #if DEBUG_CURL_DUMP 02886 for(int j=0;j<track->nLinks();++j){ 02887 std::cout << "Used Wire Info..."; 02888 if(track->links()[j]->hit()->wire()->axial()){ 02889 std::cout << "A:" << track->links()[j]->hit()->wire()->id() << ", "; 02890 }else{ 02891 std::cout << "S:" << track->links()[j]->hit()->wire()->id() << ", "; 02892 } 02893 if(debugMcFlag){ 02894 std::cout << ", HepTrackID = " << track->links()[j]->hit()->mc()->hep()->id(); 02895 std::cout << ", HepLundID = " << track->links()[j]->hit()->mc()->hep()->pType(); 02896 } 02897 double dist = distance(*track, *(track->links()[j])); 02898 if(dist > 2.)std::cout << ": Large Distance( >2cm ) = " << dist; 02899 std::cout << std::endl; 02900 } 02901 AList<TMLink> list=m_unusedAxialHits; 02902 list.append(m_unusedStereoHits); 02903 for(unsigned j=0, nList=list.length();j<nList;++j){ 02904 double dist = distance(*track, *(list[j])); 02905 std::cout << "Close Wire Info in ALL( <0.5cm )..."; 02906 if(dist < 0.5){ 02907 if(list[j]->hit()->wire()->axial()) 02908 std::cout << "CA:" << list[j]->hit()->wire()->id() << ", "; 02909 else 02910 std::cout << "CS:" << list[j]->hit()->wire()->id() << ", "; 02911 if(debugMcFlag){ 02912 std::cout << ", HepTrackID = " << list[j]->hit()->mc()->hep()->id(); 02913 std::cout << ", HepLundID = " << list[j]->hit()->mc()->hep()->pType(); 02914 } 02915 std::cout << ", Distance = " << dist << std::endl; 02916 } 02917 } 02918 #endif 02919 return; 02920 }
|
|
|
|
02923 { 02924 #if DEBUG_CURL_DUMP 02925 unsigned size = track->nLinks(); 02926 if(size == 0)return; 02927 02928 set< int, less<int> > uniqueHepID; 02929 vector<int> hepID; 02930 vector<double> ratio; 02931 for(int i=0;i<size;++i){ 02932 uniqueHepID.insert(track->links()[i]->hit()->mc()->hep()->id()); 02933 hepID.push_back(track->links()[i]->hit()->mc()->hep()->id()); 02934 //std::cout << i << " : " << track->links()[i]->hit()->mc()->hep()->id() << std::endl; 02935 } 02936 02937 set< int, less<int> >::iterator u = uniqueHepID.begin(); 02938 vector<int>::size_type sizeInt; 02939 for(unsigned i=0;i<uniqueHepID.size();++i){ 02940 sizeInt = 0; 02941 count(hepID.begin(), hepID.end(), *u, sizeInt); 02942 ratio.push_back((static_cast<double>(sizeInt)/static_cast<double>(size))); 02943 //std::cout << "HepID = " << *u << ", Ratio = " << ratio[i] << " = " << sizeInt << "/" << size << std::endl; 02944 ++u; 02945 } 02946 02947 vector<double>::iterator m = max_element(ratio.begin(), ratio.end()); 02948 int maxIndex = 0; 02949 ::distance(ratio.begin(), m, maxIndex); 02950 u = uniqueHepID.begin(); 02951 advance(u,maxIndex); 02952 //std::cout << "MAX HepID = " << *u << ", Ratio = " << ratio[maxIndex] << std::endl; 02953 std::cout << "Ratio " << ratio[maxIndex] << std::endl; 02954 for(int i=0;i<size;++i){ 02955 if(track->links()[i]->hit()->wire()->axial())std::cout << "A "; 02956 else std::cout << "S "; 02957 02958 double dist = distance(*track, *(track->links()[i])); 02959 if(*u != track->links()[i]->hit()->mc()->hep()->id()){ 02960 std::cout << "Bad " << dist << std::endl; 02961 }else{ 02962 std::cout << "Good " << dist << std::endl; 02963 } 02964 } 02965 #endif 02966 return; 02967 }
|
|
|
|
02434 { 02435 // ...finds candidates in the "links". 02436 // ...Candidates mean |"track" - wire(from "links" elements)| < dRcut 02437 // ...returns these candidates("list"). 02438 double dRcut[11] = {m_param.RANGE_FOR_STEREO_FIRST, m_param.RANGE_FOR_STEREO_SECOND, 02439 0., 0., 02440 0., m_param.RANGE_FOR_STEREO_THIRD, 02441 m_param.RANGE_FOR_STEREO_FORTH, m_param.RANGE_FOR_STEREO_FIFTH, 02442 m_param.RANGE_FOR_STEREO_SIXTH, 0., 02443 0.}; 02444 double r = fabs(track.helix().curv()); 02445 double q = track.charge(); 02446 double x = track.helix().center().x(); 02447 double y = track.helix().center().y(); 02448 for(unsigned i = 0, size = links.length(); i < size; ++i){ 02449 if(fabs((links[i]->wire()->xyPosition() - track.helix().center()).mag() - r) < 02450 dRcut[links[i]->wire()->superLayerId()]){ 02451 if(q*(x*links[i]->wire()->xyPosition().y()-y*links[i]->wire()->xyPosition().x()) > 0.){ 02452 list.remove(links[i]); 02453 list.append(links[i]); 02454 TMLink *cand = findIsolatedCloseHits(links[i]); 02455 if(cand){ 02456 list.remove(cand); 02457 list.append(cand); 02458 } 02459 } 02460 } 02461 } 02462 return; 02463 }
|
|
|
|
00871 { 00872 // This is to search "TMLink *seed" in "AList<TMLink> &list". 00873 // Return is when found, the "TMLink *list[i]" 00874 // when not found, NULL. 00875 unsigned size = list.length(); 00876 if(size == 0)return NULL; 00877 for(unsigned i=0;i<size;++i){ 00878 if(seed == list[i])return list[i]; 00879 } 00880 return NULL; 00881 }
|
|
|
|
02213 { 02214 if(c.links().length() <= 3)return false; 02215 Lpav circle; 02216 // MDC 02217 for(int i=0;i<c.links().length();++i){ 02218 circle.add_point((c.links()[i])->wire()->xyPosition().x(), 02219 (c.links()[i])->wire()->xyPosition().y(),1.0); 02220 } 02221 circle.add_point(0.,0.,1.0); // IP Constraint 02222 if (circle.fit() < 0.0 || circle.kappa() == 0.0) return false; 02223 double xc = circle.center()[0]; 02224 double yc = circle.center()[1]; 02225 double r = circle.radius(); 02226 const int maxIte = 2; 02227 for(int ite=0;ite<maxIte;++ite){ 02228 Lpav circle2; 02229 circle2.clear(); 02230 // MDC 02231 for(int i=0;i<c.links().length();++i){ 02232 if(!((c.links()[i])->hit()->state() & WireHitFittingValid))continue; 02233 double R = sqrt(((c.links()[i])->wire()->xyPosition().x()-xc)*((c.links()[i])->wire()->xyPosition().x()-xc)+ 02234 ((c.links()[i])->wire()->xyPosition().y()-yc)*((c.links()[i])->wire()->xyPosition().y()-yc)); 02235 if(R == 0.)continue; 02236 double U = 1./R; 02237 double dir = R > r ? -1. : 1.; 02238 double X = xc+((c.links()[i])->wire()->xyPosition().x()-xc)*U*(R+dir*(c.links()[i])->hit()->drift()); 02239 double Y = yc+((c.links()[i])->wire()->xyPosition().y()-yc)*U*(R+dir*(c.links()[i])->hit()->drift()); 02240 circle2.add_point(X,Y,1.0); 02241 } 02242 circle2.add_point(0.,0.,1.0); // IP Constraint 02243 if (circle2.fit() < 0.0 || circle2.kappa() == 0.0) return false; 02244 xc = circle2.center()[0]; 02245 yc = circle2.center()[1]; 02246 r = circle2.radius(); 02247 //cout << xc << ", " << yc << " : " << r << endl; 02248 } 02249 02250 // update of point information 02251 double totalChi2 = 0.; 02252 int totalNHit = 0; 02253 for(int i=0;i<c.links().length();++i){ 02254 if(!((c.links()[i])->hit()->state() & WireHitFittingValid))continue; 02255 double xw = (c.links()[i])->wire()->xyPosition().x(); 02256 double yw = (c.links()[i])->wire()->xyPosition().y(); 02257 double R = sqrt((xw-xc)*(xw-xc)+(yw-yc)*(yw-yc)); 02258 if(R == 0.)continue; 02259 double U = 1./R; 02260 double X = xc+(xw-xc)*U*r; 02261 double Y = yc+(yw-yc)*U*r; 02262 double zlr = xw*Y-yw*X; 02263 unsigned leftRight = zlr > 0. ? WireHitRight : WireHitLeft; 02264 double pChi2 = sqrt((X-xw)*(X-xw)+(Y-yw)*(Y-yw))-(c.links()[i])->hit()->drift(); 02265 //cout << sqrt((X-xw)*(X-xw)+(Y-yw)*(Y-yw)) << " - " << (c.links()[i])->hit()->drift() << endl; 02266 //cout << i << ": " << pChi2 << endl; 02267 if((c.links()[i])->hit()->dDrift() != 0.){ 02268 pChi2 *= pChi2/((c.links()[i])->hit()->dDrift()*(c.links()[i])->hit()->dDrift()); 02269 totalChi2 += pChi2; 02270 //cout << pChi2 << ", " << c.links()[i]->hit()->dDrift() << endl; 02271 ++totalNHit; 02272 }else pChi2 = 1.0e+10; 02273 (c.links()[i])->update(HepPoint3D(X,Y,0.),HepPoint3D(xw,yw,0.),leftRight,pChi2); 02274 //cout << i << ": trk(" << X << "," << Y << "), wir(" << xw << "," << yw << ")" << endl; 02275 } 02276 chi2 = totalChi2; 02277 if(totalNHit <= 3)return false; 02278 ndf = totalNHit-3; 02279 02280 HepPoint3D center(xc,yc,0.); 02281 double charge = 0.; 02282 //...Determine charge...Better way??? 02283 int qSum = 0; 02284 for(int i=0;i<c.links().length();++i){ 02285 TMLink * l = c.links()[i]; 02286 if(l == 0)continue; 02287 const TMDCWireHit * h = l->hit(); 02288 if(h == 0)continue; 02289 double q = (center.cross(h->xyPosition())).z(); 02290 if(q > 0.)qSum += 1; 02291 else qSum -= 1; 02292 } 02293 if(qSum >= 0)charge = +1.; 02294 else charge = -1.; 02295 r *= charge; 02296 //cout << "B q = " << c.charge() << ", r = " << c.radius() << ", center = " << c.center() << endl; 02297 c.property(charge,r,center); 02298 //cout << "A q = " << c.charge() << ", r = " << c.radius() << ", center = " << c.center() << endl; 02299 return true; 02300 }
|
|
|
|
00260 { 00261 // R is radius for MDC but is 2*radius for track 00262 double r = R*10.;// cm -> mm 00263 /* if(r < 83.0 || r > 874.)return 50; 00264 if(r <= 93.0)return 0; if(r <= 103.25)return 1; if(r <= 113.5)return 2; 00265 if(r <= 136.0)return 3; if(r <= 152.0)return 4; if(r <= 169.0)return 5; 00266 if(r <= 186.0)return 6; if(r <= 202.0)return 7; if(r <= 217.0)return 8; 00267 if(r <= 232.0)return 9; if(r <= 248.0)return 10; if(r <= 264.0)return 11; 00268 if(r <= 280.0)return 12; if(r <= 297.0)return 13; if(r <= 313.0)return 14; 00269 if(r <= 330.0)return 15; if(r <= 346.0)return 16; if(r <= 361.0)return 17; 00270 if(r <= 376.0)return 18; if(r <= 392.0)return 19; if(r <= 408.0)return 20; 00271 if(r <= 424.0)return 21; if(r <= 441.0)return 22; if(r <= 458.0)return 23; 00272 if(r <= 474.0)return 24; if(r <= 490.0)return 25; if(r <= 505.0)return 26; 00273 if(r <= 520.0)return 27; if(r <= 536.0)return 28; if(r <= 552.0)return 29; 00274 if(r <= 568.0)return 30; if(r <= 585.0)return 31; if(r <= 602.0)return 32; 00275 if(r <= 618.0)return 33; if(r <= 634.0)return 34; if(r <= 649.0)return 35; 00276 if(r <= 664.0)return 36; if(r <= 680.0)return 37; if(r <= 696.0)return 38; 00277 if(r <= 712.0)return 39; if(r <= 729.0)return 40; if(r <= 746.0)return 41; 00278 if(r <= 762.0)return 42; if(r <= 778.0)return 43; if(r <= 793.0)return 44; 00279 if(r <= 808.0)return 45; if(r <= 824.0)return 46; if(r <= 840.0)return 47; 00280 if(r <= 856.0)return 48; if(r <= 874.0)return 49; 00281 */ 00282 //Liuqg 060915 00283 if(r < 73.0 || r > 772.2)return 43; 00284 if(r <= 85.0)return 0; if(r <= 97.0)return 1; if(r <= 109.0)return 2; 00285 if(r <= 121.0)return 3; if(r <= 133.0)return 4; if(r <= 145.0)return 5; 00286 if(r <= 157.0)return 6; if(r <= 179.0)return 7; if(r <= 205.2)return 8; 00287 if(r <= 221.4)return 9; if(r <= 237.6)return 10; if(r <= 253.8)return 11; 00288 if(r <= 270.0)return 12; if(r <= 286.2)return 13; if(r <= 302.4)return 14; 00289 if(r <= 318.6)return 15; if(r <= 334.8)return 16; if(r <= 351.0)return 17; 00290 if(r <= 367.2)return 18; if(r <= 387.45)return 19; if(r <= 407.7)return 20; 00291 if(r <= 423.9)return 21; if(r <= 440.1)return 22; if(r <= 456.3)return 23; 00292 if(r <= 472.5)return 24; if(r <= 488.7)return 25; if(r <= 504.9)return 26; 00293 if(r <= 521.1)return 27; if(r <= 537.3)return 28; if(r <= 554.5)return 29; 00294 if(r <= 569.7)return 30; if(r <= 585.9)return 31; if(r <= 602.1)return 32; 00295 if(r <= 618.3)return 33; if(r <= 634.5)return 34; if(r <= 654.75)return 35; 00296 if(r <= 675.0)return 36; if(r <= 691.2)return 37; if(r <= 707.4)return 38; 00297 if(r <= 723.6)return 39; if(r <= 739.8)return 40; if(r <= 756.0)return 41; 00298 if(r <= 772.2)return 42; 00299 }
|
|
Utility of #1.
|
|
Utility of #1.
00722 { 00723 // Axial(num == 19) and Stereo(num == 24). 00724 // ...sets pointers to neighboring wires 00725 // in "neighbor" of "AList<TMLink> *list" element 00726 00727 for(int i=0;i<num;++i){ 00728 if(list[i].length() == 0)continue; 00729 for(int j=0;j<list[i].length();++j){ 00730 //find two links of list[i][j] 00731 //...inner layer 00732 if(num == 19){ 00733 if( i == 0 || i == 4 || i == 8 || 00734 i == 12 || i == 16)goto outer; 00735 }else if(num == 24){ 00736 if( i == 0 || i == 4 || 00737 i == 8 || i == 12 || i == 16 || i == 20 )goto outer; 00738 } 00739 00740 for(int k=0;k<list[i-1].length();++k){ 00741 if(list[i-1][k]->hit()->wire()->localId() == 00742 list[i][j]->wire()->neighbor(1)->localId()) 00743 setNeighboringWires(list[i][j], list[i-1][k]); 00744 else if(list[i-1][k]->hit()->wire()->localId() == 00745 list[i][j]->wire()->neighbor(0)->localId()) 00746 setNeighboringWires(list[i][j], list[i-1][k]); 00747 }//k 00748 outer: 00749 //...outer layer 00750 if(num == 19){ 00751 if( i == 3 || i == 7 || i == 11 || 00752 i == 15 || i == 18)goto same; 00753 }else if(num == 24){ 00754 if( i == 3 || i == 7 || i == 11 || 00755 i == 15 || i == 19 || i == 23 )goto same; 00756 } 00757 for(int k=0;k<list[i+1].length();++k){ 00758 if(list[i+1][k]->hit()->wire()->localId() == 00759 list[i][j]->hit()->wire()->neighbor(4)->localId()) 00760 setNeighboringWires(list[i][j], list[i+1][k]); 00761 else if(list[i+1][k]->wire()->localId() == 00762 list[i][j]->wire()->neighbor(5)->localId()) 00763 setNeighboringWires(list[i][j], list[i+1][k]); 00764 }//k 00765 same: 00766 //...same layer 00767 for(int k=0;k<list[i].length();++k){ 00768 if(list[i][k]->hit()->wire()->localId() == 00769 list[i][j]->hit()->wire()->localIdForPlus()+1){ 00770 setNeighboringWires(list[i][j], list[i][k]); 00771 }else if(list[i][k]->hit()->wire()->localId() == 00772 list[i][j]->hit()->wire()->localIdForMinus()-1){ 00773 setNeighboringWires(list[i][j], list[i][k]); 00774 } 00775 }//k 00776 }//j 00777 }//i 00778 }
|
|
2D Track
|
|
2D Track
01927 { 01928 //jialk origin is 3 01929 if(seed.length() < m_param.minimum_seedLength)return NULL; 01930 TCircle *circle = new TCircle(seed); 01931 m_allCircles.append(circle); 01932 int errorFlag = circle->fitForCurl(ip); 01933 //jialk add a limitation of ULTIMATE_MIN_RADIUS_OF_STRANGE_TRACK 01934 //if(fabs(circle->radius()) > m_param.MIN_RADIUS_OF_STRANGE_TRACK)return NULL; 01935 if( (fabs(circle->radius()) > m_param.MIN_RADIUS_OF_STRANGE_TRACK) || (fabs(circle->radius()) < m_param.ULTIMATE_MIN_RADIUS_OF_STRANGE_TRACK) )return NULL; 01936 int searchDirection = 1;//[ 1 : inner ], [ -1 : outer ] 01937 int searchPath(searchDirection); 01938 bool searchZero(false); 01939 bool changeDirection(false); 01940 unsigned superLayerId = seed[0]->hit()->wire()->superLayerId(); 01941 01942 AList<TMLink> cand, tmpList; 01943 AList<TMLink> preAxialCand, preStereoCand; 01944 makeList(tmpList, segmentList, seed); 01945 for(unsigned i=0, size=tmpList.length();i<size;++i){ 01946 if(tmpList[i]->wire()){ 01947 if(tmpList[i]->wire()->axial()) preAxialCand.append(tmpList[i]); 01948 else preStereoCand.append(tmpList[i]); 01949 } 01950 } 01951 #if DEBUG_CURL_DUMP 01952 std::cout << "(TCurlFinder) 2D: Superlayer of seed = " << superLayerId << std::endl; 01953 #endif 01954 01955 bool appendFlag = false; 01956 nextStep: 01957 #if DEBUG_CURL_DUMP 01958 std::cout << "(TCurlFinder) 2D: SearchPath = " << searchPath 01959 << " Search SelfSuperlayer = " << (int)(searchZero) 01960 << " Change Direction of Search = " << (int)(changeDirection) << std::endl; 01961 #endif 01962 if(preAxialCand.length() == 0 && preStereoCand.length() == 0){ 01963 if(circle->links().length() >= 3){ 01964 if(m_unusedAxialHits.length() == 0) 01965 if(errorFlag == -1)return NULL; 01966 else return circle; 01967 else goto salvage; 01968 }else{ 01969 if(m_unusedAxialHits.length() == 0)return NULL; 01970 else goto salvage; 01971 } 01972 } 01973 searchAxialCand(cand, preAxialCand, circle, 01974 searchPath, superLayerId, m_param.RANGE_FOR_AXIAL_SEARCH); 01975 if(cand.length() > 0){ 01976 appendFlag = true; 01977 for(unsigned i = 0, size = cand.length(); i < size; ++i)circle->append(*cand[i]); 01978 errorFlag = circle->fitForCurl(ip); 01979 preAxialCand.remove(circle->links()); 01980 if(m_param.STEREO_2DFIND){ 01981 searchStereoCand(cand, preStereoCand, circle, 01982 searchPath, superLayerId, m_param.RANGE_FOR_STEREO_SEARCH); 01983 if(cand.length() > 0){ 01984 appendFlag = true; 01985 for(unsigned i = 0, size = cand.length(); i < size; ++i)circle->append(*cand[i]); 01986 errorFlag = circle->fitForCurl(ip); 01987 preStereoCand.remove(circle->links()); 01988 } 01989 } 01990 if(searchDirection == 1)++searchPath; 01991 else --searchPath; 01992 goto nextStep; 01993 }else{ 01994 if(m_param.STEREO_2DFIND){ 01995 searchStereoCand(cand, preStereoCand, circle, 01996 searchPath, superLayerId, m_param.RANGE_FOR_STEREO_SEARCH); 01997 if(cand.length() > 0){ 01998 appendFlag = true; 01999 for(unsigned i = 0, size = cand.length(); i < size; ++i)circle->append(*cand[i]); 02000 errorFlag = circle->fitForCurl(ip); 02001 preStereoCand.remove(circle->links()); 02002 if(searchDirection == 1)++searchPath; 02003 else --searchPath; 02004 goto nextStep; 02005 }else if((searchPath == 1 || searchPath == -1) && !searchZero){ 02006 searchPath = 0; 02007 searchZero = true; 02008 goto nextStep; 02009 }else if((searchPath == 1 || searchPath == -1) && searchZero && !changeDirection){ 02010 searchPath *= -1; 02011 searchDirection *= -1; 02012 changeDirection = true; 02013 goto nextStep; 02014 }else{ 02015 if(circle->links().length() >= 3){ 02016 if(m_unusedAxialHits.length() == 0) 02017 if(errorFlag == -1)return NULL; 02018 else return circle; 02019 else goto salvage; 02020 }else{ 02021 if(m_unusedAxialHits.length() == 0)return NULL; 02022 else goto salvage; 02023 } 02024 } 02025 }else{ 02026 if((searchPath == 1 || searchPath == -1) && !searchZero){ 02027 searchPath = 0; 02028 searchZero = true; 02029 goto nextStep; 02030 }else if((searchPath == 1 || searchPath == -1) && searchZero && !changeDirection){ 02031 searchPath *= -1; 02032 searchDirection *= -1; 02033 changeDirection = true; 02034 goto nextStep; 02035 }else{ 02036 if(circle->links().length() >= 3){ 02037 if(m_unusedAxialHits.length() == 0) 02038 if(errorFlag == -1)return NULL; 02039 else return circle; 02040 else goto salvage; 02041 }else{ 02042 if(m_unusedAxialHits.length() == 0)return NULL; 02043 else goto salvage; 02044 } 02045 } 02046 } 02047 } 02048 02049 salvage: 02050 cand.removeAll(); 02051 searchHits(cand, m_unusedAxialHits, circle, m_param.RANGE_FOR_AXIAL_LAST2D_SEARCH); 02052 if(m_param.STEREO_2DFIND){ 02053 searchHits(cand, m_unusedStereoHits, circle, m_param.RANGE_FOR_STEREO_LAST2D_SEARCH); 02054 } 02055 if(checkAppendHits(circle->links(), cand)){ 02056 circle->append(cand); 02057 if(circle->nLinks() >= 3) 02058 if(circle->fitForCurl(ip) == -1)return NULL; 02059 else return circle; 02060 else return NULL; 02061 }else if(circle->nLinks() >= 3){ 02062 return circle; 02063 }else return NULL; 02064 }
|
|
|
|
Utility of #3 3D Track |
|
02307 { 02308 unsigned size = segmentList.length(); 02309 if(TTrack *track = make3DTrack(circle)){ 02310 m_tracks.append(track); 02311 #if 0 02312 std::cout << "MDC Helix+Pt: " << track->helix().dr() << ", " 02313 << track->helix().phi0() << ", " 02314 << track->helix().kappa() << ", " 02315 << track->helix().dz() << ", " 02316 << track->helix().tanl() 02317 << ": " << 10000./2.9979258/15./track->helix().kappa() << std::endl; 02318 #endif 02319 return track; 02320 } 02321 return NULL; 02322 }
|
|
Utility of #3 3D Track 02325 { 02326 TTrack *track = new TTrack(*circle); 02327 m_allTracks.append(track); 02328 //cout<<"2D: nAHits: "<<track->links().length()<<endl; 02329 //jialk caution origin is 3 02330 if(track->links().length() < m_param.minimum_2DTrackLength){ 02331 #if DEBUG_CURL_DUMP 02332 std::cout << "(TCurlFinder) 3D:Fail...inital hit wire # < 3." << std::endl; 02333 #endif 02334 return NULL; 02335 } 02336 AList<TMLink> allStereoHits(m_unusedStereoHits); 02337 allStereoHits.remove(track->links()); 02338 AList<TMLink> closeHits; 02339 findCloseHits(allStereoHits, *track, closeHits); 02340 //if(!m_builder.buildStereo(*track, closeHits)){ 02341 //jialk inorder to improve track robustness 02342 if ( closeHits.length() < m_param.minimum_closeHitsLength ){ 02343 #if DEBUG_CURL_DUMP 02344 std::cout << "(TCurlFinder) 3D:Fail...stereohit wire # < 5." << std::endl; 02345 #endif 02346 return NULL; 02347 } 02348 //if(!m_builder.buildStereo(*track, closeHits)){ 02349 if(!m_builder.buildStereo(*track, closeHits, m_allStereoHitsOriginal)){ 02350 #if DEBUG_CURL_DUMP 02351 std::cout << "(TCurlFinder) 3D:Fail...can not build stereo." << std::endl; 02352 #endif 02353 return NULL; 02354 } 02355 //jialk add a limitation ULTIMATE_MIN_RADIUS_OF_STRANGE_TRACK 02356 //if(fabs(track->helix().radius()) > m_param.MIN_RADIUS_OF_STRANGE_TRACK){ 02357 if( (fabs(circle->radius()) > m_param.MIN_RADIUS_OF_STRANGE_TRACK) || (fabs(circle->radius()) < m_param.ULTIMATE_MIN_RADIUS_OF_STRANGE_TRACK) ){ 02358 #if DEBUG_CURL_DUMP 02359 std::cout << "(TCurlFinder) 3D:Fail...success 3D fit, but large radius > " 02360 << m_param.MIN_RADIUS_OF_STRANGE_TRACK << "." << std::endl; 02361 #endif 02362 return NULL; 02363 } 02364 //jialk caution origin is 5 02365 if(track->links().length() >= m_param.minimum_3DTrackLength){ 02366 #if DEBUG_CURL_DUMP 02367 std::cout << "(TCurlFinder) 3D:Success...can build stereo!!!" << std::endl; 02368 #endif 02369 return track; 02370 }else{ 02371 #if DEBUG_CURL_DUMP 02372 std::cout << "(TCurlFinder) 3D:Fail...success 3D fit, but final hit wire # < 3." << std::endl; 02373 #endif 02374 return NULL; 02375 } 02376 }
|
|
Plot.
|
|
Plot.
02606 { 02607 #if DEBUG_CURL_GNUPLOT+DEBUG_CURL_SEGMENT 02608 //#if 1 02609 double X = 0.; 02610 double Y = 0.; 02611 double R[12] = {8.3, 16.9, 21.7, 31.3, 36.1, 44.1, 02612 50.5, 58.5, 64.9, 72.9, 79.3, 87.4}; 02613 double step = 300.; 02614 double dStep = 2.*M_PI/step; 02615 FILE *data; 02616 std::string nameHead = "tmp.cdc_"; 02617 for(int j=0;j<12;++j){ 02618 std::string nameFile = nameHead+"0"+itostring(j); 02619 if(j>=10)nameFile = nameHead+itostring(j); 02620 if((data = fopen(nameFile,"w")) != NULL){ 02621 for(int i=0;i<step;++i){ 02622 double x = X + R[j] * cos(dStep*static_cast<double>(i)); 02623 double y = Y + R[j] * sin(dStep*static_cast<double>(i)); 02624 fprintf(data,"%lf, %lf\n",x,y); 02625 } 02626 fclose(data); 02627 } 02628 } 02629 02630 if((data = fopen("tmp_wires.dat","w")) != NULL){ 02631 AList<TMLink> list = m_unusedAxialHitsOriginal; 02632 list.append(m_unusedStereoHitsOriginal); 02633 for(int i=0;i<list.length();i++){ 02634 double x = list[i]->hit()->wire()->xyPosition().x(); 02635 double y = list[i]->hit()->wire()->xyPosition().y(); 02636 fprintf(data,"%lf, %lf\n",x,y); 02637 } 02638 fclose(data); 02639 } 02640 #endif 02641 return; 02642 }
|
|
Sub Main Section #3.
|
|
Sub Main Section #3.
01036 { 01037 AList<TSegmentCurl> segmentList = m_segmentList; 01038 //cout<<"segments: "<<m_segmentList.length()<<endl; 01039 // if(m_param.SVD_RECONSTRUCTION)m_builder.setSvdClusters(); 01040 for(unsigned i = 0, size = m_segmentList.length(); i < size; ++i){ 01041 TCircle *circle = make2DTrack(segmentList[i]->list(), segmentList, 1); //order by sequential num 01042 if(circle){ 01043 AList<TMLink> tmp(circle->links()); 01044 #if DEBUG_CURL_DUMP 01045 std::cout << "(TCurlFinder) 2D:Created Circle!!!" << std::endl; 01046 if(m_debugPlotFlag){ 01047 int noPlot = 1; 01048 if(m_debugPlotFlag == 1){ 01049 std::cout << "(TCurlFinder) Do you want to see Circle Plot(2D)? : yes = 1, no = other #" << std::endl; 01050 cin >> noPlot; 01051 } 01052 if(noPlot == 1)plotCircle(*circle,0); 01053 } 01054 #endif 01055 01056 /* if (tmp.length()>0) { 01057 cout<<"circle ok.............."<<endl; 01058 for(int j = 0; j < tmp.length(); ++j){ 01059 TMLink *ll = tmp[j]; 01060 cout<<"layerId: "<<ll->wire()->layerId() 01061 <<" localId: "<<ll->wire()->localId()<<endl; 01062 } 01063 } 01064 */ 01065 if(TCircle *dividedCircle = dividing2DTrack(circle)){ 01066 #if DEBUG_CURL_DUMP 01067 std::cout << "(TCurlFinder) 2D:dividing...good...2 Circles!!!" << std::endl; 01068 #endif 01069 TTrack *track1(NULL), *track2(NULL); 01070 int ok2d[2] = { 0, 0 }; 01071 int ok3d[2] = { 0, 0 }; 01072 //cout<<"trac2D: "<<trace2DTrack(circle)<<" check2D: "<< check2DCircle(circle) 01073 //<<" fit: "<< circle->fitForCurl(1)<<endl; 01074 if(trace2DTrack(circle) && 01075 check2DCircle(circle) && 01076 circle->fitForCurl(1) != -1){ 01077 ok2d[0] = 1; 01078 #if DEBUG_CURL_DUMP 01079 std::cout << "(TCurlFinder) 2D:Success Circle Fit!!!" << std::endl; 01080 #endif 01081 track1 = make3DTrack(circle, segmentList); 01082 } 01083 //cout<<"trac2D: "<<trace2DTrack(dividedCircle)<<" check2D: "<< check2DCircle(dividedCircle) 01084 //<<" fit: "<< dividedCircle->fitForCurl(1)<<endl; 01085 if(trace2DTrack(dividedCircle) && 01086 check2DCircle(dividedCircle) && 01087 dividedCircle->fitForCurl(1) != -1){ 01088 ok2d[1] = 1; 01089 #if DEBUG_CURL_DUMP 01090 std::cout << "(TCurlFinder) 2D:Success Circle Fit!!!" << std::endl; 01091 #endif 01092 track2 = make3DTrack(dividedCircle, segmentList); 01093 } 01094 if(track1 && track2){ 01095 #if DEBUG_CURL_DUMP 01096 std::cout << "(TCurlFinder) 3D:Create Track!!! in track1 && track2" << std::endl; 01097 #endif 01098 salvage3DTrack(track1,true); 01099 salvage3DTrack(track2,true); 01100 #if DEBUG_CURL_DUMP 01101 std::cout << "(TCurlFinder) 1:dz = " << track1->helix().dz() 01102 << ", 2:dz = " << track2->helix().dz() << std::endl; 01103 #endif 01104 if(m_param.DETERMINE_ONE_TRACK){ 01105 if(fabs(track1->helix().dz()) < fabs(track2->helix().dz())){ 01106 m_tracks.remove(track2); 01107 if(merge3DTrack(track1, tracks)) 01108 if(check3DTrack(track1) && 01109 trace3DTrack(track1)){ 01110 ok3d[0] = 1; 01111 ok3d[1] = 1; 01112 mask3DTrack(track1,tmp); 01113 tmp.append(track1->links()); 01114 } 01115 }else{ 01116 m_tracks.remove(track1); 01117 if(merge3DTrack(track2, tracks)) 01118 if(check3DTrack(track2) && 01119 trace3DTrack(track2)){ 01120 ok3d[0] = 1; 01121 ok3d[1] = 1; 01122 mask3DTrack(track2,tmp); 01123 tmp.append(track2->links()); 01124 } 01125 } 01126 }else{ 01127 int isSaved[2] = { 0, 0 }; 01128 if(merge3DTrack(track1, tracks)){ 01129 if(check3DTrack(track1) && 01130 trace3DTrack(track1)){ 01131 ok3d[0] = 1; 01132 mask3DTrack(track1,tmp); 01133 tmp.append(track1->links()); 01134 isSaved[0] = 1; 01135 } 01136 } 01137 if(merge3DTrack(track2, tracks)){ 01138 if(check3DTrack(track2) && 01139 trace3DTrack(track2)){ 01140 ok3d[1] = 1; 01141 mask3DTrack(track2,tmp); 01142 tmp.append(track2->links()); 01143 isSaved[1] = 1; 01144 } 01145 } 01146 if(isSaved[0] == 1 && isSaved[1] == 1){ 01147 track1->daughter(track2); 01148 track2->daughter(track1); 01149 } 01150 } 01151 }else if(track1){ 01152 #if DEBUG_CURL_DUMP 01153 std::cout << "(TCurlFinder) 3D:Create Track!!! in track1" << std::endl; 01154 #endif 01155 salvage3DTrack(track1,true); 01156 if(merge3DTrack(track1, tracks)) 01157 if(check3DTrack(track1) && 01158 trace3DTrack(track1)){ 01159 ok3d[0] = 1; 01160 mask3DTrack(track1,tmp); 01161 tmp.append(track1->links()); 01162 } 01163 }else if(track2){ 01164 #if DEBUG_CURL_DUMP 01165 std::cout << "(TCurlFinder) 3D:Create Track!!! in track2" << std::endl; 01166 #endif 01167 salvage3DTrack(track2,true); 01168 if(merge3DTrack(track2, tracks)) 01169 if(check3DTrack(track2) && 01170 trace3DTrack(track2)){ 01171 ok3d[1] = 1; 01172 mask3DTrack(track2,tmp); 01173 tmp.append(track2->links()); 01174 } 01175 } 01176 01177 if(m_param.OUTPUT_2DTRACKS){ 01178 // When 2d is OK but 3d is BAD, a 2dtrk is saved. 01179 if(ok2d[0] == 1 && ok3d[0] == 0){ 01180 removeStereo(*circle); 01181 double chi2_2d; 01182 int ndf_2d; 01183 if(fitWDD(*circle,chi2_2d,ndf_2d)){ 01184 TTrack *trk2d = new TTrack(*circle); 01185 trk2d->_ndf = ndf_2d; 01186 trk2d->_chi2 = chi2_2d; 01187 m_2dTracks.append(trk2d); 01188 m_allTracks.append(trk2d); 01189 } 01190 #if DEBUG_CURL_DUMP 01191 else{ 01192 std::cout << "(TCurlFinder) 2D:fit with drift information!!!" << std::endl; 01193 } 01194 #endif 01195 } 01196 if(ok2d[1] == 1 && ok3d[1] == 0){ 01197 removeStereo(*dividedCircle); 01198 double chi2_2d; 01199 int ndf_2d; 01200 if(fitWDD(*dividedCircle,chi2_2d,ndf_2d)){ 01201 TTrack *trk2d = new TTrack(*dividedCircle); 01202 trk2d->_ndf = ndf_2d; 01203 trk2d->_chi2 = chi2_2d; 01204 m_2dTracks.append(trk2d); 01205 m_allTracks.append(trk2d); 01206 } 01207 #if DEBUG_CURL_DUMP 01208 else{ 01209 std::cout << "(TCurlFinder) 2D:fit with drift information!!!" << std::endl; 01210 } 01211 #endif 01212 } 01213 } 01214 01215 }else{ 01216 #if DEBUG_CURL_DUMP 01217 std::cout << "(TCurlFinder) 2D:dividing...no good...1 Circles!!!" << std::endl; 01218 #endif 01219 int ok2d = 0; 01220 int ok3d = 0; 01221 //cout<<"trac2D: "<<trace2DTrack(circle)<<" check2D: "<< check2DCircle(circle) 01222 //<<" fit: "<< circle->fitForCurl(1)<<endl; 01223 if(trace2DTrack(circle) && 01224 check2DCircle(circle) && 01225 circle->fitForCurl(1) != -1){ 01226 #if DEBUG_CURL_DUMP 01227 std::cout << "(TCurlFinder) 2D:Success Circle Fit!!!" << std::endl; 01228 #endif 01229 ok2d = 1; 01230 TTrack *track3 = make3DTrack(circle, segmentList); 01231 if(track3){ 01232 #if DEBUG_CURL_DUMP 01233 std::cout << "(TCurlFinder) 3D:Create Track!!! in track3" << std::endl; 01234 #endif 01235 salvage3DTrack(track3,true); 01236 if(merge3DTrack(track3, tracks)) 01237 if(check3DTrack(track3) && 01238 trace3DTrack(track3)){ 01239 ok3d = 1; 01240 mask3DTrack(track3,tmp); 01241 tmp.append(track3->links()); 01242 } 01243 } 01244 01245 if(m_param.OUTPUT_2DTRACKS){ 01246 // When 2d is OK but 3d is BAD, a 2dtrk is saved. 01247 if(ok2d == 1 && ok3d == 0){ 01248 removeStereo(*circle); 01249 double chi2_2d; 01250 int ndf_2d; 01251 if(fitWDD(*circle,chi2_2d,ndf_2d)){ 01252 TTrack *trk2d = new TTrack(*circle); 01253 trk2d->_ndf = ndf_2d; 01254 trk2d->_chi2 = chi2_2d; 01255 m_2dTracks.append(trk2d); 01256 m_allTracks.append(trk2d); 01257 } 01258 #if DEBUG_CURL_DUMP 01259 else{ 01260 std::cout << "(TCurlFinder) 2D:fit with drift information!!!" << std::endl; 01261 } 01262 #endif 01263 } 01264 } 01265 } 01266 } 01267 m_unusedAxialHits.remove(tmp); 01268 m_unusedStereoHits.remove(tmp); 01269 for(unsigned ii=0, nsize=m_segmentList.length();ii<nsize;++ii){ 01270 m_segmentList[ii]->remove(tmp); 01271 if(m_segmentList[ii]->list().length() < m_param.MIN_SEGMENT) 01272 m_segmentList[ii]->removeAll(); 01273 } 01274 } 01275 segmentList[i]->removeAll(); 01276 } 01277 01278 // Check 2D trk's wires 01279 //check2DTracks(); // ... not need because of the current algorithm 01280 01281 // 3D & 2D trks information 01282 assignTracks(); 01283 01284 #if DEBUG_CURL_DUMP 01285 std::cout << "(TCurlFinder)MDC Rec Track # 3D = " << m_tracks.length() 01286 << ", 2D = " << m_2dTracks.length() << std::endl; 01287 std::cout << "3D Track List" << std::endl; 01288 for(int j=0;j<m_tracks.length();++j){ 01289 unsigned nA = 0, nS = 0; 01290 unsigned nAOK = 0, nSOK = 0; 01291 for(unsigned i=0,size=m_tracks[j]->nLinks();i<size;++i){ 01292 if(m_tracks[j]->links()[i]->wire()->stereo())++nS; 01293 else ++nA; 01294 if( 01295 (m_tracks[j]->links()[i]->hit()->state() & WireHitFittingValid)){ 01296 if(m_tracks[j]->links()[i]->wire()->stereo())++nSOK; 01297 else ++nAOK; 01298 } 01299 } 01300 std::cout << "(TCurlFinder) #" << j << ": wire info...A+S: " << m_tracks[j]->nLinks() 01301 << ", A: " << nAOK << "/" << nA 01302 << ", S: " << nSOK << "/" << nS << std::endl; 01303 if(m_tracks[j]->daughter()) 01304 std::cout << "(TCurlFinder) Relation = EXIST" << std::endl; 01305 else 01306 std::cout << "(TCurlFinder) Relation = NO EXIST" << std::endl; 01307 } 01308 std::cout << "2D Track List" << std::endl; 01309 for(int j=0;j<m_2dTracks.length();++j){ 01310 unsigned nA = 0, nS = 0; 01311 unsigned nAOK = 0, nSOK = 0; 01312 for(unsigned i=0,size=m_2dTracks[j]->nLinks();i<size;++i){ 01313 if(m_2dTracks[j]->links()[i]->wire()->stereo())++nS; 01314 else ++nA; 01315 if( 01316 (m_2dTracks[j]->links()[i]->hit()->state() & WireHitFittingValid)){ 01317 if(m_2dTracks[j]->links()[i]->wire()->stereo())++nSOK; 01318 else ++nAOK; 01319 } 01320 } 01321 std::cout << "(TCurlFinder) #" << j << ": wire info...A+S: " << m_2dTracks[j]->nLinks() 01322 << ", A: " << nAOK << "/" << nA 01323 << ", S: " << nSOK << "/" << nS 01324 << ", Chi2: " << m_2dTracks[j]->chi2() 01325 << ", Ndf: " << m_2dTracks[j]->ndf() << std::endl; 01326 if(m_2dTracks[j]->daughter()) 01327 std::cout << "(TCurlFinder) Relation = EXIST" << std::endl; 01328 else 01329 std::cout << "(TCurlFinder) Relation = NO EXIST" << std::endl; 01330 } 01331 #endif 01332 01333 // 3D trks 01334 m_allTracks.remove(m_tracks); 01335 checkRelation(m_tracks); 01336 tracks.append(m_tracks); 01337 if(m_param.OUTPUT_2DTRACKS){ 01338 // 2D trks 01339 m_allTracks.remove(m_2dTracks); 01340 tracks2D.append(m_2dTracks); 01341 } 01342 }
|
|
|
|
|
|
00538 { 00539 // This is to make "madeList" from "originalList", 00540 // but remove "removeList" from this "madeList", that is, 00541 // madeList = originalList - removeList. 00542 madeList.removeAll(); 00543 madeList.append(originalList); 00544 madeList.remove(removeList); 00545 }
|
|
00525 { 00526 // This is to make "madeList" from "originalList", 00527 // but remove "removeList" from this "madeList", that is, 00528 // madeList = originalList - removeList. 00529 madeList.removeAll(); 00530 for(unsigned i = 0, size = originalList.length(); i < size; ++i) 00531 madeList.append(originalList[i]->list()); 00532 madeList.remove(removeList); 00533 }
|
|
Sub Main Section #1.
|
|
Sub Main Section #1.
00641 { 00642 // A sub main function ... called by "doit". 00643 // #0 makes lists. 00644 // #1 makes segments. 00645 00646 //...makes original lists(axial and stereo) 00647 // 00648 //......axial 00649 unsigned size = axialList.length(); 00650 for(unsigned i=0;i<size;++i){ 00651 if(axialList[i]->reccdc()->tdc > 500) continue; //Liuqg, tmp 00652 if(axialList[i]->state() & WireHitFindingValid){ 00653 m_allAxialHitsOriginal.append(new TMLink(0,axialList[i])); 00654 if(axialList[i]->wire()->superLayerId() <= 3) //origin is 2, Liuqg 00655 m_hitsOnInnerSuperLayer.append(axialList[i]); 00656 00657 } 00658 } 00659 size = m_allAxialHitsOriginal.length(); 00660 for(unsigned i=0;i<size;++i){ 00661 if(!(m_allAxialHitsOriginal[i]->hit()->state() & WireHitUsed)){ 00662 if(m_allAxialHitsOriginal[i]->hit()->state() & WireHitInvalidForFit){ 00663 unsigned newState = m_allAxialHitsOriginal[i]->hit()->state()&(~WireHitInvalidForFit); 00664 m_allAxialHitsOriginal[i]->hit()->state(newState); 00665 } 00666 m_unusedAxialHitsOriginal.append(m_allAxialHitsOriginal[i]); 00667 } 00668 } 00669 m_unusedAxialHits = m_unusedAxialHitsOriginal; 00670 //......stereo 00671 size = stereoList.length(); 00672 for(unsigned i=0;i<size;++i){ 00673 if (stereoList[i]->reccdc()->tdc > 500) continue; //Liuqg, tmp to exclude looping tracks 00674 if(stereoList[i]->state() & WireHitFindingValid){ 00675 m_allStereoHitsOriginal.append(new TMLink(0,stereoList[i])); 00676 if(stereoList[i]->wire()->superLayerId() <= 3) //origin is 2, Liuqg 00677 m_hitsOnInnerSuperLayer.append(stereoList[i]); 00678 } 00679 } 00680 size = m_allStereoHitsOriginal.length(); 00681 for(unsigned i=0;i<size;++i){ 00682 if(!(m_allStereoHitsOriginal[i]->hit()->state() & WireHitUsed)){ 00683 if(m_allStereoHitsOriginal[i]->hit()->state() & WireHitInvalidForFit){ 00684 unsigned newState = m_allStereoHitsOriginal[i]->hit()->state()&(~WireHitInvalidForFit); 00685 m_allStereoHitsOriginal[i]->hit()->state(newState); 00686 } 00687 m_unusedStereoHitsOriginal.append(m_allStereoHitsOriginal[i]); 00688 } 00689 } 00690 m_unusedStereoHits = m_unusedStereoHitsOriginal; 00691 00692 //...shares unsed hit wires to each layer. 00693 size = m_unusedAxialHitsOriginal.length(); 00694 for(unsigned i=0;i<size;++i){ 00695 m_unusedAxialHitsOnEachLayer[m_unusedAxialHitsOriginal[i]->hit()->wire()-> 00696 axialStereoLayerId()].append(m_unusedAxialHitsOriginal[i]); 00697 } 00698 size = m_unusedStereoHitsOriginal.length(); 00699 for(unsigned i=0;i<size;++i){ 00700 m_unusedStereoHitsOnEachLayer[m_unusedStereoHitsOriginal[i]->hit()->wire()-> 00701 axialStereoLayerId()].append(m_unusedStereoHitsOriginal[i]); 00702 } 00703 00704 //...sets pointers to neighboring hit wires of each TMLink 00705 linkNeighboringWires(m_unusedAxialHitsOnEachLayer,19); //Belle 32 00706 linkNeighboringWires(m_unusedStereoHitsOnEachLayer,24); //Belle 18 00707 00708 //...makes _unusedSuperAxialHits and _unusedSuperStereoHits 00709 createSuperLayer(); 00710 //...makes segments by linking neighboring hit wires in the same super layer 00711 m_segmentList.removeAll(); 00712 for(unsigned i=0;i<5;++i) //Belle 6 00713 if(m_unusedAxialHitsOnEachSuperLayer[i].length() > 0) 00714 createSegments(m_unusedAxialHitsOnEachSuperLayer[i]); 00715 for(unsigned i=0;i<6;++i) //Belle 5 00716 if(m_unusedStereoHitsOnEachSuperLayer[i].length() > 0) 00717 createSegments(m_unusedStereoHitsOnEachSuperLayer[i]); 00718 00719 }
|
|
MC.
|
|
MC.
02474 { 02475 #if DEBUG_CURL_MC 02476 #define MAX_INDEX_MAKEMC 100 02477 #if DEBUG_CURL_DUMP 02478 std::cout << "(TCurlFinder)Now making tracks using MC info..." << std::endl; 02479 #endif 02480 int index[MAX_INDEX_MAKEMC]; 02481 for(unsigned i = 0; i < MAX_INDEX_MAKEMC; ++i)index[i] = 9999; 02482 02483 int counter(0); 02484 bool first(true); 02485 02486 for(unsigned i = 0, size = axialHits.length(); i < size; ++i){ 02487 if(axialHits[i]->mc() && 02488 axialHits[i]->mc()->hep() && 02489 !(axialHits[i]->state() & WireHitUsed)){ 02490 int flag(1); 02491 for(unsigned j = 0; j < MAX_INDEX_MAKEMC; ++j){ 02492 if(index[j] != 9999 && index[j] == axialHits[i]->mc()->hep()->id()){ 02493 flag = 0; 02494 break; 02495 } 02496 } 02497 if(flag){ 02498 index[counter] = axialHits[i]->mc()->hep()->id(); 02499 ++counter; 02500 } 02501 } 02502 } 02503 #if DEBUG_CURL_DUMP 02504 std::cout << "(TCurlFinder)Found " << counter 02505 << " tracks with MC information." << std::endl; 02506 #endif 02507 for(unsigned j = 0; j < counter; ++j){ 02508 AList<TMLink> axialList; 02509 AList<TMLink> stereoList; 02510 int axialCounter(0); 02511 int stereoCounter(0); 02512 //...axial 02513 for(unsigned i = 0, size = axialHits.length(); i < size; ++i){ 02514 if(index[j] == axialHits[i]->mc()->hep()->id() && 02515 !(axialHits[i]->state() & WireHitUsed)){ 02516 axialList.append(new TMLink(0, axialHits[i])); 02517 ++axialCounter; 02518 } 02519 } 02520 if(axialCounter < 3){ 02521 HepAListDeleteAll(axialList); 02522 continue; 02523 } 02524 //...stereo 02525 for(unsigned i = 0, size = stereoHits.length(); i < size; ++i){ 02526 if(index[j] == stereoHits[i]->mc()->hep()->id() && 02527 !(stereoHits[i]->state() & WireHitUsed)){ 02528 stereoList.append(new TMLink(0, stereoHits[i])); 02529 ++stereoCounter; 02530 } 02531 } 02532 if(stereoCounter < 2){ 02533 HepAListDeleteAll(axialList); 02534 HepAListDeleteAll(stereoList); 02535 continue; 02536 } 02537 #if DEBUG_CURL_DUMP 02538 std::cout << "(TCurlFinder)#" << j << " : Use " 02539 << axialCounter << " axial hit wires and " 02540 << stereoCounter << " stereo hit wires" << std::endl; 02541 std::cout << "(TCurlFinder)Particle Type(LUND) = " 02542 << axialList[0]->hit()->mc()->hep()->pType() << std::endl; 02543 #endif 02544 02545 m_unusedAxialHitsOriginal.append(axialList); 02546 m_unusedAxialHitsOriginal.append(stereoList); 02547 TCircle *circle = new TCircle(axialList); 02548 m_allCircles.append(circle); 02549 circle->fitForCurl(); 02550 double charge = 1.; 02551 if(axialList[0]->hit()->mc()->hep()->pType() < 0)charge = -1.; 02552 if(fabs(axialList[0]->hit()->mc()->hep()->pType()) == 11 || 02553 fabs(axialList[0]->hit()->mc()->hep()->pType()) == 13 || 02554 fabs(axialList[0]->hit()->mc()->hep()->pType()) == 15)charge *= -1.; 02555 circle->property(charge, charge*fabs(circle->radius()), circle->center()); 02556 02557 AList<TMLink> removeList; 02558 double x = circle->center().x(); 02559 double y = circle->center().y(); 02560 //...axial 02561 for(unsigned i = 0, size = axialList.length(); 02562 i < size; ++i){ 02563 if(charge*(x*axialList[i]->xyPosition().y()- 02564 y*axialList[i]->xyPosition().x())< 0.){ 02565 removeList.append(axialList[i]); 02566 02567 } 02568 } 02569 circle->remove(removeList); 02570 if(circle->nLinks() < 3)continue; 02571 //...refits 02572 circle->fitForCurl(1); 02573 x = circle->center().x(); 02574 y = circle->center().y(); 02575 removeList.removeAll(); 02577 for(unsigned i = 0, size = stereoList.length(); 02578 i < size; ++i){ 02579 if(charge*(x*stereoList[i]->xyPosition().y()- 02580 y*stereoList[i]->xyPosition().x())< 0.){ 02581 removeList.append(stereoList[i]); 02582 } 02583 } 02584 stereoList.remove(removeList); 02585 if(stereoList.length() < 2)continue; 02586 02587 TTrack *track = new TTrack(*circle); 02588 m_allTracks.append(track); 02589 if(m_builder.buildStereoMC(*track, stereoList)){ 02590 if(track->links().length() >= 5){ 02591 track->assign(WireHitCurlFinder, TrackCurlFinder | TrackValid | Track3D); 02592 tracks.append(track); 02593 m_allTracks.remove(track); 02594 }else{ 02595 std::cout << "Can not reconstruct with MC information!" << std::endl; 02596 } 02597 }else{ 02598 std::cout << "Can not reconstruct with MC information!" << std::endl; 02599 } 02600 } 02601 #endif 02602 return 0; 02603 }
|
|
|
|
01596 { 01597 double r(fabs(track->helix().radius())); 01598 double cx(track->helix().center().x()); 01599 double cy(track->helix().center().y()); 01600 01601 AList<TMLink> list(m_unusedAxialHits); 01602 list.append(m_unusedStereoHits); 01603 list.remove(track->links()); 01604 list.sort(SortByWireId); 01605 01606 AList<TMLink> removeList; 01607 for(unsigned i=0,size=list.length();i<size;++i){ 01608 double d = distance(*track, *(list[i])); 01609 if(d < m_param.MASK_DISTANCE){ 01610 HepPoint3D tmp(d, 0., 0.); 01611 list[i]->position(tmp); 01612 removeList.append(list[i]); 01613 } 01614 } 01615 01616 int pLayerId1 = static_cast<int>(layerId(2.*r)); 01617 if(pLayerId1 != 50)pLayerId1 -= 1;//hard coding parameter 01618 int pLayerId2 = pLayerId1+2; //hard coding parameter 01619 01620 AList<TMLink> preCand, cand; 01621 while(removeList.length()){ 01622 preCand.removeAll(); 01623 preCand.append(removeList[0]); 01624 if(removeList.length() >= 2){ 01625 for(unsigned j=1,size=removeList.length();j<size;++j){ 01626 if(removeList[0]->wire()->layerId() == removeList[j]->wire()->layerId()){ 01627 for(unsigned k=0,num=preCand.length();k<num;++k){ 01628 if(preCand[k]->wire()->localIdForPlus()+1 == removeList[j]->wire()->localId()){ 01629 preCand.append(removeList[j]); 01630 break; 01631 } 01632 } 01633 } 01634 } 01635 #if 1 01636 // new 01637 if(preCand[0]->wire()->layerId() >= pLayerId1 && 01638 preCand[0]->wire()->layerId() <= pLayerId2){ 01639 cand.append(preCand); 01640 }else if(preCand.length() == 2){//hard coding parameter 01641 cand.append(preCand); 01642 }else if(preCand.length() == 1){ 01643 cand.append(preCand[0]); 01644 } 01645 #else 01646 if(preCand.length() == 1){ 01647 if(preCand[0]->position().x() < MASK_DISTANCE)cand.append(preCand[0]); 01648 }else{ 01649 if(preCand[0]->wire()->layerId() >= pLayerId1 && 01650 preCand[0]->wire()->layerId() <= pLayerId2){ 01651 cand.append(preCand); 01652 }else if(preCand.length() == 2){//hard coding parameter 01653 cand.append(preCand); 01654 } 01655 } 01656 #endif 01657 }else{ 01658 cand.append(removeList[0]); 01659 } 01660 removeList.remove(removeList[0]); 01661 removeList.remove(cand); 01662 } 01663 maskList.append(cand); 01664 }
|
|
|
|
00302 { 00303 // input - superlayer id#(0-10) 00304 // output - max# id of locallayer in its superlayer. 00305 //Liuqg 060926, change to BES, superLayerId means the max num of layers in each superlayers. 00306 /* if(superLayerId == 1 || superLayerId == 3)return 2; 00307 if(superLayerId == 5 || superLayerId == 7 || 00308 superLayerId == 9)return 3; 00309 if(superLayerId == 4 || superLayerId == 6 || 00310 superLayerId == 8 || superLayerId == 10)return 4; 00311 if(superLayerId == 0 || superLayerId == 2)return 5; */ 00312 if(superLayerId == 10)return 2; 00313 if(superLayerId >= 0 && superLayerId < 10)return 3; 00314 00315 std::cerr << "Error in the CurlFinder(maxLocalLayerId). superLayerId = " 00316 << superLayerId << std::endl; 00317 return 0; 00318 }
|
|
|
|
01667 { 01668 if(!m_param.MERGE_EXE)return track; 01669 01670 AList<TTrack> tracks(confTracks); 01671 tracks.append(m_tracks); 01672 tracks.remove(track); 01673 if(tracks.length() == 0)return track; 01674 01675 double r = track->helix().radius(); 01676 double cx = track->helix().center().x(); 01677 double cy = track->helix().center().y(); 01678 01679 unsigned bestIndex = 0; 01680 double bestDiff = 1.0e+20; 01681 double R, cX, cY; 01682 for(unsigned i=0,size=tracks.length();i<size;++i){ 01683 R = fabs(tracks[i]->helix().radius()); 01684 cX = tracks[i]->helix().center().x(); 01685 cY = tracks[i]->helix().center().y(); 01686 if(fabs(r)*(1.-m_param.MERGE_RATIO) <= R && R <= fabs(r)*(1.+m_param.MERGE_RATIO)){ 01687 if(fabs(cx-cX) <= fabs(r)*m_param.MERGE_RATIO && fabs(cy-cY) <= fabs(r)*m_param.MERGE_RATIO){ 01688 double diff = fabs((fabs(r)-fabs(R))*(cx-cX)*(cy-cY)); 01689 if(diff < bestDiff){ 01690 bestDiff = diff; 01691 bestIndex = i; 01692 } 01693 } 01694 } 01695 } 01696 if(bestDiff == 1.0e20)return track; 01697 R = tracks[bestIndex]->helix().radius(); 01698 cX = tracks[bestIndex]->helix().center().x(); 01699 cY = tracks[bestIndex]->helix().center().y(); 01700 if(r*R >= 0.){ 01701 if(fabs(track->helix().dz()-tracks[bestIndex]->helix().dz()) < m_param.MERGE_Z_DIFF){ 01702 if(track->nLinks() > tracks[bestIndex]->nLinks()){ 01703 m_tracks.remove(tracks[bestIndex]); 01704 return track; 01705 }else{ 01706 m_tracks.remove(track); 01707 #if DEBUG_CURL_DUMP 01708 std::cout << "(TCurlFinder) 3D:Merged...removing this track.(type1)" << std::endl; 01709 #endif 01710 return NULL; 01711 } 01712 } 01713 }else{ 01714 bool newTrack(false), oldTrack(false); 01715 unsigned newCounter(0), oldCounter(0); 01716 for(unsigned i=0, size=m_hitsOnInnerSuperLayer.length(); 01717 i<size;++i){ 01718 if(!oldTrack){ 01719 if((R > 0. && 01720 cX*(m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().y()-cY)- 01721 cY*(m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().x()-cX) > 0.) || 01722 (R < 0. && 01723 cX*(m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().y()-cY)- 01724 cY*(m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().x()-cX) < 0.)){ 01725 double dist = distance(m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().x()-cX, 01726 m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().y()-cY); 01727 if(dist < fabs(R)){ 01728 if(fabs(fabs(R)-dist-m_hitsOnInnerSuperLayer[i]->drift()) < 0.5){ 01729 ++oldCounter; 01730 if(oldCounter >= 3)oldTrack = true; 01731 } 01732 }else{ 01733 if(fabs(dist-fabs(R)-m_hitsOnInnerSuperLayer[i]->drift()) < 0.5){ 01734 ++oldCounter; 01735 if(oldCounter >= 3)oldTrack = true; 01736 } 01737 } 01738 } 01739 } 01740 if(!newTrack){ 01741 if((r > 0. && 01742 cx*(m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().y()-cy)- 01743 cy*(m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().x()-cx) > 0.) || 01744 (r < 0. && 01745 cx*(m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().y()-cy)- 01746 cy*(m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().x()-cx) < 0.)){ 01747 double dist = distance(m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().x()-cx, 01748 m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().y()-cy); 01749 if(dist < fabs(r)){ 01750 if(fabs(fabs(r)-dist-m_hitsOnInnerSuperLayer[i]->drift()) < 0.5){ 01751 ++newCounter; 01752 if(newCounter >= 3)newTrack = true; 01753 } 01754 }else{ 01755 if(fabs(dist-fabs(r)-m_hitsOnInnerSuperLayer[i]->drift()) < 0.5){ 01756 ++newCounter; 01757 if(newCounter >= 3)newTrack = true; 01758 } 01759 } 01760 } 01761 } 01762 if(oldTrack && newTrack)break; 01763 } 01764 if(oldTrack && !newTrack){ 01765 m_tracks.remove(track); 01766 #if DEBUG_CURL_DUMP 01767 std::cout << "(TCurlFinder) 3D:Merged...removing this track.(type2)" << std::endl; 01768 #endif 01769 return NULL; 01770 }else if(!oldTrack && newTrack){ 01771 m_tracks.remove(tracks[bestIndex]); 01772 return track; 01773 }else if(!oldTrack && !newTrack){ 01774 m_tracks.remove(track); 01775 m_tracks.remove(tracks[bestIndex]); 01776 #if DEBUG_CURL_DUMP 01777 std::cout << "(TCurlFinder) 3D:Merged...removing this track.(type3)" << std::endl; 01778 #endif 01779 return NULL; 01780 }else if(oldTrack && newTrack){ 01781 if(fabs(track->helix().dz()) > fabs(tracks[bestIndex]->helix().dz()) && 01782 fabs(track->helix().dz()) > fabs(tracks[bestIndex]->helix().dz())+m_param.MERGE_Z_DIFF){ 01783 m_tracks.remove(track); 01784 #if DEBUG_CURL_DUMP 01785 std::cout << "(TCurlFinder) 3D:Merged...removing this track.(type4)" << std::endl; 01786 #endif 01787 return NULL; 01788 }else if(fabs(tracks[bestIndex]->helix().dz()) > fabs(track->helix().dz()) && 01789 fabs(tracks[bestIndex]->helix().dz()) > fabs(track->helix().dz())+m_param.MERGE_Z_DIFF){ 01790 m_tracks.remove(tracks[bestIndex]); 01791 return track; 01792 } 01793 } 01794 } 01795 }
|
|
returns name.
Implements TFinderBase. |
|
returns name.
Implements TFinderBase. 00171 { 00172 return std::string("Curling Track Finder"); 00173 }
|
|
|
|
00460 { 00461 // r is radius for MDC but is 2*radius for track 00462 const double eps = 0.2; 00463 //changed to BESIII, Liuqg 060921 00464 /* if(r < 8.8-eps) return 0; 00465 else if(r < 9.8-eps) return 1; 00466 else if(r < 10.85-eps) return 2; 00467 else if(r < 12.8-eps) return 3; 00468 else if(r < 14.4-eps) return 4; 00469 else if(r < 15.95-eps) return 5; 00470 else if(r < 22.45-eps) return 6; 00471 else if(r < 24.0-eps) return 7; 00472 else if(r < 25.6-eps) return 8; 00473 else if(r < 27.2-eps) return 9; 00474 else if(r < 28.8-eps) return 10; 00475 else if(r < 30.4-eps) return 11; 00476 else if(r < 36.85-eps) return 12; 00477 else if(r < 38.4-eps) return 13; 00478 else if(r < 40.0-eps) return 14; 00479 else if(r < 41.6-eps) return 15; 00480 else if(r < 43.15-eps) return 16; 00481 else if(r < 51.25-eps) return 17; 00482 else if(r < 52.8-eps) return 18; 00483 else if(r < 54.4-eps) return 19; 00484 else if(r < 56.0-eps) return 20; 00485 else if(r < 57.55-eps) return 21; 00486 else if(r < 65.65-eps) return 22; 00487 else if(r < 67.2-eps) return 23; 00488 else if(r < 68.8-eps) return 24; 00489 else if(r < 70.4-eps) return 25; 00490 else if(r < 71.9-eps) return 26; 00491 else if(r < 80.05-eps) return 27; 00492 else if(r < 81.6-eps) return 28; 00493 else if(r < 83.2-eps) return 29; 00494 else if(r < 84.8-eps) return 30; 00495 else if(r < 86.3-eps) return 31; 00496 else return 32; 00497 */ 00498 if(r < 20.52-eps) return 0; 00499 else if(r < 22.14-eps) return 1; 00500 else if(r < 23.76-eps) return 2; 00501 else if(r < 25.38-eps) return 3; 00502 else if(r < 27.0-eps) return 4; 00503 else if(r < 28.62-eps) return 5; 00504 else if(r < 30.24-eps) return 6; 00505 else if(r < 31.86-eps) return 7; 00506 else if(r < 33.48-eps) return 8; 00507 else if(r < 35.1-eps) return 9; 00508 else if(r < 36.72-eps) return 10; 00509 else if(r < 38.34-eps) return 11; 00510 else if(r < 67.5-eps) return 12; 00511 else if(r < 69.12-eps) return 13; 00512 else if(r < 70.74-eps) return 14; 00513 else if(r < 72.36-eps) return 15; 00514 else if(r < 73.98-eps) return 16; 00515 else if(r < 75.6-eps) return 17; 00516 else if(r < 77.22-eps) return 18; 00517 }
|
|
|
|
00321 { 00322 // This function is to find next axial superlayer! 00323 // input - superLayerId = superlayer id#(0-10) 00324 // - in = find inner axial superlayer from "superLayerID" 00325 // This is depth of it. 00326 // ex1. If superLayerID = 2, in = 1, return 0 00327 // ex2. If superLayerID = 2, in = -1, return 4 00328 // output - return 0, 2, 4, 6, 8, 10 = no error 00329 // -1 = error 00330 if(superLayerId > 10 || superLayerId < 0){ 00331 std::cerr << "Error in the CurlFinder(nextSuperAxialLayerId)." << std::endl; 00332 return -1; 00333 } 00334 //Liuqg 060920, the following numbers have been changed from belle to besiii 00335 if(in == 0){ 00336 if(superLayerId == 2 || superLayerId == 3 || 00337 superLayerId == 4 || superLayerId == 9 || 00338 superLayerId == 10){ 00339 return superLayerId; 00340 }else{ 00341 //return superLayerId - 1; 00342 return -1; 00343 } 00344 } 00345 // almost case --> inner type 00346 if((superLayerId == 3 ) && in == 1)return 2; 00347 if(superLayerId == 4){ 00348 if(in == 1)return 3; if(in == 2)return 2; 00349 } 00350 if(superLayerId == 5 || superLayerId == 6 || 00351 superLayerId == 7 || superLayerId == 8 || 00352 superLayerId == 9){ 00353 if(in == 1)return 4; if(in == 2)return 3; 00354 if(in == 3)return 2; 00355 } 00356 if(superLayerId == 10){ 00357 if(in == 1)return 9; if(in == 2)return 4; 00358 if(in == 3)return 3; if(in == 4)return 2; 00359 } 00360 // rare case --> outer type 00361 if(superLayerId == 0 || superLayerId == 1){ 00362 if(in == -1)return 2; if(in == -2)return 3; 00363 if(in == -3)return 4; if(in == -4)return 9; 00364 if(in == -5)return 10; 00365 } 00366 if( superLayerId == 2){ 00367 if(in == -1)return 3; if(in == -2)return 4; 00368 if(in == -3)return 9; if(in == -4)return 10; 00369 } 00370 if(superLayerId == 3){ 00371 if(in == -1)return 4; if(in == -2)return 9; 00372 if(in == -3)return 10; 00373 } 00374 if(superLayerId == 4){ 00375 if(in == -1)return 9; if(in == -2)return 10; 00376 } 00377 if(superLayerId == 5 || superLayerId == 6 || 00378 superLayerId == 7 || superLayerId == 8 || 00379 superLayerId == 9){ 00380 if(in == -1)return 10; 00381 } 00382 00383 return -1; 00384 }
|
|
|
|
00387 { 00388 // This function is to find next stereo superlayer! 00389 // input - superLayerId = superlayer id#(0-10) 00390 // - in = find inner stereo superlayer from "superLayerID" 00391 // This is depth of it. 00392 // ex1. If superLayerID = 2, in = 1, return 1 00393 // ex2. If superLayerID = 2, in = -1, return 3 00394 // output - return 1, 3, 5, 7, 9 = no error 00395 // -1 = error 00396 if(superLayerId > 10 || superLayerId < 0){ 00397 std::cerr << "Error in the CurlFinder(nextSuperStereoLayerId)." << std::endl; 00398 return -1; 00399 } 00400 //Liuqg 060920, the following numbers have been changed from belle to besiii 00401 if(in == 0){ 00402 if(superLayerId == 0 || superLayerId == 1 || 00403 superLayerId == 5 || superLayerId == 6 || 00404 superLayerId == 7 || superLayerId == 8){ 00405 return superLayerId; 00406 }else{ 00407 return -1; 00408 } 00409 } 00410 // almost case --> inner type 00411 if((superLayerId == 1 || superLayerId == 2 || 00412 superLayerId == 3 || superLayerId == 4) && in == 1)return 0; 00413 if(superLayerId == 5){ 00414 if(in == 1)return 1; if(in == 2)return 0; 00415 } 00416 if(superLayerId == 6){ 00417 if(in == 1)return 5; if(in == 2)return 1; 00418 if(in == 3)return 0; 00419 } 00420 if(superLayerId == 7){ 00421 if(in == 1)return 6; if(in == 2)return 5; 00422 if(in == 3)return 1; if(in == 4)return 0; 00423 } 00424 if(superLayerId == 8){ 00425 if(in == 1)return 7; if(in == 2)return 6; 00426 if(in == 3)return 5; if(in == 4)return 1; 00427 if(in == 5)return 0; 00428 } 00429 if(superLayerId == 9 || superLayerId == 10){ 00430 if(in == 1)return 8; if(in == 2)return 7; 00431 if(in == 3)return 6; if(in == 4)return 5; 00432 if(in == 5)return 1; if(in == 6)return 0; 00433 } 00434 // rare case --> outer type 00435 if(superLayerId == 0){ 00436 if(in == -1)return 1; if(in == -2)return 5; 00437 if(in == -3)return 6; if(in == -4)return 7; 00438 if(in == -5)return 8; 00439 } 00440 if(superLayerId == 1 || superLayerId == 2 || 00441 superLayerId == 3 || superLayerId == 4){ 00442 if(in == -1)return 5; if(in == -2)return 6; 00443 if(in == -3)return 7; if(in == -4)return 8; 00444 } 00445 if(superLayerId == 5){ 00446 if(in == -1)return 6; if(in == -2)return 7; 00447 if(in == -3)return 8; 00448 } 00449 if(superLayerId == 6){ 00450 if(in == -1)return 7; if(in == -2)return 8; 00451 } 00452 if(superLayerId == 7){ 00453 if(in == -1)return 8; 00454 } 00455 00456 return -1; 00457 }
|
|
|
|
00243 { 00244 // input - layer id#(0-49) 00245 // output - offset of its layer 00246 if( layerId == 0 || layerId == 2 || layerId == 4 || 00247 layerId == 6 || layerId == 8 || layerId == 9 || 00248 layerId == 11 || layerId == 13 || layerId == 15 || 00249 layerId == 17 || layerId == 18 || layerId == 20 || 00250 layerId == 22 || layerId == 24 || layerId == 26 || 00251 layerId == 27 || layerId == 29 || layerId == 31 || 00252 layerId == 33 || layerId == 35 || layerId == 36 || 00253 layerId == 38 || layerId == 40 || layerId == 42 || 00254 layerId == 44 || layerId == 45 || layerId == 47 || 00255 layerId == 49 ) return 1; // off set is 0.5 00256 return 0; // off set is 0 00257 }
|
|
|
|
02689 { 02690 #if DEBUG_CURL_GNUPLOT 02691 //#if 1 02692 if(!m_debugCdcFrame){ 02693 makeCdcFrame(); 02694 m_debugCdcFrame = true; 02695 } 02696 double gmaxX = 90. ,gminX = -90.; 02697 double gmaxY = 90. ,gminY = -90.; 02698 FILE *gnuplot, *data; 02699 if((data = fopen("tmp.dat1","w")) != NULL){ 02700 if(flag)std::cout << "Axial Wire ID ==> " << std::endl; 02701 for(int i=0;i<circle.nLinks();++i){ 02702 if(circle.links()[i]->hit()->wire()->axial()){ 02703 double x = circle.links()[i]->hit()->wire()->xyPosition().x(); 02704 double y = circle.links()[i]->hit()->wire()->xyPosition().y(); 02705 fprintf(data,"%lf, %lf\n",x,y); 02706 if(flag){ 02707 /*if(debugMcFlag){ 02708 std::cout << " A:" << circle.links()[i]->hit()->wire()->id() << ", "; 02709 std::cout << ", HepTrackID = " << circle.links()[i]->hit()->mc()->hep()->id(); 02710 std::cout << ", HepLundID = " << circle.links()[i]->hit()->mc()->hep()->pType() << std::endl; 02711 }else std::cout << " A:" << circle.links()[i]->hit()->wire()->id() << std::endl;*/ 02712 } 02713 } 02714 } 02715 if(flag)std::cout << std::endl; 02716 fclose(data); 02717 } 02718 if((data = fopen("tmp.dat2","w")) != NULL){ 02719 if(flag)std::cout << "Stereo Wire ID ==> " << std::endl; 02720 for(int i=0;i<circle.nLinks();++i){ 02721 if(circle.links()[i]->hit()->wire()->stereo()){ 02722 double x = circle.links()[i]->hit()->wire()->xyPosition().x(); 02723 double y = circle.links()[i]->hit()->wire()->xyPosition().y(); 02724 fprintf(data,"%lf, %lf\n",x,y); 02725 if(flag){ 02726 /*if(debugMcFlag){ 02727 std::cout << " S:" << circle.links()[i]->hit()->wire()->id() << ", "; 02728 std::cout << ", HepTrackID = " << circle.links()[i]->hit()->mc()->hep()->id(); 02729 std::cout << ", HepLundID = " << circle.links()[i]->hit()->mc()->hep()->pType() << std::endl; 02730 }else std::cout << " S:" << circle.links()[i]->hit()->wire()->id() << std::endl;*/ 02731 } 02732 } 02733 } 02734 if(flag)std::cout << std::endl; 02735 fclose(data); 02736 } 02737 double X = circle.center().x(); 02738 double Y = circle.center().y(); 02739 double R = fabs(circle.radius()); 02740 double step = 300.; 02741 double dStep = 2.*M_PI/step; 02742 if((data = fopen("tmp.dat3","w")) != NULL){ 02743 for(int i=0;i<step;++i){ 02744 double x = X + R * cos(dStep*static_cast<double>(i)); 02745 double y = Y + R * sin(dStep*static_cast<double>(i)); 02746 fprintf(data,"%lf, %lf\n",x,y); 02747 } 02748 fclose(data); 02749 } 02750 if((gnuplot = popen("gnuplot","w")) != NULL){ 02751 fprintf(gnuplot,"set nokey \n"); 02752 fprintf(gnuplot,"set size 0.721,1.0 \n"); 02753 fprintf(gnuplot,"set xrange [%f:%f] \n",gminX,gmaxX); 02754 fprintf(gnuplot,"set yrange [%f:%f] \n",gminY,gmaxY); 02755 std::string longName = "plot \"tmp_wires.dat\", \"tmp.dat1\", \"tmp.dat3\" w l, \"tmp.dat2\""; 02756 std::string nameHead = ",\"tmp.cdc_"; 02757 for(int j=0;j<12;++j){ 02758 std::string nameFile = nameHead+"0"+std::string(j)+"\"w l 0"; 02759 if(j>=10)nameFile = nameHead+std::string(j)+"\"w l 0"; 02760 longName += nameFile; 02761 } 02762 longName += " \n"; 02763 fprintf(gnuplot,longName); 02764 fflush(gnuplot); 02765 char tmp[8]; 02766 gets(tmp); 02767 pclose(gnuplot); 02768 } 02769 #endif 02770 return; 02771 }
|
|
|
|
02645 { 02646 #if DEBUG_CURL_GNUPLOT 02647 if(!m_debugCdcFrame){ 02648 makeCdcFrame(); 02649 m_debugCdcFrame = true; 02650 } 02651 double gmaxX = 90. ,gminX = -90.; 02652 double gmaxY = 90. ,gminY = -90.; 02653 FILE *gnuplot, *data; 02654 if((data = fopen("tmp.dat","w")) != NULL){ 02655 if(flag)std::cout << "Wire ID = "; 02656 for(int i=0;i<list.length();i++){ 02657 double x = list[i]->hit()->wire()->xyPosition().x(); 02658 double y = list[i]->hit()->wire()->xyPosition().y(); 02659 fprintf(data,"%lf, %lf\n",x,y); 02660 if(flag)std::cout << list[i]->hit()->wire()->id() << ", "; 02661 } 02662 if(flag)std::cout << std::endl; 02663 fclose(data); 02664 } 02665 if((gnuplot = popen("gnuplot","w")) != NULL){ 02666 fprintf(gnuplot,"set nokey \n"); 02667 fprintf(gnuplot,"set size 0.721,1.0 \n"); 02668 fprintf(gnuplot,"set xrange [%f:%f] \n",gminX,gmaxX); 02669 fprintf(gnuplot,"set yrange [%f:%f] \n",gminY,gmaxY); 02670 std::string longName = "plot \"tmp_wires.dat\", \"tmp.dat\""; 02671 std::string nameHead = ",\"tmp.cdc_"; 02672 for(int j=0;j<12;++j){ 02673 std::string nameFile = nameHead+"0"+itostring(j)+"\"w l 0"; 02674 if(j>=10)nameFile = nameHead+itostring(j)+"\"w l 0"; 02675 longName += nameFile; 02676 } 02677 longName += " \n"; 02678 fprintf(gnuplot,longName); 02679 fflush(gnuplot); 02680 char tmp[8]; 02681 gets(tmp); 02682 pclose(gnuplot); 02683 } 02684 #endif 02685 return; 02686 }
|
|
|
|
02774 { 02775 #if DEBUG_CURL_GNUPLOT 02776 if(!m_debugCdcFrame){ 02777 makeCdcFrame(); 02778 m_debugCdcFrame = true; 02779 } 02780 double gmaxX = 90. ,gminX = -90.; 02781 double gmaxY = 90. ,gminY = -90.; 02782 FILE *gnuplot, *data; 02783 if((data = fopen("tmp.dat1","w")) != NULL){ 02784 if(flag)std::cout << "Axial Wire ID ==> " << std::endl; 02785 for(int i=0;i<track.nLinks();++i){ 02786 if(track.links()[i]->hit()->wire()->axial()){ 02787 double x = track.links()[i]->hit()->wire()->xyPosition().x(); 02788 double y = track.links()[i]->hit()->wire()->xyPosition().y(); 02789 fprintf(data,"%lf, %lf\n",x,y); 02790 if(flag){ 02791 if(debugMcFlag){ 02792 std::cout << " A:" << track.links()[i]->hit()->wire()->id() << ", "; 02793 std::cout << ", HepTrackID = " << track.links()[i]->hit()->mc()->hep()->id(); 02794 std::cout << ", HepLundID = " << track.links()[i]->hit()->mc()->hep()->pType() << std::endl; 02795 }else std::cout << " A:" << track.links()[i]->hit()->wire()->id() << std::endl; 02796 } 02797 } 02798 } 02799 if(flag)std::cout << std::endl; 02800 fclose(data); 02801 } 02802 if((data = fopen("tmp.dat2","w")) != NULL){ 02803 if(flag)std::cout << "Stereo Wire ID ==> " << std::endl; 02804 for(int i=0;i<track.nLinks();++i){ 02805 if(track.links()[i]->hit()->wire()->stereo()){ 02806 double x = track.links()[i]->hit()->wire()->xyPosition().x(); 02807 double y = track.links()[i]->hit()->wire()->xyPosition().y(); 02808 fprintf(data,"%lf, %lf\n",x,y); 02809 if(flag){ 02810 if(debugMcFlag){ 02811 std::cout << " S:" << track.links()[i]->hit()->wire()->id() << ", "; 02812 std::cout << ", HepTrackID = " << track.links()[i]->hit()->mc()->hep()->id(); 02813 std::cout << ", HepLundID = " << track.links()[i]->hit()->mc()->hep()->pType() << std::endl; 02814 }else std::cout << " S:" << track.links()[i]->hit()->wire()->id() << std::endl; 02815 } 02816 } 02817 } 02818 if(flag)std::cout << std::endl; 02819 fclose(data); 02820 } 02821 double X = track.helix().center().x(); 02822 double Y = track.helix().center().y(); 02823 double R = fabs(track.helix().radius()); 02824 double step = 300.; 02825 double dStep = 2.*M_PI/step; 02826 if((data = fopen("tmp.dat3","w")) != NULL){ 02827 for(int i=0;i<step;++i){ 02828 double x = X + R * cos(dStep*static_cast<double>(i)); 02829 double y = Y + R * sin(dStep*static_cast<double>(i)); 02830 fprintf(data,"%lf, %lf\n",x,y); 02831 } 02832 fclose(data); 02833 } 02834 if((gnuplot = popen("gnuplot","w")) != NULL){ 02835 fprintf(gnuplot,"set nokey \n"); 02836 fprintf(gnuplot,"set size 0.721,1.0 \n"); 02837 fprintf(gnuplot,"set xrange [%f:%f] \n",gminX,gmaxX); 02838 fprintf(gnuplot,"set yrange [%f:%f] \n",gminY,gmaxY); 02839 std::string longName = "plot \"tmp_wires.dat\", \"tmp.dat1\", \"tmp.dat3\" w l, \"tmp.dat2\""; 02840 std::string nameHead = ",\"tmp.cdc_"; 02841 for(int j=0;j<12;++j){ 02842 std::string nameFile = nameHead+"0"+itostring(j)+"\"w l 0"; 02843 if(j>=10)nameFile = nameHead+itostring(j)+"\"w l 0"; 02844 longName += nameFile; 02845 } 02846 longName += " \n"; 02847 fprintf(gnuplot,longName); 02848 fflush(gnuplot); 02849 char tmp[8]; 02850 gets(tmp); 02851 pclose(gnuplot); 02852 } 02853 #endif 02854 return; 02855 }
|
|
|
|
02199 { 02200 AList<TMLink> stereoList; 02201 for(int i=0;i<c.links().length();++i){ 02202 if(c.links()[i]->wire()->stereo()){ 02203 stereoList.append(c.links()[i]); 02204 } 02205 } 02206 if(stereoList.length()>0)c.remove(stereoList); 02207 }
|
|
|
|
01798 { 01799 if(track->nLinks() >= m_param.MIN_SALVAGE){ 01800 AList<TMLink> list = m_unusedAxialHits; 01801 list.append(m_unusedStereoHits); 01802 list.remove(track->links()); 01803 01804 if(half){ 01805 double q = track->charge(); 01806 double x = track->helix().center().x(); 01807 double y = track->helix().center().y(); 01808 AList<TMLink> removeList; 01809 for(unsigned i = 0, size = list.length(); i < size; ++i) 01810 if(q*(x*list[i]->wire()->xyPosition().y()-y*list[i]->wire()->xyPosition().x())<0.) 01811 removeList.append(list[i]); 01812 list.remove(removeList); 01813 } 01814 01815 AList<TMLink> badCand, goodCand; 01816 double dist; 01817 for(unsigned j=0, nLinks=track->nLinks();j<nLinks;++j){ 01818 dist = distance(*track, *(track->links()[j])); 01819 if(dist > m_param.BAD_DISTANCE_FOR_SALVAGE)badCand.append(track->links()[j]); 01820 } 01821 for(unsigned j=0, nList=list.length();j<nList;++j){ 01822 dist = distance(*track, *(list[j])); 01823 if(dist < m_param.GOOD_DISTANCE_FOR_SALVAGE)goodCand.append(list[j]); 01824 } 01825 track->TTrackBase::remove(badCand); 01826 track->TTrackBase::append(goodCand); 01827 if(m_fitter.fit(*track) < 0){ 01828 track->TTrackBase::remove(goodCand); 01829 track->TTrackBase::append(badCand); 01830 m_fitter.fit(*track); 01831 } 01832 } 01833 return; 01834 }
|
|
|
|
02075 { 02076 cand.removeAll(); 02077 int innerSuperLayerId = nextSuperAxialLayerId(superLayerID, depth); 02078 if(innerSuperLayerId < 0)return; 02079 for(unsigned i = 0, size = preCand.length(); i < size; ++i){ 02080 if(preCand[i]->hit()->wire()->superLayerId() == 02081 (static_cast<unsigned>(innerSuperLayerId))){ 02082 #if 0 02083 if(searchHits(preCand[i], circle, searchError))cand.append(preCand[i]); 02084 #else 02085 if(searchHits(preCand[i], circle, searchError)){ 02086 cand.remove(preCand[i]); 02087 cand.append(preCand[i]); 02088 TMLink * cand2 = findIsolatedCloseHits(preCand[i]); 02089 if(cand2){ 02090 for(unsigned j = 0; j < size; ++j){ 02091 if(preCand[j]->wire()->id() == cand2->wire()->id()){ 02092 cand.remove(cand2); 02093 cand.append(cand2); 02094 #if 0 02095 std::cout << "Axial Appending...."; 02096 std::cout << " layerID = " << cand2->wire()->layerId(); 02097 std::cout << " localID = " << cand2->wire()->localId() << std::endl; 02098 if(searchHits(cand2, circle, searchError)){ 02099 std::cout << " But this can be added by default!" << std::endl; 02100 }else{ 02101 std::cout << " Good!! this cannot be added by default!" << std::endl; 02102 } 02103 #endif 02104 break; 02105 } 02106 } 02107 } 02108 } 02109 #endif 02110 } 02111 } 02112 }
|
|
|
|
|
|
02153 { 02154 unsigned numBefore = cand.length(); 02155 for(unsigned i = 0, size = preCand.length(); i < size; ++i){ 02156 if(searchHits(preCand[i], circle, searchError)){ 02157 #if 0 02158 cand.append(preCand[i]); 02159 #else 02160 cand.remove(preCand[i]); 02161 cand.append(preCand[i]); 02162 TMLink * cand2 = findIsolatedCloseHits(preCand[i]); 02163 if(cand2){ 02164 for(unsigned j = 0; j < size; ++j){ 02165 if(preCand[j]->wire()->id() == cand2->wire()->id()){ 02166 cand.remove(cand2); 02167 cand.append(cand2); 02168 break; 02169 } 02170 } 02171 } 02172 #endif 02173 } 02174 } 02175 if(numBefore == cand.length())return 0; 02176 return 1; 02177 }
|
|
02134 { 02135 // ...checks whether "link" can be added to circle. 02136 // ..."searchError" is length for checking. 02137 // ...returns 0 = error 02138 // 1 = no error 02139 double dist = distance(link->hit()->wire()->xyPosition().x() - circle->center().x(), 02140 link->hit()->wire()->xyPosition().y() - circle->center().y()); 02141 double radius = fabs(circle->radius()); 02142 //std::cout << link->wire()->localId() << " " << link->wire()->layerId() << " r=" 02143 // << radius << " e=" << searchError << " d=" << dist << std::endl; 02144 if(radius - searchError < dist && 02145 radius + searchError > dist)return 1; 02146 return 0; 02147 }
|
|
|
|
00857 { 00858 for(int i=0;i<6;++i){ 00859 if(seed->neighbor(i)){ 00860 if(!findLink(seed->neighbor(i),list))continue; 00861 segment->append(seed->neighbor(i)); 00862 seedStock.append(seed->neighbor(i)); 00863 list.remove(seed->neighbor(i)); 00864 }else{ 00865 break; 00866 } 00867 } 00868 }
|
|
|
|
02120 { 02121 cand.removeAll(); 02122 int innerSuperLayerId = nextSuperStereoLayerId(superLayerID, depth); 02123 if(innerSuperLayerId < 0 || innerSuperLayerId > m_param.SUPERLAYER_FOR_STEREO_SEARCH)return; 02124 for(unsigned i = 0, size = preCand.length(); i < size; ++i){ 02125 if(preCand[i]->hit()->wire()->superLayerId() == 02126 (static_cast<unsigned>(innerSuperLayerId))){ 02127 if(searchHits(preCand[i], circle, searchError))cand.append(preCand[i]); 02128 } 02129 } 02130 }
|
|
|
|
00781 { 00782 // ...sets a neighboring wire of "list". 00783 // Its candidate is "next". 00784 for(int i=0;i<6;++i){ 00785 if(!list->neighbor(i)){ 00786 list->neighbor(i,const_cast<TMLink*>(next)); 00787 break; 00788 } 00789 } 00790 }
|
|
|
|
01456 { 01457 // 0 is bad, 1 is good 01458 unsigned nSize = circle->links().length(); 01459 if(nSize == 0)return 0; 01460 double r = fabs(circle->radius()); 01461 if(r < 0.01)return 0; // to reject "r=0cm" circles. 01462 double cx = circle->center().x(); 01463 double cy = circle->center().y(); 01464 double th = atan2(-cy,-cx); 01465 if(th < 0.)th += 2.*M_PI; 01466 01467 unsigned innerOK = 0; 01468 double *angle = new double [circle->links().length()]; 01469 for(unsigned i=0,size=nSize;i<size;++i){ 01470 double th_r = atan2(circle->links()[i]->wire()->xyPosition().y()-cy, 01471 circle->links()[i]->wire()->xyPosition().x()-cx); 01472 if(th_r < 0.)th_r += 2.*M_PI; 01473 double diff = th_r-th+2.*M_PI; 01474 if(th_r > th)diff = th_r-th; 01475 if(circle->links()[i]->wire()->superLayerId() <= 2)innerOK = 1; 01476 angle[i] = diff; 01477 } 01478 qsort(angle,nSize,sizeof(double),TCurlFinder_doubleCompare);//chiisai-jun 01479 double maxDiffAngle = 0.; 01480 unsigned maxIndex = 0; 01481 for(unsigned i=0,size=nSize;i<size-1;++i){ 01482 if(angle[i+1]-angle[i] > maxDiffAngle){ 01483 maxDiffAngle = angle[i+1]-angle[i]; 01484 maxIndex = i; 01485 } 01486 } 01487 delete [] angle; 01488 //std::cout << "2D TRACE : maxDifAngle = " << maxDiffAngle 01489 // << ", r = " << r << ", dist = " << r*maxDiffAngle << std::endl; 01490 01491 // if(r*maxDiffAngle > m_param.TRACE2D_DISTANCE)return 0; //Liuqg, tmp. BES layer distribution is not uniform. 01492 if(innerOK == 1)return 1; 01493 01494 double q = circle->radius() > 0. ? 1. : -1; 01495 for(unsigned i=0,size=m_hitsOnInnerSuperLayer.length();i<size;++i){ 01496 double mag = distance(m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().x()-cx, 01497 m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().y()-cy); 01498 if(fabs(mag-r) < m_param.TRACE2D_FIRST_SUPERLAYER && 01499 q*(cx*m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().y()- 01500 cy*m_hitsOnInnerSuperLayer[i]->wire()->xyPosition().x()) > 0.){ 01501 return 1; 01502 } 01503 } 01504 return 0; 01505 }
|
|
|
|
01548 { 01549 // 0 is bad, 1 is good 01550 unsigned nSize = track->links().length(); 01551 if(nSize == 0){ 01552 m_tracks.remove(track); 01553 return 0; 01554 } 01555 double r = fabs(track->helix().radius()); 01556 if(r < 0.01){ 01557 m_tracks.remove(track); 01558 return 0; // to reject "r=0cm" circles. 01559 } 01560 double cx = track->helix().center().x(); 01561 double cy = track->helix().center().y(); 01562 double th = atan2(-cy,-cx); 01563 if(th < 0.)th += 2.*M_PI; 01564 01565 double *angle = new double [track->links().length()]; 01566 for(unsigned i=0,size=nSize;i<size;++i){ 01567 double th_r = atan2(track->links()[i]->positionOnTrack().y()-cy, 01568 track->links()[i]->positionOnTrack().x()-cx); 01569 if(th_r < 0.)th_r += 2.*M_PI; 01570 double diff = th_r-th+2.*M_PI; 01571 if(th_r > th)diff = th_r-th; 01572 angle[i] = diff; 01573 } 01574 qsort(angle,nSize,sizeof(double),TCurlFinder_doubleCompare);//chiisai-jun 01575 double maxDiffAngle = 0.; 01576 unsigned maxIndex = 0; 01577 for(unsigned i=0,size=nSize;i<size-1;++i){ 01578 if(angle[i+1]-angle[i] > maxDiffAngle){ 01579 maxDiffAngle = angle[i+1]-angle[i]; 01580 maxIndex = i; 01581 } 01582 } 01583 delete [] angle; 01584 /* std::cout << "3D TRACE : maxDifAngle = " << maxDiffAngle 01585 << ", r = " << r << ", dist = " << r*maxDiffAngle << std::endl; */ 01586 if(r*maxDiffAngle > m_param.TRACE3D_DISTANCE){ 01587 m_tracks.remove(track); 01588 return 0; 01589 }else{ 01590 return 1; 01591 } 01592 }
|
|
returns version.
Implements TFinderBase. |
|
returns version.
Implements TFinderBase. 00176 { 00177 return std::string("3.00"); 00178 }
|
|
|
|
02858 { 02859 #if DEBUG_CURL_SEGMENT 02860 if(!m_debugCdcFrame){ 02861 makeCdcFrame(); 02862 m_debugCdcFrame = true; 02863 } 02864 double gmaxX = 90. ,gminX = -90.; 02865 double gmaxY = 90. ,gminY = -90.; 02866 02867 FILE *data; 02868 std::string nameHead = "tmp.segment_"; 02869 std::string nameFile = nameHead+itostring(type)+"_"+itostring(m_debugFileNumber); 02870 ++m_debugFileNumber; 02871 if((data = fopen(nameFile,"w")) != NULL){ 02872 for(int i=0;i<list.length();i++){ 02873 double x = list[i]->hit()->wire()->xyPosition().x(); 02874 double y = list[i]->hit()->wire()->xyPosition().y(); 02875 fprintf(data,"%lf, %lf\n",x,y); 02876 } 02877 fclose(data); 02878 } 02879 #endif 02880 return; 02881 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|