예제 #1
0
   usage: %prog [options] input_workspace.root output_workspace.root old_pattern new_pattern [ old_pattern2 new_pattern2 ...]

   Tool for mass renaming objects in a RooWorkspace.

   WARNING: the program will overwrite the output workspace file without asking for confirmation.

   example:

   %prog --lib $CMSSW_BASE/lib/$SCRAM_ARCH/libHiggsAnalysisCombinedLimit.so input.root output.root \\
      '(.*)_v2$' '\\1'

   will rename e.g. XYZ_v2 to XYZ      

""")

wsutils.addCommonOptions(parser)

parser.add_option(
    "-n",
    dest="dryrun",
    default=False,
    action="store_true",
    help=
    "do NOT run any renaming but just check if renamings would not cause any conflict",
)

(options, ARGV) = parser.parse_args()

sys.argv = []
#----------------------------------------
wsutils.checkCommonOptions(options)
예제 #2
0
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import sys, os, wsutils

from optparse import OptionParser
parser = OptionParser("""

  usage: %prog [options] input_file member1 [ member2 ... ]

  prints the given members of the workspace in the input file
""")

wsutils.addCommonOptions(parser, addSetVars=True)

parser.add_option(
    "-v",
    dest="verbose",
    default=False,
    action="store_true",
    help="call Print with the verbose option",
)

parser.add_option(
    "--brief",
    dest="brief",
    default=False,
    action="store_true",
    help=