#include <iostream>
#include <fstream>
#include <math.h>
#include <stdlib.h>
#include "CLHEP/String/Strings.h"
#include "TrkReco/TCurlFinder.h"
#include "TrkReco/TMDCWire.h"
#include "TrkReco/TMDCWireHit.h"
#include "TrkReco/TMLink.h"
#include "TrkReco/TCircle.h"
#include "TrkReco/TTrack.h"
#include "TrkReco/TSegmentCurl.h"
#include "MdcTables/MdcTables.h"
Go to the source code of this file.
Defines | |
#define | DEBUG_CURL_DUMP 0 |
#define | DEBUG_CURL_SEGMENT 0 |
#define | DEBUG_CURL_GNUPLOT 0 |
#define | DEBUG_CURL_MC 0 |
Functions | |
int | sortBySequentialLength (const void *av, const void *bv) |
int | sortByArcLength (const void *av, const void *bv) |
int | TCurlFinder_doubleCompare (const void *i, const void *j) |
TMLink * | findIsolatedCloseHits (TMLink *link) |
#define DEBUG_CURL_DUMP 0 |
Definition at line 26 of file TCurlFinder.cxx.
#define DEBUG_CURL_GNUPLOT 0 |
Definition at line 28 of file TCurlFinder.cxx.
#define DEBUG_CURL_MC 0 |
Definition at line 29 of file TCurlFinder.cxx.
#define DEBUG_CURL_SEGMENT 0 |
Definition at line 27 of file TCurlFinder.cxx.
Definition at line 2400 of file TCurlFinder.cxx.
References genRecEmupikp::i, ganga-rec::j, TMDCWire::layerId(), TMDCWire::localId(), TMLink::neighbor(), and TMLink::wire().
Referenced by TCurlFinder::findCloseHits(), TCurlFinder::searchAxialCand(), and TCurlFinder::searchHits().
02401 { 02402 int nNeighbor = 0; 02403 int nIsolated = 0; 02404 TMLink * isolatedLink[2] = {NULL,NULL}; 02405 unsigned layerID = link->wire()->layerId(); 02406 unsigned localID = link->wire()->localId(); 02407 for(int i=0;i<6;++i){ 02408 if(link->neighbor(i)){ 02409 if(link->neighbor(i)->wire()->layerId() == layerID){ 02410 ++nNeighbor; 02411 int isolated = 1; 02412 int testEach = 0; // for test 02413 for(int j=0;j<6;++j){ 02414 if(link->neighbor(i)->neighbor(j)){ 02415 if(link->neighbor(i)->neighbor(j)->wire()->layerId() == layerID && 02416 link->neighbor(i)->neighbor(j)->wire()->localId() != localID){ 02417 isolated = 0; 02418 } 02419 #if 1 02420 else if(link->neighbor(i)->neighbor(j)->wire()->layerId() == layerID && 02421 link->neighbor(i)->neighbor(j)->wire()->localId() == localID){ 02422 testEach = 1; 02423 } 02424 #endif 02425 }else break; 02426 } 02427 if(isolated == 1){ 02428 if(nIsolated < 2) 02429 isolatedLink[nIsolated] = link->neighbor(i); 02430 ++nIsolated; 02431 } 02432 #if 1 02433 if(testEach == 0){ 02434 std::cout << "Why?? Neighborhood info. dose not exist!!" << std::endl; 02435 } 02436 #endif 02437 } 02438 }else break; 02439 } 02440 #if 0 02441 std::cout << "isolated/neighbor # = " << nIsolated << "/" << nNeighbor << std::endl; 02442 std::cout << "layer ID = " << layerID << " "; 02443 std::cout << "local ID = " << localID << " --> "; 02444 if(isolatedLink[0])std::cout << isolatedLink[0]->wire()->localId() << " "; 02445 if(isolatedLink[1])std::cout << isolatedLink[1]->wire()->localId() << " "; 02446 std::cout << std::endl; 02447 #endif 02448 if(nIsolated == 1 && 02449 nNeighbor == 1 && isolatedLink[0])return isolatedLink[0]; 02450 else return NULL; 02451 }
int sortByArcLength | ( | const void * | av, | |
const void * | bv | |||
) |
Definition at line 226 of file TCurlFinder.cxx.
00226 { 00227 const TMLink **a((const TMLink**)av); 00228 const TMLink **b((const TMLink**)bv); 00229 if( (*a)->position().x() > (*b)->position().x() ){ 00230 return 1; 00231 }else if( (*a)->position().x() == (*b)->position().x() ){ 00232 return 0; 00233 }else{ 00234 return -1; 00235 } 00236 }
int sortBySequentialLength | ( | const void * | av, | |
const void * | bv | |||
) |
Definition at line 200 of file TCurlFinder.cxx.
Referenced by TCurlFinder::checkSortSegments().
00200 { 00201 const TSegmentCurl **a((const TSegmentCurl**)av); 00202 const TSegmentCurl **b((const TSegmentCurl**)bv); 00203 if( (*a)->maxSeq() < (*b)->maxSeq() ){ 00204 return 1; 00205 }else if( (*a)->maxSeq() == (*b)->maxSeq() ){ 00206 return 0; 00207 }else{ 00208 return -1; 00209 } 00210 }
int TCurlFinder_doubleCompare | ( | const void * | i, | |
const void * | j | |||
) |
Definition at line 1454 of file TCurlFinder.cxx.
Referenced by TCurlFinder::trace2DTrack(), and TCurlFinder::trace3DTrack().
01454 { 01455 if(*(static_cast<const double*>(i)) > *(static_cast<const double*>(j)))return 1; 01456 if(*(static_cast<const double*>(i)) < *(static_cast<const double*>(j)))return -1; 01457 return 0; 01458 }