File indexing completed on 2024-04-06 12:26:28
0001
0002
0003
0004 eval `scramv1 runtime -sh`
0005
0006 echo -e "\n&&&&&&&&&&&&&&&&&&&&&&&\n Run with Fake SiStripQuality \n&&&&&&&&&&&&&&&&&&&&&&&\n"
0007 cmsRun testClusterizer_FakeQuality.cfg > Fake.out
0008 cat Fake.out | awk '$0~/Seed/{aprint=1} {if(aprint==1) print $0} $0~/Cluster accepted/{aprint=0} $0~/Cluster rejected/{aprint=0}' > Fake.ClusterList.out
0009
0010
0011 echo -e "\n&&&&&&&&&&&&&&&&&&&&&&&\n Extracting bad components \n&&&&&&&&&&&&&&&&&&&&&&&\n"
0012
0013 Number_BadModules=1
0014 Number_BadApv=4
0015 Number_BadChannels=10
0016
0017
0018 cat Fake.ClusterList.out | grep -A1 "Strips on the" | grep detID | awk 'BEGIN{counter=0;apv=-1;detid=-1}{if(counter<c){counter++;print $2" "$4;detid=$2;apv=int($4/128)}else if(counter<b+c){if(detid!=$2 && apv!=int($4/128)){counter++;apv=int($4/128);print $2" "$4;detid=$2}}else if(counter<a+b+c){if(detid!=$2){detid=$2;counter++;print $2" "$4}}}' a=$Number_BadModules b=$Number_BadApv c=$Number_BadChannels > Fake.DetId_Strip_List.out
0019
0020
0021 C=`cat Fake.DetId_Strip_List.out | head -$Number_BadChannels | awk ' BEGIN{detid=-1;a="";flag=0} func printFunc(val){if(flag){print ","}; print "{ uint32 BadModule = "detid" vuint32 BadChannelList = {"val"}}" ; flag=1}{if(detid==-1){detid=$1;a=$2;} if(detid!=$1){printFunc(a); detid=$1; a=$2}else{a=sprintf("%s , %d",a,$2);} } END{printFunc(a)}'`
0022
0023 echo
0024 echo $C
0025
0026 let tot=$Number_BadChannels+$Number_BadApv
0027
0028 B=`cat Fake.DetId_Strip_List.out | head -$tot | tail -$Number_BadApv | awk '{counter++;if(counter!=1){print ","};print "{ uint32 BadModule = "$1 " vuint32 BadApvList = {"int($2/128)"} }" }'`
0029
0030 echo
0031 echo $B
0032
0033 let tot=$Number_BadChannels+$Number_BadApv+$Number_BadModules
0034
0035 A=`cat Fake.DetId_Strip_List.out | head -$tot | tail -$Number_BadModules | awk '{counter++;if(counter!=1){print ","};print $1 }'`
0036
0037 echo
0038 echo $A
0039
0040
0041 echo -e "\n&&&&&&&&&&&&&&&&&&&&&&&\n Create DB \n&&&&&&&&&&&&&&&&&&&&&&&\n"
0042 rm -f dbfile.db
0043 cmscond_bootstrap_detector.pl --offline_connect sqlite_file:dbfile.db --auth /afs/cern.ch/cms/DB/conddb/authentication.xml STRIP
0044
0045
0046 echo -e "\n&&&&&&&&&&&&&&&&&&&&&&&\n Fill DB \n&&&&&&&&&&&&&&&&&&&&&&&\n"
0047
0048 echo -e "create cfg from template"
0049 cat SiStripBadChannel.tpl | sed -e "s@insert_BadModuleList@`echo $A`@" -e "s@insert_BadApvList@`echo $B`@" -e "s@insert_BadChannelList@`echo $C`@" > SiStripBadChannel.cfg
0050 cat SiStripBadApv.tpl | sed -e "s@insert_BadModuleList@`echo $A`@" -e "s@insert_BadApvList@`echo $B`@" -e "s@insert_BadChannelList@`echo $C`@" > SiStripBadApv.cfg
0051 cat SiStripBadModule.tpl | sed -e "s@insert_BadModuleList@`echo $A`@" -e "s@insert_BadApvList@`echo $B`@" -e "s@insert_BadChannelList@`echo $C`@" > SiStripBadModule.cfg
0052
0053 echo "cmsRun SiStripBadModule.cfg > fillDb_module.out"
0054 cmsRun SiStripBadModule.cfg > fillDb_module.out
0055
0056 echo "cmsRun SiStripBadApv.cfg > fillDb_apv.out"
0057 cmsRun SiStripBadApv.cfg > fillDb_apv.out
0058
0059 echo "cmsRun SiStripBadChannel.cfg > fillDb_channel.out"
0060 cmsRun SiStripBadChannel.cfg > fillDb_channel.out
0061
0062
0063 echo "cmsRun testSiStripQualityESProducer.cfg"
0064 cmsRun testSiStripQualityESProducer.cfg
0065
0066 echo -e "\n&&&&&&&&&&&&&&&&&&&&&&&\n Run with Real SiStripQuality \n&&&&&&&&&&&&&&&&&&&&&&&\n"
0067 cmsRun testClusterizer_RealQuality.cfg > Real.out
0068 cat Real.out | awk '$0~/Seed/{aprint=1} {if(aprint==1) print $0} $0~/Cluster accepted/{aprint=0} $0~/Cluster rejected/{aprint=0}' > Real.ClusterList.out
0069
0070 sdiff Real.ClusterList.out Fake.ClusterList.out > thediff.out
0071
0072 echo "look at the thediff.out file, or with emacs"
0073
0074 echo "emacs Real.ClusterList.out Fake.ClusterList.out"