Commit 36c32766 authored by Johnston's avatar Johnston
Browse files

starting to test constructed circle segments

parent f779f2f2
......@@ -37,10 +37,12 @@ void hough_transform2(
TH1F * hphi = new TH1F("hphi", "hphi", 50, -4, 4 );
TH1F * htheta = new TH1F("htheta", "htheta", 180, 0, 180 );
std::vector<XYZTVector> hits ;
double degree = TMath::Pi()/180.0;
//make tracks from combining two simulated events
/*
for(int i_track = 0; i_track < Ntracks; i_track++){ // made tracks by combining events
t->GetEntry(i_event);
......@@ -65,8 +67,9 @@ void hough_transform2(
}
}
std::cout << "Created 'event' by combining " << Ntracks << " real events from file\n";
*/
//make track with linear points
/*for(int i_hit = 0; i_hit < 100; i_hit++){ // make test hits in straight line
double x_incr = 1;
double y_incr = 1;
......@@ -91,6 +94,27 @@ void hough_transform2(
hyz->Fill(y_extra, z_extra);
hxy2->Fill(x_extra, y_extra);*/
//make track in a circle
int numhits = 20;
double radius = 1000;
double centerx = -1000;
double centery = 0;
for(int i_hit=0; i_hit < numhits; i_hit++){
double theta = 30./numhits*degree*i_hit;
double xval = TMath::Cos(theta)*radius+centerx;
double yval = TMath::Sin(theta)*radius+centery;
hits.push_back( {xval , yval , 0 , 0} );
std::cout << " x val " << xval << " y val " << yval << std::endl;
hxy->Fill(xval,yval);
hxz->Fill(xval,0);
hyz->Fill(yval,0);
hxy2->Fill(xval,yval);
}
std::vector<std::tuple<XYZTVector,XYZTVector,XYZTVector>> master_hits ;
std::vector<XYZTVector> all_chits ;
......@@ -112,9 +136,9 @@ void hough_transform2(
}
*/
//for(auto ahit : all_chits) { // find lines in real space first, then conformal space
for(auto ahit : hits) {
//std::cout << ahit.X() << " , " << ahit.Y() << std::en1l;
for(auto ahit : all_chits) { // find lines in real space first, then conformal space
//for(auto ahit : hits) {
std::cout << ahit.X() << " , " << ahit.Y() << std::endl;
huv->Fill( ahit.X(), ahit.Y() );
hphi->Fill(TMath::ATan(ahit.Y()/ahit.X()));
for(int i_theta = 0; i_theta<180; i_theta++) {
......@@ -210,8 +234,8 @@ void hough_transform2(
//c = new TCanvas();
//ht->fIntReduced->Draw();
//c = new TCanvas();
//ht->fIntLeft->Draw();
c = new TCanvas();
huv->Draw("box");
c = new TCanvas();
c->Divide(2,2);
......@@ -226,21 +250,11 @@ void hough_transform2(
//htrack2->Draw("box,same");
//hpeaky->Draw("box,same");
c->cd(2);
//huv->Draw("box");
if(FoundTrackHists.size()>0) {FoundTrackHists[0]->Draw("box");}
c->cd(3);
if(FoundTrackHists.size()>1) {FoundTrackHists[1]->Draw("box");}
//hrphi->Draw("");
/*hxy2->Draw("box");
for(auto ahist : vertextrack){
ahist->Draw("box,same");
}*/
//hpeaky2->SetLineColor(2);
//hpeaky2->Draw("box,same");
c->cd(4);
if(FoundTrackHists.size()>2) {FoundTrackHists[2]->Draw("box");}
//hphi->Draw();
//hrphi->Draw("lego2");
/*c = new TCanvas();
c->Divide(2,2);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment