This macro uses an existing PROOF session or starts one at the indicated URL. In the case non existing PROOF session is found and no URL is given, the macro tries to start a local PROOF session.
Currently available analysis are (to see how all this really works check the scope for the specified option inside the macro):
"simple"
Selector: ProofSimple.h.C
root[] runProof("simple")
This will create a local PROOF session and run an analysis filling 100 histos with 100000 gaussian random numbers, and displaying them in a canvas with 100 pads (10x10). The number of histograms can be passed as argument 'nhist' to 'simple', e.g. to fill 16 histos with 1000000 entries use
root[] runProof("simple(nevt=1000000,nhist=16)")
The argument nhist3 controls the creation of 3d histos to simulate merging load. By default, no 3D hitogram is created.
"h1"
Selector: tutorials/tree/h1analysis.h.C
root[] runProof("h1")
This runs the 'famous' H1 analysis from $ROOTSYS/tree/h1analysis.C.h. By default the data are read from the HTTP server at root.cern.ch, the data source can be changed via the argument 'h1src', e.g.
root[] runProof("h1,h1src=/data/h1")
(the directory specified must contain the 4 H1 files).
The 'h1' example is also used to show how to use entry-lists in PROOF. To fill the list for the events used for the final plots add the option 'fillList':
root[] runProof("h1,fillList")
To use the list previously created for the events used for the final plots add the option 'useList':
root[] runProof("h1,useList")
"event"
Selector: ProofEvent.h,.C
This is an example of using PROOF par files. It runs event generation and simple analysis based on the 'Event' class found under test.
root[] runProof("event")
"eventproc"
Selector: ProofEventProc.h.C
This is an example of using PROOF par files and process 'event' data from the ROOT HTTP server. It runs the ProofEventProc selector which is derived from the EventTree_Proc one found under test/ProofBench. The following specific arguments are available:
- 'readall' to read the whole event, by default only the branches needed by the analysis are read (read 25% more bytes)
- 'datasrc=<dir-with-files>' to read the files from another server, the files must be named 'event_<num>.root' where <num>=1,2,... or
- 'datasrc=<file-with-files>' to take the file content from a text file, specified one file per line; usefull when testing differences between several sources and distributions
- 'files=N' to change the number of files to be analysed (default is 10, max is 50 for the HTTP server).
- 'uneven' to process uneven entries from files following the scheme {50000,5000,5000,5000,5000} and so on
root[] runProof("eventproc")
"pythia8"
Selector: ProofPythia.h.C
This runs Pythia8 generation based on main03.cc example in Pythia 8.1
To run this analysis ROOT must be configured with pythia8.
Note that before executing this analysis, the env variable PYTHIA8 must point to the pythia8100 (or newer) directory, in particular, $PYTHIA8/xmldoc must contain the file Index.xml. The tutorial assumes that the Pythia8 directory is the same on all machines, i.e. local and worker ones.
root[] runProof("pythia8")
"ntuple"
Selector: ProofNtuple.h.C
This is an example of final merging via files created on the workers, using TProofOutputFile. The final file is called ProofNtuple.root and it is created in the directory where the tutorial is run. If the PROOF cluster is remote, the file is received by a local xrootd daemon started for the purpose. Because of this, this example can be run only on unix clients.
root[] runProof("ntuple")
By default the random numbers are generate anew. There is the possibility use a file of random numbers (to have reproducible results) by specify the option 'inputrndm', e.g.
root[] runProof("ntuple(inputrndm)")
By default the output will be saved in the local file SimpleNtuple.root; location and name of the file can be changed via the argument 'outfile', e.g.
root[] runProof("simplefile(outfile=/data0/testntuple.root)") root[] runProof("simplefile(outfile=root://aserver//data/testntuple.root)")
"dataset"
Selector: ProofNtuple.h.C
This is an example of automatic creation of a dataset from files created on the workers, using TProofOutputFile. The dataset is called testNtuple and it is automatically registered and verified. The files contain the same ntuple as in previous example/tutorial 6 (the same selector ProofNTuple is used with a slightly different configuration). The dataset is then used to produce the same plot as in 5 but using the DrawSelect methods of PROOF, which also show how to set style, color and other drawing attributes in PROOF. Depending on the relative worker perforance, some of the produced files may result in having no entries. If this happens, the file will be added to the missing (skipped) file list. Increasing the number of events (via nevt=...) typically solves this issue.
root[] runProof("dataset")
"friends"
Selectors: ProofFriends.h(.C), ProofAux.h(.C)
This is an example of TTree friend processing in PROOF. It also shows how to use the TPacketizerFile to steer creation of files.
root[] runProof("friends")
The trees are by default created in separate files; to create them in the same file use option 'samefile', e.g.
root[] runProof("friends(samefile)")
"simplefile"
Selector: ProofSimpleFile.h.C
root[] runProof("simplefile")
This will create a local PROOF session and run an analysis filling 16+16 histos with 100000 gaussian random numbers. The merging of these histos goes via file; 16 histos are saved in the top directory, the other 16 into a subdirectory called 'blue'. The final display is done in two canvanses, one for each set of histograms and with 16 pads each (4x4). The number of histograms in each set can be passed as argument 'nhist' to 'simplefile', e.g. to fill 25 histos with 1000000 entries use
root[] runProof("simplefile(nevt=1000000,nhist=25)")
By default the output will be saved in the local file SimpleFile.root; location and name of the file can be changed via the argument 'outfile', e.g.
root[] runProof("simplefile(outfile=/data0/testsimple.root)") root[] runProof("simplefile(outfile=root://aserver//data/testsimple.root)")
"stdvec"
Selector: ProofStdVect.h.C
This is an example of using standard vectors (vector<vector<bool> > and vector<vector<float> >) in a TSelector. The same selector is run twice: in 'create' mode it creates a dataset with the tree 'stdvec' containing 3 branches, a vector<vector<bool> > and two vector<vector<float> >. The tree is saved into a file on each worker and a dataset is created with these files (the dataset is called 'TestStdVect'); in 'read' mode the dataset is read and a couple fo histograms filled and displayed.
root[] runProof("stdvec")
The following arguments are valid for all examples (the ones specific to each tutorial have been explained above)
In all cases, to run on a remote PROOF cluster, the master URL must be passed as second argument; e.g.
A rough parsing of the URL is done to determine the locality of the cluster. If using a tunnel the URL can start by localhost even for external clusters: in such cases the default locality determination will be wrong, so one has to tell explicity that the cluster is external via the option field, e.g.
In the case of local running it is possible to specify the number of workers to start as third argument (the default is the number of cores of the machine), e.g.
will start 4 workers. Note that the real number of workers is changed only the first time you call runProof into a ROOT session. Following calls can reduce the number of active workers, but not increase it. For example, in the same session of the call above starting 4 workers, this
will disable 2 workers and use the other 2.
Finally, it is possible to pass as 4th argument a list of objects to be added to the input list to further control the PROOF behaviour:
the content of 'ins' will then be copied to the input list before processing.
void plotNtuple(
TProof *p,
const char *ds,
const char *ntptitle);
void SavePerfTree(
TProof *proof,
const char *fn);
const char *pythia8dir = 0;
const char *pythia8data = 0;
void runProof(const char *what = "simple",
const char *masterurl = "proof://localhost:40000",
{
if (!u.IsNull() && u != "lite://") {
if ((!strcmp(uu.GetHost(), "localhost") && !uopts.Contains("external")) ||
}
if (!u.BeginsWith(uu.GetProtocol())) uu.SetProtocol("proof");
uopts.ReplaceAll("external", "");
uu.SetOptions(uopts.Data());
u = uu.GetUrl();
}
const char *url = u.Data();
if (!ug) {
Printf(
"runProof: could not get user info");
return;
}
if (!tmpdir.EndsWith(us.
Data())) tmpdir +=
us;
Printf(
"runProof: unable to get a writable tutorial directory (tried: %s)" " - cannot continue", tmpdir.Data());
return;
}
TString tutdir =
Form(
"%s/.proof-tutorial", tmpdir.Data());
Printf(
"runProof: creating the temporary directory" " for the tutorial (%s) ... ", tutdir.
Data());
Printf(
"runProof: could not assert / create the temporary directory" " for the tutorial (%s)", tutdir.
Data());
return;
}
}
if (what && !strncmp(what, "pythia8", 7)) {
if (!pythia8dir || strlen(pythia8dir) <= 0) {
Printf(
"runProof: pythia8: environment variable PYTHIA8 undefined:" " it must contain the path to pythia81xx root directory (local and remote) !");
return;
}
if (!pythia8data || strlen(pythia8data) <= 0) {
if (!pythia8data || strlen(pythia8data) <= 0) {
Printf(
"runProof: pythia8: environment variable PYTHIA8DATA undefined:" " it one must contain the path to pythia81xx/xmldoc"
" subdirectory (local and remote) !");
return;
}
}
TString env =
Form(
"echo export PYTHIA8=%s; export PYTHIA8DATA=%s",
pythia8dir, pythia8data);
}
if (!proof) {
Printf(
"runProof: could not start/attach a PROOF session");
return;
}
if (proof->IsLite()) isProofLocal =
kTRUE;
#ifdef WIN32
if (isProofLocal && what && !strcmp(what, "ntuple", 6)) {
Printf(
"runProof: the 'ntuple' example needs to run xrootd to receive the output file, \n" " but xrootd is not supported on Windows - cannot continue");
return;
}
#endif
FILE *fs = fopen(proofsessions.Data(), "a");
if (!fs) {
Printf(
"runProof: could not create files for sessions tags");
} else {
fprintf(fs,"session-%s\n", proof->GetSessionTag());
fclose(fs);
}
if (!proof) {
Printf(
"runProof: could not start/attach a PROOF session");
return;
}
if (nwrks > 0)
proof->SetParallel(nwrks);
if (!rootbin) {
Printf(
"runProof: root.exe not found: please check the environment!");
return;
}
TString tutorials(
Form(
"%s/tutorials", rootsys.Data()));
delete[] rootbin;
args.ReplaceAll("("," ");
args.ReplaceAll(")"," ");
args.ReplaceAll(","," ");
if (!args.Tokenize(act, from, " ")) {
Printf(
"runProof: action not found: check your arguments (%s)", what);
return;
}
aMode += "+";
}
TString aNevt, aFirst, aNwrk, opt, sel, punzip(
"off"), aCache, aOutFile,
aH1Src("http://root.cern.ch/files/h1"),
aDebug, aDebugEnum, aRateEst, aPerfTree("perftree.root"),
aFeedback("fb=stats");
while (args.Tokenize(tok, from, " ")) {
aDebug = tok;
if ((icol = aDebug.Index(
":")) !=
kNPOS) {
aDebugEnum = aDebug(0, icol);
aDebug.Remove(0, icol+1);
}
if (!aDebug.IsDigit()) {
Printf(
"runProof: %s: error parsing the 'debug=' option (%s) - ignoring", act.
Data(), tok.
Data());
aDebug = "";
aDebugEnum = "";
}
}
aNevt = tok;
if (!aNevt.IsDigit()) {
Printf(
"runProof: %s: error parsing the 'nevt=' option (%s) - ignoring", act.
Data(), tok.
Data());
aNevt = "";
}
}
aFirst = tok;
if (!aFirst.IsDigit()) {
Printf(
"runProof: %s: error parsing the 'first=' option (%s) - ignoring", act.
Data(), tok.
Data());
aFirst = "";
}
}
opt = "ASYN";
aNwrk = tok;
if (!aNwrk.IsDigit()) {
Printf(
"runProof: %s: error parsing the 'nwrk=' option (%s) - ignoring", act.
Data(), tok.
Data());
aNwrk = "";
}
}
punzip = "on";
aCache = tok;
if (!aCache.IsDigit()) {
Printf(
"runProof: %s: error parsing the 'cache=' option (%s) - ignoring", act.
Data(), tok.
Data());
aCache = "";
}
}
aSubMg = 0;
}
}
}
opt += "fillList";
}
if (!(tok.
IsNull())) aH1Src = tok;
Printf(
"runProof: %s: reading data files from '%s'", act.
Data(), aH1Src.Data());
}
if (!(tok.
IsNull())) aRateEst = tok;
Printf(
"runProof: %s: progress-bar rate estimation option: '%s'", act.
Data(), aRateEst.Data());
}
if (!(tok.
IsNull())) aPerfTree = tok;
}
Printf(
"runProof: %s: saving performance tree to '%s'", act.
Data(), aPerfTree.Data());
}
if (!(tok.
IsNull())) aOutFile = tok;
}
Printf(
"runProof: %s: output file: '%s'", act.
Data(), aOutFile.Data());
}
if (tok == "off" || tok == "OFF" || tok == "0") {
aFeedback = "";
tok[0] = ',';
aFeedback += tok;
} else {
}
}
Printf(
"runProof: %s: feedback: '%s'", act.
Data(), aFeedback.Data());
}
}
Long64_t nevt = (aNevt.IsNull()) ? -1 : aNevt.Atoi();
Long64_t first = (aFirst.IsNull()) ? 0 : aFirst.Atoi();
Long64_t nwrk = (aNwrk.IsNull()) ? -1 : aNwrk.Atoi();
from = 0;
if (nwrk > 0) {
if (proof->GetParallel() < nwrk) {
Printf(
"runProof: %s: request for a number of workers larger then available - ignored", act.
Data());
} else {
proof->SetParallel(nwrk);
}
}
if (!aDebug.IsNull()) {
Int_t dbg = aDebug.Atoi();
if (!aDebugEnum.IsNull()) scope = getDebugEnum(aDebugEnum.Data());
proof->SetLogLevel(dbg, scope);
Printf(
"runProof: %s: verbose mode for '%s'; level: %d", act.
Data(), aDebugEnum.Data(), dbg);
}
if (aRateEst == "average")
proof->SetParameter("PROOF_RateEstimation", aRateEst);
if (punzip == "on") {
proof->SetParameter(
"PROOF_UseParallelUnzip", (
Int_t)1);
Printf(
"runProof: %s: parallel unzip enabled", act.
Data());
} else {
proof->SetParameter(
"PROOF_UseParallelUnzip", (
Int_t)0);
}
if (!aCache.IsNull()) {
if (cachesz <= 0) {
proof->SetParameter(
"PROOF_UseTreeCache", (
Int_t)0);
Printf(
"runProof: %s: disabling tree cache", act.
Data());
} else {
proof->SetParameter(
"PROOF_UseTreeCache", (
Int_t)1);
proof->SetParameter("PROOF_CacheSize", cachesz);
Printf(
"runProof: %s: setting cache size to %lld", act.
Data(), cachesz);
}
} else {
proof->DeleteParameters("PROOF_UseTreeCache");
proof->DeleteParameters("PROOF_CacheSize");
}
if (aSubMg >= 0) {
proof->SetParameter("PROOF_UseMergers", aSubMg);
if (aSubMg > 0) {
Printf(
"runProof: %s: enabling merging via %d sub-mergers", act.
Data(), aSubMg);
} else {
Printf(
"runProof: %s: enabling merging via sub-mergers (optimal number)", act.
Data());
}
} else {
proof->DeleteParameters("PROOF_UseMergers");
}
if (makePerfTree) {
proof->SetParameter("PROOF_StatsHist", "");
proof->SetParameter("PROOF_StatsTrace", "");
proof->SetParameter("PROOF_SlaveStatsTrace", "");
}
if (ins && ins->GetSize() > 0) {
while ((oin = nxo())) { proof->AddInput(oin); }
}
proof->GetInputList()->Print();
if (act == "simple") {
if (first > 0)
Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial" " - ignored", act.
Data());
nevt = (nevt < 0) ? 100000 : nevt;
while (args.Tokenize(tok, from, " ")) {
aNhist = tok;
Printf(
"runProof: error parsing the 'nhist=' option (%s) - ignoring", tok.
Data());
aNhist = "";
}
aNhist3 = tok;
Printf(
"runProof: error parsing the 'nhist3=' option (%s) - ignoring", tok.
Data());
aNhist3 = "";
}
}
}
Printf(
"\nrunProof: running \"simple\" with nhist= %d, nhist3=%d and nevt= %lld\n", nhist, nhist3, nevt);
proof->SetParameter(
"ProofSimple_NHist", (
Long_t)nhist);
if (nhist3 > 0) proof->SetParameter(
"ProofSimple_NHist3", (
Long_t)nhist3);
sel.Form(
"%s/proof/ProofSimple.C%s", tutorials.Data(), aMode.
Data());
proof->Process(sel.Data(), nevt, xopt);
} else if (act == "h1") {
if (useList) {
TString eln(
"elist"), elfn(
"elist.root");
Printf(
"\nrunProof: asked to use an entry list but '%s' not found or not readable", elfn.Data());
Printf(
"\nrunProof: did you forget to run with 'fillList=%s'?\n", elfn.Data());
} else {
if (elist) {
} else {
Printf(
"\nrunProof: could not find entry-list '%s' in file '%s': ignoring",
eln.Data(), elfn.Data());
}
} else {
Printf(
"\nrunProof: requested entry-list file '%s' not existing (or not readable):" " ignoring", elfn.Data());
}
}
}
sel.Form(
"%s/tree/h1analysis.C%s", tutorials.Data(), aMode.
Data());
Printf(
"\nrunProof: running \"h1\"\n");
chain->
Process(sel.Data(),xopt,nevt,first);
while ((o = nxi())) {
if (!strncmp(o->GetName(), "elist", 5)) {
delete o;
}
}
} else if (act == "pythia8") {
if (first > 0)
Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial" " - ignored", act.
Data());
Printf(
"runProof: pythia8: PYTHIA8DATA directory (%s) must" " contain the Index.xml file !", pythia8data);
return;
}
Printf(
"runProof: pythia8: par file not found (tried %s)", pythia8par.
Data());
return;
}
proof->UploadPackage(pythia8par);
proof->EnablePackage("pythia8");
proof->ShowEnabledPackages();
Printf(
"runProof: pythia8: check settings:");
proof->Exec(".!echo hostname = `hostname`; echo \"ls pythia8:\"; ls pythia8");
Printf(
"runProof: pythia8: libEG not found \n");
return;
}
Printf(
"runProof: pythia8: libEGPythia8 not found \n");
return;
}
nevt = (nevt < 0) ? 100 : nevt;
Printf(
"\nrunProof: running \"Pythia01\" nevt= %lld\n", nevt);
sel.Form(
"%s/proof/ProofPythia.C%s", tutorials.Data(), aMode.
Data());
proof->Process(sel.Data(), nevt, xopt);
} else if (act == "event") {
if (first > 0)
Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial" " - ignored", act.
Data());
Printf(
"runProof: event: par file not found (tried %s)", eventpar.Data());
return;
}
proof->UploadPackage(eventpar);
proof->EnablePackage("event");
Printf(
"Enabled packages...\n");
proof->ShowEnabledPackages();
nevt = (nevt < 0) ? 100 : nevt;
Printf(
"\nrunProof: running \"event\" nevt= %lld\n", nevt);
sel.Form(
"%s/proof/ProofEvent.C%s", tutorials.Data(), aMode.
Data());
proof->Process(sel.Data(), nevt, xopt);
} else if (act == "eventproc") {
Printf(
"runProof: eventproc: par file not found (tried %s)", eventpar.
Data());
return;
}
proof->UploadPackage(eventpar);
proof->EnablePackage("event");
Printf(
"Enabled packages...\n");
proof->ShowEnabledPackages();
Printf(
"runProof: eventproc: ProcFileElements.C not found (tried %s)", pfelem.
Data());
return;
}
pfelem += aMode;
proof->Load(pfelem);
TString aFiles, aDataSrc(
"http://root.cern.ch/files/data"), aPartitions;
proof->SetParameter("ProofEventProc_Read", "optimized");
while (args.Tokenize(tok, from, " ")) {
aFiles = tok;
Printf(
"runProof: error parsing the 'files=' option (%s) - ignoring", tok.
Data());
aFiles = "";
}
Printf(
"runProof: error parsing the 'datasrc=' option (%s) - ignoring", tok.
Data());
} else {
aDataSrc = tok;
Printf(
"runProof: reading files from: %s", aDataSrc.Data());
}
} else if (tok == "readall") {
proof->SetParameter("ProofEventProc_Read", "readall");
Printf(
"runProof: eventproc: reading the full event");
} else if (tok == "uneven") {
Printf(
"runProof: error parsing the 'partitions=' option (%s) - ignoring", tok.
Data());
} else {
aPartitions = tok;
Printf(
"runProof: partitions: %s included in packetizer operations", aPartitions.
Data());
}
}
}
Printf(
"runProof: found aFiles: '%s', nFiles: %d", aFiles.
Data(), nFiles);
if (nFiles > 50) {
Printf(
"runProof: max number of files is 50 - resizing request");
nFiles = 50;
}
} else {
for (i = 1; i <= nFiles; i++) {
k = (i - 1) % nds;
if (os) {
if (uneven) {
if ((i - 1)%5 == 0)
else
} else {
}
}
}
delete dsrcs;
}
proof->SetParameter("PROOF_ValidateByFile", 1);
proof->SetParameter("PROOF_PacketizerPartitions", aPartitions);
}
sel.
Form(
"%s/proof/ProofEventProc.C%s", tutorials.Data(), aMode.
Data());
Printf(
"\nrunProof: running \"eventproc\"\n");
c->
Process(sel.Data(), xopt, nevt, first);
} else if (act == "ntuple") {
if (first > 0)
Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial" " - ignored", act.
Data());
nevt = (nevt < 0) ? 1000 : nevt;
Printf(
"\nrunProof: running \"ntuple\" with nevt= %lld\n", nevt);
while (args.Tokenize(tok, from, " ")) {
if (tok == "inputrndm") {
break;
}
}
if (usentprndm)
Printf(
"runProof: taking randoms from input ntuple\n");
if (fout.IsNull()) {
if (!isProofLocal) {
while (port < 9010) {
if (checkXrootdAt(port) != 1) {
break;
}
}
port++;
}
if (!xrdok) {
Printf(
"runProof: could not start basic xrootd on ports 9000-9009 - cannot continue");
return;
}
proof->AddInput(
new TNamed(
"PROOF_OUTPUTFILE_LOCATION",
"LOCAL"));
}
}
proof->AddInput(
new TNamed(
"PROOF_OUTPUTFILE", fout.Data()));
if (usentprndm) {
proof->SetInputDataFile(fnr);
proof->SetParameter("PROOF_USE_NTP_RNDM","yes");
Printf(
"runProof: taking randoms from '%s'", fnr.
Data());
}
sel.Form(
"%s/proof/ProofNtuple.C%s", tutorials.Data(), aMode.
Data());
Printf(
"runProof: selector file '%s', options: '%s'", sel.Data(), xopt.
Data());
proof->Process(sel.Data(), nevt, xopt);
if (usentprndm) {
proof->DeleteParameters("PROOF_USE_NTP_RNDM");
proof->SetInputDataFile(0);
}
} else if (act == "dataset") {
if (first > 0)
Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial" " - ignored", act.
Data());
nevt = (nevt < 0) ? 1000000 : nevt;
Printf(
"\nrunProof: running \"dataset\" with nevt= %lld\n", nevt);
proof->SetParameter("SimpleNtuple.root","testNtuple");
proof->SetParameter("PROOF_NTUPLE_DONT_PLOT", "");
sel.Form(
"%s/proof/ProofNtuple.C%s", tutorials.Data(), aMode.
Data());
proof->Process(sel.Data(), nevt, xopt);
if (proof->GetOutputList()->FindObject("testNtuple")) {
plotNtuple(proof, "testNtuple", "proof ntuple from dataset");
} else {
Printf(
"runProof: dataset 'testNtuple' not found in the output list");
}
proof->DeleteParameters("PROOF_NTUPLE_DONT_PLOT");
proof->DeleteParameters("SimpleNtuple.root");
} else if (act == "friends") {
if (first > 0)
Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial" " - ignored", act.
Data());
while (args.Tokenize(tok, from, " ")) {
if (tok == "samefile") {
break;
}
}
TList *wrks = proof->GetListOfSlaveInfos();
if (!wrks) {
Printf(
"runProof: could not get the list of information about the workers");
return;
}
files->
SetName(
"PROOF_FilesToProcess");
if (!wrklist) {
}
}
proof->AddInput(files);
if (sameFile) {
Printf(
"runProof: friend tree stored in the same file as the main tree");
proof->SetParameter("ProofAux_Action", "GenerateTreesSameFile");
} else {
proof->SetParameter("ProofAux_Action", "GenerateTrees");
}
nevt = (nevt < 0) ? 10000 : nevt;
proof->SetParameter(
"ProofAux_NEvents", (
Long64_t)nevt);
proof->SetParameter("PROOF_Packetizer", "TPacketizerFile");
sel.Form(
"%s/proof/ProofAux.C%s", tutorials.Data(), aMode.
Data());
proof->Process(sel.Data(), 1);
proof->DeleteParameters("PROOF_Packetizer");
if (proof->GetOutputList()) {
TIter nxo(proof->GetOutputList());
while ((o = nxo())) {
if (l && !strncmp(l->
GetName(),
"MainList-", 9)) {
}
}
nxo.Reset();
while ((o = nxo())) {
if (l && !strncmp(l->
GetName(),
"FriendList-", 11)) {
}
}
}
sel.Form(
"%s/proof/ProofFriends.C%s", tutorials.Data(), aMode.
Data());
} else if (act == "simplefile") {
if (first > 0)
Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial" " - ignored", act.
Data());
nevt = (nevt < 0) ? 1000000 : nevt;
while (args.Tokenize(tok, from, " ")) {
aNhist = tok;
Printf(
"runProof: error parsing the 'nhist=' option (%s) - ignoring", tok.
Data());
aNhist = "";
}
}
}
Printf(
"\nrunProof: running \"simplefile\" with nhist= %d and nevt= %lld\n", nhist, nevt);
proof->SetParameter(
"ProofSimple_NHist", (
Long_t)nhist);
if (fout.IsNull()) {
if (!isProofLocal) {
while (port < 9010) {
if (checkXrootdAt(port) != 1) {
break;
}
}
port++;
}
if (!xrdok) {
Printf(
"runProof: could not start basic xrootd on ports 9000-9009 - cannot continue");
return;
}
proof->AddInput(
new TNamed(
"PROOF_OUTPUTFILE_LOCATION",
"LOCAL"));
}
}
proof->AddInput(
new TNamed(
"PROOF_OUTPUTFILE", fout.Data()));
sel.Form(
"%s/proof/ProofSimpleFile.C%s", tutorials.Data(), aMode.
Data());
proof->Process(sel.Data(), nevt, xopt);
} else if (act == "stdvec") {
if (first > 0)
Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial" " - ignored", act.
Data());
nevt = (nevt < 0) ? 50000 * proof->GetParallel() : nevt;
Printf(
"\nrunProof: running \"stdvec\" with nevt= %lld\n", nevt);
sel.Form(
"%s/proof/ProofStdVect.C%s", tutorials.Data(), aMode.
Data());
xopt.
Form(
"%s %s create", aFeedback.Data(), opt.Data());
proof->Process(sel.Data(), nevt, xopt);
if (proof->ExistsDataSet("TestStdVect")) {
xopt.
Form(
"%s %s", aFeedback.Data(), opt.Data());
proof->Process("TestStdVect", sel.Data(), xopt);
} else {
Printf(
"runProof: dataset 'TestStdVect' not available!");
}
} else {
Printf(
"runProof: unknown tutorial: %s", what);
}
if (makePerfTree) {
SavePerfTree(proof, aPerfTree.Data());
}
}
void plotNtuple(
TProof *p,
const char *ds,
const char *ntptitle)
{
p->
DrawSelect(ds,
"1.3*px+2",
"(px^2+py^2>4) && py>0",
"same");
p->
DrawSelect(ds,
"pz:py:px",
"(pz<10 && pz>6)+(pz<4 && pz>3)");
p->
DrawSelect(ds,
"pz:py:px",
"pz<6 && pz>4",
"same");
p->
DrawSelect(ds,
"pz:py:px",
"pz<4 && pz>3",
"same");
l2->
AddText(
"You can interactively rotate this view in 2 ways:");
l2->
AddText(
" - With the RotateCube in clicking in this pad");
l2->
AddText(
" - Selecting View with x3d in the View menu");
}
void SavePerfTree(
TProof *proof,
const char *fn)
{
if (!proof) {
Printf(
"PROOF must be run to save output performance information");;
return;
}
Printf(
"PROOF outputlist undefined or empty");;
return;
}
Printf(
"ERROR: could not open file '%s' for writing", fn);;
} else {
while ((obj = nxo())) {
if (objname.BeginsWith("PROOF_")) {
if (objname == "PROOF_PerfStats" ||
objname == "PROOF_PacketsHist" ||
objname == "PROOF_EventsHist" ||
objname == "PROOF_NodeHist" ||
objname == "PROOF_LatencyHist" ||
objname == "PROOF_ProcTimeHist" ||
objname == "PROOF_CpuTimeHist")
obj->Write();
}
}
}
}