47 void SpyServ::HandleSocket(
TSocket *
s)
58 if (s->
Recv(request,
sizeof(request)) <= 0) {
68 if (!strcmp(request,
"get hpx"))
69 answer.WriteObject(fHpx);
70 else if (!strcmp(request,
"get hpxpy"))
71 answer.WriteObject(fHpxpy);
72 else if (!strcmp(request,
"get hprof"))
73 answer.WriteObject(fHprof);
75 Error(
"SpyServ::HandleSocket",
"unexpected message");
90 if (!fServ->IsValid())
102 fCanvas =
new TCanvas(
"SpyServ",
"SpyServ",200,10,700,500);
103 fCanvas->SetFillColor(42);
104 fCanvas->GetFrame()->SetFillColor(21);
105 fCanvas->GetFrame()->SetBorderSize(6);
106 fCanvas->GetFrame()->SetBorderMode(-1);
109 fHpx =
new TH1F(
"hpx",
"This is the px distribution",100,-4,4);
110 fHpxpy =
new TH2F(
"hpxpy",
"py vs px",40,-4,4,40,-4,4);
111 fHprof =
new TProfile(
"hprof",
"Profile of pz versus px",100,-4,4,0,20);
114 fHpx->SetFillColor(48);
120 for (
Int_t i = 0; ; i++) {
126 if (i && (i%kUPDATE) == 0) {
127 if (i == kUPDATE) fHpx->Draw();
138 if (
gROOT->IsInterrupted())
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
const char * GetHostName() const
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
virtual Int_t Recv(TMessage *&mess)
Receive a TMessage object.
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
virtual void Add(TSocket *sock, Int_t interest=kRead)
Add socket to the monitor's active list.
1-D histogram with a float per channel (see TH1 documentation)}
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
void Error(const char *location, const char *msgfmt,...)
object has not been deleted
virtual Int_t Select(Int_t interest=kRead, Long_t timeout=-1)
Waits for this socket to change status.
R__EXTERN TSystem * gSystem
2-D histogram with a float per channel (see TH1 documentation)}
R__EXTERN TRandom * gRandom
static constexpr double s
virtual void Exit(int code, Bool_t mode=kTRUE)
Exit the application.
TInetAddress GetInetAddress() const
THist< 2, float, THistStatContent, THistStatUncertainty > TH2F