Commit 6caebbf0 authored by Johnston's avatar Johnston
Browse files

test on constructed line

parent d92420fb
......@@ -149,10 +149,10 @@ namespace genfind {
fPhi->Fill(phi);
}
int nfound = fSpec1->Search(fPhi,1,"col",0.2);
std::cout << "number found peaks is " << nfound << std::endl;
for(int n = 0; n < nfound; n++) {
double xphi = (fSpec1->GetPositionX())[n];
std::cout << xphi << std::endl;
std::cout << "xphi is " << xphi << std::endl;
fPhiPeaks.push_back(xphi);
}
......@@ -164,6 +164,11 @@ namespace genfind {
const std::vector<std::tuple<ROOT::Math::XYZTVector,ROOT::Math::XYZTVector,ROOT::Math::XYZTVector>>& hits,
double dphi )
{
// note, this function is NOT apparently very consistent
// even running the same input twice does not guarantee the same result.
// Peak 1 has 16hits and Peak 1 has 1hits can come from same set of points.
//
// copy the hits
auto the_hits = hits;
std::cout << " " << the_hits.size() << " hits start\n" ;
......
......@@ -41,7 +41,7 @@ void hough_transform2(
double degree = TMath::Pi()/180.0;
for(int i_track = 0; i_track < Ntracks; i_track++){
/*for(int i_track = 0; i_track < Ntracks; i_track++){ // made tracks by combining events
t->GetEntry(i_event);
i_event++;
......@@ -64,11 +64,25 @@ void hough_transform2(
hxy2->Fill(thit->position.X(), thit->position.Y());
}
}
std::cout << "Created 'event' by combining " << Ntracks << " real events from file\n";
*/
for(int i_hit = 0; i_hit < 100; i_hit++){ // make test hits in straight line
double x_incr = 1;
double y_incr = 1;
double z_incr = 1;
hits.push_back( {x_incr*i_hit , y_incr*i_hit, z_incr*i_hit , 0.0} );
std::cout << x_incr*i_hit << " , " << y_incr*i_hit << std::endl;
hxy->Fill(x_incr*i_hit, y_incr*i_hit);
hxz->Fill(x_incr*i_hit, z_incr*i_hit);
hyz->Fill(y_incr*i_hit, z_incr*i_hit);
hxy2->Fill(x_incr*i_hit, y_incr*i_hit);
}
std::vector<std::tuple<XYZTVector,XYZTVector,XYZTVector>> master_hits ;
std::vector<XYZTVector> all_chits ;
std::cout << "Created 'event' by combining " << Ntracks << " real events from file\n";
for(const auto& fhit : hits){
//auto fhit = hits.at(0);
auto chits = ht->GetConformalCoordinates(fhit, hits);
......@@ -79,13 +93,15 @@ void hough_transform2(
master_hits.push_back(make_tuple(hits[ihit], chits[ihit], fhit));
}
}
std::cout << " Master " << master_hits.size() << std::endl;
/* std::cout << " Master " << master_hits.size() << std::endl;
if(master_hits.size()>2500){
std::cout << "too many master hits " << std::endl;
return;
}
*/
//for(auto ahit : all_chits) {
//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() );
......@@ -161,10 +177,11 @@ void hough_transform2(
c->cd(2);
huv->Draw("box");
c->cd(3);
hxy2->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);
......
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