10 #define ProofNtuple_cxx 27 ProofNtuple::~ProofNtuple()
38 void ProofNtuple::PlotNtuple(
TNtuple *ntp,
const char *ntptitle)
59 ntp->
Draw(
"3*px+2",
"px**2+py**2>1");
61 ntp->
Draw(
"2*px+2",
"pz>2",
"same");
63 ntp->
Draw(
"1.3*px+2",
"(px^2+py^2>4) && py>0",
"same");
69 ntp->
Draw(
"pz:py:px",
"(pz<10 && pz>6)+(pz<4 && pz>3)");
71 ntp->
Draw(
"pz:py:px",
"pz<6 && pz>4",
"same");
73 ntp->
Draw(
"pz:py:px",
"pz<4 && pz>3",
"same");
77 l2->
AddText(
"You can interactively rotate this view in 2 ways:");
78 l2->
AddText(
" - With the RotateCube in clicking in this pad");
79 l2->
AddText(
" - Selecting View with x3d in the View menu");
97 if (out) fPlotNtuple =
kFALSE;
101 void ProofNtuple::SlaveBegin(
TTree * )
110 TNamed *
nm =
dynamic_cast<TNamed *
>(fInput->FindObject(
"SimpleNtuple.root"));
120 Info(
"SlaveBegin",
"PROOF_OUTPUTFILE_LOCATION: %s", (out ? out->
GetTitle() :
"undef"));
123 if (out) fProofFile->SetOutputFileName(out->
GetTitle());
127 fFile = fProofFile->OpenFile(
"RECREATE");
128 if (fFile && fFile->IsZombie())
SafeDelete(fFile);
132 Info(
"SlaveBegin",
"could not create '%s': instance is invalid!", fProofFile->GetName());
137 fNtp =
new TNtuple(
"ntuple",
"Demo ntuple",
"px:py:pz:random:i");
139 fNtp->SetDirectory(fFile);
143 fNtp2 =
new TNtuple(
"ntuple2",
"Demo ntuple2",
"vx:vy:vz");
145 fNtp2->SetDirectory(fFile);
152 if (!(fNtpRndm = dynamic_cast<TNtuple *>(fInput->FindObject(
"NtpRndm")))) {
154 "asked to use rndm ntuple but 'NtpRndm' not found in the" 155 " input list! Using the random generator");
158 Info(
"SlaveBegin",
"taking randoms from input ntuple 'NtpRndm'");
163 if (!fNtpRndm) fRandom =
new TRandom3(0);
187 if (!fNtp)
return kTRUE;
193 Float_t *ar = fNtpRndm->GetArgs();
194 Long64_t ent = entry % fNtpRndm->GetEntries();
195 fNtpRndm->GetEntry(ent);
199 }
else if (fRandom) {
200 fRandom->Rannor(px,py);
201 random = fRandom->Rndm();
203 Abort(
"no way to get random numbers! Stop processing", kAbortProcess);
208 fNtp->Fill(px,py,pz,random,i);
210 if (!fNtp2)
return kTRUE;
214 fNtp2->Fill(px,py,vz);
220 void ProofNtuple::SlaveTerminate()
229 Error(
"SlaveTerminate",
"'ntuple' is undefined!");
234 if (fNtp->GetEntries() > 0) {
239 fOutput->Add(fProofFile);
243 fNtp->SetDirectory(0);
244 if (fNtp2) fNtp2->SetDirectory(0);
249 TUrl uf(*(fFile->GetEndpointUrl()));
258 void ProofNtuple::Terminate()
265 if (!fPlotNtuple)
return;
269 dynamic_cast<TProofOutputFile*>(fOutput->FindObject(
"SimpleNtuple.root")))) {
271 TString outputFile(fProofFile->GetOutputFileName());
272 TString outputName(fProofFile->GetName());
273 outputName +=
".root";
274 Printf(
"outputFile: %s", outputFile.Data());
279 Printf(
"Managed to open file: %s", outputFile.Data());
280 fNtp = (
TNtuple *) fFile->Get(
"ntuple");
282 Error(
"Terminate",
"could not open file: %s", outputFile.Data());
287 Error(
"Terminate",
"TProofOutputFile not found");
292 if (fNtp) PlotNtuple(fNtp,
"proof ntuple");
virtual const char * GetName() const
Returns name of object.
Double_t ErfInverse(Double_t x)
returns the inverse error function x must be <-1<x<1
Random number generator class based on M.
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
virtual TVirtualPad * GetPad(Int_t subpadnumber) const
Get a pointer to subpadnumber of this pad.
This class represents a WWW compatible URL.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
overwrite existing object with same name
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
TVirtualPad * cd(Int_t subpadnumber=0)
Set Current pad.
TFrame * GetFrame()
Get frame.
The TNamed class is the base class for all named ROOT classes.
virtual void SetGrid(Int_t valuex=1, Int_t valuey=1)
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
void Info(const char *location, const char *msgfmt,...)
virtual void Close(Option_t *option="")
Delete all objects from memory and directory structure itself.
virtual void RedrawAxis(Option_t *option="")
Redraw the frame axis Redrawing axis may be necessary in case of superimposed histograms when one or ...
void Error(const char *location, const char *msgfmt,...)
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
A simple TTree restricted to a list of float variables only.
R__EXTERN TSystem * gSystem
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
The most important graphics class in the ROOT system.
char * Form(const char *fmt,...)
Class to steer the merging of files produced on the workers.
void Warning(const char *location, const char *msgfmt,...)
static constexpr double nm
A Pave (see TPave) with text, lines or/and boxes inside.
Describe directory structure in memory.
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
Selector to fill a simple ntuple.
A TTree object has a header with a name and a title.
Double_t Sqrt(Double_t x)
virtual void Update()
Update canvas pad buffers.
virtual const char * GetTitle() const
Returns title of object.
virtual void SetLogy(Int_t value=1)
Set Lin/Log scale for Y.