From a4777360a2faa8bc36013e9d816e5a6afccce4b7 Mon Sep 17 00:00:00 2001
From: Gerardo Ganis <Gerardo.Ganis@cern.ch>
Date: Mon, 29 Oct 2018 11:12:50 +0100
Subject: [PATCH] proof: remove deprecated PQ2 module

---
 man/man1/pq2-ana-dist.1        |  131 ----
 man/man1/pq2-cache.1           |   90 ---
 man/man1/pq2-info-server.1     |   84 ---
 man/man1/pq2-ls-files-server.1 |   90 ---
 man/man1/pq2-ls-files.1        |   84 ---
 man/man1/pq2-ls.1              |  112 ----
 man/man1/pq2-put.1             |  168 -----
 man/man1/pq2-redistribute.1    |   77 ---
 man/man1/pq2-rm.1              |   85 ---
 man/man1/pq2-verify.1          |  134 ----
 man/man1/pq2.1                 |  166 -----
 man/man1/setup-pq2.1           |  124 ----
 proof/CMakeLists.txt           |    1 -
 proof/pq2/CMakeLists.txt       |    7 -
 proof/pq2/src/pq2actions.cxx   | 1133 --------------------------------
 proof/pq2/src/pq2actions.h     |   34 -
 proof/pq2/src/pq2main.cxx      |  382 -----------
 proof/pq2/src/pq2ping.cxx      |  292 --------
 proof/pq2/src/pq2ping.h        |   30 -
 proof/pq2/src/pq2wrappers.cxx  |  290 --------
 proof/pq2/src/pq2wrappers.h    |   35 -
 proof/pq2/src/redirguard.cxx   |   20 -
 proof/pq2/src/redirguard.h     |   35 -
 23 files changed, 3604 deletions(-)
 delete mode 100644 man/man1/pq2-ana-dist.1
 delete mode 100644 man/man1/pq2-cache.1
 delete mode 100644 man/man1/pq2-info-server.1
 delete mode 100644 man/man1/pq2-ls-files-server.1
 delete mode 100644 man/man1/pq2-ls-files.1
 delete mode 100644 man/man1/pq2-ls.1
 delete mode 100644 man/man1/pq2-put.1
 delete mode 100644 man/man1/pq2-redistribute.1
 delete mode 100644 man/man1/pq2-rm.1
 delete mode 100644 man/man1/pq2-verify.1
 delete mode 100644 man/man1/pq2.1
 delete mode 100644 man/man1/setup-pq2.1
 delete mode 100644 proof/pq2/CMakeLists.txt
 delete mode 100644 proof/pq2/src/pq2actions.cxx
 delete mode 100644 proof/pq2/src/pq2actions.h
 delete mode 100644 proof/pq2/src/pq2main.cxx
 delete mode 100644 proof/pq2/src/pq2ping.cxx
 delete mode 100644 proof/pq2/src/pq2ping.h
 delete mode 100644 proof/pq2/src/pq2wrappers.cxx
 delete mode 100644 proof/pq2/src/pq2wrappers.h
 delete mode 100644 proof/pq2/src/redirguard.cxx
 delete mode 100644 proof/pq2/src/redirguard.h

diff --git a/man/man1/pq2-ana-dist.1 b/man/man1/pq2-ana-dist.1
deleted file mode 100644
index 035a61df1b2..00000000000
--- a/man/man1/pq2-ana-dist.1
+++ /dev/null
@@ -1,131 +0,0 @@
-.\"
-.\" $Id:$
-.\"
-.TH PQ2-ANA-DIST 1 "Version 5" "ROOT"
-.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
-.\" other parms are allowed: see man(7), man(1)
-.SH NOTA BENE
-.B The PQ2 tools are deprecated will be removed in ROOT v6.16/00.
-.PP
-Please contact the ROOT team at
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-in the unlikely event this change is disruptive for your workflow.
-.SH NAME
-pq2-ana-dist \- Analyse the file distribution of a dataset (or a set of datasets) from a dataset meta-repository based on ROOT files
-.SH SYNOPSIS
-.B pq2-ana-dist
-[options] datasets
-.SH "DESCRIPTION"
-This manual page documents briefly the
-.BR pq2-ana-dist
-program.
-.PP
-.B pq2-ana-dist
-is a script invoking the
-.B pq2
-ROOT application to analyse the file distribution of a dataset (or a set of datasets) over the file
-servers, either in terms of files or of file sizes. The output is a text file with the the file movements
-needed to make the file distribution even in the chosen metrics to be used, for example, as in input
-to \fIpq2-redistribute\fR(1). Optionally the internal objects can be saved so that they can be used as starting
-point for a subsequent run. An histogram and a plot can also be saved to visualize the file distribution.
-The repository with the dataset information can be accessed via the local file
-system or a remote file server daemon or a PROOF facility.
-.PP
-More details about the underlying 'pq2' application can be found in the man page \fIpq2\fR(1).
-.SH ARGUMENTS
-.TP
-\fIdatasets\fR
-Comma-separated list of datasets to be analysed; the '*' wild card in the items (in such a case the
-full string - as shown by pq2-ls - should be given in quotes, e.g. '/default/ganis/h1-set5*'.
-.SH OPTIONS
-.TP
-\fB-h\fR, \fB--help\fR
-Display help information.
-.TP
-\fB-k\fR, \fB--keep\fR
-Keep the temporary files created during the analysis under $TMPDIR
-.TP
-\fB-v\fR
-Verbose mode
-.TP
-\fB--dataset\fR=<\fIdatasets\fR>
-Alternative way to define the datasets to be analysed.
-.TP
-\fB-s\fR <\fIservers\fR>, \fB--servers\fR=<\fIservers\fR>
-Comma-separated list of servers to be used (-s) in the analysis; a '+' in front of the list adds the
-specified servers to the existing ones: this can be useful when determining file movements to empty or
-new servers
-.TP
-\fB-e\fR <\fIexcsrvs\fR>, \fB--exclude\fR=<\fIexcsrvs\fR>
-Comma-separated list of servers to be excluded from the target servers; this can be used, for example,
-to determine the files movements to drain a server.
-.TP
-\fB-i\fR <\fIignsrvs\fR>, \fB--ignore\fR=<\fIignsrvs\fR>
-Comma-separated list of servers to be ignored in the analysis; this can be used, for example, to skip
-the redirector.
-.TP
-\fB-m\fR <\fImetrics\fR>, \fB--metrics\fR=<\fImetrics\fR>
-Metrics to be used to calculate the degree of evenness:
-.nf
-    F          use the number of files (default)
-    S          use the file size
-.fi
-.TP
-\fB-f\fR <\fIfilemv\fR>, \fB--filemv\fR=<\fIfilemv\fR>
-Defines the file where to save the result of the analysis; by the default the result is send to the screen.
-The output contains one line per each file that needs to be moved with the format 'file source destination'
-where 'file' is the file name, 'source' is the source server URL and 'destination' is the destination server URL.
-The file can be used as input, for example, to \fIpq2-redistribute\fR(1).
-.TP
-\fB--plot\fR[=<\fIfileplot.fmt\fR>]
-Defines the file with the output plot with the original distribution with the server names and the +-10% limits; the extension (if known) defines the format; the default format is 'png' and the default name 'plot.png'.  The plot can  also  be  obtained  directly from a binary output file (saved with '--fout=<outfile>.root') but just specifying '--fin=<outfile>.root --plot'. The available formats are those known by ROOT: png (default), eps, ps, pdf, svg, gif, xpm, jpg, tiff.
-.TP
-\fB--fout\fR[=<\fIoutfile\fR>]
-Defines the file where to save the output of the analysis in binary form (ROOT file); this output can be
-used as starting point for a next run, allowing to run over many datasets in separate steps.
-.TP
-\fB--fin\fR[=<\fIinfile\fR>]
-Defines the ROOT file from where to fetch the output of a previous run (saved with --fout=infile).
-.TP
-\fB-u\fR <\fIserverurl\fR>, \fB--url\fR=<\fIserverurl\fR>
-URL of the PROOF master or data server providing the information; for data servers, it must include the directory.
-Can also be specified via the environment variables PQ2PROOFURL or PQ2DSSRVURL (see ENVIRONMENT VARIABLES)."
-.TP
-\fB-t\fR <\fIdir\fR>, \fB--tmpdir\fR=<\fIdir\fR>
-Directory for temporary files; default is /tmp/<username>.
-.SH FORMAT OF THE FILE WITH MOVE DIRECTIVES
-The out file consists of one line per file to be moved with the following format:
-.nf
-
-file-name       source-server-URL       destination-server-URL
-.fi
-.SH "ENVIRONMENT VARIABLES"
-See \fIsetup-pq2\fR(1).
-.SH "SEE ALSO"
-\fIpq2\fR(1), \fIsetup-pq2\fR(1), \fIpq2-ls\fR(1), \fIpq2-ls-files\fR(1),
-\fIpq2-ls-files-server\fR(1), \fIpq2-info-server\fR(1),
-\fIpq2-redistribute\fR(1), \fIpq2-verify\fR(1), \fIpq2-rm\fR(1), \fIpq2-cache\fR(1)
-.PP
-For more information on the \fBROOT\fR system, please refer to
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-.UE
-.SH "ORIGINAL AUTHORS"
-Gerardo Ganis for the ROOT team.
-.SH "COPYRIGHT"
-This library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-.P
-This library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-.P
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-.SH AUTHOR
-This manual page was originally written by Gerardo Ganis <gerardo.ganis@cern.ch>, for ROOT version 5.
diff --git a/man/man1/pq2-cache.1 b/man/man1/pq2-cache.1
deleted file mode 100644
index f34aa090e23..00000000000
--- a/man/man1/pq2-cache.1
+++ /dev/null
@@ -1,90 +0,0 @@
-.\"
-.\" $Id:$
-.\"
-.TH PQ2-CACHE 1 "Version 5" "ROOT"
-.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
-.\" other parms are allowed: see man(7), man(1)
-.SH NOTA BENE
-.B The PQ2 tools are deprecated and will be removed in ROOT v6.16/00.
-.PP
-Please contact the ROOT team at
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-in the unlikely event this change is disruptive for your workflow.
-.SH NAME
-pq2-cache \- display or clear the local cache content of a remote dataset meta-repository based on ROOT files
-.SH SYNOPSIS
-.B pq2-cache
-[action] [options] [datasets]
-.SH "DESCRIPTION"
-This manual page documents briefly the
-.BR pq2-cache
-program.
-.PP
-.B pq2-cache
-is a script invoking the
-.B pq2
-ROOT application to display or clear the local cache content of a remote dataset meta-repository based on ROOT files;
-the repository can be accessed via a remote file server daemon.
-.PP
-More details about the underlying 'pq2' application can be found in the man page \fIpq2\fR(1).
-.SH ACTIONS
-.TP
-\fIshow\fR
-Display cache content (default)
-.TP
-\fIclear\fR
-Clear cache content
-.SH ARGUMENTS
-.TP
-\fIdatasets\fR
-Datasets to processed; wildcards are supported.
-.SH OPTIONS
-.TP
-\fB-h\fR, \fB--help\fR
-Display help information.
-.TP
-\fB-k\fR, \fB--keep\fR
-Keep the temporary files created during the analysis under $TMPDIR
-.TP
-\fB-v\fR
-Verbose mode
-.TP
-\fB--dataset\fR=<\fIdataset\fR>
-Alternative way to define the datasets to be removed.
-.TP
-\fB-u\fR <\fIserverurl\fR>, \fB--url\fR=<\fIserverurl\fR>
-URL of the data server providing the information; it must include the directory.
-Can also be specified via the environment variables PQ2DSSRVURL (see ENVIRONMENT VARIABLES)."
-.TP
-\fB-t\fR <\fIdir\fR>, \fB--tmpdir\fR=<\fIdir\fR>
-Directory for temporary files; default is /tmp/<username>.
-.SH "ENVIRONMENT VARIABLES"
-See \fIsetup-pq2\fR(1).
-.SH "SEE ALSO"
-\fIpq2\fR(1), \fIsetup-pq2\fR(1), \fIpq2-ls\fR(1), \fIpq2-ls-files\fR(1),
-\fIpq2-ls-files-server\fR(1), \fIpq2-info-server\fR(1),
-\fIpq2-ana-dist\fR(1), \fIpq2-put\fR(1), \fIpq2-verify\fR(1), \fIpq2-rm\fR(1)
-.PP
-For more information on the \fBROOT\fR system, please refer to
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-.UE
-.SH "ORIGINAL AUTHORS"
-Gerardo Ganis for the ROOT team.
-.SH "COPYRIGHT"
-This library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-.P
-This library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-.P
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-.SH AUTHOR
-This manual page was originally written by Gerardo Ganis <gerardo.ganis@cern.ch>, for ROOT version 5.
diff --git a/man/man1/pq2-info-server.1 b/man/man1/pq2-info-server.1
deleted file mode 100644
index ef89b5e239d..00000000000
--- a/man/man1/pq2-info-server.1
+++ /dev/null
@@ -1,84 +0,0 @@
-.\"
-.\" $Id:$
-.\"
-.TH PQ2-INFO-SERVER 1 "Version 5" "ROOT"
-.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
-.\" other parms are allowed: see man(7), man(1)
-.SH NOTA BENE
-.B The PQ2 tools are deprecated and will be removed in ROOT v6.16/00.
-.PP
-Please contact the ROOT team at
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-in the unlikely event this change is disruptive for your workflow.
-.SH NAME
-pq2-info-server \- Display info about the datasets on a given server from a dataset meta-repository based on ROOT files
-.SH SYNOPSIS
-.B pq2-info-server
-[options] server
-.SH "DESCRIPTION"
-This manual page documents briefly the
-.BR pq2-info-server
-program.
-.PP
-.B pq2-info-server
-is a script invoking the
-.B pq2
-ROOT application to display info about the datasets on a given server
-from a dataset meta-repository based on ROOT files; the repository can be accessed via the local file
-system or a remote file server daemon or a PROOF facility.
-.PP
-More details about the underlying 'pq2' application can be found in the man page \fIpq2\fR(1).
-.SH ARGUMENTS
-.TP
-\fIserver\fR
-Server for which the information is wanted.
-.SH OPTIONS
-.TP
-\fB-h\fR, \fB--help\fR
-Display help information.
-.TP
-\fB-k\fR, \fB--keep\fR
-Keep the temporary files created during the analysis under $TMPDIR
-.TP
-\fB-v\fR
-Verbose mode
-.TP
-\fB--server\fR=<\fIserver\fR>
-Alternative way to define the server.
-.TP
-\fB-u\fR <\fIserverurl\fR>, \fB--url\fR=<\fIserverurl\fR>
-URL of the PROOF master or data server providing the information; for data servers, it must include the directory.
-Can also be specified via the environment variables PQ2PROOFURL or PQ2DSSRVURL (see ENVIRONMENT VARIABLES)."
-.TP
-\fB-t\fR <\fIdir\fR>, \fB--tmpdir\fR=<\fIdir\fR>
-Directory for temporary files; default is /tmp/<username>.
-.SH "ENVIRONMENT VARIABLES"
-See \fIsetup-pq2\fR(1).
-.SH "SEE ALSO"
-\fIpq2\fR(1), \fIsetup-pq2\fR(1), \fIpq2-ls\fR(1), \fIpq2-ls-files\fR(1),
-\fIpq2-ls-files-server\fR(1), \fIpq2-ana-dist\fR(1),
-\fIpq2-put\fR(1), \fIpq2-verify\fR(1), \fIpq2-rm\fR(1), \fIpq2-cache\fR(1)
-.PP
-For more information on the \fBROOT\fR system, please refer to
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-.UE
-.SH "ORIGINAL AUTHORS"
-Gerardo Ganis for the ROOT team.
-.SH "COPYRIGHT"
-This library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-.P
-This library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-.P
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-.SH AUTHOR
-This manual page was originally written by Gerardo Ganis <gerardo.ganis@cern.ch>, for ROOT version 5.
diff --git a/man/man1/pq2-ls-files-server.1 b/man/man1/pq2-ls-files-server.1
deleted file mode 100644
index 6177e54ad1e..00000000000
--- a/man/man1/pq2-ls-files-server.1
+++ /dev/null
@@ -1,90 +0,0 @@
-.\"
-.\" $Id:$
-.\"
-.TH PQ2-LS-FILES-SERVER 1 "Version 5" "ROOT"
-.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
-.\" other parms are allowed: see man(7), man(1)
-.SH NOTA BENE
-.B The PQ2 tools are deprecated and will be removed in ROOT v6.16/00.
-.PP
-Please contact the ROOT team at
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-in the unlikely event this change is disruptive for your workflow.
-.SH NAME
-pq2-ls-files-server \- List the file content of a dataset on a given server from a dataset meta-repository based on ROOT files
-.SH SYNOPSIS
-.B pq2-ls-files-server
-[options] -s servers dataset
-.SH "DESCRIPTION"
-This manual page documents briefly the
-.BR pq2-ls-files-server
-program.
-.PP
-.B pq2-ls-files-server
-is a script invoking the
-.B pq2
-ROOT application to list the file content of a dataset on a given server or list of servers from
-a dataset meta-repository based on ROOT files; the repository can be accessed via the local file
-system or a remote file server daemon or a PROOF facility.
-.PP
-More details about the underlying 'pq2' application can be found in the man page \fIpq2\fR(1).
-.SH ARGUMENTS
-.TP
-\fIdataset\fR
-The dataset whose files are to be listed.
-.TP
-\fB-s\fR \fIservers\fR
-Comma-separated list of servers for which the information is wanted.
-.SH OPTIONS
-.TP
-\fB-h\fR, \fB--help\fR
-Display help information.
-.TP
-\fB-k\fR, \fB--keep\fR
-Keep the temporary files created during the analysis under $TMPDIR
-.TP
-\fB-v\fR
-Verbose mode
-.TP
-\fB-d\fR <\fIdatasets\fR>, \fB--dataset=\fR<\fIdatasets\fR>
-Alternative way to define the dataset to be analysed.
-.TP
-\fB--server\fR=<\fIservers\fR>
-Alternative way to define the list of servers for which the information is wanted.
-.TP
-\fB-u\fR <\fIserverurl\fR>, \fB--url\fR=<\fIserverurl\fR>
-URL of the PROOF master or data server providing the information; for data servers, it must include the directory.
-Can also be specified via the environment variables PQ2PROOFURL or PQ2DSSRVURL (see ENVIRONMENT VARIABLES)."
-.TP
-\fB-t\fR <\fIdir\fR>, \fB--tmpdir\fR=<\fIdir\fR>
-Directory for temporary files; default is /tmp/<username>.
-.SH "ENVIRONMENT VARIABLES"
-See \fIsetup-pq2\fR(1).
-.SH "SEE ALSO"
-\fIpq2\fR(1), \fIsetup-pq2\fR(1), \fIpq2-ls\fR(1), \fIpq2-ls-files\fR(1),
-\fIpq2-info-server\fR(1), \fIpq2-ana-dist\fR(1),
-\fIpq2-put\fR(1), \fIpq2-verify\fR(1), \fIpq2-rm\fR(1), \fIpq2-cache\fR(1)
-.PP
-For more information on the \fBROOT\fR system, please refer to
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-.UE
-.SH "ORIGINAL AUTHORS"
-Gerardo Ganis for the ROOT team.
-.SH "COPYRIGHT"
-This library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-.P
-This library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-.P
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-.SH AUTHOR
-This manual page was originally written by Gerardo Ganis <gerardo.ganis@cern.ch>, for ROOT version 5.
diff --git a/man/man1/pq2-ls-files.1 b/man/man1/pq2-ls-files.1
deleted file mode 100644
index 3674ee2caab..00000000000
--- a/man/man1/pq2-ls-files.1
+++ /dev/null
@@ -1,84 +0,0 @@
-.\"
-.\" $Id:$
-.\"
-.TH PQ2-LS-FILES 1 "Version 5" "ROOT"
-.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
-.\" other parms are allowed: see man(7), man(1)
-.SH NOTA BENE
-.B The PQ2 tools are deprecated and will be removed in ROOT v6.16/00.
-.PP
-Please contact the ROOT team at
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-in the unlikely event this change is disruptive for your workflow.
-.SH NAME
-pq2-ls-files \- List the file content of a dataset from a dataset meta-repository based on ROOT files
-.SH SYNOPSIS
-.B pq2-ls
-[options] dataset
-.SH "DESCRIPTION"
-This manual page documents briefly the
-.BR pq2-ls-files
-program.
-.PP
-.B pq2-ls-files
-is a script invoking the
-.B pq2
-ROOT application to list the file content of a dataset from a dataset meta-repository based on ROOT files;
-the repository can be accessed via the local file
-system or a remote file server daemon or a PROOF facility.
-.PP
-More details about the underlying 'pq2' application can be found in the man page \fIpq2\fR(1).
-.SH ARGUMENTS
-.TP
-\fIdataset\fR
-The dataset whose files are to be listed.
-.SH OPTIONS
-.TP
-\fB-h\fR, \fB--help\fR
-Display help information.
-.TP
-\fB-k\fR, \fB--keep\fR
-Keep the temporary files created during the analysis under $TMPDIR
-.TP
-\fB-v\fR
-Verbose mode
-.TP
-\fB-d\fR <\fIdataset\fR>, \fB--dataset\fR=<\fIdataset\fR>
-Alternative way to define the dataset or the datasets to be listed.
-.TP
-\fB-u\fR <\fIserverurl\fR>, \fB--url\fR=<\fIserverurl\fR>
-URL of the PROOF master or data server providing the information; for data servers, it must include the directory.
-Can also be specified via the environment variables PQ2PROOFURL or PQ2DSSRVURL (see ENVIRONMENT VARIABLES)."
-.TP
-\fB-t\fR <\fIdir\fR>, \fB--tmpdir\fR=<\fIdir\fR>
-Directory for temporary files; default is /tmp/<username>.
-.SH "ENVIRONMENT VARIABLES"
-See \fIsetup-pq2\fR(1).
-.SH "SEE ALSO"
-\fIpq2\fR(1), \fIsetup-pq2\fR(1), \fIpq2-ls\fR(1), \fIpq2-ls-files-server\fR(1),
-\fIpq2-info-server\fR(1), \fIpq2-ana-dist\fR(1),
-\fIpq2-put\fR(1), \fIpq2-verify\fR(1), \fIpq2-rm\fR(1), \fIpq2-cache\fR(1)
-.PP
-For more information on the \fBROOT\fR system, please refer to
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-.UE
-.SH "ORIGINAL AUTHORS"
-Gerardo Ganis for the ROOT team.
-.SH "COPYRIGHT"
-This library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-.P
-This library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-.P
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-.SH AUTHOR
-This manual page was originally written by Gerardo Ganis <gerardo.ganis@cern.ch>, for ROOT version 5.
diff --git a/man/man1/pq2-ls.1 b/man/man1/pq2-ls.1
deleted file mode 100644
index 2c99d8ec077..00000000000
--- a/man/man1/pq2-ls.1
+++ /dev/null
@@ -1,112 +0,0 @@
-.\"
-.\" $Id:$
-.\"
-.TH PQ2-LS 1 "Version 5" "ROOT"
-.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
-.\" other parms are allowed: see man(7), man(1)
-.SH NOTA BENE
-.B The PQ2 tools are deprecated and will be removed in ROOT v6.16/00.
-.PP
-Please contact the ROOT team at
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-in the unlikely event this change is disruptive for your workflow.
-.SH NAME
-pq2-ls \- List the available datasets in a dataset meta-repository based on ROOT files
-.SH SYNOPSIS
-.B pq2-ls
-[options] [datasets]
-.SH "DESCRIPTION"
-This manual page documents briefly the
-.BR pq2-ls
-program.
-.PP
-.B pq2-ls
-is a script invoking the
-.B pq2
-ROOT application to list the available datasets in a dataset meta-repository based on ROOT files;
-the repository can be accessed via the local file
-system or a remote file server daemon or a PROOF facility.
-.PP
-More details about the underlying 'pq2' application can be found in the man page \fIpq2\fR(1).
-.SH ARGUMENTS
-.TP
-\fIdatasets\fR
-The dataset or the datasets to be listed; the wildcards '*' is supported. By default, all the datasets
-in the repository are listed.
-.SH OPTIONS
-.TP
-\fB-h\fR, \fB--help\fR
-Display help information.
-.TP
-\fB-k\fR, \fB--keep\fR
-Keep the temporary files created during the analysis under $TMPDIR
-.TP
-\fB-v\fR
-Verbose mode
-.TP
-\fB--forcescan\fR
-Force opening of the datasets are open to get the information; by default the pre-processed information is used, if any.
-.TP
-\fB--noupdate\fR
-In the case a cache is used, do not update the cache (may be slow on some servers).
-.TP
-\fB--refresh\fR
-Refresh the information (requires appropriate credentials; typically it can be done only for owned datasets).
-.TP
-\fB-d\fR <\fIdataset\fR>, \fB--dataset\fR=<\fIdataset\fR>
-Alternative way to define the dataset or the datasets to be listed.
-.TP
-\fB-u\fR <\fIserverurl\fR>, \fB--url\fR=<\fIserverurl\fR>
-URL of the PROOF master or data server providing the information; for data servers, it must include the directory.
-Can also be specified via the environment variables PQ2PROOFURL or PQ2DSSRVURL (see ENVIRONMENT VARIABLES)."
-.TP
-\fB-t\fR <\fIdir\fR>, \fB--tmpdir\fR=<\fIdir\fR>
-Directory for temporary files; default is /tmp/<username>.
-.SH "FORMAT OF THE OUTPUT"
-The information printed by pq2-ls has the following format:
-.nf
-
-/group/user/dsname                        | # files |  /<def-tree> | # evts   | size     | staged fraction
-
-.fi
-for example
-.nf
-
-Dataset URI                               | # Files | Default tree | # Events |   Disk   | Staged
-/PWG2/akisiel/Therminator_c2030           |     952 | /esdTree     |      927 |     4 GB |   97 %
-
-.fi
-
-The space reserved for the default tree name is 14 characters: for longer names the last character is substituted
-with a '>'.
-
-.SH "ENVIRONMENT VARIABLES"
-See \fIsetup-pq2\fR(1).
-.SH "SEE ALSO"
-\fIpq2\fR(1), \fIsetup-pq2\fR(1), \fIpq2-ls-files\fR(1), \fIpq2-ls-files-server\fR(1),
-\fIpq2-info-server\fR(1), \fIpq2-ana-dist\fR(1),
-\fIpq2-put\fR(1), \fIpq2-verify\fR(1), \fIpq2-rm\fR(1), \fIpq2-cache\fR(1)
-.PP
-For more information on the \fBROOT\fR system, please refer to
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-.UE
-.SH "ORIGINAL AUTHORS"
-Gerardo Ganis for the ROOT team.
-.SH "COPYRIGHT"
-This library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-.P
-This library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-.P
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-.SH AUTHOR
-This manual page was originally written by Gerardo Ganis <gerardo.ganis@cern.ch>, for ROOT version 5.
diff --git a/man/man1/pq2-put.1 b/man/man1/pq2-put.1
deleted file mode 100644
index d511f04079d..00000000000
--- a/man/man1/pq2-put.1
+++ /dev/null
@@ -1,168 +0,0 @@
-.\"
-.\" $Id:$
-.\"
-.TH PQ2-PUT 1 "Version 5" "ROOT"
-.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
-.\" other parms are allowed: see man(7), man(1)
-.SH NOTA BENE
-.B The PQ2 tools are deprecated and will be removed in ROOT v6.16/00.
-.PP
-Please contact the ROOT team at
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-in the unlikely event this change is disruptive for your workflow.
-.SH NAME
-pq2-put \- Register one or more datasets in a dataset meta-repository based on ROOT files
-.SH SYNOPSIS
-.B pq2-put
-[options] datasetfile
-.SH "DESCRIPTION"
-This manual page documents briefly the
-.BR pq2-put
-program.
-.PP
-.B pq2-put
-is a script invoking the
-.B pq2
-ROOT application to register one or more datasets in a dataset meta-repository based on ROOT files;
-the repository can be accessed via the local file
-system or a remote file server daemon or a PROOF facility.
-.PP
-More details about the underlying 'pq2' application can be found in the man page \fIpq2\fR(1).
-.SH ARGUMENTS
-.TP
-\fIdatasetfile\fR
-Path to the file with the list of files in the dataset or directory with the files containing the
-file lists of the datasets to be registered; in the first case wildcards '*' can be specified in
-the file name, i.e. '<dir>/fil*' is ok but '<dir>/*/file' is not. In all cases the name of the
-dataset is the name of the file finally used. The format of the file is described below.
-.SH OPTIONS
-.TP
-\fB-h\fR, \fB--help\fR
-Display help information.
-.TP
-\fB-k\fR, \fB--keep\fR
-Keep the temporary files created during the analysis under $TMPDIR
-.TP
-\fB-v\fR
-Verbose mode
-.TP
-\fB-d\fR <\fIdatasetfile\fR>, \fB--dataset\fR <\fIdatasetfile\fR>
-Alternative way to define path to the file with the list of files.
-.TP
-\fB-o\fR <\fIoptions\fR>
-Options for registering datasets; a combination of:
-.nf
-     O   overwrite existing dataset
-     U   add information to existing dataset, if any or create a new one
-     T   Trust the information already present in the dataset
-     V   verify (scan) information in the dataset (can be very slow)
-.fi
-.TP
-\fB--overwrite\fR
-Alternative to '-o O'.
-.TP
-\fB--update\fR
-Alternative to '-o U'.
-.TP
-\fB--trust\fR
-Alternative to '-o T'.
-.TP
-\fB--tree=\fR<\fIdefault-tree-name\fR>
-Set the name of the default tree name to 'default-tree-name' (option 'T' or --trust only); this
-allows to skip the tree name specification during Process when more TTree (or derivative) objects
-are available in the files.
-.TP
-\fB--staged\fR
-Assume all files online or staged (option 'T' or --trust only).
-.TP
-\fB-u\fR <\fIserverurl\fR>, \fB--url\fR=<\fIserverurl\fR>
-URL of the PROOF master or data server providing the information; for data servers, it must include the directory.
-Can also be specified via the environment variables PQ2PROOFURL or PQ2DSSRVURL (see ENVIRONMENT VARIABLES)."
-.TP
-\fB-t\fR <\fIdir\fR>, \fB--tmpdir\fR=<\fIdir\fR>
-Directory for temporary files; default is /tmp/<username>.
-.SH "FORMAT OF THE FILES"
-The name of the file defining the dataset is the name of the dataset.
-The files must contain one line per each file in the dataset with the full file URL.
-If available, additional information can be specified on the same line with the following keywords:
-.nf
-
-   sz:<size>                            size of the file in bytes
-   md5:<md5_ascii>                      MD5 sum of the file in ASCII form
-   uuid:<uuid>                          UUID of the file
-   tree:<name>,<entries>,<first>,<last> meta-information about a tree in the file; the should be in the form
-                                        <subdir>/tree-name;'entries' is the number of entries in the tree;
-                                        'first' and 'last' define the entry range.
-   obj:<name>,<class>,<entries>         meta-information about a generic object in the file; the should be in
-                                        the form <subdir>/obj-name; 'class' is the object class; 'entries' is
-                                        the number of occurrences for this object.
-.fi
-Multiple occurrences of 'tree:' or 'obj:' can be specified.
-.SH "EXAMPLES"
-The following examples show how to register information corresponding to the H1 example of the ROOT
-tutorials.
-.TP
-\fBMinimal information\fR
-In this example the files are read from the ROOT HTTP server. Detailed information about the content of the
-files is not available, so only the URLs are given. If the file is called h1-http, we get
-.nf
-
-   $ cat h1-http
-   http://root.cern.ch/files/h1/dstarmb.root
-   http://root.cern.ch/files/h1/dstarp1a.root
-   http://root.cern.ch/files/h1/dstarp1b.root
-   http://root.cern.ch/files/h1/dstarp2.root
-.fi
-
-The dataset is registered and verification required:
-.nf
-   $ pq2-put -o "V" h1-http
-   pq2-put: 1 dataset(s) registered
-.fi
-.TP
-\fBFull information\fR
-In this example the files are read from the local /data/h1 directory.
-Detailed information about the content of the files is available. If the file is called h1-local, we get
-.nf
-   $ cat h1-local
-   file:/data/h1/dstarmb.root  sz:21330730 md5:0a60055370e16d954f90fb50c2d1a801 tree:h42,21920,0,-1
-   file:/data/h1/dstarp1a.root md5:e2f959b15235214be3c973c3e7a9ff2c sz:71464503 tree:h42,73243
-   file:/data/h1/dstarp1b.root md5:169ea4799661696a25e73257fe8a833d sz:83827959 tree:h42,85597
-   file:/data/h1/dstarp2.root md5:907d10b401a35c0240cfa76bedc31420 sz:100675234 tree:h42,103053
-.fi
-
-The dataset is registered trusting the passed information:
-.nf
-   $ pq2-put -o T --tree=h42 --staged h1-local
-   pq2-put: 1 dataset(s) registered
-.fi
-.SH "ENVIRONMENT VARIABLES"
-See \fIsetup-pq2\fR(1).
-.SH "SEE ALSO"
-\fIpq2\fR(1), \fIsetup-pq2\fR(1), \fIpq2-ls\fR(1), \fIpq2-ls-files\fR(1),
-\fIpq2-ls-files-server\fR(1), \fIpq2-info-server\fR(1),
-\fIpq2-ana-dist\fR(1), \fIpq2-verify\fR(1), \fIpq2-rm\fR(1), \fIpq2-cache\fR(1)
-.PP
-For more information on the \fBROOT\fR system, please refer to
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-.UE
-.SH "ORIGINAL AUTHORS"
-Gerardo Ganis for the ROOT team.
-.SH "COPYRIGHT"
-This library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-.P
-This library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-.P
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-.SH AUTHOR
-This manual page was originally written by Gerardo Ganis <gerardo.ganis@cern.ch>, for ROOT version 5.
diff --git a/man/man1/pq2-redistribute.1 b/man/man1/pq2-redistribute.1
deleted file mode 100644
index 512bc9cc7b2..00000000000
--- a/man/man1/pq2-redistribute.1
+++ /dev/null
@@ -1,77 +0,0 @@
-.\"
-.\" $Id:$
-.\"
-.TH PQ2-REDISTRIBUTE 1 "Version 5" "ROOT"
-.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
-.\" other parms are allowed: see man(7), man(1)
-.SH NOTA BENE
-.B The PQ2 tools are deprecated and will be removed in ROOT v6.16/00.
-.PP
-Please contact the ROOT team at
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-in the unlikely event this change is disruptive for your workflow.
-.SH NAME
-pq2-redistribute \- Execute the file movements as determined by pq2-ana-dist
-.SH SYNOPSIS
-.B pq2-redistribute
-[-b backend] -f filemv
-.SH "DESCRIPTION"
-This manual page documents briefly the
-.BR pq2-redistribute
-program.
-.PP
-.B pq2-redistribute
-is a script executing the file movements as determined by \fIpq2-ana-dist\fR(1) using the specified backend.
-Currently only the XROOTD backend is supported (tag 'xrd'; default).
-.PP
-More details about the input file can be found in the man page \fIpq2-ana-dist\fR(1).
-.SH OPTIONS
-.TP
-\fB-h\fR, \fB--help\fR
-Display help information.
-.TP
-\fB--dryrun\fR
-Only show the action that should be done (don't execute them).
-.TP
-\fB-b\fR <\fIbackend\fR>
-Tag identifying the backend to be used. Currently only 'xrd' (for XROOTD) is supported.
-.TP
-\fB-f\fR <\fIfilemv\fR>
-File with the file movement directives produced by pq2-ana-dist .
-.TP
-\fB-r\fR <\fIredirurl\fR>, \fB--redir\fR=<\fIredirurl\fR>
-URL of the redirector from where the files should be copied and deleted.
-.TP
-\fB-t\fR <\fIdir\fR>, \fB--tmpdir\fR=<\fIdir\fR>
-Directory for temporary files; default is /tmp/<username>. This is used to store temporary copies of the
-files during transfers.
-.SH "ENVIRONMENT VARIABLES"
-See \fIsetup-pq2\fR(1).
-.SH "SEE ALSO"
-\fIpq2\fR(1), \fIpq2-ls\fR(1), \fIpq2-ls-files\fR(1), \fIpq2-ls-files-server\fR(1),
-\fIpq2-info-server\fR(1), \fIpq2-ana-dist\fR(1),
-\fIpq2-put\fR(1), \fIpq2-verify\fR(1), \fIpq2-rm\fR(1), \fIpq2-cache\fR(1)
-.PP
-For more information on the \fBROOT\fR system, please refer to
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-.UE
-.SH "ORIGINAL AUTHORS"
-Gerardo Ganis for the ROOT team.
-.SH "COPYRIGHT"
-This library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-.P
-This library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-.P
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-.SH AUTHOR
-This manual page was originally written by Gerardo Ganis <gerardo.ganis@cern.ch>, for ROOT version 5.
diff --git a/man/man1/pq2-rm.1 b/man/man1/pq2-rm.1
deleted file mode 100644
index 2039217a62d..00000000000
--- a/man/man1/pq2-rm.1
+++ /dev/null
@@ -1,85 +0,0 @@
-.\"
-.\" $Id:$
-.\"
-.TH PQ2-RM 1 "Version 5" "ROOT"
-.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
-.\" other parms are allowed: see man(7), man(1)
-.SH NOTA BENE
-.B The PQ2 tools are deprecated and will be removed in ROOT v6.16/00.
-.PP
-Please contact the ROOT team at
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-in the unlikely event this change is disruptive for your workflow.
-.SH NAME
-pq2-rm \- Remove one or more datasets from a dataset meta-repository based on ROOT files
-.SH SYNOPSIS
-.B pq2-rm
-[options] dataset
-.SH "DESCRIPTION"
-This manual page documents briefly the
-.BR pq2-rm
-program.
-.PP
-.B pq2-rm
-is a script invoking the
-.B pq2
-ROOT application to remove one or more datasets from a dataset meta-repository based on ROOT files;
-the repository can be accessed via the local file
-system or a remote file server daemon or a PROOF facility.
-.PP
-More details about the underlying 'pq2' application can be found in the man page \fIpq2\fR(1).
-.SH ARGUMENTS
-.TP
-\fIdataset\fR
-Datasets to be removed; the '*' wild card in the items (in such a case the full string, as shown by pq2-ls,
-should be given, e.g. '/default/ganis/h1-set5*'.
-.SH OPTIONS
-.TP
-\fB-h\fR, \fB--help\fR
-Display help information.
-.TP
-\fB-k\fR, \fB--keep\fR
-Keep the temporary files created during the analysis under $TMPDIR
-.TP
-\fB-v\fR
-Verbose mode
-.TP
-\fB-d\fR <\fIdataset\fR>, \fB--dataset\fR=<\fIdataset\fR>
-Alternative way to define the datasets to be removed.
-.TP
-\fB-u\fR <\fIserverurl\fR>, \fB--url\fR=<\fIserverurl\fR>
-URL of the PROOF master or data server providing the information; for data servers, it must include the directory.
-Can also be specified via the environment variables PQ2PROOFURL or PQ2DSSRVURL (see ENVIRONMENT VARIABLES)."
-.TP
-\fB-t\fR <\fIdir\fR>, \fB--tmpdir\fR=<\fIdir\fR>
-Directory for temporary files; default is /tmp/<username>.
-.SH "ENVIRONMENT VARIABLES"
-See \fIsetup-pq2\fR(1).
-.SH "SEE ALSO"
-\fIpq2\fR(1), \fIsetup-pq2\fR(1), \fIpq2-ls\fR(1), \fIpq2-ls-files\fR(1),
-\fIpq2-ls-files-server\fR(1), \fIpq2-info-server\fR(1),
-\fIpq2-ana-dist\fR(1), \fIpq2-put\fR(1), \fIpq2-verify\fR(1), \fIpq2-cache\fR(1)
-.PP
-For more information on the \fBROOT\fR system, please refer to
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-.UE
-.SH "ORIGINAL AUTHORS"
-Gerardo Ganis for the ROOT team.
-.SH "COPYRIGHT"
-This library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-.P
-This library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-.P
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-.SH AUTHOR
-This manual page was originally written by Gerardo Ganis <gerardo.ganis@cern.ch>, for ROOT version 5.
diff --git a/man/man1/pq2-verify.1 b/man/man1/pq2-verify.1
deleted file mode 100644
index 8a111adf6b5..00000000000
--- a/man/man1/pq2-verify.1
+++ /dev/null
@@ -1,134 +0,0 @@
-.\"
-.\" $Id:$
-.\"
-.TH PQ2-VERIFY 1 "Version 5" "ROOT"
-.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
-.\" other parms are allowed: see man(7), man(1)
-.SH NOTA BENE
-.B The PQ2 tools are deprecated and will be removed in ROOT v6.16/00.
-.PP
-Please contact the ROOT team at
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-in the unlikely event this change is disruptive for your workflow.
-.SH NAME
-pq2-verify \- Extract the content one or more datasets from a dataset meta-repository based on ROOT files
-.SH SYNOPSIS
-.B pq2-verify
-[options] dataset
-.SH "DESCRIPTION"
-This manual page documents briefly the
-.BR pq2-verify
-program.
-.PP
-.B pq2-verify
-is a script invoking the
-.B pq2
-ROOT application to extract the content one or more datasets from a dataset meta-repository based on ROOT files;
-the repository can be accessed via the local file
-system or a remote file server daemon or a PROOF facility.
-.PP
-More details about the underlying 'pq2' application can be found in the man page \fIpq2\fR(1).
-.SH ARGUMENTS
-.TP
-\fIdataset\fR
-Datasets to be analysed; the '*' wild card in the items (in such a case the full string, as shown by pq2-ls,
-should be given, e.g. '/default/ganis/h1-set5*'.
-.SH OPTIONS
-.TP
-\fB-h\fR, \fB--help\fR
-Display help information.
-.TP
-\fB-k\fR, \fB--keep\fR
-Keep the temporary files created during the analysis under $TMPDIR
-.TP
-\fB-v\fR
-Verbose mode
-.TP
-\fB-d\fR <\fIdataset\fR>, \fB--dataset\fR=<\fIdataset\fR>
-Alternative way to define the datasets to be analyzed
-.TP
-\fB-o\fR <\fIoptions\fR>
-Options for verifying datasets. These allow to control: the subset selection; the pre-processing actions;
-and the processing action.
-.nf
-
-   Options controlling the file sample:
-      A               process all files
-      D               process only files marked as staged ('on Disk') (if 'A' is not specified the default
-                      is to process only files marked as non-staged)
-
-   Options controlling the pre-processing actions done on the selected sample or the complementary:
-      O               open the files marked as staged when processing only files marked as non-staged
-      T               open and touch the files marked as staged when processing only files marked as non-staged
-      I               do not check the actual stage status on selected files (by default the stage status
-                      is checked)
-
-   Options controlling the action performed on the selected files:
-      N               do nothing
-      P               open the selected files and extract the meta information
-      L               only locate the selected files
-      S               issue a stage request for the selected files not yet staged
-
-   Miscellanea
-      V               notify the actions
-
-.fi
-Not all the combinations of the above options are allowed; an error is printed when an inconsistency is found.
-.TP
-\fB--redir\fR=<\fIredirector\fR
-URL to be used to relocate the files.
-.TP
-\fB-u\fR <\fIserverurl\fR>, \fB--url\fR=<\fIserverurl\fR>
-URL of the PROOF master or data server providing the information; for data servers, it must include the directory.
-Can also be specified via the environment variables PQ2PROOFURL or PQ2DSSRVURL (see ENVIRONMENT VARIABLES)."
-.TP
-\fB-t\fR <\fIdir\fR>, \fB--tmpdir\fR=<\fIdir\fR>
-Directory for temporary files; default is /tmp/<username>.
-.SH "RETURN"
-The pq2-verify script returns -1 if any error occurs (connection failed; dataset does not exists) and >=0 in
-case of success. A return code of 1 indicates that some of the files in the dataset are not yet online (staged);
-this can be used to trigger automatic retries in scripts while waiting for stage-in operations.
-.SH "EXAMPLES"
-.TP
-1. Update the 'is-staged' bit for all the files in a dataset
-.nf
-
-   $ pq2-verify -o "AN" /default/pippo/mydset
-.fi
-.TP
-2. Issue a locate request for all the files in a dataset
-.nf
-
-   $ pq2-verify -o "AL" /default/pippo/mydset
-.fi
-
-.SH "ENVIRONMENT VARIABLES"
-See \fIsetup-pq2\fR(1).
-.SH "SEE ALSO"
-\fIpq2\fR(1), \fIsetup-pq2\fR(1), \fIpq2-ls\fR(1), \fIpq2-ls-files\fR(1),
-\fIpq2-ls-files-server\fR(1), \fIpq2-info-server\fR(1),
-\fIpq2-ana-dist\fR(1), \fIpq2-put\fR(1), \fIpq2-rm\fR(1), \fIpq2-cache\fR(1)
-.PP
-For more information on the \fBROOT\fR system, please refer to
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-.UE
-.SH "ORIGINAL AUTHORS"
-Gerardo Ganis for the ROOT team.
-.SH "COPYRIGHT"
-This library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-.P
-This library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-.P
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-.SH AUTHOR
-This manual page was originally written by Gerardo Ganis <gerardo.ganis@cern.ch>, for ROOT version 5.
diff --git a/man/man1/pq2.1 b/man/man1/pq2.1
deleted file mode 100644
index 31a10fe5bfd..00000000000
--- a/man/man1/pq2.1
+++ /dev/null
@@ -1,166 +0,0 @@
-.\"
-.\" $Id:$
-.\"
-.TH PQ2 1 "Version 5" "ROOT"
-.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
-.\" other parms are allowed: see man(7), man(1)
-.SH NOTA BENE
-.B The PQ2 tools are deprecated and will be removed in ROOT v6.16/00.
-.PP
-Please contact the ROOT team at
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-in the unlikely event this change is disruptive for your workflow.
-.SH NAME
-pq2 \- The command line interface to a dataset meta-repository based on ROOT files
-.SH SYNOPSIS
-.B pq2
-action
-.I "options"
-.SH "DESCRIPTION"
-This manual page documents briefly the
-.BR pq2
-program.
-.PP
-.B pq2
-is a
-.B ROOT
-application providing an interface to a dataset meta-repository based on ROOT files;
-the repository can be accessed via the local file
-system or a remote file server daemon or a PROOF facility.
-.PP
-When working with a local or remote file system, \fIpq2\fR instantiates a \fITDataSetManagerFile\fR class
-on the specified local or remote directory. Remote access is done via the \fITFile\fR interface, so any
-implementation of \fITFile\fR supported by the installation can in principle be used.
-When working with PROOF server the \fITProof\fR dataset manager interface is used to access the dataset
-repository attached to the PROOF cluster.
-.SH ACTIONS
-.TP
-ls
-list compact information about all or a sample dataset.
-.TP
-ls-files
-list compact information about all the files of a given dataset.
-.TP
-ls-files-server
-list the file content of a dataset on a given server or list of servers.
-.TP
-info-server
-display compact information about the datasets on a given server or a set of servers.
-.TP
-ana-dist
-analyse the file distribution of a dataset (or a set of datasets) over the file
-servers, either in terms of files or of file sizes. The output is a text file with
-the the file movements needed to make the file distribution even in the chosen
-metrics to be used in input to pq2-redistribute.
-Optionally the internal objects can be saved so that they can be used as starting
-point for a subsequent run. Also an histogram and a plot can be saved to visualize
-the file distribution.
-.TP
-put
-register one or more datasets.
-.TP
-rm
-remove one or more datasets.
-.TP
-verify
-scan the content one or more datasets.
-.TP
-cache
-display or clear the local cache content.
-
-.SH COMMON OPTIONS
-Some of the options listed below have a slight different meaning
-depending on the action. Please refer to the man pages of the script interfaces to the actions for more
-details (see below).
-.TP
-\fB-d\fR <\fIdataset\fR>
-For all action but \fIput\fR, the dataset to be processed. For listing actions the wildcards '*' is supported.
-For action \fIput\fR, \fIdataset\fR is the path to the file with the list of files in the dataset or
-directory with the files containing the file lists of the datasets to be registered; in the first case wildcards '*'
-can be specified in the file name, i.e. '<dir>/fil*' is ok but '<dir>/*/file' is not.
-In all cases the name of the dataset is the name of the file finally used.
-.TP
-\fB-u\fR <\fIserverurl\fR>
-URL of the PROOF master or data server providing the information; for data servers, it must include the directory.
-Can also be specified via the environment variables PQ2PROOFURL or PQ2DSSRVURL (see ENVIRONMENT VARIABLES)."
-.TP
-\fB-o\fR <\fIoptions\fR>
-Specify a string of options to be passed to the instance actually performing the action; the exact meaning is action
-dependent.
-.TP
-\fB-s\fR <\fIservers\fR>
-Specify a server or a comma-separated list of servers to be used in the analysis when required by the action.
-.TP
-\fB-k\fR
-Keep the temporary files created during the analysis under $TMPDIR
-.TP
-\fB-v\fR
-Verbose mode
-.SH OPTIONS for action verify
-The options listed below apply only to action 'verify'
-.TP
-\fB-r\fR <\fIredirector\fR>
-Force re-location of the files via the specified redirector; useful after a file redistribution on the same file
-server.
-.SH OPTIONS for action ana-dist
-The options listed below apply only to action 'ana-dist'
-.TP
-\fB-m\fR <\fImetrics\fR>
-Defines the metrics to be used in the distribution analysis. The possibilities supported currently are: 'F' to use
-the number of files, and 'S' to use the file size.
-.TP
-\fB-f\fR <\fIresult file\fR>
-Defines the file where to save the result of the analysis; by the default the result is send to the screen.
-The output contains one line per each file that needs to be moved with the format 'file source destination' where 'file' is the file name, 'source' is the source server URL and 'destination' is the destination server URL.
-.TP
-\fB--outfile\fR <\fIoutput file\fR>
-Defines the file where to save the output of the analysis in binary form (ROOT file); this output can be used as starting
-point for a next run, allowing to run over many datasets in separate steps.
-.TP
-\fB--infile\fR <\fIinput file\fR>
-Defines the ROOT file from where to fetch the output of a previous run (saved with --outfile).
-.TP
-\fB-i\fR <\fIignored servers\fR>
-Specify a server or a comma-separated list of servers to be ignored in the analysis; this allows to exclude, for example,
-the redirector.
-.TP
-\fB-e\fR <\fIexcluded servers\fR>
-Specify a server or a comma-separated list of servers to be excluded from the target servers; this can be used, for example,
-to determine the files movements to drain a server.
-.TP
-\fB--plot\fR [<\fIplot file\fR>]
-Defines the file with the output plot with the original distribution with the server names and the +-10% limits;
-the extension (if known) defines the format; the default format is 'png' and the default name 'plot.png'.
-The plot can also be obtained directly from a binary output file (saved with '--outfile <outfile>.root') but
-just specifying '--infile <outfile>.root --plot'
-
-.SH "ENVIRONMENT VARIABLES"
-See \fIsetup-pq2\fR(1).
-.SH "SEE ALSO"
-\fIsetup-pq2\fR(1), \fIpq2-ls\fR(1), \fIpq2-ls-files\fR(1), \fIpq2-ls-files-server\fR(1),
-\fIpq2-info-server\fR(1), \fIpq2-ana-dist\fR(1),
-\fIpq2-put\fR(1), \fIpq2-verify\fR(1), \fIpq2-rm\fR(1), \fIpq2-cache\fR(1)
-.PP
-For more information on the \fBROOT\fR system, please refer to
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-.UE
-.SH "ORIGINAL AUTHORS"
-Gerardo Ganis for the ROOT team.
-.SH "COPYRIGHT"
-This library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-.P
-This library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-.P
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-.SH AUTHOR
-This manual page was originally written by Gerardo Ganis <gerardo.ganis@cern.ch>, for ROOT version 5.
diff --git a/man/man1/setup-pq2.1 b/man/man1/setup-pq2.1
deleted file mode 100644
index 8149f33507b..00000000000
--- a/man/man1/setup-pq2.1
+++ /dev/null
@@ -1,124 +0,0 @@
-.\"
-.\" $Id:$
-.\"
-.TH SETUP-PQ2 1 "Version 5" "ROOT"
-.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
-.\" other parms are allowed: see man(7), man(1)
-.SH NOTA BENE
-.B The PQ2 tools are deprecated and will be removed in ROOT v6.16/00.
-.PP
-Please contact the ROOT team at
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-in the unlikely event this change is disruptive for your workflow.
-.SH NAME
-setup-pq2 \- Script defining the environment for the PQ2 tools
-.SH SYNOPSIS
-source
-.B <path>/<to>/setup-pq2
-.SH "DESCRIPTION"
-This manual page documents briefly the
-.BR setup-pq2
-script.
-.PP
-.B setup-pq2
-is a script containing the definition of the environment variable used by the PQ2 tools.
-The script contains the templates both or bash-like and csh-like shells.
-Before sourcing this script it is advised to source <root_sys>/bin.thisroot.sh (or .csh,
-for csh-like shell): this properly defines the ROOT settings, including the path for these
-man pages.
-
-More details about the underlying 'pq2' application can be found in the man page \fIpq2\fR(1).
-.SH "ENVIRONMENT VARIABLES CONTROLLING THE BEHAVIOUR OF PQ2"
-The following environment variables may be used to control the behaviour of the PQ2 tools:
-.TP
-PATH
-Add the path to the PQ2 scripts to the execution path so that they are picked-up automatically.
-.TP
-PQ2DSSRVURL
-Path to the dataset repository when working via a local or remote file system; the value specified here is
-superseded by '-u srvurl'; the path must contain the full directory specification. To test the goodness of the
-path run gSystem->AccessPathName("$PQ2DSSRVURL", kReadPermissions) in a ROOT shell: this command will return
-0 is the path is good. The PQ2DSSRVURL settings are superseded by '-u srvurl'. If not specified, PQ2DSSRVURL defaults
-to PQ2PROOFURL (see below).
-.TP
-PQ2PROOFURL
-URL of the PROOF master connected to the dataset repository when working with PROOF server (i.e. the entry point of the
-PROOF cluster). To test the goodness of the url try to pen a PROOF session in ROOT shell with
-TProof::Open("$PQ2PROOFURL", "masteronly").
-.TP
-PROOFURL
-Same as PQ2PROOFURL but deprecated.
-.TP
-DATASETCACHE
-Controls the use of the cache when working via a remote file system; set to 'no' to disable the cache; by default
-the cache is enabled.
-.TP
-DATASETLOCALCACHEDIR
-Location of the local cache the default is a path derived from $PQ2DSSRVURL (replacement of '/' and ':' with %) and
-created under $TMPDIR, e.g. for PQ2DSSRVURL set to root://alicecaf.cern.ch:11094//dataset-xpd, the default cache
-directory is /tmp/<user>/dataset.cache/root%%%alicecaf.cern.ch%11094%%dataset-xpd .
-.TP
-PQ2GROUP
-Group to be used to initialize the dataset manager instance when working via a local or remote file system;
-the default is an empty string, which results in 'default'.
-.TP
-PQ2USER
-User to be used to initialize the dataset manager instance when working via a local or remote file system;
-the default is an empty string, which results in 'username' running the 'pq2' instance.
-.TP
-PQ2DSMGROPTS
-Options to be used in initializing the dataset manager; the default allows for browsing only, e.g. '-Ar:-Av:'
-.TP
-PQ2DSSRVACTS
-List of operations to be done via the data server in the case both PQ2DSSRVURL and PQ2PROOFURL are specified.
-By the default, the browsing actions (ls, ls-files, ls-files-server, info-server, ana-dist) are executed via
-PQ2DSSRVURL, the others (put, rm, verify) via PQ2PROOFURL. This allows to speed-up the operations by using
-caching and to reduce the load on the PROOF master.
-.RS
-The format is "<action-tag>:" where the action tags are:
-.RE
-.RS
-.nf
-              ls             for      ls
-              lsfiles        for      ls-files
-              filessrv       for      ls-files-server
-              infosrv        for      info-server
-              anadist        for      ana-dist
-              cache          for      cache
-              put            for      put
-              rm             for      rm
-              vfy            for      verify
-.fi
-.RE
-.TP
-TMPDIR
-Directory used for temporary files or directories; the actual temporary directory is required to end with the
-username (in some cases TMPDIR already ends with the username).
-.SH "SEE ALSO"
-\fIpq2\fR(1), \fIpq2-ls\fR(1), \fIpq2-ls-files\fR(1), \fIpq2-ls-files-server\fR(1),
-\fIpq2-info-server\fR(1), \fIpq2-ana-dist\fR(1),
-\fIpq2-put\fR(1), \fIpq2-verify\fR(1), \fIpq2-rm\fR(1), \fIpq2-cache\fR(1)
-.PP
-For more information on the \fBROOT\fR system, please refer to
-.UR http://root.cern.ch/
-.I http://root.cern.ch
-.UE
-.SH "ORIGINAL AUTHORS"
-Gerardo Ganis for the ROOT team.
-.SH "COPYRIGHT"
-This library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-.P
-This library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-.P
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-.SH AUTHOR
-This manual page was originally written by Gerardo Ganis <gerardo.ganis@cern.ch>, for ROOT version 5.
diff --git a/proof/CMakeLists.txt b/proof/CMakeLists.txt
index df06e44b643..5ce471cbe1d 100644
--- a/proof/CMakeLists.txt
+++ b/proof/CMakeLists.txt
@@ -10,4 +10,3 @@ if(xrootd AND ssl)
   add_subdirectory(proofd)
   add_subdirectory(proofx)
 endif()
-add_subdirectory(pq2)
diff --git a/proof/pq2/CMakeLists.txt b/proof/pq2/CMakeLists.txt
deleted file mode 100644
index 947464b64ba..00000000000
--- a/proof/pq2/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-############################################################################
-# CMakeLists.txt file for building ROOT proof/pq2 package
-# @author Pere Mato, CERN
-############################################################################
-
-ROOT_EXECUTABLE(pq2 *.cxx LIBRARIES Core Proof Hist Matrix Tree
-  RIO Net Thread MathCore)
diff --git a/proof/pq2/src/pq2actions.cxx b/proof/pq2/src/pq2actions.cxx
deleted file mode 100644
index b439f301c6a..00000000000
--- a/proof/pq2/src/pq2actions.cxx
+++ /dev/null
@@ -1,1133 +0,0 @@
-// @(#)root/proof:$Id$
-// Author: G. Ganis, Mar 2010
-
-/*************************************************************************
- * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
- * All rights reserved.                                                  *
- *                                                                       *
- * For the licensing terms see $ROOTSYS/LICENSE.                         *
- * For the list of contributors see $ROOTSYS/README/CREDITS.             *
- *************************************************************************/
-
-// ************************************************************************* //
-// *                                                                       * //
-// *                        p q 2 a c t i o n s                            * //
-// *                                                                       * //
-// * This file implements the action functions used in PQ2                 * //
-// *                                                                       * //
-// ************************************************************************* //
-
-#include <errno.h>
-
-#include "pq2actions.h"
-#include "pq2wrappers.h"
-#include "redirguard.h"
-
-#include "TFile.h"
-#include "TFileCollection.h"
-#include "TFileInfo.h"
-#include "THashList.h"
-#include "TH1D.h"
-#include "TParameter.h"
-#include "TRegexp.h"
-#include "TString.h"
-#include "TSystem.h"
-
-// Global variables defined by other PQ2 components
-extern TString flog;
-extern TString ferr;
-extern TString fres;
-extern Int_t gverbose;
-
-// Local globals
-static const char *glabMet[] = { "#files", "size" };
-THashList gProtoPortMap;
-// Local functions
-int do_anadist_ds(TFileCollection *fc, const char *newsrvs = 0, const char *ignsrvs = 0,
-                  const char *excsrvs = 0, int met = 0, const char *fnout = 0,
-                  TList *distinfo = 0, const char *outfile = 0, const char *infile = 0);
-void do_anadist_getkey(const char *p, TString &key);
-void do_anadist_getkey(TUrl *u, TString &key);
-
-// Usefule macros
-#define SDELTWO(x,y)  { SafeDelete(x); SafeDelete(y); }
-#define SDELTRE(x,y,z)  { SafeDelete(x); SafeDelete(y); SafeDelete(z); }
-#define SDELETE(x,y,z,w,t)  { SafeDelete(x); SafeDelete(y); SafeDelete(z); SafeDelete(w); SafeDelete(t); }
-
-////////////////////////////////////////////////////////////////////////////////
-/// Execute 'cache'
-
-void do_cache(bool clear, const char *ds)
-{
-   // Show / Clear the cache
-   DataSetCache(clear, ds);
-   // Remove the error file
-   gSystem->Unlink(ferr.Data());
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Execute 'ls'
-
-void do_ls(const char *ds, const char *opt)
-{
-   // List the data sets
-   ShowDataSets(ds, opt);
-   // Remove the error file
-   gSystem->Unlink(ferr.Data());
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Execute 'ls-files'
-
-void do_ls_files_server(const char *ds, const char *server)
-{
-   const char *action = (server && strlen(server) > 0) ? "pq2-ls-files-server" : "pq2-ls-files";
-
-   // We need to scan all the datasets to find the matching ones ...
-   TFileCollection *fc = 0;
-   { redirguard rog(flog.Data(), "a", gverbose);
-      if (server && strlen(server) > 0) {
-         fc = GetDataSet(ds, server);
-      } else {
-         fc = GetDataSet(ds);
-      }
-   }
-   if (!fc) {
-      // Notify
-      gSystem->Rename(flog.Data(), ferr.Data());
-      Printf("%s: ERROR: problems retrieving info about dataset '%s'", action, ds);
-      return;
-   }
-
-   // Overall info
-   if (server && strlen(server) > 0) {
-      Printf("%s: dataset '%s' has %d files on server: %s",
-                                              action, ds, fc->GetList()->GetSize(), server);
-   } else {
-      Printf("%s: dataset '%s' has %d files", action, ds, fc->GetList()->GetSize());
-   }
-
-   // Header
-   TString num("      #   ");
-   TString nam("File"); nam.Resize(80);
-   TString siz("        Size");
-   TString met("#Objs Obj|Type|Entries, ...");
-   TString header;
-   header.Form("%s%s%s   %s", num.Data(), nam.Data(), siz.Data(), met.Data());
-
-   // Iterate
-   const char *unit[4] = {"kB", "MB", "GB", "TB"};
-   TString uu, meta, name;
-   TIter nxf(fc->GetList());
-   TFileInfo *fi = 0;
-   Int_t nf = 0;
-   while ((fi = (TFileInfo *) nxf())) {
-      nf++;
-      if (nf == 1)
-         Printf("%s:%s", action, header.Data());
-      // URL
-      uu = fi->GetCurrentUrl()->GetUrl();
-      if (uu.Length() < 80) uu.Resize(80);
-      // Size renormalize to kB, MB or GB
-      Int_t k = 0;
-      Long64_t refsz = 1024;
-      Long64_t xsz = (Long64_t) (fi->GetSize() / refsz);
-      while (xsz > 1024 && k < 3) {
-         k++;
-         refsz *= 1024;
-         xsz = (Long64_t) (fi->GetSize() / refsz);
-      }
-      // Meta info
-      meta = "";
-      if (fi->GetMetaDataList()) {
-         meta.Form("  %d  ", fi->GetMetaDataList()->GetSize());
-         Bool_t firstObj = kTRUE;
-         TIter nxm(fi->GetMetaDataList());
-         TFileInfoMeta *fim = 0;
-         while ((fim = (TFileInfoMeta *) nxm())) {
-            if (!firstObj) meta += ",";
-            name = fim->GetObject();
-            if (strcmp(fim->GetDirectory(),"/")) name = fim->GetName();
-            meta += Form("%s|%s|%lld", name.Data(), fim->GetClass(), fim->GetEntries());
-            firstObj = kFALSE;
-         }
-      }
-      // Printout
-      if (xsz > 0) {
-         Printf("%s:  %5d   %s %8lld %s    %s", action, nf, uu.Data(), xsz, unit[k], meta.Data());
-      } else {
-         Printf("%s:  %5d   %s         N/A    N/A", action, nf, uu.Data());
-      }
-   }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Formatted printout of the content of TFileCollection 'fc'.
-/// Options in the form
-///           popt = u * 10 + f
-///     f    0 => header only, 1 => header + files
-///   when printing files
-///     u    0 => print file name only, 1 => print full URL
-
-void printDataSet(TFileCollection *fc, Int_t popt)
-{
-   if (!fc) return;
-
-   Int_t f = popt%10;
-   Int_t u = popt - 10 * f;
-
-   Printf("+++");
-   if (fc->GetTitle() && (strlen(fc->GetTitle()) > 0)) {
-      Printf("+++ Dumping: %s: ", fc->GetTitle());
-   } else {
-      Printf("+++ Dumping: %s: ", fc->GetName());
-   }
-   Printf("%s", fc->ExportInfo("+++ Summary:", 1)->GetName());
-   if (f == 1) {
-      Printf("+++ Files:");
-      Int_t nf = 0;
-      TIter nxfi(fc->GetList());
-      TFileInfo *fi = 0;
-      while ((fi = (TFileInfo *)nxfi())) {
-         if (u == 1)
-            Printf("+++ %5d. %s", ++nf, fi->GetCurrentUrl()->GetUrl());
-         else
-            Printf("+++ %5d. %s", ++nf, fi->GetCurrentUrl()->GetFile());
-      }
-   }
-   Printf("+++");
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Execute 'info-server'
-
-void do_info_server(const char *server)
-{
-   const char *action = "pq2-info-server";
-
-   // We need to scan all the datasets to find the matching ones ...
-   TMap *dsmap = 0;
-   {  redirguard rog(flog.Data(), "a", gverbose);
-      dsmap = GetDataSets("/*/*", server);
-   }
-   if (!dsmap) {
-      // Notify
-      gSystem->Rename(flog.Data(), ferr.Data());
-      Printf("%s: ERROR: problems retrieving info about datasets for server '%s'", action, server);
-      return;
-   }
-
-   redirguard rog(fres.Data(), "w", gverbose);
-   Int_t popt = 0;
-   TIter nxk(dsmap);
-   TObject *k = 0;
-   TFileCollection *fc = 0;
-   while ((k = nxk()) && (fc = (TFileCollection *) dsmap->GetValue(k))) {
-      printDataSet(fc, popt);
-   }
-   delete dsmap;
-
-   // Done
-   return;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-Int_t pq2register(const char *dsname, const char *files, const char *opt) {
-   // If the dataset exists already do not continue
-   TString oo(opt);
-   oo.ToUpper();
-   redirguard rog(flog.Data(), "a", gverbose);
-   if (ExistsDataSet(dsname) &&
-       !oo.Contains("O") && !oo.Contains("U")) {
-      return 2;
-   }
-   // Create the file collection
-   TFileCollection *fc = new TFileCollection("dum", "dum", files);
-
-   // The option may contain the default tree name and/or the staged status
-   Int_t itb = kNPOS, ite = kNPOS;
-   TString o(opt), deftree;
-   if ((itb = o.Index("tree:")) != kNPOS) {
-      deftree = o(itb + 5, o.Length());
-      if ((ite = deftree.Index('|')) != kNPOS) deftree.Remove(ite);
-      o.ReplaceAll(TString::Format("tree:%s|", deftree.Data()), "");
-      if (!deftree.BeginsWith("/")) deftree.Insert(0, "/");
-      if (!deftree.IsNull()) fc->SetDefaultTreeName(deftree);
-   }
-   if (o.Contains("staged|")) {
-      fc->SetBitAll(TFileInfo::kStaged);
-      o.ReplaceAll("staged|", "");
-   }
-   // Update the collection
-   fc->Update();
-
-   // Register the file collection
-   Int_t rc =0;
-   if (RegisterDataSet(dsname, fc, o) == 0) rc = 1;
-   // Cleanup
-   delete fc;
-
-   // Done
-   return rc;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Execute 'put'
-
-void do_put(const char *files, const char *opt)
-{
-   const char *action = "pq2-put";
-
-   // Check the file path makes sense
-   if (!files || strlen(files) <= 0) {
-      // Notify
-      gSystem->Rename(flog.Data(), ferr.Data());
-      Printf("%s: ERROR: path files not defined!", action);
-      return ;
-   }
-
-   // Find out if it is a single file or a directory or contains a wildcard
-   Bool_t isDir = kFALSE;
-   Bool_t isWild = kFALSE;
-   TString dir, base;
-   FileStat_t st;
-   if (gSystem->GetPathInfo(files, st) != 0) {
-      // Path does not exists: check the basename for wild cards; in such a case
-      // we have to do a selective search in the directory
-      base = gSystem->BaseName(files);
-      if (base.Contains("*")) {
-         isWild = kTRUE;
-         base.ReplaceAll("*", ".*");
-         isDir = kTRUE;
-         dir = gSystem->DirName(files);
-      }
-
-   } else {
-      // Path exists: is it a dir or a file ?
-      if (R_ISDIR(st.fMode)) {
-         isDir = kTRUE;
-         dir = files;
-      }
-   }
-
-   Int_t ndp = 0, nd = 0;
-   Int_t printerr = 1;
-   Int_t rc = 0;
-   // If simple file ...
-   if (!isDir) {
-      nd++;
-      // ... just register and exit
-      TString dsname = gSystem->BaseName(files);
-      if ((rc = pq2register(dsname.Data(), files, opt)) != 0) {
-         // Notify
-         gSystem->Rename(flog.Data(), ferr.Data());
-         if (rc == 2) {
-            Printf("%s: WARNING: dataset '%s' already exists - ignoring request", action, dsname.Data());
-            Printf("%s:          (use '-o O' to overwrite,  '-o U' to update)", action);
-         } else {
-            Printf("%s: ERROR: problems registering '%s' from '%s'", action, dsname.Data(), files);
-         }
-         return;
-      }
-      printerr = 0;
-   } else {
-      // ... else, scan the directory
-      void *dirp = gSystem->OpenDirectory(dir.Data());
-      if (!dirp) {
-         // Notify
-         gSystem->Rename(flog.Data(), ferr.Data());
-         Printf("%s: ERROR: could not open directory '%s'", action, dir.Data());
-         return;
-      }
-      printerr = 0;
-      // Loop over the entries
-      TString file;
-      TRegexp reg(base);
-      const char *ent = 0;
-      while ((ent = gSystem->GetDirEntry(dirp))) {
-         // Skip default entries
-         if (!strcmp(ent, ".") || !strcmp(ent, "..")) continue;
-         if (isWild) {
-            file = ent;
-            if (file.Index(reg) == kNPOS) continue;
-         }
-         nd++;
-         file.Form("%s/%s", dir.Data(), ent);
-         if ((rc = pq2register(ent, file.Data(), opt)) != 0) {
-            nd--;
-            ndp++;
-            printerr = 1;
-            // Notify
-            if (rc == 1) {
-               Printf("%s: ERROR: problems registering '%s' from '%s'", action, ent, file.Data());
-            } else {
-               Printf("%s: WARNING: dataset '%s' already exists - ignoring request", action, ent);
-               Printf("%s:          (use '-o O' to overwrite,  '-o U' to update)", action);
-            }
-            continue;
-         }
-      }
-      gSystem->FreeDirectory(dirp);
-   }
-
-   // If no match, notify
-   if (printerr == 1) {
-      Printf("%s: WARNING: problems with %d dataset(s)", action, ndp);
-      gSystem->Rename(flog.Data(), ferr.Data());
-   }
-   Printf("%s: %d dataset(s) registered", action, nd);
-
-   // Done
-   return;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Execute 'rm'
-
-void do_rm(const char *dsname)
-{
-   const char *action = "pq2-ds";
-
-   Int_t nd = 0;
-   Int_t printerr = 1;
-   TString ds(dsname);
-   if (!ds.Contains("*")) {
-      nd++;
-      // Remove the dataset
-      redirguard rog(flog.Data(), "a", gverbose);
-      if (RemoveDataSet(dsname) != 0) {
-         // Notify
-         gSystem->Rename(flog.Data(), ferr.Data());
-         Printf("%s: ERROR: problems removing dataset '%s'", action, dsname);
-         return;
-      }
-      printerr = 0;
-   } else {
-      // We need to scan all the datasets to find the matching ones ...
-      TMap *dss = 0;
-      {  redirguard rog(flog.Data(), "a", gverbose);
-         dss = GetDataSets();
-      }
-      if (!dss) {
-         // Notify
-         gSystem->Rename(flog.Data(), ferr.Data());
-         Printf("%s: ERROR: problems retrieving info about datasets", action);
-         return;
-      }
-      printerr = 0;
-      // Iterate
-      TRegexp reg(dsname, kTRUE);
-      TIter nxd(dss);
-      TObjString *os = 0;
-      while ((os = dynamic_cast<TObjString*>(nxd()))) {
-         ds = os->GetName();
-         if (ds.Index(reg) != kNPOS) {
-            nd++;
-            // Remove the dataset
-            redirguard rog(flog.Data(), "a", gverbose);
-            if (RemoveDataSet(ds.Data()) != 0) {
-               printerr = 1;
-               // Notify
-               Printf("%s: ERROR: problems removing dataset '%s'", action, ds.Data());
-               continue;
-            }
-         }
-      }
-
-   }
-
-   // If no match, notify
-   if (nd == 0) {
-      Printf("%s: WARNING: no matching dataset found!", action);
-   } else {
-      Printf("%s: %d dataset(s) removed", action, nd);
-   }
-   if (printerr)
-      gSystem->Rename(flog.Data(), ferr.Data());
-
-   // Done
-   return;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Execute 'verify'
-
-int do_verify(const char *dsname, const char *opt, const char *redir)
-{
-   const char *action = "pq2-verify";
-
-   Int_t nd = 0, rc = -1;
-   Int_t printerr = 1;
-   TString ds(dsname);
-   if (!ds.Contains("*")) {
-      nd++;
-      // Verify the dataset
-      if ((rc = VerifyDataSet(dsname, opt, redir)) < 0) {
-         // Notify
-         Printf("%s: ERROR: problems verifing dataset '%s'", action, dsname);
-         return rc;
-      } else if (rc > 0) {
-         // Notify
-         Printf("%s: WARNING: %s: some files not yet online (staged)", action, dsname);
-      }
-      printerr = 0;
-   } else {
-      // We need to scan all the datasets to find the matching ones ...
-      TMap *dss = GetDataSets(dsname, "", "list");
-      if (!dss) {
-         // Notify
-         Printf("%s: ERROR: problems retrieving info about datasets", action);
-         return rc;
-      }
-      printerr = 0;
-      // Iterate
-      Int_t xrc = -1;
-      TIter nxd(dss);
-      TObjString *os = 0;
-      while ((os = dynamic_cast<TObjString*>(nxd()))) {
-         nd++;
-         // Verify the dataset
-         Printf("%s: start verification of dataset '%s' ...", action, os->GetName());
-         if ((xrc = VerifyDataSet(os->GetName(), opt, redir)) < 0) {
-            printerr = 1;
-            // Notify
-            Printf("%s: ERROR: problems verifying dataset '%s'", action, os->GetName());
-            continue;
-         } else if (xrc > 0) {
-            // At least one is not fully available
-            rc = 1;
-            // Notify
-            Printf("%s: WARNING: %s: some files not yet online (staged)", action, os->GetName());
-         } else if (rc < 0) {
-            // At least one is good
-            rc = 0;
-         }
-      }
-   }
-
-   // If no match, notify
-   if (nd == 0) {
-      Printf("%s: WARNING: no matching dataset found!", action);
-   } else {
-      Printf("%s: %d dataset(s) verified", action, nd);
-   }
-   if (printerr)
-      gSystem->Rename(flog.Data(), ferr.Data());
-
-   // Done
-   return rc;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Execute 'analyze-distribution' for the dataset(s) described by 'ds'.
-/// The result is output to the screan and the details about file movement to file
-/// 'fnout', if defined.
-
-void do_anadist(const char *ds, const char *servers, const char *ignsrvs,
-                const char *excsrvs, const char *metrics, const char *fnout,
-                const char *plot, const char *outfile, const char *infile)
-{
-   const char *action = "pq2-ana-dist";
-
-   // Running mode
-   Bool_t plot_m = (plot && strlen(plot)) ? kTRUE : kFALSE;
-   Bool_t plotonly_m = (plot_m && infile && strlen(infile)) ? kTRUE : kFALSE;
-
-   // We need to scan all the datasets to find the matching ones ...
-   TMap *fcmap = 0;
-   TObject *k = 0;
-   if (!plotonly_m) {
-      redirguard rog(flog.Data(), "a", gverbose);
-      TString dss(ds), d;
-      Int_t from = 0;
-      while (dss.Tokenize(d, from, ",")) {
-         TMap *xm = GetDataSets(d);
-         if (xm) {
-            if (!fcmap) {
-               fcmap = xm;
-            } else {
-               TIter nxds(xm);
-               while ((k = nxds())) {
-                  fcmap->Add(k, xm->GetValue(k));
-                  xm->Remove(k);
-               }
-            }
-            if (xm != fcmap) {
-               xm->SetOwner(kFALSE);
-               SafeDelete(xm);
-            }
-         }
-      }
-      if (!fcmap || fcmap->GetSize() <= 0) {
-         SafeDelete(fcmap);
-         // Notify
-         gSystem->Rename(flog.Data(), ferr.Data());
-         Printf("%s: ERROR: problems retrieving info about dataset '%s' (or empty dataset)", action, ds);
-         return;
-      }
-      if (gverbose > 0) fcmap->Print();
-   }
-
-   // Which metrics
-   Int_t optMet = 0;  // # of files
-   if (metrics && !strcmp(metrics, "S")) optMet = 1;  // Size in bytes
-   if (gverbose > 0)
-      Printf("%s: using metrics: '%s'", action, glabMet[optMet]);
-
-   TList distinfo;
-   if (plotonly_m) {
-      // Get the dist info
-      if (do_anadist_ds(0, 0, 0, 0, optMet, 0, &distinfo, 0, infile) != 0) {
-         Printf("%s: problems getting dist info from '%s'", action, infile);
-      }
-   } else {
-      // Name
-      TString cname(ds);
-      if (cname.BeginsWith("/")) cname.Remove(0,1);
-      Ssiz_t ilst = kNPOS;
-      if (cname.EndsWith("/") && (ilst = cname.Last('/')) != kNPOS) cname.Remove(ilst);
-      cname.ReplaceAll("/", "-");
-      cname.ReplaceAll("*", "-star-");
-      distinfo.SetName(cname);
-      TFileCollection *fc = 0;
-      TIter nxd(fcmap);
-      TFileCollection *fctot = 0;
-      while ((k = nxd()) && (fc = (TFileCollection *) fcmap->GetValue(k))) {
-         if (!fctot) {
-            // The first one
-            fctot = fc;
-            fcmap->Remove(k);
-         } else {
-            // Add
-            fctot->Add(fc);
-         }
-      }
-      // Analyse the global dataset
-      if (do_anadist_ds(fctot, servers, ignsrvs, excsrvs,
-                        optMet, fnout, &distinfo, outfile, infile) != 0) {
-         Printf("%s: problems analysing dataset '%s'", action, fc ? fc->GetName() : "<undef>");
-      }
-      // Cleanup
-      SafeDelete(fcmap);
-      SafeDelete(fctot);
-   }
-
-   // Save histo, if any
-   TString fileplot(plot), gext;
-   if (!(fileplot.IsNull())) {
-      if (fileplot.Contains(".")) {
-         gext = fileplot(fileplot.Last('.') + 1, fileplot.Length());
-      } else {
-         gext = "png";
-      }
-      const char *fmts[9] = {"png", "eps", "ps", "pdf", "svg", "gif", "xpm", "jpg", "tiff" };
-      Int_t iplot = 0;
-      while (iplot < 9 && gext != fmts[iplot]) { iplot++; }
-      if (iplot == 9) {
-         Printf("%s: graphics format '%s' not supported: switching to 'png'", action, gext.Data());
-         gext = "png";
-      }
-      if (!(fileplot.EndsWith(gext))) {
-         if (!(fileplot.EndsWith("."))) fileplot += ".";
-         fileplot += gext;
-      }
-      // Create the histogram
-      TH1D *h1d = 0;
-      if (distinfo.GetSize() > 0) {
-         h1d = new TH1D("DistInfoHist", distinfo.GetName(), distinfo.GetSize(), 0.5, distinfo.GetSize() + .5);
-         TIter nxs(&distinfo);
-         TParameter<Double_t> *ent = 0;
-         Double_t x = 0;
-         while ((ent = (TParameter<Double_t> *) nxs())) {
-            x += 1.;
-            h1d->Fill(x, ent->GetVal());
-            TString nn(TUrl(ent->GetName()).GetHost()), nnn(nn);
-            nnn.ReplaceAll(".", "");
-            if (!nnn.IsDigit() && nn.Contains(".")) nn.Remove(nn.First('.'));
-            Int_t i = h1d->FindBin(x);
-            h1d->GetXaxis()->SetBinLabel(i, nn.Data());
-         }
-         h1d->GetXaxis()->SetLabelSize(0.03);
-      } else {
-         Printf("%s: plot requested but no server found (info list is empty)!", action);
-      }
-      if (h1d) {
-         TString filehist(fileplot);
-         filehist.Remove(filehist.Last('.')+1);
-         filehist += "root";
-         TFile *f = TFile::Open(filehist, "RECREATE");
-         if (f) {
-            f->cd();
-            h1d->Write(0,TObject::kOverwrite);
-            SafeDelete(f);
-            // Write the instruction for the plotting macro
-            TString filetmp = TString::Format("%s/%s.tmp", gSystem->TempDirectory(), action);
-            FILE *ftmp = fopen(filetmp.Data(), "w");
-            if (ftmp) {
-               fprintf(ftmp, "%s %s %s", filehist.Data(), fileplot.Data(), glabMet[optMet]);
-               fclose(ftmp);
-            } else {
-               Printf("%s: problems opening temp file '%s' (errno: %d)", action, filetmp.Data(), errno);
-               Printf("%s: relevant info: %s %s %s (input to pq2PlotDist.C)",
-                                             action, filehist.Data(), fileplot.Data(), glabMet[optMet]);
-            }
-         } else {
-            Printf("%s: problems opening file '%s'", action, filehist.Data());
-         }
-      } else {
-         Printf("%s: histogram requested but not found", action);
-      }
-   }
-
-   // Done
-   return;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Do analysis of dataset 'fc'
-
-int do_anadist_ds(TFileCollection *fc, const char *servers, const char *ignsrvs,
-                  const char *excsrvs, int met, const char *fnout,
-                  TList *distinfo, const char *outfile, const char *infile)
-{
-   const char *action = "pq2-ana-dist-ds";
-
-   // Check the inputs
-   Bool_t distonly_m = (!fc && distinfo && infile && strlen(infile) > 0) ? kTRUE : kFALSE;
-   const char *dsname = 0;
-   if (!distonly_m) {
-      if (!fc) {
-         Printf("%s: dataset undefined!", action);
-         return -1;
-      }
-      dsname = fc->GetName();
-      if (fc->GetList()->GetSize() <= 0) {
-         Printf("%s: dataset '%s' is empty", action, dsname);
-         return -1;
-      }
-   } else {
-      dsname = distinfo->GetName();
-   }
-
-   THashList *ignore = 0, *targets = 0, *exclude = 0;
-   Bool_t addmode = kFALSE;
-   if (!distonly_m) {
-      TString ss, k, key;
-      Int_t from = 0;
-      // List of servers to be ignored
-      if (ignsrvs && strlen(ignsrvs)) {
-         ss = ignsrvs;
-         from = 0;
-         while (ss.Tokenize(k, from, ",")) {
-            do_anadist_getkey(k.Data(), key);
-            if (!(key.IsNull())) {
-               if (!ignore) ignore = new THashList();
-               ignore->Add(new TObjString(key));
-            }
-         }
-      }
-      // List of servers to be excluded
-      if (excsrvs && strlen(excsrvs)) {
-         ss = excsrvs;
-         from = 0;
-         while (ss.Tokenize(k, from, ",")) {
-            do_anadist_getkey(k.Data(), key);
-            if (!(key.IsNull())) {
-               if (!exclude) exclude = new THashList();
-               exclude->Add(new TObjString(key));
-            }
-         }
-      }
-      // List of sub-TFileCollection for target servers: in add mode we complete it during
-      // the first scan
-      targets = new THashList();
-      if (servers && strlen(servers)) {
-         ss = servers;
-         if (ss.BeginsWith("+")) {
-            addmode = kTRUE;
-            ss.Remove(0,1);
-         }
-         from = 0;
-         while (ss.Tokenize(k, from, ",")) {
-            do_anadist_getkey(k.Data(), key);
-            if (!(key.IsNull())) targets->Add(new TFileCollection(key));
-         }
-      } else {
-         addmode = kTRUE;
-      }
-   }
-   // List of sub-TFileCollection for each server, so that we automatically count
-   // the sizes and totals
-   TNamed *fcsls_title = 0;
-   THashList *fcsls = 0;
-   Int_t targets_size = -1;
-   if (infile && strlen(infile)) {
-      TFile *flist = TFile::Open(infile);
-      if (flist) {
-         Printf("%s: reading info from file '%s' ", action, infile);
-         if (!(fcsls = (THashList *) flist->Get("FileDistList"))) {
-            Printf("%s: could not find starting file distribution 'FileDistList' in input file '%s' ",
-                        action, infile);
-            flist->Close();
-            SafeDelete(flist);
-            SDELTRE(ignore, targets, exclude);
-            return -1;
-         }
-         // Get the title
-         fcsls_title = (TNamed *) flist->Get("FileDistList_Title");
-         // Get the targets size
-         TParameter<Int_t> *psz = (TParameter<Int_t> *) flist->Get("Targets_Size");
-         if (psz) targets_size = psz->GetVal();
-         // Close
-         flist->Close();
-         SafeDelete(flist);
-         // Add info about the current run in the title
-         if (distinfo && fcsls_title && strlen(fcsls_title->GetTitle()) > 0) {
-            TString runt(fcsls_title->GetTitle());
-            if (strcmp(distinfo->GetName(), "TList")) {
-               if (!(runt.IsNull())) runt += ",";
-               runt += distinfo->GetName();
-               fcsls_title->SetTitle(runt);
-            }
-            distinfo->SetName(fcsls_title->GetTitle());
-         }
-      } else {
-         Printf("%s: problems opening input file '%s' ", action, infile);
-         SDELTRE(ignore, targets, exclude);
-         return -1;
-      }
-   }
-   if (!fcsls) {
-      fcsls = new THashList();
-      fcsls->SetName("FileDistList");
-      fcsls_title = new TNamed("FileDistList_Title", distinfo ? distinfo->GetName() : "");
-   }
-
-   // Set initial values for the counters, if needed
-   Long64_t totsz = 0, totfiles = 0;
-   TFileCollection *fcs = 0;
-   TIter nxfc(fcsls);
-   while ((fcs = (TFileCollection *) nxfc())) {
-      fcs->Update();
-      totfiles += fcs->GetNFiles();
-      totsz += fcs->GetTotalSize();
-   }
-
-   // Analyze the file collection content now
-   TFileInfo *fi = 0;
-   if (fc) {
-      TIter nxfi(fc->GetList());
-      while ((fi = (TFileInfo *) nxfi())) {
-         // Get the key
-         TString key;
-         do_anadist_getkey(fi->GetCurrentUrl(), key);
-         // Ignore if requested
-         if (ignore && ignore->FindObject(key)) continue;
-         // Get the TFileCollection for this server
-         if (!(fcs = (TFileCollection *) fcsls->FindObject(key))) {
-            if (gverbose > 0)
-               Printf("%s:%s: found server '%s' ... ", action, dsname, key.Data());
-            fcs = new TFileCollection(key);
-            fcsls->Add(fcs);
-         }
-         fcs->Add(fi);
-         // In add mode, add  as target, if needed
-         Bool_t excluded = (exclude && exclude->FindObject(key)) ? kTRUE : kFALSE;
-         if (!excluded) {
-            if (targets && !(fcs = (TFileCollection *) targets->FindObject(key))) {
-               if (addmode) {
-                  if (gverbose > 0)
-                     Printf("%s:%s: add new target server '%s' ...", action, dsname, key.Data());
-                  fcs = new TFileCollection(key);
-                  targets->Add(fcs);
-               }
-            }
-            if (fcs) fcs->Add(fi);
-         }
-         // Count
-         totsz += fi->GetSize();
-         totfiles++;
-      }
-
-      // Nothing to do if no targets
-      if (targets->GetSize() <= 0) {
-         Printf("%s:%s: target servers list is empty!", action, dsname);
-         SDELETE(ignore, targets, exclude, fcsls, fcsls_title);
-         return -1;
-      } else {
-         Printf("%s:%s: %d target servers found", action, dsname, targets->GetSize());
-         if (gverbose > 0) targets->Print();
-      }
-   }
-   SDELTWO(ignore, exclude);
-
-   // Separate into 'excess' and 'defect' lists
-   TList *excls = new TList;
-   TList *defls = new TList;
-   targets_size = (targets) ? targets->GetSize() : targets_size;
-   Double_t avgfiles = 0, avgsize = 0;
-   if (targets_size > 0) {
-      avgfiles = (Double_t)totfiles / targets_size;
-      avgsize = (Double_t)totsz / targets_size / 1024. / 1024. / 1024.;
-      Printf("%s:%s: %d servers found, %lld files; in average: %.3f files / %.3f GBs per server",
-                  action, dsname, fcsls->GetSize(), totfiles, avgfiles, avgsize);
-   } else {
-      // Cannot continue;
-      Printf("%s:%s: target size is null or negative", action, dsname);
-      SDELETE(ignore, targets, exclude, fcsls, fcsls_title);
-      return -1;
-   }
-   // Before redistribution
-   if (gverbose > 0) Printf("\n%s:%s: Before redistribution:", action, dsname);
-   nxfc.Reset();
-   while ((fcs = (TFileCollection *) nxfc())) {
-      fcs->Update();
-      Long64_t nfexcess = fcs->GetNFiles() - (Long64_t) avgfiles;
-      Double_t xdf = nfexcess / avgfiles;
-      Double_t fcsz = fcs->GetTotalSize() / 1024. / 1024. / 1024.;
-      Double_t szexcess = fcsz - avgsize;
-      Double_t xdsz = szexcess / avgsize;
-      // Fill the output histogram, if needed
-      if (distinfo) {
-         TParameter<Double_t> *ent = (TParameter<Double_t> *) distinfo->FindObject(fcs->GetName());
-         if (!ent) {
-            ent = new TParameter<Double_t>(fcs->GetName(), 0.);
-            distinfo->Add(ent);
-         }
-         if (met == 0) {
-            ent->SetVal(ent->GetVal() + (Double_t) fcs->GetNFiles());
-         } else if (met == 1) {
-            ent->SetVal(ent->GetVal() + fcsz);
-         }
-      }
-      if (gverbose > 0)
-         Printf("%s:%s:  server %s:  %lld files (diff: %lld, %.3f) - %.3f GBs (diff: %.3f, %.3f)",
-                action, dsname, fcs->GetName(), fcs->GetNFiles(), nfexcess, xdf, fcsz, szexcess, xdsz);
-      if (fc) {
-         // Move to the appropriate list
-         Bool_t isExcess = kFALSE;
-         if (targets && targets->FindObject(fcs->GetName())) {
-            if (met == 0) {
-               if (nfexcess > 0.) isExcess = kTRUE;
-            } else if (met == 1) {
-               if (szexcess > 0.) isExcess = kTRUE;
-            }
-         } else {
-            // This server needs to be freed
-            isExcess = kTRUE;
-         }
-         if (isExcess) {
-            excls->Add(fcs);
-         } else {
-            defls->Add(fcs);
-         }
-      }
-   }
-   if (outfile && strlen(outfile)) {
-      TFile *flist = TFile::Open(outfile, "RECREATE");
-      if (flist) {
-         flist->cd();
-         Printf("%s: saving info to file '%s' ", action, outfile);
-         fcsls->Write("FileDistList", TObject::kOverwrite | TObject::kSingleKey);
-         if (fcsls_title) fcsls_title->Write("FileDistList_Title", TObject::kOverwrite);
-         if (targets) {
-            TParameter<Int_t> *psz = new TParameter<Int_t>("Targets_Size", targets->GetSize());
-            psz->Write("Targets_Size", TObject::kOverwrite);
-         }
-         flist->Close();
-         SafeDelete(flist);
-      } else {
-         Printf("%s: problems opening output file '%s' ", action, outfile);
-         return -1;
-      }
-   }
-   // Cleanup
-   fcsls->SetOwner(0);
-   SDELTWO(fcsls, fcsls_title);
-
-   // If we just need the dist info we are done
-   if (!fc) {
-      SDELETE(targets, fcsls, fcsls_title, excls, defls);
-      return 0;
-   }
-
-   // Notify
-   if (gverbose > 0) {
-      Printf("%s:%s: %d servers found in excess", action, dsname, excls->GetSize());
-      excls->Print();
-      Printf("%s:%s: %d servers found in defect", action, dsname, defls->GetSize());
-      defls->Print();
-   } else {
-      Printf("%s:%s: %d servers found in excess, %d in defect", action, dsname, excls->GetSize(), defls->GetSize());
-   }
-
-   // Open output file, if requested
-   FILE *fout = 0;
-   if (fnout && strlen(fnout) > 0) {
-      if (!(fout = fopen(fnout, "a"))) {
-         Printf("%s: problems opening output file '%s' (errno: %d)", action, fnout, errno);
-         SDELETE(targets, fcsls, fcsls_title, excls, defls);
-         return -1;
-      }
-   }
-
-   // Get the list of files to be moved
-   THashList szls;
-   TIter nxefc(excls);
-   TIter nxdfc(defls);
-   Int_t mvfiles = 0;
-   Bool_t printheader = kTRUE;
-   TFileCollection *fcd = (TFileCollection *) nxdfc();
-   while ((fcs = (TFileCollection *) nxefc())) {
-      Bool_t isTarget = (targets->FindObject(fcs->GetName())) ? kTRUE : kFALSE;
-      Long64_t fcfiles = 0;
-      Double_t fcsz = 0.;
-      TIter nxefi(fcs->GetList());
-      while ((fi = (TFileInfo *) nxefi())) {
-         if (!fcd) {
-            Printf("%s:%s: WARNING: processing list in excess '%s': no more lists in deficit!",
-                   action, dsname, fcs->GetName());
-            break;
-         }
-         // Count
-         fcfiles++;
-         fcsz += (fi->GetSize() / 1024. / 1024. / 1024.) ;
-         if (!isTarget ||
-            (((met == 0) && (fcfiles > avgfiles)) || ((met == 1) && (fcsz > avgsize)))) {
-            // Write record in output file, if requested
-            TUrl u(fi->GetCurrentUrl()->GetUrl());
-            u.SetAnchor("");
-            u.SetOptions("");
-            TString php(u.GetUrl());
-            php.Remove(php.Index(u.GetFile()));
-            Ssiz_t ilst = kNPOS;
-            if (php.EndsWith("/") && ((ilst = php.Last('/')) != kNPOS)) php.Remove(ilst);
-            if (fout) {
-               fprintf(fout,"%s %s %s\n", u.GetFile(), php.Data(), fcd->GetName());
-            } else {
-               if (printheader) Printf(" File  Source_Server  Destination_Server");
-               Printf("%s %s %s", u.GetFile(), php.Data(), fcd->GetName());
-               printheader = kFALSE;
-            }
-            fcs->GetList()->Remove(fi);
-            fcd->Add(fi);
-            Bool_t getnext = kFALSE;
-            if (met == 0 && fcd->GetList()->GetSize() > avgfiles) getnext = kTRUE;
-            if (met == 1) {
-               Long64_t xfcsz = 0;
-               TParameter<Long64_t> *ptot = (TParameter<Long64_t> *) szls.FindObject(fcd);
-               if (!ptot) {
-                  fcd->Update();
-                  ptot = new TParameter<Long64_t>(fcd->GetName(), fcd->GetTotalSize());
-                  xfcsz = ptot->GetVal();
-                  szls.Add(ptot);
-               } else {
-                  xfcsz = ptot->GetVal();
-                  xfcsz += fi->GetSize();
-               }
-               if ((xfcsz / 1024. / 1024. / 1024.) > avgsize) getnext = kTRUE;
-            }
-            if (getnext) fcd = (TFileCollection *) nxdfc();
-            // Count files to be moved
-            mvfiles++;
-         }
-      }
-   }
-   // Close the file
-   if (fout) {
-      if ((fclose(fout)) != 0)
-         Printf("%s: problems closing output file '%s' (errno: %d)", action, fnout, errno);
-   }
-   Printf("%s:%s: %d files should be moved to make the distribution even (metrics: %s)",
-          action, dsname, mvfiles, glabMet[met]);
-
-   // After redistribution
-   if (gverbose > 0) {
-      Printf("\n%s:%s: After redistribution:", action, dsname);
-      nxefc.Reset();
-      while ((fcs = (TFileCollection *) nxefc())) {
-         fcs->Update();
-         Long64_t nfexcess = fcs->GetNFiles() - (Long64_t) avgfiles;
-         Double_t xdf = nfexcess / avgfiles;
-         Double_t fcsz = fcs->GetTotalSize() / 1024. / 1024. / 1024.;
-         Double_t szexcess = fcsz - avgsize;
-         Double_t xdsz = szexcess / avgsize;
-         Printf("%s:%s:  Server %s:  %lld files (diff: %lld, %.3f) - %.3f GBs (diff: %.3f, %.3f)",
-                action, dsname, fcs->GetName(), fcs->GetNFiles(), nfexcess, xdf, fcsz, szexcess, xdsz);
-      }
-      nxdfc.Reset();
-      while ((fcs = (TFileCollection *) nxdfc())) {
-         fcs->Update();
-         Long64_t nfexcess = fcs->GetNFiles() - (Long64_t) avgfiles;
-         Double_t xdf = nfexcess / avgfiles;
-         Double_t fcsz = fcs->GetTotalSize() / 1024. / 1024. / 1024.;
-         Double_t szexcess = fcsz - avgsize;
-         Double_t xdsz = szexcess / avgsize;
-         Printf("%s:%s:  server %s:  %lld files (diff: %lld, %.3f) - %.3f GBs (diff: %.3f, %.3f)",
-                action, dsname, fcs->GetName(), fcs->GetNFiles(), nfexcess, xdf, fcsz, szexcess, xdsz);
-      }
-   }
-   // Cleanup
-   SDELETE(targets, fcsls, fcsls_title, excls, defls);
-   // Done
-   return 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Get the key corresponding to path 'p'.
-
-void do_anadist_getkey(const char *p, TString &key)
-{
-   TUrl u(p);
-   if (strncmp(p, u.GetProtocol(), strlen(u.GetProtocol()))) {
-      u.SetProtocol("root");
-      TString sport = TString::Format(":%d", u.GetPort());
-      if (!strstr(p, sport.Data())) u.SetPort(1094);
-   }
-   if (gverbose > 0) Printf("do_anadist_getkey: url: %s", u.GetUrl());
-   return do_anadist_getkey(&u, key);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Get the key corresponding to url 'u'.
-
-void do_anadist_getkey(TUrl *u, TString &key)
-{
-   key = "";
-   if (u) {
-      TParameter<Int_t> *php = (TParameter<Int_t> *)gProtoPortMap.FindObject(u->GetProtocol());
-      if (!php) {
-         TUrl xu(TString::Format("%s://host//file", u->GetProtocol()));
-         php = new TParameter<Int_t>(u->GetProtocol(), xu.GetPort());
-         gProtoPortMap.Add(php);
-      }
-      if (u->GetPort() != php->GetVal()) {
-         key.Form("%s://%s:%d", u->GetProtocol(), u->GetHost(), u->GetPort());
-      } else {
-         key.Form("%s://%s", u->GetProtocol(), u->GetHost());
-      }
-   }
-   // Done
-   return;
-}
-////////////////////////////////////////////////////////////////////////////////
-/// Create the plot for the histogram, and save to 'fnout'.
-/// Format determined by th extension of fnout.
-
-int do_anadist_plot(TH1D *h1d, const char * /*fnout*/)
-{
-   Printf("do_anadist_plot: will be doing a plot here ... ");
-
-   if (h1d) {
-      Printf("do_anadist_plot: we save the histo for now (to testhist.root)");
-      TFile *f = TFile::Open("testhist.root", "RECREATE");
-      if (f) {
-         f->cd();
-         h1d->Write(0,TObject::kOverwrite);
-         SafeDelete(f);
-         return 0;
-      }
-   }
-   return -1;
-}
diff --git a/proof/pq2/src/pq2actions.h b/proof/pq2/src/pq2actions.h
deleted file mode 100644
index 67b3149fef8..00000000000
--- a/proof/pq2/src/pq2actions.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// @(#)root/proof:$Id$
-// Author: G. Ganis, Mar 2010
-
-/*************************************************************************
- * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
- * All rights reserved.                                                  *
- *                                                                       *
- * For the licensing terms see $ROOTSYS/LICENSE.                         *
- * For the list of contributors see $ROOTSYS/README/CREDITS.             *
- *************************************************************************/
-
-#ifndef PQ2_actions
-#define PQ2_actions
-
-//////////////////////////////////////////////////////////////////////////
-//                                                                      //
-// pq2actions                                                           //
-//                                                                      //
-// Prototypes for action functions used in PQ2 functions                //
-//                                                                      //
-//////////////////////////////////////////////////////////////////////////
-
-void do_cache(bool clear = 1, const char *ds = 0);
-void do_ls(const char *ds, const char *opt = "");
-void do_ls_files_server(const char *ds, const char *server);
-void do_info_server(const char *server);
-void do_put(const char *ds, const char *opt);
-void do_rm(const char *ds);
-int  do_verify(const char *ds, const char *opt = 0, const char *redir = 0);
-void do_anadist(const char *ds, const char *newsrvs = 0, const char *ignsrvs = 0,
-                const char *excsrvs = 0, const char *metrics = "F", const char *fout = 0,
-                const char *plot = 0, const char *outfile = 0, const char *infile = 0);
-
-#endif
diff --git a/proof/pq2/src/pq2main.cxx b/proof/pq2/src/pq2main.cxx
deleted file mode 100644
index 3eca30cf679..00000000000
--- a/proof/pq2/src/pq2main.cxx
+++ /dev/null
@@ -1,382 +0,0 @@
-// @(#)root/proof:$Id$
-// Author: G. Ganis, Mar 2010
-
-/*************************************************************************
- * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
- * All rights reserved.                                                  *
- *                                                                       *
- * For the licensing terms see $ROOTSYS/LICENSE.                         *
- * For the list of contributors see $ROOTSYS/README/CREDITS.             *
- *************************************************************************/
-
-// ************************************************************************* //
-// *                                                                       * //
-// *                           p q 2 m a i n                               * //
-// *                                                                       * //
-// * This file implements the steering main for PD2                        * //
-// * The tests can be run as a standalone program or with the interpreter. * //
-// *                                                                       * //
-// ************************************************************************* //
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "TMacro.h"
-#include "TString.h"
-#include "TSystem.h"
-#include "TUUID.h"
-
-#include "pq2actions.h"
-#include "pq2ping.h"
-
-// Local prototype and global variables
-void showFile(const char *fn, int show, int keep);
-static Int_t gkeep = 0;
-
-// Global variables used by other PQ2 components
-TString flog;
-TString ferr;
-TString fres;
-Int_t gverbose = 0;
-
-void PrintDeprecation(bool withctx = true)
-{
-   if (withctx) printf(" \n");
-   printf(" NB: The PQ2 tools are deprecated and not maintained any longer and will be removed in ROOT v6.16/00\n");
-   printf("     Please contact the ROOT team in the unlikely event this change is disruptive for your workflow.\n");
-   if (withctx) printf(" \n");
-}
-
-
-//_____________________________batch only_____________________
-int main(int argc, char **argv)
-{
-
-   // Request for help?
-   if (argc > 1 && !strcmp(argv[1],"-h")) {
-      printf(" \n");
-      printf(" PQ2 functionality\n");
-      printf(" \n");
-      printf(" Usage:\n");
-      printf(" \n");
-      printf(" $ ./pq2 [-h] [-v] [-k] <action> [-d datasetname|datasetfile] [-s server] -u serviceurl\n");
-      printf(" \n");
-      printf(" Arguments:\n");
-      printf("   -h            prints this menu\n");
-      printf("   -v            verbose mode\n");
-      printf("   -k            keep temporary files\n");
-      printf("   <action>      ls, ls-files, ls-files-server, info-server, put, rm, verify\n");
-      printf("   datasetname   Name of the dataset; the wild card '*' is accepted: in \n");
-      printf("                 such a case the full path - as shown by pq2-ls - must \n");
-      printf("                 be given in quotes, e.g. \"/default/ganis/h1-set5*\"\n");
-      printf("                 (applies to: ls-files, ls-files-server, rm, verify\n");
-      printf("   datasetfile   Path to the file with the list of files in the dataset or \n");
-      printf("                 directory with the files containing the file lists of the \n");
-      printf("                 datasets to be registered; in the first case wildcards '*' \n");
-      printf("                 can be specified in the file name, i.e. \"<dir>/fil*\" is ok \n");
-      printf("                 but \"<dir>/*/file\" is not. In all cases the name of the \n");
-      printf("                 dataset is the name of the file finally used\n");
-      printf("                 (applies to: put)\n");
-      printf("   server        Name of the server for which the information is wanted; can be in \n");
-      printf("                 URL form \n");
-      printf("                 (applies to: ls-files-server, info-server)\n");
-      printf("   serviceurl    entry point of the service to be used to get the information (PROOF master\n");
-      printf("                 or data server) in the form '[user@]host.domain[:port]'\n");
-      printf(" \n");
-      PrintDeprecation(false);
-      printf(" \n");
-      gSystem->Exit(0);
-   }
-
-   PrintDeprecation();
-
-   // Parse options
-   const char *action = 0;
-   const char *url = 0;
-   const char *dataset = 0;
-   const char *servers = 0;
-   const char *options = 0;
-   const char *ignsrvs = 0;
-   const char *excsrvs = 0;
-   const char *metrics = 0;
-   const char *fout = 0;
-   const char *plot = 0;
-   const char *infile = 0;
-   const char *outfile = 0;
-   const char *redir = 0;
-   Int_t i = 1;
-   while (i < argc) {
-      if (!strcmp(argv[i],"-h")) {
-         // Ignore if not first argument
-         i++;
-      } else if (!strcmp(argv[i],"-d")) {
-         if (i+1 == argc || argv[i+1][0] == '-') {
-            Printf(" -d should be followed by a string: ignoring");
-            i++;
-         } else {
-            dataset = argv[i+1];
-            i += 2;
-         }
-      } else if (!strcmp(argv[i],"-o")) {
-         if (i+1 == argc || argv[i+1][0] == '-') {
-            Printf(" -o should be followed by a string: ignoring");
-            i++;
-         } else {
-            options = argv[i+1];
-            i += 2;
-         }
-      } else if (!strcmp(argv[i],"-e") ||!strcmp(argv[i],"--exclude") ) {
-         if (i+1 == argc || argv[i+1][0] == '-') {
-            Printf(" -e or --exclude should be followed by a string: ignoring");
-            i++;
-         } else {
-            excsrvs = argv[i+1];
-            i += 2;
-         }
-      } else if (!strcmp(argv[i],"-i") ||!strcmp(argv[i],"--ignore") ) {
-         if (i+1 == argc || argv[i+1][0] == '-') {
-            Printf(" -i or --ignore should be followed by a string: ignoring");
-            i++;
-         } else {
-            ignsrvs = argv[i+1];
-            i += 2;
-         }
-      } else if (!strcmp(argv[i],"-s") || !strcmp(argv[i],"--servers")) {
-         if (i+1 == argc || argv[i+1][0] == '-') {
-            Printf(" -s or --servers should be followed by a string: ignoring");
-            i++;
-         } else {
-            servers = argv[i+1];
-            i += 2;
-         }
-      } else if (!strcmp(argv[i],"-m")) {
-         if (i+1 == argc || argv[i+1][0] == '-') {
-            Printf(" -m should be followed by a string: ignoring");
-            i++;
-         } else {
-            metrics = argv[i+1];
-            i += 2;
-         }
-      } else if (!strcmp(argv[i],"-f")) {
-         if (i+1 == argc || argv[i+1][0] == '-') {
-            Printf(" -f should be followed by a string: ignoring");
-            i++;
-         } else {
-            fout = argv[i+1];
-            i += 2;
-         }
-      } else if (!strcmp(argv[i],"-r")) {
-         if (i+1 == argc || argv[i+1][0] == '-') {
-            Printf(" -r should be followed by a string: ignoring");
-            i++;
-         } else {
-            redir = argv[i+1];
-            i += 2;
-         }
-      } else if (!strcmp(argv[i],"-u")) {
-         if (i+1 == argc || argv[i+1][0] == '-') {
-            Printf(" -u should be followed by a string: ignoring");
-            i++;
-         } else {
-            url = argv[i+1];
-            i += 2;
-         }
-      } else if (!strcmp(argv[i],"--plot")) {
-         if (i+1 == argc || argv[i+1][0] == '-') {
-            plot = "plot.png";
-            i++;
-         } else {
-            plot = argv[i+1];
-            i += 2;
-         }
-      } else if (!strcmp(argv[i],"--infile")) {
-         if (i+1 == argc || argv[i+1][0] == '-') {
-            Printf(" --infile should be followed by a string: ignoring");
-            i++;
-         } else {
-            infile = argv[i+1];
-            i += 2;
-         }
-      } else if (!strcmp(argv[i],"--outfile")) {
-         if (i+1 == argc || argv[i+1][0] == '-') {
-            Printf(" --outfile should be followed by a string: ignoring");
-            i++;
-         } else {
-            outfile = argv[i+1];
-            i += 2;
-         }
-      } else if (!strncmp(argv[i],"-v",2)) {
-         gverbose++;
-         if (!strncmp(argv[i],"-vv", 3)) gverbose++;
-         if (!strncmp(argv[i],"-vvv", 4)) gverbose++;
-         i++;
-      } else if (!strncmp(argv[i],"-k",2)) {
-         gkeep++;
-         i++;
-      } else {
-         action = argv[i];
-         i++;
-      }
-   }
-   if (!action) {
-      Printf("Specifying an action is mandatory - exit");
-      gSystem->Exit(1);
-   }
-   if (gverbose > 0) Printf("action: %s (url: %s)", action, url);
-
-   // Find out the action index
-   const int nact = 9;
-   const char *actions[nact] = { "ls", "ls-files", "ls-files-server",
-                                 "info-server", "put", "rm", "verify",
-                                 "ana-dist", "cache" };
-   const char *tags[nact]    = { "ls", "lsfiles", "filessrv",
-                                 "infosrv", "put", "rm", "vfy", "anadist", "cache" };
-   const char *tag = 0;
-   Int_t iact = -1;
-   for (i = 0; i < nact; i++) {
-      if (action && !strcmp(action, actions[i])) {
-         iact = i;
-         tag = tags[i];
-      }
-   }
-   if (iact == -1) {
-      Printf("Unknown action: %d (%s)", iact, action ? action : "");
-      gSystem->Exit(1);
-   }
-
-   // Unique temporary dir
-   if (gverbose > 0) Printf("Tmp dir: %s", gSystem->TempDirectory());
-   TString tdir(gSystem->TempDirectory());
-   UserGroup_t *ug = gSystem->GetUserInfo(gSystem->GetUid());
-   if (ug) {
-      if (!(tdir.EndsWith(ug->fUser))) {
-         if (!(tdir.EndsWith("/"))) tdir += "/";
-         tdir += ug->fUser;
-      }
-      SafeDelete(ug);
-   }
-   if (gSystem->AccessPathName(tdir) && gSystem->mkdir(tdir, kTRUE) != 0) {
-      Printf("Could create temp directory at: %s", tdir.Data());
-      gSystem->Exit(1);
-   }
-   flog.Form("%s/pq2%s.log", tdir.Data(), tag);
-   ferr.Form("%s/pq2%s.err", tdir.Data(), tag);
-   fres.Form("%s/pq2%s.res", tdir.Data(), tag);
-   if (!gSystem->AccessPathName(ferr)) gSystem->Unlink(ferr);
-   if (!gSystem->AccessPathName(flog)) gSystem->Unlink(flog);
-   if (!gSystem->AccessPathName(fres)) gSystem->Unlink(fres);
-
-   // Check URL
-   bool def_proof= 0;
-   if (!url) {
-      // List of actions to be done via server
-      TString dsmgracts = getenv("PQ2DSSRVACTS") ? getenv("PQ2DSSRVACTS")
-                                                 : "ls:lsfiles:filessrv:infosrv:anadist:cache:" ;
-      // Determine the server to be used
-      TString atag(TString::Format("%s:", tag));
-      if (dsmgracts.Contains(atag) && getenv("PQ2DSSRVURL")) {
-         url = getenv("PQ2DSSRVURL");
-      } else if (getenv("PROOFURL") || getenv("PQ2PROOFURL")) {
-         url = getenv("PQ2PROOFURL") ? getenv("PQ2PROOFURL") : getenv("PROOFURL");
-         def_proof = 1;
-      } else {
-         Printf("Specifying a service URL is mandatory - exit");
-         gSystem->Exit(1);
-      }
-   }
-   if (gverbose > 0) Printf("Checking URL: %s", url ? url : "--undef--");
-   Int_t urlrc = checkUrl(url, flog.Data(), def_proof);
-   if (urlrc < 0) {
-      Printf("Specified URL does not identifies a running service: %s", url);
-      gSystem->Exit(1);
-   }
-
-   Int_t rc = 0;
-   try {
-      if (iact == 0) {
-         // ls
-         do_ls(dataset, options);
-
-      } else if (iact == 1) {
-         // ls-files
-         do_ls_files_server(dataset, 0);
-
-      } else if (iact == 2) {
-         // ls-files-server
-         do_ls_files_server(dataset, servers);
-
-      } else if (iact == 3) {
-         // info-server
-         do_info_server(servers);
-
-      } else if (iact == 4) {
-         // put
-         do_put(dataset, options);
-
-      } else if (iact == 5) {
-         // rm
-         do_rm(dataset);
-
-      } else if (iact == 6) {
-         // verify
-         rc = do_verify(dataset, options, redir);
-
-      } else if (iact == 7) {
-         // ana-dist
-         do_anadist(dataset, servers, ignsrvs, excsrvs, metrics, fout, plot, outfile, infile);
-
-      } else if (iact == 8) {
-         // cache
-         bool clear = (options && !strcmp(options, "clear")) ? 1 : 0;
-         do_cache(clear, dataset);
-
-      } else {
-         // Unknown
-         Printf("Unknown action code: %d - Protocol error?", iact);
-      }
-   }
-   catch (std::exception& exp) {
-      Printf("Standard exception caught: '%s' - We exit whatever it is ...", exp.what());
-      gSystem->Exit(rc);
-   }
-   catch (const char *str) {
-      Printf("Exception thrown: %s", str);
-   }
-   // handle every exception
-   catch (...) {
-      Printf("Handle uncaugth exception, terminating");
-   }
-
-   if (!gSystem->AccessPathName(ferr)) {
-      showFile(ferr, 1, gkeep);
-   } else {
-      if (!gSystem->AccessPathName(flog)) showFile(flog, gverbose, gkeep);
-      if (!gSystem->AccessPathName(fres)) showFile(fres, 1, gkeep);
-   }
-   if (gkeep > 0) {
-      Printf("Temporary files kept: ");
-      if (!gSystem->AccessPathName(ferr)) Printf(" -> %s", ferr.Data());
-      if (!gSystem->AccessPathName(flog)) Printf(" -> %s", flog.Data());
-      if (!gSystem->AccessPathName(fres)) Printf(" -> %s", fres.Data());
-   }
-
-   PrintDeprecation();
-
-   gSystem->Exit(rc);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Display the content of file 'fn'
-
-void showFile(const char *fn, int show, int keep)
-{
-   if (fn && strlen(fn)) {
-      FileStat_t st;
-      if (gSystem->GetPathInfo(fn, st) != 0 || !R_ISREG(st.fMode)) {
-         Printf("File '%s' cannot be stated or is not regular: ignoring", fn);
-         return;
-      }
-      if (show > 0) { TMacro m(fn); m.Print(); }
-      if (keep == 0) gSystem->Unlink(fn);
-   }
-}
diff --git a/proof/pq2/src/pq2ping.cxx b/proof/pq2/src/pq2ping.cxx
deleted file mode 100644
index 4a47b6caa7a..00000000000
--- a/proof/pq2/src/pq2ping.cxx
+++ /dev/null
@@ -1,292 +0,0 @@
-// @(#)root/proof:$Id$
-// Author: G. Ganis, Mar 2010
-
-/*************************************************************************
- * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
- * All rights reserved.                                                  *
- *                                                                       *
- * For the licensing terms see $ROOTSYS/LICENSE.                         *
- * For the list of contributors see $ROOTSYS/README/CREDITS.             *
- *************************************************************************/
-
-// ************************************************************************* //
-// *                                                                       * //
-// *                           p q 2 p i n g                               * //
-// *                                                                       * //
-// * This file implements the daemon checking functions used by pq2main    * //
-// *                                                                       * //
-// ************************************************************************* //
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "Bytes.h"
-#include "TSocket.h"
-#include "TString.h"
-#include "TSystem.h"
-#include "TUrl.h"
-
-#include "redirguard.h"
-#include "pq2ping.h"
-
-// Auxilliary structures for Xrootd/Xproofd pinging ...
-// The client request
-typedef struct {
-   int first;
-   int second;
-   int third;
-   int fourth;
-   int fifth;
-} clnt_HS_t;
-// The body received after the first handshake's header
-typedef struct {
-   int msglen;
-   int protover;
-   int msgval;
-} srv_HS_t;
-
-// Global variables used by other PQ2 components
-TUrl    gUrl;
-Bool_t  gIsProof = kFALSE;
-
-// Global variables defined by other PQ2 components
-extern Int_t gverbose;
-
-////////////////////////////////////////////////////////////////////////////////
-/// Check if something is running at gUrl
-/// Return
-///        0 if OK and data server
-///        1 if OK and PROOF server
-///       -1 if nothing valid is available
-
-Int_t checkUrl(const char *url, const char *flog, bool def_proof)
-{
-   gIsProof = kFALSE;
-   gUrl.SetUrl(url);
-   TString protocol(gUrl.GetProtocol());
-   if (protocol == "root" || protocol == "xroot") {
-      // Check Xrootd
-      if (pingXrootdAt() != 0) {
-         Printf("checkUrl: specified URL does not identifies a running (x)rootd server: %s", url);
-         return -1;
-      }
-   } else if (protocol == "proof") {
-      // Check PROOF
-      if (pingXproofdAt() != 0) {
-         Printf("checkUrl: specified URL does not identifies a running PROOF master: %s", url);
-         return -1;
-      }
-      gIsProof = kTRUE;
-      // Always force a new session (do not attach)
-      gUrl.SetOptions("N");
-   } else {
-      Int_t rc = -1;
-      if (def_proof) {
-         // Check first PROOF
-         {  redirguard rog(flog, "a", 0);
-            if ((rc = pingXproofdAt()) == 0)
-               gIsProof = kTRUE;
-         }
-         if (rc != 0) {
-            // Check also a generic data server
-            if (pingServerAt() != 0) {
-               Printf("checkUrl: specified URL does not identifies a valid PROOF or data server: %s", url);
-               return -1;
-            }
-         }
-      } else {
-         // Check first generic data server
-         {  redirguard rog(flog, "a", 0);
-            rc = pingServerAt();
-         }
-         if (rc != 0) {
-            // Check also PROOF
-            if (pingXproofdAt() != 0) {
-               Printf("checkUrl: specified URL does not identifies a valid data or PROOF server: %s", url);
-               return -1;
-            }
-            gIsProof = kTRUE;
-         }
-      }
-   }
-   if (gverbose > 0) Printf("checkUrl: %s service", (gIsProof ? "PROOF" : "Data"));
-
-   // Done (if we are here the test was successful)
-   return ((gIsProof) ? 1 : 0);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Check if a XrdXrootd service is running on 'port' at 'host'
-/// Return
-///        0 if OK
-///       -1 if nothing is listening on the port (connection cannot be open)
-///        1 if something is listening but not XROOTD
-
-Int_t pingXrootdAt()
-{
-   Int_t port = gUrl.GetPort();
-   const char *host = gUrl.GetHost();
-
-   // Open the connection
-   TSocket s(host, port);
-   if (!(s.IsValid())) {
-      if (gDebug > 0)
-         Printf("pingXrootdAt: could not open connection to %s:%d", host, port);
-      return -1;
-   }
-   // Send the first bytes
-   clnt_HS_t initHS;
-   memset(&initHS, 0, sizeof(initHS));
-   initHS.fourth = host2net((int)4);
-   initHS.fifth  = host2net((int)2012);
-   int len = sizeof(initHS);
-   int writeCount = s.SendRaw(&initHS, len);
-   if (writeCount != len) {
-      if (gDebug > 0)
-         Printf("pingXrootdAt: 1st: wrong number of bytes sent: %d (expected: %d)",
-                writeCount, len);
-      return 1;
-   }
-   // Read first server response
-   int type;
-   len = sizeof(type);
-   int readCount = s.RecvRaw(&type, len); // 4(2+2) bytes
-   if (readCount != len) {
-      if (gDebug > 0)
-         Printf("pingXrootdAt: 1st: wrong number of bytes read: %d (expected: %d)",
-                readCount, len);
-      return 1;
-   }
-   // to host byte order
-   type = net2host(type);
-   // Check if the server is the eXtended proofd
-   if (type == 0) {
-      srv_HS_t xbody;
-      len = sizeof(xbody);
-      readCount = s.RecvRaw(&xbody, len); // 12(4+4+4) bytes
-      if (readCount != len) {
-         if (gDebug > 0)
-            Printf("pingXrootdAt: 2nd: wrong number of bytes read: %d (expected: %d)",
-                   readCount, len);
-         return 1;
-      }
-
-   } else if (type == 8) {
-      // Standard proofd
-      if (gDebug > 0)
-         Printf("pingXrootdAt: server is ROOTD");
-      return 1;
-   } else {
-      // We don't know the server type
-      if (gDebug > 0)
-         Printf("pingXrootdAt: unknown server type: %d", type);
-      return 1;
-   }
-   // Done
-   return 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Check if a XrdProofd service is running on 'port' at 'host'
-/// Return
-///        0 if OK
-///       -1 if nothing is listening on the port (connection cannot be open)
-///        1 if something is listening but not XPROOFD
-
-Int_t pingXproofdAt()
-{
-   Int_t port = gUrl.GetPort();
-   const char *host = gUrl.GetHost();
-
-   // Open the connection
-   TSocket s(host, port);
-   if (!(s.IsValid())) {
-      if (gDebug > 0)
-         Printf("pingXproofdAt: could not open connection to %s:%d", host, port);
-      return -1;
-   }
-   // Send the first bytes
-   int writeCount = -1;
-   clnt_HS_t initHS;
-   memset(&initHS, 0, sizeof(initHS));
-   initHS.third  = (int)host2net((int)1);
-   int len = sizeof(initHS);
-   writeCount = s.SendRaw(&initHS, len);
-   if (writeCount != len) {
-      if (gDebug > 0)
-         Printf("pingXproofdAt: 1st: wrong number of bytes sent: %d (expected: %d)",
-                writeCount, len);
-      return 1;
-   }
-   // These 8 bytes are need by 'proofd' and discarded by XPD
-   int dum[2];
-   dum[0] = (int)host2net((int)4);
-   dum[1] = (int)host2net((int)2012);
-   writeCount = s.SendRaw(&dum[0], sizeof(dum));
-   if (writeCount != sizeof(dum)) {
-      if (gDebug > 0)
-         Printf("pingXproofdAt: 2nd: wrong number of bytes sent: %d (expected: %d)",
-                writeCount, (int) sizeof(dum));
-      return 1;
-   }
-   // Read first server response
-   int type;
-   len = sizeof(type);
-   int readCount = s.RecvRaw(&type, len); // 4(2+2) bytes
-   if (readCount != len) {
-      if (gDebug > 0)
-         Printf("pingXproofdAt: 1st: wrong number of bytes read: %d (expected: %d)",
-                readCount, len);
-      return 1;
-   }
-   // to host byte order
-   type = net2host(type);
-   // Check if the server is the eXtended proofd
-   if (type == 0) {
-      srv_HS_t xbody;
-      len = sizeof(xbody);
-      readCount = s.RecvRaw(&xbody, len); // 12(4+4+4) bytes
-      if (readCount != len) {
-         if (gDebug > 0)
-            Printf("pingXproofdAt: 2nd: wrong number of bytes read: %d (expected: %d)",
-                   readCount, len);
-         return 1;
-      }
-      xbody.protover = net2host(xbody.protover);
-      xbody.msgval = net2host(xbody.msglen);
-      xbody.msglen = net2host(xbody.msgval);
-
-   } else if (type == 8) {
-      // Standard proofd
-      if (gDebug > 0)
-         Printf("pingXproofdAt: server is PROOFD");
-      return 1;
-   } else {
-      // We don't know the server type
-      if (gDebug > 0)
-         Printf("pingXproofdAt: unknown server type: %d", type);
-      return 1;
-   }
-   // Done
-   return 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Check if service is running at 'url'
-/// Return
-///        0 if OK
-///       -1 if nothing is listening at the URL
-///        1 if not a directory
-
-Int_t pingServerAt()
-{
-   Int_t rc = -1;
-   FileStat_t st;
-   if (gSystem->GetPathInfo(gUrl.GetUrl(), st) == 0) {
-      rc = 1;
-      if (R_ISDIR(st.fMode)) rc = 0;
-   }
-
-   // Done
-   return rc;
-}
diff --git a/proof/pq2/src/pq2ping.h b/proof/pq2/src/pq2ping.h
deleted file mode 100644
index 7eae8f1333a..00000000000
--- a/proof/pq2/src/pq2ping.h
+++ /dev/null
@@ -1,30 +0,0 @@
-// @(#)root/proof:$Id$
-// Author: G. Ganis, Mar 2010
-
-/*************************************************************************
- * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
- * All rights reserved.                                                  *
- *                                                                       *
- * For the licensing terms see $ROOTSYS/LICENSE.                         *
- * For the list of contributors see $ROOTSYS/README/CREDITS.             *
- *************************************************************************/
-
-#ifndef PQ2_ping
-#define PQ2_ping
-
-#include "Rtypes.h"
-
-//////////////////////////////////////////////////////////////////////////
-//                                                                      //
-// pq2ping                                                              //
-//                                                                      //
-// Prototypes for functions used in PQ2 functions to check daemons      //
-//                                                                      //
-//////////////////////////////////////////////////////////////////////////
-
-Int_t checkUrl(const char *url, const char *flog, bool def_proof = 0);
-Int_t pingXproofdAt();
-Int_t pingXrootdAt();
-Int_t pingServerAt();
-
-#endif
diff --git a/proof/pq2/src/pq2wrappers.cxx b/proof/pq2/src/pq2wrappers.cxx
deleted file mode 100644
index 571576fb716..00000000000
--- a/proof/pq2/src/pq2wrappers.cxx
+++ /dev/null
@@ -1,290 +0,0 @@
-// @(#)root/proof:$Id$
-// Author: G. Ganis, Mar 2010
-
-/*************************************************************************
- * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
- * All rights reserved.                                                  *
- *                                                                       *
- * For the licensing terms see $ROOTSYS/LICENSE.                         *
- * For the list of contributors see $ROOTSYS/README/CREDITS.             *
- *************************************************************************/
-
-//////////////////////////////////////////////////////////////////////////
-//                                                                      //
-// pq2wrappers                                                          //
-//                                                                      //
-// This file implements the wrapper functions used in PQ2               //
-//                                                                      //
-//////////////////////////////////////////////////////////////////////////
-#include <stdlib.h>
-
-#include "pq2wrappers.h"
-#include "redirguard.h"
-
-#include "TDataSetManager.h"
-#include "TEnv.h"
-#include "TFileInfo.h"
-#include "TPluginManager.h"
-#include "TProof.h"
-#include "TROOT.h"
-
-TDataSetManager *gDataSetManager = 0;
-
-// Global variables defined by other PQ2 components
-extern TUrl    gUrl;
-extern Bool_t  gIsProof;
-extern TString flog;
-extern TString ferr;
-extern TString fres;
-extern Int_t gverbose;
-
-// How to start PROOF (new VerifyDataSet wants it parallel)
-static bool doParallel = kFALSE;
-
-Int_t getProof(const char *where, Int_t verbose = 1);
-Int_t getDSMgr(const char *where);
-
-////////////////////////////////////////////////////////////////////////////////
-/// ShowCache wrapper
-
-void DataSetCache(bool clear, const char *ds)
-{
-   if (gIsProof) {
-      doParallel = kFALSE;
-      if (!gProof && getProof("DataSetCache", 0) != 0) return;
-      return (clear ? gProof->ClearDataSetCache(ds) : gProof->ShowDataSetCache(ds));
-   } else {
-      if (!gDataSetManager && getDSMgr("DataSetCache") != 0) return;
-      Int_t rc = (clear) ? gDataSetManager->ClearCache(ds) : gDataSetManager->ShowCache(ds);
-      if (rc != 0)
-         Printf("DataSetCache: problems running '%s'", (clear ? "clear" : "show"));
-      return;
-   }
-   // Done
-   return;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// ShowDataSets wrapper
-
-void ShowDataSets(const char *ds, const char *opt)
-{
-   if (gIsProof) {
-      doParallel = kFALSE;
-      if (!gProof && getProof("ShowDataSets", 0) != 0) return;
-      return gProof->ShowDataSets(ds, opt);
-   } else {
-      if (!gDataSetManager && getDSMgr("ShowDataSets") != 0) return;
-      return gDataSetManager->ShowDataSets(ds, opt);
-   }
-   // Done
-   return;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// GetDataSet wrapper
-
-TFileCollection *GetDataSet(const char *ds, const char *server)
-{
-   TFileCollection *fc = 0;
-   if (gIsProof) {
-      doParallel = kFALSE;
-      if (!gProof && getProof("GetDataSet") != 0) return fc;
-      return gProof->GetDataSet(ds, server);
-   } else {
-      if (!gDataSetManager && getDSMgr("ShowDataSets") != 0) return fc;
-      return gDataSetManager->GetDataSet(ds, server);
-   }
-   // Done
-   return fc;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// GetDataSets wrapper
-
-TMap *GetDataSets(const char *owner, const char *server, const char *opt)
-{
-   TMap *dss = 0;
-   if (gIsProof) {
-      doParallel = kFALSE;
-      if (!gProof && getProof("GetDataSets") != 0) return dss;
-      return gProof->GetDataSets(owner, server);
-   } else {
-      if (!gDataSetManager && getDSMgr("GetDataSets") != 0) return dss;
-      // Get the datasets and fill a map
-      UInt_t oo = (opt && !strcmp(opt, "list")) ? (UInt_t)TDataSetManager::kList
-                                                : (UInt_t)TDataSetManager::kExport;
-      dss = gDataSetManager->GetDataSets(owner, oo);
-      // If defines, option gives the name of a server for which to extract the information
-      if (dss) {
-         if (server && strlen(server) > 0) {
-            // The return map will be in the form   </group/user/datasetname> --> <dataset>
-            TMap *rmap = new TMap;
-            TObject *k = 0;
-            TFileCollection *fc = 0, *xfc = 0;
-            TIter nxd(dss);
-            while ((k = nxd()) && (fc = (TFileCollection *) dss->GetValue(k))) {
-               // Get subset on specified server, if any
-               if ((xfc = fc->GetFilesOnServer(server))) {
-                  rmap->Add(new TObjString(k->GetName()), xfc);
-               }
-            }
-            dss->DeleteAll();
-            delete dss;
-            dss = 0;
-            if (rmap->GetSize() > 0) {
-               dss = rmap;
-            } else {
-               Printf("GetDataSets: no dataset found on server '%s' for owner '%s'", server, owner);
-               delete rmap;
-            }
-         }
-      } else  {
-         Printf("GetDataSets: no dataset found for '%s'", owner);
-      }
-   }
-   // Done
-   return dss;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// RemoveDataSet wrapper
-
-Int_t RemoveDataSet(const char *dsname)
-{
-   if (gIsProof) {
-      doParallel = kFALSE;
-      if (!gProof && getProof("RemoveDataSet") != 0) return -1;
-      return gProof->RemoveDataSet(dsname);
-   } else {
-      if (!gDataSetManager && getDSMgr("RemoveDataSet") != 0) return -1;
-      return gDataSetManager->RemoveDataSet(dsname);
-   }
-   // Done
-   return -1;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// VerifyDataSet wrapper
-
-Int_t VerifyDataSet(const char *dsname, const char *opt, const char *redir)
-{
-   Int_t rc = -1;
-   // Honour the 'redir' if required
-   TString srvmaps;
-   if (redir && strlen(redir) > 0) srvmaps.Form("|%s", redir);
-   if (gIsProof) {
-      // Honour the 'redir' if required
-      if (!(srvmaps.IsNull())) {
-         TProof::AddEnvVar("DATASETSRVMAPS", srvmaps);
-      }
-      TString sopt(opt);
-      doParallel = (sopt.Contains("S")) ? kFALSE : kTRUE;
-      if (gProof && doParallel && gProof->GetParallel() == 0) {
-         gProof->Close();
-         delete gProof;
-         gProof = 0;
-      }
-      if (!gProof && getProof("VerifyDataSet") != 0) return -1;
-      if ((rc = gProof->VerifyDataSet(dsname, opt)) == 0) {
-         // Success; partial at least. Check if all files are staged
-         TFileCollection *fcs = gProof->GetDataSet(dsname, "S:");
-         if (fcs && fcs->GetStagedPercentage() < 99.99999) rc = 1;
-      }
-   } else {
-      // Honour the 'redir' if required
-      if (!(srvmaps.IsNull())) {
-         gEnv->SetValue("DataSet.SrvMaps", srvmaps);
-      }
-      if (!gDataSetManager && getDSMgr("VerifyDataSet") != 0) return -1;
-      if ((rc = gDataSetManager->ScanDataSet(dsname, opt)) == 0) {
-         // Success; partial at least. Check if all files are staged
-         TFileCollection *fcs = gDataSetManager->GetDataSet(dsname, "S:");
-         if (fcs && fcs->GetStagedPercentage() < 99.99999) rc = 1;
-      }
-   }
-   // Done
-   return rc;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// ExistsDataSet wrapper
-
-Bool_t ExistsDataSet(const char *dsname)
-{
-   if (gIsProof) {
-      doParallel = kFALSE;
-      if (!gProof && getProof("ExistsDataSet") != 0) return kFALSE;
-      return gProof->ExistsDataSet(dsname);
-   } else {
-      if (!gDataSetManager && getDSMgr("ExistsDataSet") != 0) return kFALSE;
-      return gDataSetManager->ExistsDataSet(dsname);
-   }
-   return kFALSE;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// RegisterDataSet wrapper
-
-Int_t RegisterDataSet(const char *dsname, TFileCollection *fc, const char* opt)
-{
-   if (gIsProof) {
-      doParallel = kFALSE;
-      if (!gProof && getProof("GetDataSet") != 0) return -1;
-      return gProof->RegisterDataSet(dsname, fc, opt);
-   } else {
-      if (!gDataSetManager && getDSMgr("RegisterDataSet") != 0) return -1;
-      return gDataSetManager->RegisterDataSet(dsname, fc, opt);
-   }
-   return -1;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Open a PROOF session at gUrl
-
-Int_t getProof(const char *where, Int_t verbose)
-{
-   {  redirguard rog(flog.Data(), "a", verbose);
-      const char *popt = (doParallel) ? "" : "masteronly";
-      TProof::Open(gUrl.GetUrl(), popt);
-   }
-   if (!gProof || !gProof->IsValid()) {
-      Printf("getProof:%s: problems starting a PROOF session at '%s'", where, gUrl.GetUrl());
-      return -1;
-   }
-   if (gverbose >= 2) gProof->SetLogLevel(2);
-   // Done
-   return 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Open a dataset manager for gUrl
-
-Int_t getDSMgr(const char *where)
-{
-   Int_t rc = -1;
-   if (gROOT->GetPluginManager()) {
-      // Find the appropriate handler
-      TPluginHandler *h = gROOT->GetPluginManager()->FindHandler("TDataSetManager", "file");
-      if (h && h->LoadPlugin() != -1) {
-         TString group(getenv("PQ2GROUP")), user(getenv("PQ2USER"));
-         TString dsm, opt("opt:-Ar:-Av:");
-         const char *o = getenv("PQ2DSMGROPTS");
-         if (o) {
-            opt = "";
-            if (strlen(o) > 0) opt.Form("opt:%s", o);
-         }
-         dsm.Form("file dir:%s %s", gUrl.GetUrl(), opt.Data());
-         gDataSetManager = reinterpret_cast<TDataSetManager*>(h->ExecPlugin(3,
-                                                              group.Data(), user.Data(),
-                                                              dsm.Data()));
-         if (gDataSetManager) {
-            rc = 0;
-         } else {
-            Printf("getDSMgr:%s: problems creating a dataset manager at '%s'", where, gUrl.GetUrl());
-         }
-      }
-   }
-   // Done
-   return rc;
-}
diff --git a/proof/pq2/src/pq2wrappers.h b/proof/pq2/src/pq2wrappers.h
deleted file mode 100644
index d02c1ea962a..00000000000
--- a/proof/pq2/src/pq2wrappers.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// @(#)root/proof:$Id$
-// Author: G. Ganis, Mar 2010
-
-/*************************************************************************
- * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
- * All rights reserved.                                                  *
- *                                                                       *
- * For the licensing terms see $ROOTSYS/LICENSE.                         *
- * For the list of contributors see $ROOTSYS/README/CREDITS.             *
- *************************************************************************/
-
-#ifndef PQ2_wrappers
-#define PQ2_wrappers
-
-//////////////////////////////////////////////////////////////////////////
-//                                                                      //
-// pq2wrappers                                                          //
-//                                                                      //
-// Prototypes for wrapper functions used in PQ2                         //
-//                                                                      //
-//////////////////////////////////////////////////////////////////////////
-
-#include "TFileCollection.h"
-#include "TMap.h"
-
-void             DataSetCache(bool clear, const char *ds);
-void             ShowDataSets(const char *ds, const char *opt = "");
-TFileCollection *GetDataSet(const char *ds, const char *server = "");
-TMap            *GetDataSets(const char *owner = "", const char *server = "", const char *opt = 0);
-Int_t            RemoveDataSet(const char *dsname);
-Int_t            VerifyDataSet(const char *dsname, const char *opt = 0, const char *redir = 0);
-Bool_t           ExistsDataSet(const char *dsname);
-Int_t            RegisterDataSet(const char *dsname, TFileCollection *fc, const char *opt = "");
-
-#endif
diff --git a/proof/pq2/src/redirguard.cxx b/proof/pq2/src/redirguard.cxx
deleted file mode 100644
index 0f8de44daac..00000000000
--- a/proof/pq2/src/redirguard.cxx
+++ /dev/null
@@ -1,20 +0,0 @@
-// @(#)root/proof:$Id$
-// Author: G. Ganis, Mar 2010
-
-/*************************************************************************
- * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
- * All rights reserved.                                                  *
- *                                                                       *
- * For the licensing terms see $ROOTSYS/LICENSE.                         *
- * For the list of contributors see $ROOTSYS/README/CREDITS.             *
- *************************************************************************/
-
-//////////////////////////////////////////////////////////////////////////
-//                                                                      //
-// redirguard                                                           //
-//                                                                      //
-// Auxilliary class used in PQ2 functions to redirect the logs          //
-//                                                                      //
-//////////////////////////////////////////////////////////////////////////
-
-#include "redirguard.h"
diff --git a/proof/pq2/src/redirguard.h b/proof/pq2/src/redirguard.h
deleted file mode 100644
index 237a19c39c7..00000000000
--- a/proof/pq2/src/redirguard.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// @(#)root/proof:$Id$
-// Author: G. Ganis, Mar 2010
-
-/*************************************************************************
- * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
- * All rights reserved.                                                  *
- *                                                                       *
- * For the licensing terms see $ROOTSYS/LICENSE.                         *
- * For the list of contributors see $ROOTSYS/README/CREDITS.             *
- *************************************************************************/
-
-#ifndef PQ2_redirguard
-#define PQ2_redirguard
-
-//////////////////////////////////////////////////////////////////////////
-//                                                                      //
-// redirguard                                                        //
-//                                                                      //
-// Auxilliary class used in PQ2 functions to redirect the logs          //
-//                                                                      //
-//////////////////////////////////////////////////////////////////////////
-
-#include "TSystem.h"
-
-class redirguard {
-private:
-   RedirectHandle_t fRH;
-   Bool_t           fDoIt;
-public:
-   redirguard(const char *fn, const char *mode = "a", Int_t doit = 0)
-       { fDoIt = (doit == 0) ? kTRUE : kFALSE;
-         if (fDoIt) gSystem->RedirectOutput(fn, mode, &fRH); }
-   ~redirguard() { if (fDoIt) gSystem->RedirectOutput(0, 0, &fRH); }
-};
-#endif
-- 
GitLab