22 for (
size_t i = 0;
i < ch.size();
i++) {
24 Bool_t duplicated = kFALSE;
27 Int_t id2 = ch[
i]->GetTubeID();
33 if(duplicated)
continue;
34 Int_t
layer = (ch[
i]->GetLayerID() - 1) / 2;
36 ch[
i]->Position(base2);
39 dir2 = TVector3(
TMath::Sin(-5 * TMath::DegToRad()),
41 }
else if (layer % 4 == 2) {
42 dir2 = TVector3(
TMath::Sin(5 * TMath::DegToRad()),
45 dir2 = TVector3(0, 1, 0);
55 vector<PndFtsHit*>
hits;
63 vector<PndFtsHit*> hits2;
83 for(
size_t i=0;
i<hits.size();
i++){
85 sumX+=hits[
i]->GetX();
86 sumX2+=hits[
i]->GetX()*hits[
i]->GetX();
87 sumZ+=hits[
i]->GetZ();
88 sumXZ+=hits[
i]->GetX()*hits[
i]->GetZ();
91 matrix[0][0]=hits.size();
98 TVector3
p1(20,0,result.X()+20*result.Y());
99 TVector3
p2(40,0,result.X()+40*result.Y());
102 TVector3 dir =
p1-
p2;
111 for(
size_t i=0;
i<hits.size();
i++){
112 sumZ+=hits[
i]->GetZ();
113 sumZ2+=hits[
i]->GetZ()*hits[
i]->GetZ();
114 sumX+=hits[
i]->GetX();
115 sumZX+=hits[
i]->GetZ()*hits[
i]->GetX();
118 matrix[0][0]=hits.size();
125 TVector3
p1(result.X()+hits[0]->GetZ()*result.Y(),0,hits[0]->GetZ());
126 TVector3
p2(result.X()+(hits[0]->GetZ()+50)*result.Y(),0,hits[0]->GetZ()+50);
127 TVector3 dir =
p1-
p2;
136 for(
size_t i=0;
i<hits.size();
i++){
137 sumY+=hits[
i]->GetY();
138 sumY2+=hits[
i]->GetY()*hits[
i]->GetY();
139 sumZ+=hits[
i]->GetZ();
140 sumYZ+=hits[
i]->GetY()*hits[
i]->GetZ();
143 matrix[0][0]=hits.size();
150 TVector3
p1(0,-20,result.X()-20*result.Y());
151 TVector3
p2(0,20,result.X()+20*result.Y());
152 TVector3 dir =
p1-
p2;
161 for(
size_t i=0;
i<hits.size();
i++){
162 sumZ+=hits[
i]->GetZ();
163 sumZ2+=hits[
i]->GetZ()*hits[
i]->GetZ();
164 sumY+=hits[
i]->GetY();
165 sumZY+=hits[
i]->GetZ()*hits[
i]->GetY();
168 matrix[0][0]=hits.size();
175 TVector3
p1(0,result.X()+hits[0]->GetZ()*result.Y(),hits[0]->GetZ());
176 TVector3
p2(0,result.X()+(hits[0]->GetZ()+300)*result.Y(),hits[0]->GetZ()+300);
177 TVector3 dir =
p1-
p2;
183 Double_t fac = -matrix[1][0]/matrix[0][0];
184 for(
int i=0;
i<3;
i++){
185 matrix[1][
i]+= (fac*matrix[0][
i]);
188 Double_t a = (matrix[0][2] - b*matrix[0][1])/matrix[0][0];
189 return TVector2(a,b);
194 h2->SetDetectorID(h->GetDetectorID());
198 h2->SetXYZ(pos[0],pos[1],pos[2]);
199 h2->SetRefIndex(h->GetRefIndex());
200 h2->SetEntryNr(h->GetEntryNr());
207 FairTrackParP tp2(v, 0 * v, v, v, 1, v, v, v);
209 Int_t j = hitArr->GetEntries();
211 fCorrectedHits[
i]->SetEntryNr(FairLink(-1, FairRootManager::Instance()->GetEntryNr(),FairRootManager::Instance()->GetBranchId(
"CorrectedHits"), j));
TVector3 getPerpendicular(PndLine l2)
virtual ~PndLineApproximation()
PndLine linearRegression(vector< PndFtsHit * > hits)
PndLine linearRegressionZY(vector< PndFtsHit * > hits)
PndLineApproximation newApproximation(PndLineApproximation &approx2)
PndLine linearRegressionYZ(vector< PndFtsHit * > hits)
void SetChamberID(Int_t chamberid)
vector< PndFtsHit * > fCorrectedHits
void SetTubeID(Int_t tubeid)
void AddHit(UInt_t detId, UInt_t hitId, Double_t rho)
PndTrack plot(Double_t zVal1, Double_t zVal2, TClonesArray *hitArr)
PndFtsHit * copyHitWithNewPosition(PndFtsHit *h, TVector3 pos)
void correctHits3DAndAdd(vector< PndFtsHit * > correctedHits)
void SetLayerID(Int_t layerid)
PndLine linearRegressionXZ(vector< PndFtsHit * > hits)
PndLine linearRegressionZX(vector< PndFtsHit * > hits)
FairTrackParP plot(Double_t zVal1, Double_t zVal2)
Int_t GetChamberID() const