Anp::HistVtx Class Reference

#include <PlotVtx.h>

Inheritance diagram for Anp::HistVtx:
Anp::Base

List of all members.

Public Member Functions

 HistVtx ()
virtual ~HistVtx ()
bool Fill (const Vertex &vertex, double weight)
bool Fill (const Vertex &lhs, const Vertex &rhs, double weight)
bool Make (TDirectory *dir, const std::string &option)
void SetCenter (double x, double y)

Private Member Functions

TH1 * GetTH1 (const std::string &key, const std::string &name="")
TH2 * GetTH2 (const std::string &key, const std::string &name="")

Private Attributes

bool fPlot
int fNMiss
double fCenterX
double fCenterY
TDirectory * fDir
TH1 * fX
TH1 * fY
TH1 * fU
TH1 * fV
TH1 * fZ
TH1 * fR2
TH1 * fCosX
TH1 * fCosY
TH1 * fCosZ
TH2 * fYX
TH2 * fXZ
TH2 * fYZ
TH1 * fDiffX
TH1 * fDiffY
TH1 * fDiffZ
TH1 * fDiffR2d
TH1 * fDiffR3d
TH1 * fProjRad
TH1 * fProjAng
TH2 * fDiffR2dForYX
TH2 * fDiffR2dForXZ
TH2 * fDiffR2dForYZ
TH2 * fProjRadVsRad

Detailed Description

Definition at line 25 of file PlotVtx.h.


Constructor & Destructor Documentation

Anp::HistVtx::HistVtx (  ) 

Definition at line 30 of file PlotVtx.cxx.

00031    :fPlot(false),
00032     fNMiss(0),
00033     fCenterX(1.4828),
00034     fCenterY(0.2384),
00035     fDir(0),
00036     fX(0),
00037     fY(0),
00038     fU(0),
00039     fV(0),
00040     fZ(0),
00041     fR2(0),
00042     fCosX(0),
00043     fCosY(0),
00044     fCosZ(0),
00045     fYX(0),
00046     fXZ(0),
00047     fYZ(0),
00048     fDiffX(0),
00049     fDiffY(0),
00050     fDiffZ(0),
00051     fDiffR2d(0),
00052     fDiffR3d(0),
00053     fProjRad(0),
00054     fProjAng(0),
00055     fDiffR2dForYX(0),
00056     fDiffR2dForXZ(0),
00057     fDiffR2dForYZ(0),
00058     fProjRadVsRad(0)
00059 {
00060 }

Anp::HistVtx::~HistVtx (  )  [virtual]

Definition at line 63 of file PlotVtx.cxx.

00064 { 
00065 }


Member Function Documentation

bool Anp::HistVtx::Fill ( const Vertex lhs,
const Vertex rhs,
double  weight 
)

Definition at line 93 of file PlotVtx.cxx.

References fCenterX, fCenterY, fDiffR2d, fDiffR2dForXZ, fDiffR2dForYX, fDiffR2dForYZ, fDiffR3d, fDiffX, fDiffY, fDiffZ, fDir, Fill(), fPlot, fProjAng, fProjRad, fProjRadVsRad, Anp::Vertex::X(), Anp::Vertex::Y(), and Anp::Vertex::Z().

00094 {
00095    if(!fPlot || !fDir) return false;
00096   
00097    const double diffX = lhs.X() - rhs.X();
00098    const double diffY = lhs.Y() - rhs.Y();
00099    const double diffZ = lhs.Z() - rhs.Z();
00100    const double diffR2d = std::sqrt(diffX*diffX + diffY*diffY);
00101    const double diffR3d = std::sqrt(diffX*diffX + diffY*diffY + diffZ*diffZ);
00102 
00103    fDiffX -> Fill(diffX, weight);
00104    fDiffY -> Fill(diffY, weight);
00105    fDiffZ -> Fill(diffZ, weight);
00106 
00107    fDiffR2d -> Fill(diffR2d, weight);
00108    fDiffR3d -> Fill(diffR3d, weight);
00109 
00110    //
00111    // Compute 2d (xy) vector between lhs vertex and fiducial center
00112    //
00113    const double coordX = lhs.X() - fCenterX;
00114    const double coordY = lhs.Y() - fCenterY;
00115    const double coordR = std::sqrt(coordX*coordX + coordY*coordY);
00116    
00117    if(coordR > 0.0)
00118    {
00119       fProjRad -> Fill((+coordX*diffX + coordY*diffY)/coordR, weight);
00120       fProjAng -> Fill((-coordY*diffX + coordX*diffY)/coordR, weight);
00121       
00122       if(fProjRadVsRad) fProjRadVsRad -> Fill(coordR, (+coordX*diffX + coordY*diffY)/coordR, weight);
00123    }
00124    else
00125    {
00126       fProjRad -> Fill(0.0, weight);
00127       fProjAng -> Fill(0.0, weight);      
00128    }
00129    
00130    if(fDiffR2dForYX) fDiffR2dForYX -> Fill(lhs.X(), lhs.Y(), diffR2d);
00131    if(fDiffR2dForXZ) fDiffR2dForXZ -> Fill(lhs.Z(), lhs.X(), diffR2d);
00132    if(fDiffR2dForYZ) fDiffR2dForYZ -> Fill(lhs.Z(), lhs.Y(), diffR2d);
00133 
00134    return true;
00135 }

bool Anp::HistVtx::Fill ( const Vertex vertex,
double  weight 
)

Definition at line 68 of file PlotVtx.cxx.

References Anp::Vertex::CosX(), Anp::Vertex::CosY(), Anp::Vertex::CosZ(), fCosX, fCosY, fCosZ, fDir, fPlot, fR2, fU, fV, fX, fXZ, fY, fYX, fYZ, fZ, Anp::Vertex::U(), Anp::Vertex::V(), Anp::Vertex::X(), Anp::Vertex::Y(), and Anp::Vertex::Z().

Referenced by Fill().

00069 {
00070    if(!fPlot || !fDir) return false;
00071    
00072    fX -> Fill(vertex.X(), weight);
00073    fY -> Fill(vertex.Y(), weight);
00074    fU -> Fill(vertex.U(), weight);
00075    fV -> Fill(vertex.V(), weight);
00076    fZ -> Fill(vertex.Z(), weight);
00077 
00078    fR2 -> Fill(vertex.X()*vertex.X() + vertex.Y()*vertex.Y(), weight);
00079    
00080    fCosX -> Fill(vertex.CosX(), weight);
00081    fCosY -> Fill(vertex.CosY(), weight);
00082    fCosZ -> Fill(vertex.CosZ(), weight);
00083    
00084    if(fYX) fYX -> Fill(vertex.X(), vertex.Y(), weight);
00085    if(fXZ) fXZ -> Fill(vertex.Z(), vertex.X(), weight);
00086    if(fYZ) fYZ -> Fill(vertex.Z(), vertex.Y(), weight);
00087 
00088    return true;
00089 }

TH1 * Anp::HistVtx::GetTH1 ( const std::string &  key,
const std::string &  name = "" 
) [private]

Definition at line 201 of file PlotVtx.cxx.

References Anp::HistMan::CreateTH1(), fDir, fNMiss, Anp::HistMan::Instance(), and Anp::SetDir().

00202 {
00203    TH1 *h = HistMan::Instance().CreateTH1(key, "vertex");
00204    if(h)
00205    {
00206       Anp::SetDir(h, fDir, name);
00207    }
00208    else
00209    {
00210       ++fNMiss;
00211    }
00212 
00213    return h;
00214 }

TH2 * Anp::HistVtx::GetTH2 ( const std::string &  key,
const std::string &  name = "" 
) [private]

Definition at line 217 of file PlotVtx.cxx.

References Anp::HistMan::CreateTH2(), fDir, fNMiss, Anp::HistMan::Instance(), and Anp::SetDir().

00218 {
00219    TH2 *h = HistMan::Instance().CreateTH2(key, "vertex");
00220    if(h)
00221    {
00222       Anp::SetDir(h, fDir, name);
00223    }
00224    else
00225    {
00226       ++fNMiss;
00227    }
00228 
00229    return h;
00230 }

bool Anp::HistVtx::Make ( TDirectory *  dir,
const std::string &  option 
)
void Anp::HistVtx::SetCenter ( double  x,
double  y 
)

Definition at line 194 of file PlotVtx.cxx.

References fCenterX, and fCenterY.

00195 {
00196    fCenterX = x;
00197    fCenterY = y;
00198 }


Member Data Documentation

double Anp::HistVtx::fCenterX [private]

Definition at line 50 of file PlotVtx.h.

Referenced by Fill(), and SetCenter().

double Anp::HistVtx::fCenterY [private]

Definition at line 51 of file PlotVtx.h.

Referenced by Fill(), and SetCenter().

TH1* Anp::HistVtx::fCosX [private]

Definition at line 65 of file PlotVtx.h.

Referenced by Fill().

TH1* Anp::HistVtx::fCosY [private]

Definition at line 66 of file PlotVtx.h.

Referenced by Fill().

TH1* Anp::HistVtx::fCosZ [private]

Definition at line 67 of file PlotVtx.h.

Referenced by Fill().

TH1* Anp::HistVtx::fDiffR2d [private]

Definition at line 79 of file PlotVtx.h.

Referenced by Fill().

Definition at line 86 of file PlotVtx.h.

Referenced by Fill().

Definition at line 85 of file PlotVtx.h.

Referenced by Fill().

Definition at line 87 of file PlotVtx.h.

Referenced by Fill().

TH1* Anp::HistVtx::fDiffR3d [private]

Definition at line 80 of file PlotVtx.h.

Referenced by Fill().

TH1* Anp::HistVtx::fDiffX [private]

Definition at line 76 of file PlotVtx.h.

Referenced by Fill().

TH1* Anp::HistVtx::fDiffY [private]

Definition at line 77 of file PlotVtx.h.

Referenced by Fill().

TH1* Anp::HistVtx::fDiffZ [private]

Definition at line 78 of file PlotVtx.h.

Referenced by Fill().

TDirectory* Anp::HistVtx::fDir [private]

Definition at line 53 of file PlotVtx.h.

Referenced by Fill(), GetTH1(), and GetTH2().

int Anp::HistVtx::fNMiss [private]

Definition at line 48 of file PlotVtx.h.

Referenced by GetTH1(), and GetTH2().

bool Anp::HistVtx::fPlot [private]

Definition at line 47 of file PlotVtx.h.

Referenced by Fill().

TH1* Anp::HistVtx::fProjAng [private]

Definition at line 83 of file PlotVtx.h.

Referenced by Fill().

TH1* Anp::HistVtx::fProjRad [private]

Definition at line 82 of file PlotVtx.h.

Referenced by Fill().

Definition at line 88 of file PlotVtx.h.

Referenced by Fill().

TH1* Anp::HistVtx::fR2 [private]

Definition at line 63 of file PlotVtx.h.

Referenced by Fill().

TH1* Anp::HistVtx::fU [private]

Definition at line 60 of file PlotVtx.h.

Referenced by Fill().

TH1* Anp::HistVtx::fV [private]

Definition at line 61 of file PlotVtx.h.

Referenced by Fill().

TH1* Anp::HistVtx::fX [private]

Definition at line 58 of file PlotVtx.h.

Referenced by Fill().

TH2* Anp::HistVtx::fXZ [private]

Definition at line 70 of file PlotVtx.h.

Referenced by Fill().

TH1* Anp::HistVtx::fY [private]

Definition at line 59 of file PlotVtx.h.

Referenced by Fill().

TH2* Anp::HistVtx::fYX [private]

Definition at line 69 of file PlotVtx.h.

Referenced by Fill().

TH2* Anp::HistVtx::fYZ [private]

Definition at line 71 of file PlotVtx.h.

Referenced by Fill().

TH1* Anp::HistVtx::fZ [private]

Definition at line 62 of file PlotVtx.h.

Referenced by Fill().


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

Generated on 3 Dec 2018 for loon by  doxygen 1.6.1