#include <ProfMon.h>
Inheritance diagram for ProfMon:

Public Member Functions | |
| ProfMon () | |
| virtual | ~ProfMon () |
| double | GetStats (double &xmean, double &ymean, double &xrms, double &yrms) |
Static Public Member Functions | |
| int | Xindex (int channel) |
| int | Yindex (int channel) |
| double | WirePosition (int channel) |
Static Public Attributes | |
| const double | WIRE_SPACING = 0.5 |
| const int | MIN_CHANNEL = 1 |
| const int | MAX_CHANNEL = 44 |
Helper for dealing with Profile Monitor acnet devices in the bmnt ttree
Definition at line 12 of file ProfMon.h.
|
|
Definition at line 11 of file ProfMon.cxx. 00012 {
00013 }
|
|
|
Definition at line 14 of file ProfMon.cxx. 00015 {
00016 }
|
|
||||||||||||||||||||
|
Calculate statistical values. Return the sum of charge in both X and Y Definition at line 44 of file ProfMon.cxx. References Swic::GetVoltage(), WirePosition(), Xindex(), and Yindex(). Referenced by ProtonDist::Fill(). 00046 {
00047 double qx=0,qx2=0,qtotx=0;
00048 double qy=0,qy2=0,qtoty=0;
00049 for (int ch = MIN_CHANNEL; ch <= MAX_CHANNEL; ++ch) {
00050 double X = this->WirePosition(ch);
00051 double Y = this->WirePosition(ch);
00052
00053 int x_index = this->Xindex(ch);
00054 int y_index = this->Yindex(ch);
00055
00056 double Qx = this->GetVoltage(x_index);
00057 double Qy = this->GetVoltage(y_index);
00058
00059 Qx = Qx > 0 ? Qx : 0;
00060 Qy = Qy > 0 ? Qy : 0;
00061
00062 qtotx += Qx;
00063 qtoty += Qy;
00064
00065 qx += Qx*X;
00066 qy += Qy*Y;
00067
00068 qx2 += Qx*X*X;
00069 qy2 += Qy*Y*Y;
00070 }
00071 xmean = qx/qtotx;
00072 ymean = qy/qtoty;
00073 xrms = sqrt(qx2/qtotx-xmean*xmean);
00074 yrms = sqrt(qy2/qtoty-ymean*ymean);
00075 return qtotx+qtoty;
00076
00077 }
|
|
|
Return the distance from origin to given wire channel. Origin is half way between channels 22 and 23. Definition at line 39 of file ProfMon.cxx. References MAX_CHANNEL. Referenced by book_and_fill(), fill_profile(), and GetStats(). 00040 {
00041 double mid = (MAX_CHANNEL-MIN_CHANNEL)/2.0 + MIN_CHANNEL;
00042 return (channel - mid) * WIRE_SPACING;
00043 }
|
|
|
Get the index into the wire data block for the given wire channel for either X or Y views. The channels are numbered 1-44, indices are confined to be [0-95] but don't fill the range completly. Negative index is returned if a bad channel is passed. Definition at line 27 of file ProfMon.cxx. Referenced by fill_profile(), and GetStats(). 00028 {
00029 if (channel < MIN_CHANNEL || channel > MAX_CHANNEL) return -1;
00030 return channel+1;
00031 }
|
|
|
Definition at line 32 of file ProfMon.cxx. Referenced by fill_profile(), and GetStats(). 00033 {
00034 if (channel < MIN_CHANNEL || channel > MAX_CHANNEL) return -1;
00035 return channel+49;
00036 }
|
|
|
Definition at line 8 of file ProfMon.cxx. Referenced by fill_profile(), and WirePosition(). |
|
|
Definition at line 7 of file ProfMon.cxx. Referenced by fill_profile(). |
|
|
Definition at line 6 of file ProfMon.cxx. |
1.3.9.1