1 #include "ERmuSiTrackFinder.h" 10 #include "FairRootManager.h" 11 #include "FairRunAna.h" 12 #include "FairRuntimeDb.h" 15 #include "ERDetectorList.h" 16 #include "ERmuSiTrack.h" 17 #include "ERmuSiPoint.h" 21 : FairTask(
"ER muSi track finding scheme")
28 : FairTask(
"ER muSi track finding scheme ", verbose)
40 void ERmuSiTrackFinder::SetParContainers()
43 FairRunAna* run = FairRunAna::Instance();
44 if ( ! run ) Fatal(
"SetParContainers",
"No analysis run");
46 FairRuntimeDb* rtdb = run->GetRuntimeDb();
47 if ( ! rtdb ) Fatal(
"SetParContainers",
"No runtime database");
55 FairRootManager* ioman = FairRootManager::Instance();
56 if ( ! ioman ) Fatal(
"Init",
"No FairRootManager");
58 fmuSiHits = (TClonesArray*) ioman->GetObject(
"muSiHit");
62 fmuSiTracks =
new TClonesArray(
"ERmuSiTrack",1000);
64 ioman->Register(
"muSiTrack",
"muSi tracks", fmuSiTracks, kTRUE);
74 std::cout << std::endl;
75 std::cout <<
"ERmuSiTrackFinder:" << std::endl;
78 std::vector<ERmuSiHit*> HitsByStation[3];
80 for (Int_t iHit = 0; iHit <
fmuSiHits->GetEntriesFast(); iHit++){
83 HitsByStation[hit->Station()].push_back(hit);
86 for (std::vector<ERmuSiHit*>::iterator it0 = HitsByStation[0].begin(); it0 != HitsByStation[0].end(); ++it0 ){
87 for(std::vector<ERmuSiHit*>::iterator it1 = HitsByStation[1].begin(); it1 != HitsByStation[1].end(); ++it1){
89 TVector3 singlet1((*it1)->GetX()-(*it0)->GetX(),(*it1)->GetY()-(*it0)->GetY(),(*it1)->GetZ()-(*it0)->GetZ());
91 for(std::vector<ERmuSiHit*>::iterator it2 = HitsByStation[2].begin(); it2 != HitsByStation[2].end(); ++it2){
93 TVector3 singlet2((*it2)->GetX()-(*it1)->GetX(),(*it2)->GetY()-(*it1)->GetY(),(*it2)->GetZ()-(*it1)->GetZ());
95 Double_t angle = singlet2.Angle(singlet1);
96 if (angle < fAngleCut){
98 track->AddHit(0,*(*it0));
99 track->AddHit(1,*(*it1));
100 track->AddHit(2,*(*it2));
105 std::cout <<
"Tracks count:" << fmuSiTracks->GetEntriesFast() << std::endl;
113 fmuSiTracks->Delete();
virtual InitStatus Init()
virtual void Exec(Option_t *opt)