Kalanand's July 2009 Log

   June 2009   
July 2009
   August 2009   

July 7th

History search lines for .cshrc

Here are the magic lines
bindkey -k up    history-search-backward
bindkey -k down  history-search-forward 

python string container: scan for pattern and remove matches

I have container (in fact a cms.untracked.vstring) and want to remove from it all strings that match to a pattern, to be more specific to "[]drop []*[]" where '[]' should indicate an arbitrary number of white space (and '*' is a real '*', not a wild card...).
import re

dropRE = re.compile (r'\s*drop\s+\*\s*')

for line in container:
    # you may need to replace match(line) with match( string(line) )
    if not re.match(line):
        # put line in new container
The beginning and ending spaces in the search are superfluous, but I put them in in case you wanted to force the string to match at the beginning or end of the line e.g.,
dropRE = re.compile (r'^\s*drop\s+\*\s*$')

July 24th

SWGuidePATEventSize < CMS < TWiki

See instructions here https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePATEventSize#Measuring_the_event_size

July 28th

Moving CRAB job output to nobackup disk

Seema kindly provided the following script to move completed job outputs to nobackup.
#!/bin/tcsh -f

set crabjob=${1}
echo ${crabjob}

set dir=`grep outputdir ${crabjob}/share/crab.cfg`
echo ${dir}
set outputdir=`echo ${dir} | cut -f2-6 -d"="`
echo outputdir ${outputdir}

set outfilename=`ls ${outputdir}/*.root | tail -1 | cut -f1 -d"_"`.root
echo ${outfilename}

hadd  ${outfilename} ${outputdir}/*.root

echo "mv to /uscms/home/seema/nobackup/GR09/histoFiles"
mv ${outfilename} /uscms/home/seema/nobackup/GR09/histoFiles/.

Go to June's log

Last modified: Tue Jul 28 16:29:57 CST 2009