Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Anp::Draw Namespace Reference


Typedefs

typedef std::vector< Anp::StripIterSVec
typedef SVec::iterator SIterator
typedef SVec::const_iterator SIter
typedef std::vector< Anp::StdHepIterHepVec
typedef HepVec::iterator HepIterator
typedef HepVec::const_iterator HepIter

Functions

void Config (TPad *pad, const std::string &prefix, const Registry &reg)
void Config (TH1 *h, const std::string &prefix, const Registry &reg)
TH2 * CreateTH2 (const std::string &prefix, const Registry &reg)
TGraph * CreateTGraph (const std::string &prefix, const Registry &reg)
double Read (const std::string &key, double pvalue, const Registry &reg)
int Read (const std::string &key, int pvalue, const Registry &reg)
const std::string Read (const std::string &key, const std::string &pvalue, const Registry &reg)
int Read (const Record &record, HepVec &hvec, int beg, int end)


Typedef Documentation

typedef HepVec::const_iterator Anp::Draw::HepIter
 

Definition at line 28 of file DrawUtil.h.

typedef HepVec::iterator Anp::Draw::HepIterator
 

Definition at line 27 of file DrawUtil.h.

typedef std::vector<Anp::StdHepIter> Anp::Draw::HepVec
 

Definition at line 26 of file DrawUtil.h.

typedef SVec::const_iterator Anp::Draw::SIter
 

Definition at line 24 of file DrawUtil.h.

typedef SVec::iterator Anp::Draw::SIterator
 

Definition at line 23 of file DrawUtil.h.

typedef std::vector<Anp::StripIter> Anp::Draw::SVec
 

Definition at line 22 of file DrawUtil.h.


Function Documentation

void Anp::Draw::Config TH1 *  h,
const std::string &  prefix,
const Registry reg
 

Definition at line 42 of file DrawUtil.cxx.

References Read().

Referenced by Anp::StdHepTab::Init(), Anp::SnarlTimeTab::Init(), Anp::SnarlAdcTab::Init(), Anp::EventHitTab::Init(), Anp::EventAdcTab::Init(), and Anp::SnarlTimeTab::NewSnarl().

00043 {
00044    if(!h)
00045    {
00046       return;
00047    }
00048 
00049    double YAxisTitleOffset = 0.7;
00050    double XAxisTitleOffset = 0.7;
00051 
00052    string YAxisTitle = "";
00053    string XAxisTitle = "";
00054 
00055    double YAxisTitleSize = 0.065;
00056    double XAxisTitleSize = 0.065;
00057 
00058    string ShowStats = "no";
00059 
00060    string CenterXTitle = "yes";
00061    string CenterYTitle = "yes";
00062 
00063    int LineStyle = 1;
00064    int LineColor = 1;
00065    int LineWidth = 1;
00066 
00067    int FillStyle = -1;
00068    int FillColor = 1;
00069 
00070    YAxisTitleOffset = Read(prefix + "YAxisTitleOffset", YAxisTitleOffset, reg);
00071    XAxisTitleOffset = Read(prefix + "XAxisTitleOffset", XAxisTitleOffset, reg);
00072 
00073    YAxisTitle = Read(prefix + "YAxisTitle", YAxisTitle, reg);
00074    XAxisTitle = Read(prefix + "XAxisTitle", XAxisTitle, reg); 
00075 
00076    YAxisTitleSize = Read(prefix + "YAxisTitleSize", YAxisTitleSize, reg);
00077    XAxisTitleSize = Read(prefix + "XAxisTitleSize", XAxisTitleSize, reg);
00078 
00079    ShowStats = Read(prefix + "ShowStats", ShowStats, reg);
00080 
00081    CenterXTitle = Read(prefix + "CenterXTitle", CenterXTitle, reg);
00082    CenterYTitle = Read(prefix + "CenterYTitle", CenterYTitle, reg);
00083 
00084    LineStyle = Read(prefix + "LineStyle", LineStyle, reg);
00085    LineColor = Read(prefix + "LineColor", LineColor, reg);
00086    LineWidth = Read(prefix + "LineWidth", LineWidth, reg);
00087 
00088    FillStyle = Read(prefix + "FillStyle", FillStyle, reg);
00089    FillColor = Read(prefix + "FillColor", FillColor, reg);
00090 
00091    h -> GetXaxis() -> SetTitleOffset(XAxisTitleOffset);
00092    h -> GetYaxis() -> SetTitleOffset(YAxisTitleOffset);
00093 
00094    h -> GetXaxis() -> SetTitle(XAxisTitle.c_str());
00095    h -> GetYaxis() -> SetTitle(YAxisTitle.c_str()); 
00096 
00097    h -> GetXaxis() -> SetTitleSize(XAxisTitleSize);
00098    h -> GetYaxis() -> SetTitleSize(YAxisTitleSize);
00099 
00100    if(LineStyle > 0)
00101    {
00102       h -> SetLineStyle(LineStyle);
00103       h -> SetLineColor(LineColor);
00104       h -> SetLineWidth(LineWidth);
00105    }
00106    if(FillStyle > 0)
00107    {
00108       h -> SetFillStyle(FillStyle);
00109       h -> SetFillColor(FillColor);
00110    }   
00111 
00112    if(ShowStats == "yes")
00113    {
00114       h -> SetStats(kTRUE);
00115    }
00116    else if(ShowStats == "no")
00117    {
00118       h -> SetStats(kFALSE);
00119    }
00120 
00121    if(CenterXTitle == "yes")
00122    {
00123       h -> GetXaxis() -> CenterTitle();
00124    }
00125    if(CenterYTitle == "yes")
00126    {
00127       h -> GetYaxis() -> CenterTitle();
00128    }
00129 }

void Anp::Draw::Config TPad *  pad,
const std::string &  prefix,
const Registry reg
 

Definition at line 18 of file DrawUtil.cxx.

References Read().

00019 {
00020    if(!pad)
00021    {
00022       return;
00023    }
00024 
00025    double PadRightMargin = 0.15;
00026    double PadLeftMargin = 0.12;
00027    double PadTopMargin = 0.02;
00028    double PadBottomMargin = 0.12;   
00029 
00030    PadRightMargin = Read(prefix + "PadRightMargin", PadRightMargin, reg);
00031    PadLeftMargin = Read(prefix + "PadLeftMargin", PadLeftMargin, reg);
00032    PadTopMargin = Read(prefix + "PadTopMargin", PadTopMargin, reg);
00033    PadBottomMargin = Read(prefix + "PadBottomMargin", PadBottomMargin, reg);
00034 
00035    pad -> SetRightMargin(PadRightMargin);
00036    pad -> SetLeftMargin(PadLeftMargin);
00037    pad -> SetTopMargin(PadTopMargin);
00038    pad -> SetBottomMargin(PadBottomMargin);
00039 }

TGraph * Anp::Draw::CreateTGraph const std::string &  prefix,
const Registry reg
 

Definition at line 195 of file DrawUtil.cxx.

References Read().

Referenced by Anp::EventHitTab::Init().

00196 {
00197    double MarkerSize = 1.0;
00198    int MarkerStyle = 8;
00199    int MarkerColor = 3;
00200 
00201    MarkerSize = Read(prefix + "MarkerSize", MarkerSize, reg);
00202    MarkerStyle = Read(prefix + "MarkerStyle", MarkerStyle, reg);
00203    MarkerColor = Read(prefix + "MarkerColor", MarkerColor, reg);
00204 
00205    TGraph *g = new TGraph(0);
00206    
00207    g -> SetMarkerSize(MarkerSize);
00208    g -> SetMarkerStyle(MarkerStyle);
00209    g -> SetMarkerColor(MarkerColor);
00210 
00211    return g;
00212 }

TH2 * Anp::Draw::CreateTH2 const std::string &  prefix,
const Registry reg
 

Definition at line 132 of file DrawUtil.cxx.

References Read().

Referenced by Anp::StdHepTab::Init(), Anp::SnarlAdcTab::Init(), Anp::EventHitTab::Init(), and Anp::EventAdcTab::Init().

00133 {
00134    float MinT = -4.0;
00135    float MaxT = +4.0;
00136 
00137    float MinZ = 0.0;
00138    float MaxZ = 16.0;
00139 
00140    float WidthT = 0.0410;
00141    float WidthZ = 0.0571;
00142 
00143    MinT = Read(prefix + "MinT", MinT, reg);
00144    MaxT = Read(prefix + "MaxT", MaxT, reg);
00145    
00146    MinZ = Read(prefix + "MinZ", MinZ, reg);
00147    MaxZ = Read(prefix + "MaxZ", MaxZ, reg);   
00148 
00149    WidthT = Read(prefix + "WidthT", WidthT, reg);
00150    WidthZ = Read(prefix + "WidthZ", WidthZ, reg);
00151 
00152    if(!(WidthT > 0.0)) WidthT = 0.0410;
00153    if(!(WidthZ > 0.0)) WidthZ = 0.0410;
00154 
00155    string Name = "TView";
00156    string Title = "T view";
00157    string XTitle = "Z position (m)";
00158    string YTitle = "T position (m)";
00159 
00160    TH2 *h = new TH2F(Name.c_str(), Title.c_str(), 
00161                      static_cast<int>((MaxZ-MinZ)/WidthZ), MinZ, MaxZ,
00162                      static_cast<int>((MaxT-MinT)/WidthT), MinT, MaxT);
00163 
00164    h -> SetDirectory(0);
00165 
00166    h -> GetXaxis() -> SetTitle(XTitle.c_str());
00167    h -> GetXaxis() -> CenterTitle();
00168    h -> GetYaxis() -> SetTitle(YTitle.c_str());
00169    h -> GetYaxis() -> CenterTitle();
00170 
00171    h -> SetStats(kFALSE);
00172 
00173    double XAxisTitleOffset = 0.7;
00174    double YAxisTitleOffset = 0.7;
00175 
00176    double XAxisTitleSize = 0.065;
00177    double YAxisTitleSize = 0.065;   
00178 
00179    XAxisTitleOffset = Read(prefix + "XAxisTitleOffset", XAxisTitleOffset, reg);
00180    YAxisTitleOffset = Read(prefix + "YAxisTitleOffset", YAxisTitleOffset, reg);
00181 
00182    XAxisTitleSize = Read(prefix + "XAxisTitleSize", XAxisTitleSize, reg);
00183    YAxisTitleSize = Read(prefix + "YAxisTitleSize", YAxisTitleSize, reg);
00184 
00185    h -> GetXaxis() -> SetTitleOffset(XAxisTitleOffset);
00186    h -> GetYaxis() -> SetTitleOffset(YAxisTitleOffset);
00187 
00188    h -> GetXaxis() -> SetTitleSize(XAxisTitleSize);
00189    h -> GetYaxis() -> SetTitleSize(YAxisTitleSize);
00190 
00191    return h;
00192 }

int Anp::Draw::Read const Record &  record,
HepVec hvec,
int  beg,
int  end
 

Definition at line 251 of file DrawUtil.cxx.

References count, Read(), Anp::Record::StdHepBeg(), Anp::Record::StdHepEnd(), and Anp::StdHepIter.

Referenced by Anp::SnarlAdcTab::Add(), Anp::StdHepTab::CreateArrows(), Anp::SnarlTimeTab::NewSnarl(), Anp::StdHepTab::Set(), Anp::StdHepTab::ZoomIn(), Anp::SnarlAdcTab::ZoomIn(), Anp::EventHitTab::ZoomIn(), and Anp::EventAdcTab::ZoomIn().

00252 {
00253    if(beg > end)
00254    {
00255       cerr << "Draw::ReadStdHep - invalid StdHep index range" << endl;
00256       return 0;
00257    }
00258 
00259    int count = 0;
00260 
00261    for(StdHepIter it = record.StdHepBeg(); it != record.StdHepEnd(); ++it)
00262    {
00263       if(it -> StdHepIndex() < beg || it -> StdHepIndex() > end)
00264       {
00265          continue;
00266       }
00267 
00268       ++count;
00269       
00270       hvec.push_back(it);
00271 
00272       count += Anp::Draw::Read(record, hvec, it -> ChildBeg(), it -> ChildEnd());
00273    }
00274    
00275    return count;
00276 }

const string Anp::Draw::Read const std::string &  key,
const std::string &  pvalue,
const Registry reg
 

Definition at line 239 of file DrawUtil.cxx.

References Registry::Get(), and Registry::KeyExists().

00240 {
00241    const char *value = 0;
00242    if(reg.KeyExists(key.c_str()) && reg.Get(key.c_str(), value))
00243    {
00244       return value;
00245    }
00246    
00247    return pvalue;
00248 }

int Anp::Draw::Read const std::string &  key,
int  pvalue,
const Registry reg
 

Definition at line 227 of file DrawUtil.cxx.

References Registry::Get(), and Registry::KeyExists().

00228 {
00229    int value = 0;
00230    if(reg.KeyExists(key.c_str()) && reg.Get(key.c_str(), value))
00231    {
00232       return value;
00233    }
00234    
00235    return pvalue;
00236 }

double Anp::Draw::Read const std::string &  key,
double  pvalue,
const Registry reg
 

Definition at line 215 of file DrawUtil.cxx.

References Registry::Get(), and Registry::KeyExists().

Referenced by Config(), CreateTGraph(), CreateTH2(), and Read().

00216 {
00217    double value = 0.0;
00218    if(reg.KeyExists(key.c_str()) && reg.Get(key.c_str(), value))
00219    {
00220       return value;
00221    }
00222    
00223    return pvalue;
00224 }


Generated on Fri Mar 28 16:15:55 2008 for loon by  doxygen 1.3.9.1