Changeset 288 in Idarraga


Ignore:
Timestamp:
Apr 27, 2012, 12:01:34 AM (12 years ago)
Author:
idarraga
Message:
 
Location:
mafalda/MAFTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mafalda/MAFTools/MAFTools.cpp

    r285 r288  
    2424#include <TGraph.h>
    2525#include <TMath.h>
     26#include <TGraph2D.h>
    2627
    2728using namespace std;
     
    139140        return CalcDistance(px, py, interx, intery);
    140141}
     142
    141143
    142144void DrawLine(MediPixAlgo * algo, Float_t x1, Float_t y1, Float_t x2, Float_t y2, Int_t wd = 2, Int_t st = 2, EColor color = kBlack) {
     
    633635        double par[] = { m_a[index], m_b[index], m_c[index], m_t[index] };
    634636
    635 /*
     637        /*
    636638        if(pix.first == 111 && pix.second == 70) {
    637639                std::cout << "a = " << par[0] << std::endl;
     
    697699}
    698700
     701TGraph2D * ConvertClusterToGraph2D(blob b, int div, int id){
     702
     703        TString funcname = "TGraph2D_";
     704        funcname += id;
     705        return ConvertClusterToGraph2D(b, div, funcname);
     706}
     707
     708TGraph2D * ConvertClusterToGraph2D(blob b, int div, TString gname){
     709
     710        vector<double> x;
     711        vector<double> y;
     712        vector<double> z;
     713        list< pair < pair<int, int>, int > >::iterator i;
     714        list< pair < pair<int, int>, int > > cld = b.GetClusterDescription();
     715
     716        if(div == 1 || div == 0) {
     717                for ( i = cld.begin() ; i != cld.end() ; i++ ) {
     718                        x.push_back((*i).first.first);
     719                        y.push_back((*i).first.second);
     720                        z.push_back((*i).second); // TOT
     721                }
     722        }
     723        /*
     724        else {
     725        }
     726        */
     727        TGraph2D * g2 = new TGraph2D((int)x.size(), &x[0], &y[0], &z[0]);
     728        g2->SetName(gname);
     729
     730        return g2;
     731}
     732
    699733}
    700734#endif
  • mafalda/MAFTools/MAFTools.h

    r285 r288  
    1818class MediPixAlgo;
    1919class Highlighter;
     20class TGraph2D;
    2021//class AllBlobsContainer;
    2122//typedef struct steerSpiral;
     
    4445Double_t CalcPerpDistanceToLine(Float_t, Float_t, pair<Int_t, Int_t>);
    4546Double_t CalcPerpDistanceToLine(Float_t, Float_t, Int_t, Int_t);
    46 
    4747
    4848/* Drawing */
     
    7878void ClearOneBlobData(blob *);
    7979
    80 /* Dump contents of a blob */
     80// Dump contents of a blob
    8181void DumpBlobContents(blob);
    8282
    8383int FindDiscontinuity(blob);
    8484
     85// More functions on Clustesr
     86TGraph2D * ConvertClusterToGraph2D(blob, int, TString); // an identifier, can be string or int
     87TGraph2D * ConvertClusterToGraph2D(blob, int, int);
    8588
    8689///////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.