GammaCombo  Rev:Unversioneddirectory
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Contour Class Reference

#include <Contour.h>

Collaboration diagram for Contour:
Collaboration graph
[legend]

Public Member Functions

 Contour (OptParser *arg, TList *listOfGraphs)
 Constructor. More...
 
void Draw ()
 Draw the contours into the currently active Canvas. More...
 
void DrawFilled ()
 Draw filled contours into the currently active Canvas. More...
 
void DrawLine ()
 Draw line contours into the currently active Canvas. More...
 
int getSigma ()
 
void magneticBoundaries (const TH2F *hCL)
 
void setSigma (int s)
 
void setStyle (int linecolor, int linestyle, int linewidth, int fillcolor, int fillstyle)
 Set the contour style. More...
 
void setTransparency (float percent)
 Set transparency. More...
 
 ~Contour ()
 

Private Member Functions

TGraph * changePointOrder (TGraph *g, int pointId)
 Helper function for joinIfInside(). More...
 
void findClosestPoints (TGraph *g1, TGraph *g2, int &i1, int &i2)
 Helper function for makeHoles(). More...
 
TGraph * joinIfInside (TGraph *g1, TGraph *g2)
 Helper function for makeHoles(). More...
 
void magneticBoundaries (vector< TGraph *> &contours, const TH2F *hCL)
 Magnetic boundaries. More...
 
vector< TGraph * > makeHoles (vector< TGraph *> &contours)
 Make contours that have holes cut away. More...
 

Private Attributes

float m_alpha
 
OptParserm_arg
 command line arguments More...
 
vector< TGraph * > m_contours
 container for the several disjoint subcontours. Used by DrawLine(). More...
 
vector< TGraph * > m_contoursHoles
 container for contours with holes. Filled by makeHoles(). Used by DrawFilled(). More...
 
int m_fillcolor
 
int m_fillstyle
 
int m_linecolor
 style for the contour More...
 
int m_linestyle
 
int m_linewidth
 
int m_sigma
 sigma level of the contour More...
 

Detailed Description

Definition at line 19 of file Contour.h.

Constructor & Destructor Documentation

§ Contour()

Contour::Contour ( OptParser arg,
TList *  listOfGraphs 
)

Constructor.

The class stores copies of the TGraphs provided in listOfGraphs.

Parameters
arg- command line options
listOfGraphs- list of TGraphs that make up the subcontours

Definition at line 9 of file Contour.cpp.

§ ~Contour()

Contour::~Contour ( )

Definition at line 29 of file Contour.cpp.

Member Function Documentation

§ changePointOrder()

TGraph * Contour::changePointOrder ( TGraph *  g,
int  pointId 
)
private

Helper function for joinIfInside().

Definition at line 202 of file Contour.cpp.

§ Draw()

void Contour::Draw ( )

Draw the contours into the currently active Canvas.

Definition at line 42 of file Contour.cpp.

§ DrawFilled()

void Contour::DrawFilled ( )

Draw filled contours into the currently active Canvas.

This plots the contours in m_contoursHoles.

Definition at line 53 of file Contour.cpp.

§ DrawLine()

void Contour::DrawLine ( )

Draw line contours into the currently active Canvas.

This plots the contours in m_contours.

Definition at line 74 of file Contour.cpp.

§ findClosestPoints()

void Contour::findClosestPoints ( TGraph *  g1,
TGraph *  g2,
int &  i1,
int &  i2 
)
private

Helper function for makeHoles().

Definition at line 218 of file Contour.cpp.

§ getSigma()

int Contour::getSigma ( )
inline

Definition at line 28 of file Contour.h.

§ joinIfInside()

TGraph * Contour::joinIfInside ( TGraph *  g1,
TGraph *  g2 
)
private

Helper function for makeHoles().

Definition at line 150 of file Contour.cpp.

§ magneticBoundaries() [1/2]

void Contour::magneticBoundaries ( const TH2F *  hCL)

Definition at line 283 of file Contour.cpp.

§ magneticBoundaries() [2/2]

void Contour::magneticBoundaries ( vector< TGraph *> &  contours,
const TH2F *  hCL 
)
private

Magnetic boundaries.

If a contour is closer than half a binwidth to a boundary, adjust it to be actually the boundary.

Parameters
contour- input contours
hCL- a histogram defining the boundaries

Definition at line 258 of file Contour.cpp.

§ makeHoles()

vector< TGraph * > Contour::makeHoles ( vector< TGraph *> &  contours)
private

Make contours that have holes cut away.

If a, say, 1sigma contour looks like a ring, it is initially stored as two independent circles in the TList. Here we join them, if one lies inside the other, such that when the resulting contour is plotted, the plot will actually have a hole.

Fills m_contoursHoles. The reason this is kept separate from the m_contours container, that holds the contours without holes, is the plotting: one can't plot the just-lines version from the contours with holes, else one sees where the contour is artificially closed to be able to fill the inside.

Parameters
contours- vector containing contours without holes
Returns
- vector with contours with holes

Definition at line 114 of file Contour.cpp.

§ setSigma()

void Contour::setSigma ( int  s)
inline

Definition at line 30 of file Contour.h.

§ setStyle()

void Contour::setStyle ( int  linecolor,
int  linestyle,
int  linewidth,
int  fillcolor,
int  fillstyle 
)

Set the contour style.

Definition at line 89 of file Contour.cpp.

§ setTransparency()

void Contour::setTransparency ( float  percent)

Set transparency.

Parameters
percent- 0% means intransparent

Definition at line 294 of file Contour.cpp.

Member Data Documentation

§ m_alpha

float Contour::m_alpha
private

Definition at line 51 of file Contour.h.

§ m_arg

OptParser* Contour::m_arg
private

command line arguments

Definition at line 42 of file Contour.h.

§ m_contours

vector<TGraph*> Contour::m_contours
private

container for the several disjoint subcontours. Used by DrawLine().

Definition at line 43 of file Contour.h.

§ m_contoursHoles

vector<TGraph*> Contour::m_contoursHoles
private

container for contours with holes. Filled by makeHoles(). Used by DrawFilled().

Definition at line 44 of file Contour.h.

§ m_fillcolor

int Contour::m_fillcolor
private

Definition at line 48 of file Contour.h.

§ m_fillstyle

int Contour::m_fillstyle
private

Definition at line 49 of file Contour.h.

§ m_linecolor

int Contour::m_linecolor
private

style for the contour

Definition at line 46 of file Contour.h.

§ m_linestyle

int Contour::m_linestyle
private

Definition at line 47 of file Contour.h.

§ m_linewidth

int Contour::m_linewidth
private

Definition at line 50 of file Contour.h.

§ m_sigma

int Contour::m_sigma
private

sigma level of the contour

Definition at line 45 of file Contour.h.


The documentation for this class was generated from the following files: