Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:32:53

0001 #!/bin/bash
0002 
0003 if [ $# -ne 2 ]; then
0004     echo "usage: ./compare.sh CMSSW_RELEASE_1 CMSSW_RELEASE_2"
0005     exit 1
0006 fi
0007 release1=$1
0008 release2=$2
0009 #dqmdir="/tas03/home/jribnik/devel/muonidval/dqm/fastsim"
0010 dqmdir="/tas03/home/jribnik/devel/muonidval/dqm"
0011 
0012 echo "Reticulating spline for $release1/$release2 comparison..."
0013 #Format of a standard RECO DQM file
0014 #DQM_V0001_R000000001__RelValSingleMuPt100__CMSSW_3_6_0_pre1-MC_3XY_V21-v2__GEN-SIM-RECO.root
0015 #Format of a FastSim DQM file
0016 #DQM_V0001_R000000001__RelValSingleMuPt100__CMSSW_3_6_0_pre1-MC_3XY_V21_FastSim-v1__GEN-SIM-DIGI-RECO.root
0017 
0018 file1s=(`find -L $dqmdir -maxdepth 1 -name "DQM_V0001_R000000001__*__${release1}-*__*.root"`)
0019 if [ ${#file1s[@]} -eq 0 ]; then
0020     echo "No samples found for $release1. Exiting."
0021     exit 2
0022 fi
0023 
0024 for file1 in ${file1s[@]}; do
0025     isfastsim=0
0026     echo $file1 | grep FastSim >/dev/null
0027     if [ $? -eq 0 ]; then
0028         isfastsim=1
0029     fi
0030 
0031     sample=`echo $file1 | awk -F'__' '{print $2}'`
0032     vfile1=`echo $file1 | awk -F'__' '{print $3}' | awk -F'-' '{print $3}'`
0033     vfile2=""
0034     echo "Found $sample for ${release1}-$vfile1..."
0035 
0036     # Means we did not find a comparable
0037     # sample in the second release
0038     gosolo=0
0039 
0040     file2s=(`find -L $dqmdir -maxdepth 1 -name "DQM_V0001_R000000001__${sample}__${release2}-*-${vfile1}__*.root"`)
0041     if [ ${#file2s[@]} -eq 0 ]; then
0042         # Could be that the given v does not exist
0043         # so we'll compare to v1
0044         file2s=(`find $dqmdir -maxdepth 1 -name "DQM_V0001_R000000001__${sample}__${release2}-*-v1__*.root"`)
0045     fi
0046     if [ ${#file2s[@]} -ne 1 ]; then
0047         echo "but not in $release2. Making non-comparison plots."
0048         gosolo=1
0049     else
0050         vfile2=$(echo ${file2s[0]} | awk -F'__' '{print $3}' | awk -F'-' '{print $3}')
0051         echo "and in ${release2}-${vfile2}. Making comparison plots."
0052     fi
0053 
0054     newdir="${release1}-${vfile1}/$sample"
0055     if [ $gosolo -eq 0 ]; then
0056         newdir="${release1}-${vfile1}_vs_${release2}-${vfile2}/$sample"
0057     fi
0058     mkdir -p $newdir
0059     cd $newdir
0060     cp ../../muonIdVal.C ./
0061     cmd="root -b -l -q 'muonIdVal.C++(\"$file1\")'"
0062     if [ $gosolo -eq 0 ]; then
0063         cmd="root -b -l -q 'muonIdVal.C++(\"$file1\",\"${file2s[0]}\")'"
0064     fi
0065     eval $cmd
0066     rm muonIdVal.C muonIdVal_C.d muonIdVal_C.so
0067     mkdir GlobalMuons TrackerMuons GlobalMuonsNotTrackerMuons TrackerMuonsNotGlobalMuons
0068     mv gm_*.png GlobalMuons
0069     mv tm_*.png TrackerMuons
0070     mv gmntm_*.png GlobalMuonsNotTrackerMuons
0071     mv tmngm_*.png TrackerMuonsNotGlobalMuons
0072     cd -
0073 done