FairRoot/PandaRoot
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
PndTrkLegendreSecTask2 Class Reference

#include <PndTrkLegendreSecTask2.h>

Inheritance diagram for PndTrkLegendreSecTask2:

Public Member Functions

 PndTrkLegendreSecTask2 ()
 
 PndTrkLegendreSecTask2 (int verbose)
 
 ~PndTrkLegendreSecTask2 ()
 
virtual InitStatus Init ()
 
virtual void Exec (Option_t *opt)
 
void SetParContainers ()
 
void Initialize ()
 
void Reset ()
 
Int_t FillConformalHitList (int isec=-1)
 
Int_t FillConformalHitList (PndTrkCluster *cluster)
 
void FillLegendreHisto (Int_t mode)
 
void FillLegendreHisto (PndTrkCluster *cluster)
 
Int_t AddHitToClusterByDistance (PndTrkCluster *cluster, Int_t mode, double fitm, double fitp)
 
Bool_t CheckVicinity (PndTrkHit *hit, PndTrkCluster *cluster)
 
Bool_t CheckAssignability (std::vector< PndTrkHit * > hitlist)
 
PndTrkCluster CreateSttCluster (PndTrkHit *firsthit)
 
Bool_t IsSttAssociate (PndTrkHit *hit1, PndTrkHit *hit2)
 
PndTrkCluster CreateClusterByConfDistance (double fitm, double fitq)
 
PndTrkCluster CreateClusterByRealDistance (double xc0, double yc0, double R0)
 
PndTrkCluster CreateClusterByMixedDistance (double fitm, double fitq)
 
PndTrkCluster CreateClusterByDistance (Int_t mode, double fitm, double fitq)
 
PndTrkCluster CreateSkewHitList (PndTrkTrack *track)
 
void FromConformalToRealTrack (double fitm, double fitp, double &x0, double &y0, double &R)
 
PndTrkCluster CleanUpSkewHitList (PndTrkCluster *skewhitlist)
 
void RegisterTrack (PndTrkTrack *track)
 
void ComputeTraAndRot (PndTrkHit *hit, Double_t &delta, Double_t trasl[2])
 
PndTrkHitFindSttReferenceHit (int isec=-1)
 
PndTrkHitFindMvdPixelReferenceHit ()
 
PndTrkHitFindMvdStripReferenceHit ()
 
PndTrkHitFindMvdReferenceHit ()
 
PndTrkHitFindReferenceHit ()
 
PndTrkHitFindReferenceHit (PndTrkCluster *cluster)
 
PndTrkCluster Cleanup (PndTrkCluster cluster)
 
void SearchSecondaryTracks ()
 
void SwitchOnDisplay ()
 
void DrawGeometry ()
 
void DrawHits (PndTrkHitList *hitlist)
 
void Refresh ()
 
void RefreshConf ()
 
void DrawGeometryConf (double x1, double y1, double x2, double y2)
 
void DrawConfHit (double x, double y, double r, int marker=2)
 
void LightCluster (PndTrkCluster *cluster)
 
void DrawLegendreHisto ()
 
void RefreshZ ()
 
void DrawZGeometry (int whichone=1, double phimin=0, double phimax=360, double zmin=-43, double zmax=113)
 
void DontUseMvdPix ()
 
void DontUseMvdStr ()
 
void DontUseStt ()
 
Bool_t DoesRealHitBelong (PndTrkHit *hit, double x0, double y0, double R)
 
Bool_t DoesConfHitBelong (PndTrkConformalHit *hit, double fitm, double fitp)
 
void RePrepareLegendre (PndTrkCluster *cluster)
 
void PrepareLegendre ()
 
Int_t ApplyLegendre (double &theta_max, double &r_max)
 
Int_t ApplyLegendre (PndTrkCluster *cluster, double &theta_max, double &r_max)
 
Int_t ExtractLegendre (Int_t mode, double &theta_max, double &r_max)
 
Bool_t ZPhiFit (int iter, PndTrkCluster *cluster, double &fitm, double &fitp)
 
PndTrkClusterCleanupZPhiFit (PndTrkCluster *cluster, double fitm, double fitp)
 
double ComputeZRediduals (PndTrkCluster *cluster, double fitm, double fitp)
 
double CorrectZ (PndTrkCluster *cluster, double deltaz, double fitm, double fitp)
 

Public Attributes

Bool_t fDisplayOn
 
TH2F * hxy
 
TH2F * hxz
 
TH2F * hzphi
 
TCanvas * display
 
TH2F * huv
 

Private Member Functions

 ClassDef (PndTrkLegendreSecTask2, 1)
 

Private Attributes

Int_t fNofMvdPixHits
 
Int_t fNofMvdStrHits
 
Int_t fNofSttHits
 
Int_t fNofTriplets
 
Int_t fNofHits
 
TClonesArray * fSttPointArray
 
TClonesArray * fSttHitArray
 
TClonesArray * fMvdPixelHitArray
 
TClonesArray * fMvdStripHitArray
 
TClonesArray * fTrackArray
 
TClonesArray * fTrackCandArray
 
TClonesArray * fTubeArray
 
PndGeoSttParfSttParameters
 
char fSttBranch [200]
 
char fMvdPixelBranch [200]
 
char fMvdStripBranch [200]
 
PndSttMapCreatorfMapper
 
Int_t fEventCounter
 
PndTrkSttHitListstthitlist
 
PndTrkSdsHitListmvdpixhitlist
 
PndTrkSdsHitListmvdstrhitlist
 
Double_t fSttParalDistance
 
Double_t fSttToMvdStripDistance
 
double fDeltaThetaRad
 
PndTrkLegendreTransformlegendre
 
Bool_t fPersistence
 
Bool_t fUseMVDPix
 
Bool_t fUseMVDStr
 
Bool_t fUseSTT
 
Bool_t fSecondary
 
Bool_t fInitDone
 
PndTrkConformalTransformconform
 
PndTrkConformalHitListconformalhitlist
 
PndTrkToolstools
 
PndTrkHitfRefHit
 
Double_t fMvdPix_RealDistLimit
 
Double_t fMvdStr_RealDistLimit
 
Double_t fStt_RealDistLimit
 
Double_t fMvdPix_ConfDistLimit
 
Double_t fMvdStr_ConfDistLimit
 
Double_t fStt_ConfDistLimit
 
std::vector< std::pair< double,
double > > 
fFoundPeaks
 
double fTime
 
TStopwatch * fTimer
 
PndTrkFitterfFitter
 

Detailed Description

Definition at line 35 of file PndTrkLegendreSecTask2.h.

Constructor & Destructor Documentation

PndTrkLegendreSecTask2::PndTrkLegendreSecTask2 ( )

Default constructor

Definition at line 54 of file PndTrkLegendreSecTask2.cxx.

References fMvdPixelBranch, fMvdStripBranch, fSttBranch, and PndGeoHandling::Instance().

54  : FairTask("secondary track finder", 0), fDisplayOn(kFALSE), fPersistence(kTRUE), fUseMVDPix(kTRUE), fUseMVDStr(kTRUE), fUseSTT(kTRUE), fSecondary(kFALSE), fMvdPix_RealDistLimit(1000), fMvdStr_RealDistLimit(1000), fStt_RealDistLimit(1000), fMvdPix_ConfDistLimit(1000), fMvdStr_ConfDistLimit(1000), fStt_ConfDistLimit(1000), fInitDone(kFALSE) {
55  sprintf(fSttBranch,"STTHit");
56  sprintf(fMvdPixelBranch,"MVDHitsPixel");
57  sprintf(fMvdStripBranch,"MVDHitsStrip");
59 }
static PndGeoHandling * Instance()
PndTrkLegendreSecTask2::PndTrkLegendreSecTask2 ( int  verbose)

Definition at line 61 of file PndTrkLegendreSecTask2.cxx.

References fMvdPixelBranch, fMvdStripBranch, fSttBranch, and PndGeoHandling::Instance().

61  : FairTask("secondary track finder", verbose), fDisplayOn(kFALSE), fPersistence(kTRUE), fUseMVDPix(kTRUE), fUseMVDStr(kTRUE), fUseSTT(kTRUE), fSecondary(kFALSE), fMvdPix_RealDistLimit(1000), fMvdStr_RealDistLimit(1000), fStt_RealDistLimit(1000), fMvdPix_ConfDistLimit(1000), fMvdStr_ConfDistLimit(1000), fStt_ConfDistLimit(1000), fInitDone(kFALSE) {
62  sprintf(fSttBranch,"STTHit");
63  sprintf(fMvdPixelBranch,"MVDHitsPixel");
64  sprintf(fMvdStripBranch,"MVDHitsStrip");
66 }
#define verbose
static PndGeoHandling * Instance()
PndTrkLegendreSecTask2::~PndTrkLegendreSecTask2 ( )

Destructor

Definition at line 71 of file PndTrkLegendreSecTask2.cxx.

71  {
72 
73 }

Member Function Documentation

int PndTrkLegendreSecTask2::AddHitToClusterByDistance ( PndTrkCluster cluster,
Int_t  mode,
double  fitm,
double  fitp 
)

Definition at line 1354 of file PndTrkLegendreSecTask2.cxx.

References PndTrkCluster::AddHit(), Bool_t, CheckVicinity(), conformalhitlist, display, DoesConfHitBelong(), PndTrkCluster::DoesContain(), DoesRealHitBelong(), Double_t, fDisplayOn, fMvdPixelBranch, fMvdStripBranch, fRefHit, FromConformalToRealTrack(), fSttBranch, PndTrkHit::GetDetectorID(), PndTrkConformalHit::GetHit(), PndTrkConformalHitList::GetHit(), PndTrkHit::GetIsochrone(), PndTrkConformalHitList::GetNofHits(), PndTrkHit::GetPosition(), hit, R, x0, and y0.

Referenced by Exec().

1354  {
1355 
1356  // mode: -------------------------------------------
1357  // 0 all conformal: pix conf - str conf - stt conf
1358  // 1 all real: pix real - str real - stt real
1359  // 2 mix: pix real - str real - stt conf
1360  // --------------------------------------------------
1361  Double_t x0, y0, R;
1362  FromConformalToRealTrack(fitm, fitp, x0, y0, R);
1363  int addedcounter = 0;
1364  for(int ihit = 0; ihit < conformalhitlist->GetNofHits(); ihit++) {
1366  PndTrkHit *hit = chit->GetHit();
1367  if(cluster->DoesContain(hit) == kTRUE) continue;
1368  Bool_t accept = kFALSE;
1369 
1370  if(hit == fRefHit) accept = DoesRealHitBelong(hit, x0, y0, R);
1371  else {
1372  if(mode == 0) accept = DoesConfHitBelong(chit, fitm, fitp);
1373  else if(mode == 1) accept = DoesRealHitBelong(hit, x0, y0, R);
1374  else if(mode == 2) {
1375  if(hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fSttBranch)) accept = DoesConfHitBelong(chit, fitm, fitp);
1376  else accept = DoesRealHitBelong(hit, x0, y0, R);
1377  }
1378  }
1379 
1380  // cout << "@@@@@@@@@@@@@@ ACCEPT " << accept << endl;
1381  if(accept == kTRUE) accept = CheckVicinity(hit, cluster);
1382 
1383 
1384 
1385  if(accept == kTRUE && fDisplayOn) {
1386  display->cd(1);
1387  if(hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fSttBranch)) {
1388  TArc *arc = new TArc(hit->GetPosition().X(), hit->GetPosition().Y(), hit->GetIsochrone());
1389  arc->SetFillStyle(0);
1390  arc->SetLineColor(5);
1391  arc->Draw("SAME");
1392  }
1393  else {
1394  TMarker *mrk;
1395  if(hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fMvdPixelBranch)) mrk = new TMarker(hit->GetPosition().X(), hit->GetPosition().Y(), 21);
1396  else if(hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fMvdStripBranch)) mrk = new TMarker(hit->GetPosition().X(), hit->GetPosition().Y(), 25);
1397  mrk->SetMarkerColor(5);
1398  mrk->Draw("SAME");
1399  }
1400  }
1401 
1402  // ********** CHECK ***********
1403  // if you put "is used" the efficiency beecomes much lower!
1404  // DO NOT: if(!hit->IsUsed())
1405  if(accept == kTRUE) {
1406  // cout << "ADDING TO CLUSTER" << endl;
1407  addedcounter++;
1408  cluster->AddHit(hit);
1409  }
1410  }
1411  return addedcounter;
1412 }
Double_t x0
Definition: checkhelixhit.C:70
void AddHit(PndTrkHit *hit)
Int_t mode
Definition: autocutx.C:47
Int_t GetDetectorID()
Definition: PndTrkHit.h:57
Double_t
Bool_t CheckVicinity(PndTrkHit *hit, PndTrkCluster *cluster)
PndTrkConformalHit * GetHit(int index)
Double_t y0
Definition: checkhelixhit.C:71
Bool_t DoesConfHitBelong(PndTrkConformalHit *hit, double fitm, double fitp)
TVector3 GetPosition()
Definition: PndTrkHit.h:62
Bool_t DoesContain(PndTrkHit *hit)
Bool_t DoesRealHitBelong(PndTrkHit *hit, double x0, double y0, double R)
PndTrkConformalHitList * conformalhitlist
void FromConformalToRealTrack(double fitm, double fitp, double &x0, double &y0, double &R)
PndSdsMCPoint * hit
Definition: anasim.C:70
Double_t GetIsochrone()
Definition: PndTrkHit.h:63
Double_t R
Definition: checkhelixhit.C:61
Int_t PndTrkLegendreSecTask2::ApplyLegendre ( double &  theta_max,
double &  r_max 
)

Definition at line 2224 of file PndTrkLegendreSecTask2.cxx.

References ExtractLegendre(), and PrepareLegendre().

Referenced by Exec().

2224  {
2225  PrepareLegendre();
2226  return ExtractLegendre(0, theta_max, r_max);
2227 }
Int_t ExtractLegendre(Int_t mode, double &theta_max, double &r_max)
Int_t PndTrkLegendreSecTask2::ApplyLegendre ( PndTrkCluster cluster,
double &  theta_max,
double &  r_max 
)

Definition at line 2229 of file PndTrkLegendreSecTask2.cxx.

References ExtractLegendre(), and RePrepareLegendre().

2229  {
2230  RePrepareLegendre(cluster);
2231  return ExtractLegendre(1, theta_max, r_max);
2232 }
Int_t ExtractLegendre(Int_t mode, double &theta_max, double &r_max)
void RePrepareLegendre(PndTrkCluster *cluster)
Bool_t PndTrkLegendreSecTask2::CheckAssignability ( std::vector< PndTrkHit * >  hitlist)

Definition at line 886 of file PndTrkLegendreSecTask2.cxx.

References hit, and PndTrkHit::IsUsed().

Referenced by Exec().

886  {
887 
888  for(int ihit = 0; ihit < hitlist.size(); ihit++) {
889  PndTrkHit* hit = hitlist.at(ihit);
890  if(hit->IsUsed() == kFALSE) return kTRUE;
891  }
892  return kFALSE;
893 }
Bool_t IsUsed()
Definition: PndTrkHit.h:58
PndSdsMCPoint * hit
Definition: anasim.C:70
Bool_t PndTrkLegendreSecTask2::CheckVicinity ( PndTrkHit hit,
PndTrkCluster cluster 
)

Definition at line 1418 of file PndTrkLegendreSecTask2.cxx.

References Double_t, PndTrkCluster::GetMinimumXYDistanceFromHit(), PndTrkHit::IsMvdPixel(), PndTrkHit::IsMvdStrip(), and PndTrkHit::IsStt().

Referenced by AddHitToClusterByDistance().

1418  {
1419  Double_t fMinimumDistanceLimit = 3;
1420 
1421  double distance = cluster->GetMinimumXYDistanceFromHit(hit);
1422  if(hit->IsMvdStrip()) fMinimumDistanceLimit = 10;
1423  else if(hit->IsMvdPixel()) fMinimumDistanceLimit = 3; // CHECK
1424  else if(hit->IsStt()) fMinimumDistanceLimit = 2;
1425 
1426  // cout << "GET MINIMUM DISTANCE " << distance << endl;
1427 
1428  if(distance < fMinimumDistanceLimit) return kTRUE;
1429  return kFALSE;
1430 }
Double_t GetMinimumXYDistanceFromHit(PndTrkHit *hit)
Bool_t IsMvdPixel()
Definition: PndTrkHit.h:75
Bool_t IsMvdStrip()
Definition: PndTrkHit.h:76
Double_t
Bool_t IsStt()
Definition: PndTrkHit.h:72
PndTrkLegendreSecTask2::ClassDef ( PndTrkLegendreSecTask2  ,
 
)
private
PndTrkCluster PndTrkLegendreSecTask2::Cleanup ( PndTrkCluster  cluster)

Definition at line 2316 of file PndTrkLegendreSecTask2.cxx.

References PndTrkCluster::AddHit(), angle, conform, display, Double_t, PndTrkHit::Draw(), fDisplayOn, PndTrkClean::FindMvdLayer(), fSecondary, fTubeArray, PndTrkHit::GetDistance(), PndTrkCluster::GetHit(), PndSttTube::GetLayerID(), PndTrkCluster::GetMvdPixelHitList(), PndTrkCluster::GetMvdStripHitList(), PndSttTube::GetNeighborings(), PndTrkCluster::GetNofHits(), PndTrkConformalTransform::GetRotation(), PndSttTube::GetSectorID(), PndTrkHit::GetSensorID(), PndTrkCluster::GetSttParallelHitList(), PndTrkConformalTransform::GetTranslation(), PndTrkHit::GetTubeID(), hit, nhit, PndTrkHit::SetSortVariable(), and PndTrkCluster::Sort().

Referenced by Exec().

2316  {
2317 
2318  // CLEANUP
2319  // -------------------------------------------------------
2320  // CleanCluster(cluster);
2321  // cluster->SortMvdPixelByLayerID();
2322  // cluster->SortByLayerID();
2323  PndTrkClean clean;
2324  int leftvotes = 0;
2325  int rightvotes = 0;
2326 
2327  TVector2 trasl = conform->GetTranslation();
2329 
2330  // SET SORT VARIABLE
2331  // MVD PIX PART OF CLUSTER
2332  PndTrkCluster mvdpixcluster = cluster.GetMvdPixelHitList();
2333  for(int ihit = 0; ihit < mvdpixcluster.GetNofHits(); ihit++) {
2334  PndTrkHit *hit = mvdpixcluster.GetHit(ihit);
2335  if(fSecondary) hit->SetSortVariable(hit->GetDistance(TVector3(trasl.X(), trasl.Y(), angle)));
2336  else hit->SetSortVariable(hit->GetDistance(TVector3(0., 0., 0)));
2337  int sensorID = hit->GetSensorID();
2338  int layerID = clean.FindMvdLayer(sensorID);
2339  if(layerID%2 == 0) rightvotes++;
2340  else leftvotes++;
2341  }
2342  // MVD STR PART OF CLUSTER
2343  PndTrkCluster mvdstrcluster = cluster.GetMvdStripHitList();
2344  for(int ihit = 0; ihit < mvdstrcluster.GetNofHits(); ihit++) {
2345  PndTrkHit *hit = mvdstrcluster.GetHit(ihit);
2346  if(fSecondary) hit->SetSortVariable(hit->GetDistance(TVector3(trasl.X(), trasl.Y(), angle)));
2347  else hit->SetSortVariable(hit->GetDistance(TVector3(0., 0., 0)));
2348  int sensorID = hit->GetSensorID();
2349  int layerID = clean.FindMvdLayer(sensorID);
2350  if(layerID%2 == 0) rightvotes++;
2351  else leftvotes++;
2352  }
2353  // STT PARALLEL PART OF CLUSTER
2354  PndTrkCluster sttcluster = cluster.GetSttParallelHitList();
2355  for(int ihit = 0; ihit < sttcluster.GetNofHits(); ihit++) {
2356  PndTrkHit *hit = sttcluster.GetHit(ihit);
2357  int layerID = -999, tubeID = hit->GetTubeID(), sectorID = -999;
2358  PndSttTube *tube = (PndSttTube*) fTubeArray->At(tubeID);
2359  layerID = tube->GetLayerID();
2360  sectorID = tube->GetSectorID();
2361  if(fSecondary) hit->SetSortVariable(hit->GetDistance(TVector3(trasl.X(), trasl.Y(), angle)));
2362  else hit->SetSortVariable(1000+layerID);
2363  if(sectorID < 3) rightvotes++;
2364  else leftvotes++;
2365  }
2366 
2367  // cout << "VOTES: LEFT " << leftvotes << " RIGHT " << rightvotes << endl;
2368  for(int ihit = 0; ihit < cluster.GetNofHits(); ihit++) {
2369  PndTrkHit *hit = cluster.GetHit(ihit);
2370  // cout << "for sorting " << hit->GetDetectorID () << " " << hit->GetHitID() << " " << hit->GetSortVariable() << endl;
2371  }
2372 
2373  cluster.Sort();
2374  for(int ihit = 0; ihit < cluster.GetNofHits(); ihit++) {
2375  PndTrkHit *hit = cluster.GetHit(ihit);
2376  // cout << "sorted " << hit->GetDetectorID () << " " << hit->GetHitID() << " " << hit->GetSortVariable() << endl;
2377  }
2378 
2379  // cluster.Print();
2380 
2381  // DELETE HITS
2382  PndTrkCluster deletioncluster;
2383 
2384  // LEFT/RIGHT CRITERION ------------------------------------------ NOW OFF
2385  // PIXEL
2386  mvdpixcluster = cluster.GetMvdPixelHitList();
2387  for(int ihit = 0; ihit < mvdpixcluster.GetNofHits(); ihit++) {
2388  PndTrkHit *hit = mvdpixcluster.GetHit(ihit);
2389  int sensorID = hit->GetSensorID();
2390  int layerID = clean.FindMvdLayer(sensorID);
2391  // cout << "pixel sorted " << hit->GetHitID() << " " << hit->GetSortVariable() << " " << sensorID << " " << layerID << endl;
2392 
2393 
2394  if((leftvotes > rightvotes) && (layerID%2 == 0)) {
2395  // deletioncluster.AddHit(hit);
2396  // cout << "pixel DELETED " << hit->GetHitID() << " " << ihit << " " << mvdpixcluster.GetNofHits() << endl;
2397  }
2398  else if((leftvotes < rightvotes) && (layerID%2 != 0)) {
2399  // deletioncluster.AddHit(hit);
2400  // cout << "pixel DELETED " << hit->GetHitID() << " " << ihit << " " << mvdpixcluster.GetNofHits() << endl;
2401  }
2402 
2403  if(fDisplayOn) {
2404  char goOnChar;
2405  display->cd(1);
2406  hit->Draw(kGreen);
2407  display->Update();
2408  display->Modified();
2409  cout << "WAITING" << endl;
2410  cin >> goOnChar;
2411  }
2412  }
2413  // STRIP
2414  mvdstrcluster = cluster.GetMvdStripHitList();
2415  for(int ihit = 0; ihit < mvdstrcluster.GetNofHits(); ihit++) {
2416  PndTrkHit *hit = mvdstrcluster.GetHit(ihit);
2417  int sensorID = hit->GetSensorID();
2418  // cout << "strip sorted " << hit->GetHitID() << " " << hit->GetSortVariable() << " " << sensorID << " " << clean.FindMvdLayer(sensorID) << endl;
2419  int layerID = clean.FindMvdLayer(sensorID);
2420  if((leftvotes > rightvotes) && (layerID%2 == 0)) {
2421  // deletioncluster.AddHit(hit);
2422  // cout << "strip DELETED " << hit->GetHitID() << endl;
2423  }
2424  else if((leftvotes < rightvotes) && (layerID%2 != 0)) {
2425  // deletioncluster.AddHit(hit);
2426  // cout << "strip DELETED " << hit->GetHitID() << endl;
2427  }
2428  if(fDisplayOn) {
2429  char goOnChar;
2430  display->cd(1);
2431  hit->Draw(kBlue);
2432  display->Update();
2433  display->Modified();
2434  // cin >> goOnChar;
2435  }
2436  }
2437 
2438  // STT PARALLEL
2439  sttcluster = cluster.GetSttParallelHitList();
2440  for(int ihit = 0; ihit < sttcluster.GetNofHits(); ihit++) {
2441  PndTrkHit *hit = sttcluster.GetHit(ihit);
2442  int layerID = -999, tubeID = hit->GetTubeID();
2443  PndSttTube *tube = (PndSttTube*) fTubeArray->At(tubeID);
2444  layerID = tube->GetLayerID();
2445  // cout << "stt sorted " << hit->GetHitID() << " " << hit->GetSortVariable() << " " << tubeID << " " << layerID << endl;
2446 
2447  int sectorID = tube->GetSectorID();
2448 
2449  if((leftvotes > rightvotes) && (sectorID < 3)) {
2450  // deletioncluster.AddHit(hit);
2451  // cout << "stt DELETED " << hit->GetHitID() << " " << sectorID << endl;
2452  }
2453  else if((leftvotes < rightvotes) && (sectorID >= 3)) {
2454  // deletioncluster.AddHit(hit);
2455  // cout << "stt DELETED " << hit->GetHitID() << " " << sectorID << endl;
2456  }
2457  // ~~~~~~~~~~~~~~~~~~ check *******************
2458  else { // NEIGHBORING CRITERION ------------------------------------------------
2459  TArrayI neighboring = tube->GetNeighborings();
2460  // cout << "NEIGHBORING TO TUBE " << tubeID << endl;
2461  // for(int nhit = 0; nhit < neighboring.GetSize(); nhit++) {
2462  // cout << " " << neighboring.At(nhit);
2463  // }
2464  // cout << endl;
2465 
2466  int neighboringcounter = 0;
2467  for(int ohit = 0; ohit < sttcluster.GetNofHits(); ohit++) {
2468  if(ihit == ohit) continue;
2469  PndTrkHit *otherhit = sttcluster.GetHit(ohit);
2470  int otherhitID = otherhit->GetTubeID();
2471 
2472  for(int nhit = 0; nhit < neighboring.GetSize(); nhit++) {
2473  if(otherhitID == neighboring.At(nhit)) neighboringcounter++;
2474  }
2475 
2476  // if(isthere == false)
2477  // {
2478  // deletioncluster.AddHit(hit);
2479  // cout << "stt DELETEDbis " << hit->GetHitID() << " " << sectorID << endl;
2480  // }
2481  }
2482  // cout << "hit " << ihit << " has " << neighboringcounter << " NEIGHBORINS" << endl;
2483 
2484  if(layerID != 0 && layerID != 7 && layerID != 8 && ihit != sttcluster.GetNofHits() - 1 && neighboringcounter == 1) {
2485  // cout << "I SHOULD DELETE THIS" << endl;
2486  // deletioncluster.AddHit(hit);
2487  // OFF FOR NOW: delete if there is just 1 neighboring
2488  // cout << "stt DELETED " << hit->GetHitID() << " " << sectorID << endl;
2489  }
2490 
2491  // ON, delete if there is no neighboring (isolated hit)
2492  if(neighboringcounter == 0) {
2493  // cout << "I WILL DELETE THIS" << endl;
2494  deletioncluster.AddHit(hit);
2495  // cout << "stt DELETED " << hit->GetHitID() << " " << sectorID << endl;
2496  }
2497 
2498  if(fDisplayOn) {
2499  char goOnChar;
2500  display->cd(1);
2501  hit->Draw(kCyan);
2502  display->Update();
2503  display->Modified();
2504  // cin >> goOnChar;
2505  }
2506  }
2507  }
2508 
2509  if(fDisplayOn) {
2510  char goOnChar;
2511  // cin >> goOnChar;
2512  }
2513  // ~~~~~~~~~~~~~~~~~~
2514 
2515 
2516 
2517  // ACTUAL DELETION OF HITS
2518 
2519  PndTrkCluster finalcluster;
2520  for(int ihit = 0; ihit < cluster.GetNofHits(); ihit++) {
2521  PndTrkHit *hit = cluster.GetHit(ihit);
2522  bool stop = false;
2523  for(int jhit = 0; jhit < deletioncluster.GetNofHits(); jhit++) {
2524  PndTrkHit *dhit = deletioncluster.GetHit(jhit);
2525  if(hit == dhit) {
2526  // ********** CHECK ***********
2527  // cout << "trhrow in again" << endl;
2528  // dhit->SetUsedFlag(0);
2529  stop = true;
2530  break;
2531  }
2532  }
2533  if(!stop) finalcluster.AddHit(hit);
2534  }
2535 
2536  return finalcluster;
2537 }
int FindMvdLayer(int sensorID)
PndTrkConformalTransform * conform
void SetSortVariable(Double_t sortvar)
Definition: PndTrkHit.h:44
void AddHit(PndTrkHit *hit)
PndTrkHit * GetHit(int index)
int GetLayerID()
Definition: PndSttTube.cxx:128
Int_t GetSensorID()
Definition: PndTrkHit.h:60
PndTrkCluster GetSttParallelHitList()
Double_t
Double_t GetDistance(PndTrkHit *fromhit)
Definition: PndTrkHit.cxx:83
TArrayI GetNeighborings()
Definition: PndSttTube.cxx:137
PndTrkCluster GetMvdPixelHitList()
void Draw(Color_t color)
Definition: PndTrkHit.cxx:109
PndSdsMCPoint * hit
Definition: anasim.C:70
Double_t angle
Int_t GetNofHits()
Definition: PndTrkCluster.h:52
int GetSectorID()
Definition: PndSttTube.cxx:124
Int_t GetTubeID()
Definition: PndTrkHit.h:61
PndTrkCluster GetMvdStripHitList()
PndTrkCluster PndTrkLegendreSecTask2::CleanUpSkewHitList ( PndTrkCluster skewhitlist)

Definition at line 1895 of file PndTrkLegendreSecTask2.cxx.

References PndTrkCluster::AddHit(), display, DrawZGeometry(), fabs(), fDisplayOn, PndTrkCluster::GetHit(), PndTrkSkewHit::GetIntersection1(), PndTrkSkewHit::GetIntersection2(), PndTrkCluster::GetNofHits(), PndTrkSkewHit::GetPhi1(), PndTrkSkewHit::GetPhi2(), hzphi, PndTrkHit::SetSortVariable(), and PndTrkCluster::Sort().

Referenced by Exec().

1895  {
1896 
1897 
1898  // 6. FIRST CLEANING of the track skewed associations
1899  // find most probable z - CHECK what happens if a track is very fwd peaked?
1900  // TRY WITH DELTA z = COST
1901  // cout << "##################### FIND MOST PROBABLE Z" << endl;
1902  double phimin = 400, phimax = -1, zmin = 1000, zmax = -1;
1903 
1904  for(int ihit = 0; ihit < skewhitlist->GetNofHits(); ihit++) {
1905  PndTrkSkewHit *skewhit = (PndTrkSkewHit*) skewhitlist->GetHit(ihit);
1906  if(!skewhit) continue;
1907  TVector3 fin_intersection1 = skewhit->GetIntersection1();
1908  TVector3 fin_intersection2 = skewhit->GetIntersection2();
1909 
1910  double phi1 = skewhit->GetPhi1();
1911  double phi2 = skewhit->GetPhi2();
1912 
1913  if(phi1 < phimin) phimin = phi1;
1914  if(phi2 < phimin) phimin = phi2;
1915  if(fin_intersection1.Z() < zmin) zmin = fin_intersection1.Z();
1916  if(fin_intersection2.Z() < zmin) zmin = fin_intersection2.Z();
1917 
1918  if(phi1 > phimax) phimax = phi1;
1919  if(phi2 > phimax) phimax = phi2;
1920  if(fin_intersection1.Z() > zmax) zmax = fin_intersection1.Z();
1921  if(fin_intersection2.Z() > zmax) zmax = fin_intersection2.Z();
1922  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ CHECK
1923  }
1924  // cout << "PHI: " << phimin << " " << phimax << endl;
1925  // cout << "Z : " << zmin << " " << zmax << endl;
1926 
1927  // DISPLAY ----------------------------
1928  if(fDisplayOn) {
1929  char goOnChar;
1930  display->cd(4);
1931  phimin -= 30;
1932  phimax += 30;
1933  zmin -= 13;
1934  zmax += 13;
1935  DrawZGeometry(2, phimin, phimax, zmin, zmax);
1936  hzphi->SetXTitle("#phi");
1937  hzphi->SetYTitle("#z");
1938  hzphi->Draw();
1939  display->Update();
1940  display->Modified();
1941 
1942 
1943  for(int ihit = 0; ihit < skewhitlist->GetNofHits(); ihit++) {
1944  PndTrkSkewHit *skewhit = (PndTrkSkewHit*) skewhitlist->GetHit(ihit);
1945  if(!skewhit) continue;
1946 
1947  TVector3 fin_intersection1 = skewhit->GetIntersection1();
1948  TVector3 fin_intersection2 = skewhit->GetIntersection2();
1949 
1950  double phi1 = skewhit->GetPhi1();
1951  double phi2 = skewhit->GetPhi2();
1952 
1953  TLine *linezphi = new TLine(phi1, fin_intersection1.Z(), phi2, fin_intersection2.Z());
1954  // TLine *linezphi = new TLine(fin_intersection1.Z(), phi1, fin_intersection2.Z(), phi2);
1955  linezphi->SetLineStyle(1);
1956  linezphi->Draw("SAME");
1957 
1958  TMarker *mrkzphi1 = new TMarker(phi1, fin_intersection1.Z(), 20);
1959  // TMarker *mrkzphi1 = new TMarker(fin_intersection1.Z(), phi1, 20);
1960 
1961  mrkzphi1->SetMarkerColor(kBlue - 9);
1962  mrkzphi1->Draw("SAME");
1963 
1964  TMarker *mrkzphi2 = new TMarker(phi2, fin_intersection2.Z(), 20);
1965  // TMarker *mrkzphi2 = new TMarker(fin_intersection2.Z(), phi2, 20);
1966  mrkzphi2->SetMarkerColor(kMagenta - 7);
1967  mrkzphi2->Draw("SAME");
1968  }
1969  display->Update();
1970  display->Modified();
1971  // cin >> goOnChar;
1972  }
1973  // DISPLAY ----------------------------
1974 
1975  TH1F hz("hz", "z", (zmax - zmin)/10., zmin, zmax); // CHECK
1976  for(int ihit = 0; ihit < skewhitlist->GetNofHits(); ihit++) {
1977  PndTrkSkewHit *skewhit = (PndTrkSkewHit*) skewhitlist->GetHit(ihit);
1978  if(!skewhit) continue;
1979  TVector3 fin_intersection1 = skewhit->GetIntersection1();
1980  TVector3 fin_intersection2 = skewhit->GetIntersection2();
1981  hz.Fill(fin_intersection1.Z());
1982  hz.Fill(fin_intersection2.Z());
1983  }
1984  int maxbinz = hz.GetMaximumBin();
1985  double mostprobZ = hz.GetBinCenter(maxbinz);
1986  // cout << mostprobZ << endl;
1987 
1988  // delete hits too far away ..........
1989  // cout << "##################### DELETE HITS" << endl;
1990  PndTrkCluster tmpskewhitlist;
1991  for(int ihit = 0; ihit < skewhitlist->GetNofHits(); ihit++) {
1992  PndTrkSkewHit *skewhit = (PndTrkSkewHit*) skewhitlist->GetHit(ihit);
1993  if(!skewhit) continue;
1994  TVector3 fin_intersection1 = skewhit->GetIntersection1();
1995  TVector3 fin_intersection2 = skewhit->GetIntersection2();
1996  double phi1 = skewhit->GetPhi1();
1997  double phi2 = skewhit->GetPhi2();
1998 
1999  if(fabs(fin_intersection1.Z() - mostprobZ) > 30. && fabs(fin_intersection2.Z() - mostprobZ) > 30.) {
2000  // cout << "THROW AWAY " << ihit << " " << fabs(fin_intersection1.Z() - mostprobZ) << " " << fabs(fin_intersection2.Z() - mostprobZ) << endl;
2001  continue;
2002  }
2003  skewhit->SetSortVariable((phi1 + phi2)/2.);
2004  tmpskewhitlist.AddHit(skewhit);
2005  }
2006  tmpskewhitlist.Sort();
2007  return tmpskewhitlist;
2008 }
Double_t GetPhi1()
Definition: PndTrkSkewHit.h:37
void SetSortVariable(Double_t sortvar)
Definition: PndTrkHit.h:44
void AddHit(PndTrkHit *hit)
TVector3 GetIntersection2()
Definition: PndTrkSkewHit.h:35
PndTrkHit * GetHit(int index)
Double_t GetPhi2()
Definition: PndTrkSkewHit.h:38
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
TVector3 GetIntersection1()
Definition: PndTrkSkewHit.h:34
Int_t GetNofHits()
Definition: PndTrkCluster.h:52
void DrawZGeometry(int whichone=1, double phimin=0, double phimax=360, double zmin=-43, double zmax=113)
PndTrkCluster * PndTrkLegendreSecTask2::CleanupZPhiFit ( PndTrkCluster cluster,
double  fitm,
double  fitp 
)

Definition at line 2540 of file PndTrkLegendreSecTask2.cxx.

References PndTrkCluster::AddHit(), fabs(), fMvdPixelBranch, fMvdStripBranch, fSttBranch, PndTrkHit::GetDetectorID(), PndTrkCluster::GetHit(), PndTrkCluster::GetNofHits(), PndTrkHit::GetPhi(), PndTrkHit::GetPosition(), hit, PndTrkHit::IsSttParallel(), phi, and sqrt().

Referenced by Exec().

2540  {
2541 
2542  PndTrkCluster *cleancluster = new PndTrkCluster();
2543  for(int ihit = 0; ihit < cluster->GetNofHits(); ihit++) {
2544  PndTrkHit *hit = cluster->GetHit(ihit);
2545  if(hit->IsSttParallel()) {
2546  cleancluster->AddHit(hit);
2547  continue; // CHECK IsSttParrallel will be changed
2548  }
2549 
2550  TVector3 position = hit->GetPosition();
2551  double phi = hit->GetPhi();
2552 
2553  // d = | m x - y + p | / sqrt(m**2 + 1)
2554  double distance = fabs(fitm * phi - position.Z() + fitp )/sqrt(fitm * fitm + 1);
2555  // cout << "distance " << hit->GetHitID() << " " << distance << endl;
2556 
2557  if(hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fMvdPixelBranch) || hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fMvdStripBranch)) {
2558  if(distance < 1) cleancluster->AddHit(hit);
2559  }
2560  else if(hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fSttBranch)) {
2561  if(distance < 5) cleancluster->AddHit(hit);
2562  }
2563  }
2564  // cout << "cleancluster " << cleancluster->GetNofHits () << endl;
2565  return cleancluster;
2566 }
Double_t GetPhi()
Definition: PndTrkHit.h:67
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
void AddHit(PndTrkHit *hit)
PndTrkHit * GetHit(int index)
Bool_t IsSttParallel()
Definition: PndTrkHit.h:70
Int_t GetDetectorID()
Definition: PndTrkHit.h:57
TVector3 GetPosition()
Definition: PndTrkHit.h:62
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
PndSdsMCPoint * hit
Definition: anasim.C:70
Int_t GetNofHits()
Definition: PndTrkCluster.h:52
void PndTrkLegendreSecTask2::ComputeTraAndRot ( PndTrkHit hit,
Double_t delta,
Double_t  trasl[2] 
)

Definition at line 2186 of file PndTrkLegendreSecTask2.cxx.

References PndTrkHit::GetPosition().

Referenced by Exec().

2186  {
2187 
2188  trasl[0] = hit->GetPosition().X();
2189  trasl[1] = hit->GetPosition().Y();
2190 
2191  delta = 0.; // TMath::ATan2(hit->GetPosition().Y() - 0., hit->GetPosition().X() - 0.); // CHECK
2192 
2193 }
TVector3 GetPosition()
Definition: PndTrkHit.h:62
double PndTrkLegendreSecTask2::ComputeZRediduals ( PndTrkCluster cluster,
double  fitm,
double  fitp 
)

Definition at line 2660 of file PndTrkLegendreSecTask2.cxx.

References display, fDisplayOn, fSttBranch, PndTrkHit::GetDetectorID(), PndTrkCluster::GetHit(), PndTrkCluster::GetNofHits(), PndTrkHit::GetPhi(), PndTrkHit::GetPosition(), hit, PndTrkHit::IsSttParallel(), and phi.

2660  {
2661 
2662  TH1F hresiduals("hresiduals", "residuals in z", 20, -5, 5);
2663 
2664  for(int ihit = 0; ihit < cluster->GetNofHits(); ihit++) {
2665  PndTrkHit *hit = cluster->GetHit(ihit);
2666 
2667  if(hit->GetDetectorID() != FairRootManager::Instance()->GetBranchId(fSttBranch)) continue;
2668  if(hit->IsSttParallel()) continue;
2669 
2670  TVector3 position = hit->GetPosition();
2671  double phi = hit->GetPhi();
2672 
2673 
2674  double distance = fitm * phi + fitp - position.Z();
2675 
2676  hresiduals.Fill(distance);
2677  }
2678 
2679  if(fDisplayOn) {
2680  display->cd(4);
2681  char goOnChar;
2682  cout << "residuals";
2683  cin >> goOnChar;
2684  hresiduals.Draw();
2685  display->Update();
2686  display->Modified();
2687  cin >> goOnChar;
2688  }
2689  return hresiduals.GetMean();
2690 }
Double_t GetPhi()
Definition: PndTrkHit.h:67
PndTrkHit * GetHit(int index)
Bool_t IsSttParallel()
Definition: PndTrkHit.h:70
Int_t GetDetectorID()
Definition: PndTrkHit.h:57
TVector3 GetPosition()
Definition: PndTrkHit.h:62
PndSdsMCPoint * hit
Definition: anasim.C:70
Int_t GetNofHits()
Definition: PndTrkCluster.h:52
double PndTrkLegendreSecTask2::CorrectZ ( PndTrkCluster cluster,
double  deltaz,
double  fitm,
double  fitp 
)

Definition at line 2692 of file PndTrkLegendreSecTask2.cxx.

References display, Double_t, fDisplayOn, fSttBranch, fTubeArray, PndTrkHit::GetDetectorID(), PndSttTube::GetHalfLength(), PndTrkCluster::GetHit(), PndTrkCluster::GetNofHits(), PndSttTube::GetPosition(), PndTrkHit::GetPosition(), PndTrkHit::GetTubeID(), PndSttTube::GetWireDirection(), hit, PndTrkHit::IsSttParallel(), m, p, and PndTrkHit::SetPosition().

2692  {
2693 
2694  for(int ihit = 0; ihit < cluster->GetNofHits(); ihit++) {
2695  PndTrkHit *hit = cluster->GetHit(ihit);
2696 
2697  if(hit->GetDetectorID() != FairRootManager::Instance()->GetBranchId(fSttBranch)) continue;
2698  if(hit->IsSttParallel()) continue;
2699 
2700  TVector3 position = hit->GetPosition();
2701  double newz = position.Z() - deltaz;
2702 
2703 
2704  int tubeID = hit->GetTubeID();
2705  PndSttTube *tube = (PndSttTube*) fTubeArray->At(tubeID);
2706 
2707  TVector3 wireDirection = tube->GetWireDirection();
2708  Double_t halflength = tube->GetHalfLength();
2709 
2710  TVector3 first = tube->GetPosition() + wireDirection * halflength; // CHECK
2711  TVector3 second = tube->GetPosition() - wireDirection * halflength; // CHECK
2712 
2713  double m, p;
2714  double newx = position.X();
2715  double newy = position.Y();
2716  if((second.X() - first.X()) != 0) {
2717  m = (second.Z() - first.Z())/(second.X() - first.X());
2718  p = position.Z() - m * position.X();
2719  newx = (newz - p)/m;
2720  }
2721 
2722  if((second.Y() - first.Y()) != 0) {
2723 
2724  m = (second.Z() - first.Z())/(second.Y() - first.Y());
2725  p = position.Z() - m * position.Y();
2726  newy = (newz - p)/m;
2727  }
2728 
2729  hit->SetPosition(TVector3(newx, newy, newz));
2730 
2731  if(fDisplayOn) {
2732  display->cd(1);
2733  char goOnChar;
2734  cout << endl;
2735  cout << "SEE IT" ;
2736  TMarker *mrk = new TMarker(newx, newy, 6);
2737  mrk->SetMarkerColor(kOrange);
2738  mrk->Draw("SAME");
2739  display->Update();
2740  display->Modified();
2741 
2742  cout << "old " << position.X() << " " << position.Y() << " " << position.Z() << endl;
2743  cout << "new " << newx << " " << newy << " " << newz << endl;
2744 
2745  cin >> goOnChar;
2746  }
2747 
2748  }
2749 }
Double_t p
Definition: anasim.C:58
__m128 m
Definition: P4_F32vec4.h:28
Double_t GetHalfLength()
Definition: PndSttTube.cxx:99
PndTrkHit * GetHit(int index)
Bool_t IsSttParallel()
Definition: PndTrkHit.h:70
Int_t GetDetectorID()
Definition: PndTrkHit.h:57
Double_t
TVector3 GetPosition()
Definition: PndTrkHit.h:62
TVector3 GetPosition()
Definition: PndSttTube.cxx:87
void SetPosition(TVector3 pos)
Definition: PndTrkHit.h:47
PndSdsMCPoint * hit
Definition: anasim.C:70
Int_t GetNofHits()
Definition: PndTrkCluster.h:52
Int_t GetTubeID()
Definition: PndTrkHit.h:61
TVector3 GetWireDirection()
Definition: PndSttTube.cxx:107
PndTrkCluster PndTrkLegendreSecTask2::CreateClusterByConfDistance ( double  fitm,
double  fitq 
)

Definition at line 1037 of file PndTrkLegendreSecTask2.cxx.

References PndTrkCluster::AddHit(), Bool_t, conformalhitlist, display, fDisplayOn, fMvdPixelBranch, fMvdStripBranch, fSttBranch, PndTrkConformalHit::GetDetectorID(), PndTrkConformalHit::GetDistanceFromTrack(), PndTrkHitList::GetHit(), PndTrkConformalHitList::GetHit(), PndTrkConformalHit::GetHitID(), PndTrkConformalHit::GetIsochrone(), PndTrkConformalHitList::GetNofHits(), PndTrkConformalHit::GetU(), PndTrkConformalHit::GetV(), hit, mvdpixhitlist, mvdstrhitlist, and stthitlist.

1037  {
1038 
1039  PndTrkCluster cluster;
1040  // ADD HIT IN CONFORMAL PLANE WITH DISTANCE CRITERION
1041  // cost x + sint y - r = 0 -> |cost x0 + sint y0 - r|
1042  // cout << "CONFORMALHITLIST " << conformalhitlist->GetNofHits() << endl;
1043  for(int ihit = 0; ihit < conformalhitlist->GetNofHits(); ihit++) {
1045  double dist = chit->GetDistanceFromTrack(fitm, fitq);
1046  int hitID = chit->GetHitID();
1047  int detID = chit->GetDetectorID();
1048 
1049  // CHECK limits
1050  double distlimit = 0;
1051  if(detID == FairRootManager::Instance()->GetBranchId(fMvdPixelBranch)) distlimit = 0.003;
1052  else if(detID == FairRootManager::Instance()->GetBranchId(fMvdStripBranch)) distlimit = 0.003;
1053  else if(detID == FairRootManager::Instance()->GetBranchId(fSttBranch)) {
1054  if(chit->GetIsochrone() > 1.e-4) distlimit = 6 * chit->GetIsochrone();
1055  else distlimit = 0.001;
1056  }
1057  // ---------------------------
1058  Bool_t accept = kFALSE;
1059 
1060 
1061  if(dist < distlimit) {
1062  if(fDisplayOn) {
1063  if(chit->GetIsochrone() > 0) {
1064  TArc *arc = new TArc(chit->GetU(), chit->GetV(), chit->GetIsochrone());
1065  arc->SetFillStyle(0);
1066  arc->SetLineColor(5);
1067  display->cd(2);
1068  arc->Draw("SAME");
1069  }
1070  else {
1071  TMarker *mrk;
1072  if(detID == FairRootManager::Instance()->GetBranchId(fMvdPixelBranch)) mrk = new TMarker(chit->GetU(), chit->GetV(), 21);
1073  else if(detID == FairRootManager::Instance()->GetBranchId(fMvdStripBranch)) mrk = new TMarker(chit->GetU(), chit->GetV(), 25);
1074  mrk->SetMarkerColor(5);
1075  display->cd(2);
1076  mrk->Draw("SAME");
1077  }
1078  }
1079 
1080  PndTrkHit *hit;
1081  if(detID == FairRootManager::Instance()->GetBranchId(fMvdPixelBranch)) {
1082  hit = mvdpixhitlist->GetHit(hitID);
1083  }
1084  else if(detID == FairRootManager::Instance()->GetBranchId(fMvdStripBranch)) {
1085  hit = mvdstrhitlist->GetHit(hitID);
1086  }
1087  else if(detID == FairRootManager::Instance()->GetBranchId(fSttBranch)) {
1088  hit = stthitlist->GetHit(hitID);
1089  }
1090 
1091  // ********** CHECK ***********
1092  // if you put "is used" the efficiency beecomes much lower!
1093  // DO NOT: if(!hit->IsUsed())
1094  cluster.AddHit(hit);
1095  accept = kTRUE;
1096 
1097  }
1098 
1099  // else cout << "DISCARDED " << hitID << " " << detID << " " << dist << " " << distlimit << endl;
1100  }
1101 
1102  return cluster;
1103 }
PndTrkSdsHitList * mvdpixhitlist
void AddHit(PndTrkHit *hit)
PndTrkHit * GetHit(int index)
PndTrkConformalHit * GetHit(int index)
double GetDistanceFromTrack(double fitm, double fitp)
PndTrkConformalHitList * conformalhitlist
PndSdsMCPoint * hit
Definition: anasim.C:70
PndTrkSdsHitList * mvdstrhitlist
PndTrkCluster PndTrkLegendreSecTask2::CreateClusterByDistance ( Int_t  mode,
double  fitm,
double  fitq 
)

Definition at line 1298 of file PndTrkLegendreSecTask2.cxx.

References PndTrkCluster::AddHit(), Bool_t, conformalhitlist, display, DoesConfHitBelong(), DoesRealHitBelong(), Double_t, fDisplayOn, fMvdPixelBranch, fMvdStripBranch, fRefHit, FromConformalToRealTrack(), fSttBranch, PndTrkHit::GetDetectorID(), PndTrkConformalHit::GetHit(), PndTrkConformalHitList::GetHit(), PndTrkHit::GetIsochrone(), PndTrkConformalHitList::GetNofHits(), PndTrkHit::GetPosition(), hit, R, x0, and y0.

1298  {
1299  PndTrkCluster cluster;
1300 
1301  // mode: -------------------------------------------
1302  // 0 all conformal: pix conf - str conf - stt conf
1303  // 1 all real: pix real - str real - stt real
1304  // 2 mix: pix real - str real - stt conf
1305  // --------------------------------------------------
1306  Double_t x0, y0, R;
1307  FromConformalToRealTrack(fitm, fitp, x0, y0, R);
1308 
1309  for(int ihit = 0; ihit < conformalhitlist->GetNofHits(); ihit++) {
1311  PndTrkHit *hit = chit->GetHit();
1312  Bool_t accept = kFALSE;
1313 
1314  if(hit == fRefHit) accept = DoesRealHitBelong(hit, x0, y0, R);
1315  else {
1316  if(mode == 0) accept = DoesConfHitBelong(chit, fitm, fitp);
1317  else if(mode == 1) accept = DoesRealHitBelong(hit, x0, y0, R);
1318  else if(mode == 2) {
1319  if(hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fSttBranch)) accept = DoesConfHitBelong(chit, fitm, fitp);
1320  else accept = DoesRealHitBelong(hit, x0, y0, R);
1321  }
1322  }
1323 
1324 
1325  if(accept == kTRUE && fDisplayOn) {
1326  display->cd(1);
1327  if(hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fSttBranch)) {
1328  TArc *arc = new TArc(hit->GetPosition().X(), hit->GetPosition().Y(), hit->GetIsochrone());
1329  arc->SetFillStyle(0);
1330  arc->SetLineColor(5);
1331  arc->Draw("SAME");
1332  }
1333  else {
1334  TMarker *mrk;
1335  if(hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fMvdPixelBranch)) mrk = new TMarker(hit->GetPosition().X(), hit->GetPosition().Y(), 21);
1336  else if(hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fMvdStripBranch)) mrk = new TMarker(hit->GetPosition().X(), hit->GetPosition().Y(), 25);
1337  mrk->SetMarkerColor(5);
1338  mrk->Draw("SAME");
1339  }
1340  }
1341 
1342  // ********** CHECK ***********
1343  // if you put "is used" the efficiency beecomes much lower!
1344  // DO NOT: if(!hit->IsUsed())
1345  if(accept == kTRUE) {
1346  // cout << "ADDING TO CLUSTER" << endl;
1347  cluster.AddHit(hit);
1348  }
1349  }
1350  return cluster;
1351 }
Double_t x0
Definition: checkhelixhit.C:70
void AddHit(PndTrkHit *hit)
Int_t mode
Definition: autocutx.C:47
Int_t GetDetectorID()
Definition: PndTrkHit.h:57
Double_t
PndTrkConformalHit * GetHit(int index)
Double_t y0
Definition: checkhelixhit.C:71
Bool_t DoesConfHitBelong(PndTrkConformalHit *hit, double fitm, double fitp)
TVector3 GetPosition()
Definition: PndTrkHit.h:62
Bool_t DoesRealHitBelong(PndTrkHit *hit, double x0, double y0, double R)
PndTrkConformalHitList * conformalhitlist
void FromConformalToRealTrack(double fitm, double fitp, double &x0, double &y0, double &R)
PndSdsMCPoint * hit
Definition: anasim.C:70
Double_t GetIsochrone()
Definition: PndTrkHit.h:63
Double_t R
Definition: checkhelixhit.C:61
PndTrkCluster PndTrkLegendreSecTask2::CreateClusterByMixedDistance ( double  fitm,
double  fitq 
)

Definition at line 1172 of file PndTrkLegendreSecTask2.cxx.

References PndTrkCluster::AddHit(), conformalhitlist, display, Double_t, fDisplayOn, FromConformalToRealTrack(), fSttBranch, PndTrkConformalHitList::GetConformalTransform(), PndTrkConformalHit::GetDetectorID(), PndTrkConformalHit::GetDistanceFromTrack(), PndTrkHitList::GetHit(), PndTrkConformalHitList::GetHit(), PndTrkConformalHit::GetHitID(), PndTrkConformalHit::GetIsochrone(), PndTrkHitList::GetNofHits(), PndTrkConformalHitList::GetNofHits(), PndTrkHit::GetPosition(), PndTrkConformalTransform::GetRotation(), PndTrkConformalHit::GetU(), PndTrkConformalHit::GetV(), PndTrkHit::GetXYDistanceFromTrack(), hit, mvdpixhitlist, mvdstrhitlist, and stthitlist.

1172  {
1173 
1174  PndTrkCluster cluster;
1175  double delta = conformalhitlist->GetConformalTransform()->GetRotation();
1176  // CHECK
1177  // ADD HIT IN MIXED MODE REAL P. FOR MVD & CONFORMAL P. FOR STT,
1178  // WITH DISTANCE CRITERION
1179  // real: fabs(R - sqrt((xc - x)**2 + (yc - y)**2)) < distlim
1180  // cofn: cost x + sint y - r = 0 -> |cost x0 + sint y0 - r|
1181 
1182  // CHECK if this needs to be kept --> change xc0 to xc etc
1183  // center and radius
1184  Double_t xc0, yc0, R0;
1185  FromConformalToRealTrack(fitm, fitq, xc0, yc0, R0);
1186  // .........................................................
1187  if(fDisplayOn) {
1188  TArc *arc = new TArc(xc0, yc0, R0);
1189  arc->SetFillStyle(0);
1190  arc->SetLineColor(5);
1191  display->cd(1);
1192  arc->Draw("SAME");
1193  }
1194  for(int ihit = 0; ihit < mvdpixhitlist->GetNofHits(); ihit++) {
1195  PndTrkHit *hit = mvdpixhitlist->GetHit(ihit);
1196  double dist = hit->GetXYDistanceFromTrack(xc0, yc0, R0);
1197  // CHECK limits
1198  double distlimit = 0.5;
1199  if(dist < distlimit) {
1200  cluster.AddHit(hit);
1201  if(fDisplayOn) {
1202  TMarker *mrk = new TMarker(hit->GetPosition().X(), hit->GetPosition().Y(), 21);
1203  mrk->SetMarkerColor(5);
1204  display->cd(1);
1205  mrk->Draw("SAME");
1206  }
1207  }
1208  }
1209  for(int ihit = 0; ihit < mvdstrhitlist->GetNofHits(); ihit++) {
1210  PndTrkHit *hit = mvdstrhitlist->GetHit(ihit);
1211  double dist = hit->GetXYDistanceFromTrack(xc0, yc0, R0);
1212  // CHECK limits
1213  double distlimit = 0.5;
1214  if(dist < distlimit){
1215  cluster.AddHit(hit);
1216  if(fDisplayOn) {
1217  TMarker *mrk = new TMarker(hit->GetPosition().X(), hit->GetPosition().Y(), 25);
1218  mrk->SetMarkerColor(5);
1219  display->cd(1);
1220  mrk->Draw("SAME");
1221  }
1222  }
1223  }
1224 
1225  for(int ihit = 0; ihit < conformalhitlist->GetNofHits(); ihit++) {
1227  double dist = chit->GetDistanceFromTrack(fitm, fitq);
1228 
1229  int hitID = chit->GetHitID();
1230  int detID = chit->GetDetectorID();
1231 
1232  // CHECK limits
1233  if(detID != FairRootManager::Instance()->GetBranchId(fSttBranch)) continue;
1234  double distlimit = 0;
1235  if(chit->GetIsochrone() > 1.e-4) distlimit = 6 * chit->GetIsochrone();
1236  else distlimit = 0.001;
1237  // ---------------------------
1238 
1239  if(dist < distlimit) {
1240 
1241  // cout << "ADDED " << hitID << " " << detID << " " << dist << " " << distlimit << endl;
1242 
1243  if(fDisplayOn) {
1244  TArc *arc = new TArc(chit->GetU(), chit->GetV(), chit->GetIsochrone());
1245  arc->SetFillStyle(0);
1246  arc->SetLineColor(5);
1247  display->cd(2);
1248  arc->Draw("SAME");
1249  }
1250 
1251  PndTrkHit *hit = stthitlist->GetHit(hitID);
1252 
1253  // ********** CHECK ***********
1254  // if you put "is used" the efficiency beecomes much lower!
1255  // DO NOT: if(!hit->IsUsed())
1256  cluster.AddHit(hit);
1257  }
1258  }
1259  return cluster;
1260 }
PndTrkSdsHitList * mvdpixhitlist
void AddHit(PndTrkHit *hit)
PndTrkHit * GetHit(int index)
Double_t
PndTrkConformalHit * GetHit(int index)
TVector3 GetPosition()
Definition: PndTrkHit.h:62
double GetDistanceFromTrack(double fitm, double fitp)
Double_t GetXYDistanceFromTrack(double x0, double y0, double R)
Definition: PndTrkHit.cxx:105
Int_t GetNofHits()
Definition: PndTrkHitList.h:43
PndTrkConformalTransform * GetConformalTransform()
PndTrkConformalHitList * conformalhitlist
void FromConformalToRealTrack(double fitm, double fitp, double &x0, double &y0, double &R)
PndSdsMCPoint * hit
Definition: anasim.C:70
PndTrkSdsHitList * mvdstrhitlist
PndTrkCluster PndTrkLegendreSecTask2::CreateClusterByRealDistance ( double  xc0,
double  yc0,
double  R0 
)

Definition at line 1105 of file PndTrkLegendreSecTask2.cxx.

References PndTrkCluster::AddHit(), display, fDisplayOn, PndTrkHitList::GetHit(), PndTrkHit::GetIsochrone(), PndTrkHitList::GetNofHits(), PndTrkHit::GetPosition(), PndTrkHit::GetXYDistanceFromTrack(), hit, PndTrkHit::IsSttSkew(), mvdpixhitlist, mvdstrhitlist, and stthitlist.

1105  {
1106  // ADD HIT IN REAL PLANE WITH DISTANCE CRITERION
1107  // sqrt((xc - x)**2 + (yc - y)**2) < distlim
1108  PndTrkCluster cluster;
1109 
1110  // .........................................................
1111  if(fDisplayOn) {
1112  TArc *arc = new TArc(xc0, yc0, R0);
1113  arc->SetFillStyle(0);
1114  arc->SetLineColor(5);
1115  display->cd(1);
1116  arc->Draw("SAME");
1117  }
1118  for(int ihit = 0; ihit < stthitlist->GetNofHits(); ihit++) {
1119  PndTrkHit *hit = stthitlist->GetHit(ihit);
1120  if(hit->IsSttSkew()) continue;
1121  double dist = hit->GetXYDistanceFromTrack(xc0, yc0, R0);
1122  // cout << ihit << " dist " << dist << endl;
1123  // CHECK limits
1124  double distlimit = 1.5 * 0.5;
1125  if(dist < distlimit){
1126  // cout << "TRACK " << xc0 << " " << yc0 << " " << R0 << endl;
1127  // cout << "ADD HIT " << dist << " " << distlimit << " " << hit->GetHitID() << endl;
1128  cluster.AddHit(hit);
1129  if(fDisplayOn) {
1130  TArc *arc = new TArc(hit->GetPosition().X(), hit->GetPosition().Y(), hit->GetIsochrone());
1131  arc->SetFillStyle(0);
1132  arc->SetLineColor(5);
1133  display->cd(1);
1134  arc->Draw("SAME");
1135  }
1136  }
1137  }
1138  for(int ihit = 0; ihit < mvdpixhitlist->GetNofHits(); ihit++) {
1139  PndTrkHit *hit = mvdpixhitlist->GetHit(ihit);
1140  double dist = hit->GetXYDistanceFromTrack(xc0, yc0, R0);
1141  // CHECK limits
1142  double distlimit = 0.5;
1143  if(dist < distlimit) {
1144  cluster.AddHit(hit);
1145  if(fDisplayOn) {
1146  TMarker *mrk = new TMarker(hit->GetPosition().X(), hit->GetPosition().Y(), 21);
1147  mrk->SetMarkerColor(5);
1148  display->cd(1);
1149  mrk->Draw("SAME");
1150  }
1151  }
1152  }
1153  for(int ihit = 0; ihit < mvdstrhitlist->GetNofHits(); ihit++) {
1154  PndTrkHit *hit = mvdstrhitlist->GetHit(ihit);
1155  double dist = hit->GetXYDistanceFromTrack(xc0, yc0, R0);
1156  // CHECK limits
1157  double distlimit = 0.5;
1158  if(dist < distlimit){
1159  cluster.AddHit(hit);
1160  if(fDisplayOn) {
1161  TMarker *mrk = new TMarker(hit->GetPosition().X(), hit->GetPosition().Y(), 25);
1162  mrk->SetMarkerColor(5);
1163  display->cd(1);
1164  mrk->Draw("SAME");
1165  }
1166  }
1167  }
1168  return cluster;
1169 
1170 }
PndTrkSdsHitList * mvdpixhitlist
void AddHit(PndTrkHit *hit)
PndTrkHit * GetHit(int index)
TVector3 GetPosition()
Definition: PndTrkHit.h:62
Double_t GetXYDistanceFromTrack(double x0, double y0, double R)
Definition: PndTrkHit.cxx:105
Int_t GetNofHits()
Definition: PndTrkHitList.h:43
PndSdsMCPoint * hit
Definition: anasim.C:70
Double_t GetIsochrone()
Definition: PndTrkHit.h:63
Bool_t IsSttSkew()
Definition: PndTrkHit.h:71
PndTrkSdsHitList * mvdstrhitlist
PndTrkCluster PndTrkLegendreSecTask2::CreateSkewHitList ( PndTrkTrack track)

Definition at line 1642 of file PndTrkLegendreSecTask2.cxx.

References a, PndTrkCluster::AddHit(), b, PndTrkTrack::ComputePhi(), PndTrkTools::ComputeSegmentCircleIntersection(), PndTrkTools::ComputeTangentInPoint(), CAMath::Cos(), display, Double_t, DrawZGeometry(), dx, dy, fDisplayOn, fTubeArray, PndTrkTrack::GetCenter(), PndSttTube::GetHalfLength(), PndTrkHitList::GetHit(), PndTrkHit::GetIsochrone(), PndTrkHitList::GetNofHits(), PndSttTube::GetPosition(), PndTrkTrack::GetRadius(), PndTrkHit::GetTubeID(), PndSttTube::GetWireDirection(), hit, PndTrkHit::IsSttSkew(), Pi, R, RefreshZ(), CAMath::Sin(), SKEW_ANGLE, CAMath::Sqrt(), stthitlist, t, tools, X, Y, and y0.

Referenced by Exec().

1642  {
1643 
1644  double xc = track->GetCenter().X();
1645  double yc = track->GetCenter().Y();
1646  double R = track->GetRadius();
1647  PndTrkCluster skewhitlist;
1648 
1649  double phimin = 400, phimax = -1, zmin = 1000, zmax = -1;
1650  for(int ihit = 0; ihit < stthitlist->GetNofHits(); ihit++) {
1651  PndTrkHit *hit = stthitlist->GetHit(ihit);
1652  // if(hit->IsUsed()) {
1653  // cout << "already used IV" << endl;
1654  // continue;
1655  // }
1656  if(hit->IsSttSkew() == kFALSE) continue;
1657 
1658  int tubeID = hit->GetTubeID();
1659  PndSttTube *tube = (PndSttTube*) fTubeArray->At(tubeID);
1660 
1661  TVector3 wireDirection = tube->GetWireDirection();
1662  Double_t halflength = tube->GetHalfLength();
1663 
1664  TVector3 first = tube->GetPosition() + wireDirection * halflength; // CHECK
1665  TVector3 second = tube->GetPosition() - wireDirection * halflength; // CHECK
1666  // if(fDisplayOn) {
1667  // char goOnChar;
1668  // display->cd(1);
1669  // TLine *l = new TLine(first.X(), first.Y(), second.X(), second.Y());
1670  // l->SetLineColor(kBlue);
1671  // l->Draw("SAME");
1672  // display->Update();
1673  // display->Modified();
1674  // cin >> goOnChar;
1675  // }
1676  double m1 = (first - second).Y()/(first - second).X();
1677  double q1 = first.Y() - m1 * first.X();
1678 
1679  // 1. compute intersection between the track circle and the wire
1680  TVector2 intersection1, intersection2;
1681  Int_t nofintersections = tools->ComputeSegmentCircleIntersection(TVector2(first.X(), first.Y()), TVector2(second.X(), second.Y()), xc, yc, R, intersection1, intersection2);
1682 
1683  if(nofintersections == 0) continue;
1684  if(nofintersections >= 2) {
1685  cout << "ERROR: MORE THAN 1 INTERSECTION!!" << endl;
1686  continue; // CHECK
1687  }
1688 
1689  if(fDisplayOn) {
1690  char goOnChar;
1691  display->cd(1);
1692  TLine *l = new TLine(first.X(), first.Y(), second.X(), second.Y());
1693  l->SetLineColor(kBlue);
1694  l->Draw("SAME");
1695 
1696  TMarker *mrk = new TMarker(intersection1.X(), intersection1.Y(), 20);
1697  mrk->SetMarkerColor(kBlue);
1698  mrk->Draw("SAME");
1699 
1700  display->Update();
1701  display->Modified();
1702 
1703 
1704  // cin >> goOnChar;
1705  }
1706 
1707 
1708  // 2. find the tangent to the track in the intersection point
1709  // tangent approximation
1710  TVector2 tangent = tools->ComputeTangentInPoint(xc, yc, intersection1);
1711 
1712  // 3. rotate clockwise the tangent/point/(wire, not explicitely)
1713  // in order to have the wire parallel to the x axis;
1714  // then translate everything to have the wire ON the x axis
1715  double beta = wireDirection.Phi();
1716  if(beta < 0) beta += TMath::Pi();
1717  // ... rotate the tangent
1718  double rtx = TMath::Cos(beta) * tangent.X() + TMath::Sin(beta) * tangent.Y();
1719  double rty = TMath::Cos(beta) * tangent.Y() - TMath::Sin(beta) * tangent.X();
1720  TVector2 rottangent(rtx, rty);
1721  rottangent = rottangent.Unit();
1722  // ... rotate the point
1723  double rx = TMath::Cos(beta) * intersection1.X() + TMath::Sin(beta) * intersection1.Y();
1724  double ry = TMath::Cos(beta) * intersection1.Y() - TMath::Sin(beta) * intersection1.X();
1725 
1726  // translation
1727  Double_t deltay = ry;
1728  rty -= deltay;
1729  ry -= deltay;
1730 
1731  // rotm, rotp
1732  Double_t rotm = rottangent.Y()/rottangent.X();
1733  Double_t rotp = ry - rotm * rx;
1734 
1735  // ellipsis
1736  double a = hit->GetIsochrone() * TMath::Cos(SKEW_ANGLE); // CHECK skew angle hard coded
1737  double b = hit->GetIsochrone();
1738 
1739  // center of ellipsis
1740  Double_t x0a, x0b, y0;
1741  y0 = 0.;
1742  x0a = (-rotp + TMath::Sqrt(b * b + a * a * rotm * rotm)) / rotm;
1743  x0b = (-rotp - TMath::Sqrt(b * b + a * a * rotm * rotm)) / rotm;
1744 
1745  // intersection point
1746  double intxa = (x0a * b * b - rotm * rotp * a * a) / (b * b + rotm * rotm * a * a);
1747  double intya = rotm * intxa + rotp;
1748  double intxb = (x0b * b * b - rotm * rotp * a * a) / (b * b + rotm * rotm * a * a);
1749  double intyb = rotm * intxb + rotp;
1750 
1751  // 4. retraslate/rerotate all back to the original plane
1752  // retranslate
1753  y0 += deltay;
1754  intya += deltay;
1755  intyb += deltay;
1756 
1757  // rerotate
1758  double x0anew = TMath::Cos(beta) * x0a - TMath::Sin(beta) * y0;
1759  double y0anew = TMath::Cos(beta) * y0 + TMath::Sin(beta) * x0a;
1760  double x0bnew = TMath::Cos(beta) * x0b - TMath::Sin(beta) * y0;
1761  double y0bnew = TMath::Cos(beta) * y0 + TMath::Sin(beta) * x0b;
1762 
1763  double intxanew = TMath::Cos(beta) * intxa - TMath::Sin(beta) * intya;
1764  double intyanew = TMath::Cos(beta) * intya + TMath::Sin(beta) * intxa;
1765  double intxbnew = TMath::Cos(beta) * intxb - TMath::Sin(beta) * intyb;
1766  double intybnew = TMath::Cos(beta) * intyb + TMath::Sin(beta) * intxb;
1767 
1768  intxa = intxanew;
1769  intya = intyanew;
1770  intxb = intxbnew;
1771  intyb = intybnew;
1772 
1773  // now we have x0a, y0a, center of the 1st ellipse
1774  // and x0b, y0b, center of the 2nd ellipse
1775  x0a = x0anew;
1776  double y0a = y0anew;
1777  x0b = x0bnew;
1778  double y0b = y0bnew;
1779 
1780  if(fDisplayOn) {
1781  char goOnChar;
1782  display->cd(1);
1783 
1784  TEllipse *ell1 = new TEllipse(x0a, y0a, a, b, 0, 360, -beta);
1785  ell1->SetFillStyle(0);
1786  ell1->SetLineColor(4);
1787  ell1->Draw("SAME");
1788  TEllipse *ell2 = new TEllipse(x0b, y0b, a, b, 0, 360, -beta);
1789  ell2->SetFillStyle(0);
1790  ell2->SetLineColor(6);
1791  ell2->Draw("SAME");
1792 
1793  TMarker *mrkinta = new TMarker(intxa, intya, 20);
1794  mrkinta->SetMarkerColor(4);
1795  mrkinta->Draw("SAME");
1796  TMarker *mrkintb = new TMarker(intxb, intyb, 20);
1797  mrkintb->SetMarkerColor(6);
1798  mrkintb->Draw("SAME");
1799  // cin >> goOnChar;
1800  }
1801 
1802  // 5. calculate z coordinate for each intersection
1803 
1804  // calculate z0a, z0b of the center of the ellipse
1805  Double_t t = ((x0a + y0a) - (first.X() + first.Y())) / ((second.X() - first.X()) + (second.Y() - first.Y()));
1806  Double_t z0a = first.Z() + (second.Z() - first.Z()) * t;
1807  // cout << "0 : calculate t, z0a " << t << " " << z0a << endl;
1808 
1809  t = ((x0b + y0b) - (first.X() + first.Y())) / ((second.X() - first.X()) + (second.Y() - first.Y()));
1810  Double_t z0b = first.Z() + (second.Z() - first.Z()) * t;
1811 
1812  TVector3 center1(x0a, y0a, z0a);
1813  TVector3 center2(x0b, y0b, z0b);
1814  if(fDisplayOn) {
1815  char goOnChar;
1816  display->cd(3);
1817  // cout << "COMPUTE Z COORDINATE" << endl;
1818  RefreshZ();
1819  DrawZGeometry();
1820  TLine *linezx = new TLine(first.X(), first.Z(), second.X(), second.Z());
1821  linezx->Draw("SAME");
1822  TMarker *mrkza = new TMarker(x0a, z0a, 20);
1823  mrkza->SetMarkerColor(4);
1824  mrkza->Draw("SAME");
1825  TMarker *mrkzb = new TMarker(x0b, z0b, 20);
1826  mrkzb->SetMarkerColor(6);
1827  mrkzb->Draw("SAME");
1828  // cin >> goOnChar;
1829  }
1830 
1831  // calculate the z of the intersection ON the ellipse (CHECK this step calculations!)
1832  double dx = intxa - x0a;
1833  double dy = intya - y0a;
1834  TVector3 dxdy(dx, dy, 0.0);
1835 
1836  TVector3 tfirst = first + dxdy;
1837  TVector3 tsecond = second + dxdy;
1838 
1839  t = ((intxa + intya) - (tfirst.X() + tfirst.Y())) / ((tsecond.X() - tfirst.X()) + (tsecond.Y() - tfirst.Y()));
1840  double intza = tfirst.Z() + (tsecond.Z() - tfirst.Z()) * t;
1841  if(fDisplayOn) {
1842  char goOnChar;
1843  display->cd(3);
1844  TLine *linezx1 = new TLine(tfirst.X(), tfirst.Z(), tsecond.X(), tsecond.Z());
1845  linezx1->SetLineStyle(1);
1846  linezx1->Draw("SAME");
1847  TMarker *mrkza1 = new TMarker(intxa, intza, 20);
1848  mrkza1->SetMarkerColor(kBlue - 9);
1849  mrkza1->Draw("SAME");
1850  // cin >> goOnChar;
1851  }
1852 
1853  tfirst = first - dxdy;
1854  tsecond = second - dxdy;
1855 
1856  t = ((intxb + intyb) - (tfirst.X() + tfirst.Y())) / ((tsecond.X() - tfirst.X()) + (tsecond.Y() - tfirst.Y()));
1857  double intzb = tfirst.Z() + (tsecond.Z() - tfirst.Z()) * t;
1858 
1859  TVector3 fin_intersection1(intxa, intya, intza);
1860  TVector3 fin_intersection2(intxb, intyb, intzb);
1861 
1862  if(fDisplayOn) {
1863  char goOnChar;
1864  display->cd(3);
1865  TLine *linezx2 = new TLine(tfirst.X(), tfirst.Z(), tsecond.X(), tsecond.Z());
1866  linezx2->SetLineStyle(1);
1867  linezx2->Draw("SAME");
1868  TMarker *mrkzb1 = new TMarker(intxb, intzb, 20);
1869  mrkzb1->SetMarkerColor(kMagenta - 7);
1870  mrkzb1->Draw("SAME");
1871  // cin >> goOnChar;
1872  }
1873  // int1.SetXYZ(intxa, intya, intza);
1874  // int2.SetXYZ(intxb, intyb, intzb);
1875  // errz = fabs(intza - intzb)/2. ;
1876 
1877  // CHECK to be changed
1878  int trackID = 1;
1879  double phi1 = track->ComputePhi(fin_intersection1);
1880  double phi2 = track->ComputePhi(fin_intersection2);
1881 
1882  PndTrkSkewHit *skewhit = new PndTrkSkewHit(*hit, trackID, center1, fin_intersection1, phi1, center2, fin_intersection2, phi2, a, b, -1, beta);
1883  // skewhit->Print();
1884  skewhitlist.AddHit(skewhit);
1885 
1886 
1887  }
1888  // cout << "PHI: " << phimin << " " << phimax << endl;
1889  // cout << "Z : " << zmin << " " << zmax << endl;
1890 
1891 
1892  return skewhitlist;
1893 }
double dy
Double_t GetRadius()
Definition: PndTrkTrack.h:43
TTree * b
Double_t GetHalfLength()
Definition: PndSttTube.cxx:99
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
static T Sin(const T &x)
Definition: PndCAMath.h:42
void AddHit(PndTrkHit *hit)
double Y
Definition: anaLmdDigi.C:68
static T Cos(const T &x)
Definition: PndCAMath.h:43
PndTrkHit * GetHit(int index)
TVector2 GetCenter()
Definition: PndTrkTrack.h:44
Double_t ComputePhi(TVector3 hit)
Int_t a
Definition: anaLmdDigi.C:126
Double_t
Double_t y0
Definition: checkhelixhit.C:71
TVector3 GetPosition()
Definition: PndSttTube.cxx:87
TVector2 ComputeTangentInPoint(double xc, double yc, TVector2 point)
double dx
double X
Definition: anaLmdDigi.C:68
Int_t ComputeSegmentCircleIntersection(TVector2 ex1, TVector2 ex2, double xc, double yc, double R, TVector2 &intersection1, TVector2 &intersection2)
Definition: PndTrkTools.cxx:77
Int_t GetNofHits()
Definition: PndTrkHitList.h:43
TTree * t
Definition: bump_analys.C:13
PndSdsMCPoint * hit
Definition: anasim.C:70
Double_t GetIsochrone()
Definition: PndTrkHit.h:63
Double_t Pi
#define SKEW_ANGLE
Int_t GetTubeID()
Definition: PndTrkHit.h:61
Double_t R
Definition: checkhelixhit.C:61
TVector3 GetWireDirection()
Definition: PndSttTube.cxx:107
void DrawZGeometry(int whichone=1, double phimin=0, double phimax=360, double zmin=-43, double zmax=113)
Bool_t IsSttSkew()
Definition: PndTrkHit.h:71
PndTrkCluster PndTrkLegendreSecTask2::CreateSttCluster ( PndTrkHit firsthit)

THE PROCEDURE

2) LOOP (int hit2) on all the hits a) consider only the ones in region iregion

2) LOOP (int hit3) on all the hits IN THE CLUSTER a) IF the hit2 you are considering in the region IS the one in the cluster (hit3), continue. ELSE try to associate it to one of the hits in the cluster (IsSttAssociate) b) if IsSttAssociate is true, add the hit2 to the cluster too.

Definition at line 1566 of file PndTrkLegendreSecTask2.cxx.

References PndTrkCluster::AddHit(), Bool_t, PndTrkCluster::DeleteAllHits(), PndTrkHitList::GetHit(), PndTrkCluster::GetHit(), PndTrkHit::GetIRegion(), PndTrkHitList::GetNofHits(), PndTrkCluster::GetNofHits(), hit, PndTrkHit::IsRegion(), IsSttAssociate(), PndTrkHit::IsUsed(), PndTrkCluster::SetIRegion(), stthitlist, and mrfdata_8b_error::success.

1566  {
1567 
1568 
1584  PndTrkCluster cluster;
1585  cluster.AddHit(firsthit);
1586  cluster.SetIRegion(firsthit->GetIRegion());
1587 
1588  // 2) LOOP on all the hits
1589  for(int ihit = 0; ihit < stthitlist->GetNofHits(); ihit++) {
1590  PndTrkHit *hit = stthitlist->GetHit(ihit);
1591 
1592  if(hit->IsUsed()) {
1593  // cout << "already used IV" << endl;
1594  continue;
1595  }
1596  if(!hit->IsRegion(firsthit->GetIRegion())) continue;
1597  // cout << ihit << " " << cluster.GetNofHits() << endl;
1598  // 3) LOOP (int hit3) on all the hits IN THE CLUSTER
1599  for(int jhit = 0; jhit < cluster.GetNofHits(); jhit++) {
1600  PndTrkHit *clushit = cluster.GetHit(jhit);
1601 
1602 
1603  if(*hit == *clushit) {
1604  continue;
1605  }
1606 
1607  Bool_t success = IsSttAssociate(hit, clushit);
1608  // cout << "success " << success << endl;
1609  if(!success) continue;
1610 
1611  cluster.AddHit(hit);
1612  break;
1613  }
1614  }
1615 
1616  if(cluster.GetNofHits() < 2) for(int ihit = 0; ihit < cluster.GetNofHits(); ihit++) cluster.DeleteAllHits();
1617  return cluster;
1618 }
void AddHit(PndTrkHit *hit)
PndTrkHit * GetHit(int index)
void SetIRegion(int iregion)
Definition: PndTrkCluster.h:46
PndTrkHit * GetHit(int index)
Int_t GetIRegion()
Definition: PndTrkHit.h:64
Bool_t IsUsed()
Definition: PndTrkHit.h:58
Int_t GetNofHits()
Definition: PndTrkHitList.h:43
PndSdsMCPoint * hit
Definition: anasim.C:70
Int_t GetNofHits()
Definition: PndTrkCluster.h:52
Bool_t IsRegion(Int_t iregion)
Definition: PndTrkHit.h:65
Bool_t IsSttAssociate(PndTrkHit *hit1, PndTrkHit *hit2)
Bool_t PndTrkLegendreSecTask2::DoesConfHitBelong ( PndTrkConformalHit hit,
double  fitm,
double  fitp 
)

Definition at line 1279 of file PndTrkLegendreSecTask2.cxx.

References fMvdPix_ConfDistLimit, fMvdPixelBranch, fMvdStr_ConfDistLimit, fMvdStripBranch, fStt_ConfDistLimit, fSttBranch, PndTrkConformalHit::GetDetectorID(), PndTrkConformalHit::GetDistanceFromTrack(), and PndTrkConformalHit::GetIsochrone().

Referenced by AddHitToClusterByDistance(), and CreateClusterByDistance().

1279  {
1280  double dist = chit->GetDistanceFromTrack(fitm, fitp);
1281  int detID = chit->GetDetectorID();
1282  if(detID == FairRootManager::Instance()->GetBranchId(fMvdPixelBranch)) {
1283  if(dist < fMvdPix_ConfDistLimit) return kTRUE;
1284  }
1285  else if(detID == FairRootManager::Instance()->GetBranchId(fMvdStripBranch)) {
1286  if(dist < fMvdStr_ConfDistLimit) return kTRUE;
1287  }
1288  else if(detID == FairRootManager::Instance()->GetBranchId(fSttBranch)) {
1289  if(chit->GetIsochrone() > 1.e-4) {
1290  if(dist < (6 * chit->GetIsochrone())) return kTRUE;
1291  }
1292  else if(dist < fStt_ConfDistLimit) return kTRUE;
1293  }
1294 
1295  return kFALSE;
1296 }
Bool_t PndTrkLegendreSecTask2::DoesRealHitBelong ( PndTrkHit hit,
double  x0,
double  y0,
double  R 
)

Definition at line 1263 of file PndTrkLegendreSecTask2.cxx.

References fMvdPix_RealDistLimit, fMvdPixelBranch, fMvdStr_RealDistLimit, fMvdStripBranch, fStt_RealDistLimit, fSttBranch, PndTrkHit::GetDetectorID(), and PndTrkHit::GetXYDistanceFromTrack().

Referenced by AddHitToClusterByDistance(), and CreateClusterByDistance().

1263  {
1264  double dist = hit->GetXYDistanceFromTrack(x0, y0, R);
1265  int detID = hit->GetDetectorID();
1266  if(detID == FairRootManager::Instance()->GetBranchId(fMvdPixelBranch)) {
1267  if(dist < fMvdPix_RealDistLimit) return kTRUE;
1268  }
1269  else if(detID == FairRootManager::Instance()->GetBranchId(fMvdStripBranch)) {
1270  if(dist < fMvdStr_RealDistLimit) return kTRUE;
1271  }
1272  else if(detID == FairRootManager::Instance()->GetBranchId(fSttBranch)) {
1273  if(dist < fStt_RealDistLimit) return kTRUE;
1274  }
1275  return kFALSE;
1276 }
Double_t x0
Definition: checkhelixhit.C:70
Int_t GetDetectorID()
Definition: PndTrkHit.h:57
Double_t y0
Definition: checkhelixhit.C:71
Double_t GetXYDistanceFromTrack(double x0, double y0, double R)
Definition: PndTrkHit.cxx:105
Double_t R
Definition: checkhelixhit.C:61
void PndTrkLegendreSecTask2::DontUseMvdPix ( )
inline

Definition at line 120 of file PndTrkLegendreSecTask2.h.

References fUseMVDPix.

120 { fUseMVDPix = kFALSE; }
void PndTrkLegendreSecTask2::DontUseMvdStr ( )
inline

Definition at line 121 of file PndTrkLegendreSecTask2.h.

References fUseMVDStr.

121 { fUseMVDStr = kFALSE; }
void PndTrkLegendreSecTask2::DontUseStt ( )
inline

Definition at line 122 of file PndTrkLegendreSecTask2.h.

References fUseSTT.

122 { fUseSTT = kFALSE; }
void PndTrkLegendreSecTask2::DrawConfHit ( double  x,
double  y,
double  r,
int  marker = 2 
)

Definition at line 1551 of file PndTrkLegendreSecTask2.cxx.

References display.

Referenced by FillLegendreHisto().

1551  {
1552  display->cd(2);
1553  if(r >= 0) {
1554  TArc *arc = new TArc(u, v, r);
1555  arc->SetFillStyle(0);
1556  arc->Draw("SAME");
1557  }
1558  else {
1559  TMarker *mrk = new TMarker(u, v, marker);
1560  mrk->Draw("SAME");
1561  }
1562  // display->Update();
1563  // display->Modified();
1564 }
double r
Definition: RiemannTest.C:14
__m128 v
Definition: P4_F32vec4.h:4
void PndTrkLegendreSecTask2::DrawGeometry ( )

Definition at line 1448 of file PndTrkLegendreSecTask2.cxx.

References display, and hxy.

Referenced by Refresh().

1448  {
1449  if(hxy == NULL) hxy = new TH2F("hxy", "xy plane", 100, -43, 43, 100, -43, 43);
1450  else hxy->Reset();
1451  display->cd(1);
1452  hxy->Draw();
1453  display->Update();
1454  display->Modified();
1455 
1456 }
void PndTrkLegendreSecTask2::DrawGeometryConf ( double  x1,
double  y1,
double  x2,
double  y2 
)

Definition at line 1506 of file PndTrkLegendreSecTask2.cxx.

References display, and huv.

Referenced by PrepareLegendre(), and RePrepareLegendre().

1506  {
1507  // CHECK
1508  char goOnChar;
1509  // cout << "DRAWING GEOMETRY CONF" << endl;
1510  // cin >> goOnChar;
1511 
1512  // CHECK previous calculations, now not used;
1513  if(huv == NULL) huv = new TH2F("huv", "uv plane", 100, x1, y1, 100, x2, y2);
1514  else {
1515  huv->Reset();
1516  huv->GetXaxis()->SetLimits(x1, y1);
1517  huv->GetYaxis()->SetLimits(x2, y2);
1518  }
1519  display->cd(2);
1520  huv->Draw();
1521  display->Update();
1522  display->Modified();
1523 
1524 }
void PndTrkLegendreSecTask2::DrawHits ( PndTrkHitList hitlist)

Definition at line 1500 of file PndTrkLegendreSecTask2.cxx.

References display, and PndTrkHitList::Draw().

Referenced by Refresh().

1500  {
1501  display->cd(1);
1502  hitlist->Draw();
1503  display->Update();
1504  display->Modified();
1505 }
void Draw(Color_t color=kBlack)
void PndTrkLegendreSecTask2::DrawLegendreHisto ( )

Definition at line 1527 of file PndTrkLegendreSecTask2.cxx.

References display, PndTrkLegendreTransform::Draw(), and legendre.

Referenced by ExtractLegendre().

1527  {
1528  display->cd(3);
1529  legendre->Draw();
1530  display->Update();
1531  display->Modified();
1532 }
PndTrkLegendreTransform * legendre
void PndTrkLegendreSecTask2::DrawZGeometry ( int  whichone = 1,
double  phimin = 0,
double  phimax = 360,
double  zmin = -43,
double  zmax = 113 
)

Definition at line 1458 of file PndTrkLegendreSecTask2.cxx.

References display, hxz, and hzphi.

Referenced by CleanUpSkewHitList(), CreateSkewHitList(), Exec(), and ZPhiFit().

1459 {
1460  if(hxz == NULL) hxz = new TH2F("hxz", "xz plane", 100, -43, 43, 100, -43, 113);
1461  else hxz->Reset();
1462  display->cd(3);
1463  hxz->Draw();
1464  if(whichone == 2) {
1465  if(hzphi == NULL) hzphi = new TH2F("hzphi", "z - phi plane", phimax - phimin, phimin, phimax, zmax - zmin, zmin, zmax);
1466  else {
1467  hzphi->Reset();
1468  hzphi->GetXaxis()->SetLimits(phimin, phimax);
1469  hzphi->GetYaxis()->SetLimits(zmin, zmax);
1470  }
1471  display->cd(4);
1472  hzphi->Draw();
1473  }
1474  display->Update();
1475  display->Modified();
1476 
1477 }
void PndTrkLegendreSecTask2::Exec ( Option_t *  opt)
virtual

Virtual method Exec

Definition at line 225 of file PndTrkLegendreSecTask2.cxx.

References PndTrkClusterList::AddCluster(), PndTrkCluster::AddHit(), AddHitToClusterByDistance(), ApplyLegendre(), Bool_t, CheckAssignability(), Cleanup(), CleanUpSkewHitList(), CleanupZPhiFit(), PndTrkTrack::ComputeCharge(), PndTrkTrack::ComputePhi(), ComputeTraAndRot(), conform, conformalhitlist, CreateSkewHitList(), display, PndTrkCluster::DoesContain(), Double_t, PndTrkTrack::Draw(), PndTrkHit::Draw(), DrawZGeometry(), PndTrkLegendreTransform::ExtractLegendreSingleLineParameters(), fabs(), fDisplayOn, fEventCounter, fFitter, FillConformalHitList(), FindReferenceHit(), fMvdPixelBranch, fMvdPixelHitArray, fMvdStripBranch, fMvdStripHitArray, fRefHit, FromConformalToRealTrack(), fSecondary, fSttHitArray, fTrackArray, fTrackCandArray, fTubeArray, fVerbose, PndTrkTrack::GetCharge(), PndTrkTrack::GetCluster(), PndTrkConformalTransform::GetConformalHit(), PndTrkConformalTransform::GetConformalSttHit(), PndTrkHit::GetDetectorID(), PndTrkCluster::GetHit(), PndTrkSttHitList::GetHitList(), PndTrkSttHitList::GetHitListFromLayer(), PndTrkSkewHit::GetIntersection1(), PndTrkSkewHit::GetIntersection2(), PndTrkConformalHit::GetIsochrone(), PndTrkCluster::GetNofHits(), PndTrkSkewHit::GetPhi1(), PndTrkSkewHit::GetPhi2(), PndTrkHit::GetPosition(), PndTrkHit::GetTubeID(), PndTrkConformalHit::GetU(), PndTrkConformalHit::GetV(), hit, hzphi, Initialize(), PndSttTube::IsNeighboring(), PndTrkHit::IsSttParallel(), PndTrkHit::IsSttSkew(), PndTrkHit::IsUsed(), legendre, PndTrkCluster::LightUp(), phi, Pi, R, Refresh(), RefreshZ(), RegisterTrack(), PndTrkCluster::Replace(), PndTrkFitter::Reset(), Reset(), PndTrkTrack::SetCenter(), PndTrkConformalTransform::SetOrigin(), PndTrkHit::SetPhi(), PndTrkFitter::SetPointToFit(), PndTrkHit::SetPosition(), PndTrkTrack::SetRadius(), PndTrkHit::SetSortVariable(), PndTrkTrack::SetTanL(), PndTrkHit::SetUsedFlag(), PndTrkTrack::SetZ0(), sigma, PndTrkCluster::Sort(), CAMath::Sqrt(), PndTrkFitter::StraightLineFit(), stthitlist, track, Z, and ZPhiFit().

225  {
226  fTrackArray->Delete();
227  fTrackCandArray->Delete();
228  if(fVerbose > 0) cout << "*********************** " << fEventCounter << " ***********************" << endl;
229 
230  fEventCounter++;
231  // CHECK THIS!
232  if(fSttHitArray->GetEntriesFast() < 3) {
233  // Reset();
234  return;
235  }
236 
237  Initialize();
238  if(fVerbose > 1) {
239  cout << "number of stt hits " << fSttHitArray->GetEntriesFast() << endl;
240  cout << "number of mvdpix hits " << fMvdPixelHitArray->GetEntriesFast() << endl;
241  cout << "number of mvdstr hits " << fMvdStripHitArray->GetEntriesFast() << endl;
242  }
243 
244 
245  // **************** CHECK **************
246  // for(int isec = 0; isec < 6; isec++) {
247  // if(stthitlist->GetNofHitsInSector(isec) == 0) continue;
248  // conformalhitlist = new PndTrkConformalHitList();
249  // if(fDisplayOn) {
250  // Refresh();
251  // char goOnChar;
252  // // cout << "Start?";
253  // // cin >> goOnChar;
254  // display->Update();
255  // display->Modified();
256  // cout << " STARTING" << endl;
257  // cin >> goOnChar;
258  // stthitlist->DrawSector(isec, kGreen);
259  // stthitlist->PrintSector(isec);
260  // display->Update();
261  // display->Modified();
262  // cout << " STARTING" << endl;
263  // cin >> goOnChar;
264  // }
265 
266 
267  // std::vector< PndTrkHit* > sttinsec = stthitlist->GetHitListFromSector(isec);
268 
269 
270  // }
271 
272  // for(int ilay = 0; ilay < 26; ilay++) {
273  // if(stthitlist->GetNofHitsInLayer(ilay) == 0) continue;
274  // conformalhitlist = new PndTrkConformalHitList();
275  // if(fDisplayOn) {
276  // Refresh();
277  // char goOnChar;
278  // // cout << "Start?";
279  // // cin >> goOnChar;
280  // display->Update();
281  // display->Modified();
282  // cout << " STARTING" << endl;
283  // cin >> goOnChar;
284  // stthitlist->DrawLayer(ilay, kGreen);
285  // stthitlist->PrintLayer(ilay);
286  // display->Update();
287  // display->Modified();
288  // cout << " STARTING" << endl;
289  // cin >> goOnChar;
290  // }
291 
292 
293  // std::vector< PndTrkHit* > sttinlay = stthitlist->GetHitListFromLayer(ilay);
294 
295 
296  // }
297 
298  // for(int isec = 0; isec < 6; isec++) {
299 
300  // for(int ilay = 0; ilay < 26; ilay++) {
301  // if(stthitlist->GetNofHitsInSectorAndLayer(isec, ilay) == 0) continue;
302  // conformalhitlist = new PndTrkConformalHitList();
303  // if(fDisplayOn) {
304  // Refresh();
305  // char goOnChar;
306  // cout << "Start?";
307  // cin >> goOnChar;
308  // display->Update();
309  // display->Modified();
310  // cout << " STARTING" << endl;
311  // cin >> goOnChar;
312  // stthitlist->DrawSectorAndLayer(isec, ilay, kGreen);
313  // stthitlist->PrintSectorAndLayer(isec, ilay);
314  // display->Update();
315  // display->Modified();
316  // cout << " STARTING" << endl;
317  // cin >> goOnChar;
318  // }
319 
320 
321  // std::vector< PndTrkHit* > sttinlay = stthitlist->GetHitListFromSectorAndLayer(isec, ilay);
322 
323 
324  // }
325  // }
326  // ********************************************
327 
328  PndTrkClusterList clusterlist;
329  PndTrkCluster *cluster = NULL;
330 
331  // for(int isec = 0; isec < 6; isec++) {
332  // cout << "@@@@@@@@@@@@@@@@@ SECTOR " << isec << endl;
333 
334  // std::vector< PndTrkHit* > sttinsec = stthitlist->GetHitListFromSector(isec);
335 
336 
337  {
338  std::vector< PndTrkHit* > sttinsec = stthitlist->GetHitList();
339 
340 
341  // int toassigncounter = sttinsec.size();
342  Bool_t stilltoassign = kTRUE;
343  // while(toassigncounter > 0) {
344  while(stilltoassign == kTRUE) {
345 
346  if(fDisplayOn) {
347  Refresh();
348  char goOnChar;
349  display->Update();
350  display->Modified();
351  cout << " STARTING" << endl;
352  cin >> goOnChar;
353  display->Update();
354  display->Modified();
355  }
356 
357 
358 
359  cluster = new PndTrkCluster();
360  PndTrkHit *tmphit = NULL;
361 
362  for(int ilay = 0; ilay < 26; ilay++) {
363 // std::vector< PndTrkHit* > sttinlay = stthitlist->GetHitListFromSectorAndLayer(isec, ilay);
364  std::vector< PndTrkHit* > sttinlay = stthitlist->GetHitListFromLayer(ilay);
365 
366  for(int ihit = 0; ihit < sttinlay.size(); ihit++) {
367  PndTrkHit *thishit = sttinlay.at(ihit);
368  if(thishit->IsUsed() == kTRUE) continue;
369  // cout << "1TMPHIT " << tmphit << endl;
370  // if(tmphit) cout << " " << tmphit->GetHitID () << endl;
371  if(tmphit == NULL) {
372  tmphit = thishit;
373  // toassigncounter--;
374  cluster->AddHit(thishit);
375  // cout << " start add " << thishit->GetHitID() << endl;
376  thishit->SetUsedFlag(kTRUE);
377  // cout << "2TMPHIT " << tmphit << endl;
378  continue;
379  }
380  // .........
381 
382  PndSttTube *tmptube = (PndSttTube*) fTubeArray->At(tmphit->GetTubeID());
383 
384  if(tmptube->IsNeighboring(thishit->GetTubeID())) {
385  cluster->AddHit(sttinlay.at(ihit));
386  tmphit = thishit;
387  thishit->SetUsedFlag(kTRUE);
388  // cout << " add " << thishit->GetHitID() << endl;
389  // toassigncounter--;
390  }
391  // else cout << "not " << thishit->GetHitID () << endl;
392  }
393  }
394 
395  tmphit = NULL;
396  if(cluster->GetNofHits() > 3) clusterlist.AddCluster(cluster);
397  else {
398  // check if there is something more to assign
399  stilltoassign = CheckAssignability(sttinsec);
400  continue;
401  }
402 
403  if(fDisplayOn) {
404  Refresh();
405  char goOnChar;
406  // cin >> goOnChar;
407  cout << "ADD CLUSTER " << cluster->GetNofHits() << endl;
408 
409  cluster->LightUp();
410  display->Update();
411  display->Modified();
412  }
413 
414 
415  // cout << "clusterlist.size " << clusterlist.GetNofClusters() << endl;
416  // if(fDisplayOn) {
417  // Refresh();
418  // char goOnChar;
419  // cout << "Start?";
420  // cin >> goOnChar;
421  // cout << "ADD CLUSTER " << cluster->GetNofHits() << endl;
422 
423  // stthitlist->DrawSector(isec, kGreen);
424  // stthitlist->PrintSector(isec);
425  // cluster->LightUp();
426  // display->Update();
427  // display->Modified();
428  // cout << " NEXT" << endl;
429  // cin >> goOnChar;
430  // }
431 
432 
433  // ================ --> TO CONFORMAL PLANE
434 
436 
437  // translation and rotation
438  Int_t nchits = 0;
439  Double_t delta = 0, trasl[2] = {0., 0.};
440  if(fSecondary) {
441  // translation and rotation - CHECK
442  // cout << " REFERENCE HIT " << cluster->GetNofHits() << endl;
443  fRefHit = FindReferenceHit(cluster);
444  if(fRefHit == NULL) {
445  // cout << "REFHIT " << fRefHit << endl;
446  Reset();
447  return;
448  }
449  ComputeTraAndRot(fRefHit, delta, trasl);
450  }
451  // cout << "DELTA " << delta << " TRASL " << trasl[0] << " " << trasl[1] << endl;
452  conform->SetOrigin(trasl[0], trasl[1], delta);
453  nchits = FillConformalHitList();
454 
455 
456  if(nchits == 0) {
457  Reset();
458  return;
459  }
460 
461 
462  // APPLY LEGENDRE TO STT ALONE
463  // -------------------------------------------------------
464  // cout << "APPLY LEGENDRE =======================" << endl;
465  double theta_max, r_max;
466  Int_t maxpeak = ApplyLegendre(cluster, theta_max, r_max);
467  if(maxpeak <= 3) {
468  // check if there is something more to assign
469  stilltoassign = CheckAssignability(sttinsec);
470 
471  continue; // break;
472  }
473 
474  // cout << "EXTRACT MAX =======================" << endl;
475 
476  double fitm, fitq;
478  if(fDisplayOn) {
479  display->cd(2);
480  TLine *line = new TLine(-10.07, fitq + fitm * (-10.07), 10.07, fitq + fitm * (10.07));
481  line->Draw("SAME");
482 
483  display->Update();
484  display->Modified();
485  }
486 
487  // center and radius
488  Double_t xc, yc, R;
489  FromConformalToRealTrack(fitm, fitq, xc, yc, R);
490  // if(fVerbose > 1) cout << "XR, YC, R: " << xc << " " << yc << " " << R << endl;
491  PndTrkTrack *track = new PndTrkTrack(cluster, xc, yc, R);
492  if(fDisplayOn) {
493  display->cd(1);
494  track->Draw(kRed);
495  display->Update();
496  display->Modified();
497  char goOnChar;
498  cout << "waiting 3 " << endl;
499  cin >> goOnChar;
500  }
501 
502 
503  // ADD HITS TO CLUSTER: PIXEL, STRIP AND STT PARALLEL
504  // -------------------------------------------------------
505  // method of hit-to-track association:
506  // 0 conformal: mvd and stt in conformal plane
507  // 1 real: mvd and stt in real plane
508  // 2 mixed: mvd in real/stt in conformal plane
509  int method = 1;
510  // PndTrkCluster thiscluster = CreateClusterByDistance(method, fitm, fitq);
511  // cluster = &thiscluster;
512  int counteradded = AddHitToClusterByDistance(cluster, method, fitm, fitq);
513 
514  // CLEANUP
515  // -------------------------------------------------------
516  PndTrkCluster thiscluster = Cleanup(*cluster);
517  cluster = &thiscluster;
518 
519  double fitm2, fitq2;
520  fFitter->Reset();
521 
522  for(int ihit = 0; ihit < cluster->GetNofHits(); ihit++)
523  {
524  PndTrkHit *hit = cluster->GetHit(ihit);
525  // if(!hit) cout << "MISSING" << endl;
526  // else cout << "IHIT " << ihit << " is here " << endl;
527  double conformal[3];
528  // cout << "hit " << hit->GetHitID() << " detid " << hit->GetDetectorID () << endl;
529  PndTrkConformalHit *chit = NULL;
530  if(hit->IsSttSkew()) continue;
531  else if(hit->IsSttParallel() == kTRUE) chit = conform->GetConformalSttHit(hit);
532  else chit = conform->GetConformalHit(hit);
533 
534  double xi1 = chit->GetU() + fitm * chit->GetIsochrone()/ TMath::Sqrt(fitm * fitm + 1);
535  double yi1 = chit->GetV() - chit->GetIsochrone() / TMath::Sqrt(fitm * fitm + 1);
536 
537  double xi2 = chit->GetU() - fitm * chit->GetIsochrone() / TMath::Sqrt(fitm * fitm + 1);
538  double yi2 = chit->GetV() + chit->GetIsochrone()/ TMath::Sqrt(fitm * fitm + 1);
539 
540  double xi = 0, yi = 0;
541 
542  fabs(yi1 - (fitm * xi1 + fitq)) < fabs(yi2 - (fitm * xi2 + fitq)) ? (yi = yi1, xi = xi1) : (yi = yi2, xi = xi2);
543 
544  double sigma = chit->GetIsochrone();
545  fFitter->SetPointToFit(xi, yi, sigma);
546 
547  if(fDisplayOn) {
548  display->cd(2);
549  TMarker *mrk = new TMarker(xi, yi, 6);
550  mrk->Draw("SAME");
551  }
552  }
553 
554  fFitter->StraightLineFit(fitm2, fitq2);
555 
556  FromConformalToRealTrack(fitm2, fitq2, xc, yc, R);
557  // if(fVerbose > 1)
558  if(fVerbose > 1) cout << "FITTER XR, YC, R: " << xc << " " << yc << " " << R << endl;
559  track->SetRadius(R);
560  track->SetCenter(xc, yc);
561 
562  if(fDisplayOn) {
563  char goOnChar;
564  display->cd(2);
565  TLine *line = new TLine(-0.07, fitq + fitm * (-0.07), 0.07, fitq + fitm * (0.07));
566  line->Draw("SAME");
567  TLine *line2 = new TLine(-0.07, fitq2 + fitm2 * (-0.07), 0.07, fitq2 + fitm2 * (0.07));
568  line2->SetLineColor(2);
569  line2->Draw("SAME");
570 
571 
572  display->cd(1);
573  track->Draw(kGreen);
574 
575  display->Update();
576  display->Modified();
577  cin >> goOnChar;
578  }
579 
580 
581  fitm = fitm2;
582  fitq = fitq2;
583 
584  // check if there is something more to assign
585  stilltoassign = CheckAssignability(sttinsec);
586 
587 
588  // cout << "still to assing " << stilltoassign << endl;
589 
590  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
591  // SKEWED ASSOCIATION ********* CHECK *********
592  // -------------------------------------------------------
593  if(fVerbose > 1) cout << "%%%%%%%%%%%%%%%%%%%% ZFINDER %%%%%%%%%%%%%%%%%%%%%%%%%%" << endl;
594 
595  if(fDisplayOn) {
596  RefreshZ();
597  DrawZGeometry(2);
598  }
599 
600 // PndTrkCluster skewhitlist;
601 // for(int ihit = 0; ihit < cluster->GetNofHits(); ihit++) {
602 // PndTrkHit *hit = (PndTrkHit*) cluster->GetHit(ihit);
603 // if(hit->IsSttSkew() == kTRUE) skewhitlist.AddHit(hit);
604 // }
605 
606  PndTrkCluster skewhitlist = CreateSkewHitList(track);
607  skewhitlist = CleanUpSkewHitList(&skewhitlist);
608 
609 
610 // for(int ihit = 0; ihit < skewhitlist.GetNofHits(); ihit++) {
611 // PndTrkSkewHit *skewhit = (PndTrkSkewHit*) skewhitlist.GetHit(ihit);
612 // cout << "SKEWED " << ihit << endl;
613 // skewhit->GetPosition().Print();
614 // }
615 
616 
617  int iz = -1, jz = -1;
618  // cout << "##################### CHOOSE Z" << endl;
619 
620  // 7. select which intersection is the most likely and add it to z fitting
621  fFitter->Reset();
622  for(int ihit = 0; ihit < skewhitlist.GetNofHits() - 1; ihit++) {
623  PndTrkSkewHit *skewhit1 = (PndTrkSkewHit*) skewhitlist.GetHit(ihit);
624  if(!skewhit1) continue;
625  TVector3 fin_intersection1[2] = {skewhit1->GetIntersection1(), skewhit1->GetIntersection2()};
626  double phi1[2] = {skewhit1->GetPhi1(), skewhit1->GetPhi2()};
627 
628  int jhit = ihit + 1;
629  PndTrkSkewHit *skewhit2 = (PndTrkSkewHit*) skewhitlist.GetHit(jhit);
630  if(!skewhit2) continue;
631  TVector3 fin_intersection2[2] = {skewhit2->GetIntersection1(), skewhit2->GetIntersection2()};
632  double phi2[2] = {skewhit2->GetPhi1(), skewhit2->GetPhi2()};
633 
634  // cout << "start from " << ihit << " " << jhit << ": " << iz << " " << jz << endl;
635  if(jz != -1) {
636  iz = jz;
637  double distance = fabs(fin_intersection1[iz].Z() - fin_intersection2[0].Z());
638  jz = 0;
639  // 11 22
640  fabs(fin_intersection1[iz].Z() - fin_intersection2[1].Z()) < distance ? (distance = fabs(fin_intersection1[iz].Z() - fin_intersection2[1].Z()), jz = 1) : distance;
641  }
642  else {
643  // 11 21
644  double distance = fabs(fin_intersection1[0].Z() - fin_intersection2[0].Z());
645  iz = 0;
646  jz = 0;
647  // 11 22
648  fabs(fin_intersection1[0].Z() - fin_intersection2[1].Z()) < distance ? (distance = fabs(fin_intersection1[0].Z() - fin_intersection2[1].Z()), iz = 0, jz = 1 ): distance;
649  // 12 21
650  fabs(fin_intersection1[1].Z() - fin_intersection2[0].Z()) < distance ? (distance = fabs(fin_intersection1[1].Z() - fin_intersection2[0].Z()), iz = 1, jz = 0) : distance;
651  // 12 22
652  fabs(fin_intersection1[1].Z() - fin_intersection2[1].Z()) < distance ? (distance = fabs(fin_intersection1[1].Z() - fin_intersection2[1].Z()), iz = 1, jz = 1): distance;
653  }
654  // cout << "end with " << ihit << " " << jhit << ": " << iz << " " << jz << endl;
655 
656  fFitter->SetPointToFit(phi1[iz], fin_intersection1[iz].Z(), 1.);// (fin_intersection1[0].Z() + fin_intersection1[1].Z())/2.); // CHECK sigma?
657 
658  // CHECK
659  // cout << "SKEWED " << ihit << endl;
660  // skewhit1->GetPosition().Print();
661 // skewhit1->GetIntersection1().Print();
662 // skewhit1->GetIntersection2().Print();
663 
664  if(iz == 0) skewhit1->SetPosition(skewhit1->GetIntersection1());
665  else skewhit1->SetPosition(skewhit1->GetIntersection2());
666 // skewhit1->GetPosition().Print();
667 
668  // CHECK last point?
669  if(ihit == skewhitlist.GetNofHits() - 2) {
670  fFitter->SetPointToFit(phi2[jz], fin_intersection2[jz].Z(), 1.);// (fin_intersection2[0].Z() + fin_intersection2[1].Z())/2.); // CHECK sigma?
671 
672  // CHECK
673  if(jz == 0) skewhit2->SetPosition(skewhit2->GetIntersection1());
674  else skewhit2->SetPosition(skewhit2->GetIntersection2());
675  }
676 
677 
678  if(fDisplayOn) {
679  char goOnChar;
680  display->cd(4);
681  TMarker *mrkfoundzphi1 = new TMarker(phi1[iz], fin_intersection1[iz].Z(), 20);
682  mrkfoundzphi1->SetMarkerColor(kYellow);
683  mrkfoundzphi1->Draw("SAME");
684 
685  TMarker *mrkfoundzphi2 = new TMarker(phi2[jz], fin_intersection2[jz].Z(), 20);
686  mrkfoundzphi2->SetMarkerColor(kYellow);
687  mrkfoundzphi2->Draw("SAME");
688 
689  display->Update();
690  display->Modified();
691  //
692  // cin >> goOnChar;
693  }
694  }
695 
696 
697  // ADD MVD POINTS ==================== RECHECK
698  PndTrkCluster *mvdcluster = track->GetCluster();
699  for(int ihit = 0; ihit < mvdcluster->GetNofHits(); ihit++) {
700  // cout << ihit << " TROVATO " << endl;
701  PndTrkHit *hit = mvdcluster->GetHit(ihit);
702  if(hit->GetDetectorID() != FairRootManager::Instance()->GetBranchId(fMvdPixelBranch) && hit->GetDetectorID() != FairRootManager::Instance()->GetBranchId(fMvdStripBranch)) continue;
703  TVector3 position = hit->GetPosition();
704  double phi = track->ComputePhi(position);
705  hit->SetPhi(phi);
706  // cout << ihit << " TROVATO " << phi << " " << position.Z() << endl;
707 
708  if(fDisplayOn) {
709  char goOnChar;
710  display->cd(4);
711  TMarker *mrkfoundzphi = new TMarker(phi, position.Z(), 21);
712  mrkfoundzphi->SetMarkerColor(kOrange);
713  mrkfoundzphi->Draw("SAME");
714  display->Update();
715  display->Modified();
716  // cin >> goOnChar;
717  }
718  fFitter->SetPointToFit(phi, position.Z(), 0.1); // CHECK ERROR
719  }
720  // ===================================
721 
722 
723  Double_t ml, pl;
724  Bool_t straightlinefit = fFitter->StraightLineFit(ml, pl);
725 
726 
727  // CHECK the following fit: if it fails, put the hits into play again?
728  if(straightlinefit = kTRUE) {
729 
730  if(fDisplayOn) {
731  char goOnChar;
732  display->cd(4);
733  TLine *l222 = new TLine(-1000, -1000 * ml + pl, 1000, 1000 * ml + pl);
734  l222->Draw("SAME");
735  display->cd(3);
736  l222->Draw("SAME");
737  display->Update();
738  display->Modified();
739  //
740  // cin >> goOnChar;
741  }
742 
743  PndTrkCluster *trkcluster = track->GetCluster();
744  for(int ihit = 0; ihit < trkcluster->GetNofHits(); ihit++) {
745  PndTrkHit *hit = trkcluster->GetHit(ihit);
746  // cout << "cluster ihit " << ihit << " " << hit->GetDetectorID() << " " << hit->GetHitID() << endl;
747  }
748 
749  // 8. last association z --> HIT: fill position and add to cluster ???? CHECK
750  for(int ihit = 0; ihit < skewhitlist.GetNofHits(); ihit++) {
751  PndTrkSkewHit *skewhit = (PndTrkSkewHit*) skewhitlist.GetHit(ihit);
752 
753  // cout << "ihit " << ihit << " " << skewhit->GetHitID() << " is already there? " << trkcluster->DoesContain(skewhit) << endl;
754  if(trkcluster->DoesContain(skewhit) == kTRUE) {
755  trkcluster->Replace(skewhit);
756  }
757  else trkcluster->AddHit(skewhit);
758  TVector3 intersection1 = skewhit->GetIntersection1();
759  double phi1 = track->ComputePhi(intersection1);
760  double calcz1 = ml * phi1 + pl;
761  TVector3 intersection2 = skewhit->GetIntersection2();
762  double phi2 = track->ComputePhi(intersection2);
763  double calcz2 = ml * phi2 + pl;
764 
765  fabs(intersection1.Z() - calcz1) < fabs(intersection2.Z() - calcz2) ? skewhit->SetPosition(intersection1) : skewhit->SetPosition(intersection2);
766  }
767 
768 
769  // 9. add skewedhitlist to cluster of the track
770  // fill the last two (missing) parameters
771 
772  for(int ihit = 0; ihit < trkcluster->GetNofHits(); ihit++) {
773  PndTrkHit *hit = trkcluster->GetHit(ihit);
774  double phi = track->ComputePhi(hit->GetPosition()); // CHECK is it neede to recalculate it?
775  // cout << "hit get pos " << endl;
776  //
777  // if(hit->IsSttSkew()) cout << "getp pos " << ihit << " " << hit->GetDetectorID() << " " << hit->GetHitID() << " " << hit->GetPosition().X() << " " << hit->GetPosition().Y() << " " << hit->GetPosition().Z() << endl;
778 
779  hit->SetSortVariable(phi);
780  hit->SetPhi(phi);
781 
782  }
783  trkcluster->Sort();
784  track->ComputeCharge();
785 
786  // 10. z-phi refit
787  Bool_t zfit = ZPhiFit(0, trkcluster, ml, pl);
788  // cout << "zfit1 on " << trkcluster->GetNofHits() << " hits/ " << zfit << " " << ml << " " << pl << " tanl " << - track->GetCharge() * ml * (180./TMath::Pi())/R << endl;
789 
790  PndTrkCluster *tmpcluster = CleanupZPhiFit(trkcluster, ml, pl);
791  trkcluster = tmpcluster;
792 
793  if(fDisplayOn) {
794  char goOnChar;
795  display->cd(4);
796  DrawZGeometry();
797  hzphi->SetXTitle("#phi");
798  hzphi->SetYTitle("#z");
799  hzphi->Draw();
800  display->Update();
801  display->Modified();
802  }
803 
804  zfit = ZPhiFit(1, trkcluster, ml, pl);
805 
806  // 11. fill the last two (missing) parameters
807 
808  // tanl = -q ml (180/pi) /R: See PndTrkTrack.h for an explanation
809 
810  if(zfit) {
811  track->SetTanL(- track->GetCharge() * ml * (180./TMath::Pi())/R);
812  track->SetZ0(pl);
813  }
814  else { // CHECK put these in default
815  track->SetTanL(-999);
816  track->SetZ0(-999);
817  }
818  // cout << "GET TANL " << ml << " " << R << " " << track->GetTanL() << endl;
819 
820  // test -------------------------------------------------------
821  PndTrkCluster *trkcluster2 = track->GetCluster();
822  // trkcluster2->Print();
823 
824  if(fDisplayOn) {
825  char goOnChar;
826  display->cd(1);
827  Refresh();
828  for(int ihit = 0; ihit < trkcluster2->GetNofHits(); ihit++) {
829  PndTrkHit *hit = trkcluster2->GetHit(ihit);
830  hit->Draw(kMagenta);
831 
832  display->Update();
833  display->Modified();
834  // cin >> goOnChar;
835  }
836  }
837  }
838  else { // CHECK put these in default
839  track->SetTanL(-999);
840  track->SetZ0(-999);
841  }
842  // ------------------------------------------------------- end test
843 
844  // TRANSFORM TO PNDTRACK AND PNDTRACKCAND
845  // -------------------------------------------------------
846  RegisterTrack(track);
847  }
848 
849  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
850 
851  }
852 
853 
854  cluster = NULL;
855  delete cluster;
856 
857  if(fDisplayOn) {
858  char goOnChar;
859  display->Update();
860  display->Modified();
861  cout << "Finish? ";
862  cin >> goOnChar;
863  cout << "FINISH" << endl;
864  }
865  // if(fDisplayOn) {
866 
867  // for(int iclus = 0; iclus < clusterlist.GetNofClusters(); iclus++) {
868 
869  // cluster = clusterlist.GetCluster(iclus);
870  // Refresh();
871  // char goOnChar;
872  // cout << "...Start?";
873  // cin >> goOnChar;
874  // cout << "ADD CLUSTER " << cluster->GetNofHits() << endl;
875 
876  // cluster->LightUp();
877  // display->Update();
878  // display->Modified();
879  // cout << " NEXT" << endl;
880  // cin >> goOnChar;
881  // }
882  // }
883  Reset();
884 }
PndTrkCluster CreateSkewHitList(PndTrkTrack *track)
Int_t ApplyLegendre(double &theta_max, double &r_max)
int fVerbose
Definition: poormantracks.C:24
void Replace(PndTrkHit *hit)
void RegisterTrack(PndTrkTrack *track)
Double_t GetPhi1()
Definition: PndTrkSkewHit.h:37
PndTrkConformalTransform * conform
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
std::vector< PndTrkHit * > GetHitList()
PndTrkCluster GetCluster()
Definition: PndTrkTrack.h:48
void SetTanL(double tanl)
Definition: PndTrkTrack.h:39
Double_t sigma[nsteps]
Definition: dedx_bands.C:65
void SetPhi(Double_t phi)
Definition: PndTrkHit.h:48
void SetSortVariable(Double_t sortvar)
Definition: PndTrkHit.h:44
void AddHit(PndTrkHit *hit)
std::vector< PndTrkHit * > GetHitListFromLayer(int ilay)
TVector3 GetIntersection2()
Definition: PndTrkSkewHit.h:35
PndTrkHit * GetHit(int index)
void AddCluster(PndTrkCluster *cluster)
Double_t ComputePhi(TVector3 hit)
Bool_t IsSttParallel()
Definition: PndTrkHit.h:70
void ComputeCharge()
Int_t GetCharge()
Definition: PndTrkTrack.h:57
void SetCenter(double x, double y)
Definition: PndTrkTrack.h:37
Bool_t CheckAssignability(std::vector< PndTrkHit * > hitlist)
Bool_t IsNeighboring(int tubeID)
Definition: PndSttTube.cxx:145
Int_t GetDetectorID()
Definition: PndTrkHit.h:57
Double_t GetPhi2()
Definition: PndTrkSkewHit.h:38
void SetUsedFlag(Bool_t used)
Definition: PndTrkHit.h:50
Double_t
void SetRadius(double radius)
Definition: PndTrkTrack.h:36
PndTrkConformalHit GetConformalHit(PndTrkHit *hit)
Int_t FillConformalHitList(int isec=-1)
PndTrkCluster CleanUpSkewHitList(PndTrkCluster *skewhitlist)
TVector3 GetPosition()
Definition: PndTrkHit.h:62
PndMCTrack * track
Definition: anaLmdCluster.C:89
void SetPosition(TVector3 pos)
Definition: PndTrkHit.h:47
void SetOrigin(double x, double y, double delta)
void Draw(Color_t color=kBlack)
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
void ExtractLegendreSingleLineParameters(double &slope, double &intercept)
Bool_t IsUsed()
Definition: PndTrkHit.h:58
PndTrkCluster * CleanupZPhiFit(PndTrkCluster *cluster, double fitm, double fitp)
PndTrkCluster Cleanup(PndTrkCluster cluster)
PndTrkLegendreTransform * legendre
void Draw(Color_t color)
Definition: PndTrkHit.cxx:109
Bool_t DoesContain(PndTrkHit *hit)
TVector3 GetIntersection1()
Definition: PndTrkSkewHit.h:34
Bool_t StraightLineFit(Double_t &fitm, Double_t &fitp)
void SetZ0(double z0)
Definition: PndTrkTrack.h:40
PndTrkConformalHit GetConformalSttHit(PndTrkHit *hit)
double Z
Definition: anaLmdDigi.C:68
void ComputeTraAndRot(PndTrkHit *hit, Double_t &delta, Double_t trasl[2])
PndTrkConformalHitList * conformalhitlist
Bool_t ZPhiFit(int iter, PndTrkCluster *cluster, double &fitm, double &fitp)
void FromConformalToRealTrack(double fitm, double fitp, double &x0, double &y0, double &R)
PndSdsMCPoint * hit
Definition: anasim.C:70
Int_t GetNofHits()
Definition: PndTrkCluster.h:52
Double_t Pi
Int_t GetTubeID()
Definition: PndTrkHit.h:61
Double_t R
Definition: checkhelixhit.C:61
Int_t AddHitToClusterByDistance(PndTrkCluster *cluster, Int_t mode, double fitm, double fitp)
void DrawZGeometry(int whichone=1, double phimin=0, double phimax=360, double zmin=-43, double zmax=113)
Bool_t IsSttSkew()
Definition: PndTrkHit.h:71
void SetPointToFit(double x, double y, double sigma)
Int_t PndTrkLegendreSecTask2::ExtractLegendre ( Int_t  mode,
double &  theta_max,
double &  r_max 
)

Definition at line 2236 of file PndTrkLegendreSecTask2.cxx.

References conformalhitlist, PndTrkLegendreTransform::DeleteZoneAroundXYLegendre(), PndTrkLegendreTransform::DeleteZoneAroundXYZoom(), display, DrawLegendreHisto(), PndTrkLegendreTransform::DrawZoom(), PndTrkLegendreTransform::ExtractLegendreMaximum(), PndTrkLegendreTransform::ExtractZoomMaximum(), fDisplayOn, fFoundPeaks, PndTrkLegendreTransform::FillZoomHisto(), fVerbose, PndTrkConformalHitList::GetHit(), PndTrkConformalHit::GetIsochrone(), PndTrkConformalHitList::GetNofHits(), PndTrkConformalHit::GetU(), PndTrkConformalHit::GetV(), legendre, PndTrkLegendreTransform::SetUpZoomHisto(), and tr.

Referenced by ApplyLegendre().

2236  {
2237  if(fDisplayOn) {
2238  char goOnChar;
2239  // cin >> goOnChar;
2241  // cout << "LEGENDRE (nof conf hits = " << conformalhitlist->GetNofHits() << ")" << endl;
2242  display->cd();
2243  // cin >> goOnChar;
2244  display->Update();
2245  display->Modified();
2246  }
2247 
2248  // FIND MAXIMUM IN LEGENDRE HISTO
2249 
2250  // legendre->ApplyThresholdLegendreHisto(0.3);
2251  int maxpeak = legendre->ExtractLegendreMaximum(theta_max, r_max);
2252 
2253  bool alreadythere = false;
2254  // if(mode == 0)
2255  {
2256 
2257  if(maxpeak <= 3) {
2258  // if(fVerbose > 1)
2259  cout << "MAXPEAK " << maxpeak << ", BREAK NOW! " << endl;
2260  return maxpeak;
2261  }
2262 
2263  for(int ialready = 0; ialready < fFoundPeaks.size(); ialready++) {
2264  std::pair<double, double> foundthetar = fFoundPeaks.at(ialready);
2265  double foundtheta = foundthetar.first;
2266  double foundr = foundthetar.second;
2267  // IF THIS PEAK WAS ALREADY FOUND, DELETE THE PEAK AND GO ON (TO AVOID INFINITE LOOPS)
2268  if(theta_max == foundtheta && r_max == foundr) {
2269  legendre->DeleteZoneAroundXYLegendre(theta_max, r_max);
2270  maxpeak = legendre->ExtractLegendreMaximum(theta_max, r_max);
2271  alreadythere = true;
2272  if(fVerbose > 0) cout << "OH NO! THIS PEAK IS ALREADY THERE" << endl;
2273  return -1;
2274  }
2275  }
2276 
2277  if(alreadythere == false) {
2278  std::pair<double, double> tr(theta_max, r_max);
2279  fFoundPeaks.push_back(tr);
2280  }
2281  }
2282  // ZOOM LEGENDRE HISTO
2283  legendre->SetUpZoomHisto(theta_max, r_max, 3, 0.005);
2284  // cout << "THETA/R " << theta_max << " " << r_max << " maxpeak " << maxpeak << endl;
2285 
2286  for(int ihit = 0; ihit < conformalhitlist->GetNofHits(); ihit++) {
2288  legendre->FillZoomHisto(chit->GetU(), chit->GetV(), chit->GetIsochrone());
2289  }
2290 
2291  if(mode == 0 && alreadythere == true) {
2292  cout << "THIS PEAK IS ALREADY THERE" << endl;
2293  legendre->DeleteZoneAroundXYZoom(theta_max, r_max);
2294  }
2295 
2296  int maxpeakzoom = legendre->ExtractZoomMaximum(theta_max, r_max);
2297  // cout << "THETA/R ZOOM " << theta_max << " " << r_max << " maxpeakzoom " << maxpeakzoom << endl;
2298 
2299  if(fDisplayOn) {
2300  char goOnChar;
2301  display->cd(3);
2302  TMarker *mrk = new TMarker(theta_max, r_max, 29);
2303  mrk->Draw("SAME");
2304  display->cd(4);
2305  legendre->DrawZoom();
2306  mrk->Draw("SAME");
2307  display->Update();
2308  display->Modified();
2309  // cin >> goOnChar;
2310  }
2311 
2312  return maxpeak;
2313 }
int fVerbose
Definition: poormantracks.C:24
void SetUpZoomHisto(double theta, double r, double deltatheta, double deltar)
void DeleteZoneAroundXYLegendre(double x, double y)
int ExtractLegendreMaximum(double &theta_max, double &r_max)
Int_t mode
Definition: autocutx.C:47
std::vector< std::pair< double, double > > fFoundPeaks
PndTrkConformalHit * GetHit(int index)
int ExtractZoomMaximum(double &theta_max, double &r_max)
void FillZoomHisto(double x, double y, double radius)
void DeleteZoneAroundXYZoom(double x, double y)
PndTrkLegendreTransform * legendre
PndTrkConformalHitList * conformalhitlist
Int_t PndTrkLegendreSecTask2::FillConformalHitList ( int  isec = -1)

Definition at line 923 of file PndTrkLegendreSecTask2.cxx.

References PndTrkConformalHitList::AddHit(), conform, conformalhitlist, fRefHit, PndTrkConformalTransform::GetConformalHit(), PndTrkConformalTransform::GetConformalSttHit(), PndTrkHitList::GetHit(), PndTrkSttHitList::GetHitFromSector(), PndTrkHitList::GetNofHits(), PndTrkConformalHitList::GetNofHits(), PndTrkSttHitList::GetNofHitsInSector(), hit, PndTrkHit::IsSttSkew(), mvdpixhitlist, mvdstrhitlist, PndTrkConformalHitList::SetConformalTransform(), and stthitlist.

Referenced by Exec().

923  {
924 
926 
927  // FILL ONCE FOR ALL THE CONFORMAL HIT LIST
928  for(int jhit = 0; jhit < mvdpixhitlist->GetNofHits(); jhit++) {
929  PndTrkHit *hit = mvdpixhitlist->GetHit(jhit);
930  if(hit == fRefHit) continue;
932  conformalhitlist->AddHit(chit);
933  }
934  for(int jhit = 0; jhit < mvdstrhitlist->GetNofHits(); jhit++) {
935  PndTrkHit *hit = mvdstrhitlist->GetHit(jhit);
936  if(hit == fRefHit) continue;
938  conformalhitlist->AddHit(chit);
939  }
940 
941  if(isec == -1) {
942  for(int jhit = 0; jhit < stthitlist->GetNofHits(); jhit++) {
943  PndTrkHit *hit = stthitlist->GetHit(jhit);
944  if(hit == fRefHit) continue;
945 
946  if(hit->IsSttSkew()) {
947  // continue;
949  conformalhitlist->AddHit(chit);
950  }
951  else {
953  conformalhitlist->AddHit(chit);
954  }
955  // PndTrkConformalHit * chit = conform->GetConformalSttHit(hit);
956  // conformalhitlist->AddHit(chit);
957  }
958  }
959  else {
960  for(int jhit = 0; jhit < stthitlist->GetNofHitsInSector(isec); jhit++) {
961  PndTrkHit *hit = stthitlist->GetHitFromSector(jhit, isec);
962  // cout << "fil conformal " << hit->GetHitID() << " " << hit->GetDetectorID() << endl;
963  if(hit->IsSttSkew()) {
964  // continue;
966  conformalhitlist->AddHit(chit);
967  }
968  else {
970  conformalhitlist->AddHit(chit);
971  }
972  // PndTrkConformalHit * chit = conform->GetConformalSttHit(hit);
973  // conformalhitlist->AddHit(chit);
974  }
975  }
976 
977 
978  return conformalhitlist->GetNofHits();
979 }
PndTrkSdsHitList * mvdpixhitlist
PndTrkConformalTransform * conform
int GetNofHitsInSector(int isec)
PndTrkHit * GetHitFromSector(int ihit, int isec)
PndTrkHit * GetHit(int index)
int isec
Definition: f_Init.h:19
void AddHit(PndTrkConformalHit *chit)
PndTrkConformalHit GetConformalHit(PndTrkHit *hit)
Int_t GetNofHits()
Definition: PndTrkHitList.h:43
PndTrkConformalHit GetConformalSttHit(PndTrkHit *hit)
PndTrkConformalHitList * conformalhitlist
void SetConformalTransform(PndTrkConformalTransform *conformal)
PndSdsMCPoint * hit
Definition: anasim.C:70
Bool_t IsSttSkew()
Definition: PndTrkHit.h:71
PndTrkSdsHitList * mvdstrhitlist
Int_t PndTrkLegendreSecTask2::FillConformalHitList ( PndTrkCluster cluster)

Definition at line 982 of file PndTrkLegendreSecTask2.cxx.

References PndTrkConformalHitList::AddHit(), conform, conformalhitlist, fRefHit, PndTrkConformalTransform::GetConformalHit(), PndTrkConformalTransform::GetConformalSttHit(), PndTrkCluster::GetHit(), PndTrkHit::GetHitID(), PndTrkConformalHit::GetIsochrone(), PndTrkConformalHitList::GetNofHits(), PndTrkCluster::GetNofHits(), PndTrkConformalHit::GetU(), PndTrkConformalHit::GetV(), hit, PndTrkHit::IsSttParallel(), PndTrkHit::IsSttSkew(), and PndTrkConformalHitList::SetConformalTransform().

982  {
983 
985 
986  for(int jhit = 0; jhit < cluster->GetNofHits(); jhit++) {
987  PndTrkHit *hit = cluster->GetHit(jhit);
988  if(hit == fRefHit) continue;
989  PndTrkConformalHit * chit = NULL;
990  cout << "HIT " << hit->GetHitID() << " " << hit->IsSttParallel() << " " << hit->IsSttSkew() << endl;
991  if(hit->IsSttParallel() == kTRUE) chit = conform->GetConformalSttHit(hit);
992  else chit = conform->GetConformalHit(hit);
993  conformalhitlist->AddHit(chit);
994  cout << "CONFORMAL " << chit->GetU() << " " << chit->GetV() << " " << chit->GetIsochrone() << endl;
995 
996  }
997  return conformalhitlist->GetNofHits();
998 }
PndTrkConformalTransform * conform
PndTrkHit * GetHit(int index)
Int_t GetHitID()
Definition: PndTrkHit.h:56
Bool_t IsSttParallel()
Definition: PndTrkHit.h:70
void AddHit(PndTrkConformalHit *chit)
PndTrkConformalHit GetConformalHit(PndTrkHit *hit)
PndTrkConformalHit GetConformalSttHit(PndTrkHit *hit)
PndTrkConformalHitList * conformalhitlist
void SetConformalTransform(PndTrkConformalTransform *conformal)
PndSdsMCPoint * hit
Definition: anasim.C:70
Int_t GetNofHits()
Definition: PndTrkCluster.h:52
Bool_t IsSttSkew()
Definition: PndTrkHit.h:71
void PndTrkLegendreSecTask2::FillLegendreHisto ( Int_t  mode)

Definition at line 1000 of file PndTrkLegendreSecTask2.cxx.

References conformalhitlist, display, DrawConfHit(), fDisplayOn, PndTrkLegendreTransform::FillLegendreHisto(), PndTrkConformalHit::GetHit(), PndTrkConformalHitList::GetHit(), PndTrkConformalHit::GetIsochrone(), PndTrkConformalHitList::GetNofHits(), PndTrkConformalHit::GetU(), PndTrkConformalHit::GetV(), hit, and legendre.

Referenced by PrepareLegendre(), and RePrepareLegendre().

1001 {
1002  // mode 0 STT alone
1003  // 1 STT + MVD
1004  for(int ihit = 0; ihit < conformalhitlist->GetNofHits(); ihit++) {
1006  // if(mode == 0 && chit->GetDetectorID() != FairRootManager::Instance()->GetBranchId(fSttBranch)) continue;
1007  PndTrkHit *hit = chit->GetHit();
1008  // if(hit->IsUsed()) continue;
1009  legendre->FillLegendreHisto(chit->GetU(), chit->GetV(), chit->GetIsochrone());
1010  if(fDisplayOn) {
1011  display->cd(2);
1012  // cout << "conformal hit " << chit->GetU() << " " << chit->GetV() << endl;
1013  DrawConfHit(chit->GetU(), chit->GetV(), chit->GetIsochrone());
1014  }
1015  }
1016 }
void FillLegendreHisto(double x, double y, double radius)
PndTrkConformalHit * GetHit(int index)
void DrawConfHit(double x, double y, double r, int marker=2)
PndTrkLegendreTransform * legendre
PndTrkConformalHitList * conformalhitlist
PndSdsMCPoint * hit
Definition: anasim.C:70
void PndTrkLegendreSecTask2::FillLegendreHisto ( PndTrkCluster cluster)

Definition at line 1018 of file PndTrkLegendreSecTask2.cxx.

References conformalhitlist, PndTrkCluster::DoesContain(), DrawConfHit(), fDisplayOn, PndTrkLegendreTransform::FillLegendreHisto(), PndTrkConformalHit::GetHit(), PndTrkConformalHitList::GetHit(), PndTrkConformalHit::GetIsochrone(), PndTrkConformalHitList::GetNofHits(), PndTrkConformalHit::GetU(), PndTrkConformalHit::GetV(), hit, and legendre.

1019 {
1020  // ---------------------------------------------------------------
1021  // cout << "FILL LEGENDRE HISTO " << cluster->GetNofHits() << endl;
1022 
1023  for(int ihit = 0; ihit < conformalhitlist->GetNofHits(); ihit++) {
1025  PndTrkHit *hit = chit->GetHit();
1026  if(cluster->DoesContain(hit) == kFALSE) continue;
1027  legendre->FillLegendreHisto(chit->GetU(), chit->GetV(), chit->GetIsochrone());
1028  if(fDisplayOn) {
1029  DrawConfHit(chit->GetU(), chit->GetV(), chit->GetIsochrone());
1030  // cout << "conformal2: " << chit->GetU() << " " << chit->GetV() << " " << chit->GetIsochrone() << endl;
1031  }
1032  }
1033 }
void FillLegendreHisto(double x, double y, double radius)
PndTrkConformalHit * GetHit(int index)
void DrawConfHit(double x, double y, double r, int marker=2)
PndTrkLegendreTransform * legendre
Bool_t DoesContain(PndTrkHit *hit)
PndTrkConformalHitList * conformalhitlist
PndSdsMCPoint * hit
Definition: anasim.C:70
PndTrkHit * PndTrkLegendreSecTask2::FindMvdPixelReferenceHit ( )

Definition at line 2080 of file PndTrkLegendreSecTask2.cxx.

References fVerbose, PndTrkHitList::GetHit(), PndTrkHit::GetHitID(), PndTrkHitList::GetNofHits(), hit, PndTrkHit::IsUsed(), and mvdpixhitlist.

Referenced by FindMvdReferenceHit().

2081  {
2082  if(mvdpixhitlist->GetNofHits() == 0) return NULL;
2083  // loop on mvd pix hits
2084  int tmphitid = -1;
2085  PndTrkHit *refhit = NULL;
2086  for(int jhit = 0; jhit < mvdpixhitlist->GetNofHits(); jhit++) {
2087  PndTrkHit *hit = mvdpixhitlist->GetHit(jhit);
2088  if(hit->IsUsed()) {
2089  if(fVerbose > 1) cout << "already used V" << endl;
2090  continue;
2091  }
2092  tmphitid = jhit;
2093  break;
2094  }
2095  if(tmphitid == -1) return NULL;
2096  refhit = mvdpixhitlist->GetHit(tmphitid);
2097  if(fVerbose > 1) cout << "MVD PIXEL REFERENCE HIT " << refhit->GetHitID() << endl;
2098  return refhit;
2099 }
int fVerbose
Definition: poormantracks.C:24
PndTrkSdsHitList * mvdpixhitlist
PndTrkHit * GetHit(int index)
Int_t GetHitID()
Definition: PndTrkHit.h:56
Bool_t IsUsed()
Definition: PndTrkHit.h:58
Int_t GetNofHits()
Definition: PndTrkHitList.h:43
PndSdsMCPoint * hit
Definition: anasim.C:70
PndTrkHit * PndTrkLegendreSecTask2::FindMvdReferenceHit ( )

Definition at line 2122 of file PndTrkLegendreSecTask2.cxx.

References FindMvdPixelReferenceHit(), and FindMvdStripReferenceHit().

Referenced by FindReferenceHit().

2123 {
2124  PndTrkHit *refhit = NULL;
2125  refhit = FindMvdStripReferenceHit();
2126  // refhit = FindMvdPixelReferenceHit();
2127  if(refhit != NULL) return refhit;
2128  // refhit = FindMvdStripReferenceHit();
2130  return refhit;
2131 }
PndTrkHit * PndTrkLegendreSecTask2::FindMvdStripReferenceHit ( )

Definition at line 2101 of file PndTrkLegendreSecTask2.cxx.

References fVerbose, PndTrkHitList::GetHit(), PndTrkHit::GetHitID(), PndTrkHitList::GetNofHits(), hit, PndTrkHit::IsUsed(), and mvdstrhitlist.

Referenced by FindMvdReferenceHit().

2102 {
2103  if(mvdstrhitlist->GetNofHits() == 0) return NULL;
2104  // loop on mvd str hits
2105  int tmphitid = -1;
2106  PndTrkHit *refhit = NULL;
2107  for(int jhit = 0; jhit < mvdstrhitlist->GetNofHits(); jhit++) {
2108  PndTrkHit *hit = mvdstrhitlist->GetHit(jhit);
2109  if(hit->IsUsed()) {
2110  if(fVerbose > 1) cout << "already used V" << endl;
2111  continue;
2112  }
2113  tmphitid = jhit;
2114  break;
2115  }
2116  if(tmphitid == -1) return NULL;
2117  refhit = mvdstrhitlist->GetHit(tmphitid);
2118  if(fVerbose > 1) cout << "MVD STRIP REFERENCE HIT " << refhit->GetHitID() << endl;
2119  return refhit;
2120 }
int fVerbose
Definition: poormantracks.C:24
PndTrkHit * GetHit(int index)
Int_t GetHitID()
Definition: PndTrkHit.h:56
Bool_t IsUsed()
Definition: PndTrkHit.h:58
Int_t GetNofHits()
Definition: PndTrkHitList.h:43
PndSdsMCPoint * hit
Definition: anasim.C:70
PndTrkSdsHitList * mvdstrhitlist
PndTrkHit * PndTrkLegendreSecTask2::FindReferenceHit ( )

Definition at line 2133 of file PndTrkLegendreSecTask2.cxx.

References FindMvdReferenceHit(), and FindSttReferenceHit().

Referenced by Exec().

2134 {
2135  PndTrkHit *refhit = NULL;
2136  // refhit = FindMvdReferenceHit();
2137  refhit = FindSttReferenceHit();
2138  if(refhit != NULL) return refhit;
2139  // refhit = FindSttReferenceHit();
2141 
2142  return refhit;
2143 }
PndTrkHit * FindSttReferenceHit(int isec=-1)
PndTrkHit * PndTrkLegendreSecTask2::FindReferenceHit ( PndTrkCluster cluster)

Definition at line 2145 of file PndTrkLegendreSecTask2.cxx.

References Double_t, fVerbose, PndTrkHit::GetDetectorID(), PndTrkCluster::GetHit(), PndTrkHit::GetHitID(), PndTrkHit::GetIsochrone(), PndTrkCluster::GetNofHits(), hit, PndTrkHit::IsStt(), and PndTrkHit::IsSttParallel().

2145  {
2146  int ntot = cluster->GetNofHits();
2147  // cout << "FIND REFERENCE HIT " << ntot << endl;
2148 
2149  if(ntot == 0) return NULL;
2150 
2151 
2152  int tmphitid = -1;
2153  Double_t tmpiso = 1.;
2154  PndTrkHit *refhit = NULL;
2155  for(int jhit = 0; jhit < ntot; jhit++) {
2156  PndTrkHit *hit = cluster->GetHit(jhit);
2157 
2158  // if(hit->IsUsed()) {
2159  // if(fVerbose > 1) cout << "STT hit " << jhit << "already used " << endl;
2160  // continue; }
2161 
2162  if(hit->IsStt()) {
2163  if(hit->IsSttParallel()) {
2164  if(hit->GetIsochrone() < tmpiso) {
2165  tmphitid = jhit;
2166  tmpiso = hit->GetIsochrone();
2167  refhit = hit;
2168  }
2169  }
2170  }
2171  else {
2172  tmphitid = jhit;
2173  break;
2174  }
2175  }
2176 
2177  if(tmphitid == -1) return NULL;
2178  refhit = cluster->GetHit(tmphitid);
2179  if(fVerbose > 1) cout << "REFERENCE HIT " << refhit->GetHitID() << " " << refhit->GetDetectorID() << endl;
2180  return refhit;
2181 
2182 
2183 }
int fVerbose
Definition: poormantracks.C:24
PndTrkHit * GetHit(int index)
Int_t GetHitID()
Definition: PndTrkHit.h:56
Bool_t IsSttParallel()
Definition: PndTrkHit.h:70
Int_t GetDetectorID()
Definition: PndTrkHit.h:57
Double_t
Bool_t IsStt()
Definition: PndTrkHit.h:72
PndSdsMCPoint * hit
Definition: anasim.C:70
Double_t GetIsochrone()
Definition: PndTrkHit.h:63
Int_t GetNofHits()
Definition: PndTrkCluster.h:52
PndTrkHit * PndTrkLegendreSecTask2::FindSttReferenceHit ( int  isec = -1)

Definition at line 2046 of file PndTrkLegendreSecTask2.cxx.

References Double_t, fVerbose, PndTrkHitList::GetHit(), PndTrkSttHitList::GetHitFromSector(), PndTrkHit::GetIsochrone(), PndTrkHitList::GetNofHits(), PndTrkSttHitList::GetNofHitsInSector(), hit, PndTrkHit::IsSttSkew(), PndTrkHit::IsUsed(), and stthitlist.

Referenced by FindReferenceHit().

2046  {
2047  int ntot = 0;
2048  if(isec == -1) ntot = stthitlist->GetNofHits();
2049  else ntot = stthitlist->GetNofHitsInSector(isec);
2050 
2051  if(ntot == 0) return NULL;
2052 
2053 
2054  int tmphitid = -1;
2055  Double_t tmpiso = 1.;
2056  PndTrkHit *refhit = NULL;
2057  for(int jhit = 0; jhit < ntot; jhit++) {
2058  PndTrkHit *hit = NULL;
2059  if(isec == -1) hit = stthitlist->GetHit(jhit);
2060  else hit = stthitlist->GetHitFromSector(jhit, isec);
2061 
2062  if(hit->IsUsed()) {
2063  if(fVerbose > 1) cout << "STT hit " << jhit << "already used " << endl;
2064  continue; }
2065  if(hit->IsSttSkew()) continue;
2066  if(hit->GetIsochrone() < tmpiso) {
2067  tmphitid = jhit;
2068  tmpiso = hit->GetIsochrone();
2069  refhit = hit;
2070  }
2071  }
2072  if(tmphitid == -1) return NULL;
2073 
2074  // PndTrkHit *refhit = &thishitlist[tmphitid];
2075  if(fVerbose > 1) cout << "STT REFERENCE HIT " << tmphitid << " " << refhit->GetIsochrone() << endl;
2076  return refhit;
2077 
2078 }
int fVerbose
Definition: poormantracks.C:24
int GetNofHitsInSector(int isec)
PndTrkHit * GetHitFromSector(int ihit, int isec)
PndTrkHit * GetHit(int index)
int isec
Definition: f_Init.h:19
Double_t
Bool_t IsUsed()
Definition: PndTrkHit.h:58
Int_t GetNofHits()
Definition: PndTrkHitList.h:43
PndSdsMCPoint * hit
Definition: anasim.C:70
Double_t GetIsochrone()
Definition: PndTrkHit.h:63
Bool_t IsSttSkew()
Definition: PndTrkHit.h:71
void PndTrkLegendreSecTask2::FromConformalToRealTrack ( double  fitm,
double  fitp,
double &  x0,
double &  y0,
double &  R 
)

Definition at line 1432 of file PndTrkLegendreSecTask2.cxx.

References conformalhitlist, CAMath::Cos(), Double_t, PndTrkConformalHitList::GetConformalTransform(), PndTrkConformalTransform::GetRotation(), PndTrkConformalTransform::GetTranslation(), CAMath::Sin(), and sqrt().

Referenced by AddHitToClusterByDistance(), CreateClusterByDistance(), CreateClusterByMixedDistance(), and Exec().

1432  {
1433  // CHECK if this needs to be kept --> change xc0 to xc etc
1434  // center and radius
1435  Double_t xcrot0, ycrot0;
1436  ycrot0 = 1 / (2 * fitp);
1437  xcrot0 = - fitm * ycrot0;
1438  R = sqrt(xcrot0 * xcrot0 + ycrot0 * ycrot0);
1439  // re-rotation and re-traslation of xc and yc
1440  // rotation
1443  // traslation
1446 }
Double_t x0
Definition: checkhelixhit.C:70
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
static T Sin(const T &x)
Definition: PndCAMath.h:42
static T Cos(const T &x)
Definition: PndCAMath.h:43
Double_t
Double_t y0
Definition: checkhelixhit.C:71
PndTrkConformalTransform * GetConformalTransform()
PndTrkConformalHitList * conformalhitlist
Double_t R
Definition: checkhelixhit.C:61
InitStatus PndTrkLegendreSecTask2::Init ( )
virtual

Virtual method Init

Definition at line 79 of file PndTrkLegendreSecTask2.cxx.

References conform, display, fDisplayOn, fEventCounter, fFitter, PndSttMapCreator::FillTubeArray(), fMapper, fMvdPix_ConfDistLimit, fMvdPix_RealDistLimit, fMvdPixelBranch, fMvdPixelHitArray, fMvdStr_ConfDistLimit, fMvdStr_RealDistLimit, fMvdStripBranch, fMvdStripHitArray, fPersistence, fSecondary, fStt_ConfDistLimit, fStt_RealDistLimit, fSttBranch, fSttHitArray, fSttParameters, fTrackArray, fTrackCandArray, fTubeArray, fVerbose, legendre, PndTrkLegendreTransform::SetUpLegendreHisto(), PndTrkLegendreTransform::SetUpZoomHisto(), and tools.

79  {
80 
81  fEventCounter = 0;
82 
83  fMvdPix_RealDistLimit = 0.5; // CHECK limits
84  fMvdStr_RealDistLimit = 0.5; // CHECK limits
85  fStt_RealDistLimit = 1.5 * 0.5; // CHECK limits
86  fMvdPix_ConfDistLimit = 0.003; // CHECK limits
87  fMvdStr_ConfDistLimit = 0.003; // CHECK limits
88  fStt_ConfDistLimit = 0.001; // CHECK limits
89  if(fSecondary) {
90  fMvdPix_RealDistLimit = 1.; // CHECK limits
91  fMvdStr_RealDistLimit = 1.; // CHECK limits
92  fMvdPix_ConfDistLimit = 0.007; // CHECK limits
93  fMvdStr_ConfDistLimit = 0.007; // CHECK limits
94  }
95 
96 
97  // Get RootManager
98  FairRootManager* ioman = FairRootManager::Instance();
99  if ( ! ioman ) {
100  cout << "-E- PndTrkLegendreSecTask2::Init: "
101  << "RootManager not instantiated, return!" << endl;
102  return kFATAL;
103  }
104 
105  // -- HITS -------------------------------------------------
106  //
107  // STT
108  fSttHitArray = (TClonesArray*) ioman->GetObject(fSttBranch);
109  if ( ! fSttHitArray ) {
110  cout << "-W- PndTrkLegendreSecTask2::Init: "
111  << "No STTHit array, return!" << endl;
112  return kERROR;
113  }
114  //
115  // MVD PIXEL
116  fMvdPixelHitArray = (TClonesArray*) ioman->GetObject(fMvdPixelBranch);
117  if ( !fMvdPixelHitArray){
118  std::cout << "-W- PndTrkLegendreSecTask2::Init: " << "No MVD Pixel hitArray, return!" << std::endl;
119  return kERROR;
120  }
121  //
122  // MVD STRIP
123  fMvdStripHitArray = (TClonesArray*) ioman->GetObject(fMvdStripBranch);
124  if ( !fMvdStripHitArray){
125  std::cout << "-W- PndTrkLegendreSecTask2::Init: " << "No MVD Strip hitArray, return!" << std::endl;
126  return kERROR;
127  }
128 
129  fTrackArray = new TClonesArray("PndTrack");
130  fTrackCandArray = new TClonesArray("PndTrackCand");
131  ioman->Register("Track", "pr", fTrackArray, fPersistence); // CHECK
132  ioman->Register("TrackCand", "pr", fTrackCandArray, fPersistence); // CHECK
133 
134 
135  // ---------------------------------------- maps of STT tubes
138  // ---------------------------------------------------- end map
139 
140  if(fDisplayOn) {
141  display = new TCanvas("display", "display", 0, 0, 800, 800); // CHECK
142  display->Divide(2, 2);
143  }
144 
146  if(fSecondary) legendre->SetUpLegendreHisto(90, 0, 180, 1000, -1.5, 1.5); // CHECK
149 
151 
152  tools = new PndTrkTools();
154 
155  return kSUCCESS;
156 
157 }
int fVerbose
Definition: poormantracks.C:24
void SetUpZoomHisto(double theta, double r, double deltatheta, double deltar)
PndTrkConformalTransform * conform
TClonesArray * FillTubeArray()
PndTrkLegendreTransform * legendre
void PndTrkLegendreSecTask2::Initialize ( )

Definition at line 169 of file PndTrkLegendreSecTask2.cxx.

References PndTrkHitList::AddTCA(), fFoundPeaks, fInitDone, fMvdPixelBranch, fMvdPixelHitArray, fMvdStripBranch, fMvdStripHitArray, fSttBranch, fSttHitArray, fTubeArray, fUseMVDPix, fUseMVDStr, fUseSTT, PndTrkSttHitList::Instanciate(), PndTrkSdsHitList::InstanciatePixel(), PndTrkSdsHitList::InstanciateStrip(), MVDPIXEL, mvdpixhitlist, mvdstrhitlist, MVDSTRIP, and stthitlist.

Referenced by Exec().

169  {
170 
174 
175  if(fUseSTT) {
176  stthitlist->AddTCA(FairRootManager::Instance()->GetBranchId(fSttBranch), fSttHitArray);
178  }
179 
180  if(fUseMVDPix) {
181  mvdpixhitlist->AddTCA(FairRootManager::Instance()->GetBranchId(fMvdPixelBranch), fMvdPixelHitArray);
183  }
184 
185  if(fUseMVDStr) {
186  mvdstrhitlist->AddTCA(FairRootManager::Instance()->GetBranchId(fMvdStripBranch), fMvdStripHitArray);
188  }
189 
190  // conformalhitlist = new PndTrkConformalHitList();
191  fFoundPeaks.clear();
192 
193  fInitDone = kTRUE;
194  // stthitlist->PrintSectors();
195 }
PndTrkSdsHitList * mvdpixhitlist
void AddTCA(Int_t detID, TClonesArray *array)
PndTrkSttHitList * Instanciate()
std::vector< std::pair< double, double > > fFoundPeaks
#define MVDSTRIP
PndTrkSdsHitList * InstanciateStrip()
#define MVDPIXEL
PndTrkSdsHitList * mvdstrhitlist
PndTrkSdsHitList * InstanciatePixel()
Bool_t PndTrkLegendreSecTask2::IsSttAssociate ( PndTrkHit hit1,
PndTrkHit hit2 
)

Definition at line 1620 of file PndTrkLegendreSecTask2.cxx.

References PndTrkHit::GetXYDistance(), and STTPARALDISTANCE.

Referenced by CreateSttCluster().

1620  {
1621 
1622  double distance = hit1->GetXYDistance(hit2); // ComputeDistance(hit1, hit2);
1623 
1624  if(distance < STTPARALDISTANCE) {
1625  // cout << "distance " << distance << endl;
1626  return kTRUE;
1627  }
1628  return kFALSE;
1629 
1630 }
#define STTPARALDISTANCE
Double_t GetXYDistance(PndTrkHit *fromhit)
Definition: PndTrkHit.cxx:94
void PndTrkLegendreSecTask2::LightCluster ( PndTrkCluster cluster)

Definition at line 1632 of file PndTrkLegendreSecTask2.cxx.

References display, PndTrkCluster::LightUp(), and Refresh().

1632  {
1633 
1634  // cout << "LIGHT UP" << endl;
1635  Refresh();
1636  cluster->LightUp();
1637  display->Update();
1638  display->Modified();
1639 }
void PndTrkLegendreSecTask2::PrepareLegendre ( )

Definition at line 2210 of file PndTrkLegendreSecTask2.cxx.

References DrawGeometryConf(), fDisplayOn, FillLegendreHisto(), fSecondary, fVerbose, legendre, RefreshConf(), and PndTrkLegendreTransform::ResetLegendreHisto().

Referenced by ApplyLegendre().

2210  {
2211 
2212  // cout << "RESETTING LEGENDRE HISTO" << endl;
2214 
2215  if(fDisplayOn) {
2216  RefreshConf();
2217  if(fSecondary) DrawGeometryConf(-1., 1., -1., 1.);
2218  else DrawGeometryConf(-0.07, 0.07, -0.07, 0.07);
2219  }
2220  if(fVerbose > 1) cout << "%%%%%%%%%%%%%%%%%%%% XY FINDER %%%%%%%%%%%%%%%%%%%%%%%%%%" << endl;
2221  FillLegendreHisto(0);
2222 }
int fVerbose
Definition: poormantracks.C:24
void DrawGeometryConf(double x1, double y1, double x2, double y2)
PndTrkLegendreTransform * legendre
void PndTrkLegendreSecTask2::Refresh ( )

Definition at line 1483 of file PndTrkLegendreSecTask2.cxx.

References DrawGeometry(), DrawHits(), fVerbose, mvdpixhitlist, mvdstrhitlist, and stthitlist.

Referenced by Exec(), LightCluster(), and RegisterTrack().

1483  {
1484  // CHECK
1485  char goOnChar;
1486  // cout << "Refresh?" << endl;
1487  // cin >> goOnChar;
1488  // cout << "REFRESHING" << endl;
1489  DrawGeometry();
1490  if(fVerbose) cout << "Refresh stt" << endl;
1492  if(fVerbose) cout << "Refresh pixel" << endl;
1494  if(fVerbose) cout << "Refresh strip" << endl;
1496  if(fVerbose) cout << "Refresh stop" << endl;
1497 
1498 }
int fVerbose
Definition: poormantracks.C:24
PndTrkSdsHitList * mvdpixhitlist
void DrawHits(PndTrkHitList *hitlist)
PndTrkSdsHitList * mvdstrhitlist
void PndTrkLegendreSecTask2::RefreshConf ( )

Definition at line 1534 of file PndTrkLegendreSecTask2.cxx.

Referenced by PrepareLegendre(), and RePrepareLegendre().

1534  { // CHECK delete
1535  // CHECK
1536  char goOnChar;
1537  // cout << "RefreshConf?" << endl;
1538  // cin >> goOnChar;
1539  // cout << "REFRESHING CONF" << endl;
1540 }
void PndTrkLegendreSecTask2::RefreshZ ( )

Definition at line 1542 of file PndTrkLegendreSecTask2.cxx.

Referenced by CreateSkewHitList(), and Exec().

1542  { // CHECK delete
1543  // CHECK
1544  char goOnChar;
1545  // cout << "RefreshZ?" << endl;
1546  // cin >> goOnChar;
1547  // cout << "REFRESHING Z" << endl;
1548 }
void PndTrkLegendreSecTask2::RegisterTrack ( PndTrkTrack track)

Definition at line 2012 of file PndTrkLegendreSecTask2.cxx.

References PndTrkTrack::ConvertToPndTrack(), display, PndTrkTrack::Draw(), fDisplayOn, fTrackArray, fTrackCandArray, fVerbose, PndTrkTrack::GetCenter(), PndTrkTrack::GetCharge(), PndTrack::GetParamFirst(), PndTrack::GetParamLast(), PndTrkTrack::GetRadius(), PndTrkTrack::GetTanL(), PndTrack::GetTrackCand(), PndTrkTrack::GetZ0(), and Refresh().

Referenced by Exec().

2012  {
2013  PndTrack *finaltrack = track->ConvertToPndTrack();
2014 
2015  TClonesArray& clref1 = *fTrackArray;
2016  Int_t size = clref1.GetEntriesFast();
2017  PndTrack *outputtrack = new(clref1[size]) PndTrack(finaltrack->GetParamFirst(), finaltrack->GetParamLast(), finaltrack->GetTrackCand());
2018 
2019  TClonesArray& clref2 = *fTrackCandArray;
2020  size = clref2.GetEntriesFast();
2021  PndTrackCand *outputtrackcand = new(clref2[size]) PndTrackCand(finaltrack->GetTrackCand());
2022 
2023  if(fVerbose > 1) {
2024  cout << "MOM FIRST: TOT, PT, PL " << outputtrack->GetParamFirst().GetMomentum().Mag() << " " << outputtrack->GetParamFirst().GetMomentum().Perp() << " " << outputtrack->GetParamFirst().GetMomentum().Z() << endl;
2025  cout << "MOM LAST: TOT, PT, PL " << outputtrack->GetParamLast().GetMomentum().Mag() << " " << outputtrack->GetParamLast().GetMomentum().Perp() << " " << outputtrack->GetParamLast().GetMomentum().Z() << endl;
2026  }
2027  if(fDisplayOn) {
2028  char goOnChar;
2029  display->cd(1);
2030  Refresh();
2031 
2032  track->Draw(kRed);
2033  display->Update();
2034  display->Modified();
2035 
2036  cout << "X, Y, R " << track->GetCenter().X() << " " << track->GetCenter().Y() << " " << track->GetRadius() << endl;
2037  cout << "Z0, TANL " << track->GetZ0() << " " << track->GetTanL() << endl;
2038  cout << "CHARGE " << track->GetCharge() << endl;
2039  // cin >> goOnChar;
2040  }
2041 
2042 }
int fVerbose
Definition: poormantracks.C:24
Double_t GetRadius()
Definition: PndTrkTrack.h:43
PndTrack ConvertToPndTrack()
Double_t GetZ0()
Definition: PndTrkTrack.h:46
TVector2 GetCenter()
Definition: PndTrkTrack.h:44
Int_t GetCharge()
Definition: PndTrkTrack.h:57
PndTrackCand GetTrackCand()
Definition: PndTrack.h:47
FairTrackParP GetParamLast()
Definition: PndTrack.h:50
void Draw(Color_t color=kBlack)
Double_t GetTanL()
Definition: PndTrkTrack.h:45
FairTrackParP GetParamFirst()
Definition: PndTrack.h:49
void PndTrkLegendreSecTask2::RePrepareLegendre ( PndTrkCluster cluster)

Definition at line 2196 of file PndTrkLegendreSecTask2.cxx.

References DrawGeometryConf(), fDisplayOn, FillLegendreHisto(), fSecondary, legendre, RefreshConf(), and PndTrkLegendreTransform::ResetLegendreHisto().

Referenced by ApplyLegendre().

2196  {
2197 
2198  // cout << "RESETTING LEGENDRE HISTO" << endl;
2200 
2201  if(fDisplayOn) {
2202  RefreshConf();
2203  if(fSecondary) DrawGeometryConf(-1., 1., -1., 1.);
2204  else DrawGeometryConf(-0.07, 0.07, -0.07, 0.07);
2205  }
2206  // cout << "%%%%%%%%%%%%%%%%%%%% XY FINDE %%%%%%%%%%%%%%%%%%%%%%%%%%" << endl;
2207  FillLegendreHisto(cluster);
2208 }
void DrawGeometryConf(double x1, double y1, double x2, double y2)
PndTrkLegendreTransform * legendre
void PndTrkLegendreSecTask2::Reset ( )

Definition at line 895 of file PndTrkLegendreSecTask2.cxx.

References display, fDisplayOn, fEventCounter, fInitDone, fTime, fTimer, fVerbose, mvdpixhitlist, mvdstrhitlist, and stthitlist.

Referenced by Exec().

896 {
897 
898  if(fDisplayOn) {
899  char goOnChar;
900  display->Update();
901  display->Modified();
902  cout << "Finish? ";
903  cin >> goOnChar;
904  cout << "FINISH" << endl;
905  }
906 
907  if(fInitDone) {
908  if(stthitlist) delete stthitlist;
909  if(mvdpixhitlist) delete mvdpixhitlist;
910  if(mvdstrhitlist) delete mvdstrhitlist;
911  if(fTimer) {
912  fTimer->Stop();
913  fTime += fTimer->RealTime();
914 
915  if(fVerbose > 0) cerr << fEventCounter << " Real time " << fTime << " s" << endl;
916  }
917  }
918 
919  fInitDone = kFALSE;
920 }
int fVerbose
Definition: poormantracks.C:24
PndTrkSdsHitList * mvdpixhitlist
PndTrkSdsHitList * mvdstrhitlist
void PndTrkLegendreSecTask2::SearchSecondaryTracks ( )
inline

Definition at line 101 of file PndTrkLegendreSecTask2.h.

References fSecondary.

101 { fSecondary = kTRUE; }
void PndTrkLegendreSecTask2::SetParContainers ( )

Definition at line 161 of file PndTrkLegendreSecTask2.cxx.

References fSttParameters, and rtdb.

161  {
162  FairRuntimeDb* rtdb = FairRunAna::Instance()->GetRuntimeDb();
163  fSttParameters = (PndGeoSttPar*) rtdb->getContainer("PndGeoSttPar");
164 }
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
void PndTrkLegendreSecTask2::SwitchOnDisplay ( )
inline

Definition at line 106 of file PndTrkLegendreSecTask2.h.

References fDisplayOn.

106 { fDisplayOn = kTRUE; }
Bool_t PndTrkLegendreSecTask2::ZPhiFit ( int  iter,
PndTrkCluster cluster,
double &  fitm,
double &  fitp 
)

Definition at line 2569 of file PndTrkLegendreSecTask2.cxx.

References PndTrkFitter::ConstrainedStraightLineFit(), display, DrawZGeometry(), fDisplayOn, fFitter, fMvdPixelBranch, fMvdStripBranch, fSttBranch, PndTrkHit::GetDetectorID(), PndTrkCluster::GetHit(), PndTrkHit::GetIsochrone(), PndTrkCluster::GetNofHits(), PndTrkHit::GetPhi(), PndTrkHit::GetPosition(), hit, hzphi, PndTrkHit::IsSttParallel(), phi, PndTrkFitter::Reset(), PndTrkFitter::SetPointToFit(), and PndTrkFitter::StraightLineFit().

Referenced by Exec().

2570 {
2571 
2572  // cout << "ZPHIFIT " << iter << endl;
2573 
2574  if(iter != 0) {
2575  if(fDisplayOn) {
2576  char goOnChar;
2577  display->cd(3);
2578  DrawZGeometry();
2579  hzphi->SetXTitle("#phi");
2580  hzphi->SetYTitle("#z");
2581  hzphi->Draw();
2582  display->Update();
2583  display->Modified();
2584  }
2585  }
2586 
2587  fFitter->Reset();
2588  PndTrkHit *hit = NULL;
2589  PndTrkHit *refhit = NULL;
2590  double refiso = 1000;
2591  for(int ihit = 0; ihit < cluster->GetNofHits(); ihit++) {
2592  hit = cluster->GetHit(ihit);
2593  if(hit->IsSttParallel() == kTRUE) continue; // CHECK IsSttParrallel will be changed
2594 
2595 
2596  TVector3 position = hit->GetPosition();
2597  double phi = hit->GetPhi();
2598  // fFitter->SetPointToFit(phi, position.Z(), 0.1);
2599 
2600  // CHECK refhit stuff
2601  if(hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fMvdPixelBranch) || hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fMvdStripBranch)) {
2602  if(iter != 0) refhit = hit;
2603  fFitter->SetPointToFit(phi, position.Z(), 0.001);
2604  // cout << ihit << " " << hit->GetDetectorID() << " " << hit->GetHitID() << " " << hit->IsSttParallel() << " SetPointToFit " << phi << " " << position.Z() << " " << endl;
2605  }
2606  else if(hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fSttBranch)) {
2607  if(iter != 0 && refhit == NULL && hit->GetIsochrone() < refiso) refhit = hit;
2608  fFitter->SetPointToFit(phi, position.Z(), 0.1);
2609  // cout << ihit << " " << hit->GetDetectorID() << " " << hit->GetHitID() << " " << hit->IsSttParallel() << " SetPointToFit " << phi << " " << position.Z() << " " << endl;
2610  }
2611 
2612  if(fDisplayOn) {
2613  char goOnChar;
2614  if(iter == 0) display->cd(4);
2615  TMarker *mrkfoundzphi = NULL;
2616  if(hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fMvdPixelBranch) || hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fMvdStripBranch)) {
2617  mrkfoundzphi = new TMarker(phi, position.Z(), 21);
2618  if(iter == 0) mrkfoundzphi->SetMarkerColor(kOrange);
2619  else mrkfoundzphi->SetMarkerColor(4);
2620  }
2621  else if(hit->GetDetectorID() == FairRootManager::Instance()->GetBranchId(fSttBranch)) {
2622  mrkfoundzphi = new TMarker(phi, position.Z(), 20);
2623  if(iter == 0) mrkfoundzphi->SetMarkerColor(kGreen);
2624  else mrkfoundzphi->SetMarkerColor(4);
2625  }
2626  mrkfoundzphi->Draw("SAME");
2627  // display->cd(3);
2628  // mrkfoundzphi->Draw("SAME");
2629 
2630  }
2631  }
2632  // ===================================
2633  bool fit = kFALSE;
2634  if(iter == 0) fit = fFitter->StraightLineFit(fitm, fitp);
2635  else {
2636  if(refhit != NULL) fit = fFitter->ConstrainedStraightLineFit(refhit->GetPhi(), refhit->GetPosition().Z(), fitm, fitp);
2637  else fit = fFitter->StraightLineFit(fitm, fitp);
2638  }
2639 
2640  if(fit) {
2641  if(fDisplayOn) {
2642  char goOnChar;
2643  if(iter != 0) display->cd(4);
2644  TLine *l22 = new TLine(-1000, -1000 * fitm + fitp, 1000, 1000 * fitm + fitp);
2645  if(iter == 0) l22->SetLineColor(3);
2646  else if(iter == 1) l22->SetLineColor(4);
2647  l22->Draw("SAME");
2648  display->cd(3);
2649  l22->Draw("SAME");
2650  display->Update();
2651  display->Modified();
2652  cin >> goOnChar;
2653  }
2654  }
2655  // ++++++++++++++++++++++++++++++++++
2656 
2657  return fit;
2658 }
Double_t GetPhi()
Definition: PndTrkHit.h:67
PndTrkHit * GetHit(int index)
Bool_t IsSttParallel()
Definition: PndTrkHit.h:70
Int_t GetDetectorID()
Definition: PndTrkHit.h:57
TVector3 GetPosition()
Definition: PndTrkHit.h:62
Bool_t ConstrainedStraightLineFit(Double_t x0, Double_t y0, Double_t &fitm, Double_t &fitp)
Bool_t StraightLineFit(Double_t &fitm, Double_t &fitp)
PndSdsMCPoint * hit
Definition: anasim.C:70
Double_t GetIsochrone()
Definition: PndTrkHit.h:63
Int_t GetNofHits()
Definition: PndTrkCluster.h:52
void DrawZGeometry(int whichone=1, double phimin=0, double phimax=360, double zmin=-43, double zmax=113)
void SetPointToFit(double x, double y, double sigma)

Member Data Documentation

PndTrkConformalTransform* PndTrkLegendreSecTask2::conform
private

Definition at line 184 of file PndTrkLegendreSecTask2.h.

Referenced by Cleanup(), Exec(), FillConformalHitList(), and Init().

PndTrkConformalHitList* PndTrkLegendreSecTask2::conformalhitlist
private
TCanvas* PndTrkLegendreSecTask2::display
double PndTrkLegendreSecTask2::fDeltaThetaRad
private

Definition at line 177 of file PndTrkLegendreSecTask2.h.

Bool_t PndTrkLegendreSecTask2::fDisplayOn
Int_t PndTrkLegendreSecTask2::fEventCounter
private

Definition at line 168 of file PndTrkLegendreSecTask2.h.

Referenced by Exec(), Init(), and Reset().

PndTrkFitter* PndTrkLegendreSecTask2::fFitter
private

Definition at line 195 of file PndTrkLegendreSecTask2.h.

Referenced by Exec(), Init(), and ZPhiFit().

std::vector< std::pair<double, double> > PndTrkLegendreSecTask2::fFoundPeaks
private

Definition at line 192 of file PndTrkLegendreSecTask2.h.

Referenced by ExtractLegendre(), and Initialize().

Bool_t PndTrkLegendreSecTask2::fInitDone
private

Definition at line 180 of file PndTrkLegendreSecTask2.h.

Referenced by Initialize(), and Reset().

PndSttMapCreator* PndTrkLegendreSecTask2::fMapper
private

Definition at line 166 of file PndTrkLegendreSecTask2.h.

Referenced by Init().

Double_t PndTrkLegendreSecTask2::fMvdPix_ConfDistLimit
private

Definition at line 190 of file PndTrkLegendreSecTask2.h.

Referenced by DoesConfHitBelong(), and Init().

Double_t PndTrkLegendreSecTask2::fMvdPix_RealDistLimit
private

Definition at line 190 of file PndTrkLegendreSecTask2.h.

Referenced by DoesRealHitBelong(), and Init().

char PndTrkLegendreSecTask2::fMvdPixelBranch[200]
private
TClonesArray* PndTrkLegendreSecTask2::fMvdPixelHitArray
private

Input array of MvdPixelHitArray

Definition at line 152 of file PndTrkLegendreSecTask2.h.

Referenced by Exec(), Init(), and Initialize().

Double_t PndTrkLegendreSecTask2::fMvdStr_ConfDistLimit
private

Definition at line 190 of file PndTrkLegendreSecTask2.h.

Referenced by DoesConfHitBelong(), and Init().

Double_t PndTrkLegendreSecTask2::fMvdStr_RealDistLimit
private

Definition at line 190 of file PndTrkLegendreSecTask2.h.

Referenced by DoesRealHitBelong(), and Init().

char PndTrkLegendreSecTask2::fMvdStripBranch[200]
private
TClonesArray* PndTrkLegendreSecTask2::fMvdStripHitArray
private

Input array of MvdStripHitArray

Definition at line 154 of file PndTrkLegendreSecTask2.h.

Referenced by Exec(), Init(), and Initialize().

Int_t PndTrkLegendreSecTask2::fNofHits
private

Definition at line 142 of file PndTrkLegendreSecTask2.h.

Int_t PndTrkLegendreSecTask2::fNofMvdPixHits
private

Definition at line 142 of file PndTrkLegendreSecTask2.h.

Int_t PndTrkLegendreSecTask2::fNofMvdStrHits
private

Definition at line 142 of file PndTrkLegendreSecTask2.h.

Int_t PndTrkLegendreSecTask2::fNofSttHits
private

Definition at line 142 of file PndTrkLegendreSecTask2.h.

Int_t PndTrkLegendreSecTask2::fNofTriplets
private

Definition at line 142 of file PndTrkLegendreSecTask2.h.

Bool_t PndTrkLegendreSecTask2::fPersistence
private

Definition at line 180 of file PndTrkLegendreSecTask2.h.

Referenced by Init().

PndTrkHit* PndTrkLegendreSecTask2::fRefHit
private
Bool_t PndTrkLegendreSecTask2::fSecondary
private
Double_t PndTrkLegendreSecTask2::fStt_ConfDistLimit
private

Definition at line 190 of file PndTrkLegendreSecTask2.h.

Referenced by DoesConfHitBelong(), and Init().

Double_t PndTrkLegendreSecTask2::fStt_RealDistLimit
private

Definition at line 190 of file PndTrkLegendreSecTask2.h.

Referenced by DoesRealHitBelong(), and Init().

char PndTrkLegendreSecTask2::fSttBranch[200]
private
TClonesArray* PndTrkLegendreSecTask2::fSttHitArray
private

Input array of PndSttHit

Definition at line 148 of file PndTrkLegendreSecTask2.h.

Referenced by Exec(), Init(), and Initialize().

Double_t PndTrkLegendreSecTask2::fSttParalDistance
private

Definition at line 174 of file PndTrkLegendreSecTask2.h.

PndGeoSttPar* PndTrkLegendreSecTask2::fSttParameters
private

Definition at line 161 of file PndTrkLegendreSecTask2.h.

Referenced by Init(), and SetParContainers().

TClonesArray* PndTrkLegendreSecTask2::fSttPointArray
private

Input array of PndSttPoints

Definition at line 146 of file PndTrkLegendreSecTask2.h.

Double_t PndTrkLegendreSecTask2::fSttToMvdStripDistance
private

Definition at line 174 of file PndTrkLegendreSecTask2.h.

double PndTrkLegendreSecTask2::fTime
private

Definition at line 193 of file PndTrkLegendreSecTask2.h.

Referenced by Reset().

TStopwatch* PndTrkLegendreSecTask2::fTimer
private

Definition at line 194 of file PndTrkLegendreSecTask2.h.

Referenced by Reset().

TClonesArray* PndTrkLegendreSecTask2::fTrackArray
private

Definition at line 156 of file PndTrkLegendreSecTask2.h.

Referenced by Exec(), Init(), and RegisterTrack().

TClonesArray * PndTrkLegendreSecTask2::fTrackCandArray
private

Definition at line 156 of file PndTrkLegendreSecTask2.h.

Referenced by Exec(), Init(), and RegisterTrack().

TClonesArray* PndTrkLegendreSecTask2::fTubeArray
private

Definition at line 158 of file PndTrkLegendreSecTask2.h.

Referenced by Cleanup(), CorrectZ(), CreateSkewHitList(), Exec(), Init(), and Initialize().

Bool_t PndTrkLegendreSecTask2::fUseMVDPix
private

Definition at line 180 of file PndTrkLegendreSecTask2.h.

Referenced by DontUseMvdPix(), and Initialize().

Bool_t PndTrkLegendreSecTask2::fUseMVDStr
private

Definition at line 180 of file PndTrkLegendreSecTask2.h.

Referenced by DontUseMvdStr(), and Initialize().

Bool_t PndTrkLegendreSecTask2::fUseSTT
private

Definition at line 180 of file PndTrkLegendreSecTask2.h.

Referenced by DontUseStt(), and Initialize().

TH2F* PndTrkLegendreSecTask2::huv

Definition at line 111 of file PndTrkLegendreSecTask2.h.

Referenced by DrawGeometryConf().

TH2F* PndTrkLegendreSecTask2::hxy

Definition at line 104 of file PndTrkLegendreSecTask2.h.

Referenced by DrawGeometry().

TH2F * PndTrkLegendreSecTask2::hxz

Definition at line 104 of file PndTrkLegendreSecTask2.h.

Referenced by DrawZGeometry().

TH2F * PndTrkLegendreSecTask2::hzphi

Definition at line 104 of file PndTrkLegendreSecTask2.h.

Referenced by CleanUpSkewHitList(), DrawZGeometry(), Exec(), and ZPhiFit().

PndTrkLegendreTransform* PndTrkLegendreSecTask2::legendre
private
PndTrkSdsHitList* PndTrkLegendreSecTask2::mvdpixhitlist
private
PndTrkSdsHitList* PndTrkLegendreSecTask2::mvdstrhitlist
private
PndTrkSttHitList* PndTrkLegendreSecTask2::stthitlist
private
PndTrkTools* PndTrkLegendreSecTask2::tools
private

Definition at line 186 of file PndTrkLegendreSecTask2.h.

Referenced by CreateSkewHitList(), and Init().


The documentation for this class was generated from the following files: