10#define ProofNtuple_cxx
27ProofNtuple::~ProofNtuple()
55 pad1->GetFrame()->SetFillColor(15);
57 ntp->SetFillStyle(1001);
58 ntp->SetFillColor(45);
59 ntp->Draw(
"3*px+2",
"px**2+py**2>1");
60 ntp->SetFillColor(38);
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)");
70 ntp->SetMarkerColor(4);
71 ntp->Draw(
"pz:py:px",
"pz<6 && pz>4",
"same");
72 ntp->SetMarkerColor(5);
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");
88void ProofNtuple::Begin(
TTree * )
101void ProofNtuple::SlaveBegin(
TTree * )
110 TNamed *nm =
dynamic_cast<TNamed *
>(fInput->FindObject(
"SimpleNtuple.root"));
119 TNamed *
out = (
TNamed *) fInput->FindObject(
"PROOF_OUTPUTFILE_LOCATION");
120 Info(
"SlaveBegin",
"PROOF_OUTPUTFILE_LOCATION: %s", (out ?
out->GetTitle() :
"undef"));
122 out = (
TNamed *) fInput->FindObject(
"PROOF_OUTPUTFILE");
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'");
199 }
else if (fRandom) {
200 fRandom->Rannor(px,py);
203 Abort(
"no way to get random numbers! Stop processing", kAbortProcess);
220void ProofNtuple::SlaveTerminate()
229 Error(
"SlaveTerminate",
"'ntuple' is undefined!");
234 if (
fNtp->GetEntries() > 0) {
243 fNtp->SetDirectory(
nullptr);
249 TUrl uf(*(fFile->GetEndpointUrl()));
258void ProofNtuple::Terminate()
269 dynamic_cast<TProofOutputFile*
>(fOutput->FindObject(
"SimpleNtuple.root")))) {
287 Error(
"Terminate",
"TProofOutputFile not found");
Selector to fill a simple ntuple.
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
R__EXTERN TSystem * gSystem
Describe directory structure in memory.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
The TNamed class is the base class for all named ROOT classes.
const char * GetTitle() const override
Returns title of object.
A simple TTree restricted to a list of float variables only.
@ kOverwrite
overwrite existing object with same name
The most important graphics class in the ROOT system.
A Pave (see TPave) with text, lines or/and boxes inside.
Class to steer the merging of files produced on the workers.
Random number generator class based on M.
virtual int Unlink(const char *name)
Unlink, i.e.
A TTree represents a columnar dataset.
This class represents a WWW compatible URL.
Double_t ErfInverse(Double_t x)
Returns the inverse error function.
Double_t Sqrt(Double_t x)
Returns the square root of x.