Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:12:33

0001 #!/bin/bash
0002 
0003 for RUN in `cat RunList.txt`; do
0004 
0005 #cp dbfile_31X_IdealConditions.db dbfile.db
0006 
0007 IOVLIST=`echo $IOVLIST $RUN`
0008 
0009 DATASET=`echo $RUN | cut -c 1-3`
0010 AFSPATH=/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/data/Express/$DATASET
0011 DQMFILE=DQM_V0001_R000${RUN}__ExpressMuon__CRAFT09-Express-v1__FEVT.root
0012 
0013 echo "Analyzing Run $RUN ..."
0014 echo "Using Dataset: $DATASET"
0015 echo "Using DQMFile: $DQMFILE"
0016 
0017 echo "Creating BadAPVIdentifier config from template"
0018 cat template_SiStripQualityBadAPVIdentifierRoot_cfg.py |sed -e "s@insertRun@$RUN@g" -e "s@insertCastorPath@$AFSPATH@" -e "s@insertDataset@$DATASET@" -e "s@insertDQMFile@$DQMFILE@" > SiStripQualityBadAPVIdentifierRoot_cfg.py
0019 
0020 echo "Starting cmsRun BadAPVIdentifier"
0021 cmsRun SiStripQualityBadAPVIdentifierRoot_cfg.py
0022 
0023 echo "Creating HotStripIdentification config from template"
0024 cat template_SiStripQualityHotStripIdentifierRoot_cfg.py |sed -e "s@insertRun@$RUN@g" -e "s@insertCastorPath@$AFSPATH@" -e "s@insertDataset@$DATASET@" -e "s@insertDQMFile@$DQMFILE@" > SiStripQualityHotStripIdentifierRoot_cfg.py
0025 
0026 echo "Starting cmsRun HotStripIdentification"
0027 cmsRun SiStripQualityHotStripIdentifierRoot_cfg.py
0028 
0029 echo "Creating Merge config from template"
0030 cat template_SiStripBadComponents_merge_cfg.py |sed -e "s@insertRun@$RUN@g" > SiStripBadComponents_merge_cfg.py
0031 
0032 echo "Starting cmsRun Merge"
0033 cmsRun SiStripBadComponents_merge_cfg.py
0034 
0035 echo "Creating SiStripQualityStatistics_offline config from template"
0036 cat template_SiStripQualityStatistics_offline_cfg.py |sed -e "s@insertRun@$RUN@" > SiStripQualityStatistics_offline_cfg.py
0037 
0038 echo "Starting cmsRun SiStripQualityStatistics_offline"
0039 cmsRun SiStripQualityStatistics_offline_cfg.py > out.tmp
0040 
0041 cat out.tmp | awk 'BEGIN{doprint=0}{if(match($0,"New IOV")!=0) doprint=1;if(match($0,"%MSG")!=0) {doprint=0;print "";} if(doprint==1) print $0}' > BadComponents_$RUN.txt
0042 
0043 rm out.tmp
0044 
0045 echo "Creating the directories on cmstac12 in /data/local1/cmstkmtc/CRAFTReproIn31X/output/BadStripAnalysis/GR09/$RUN"
0046 mkdir /data/local1/cmstkmtc/CRAFTReproIn31X/output/BadStripAnalysis/GR09/$RUN
0047 mkdir /data/local1/cmstkmtc/CRAFTReproIn31X/output/BadStripAnalysis/GR09/$RUN/ExpressTightlyFiltered
0048 mkdir /data/local1/cmstkmtc/CRAFTReproIn31X/output/BadStripAnalysis/GR09/$RUN/ExpressTightlyFiltered/TkMap
0049 
0050 echo "Moving the output files to the proper directories"
0051 cp dbfile.db /data/local1/cmstkmtc/CRAFTReproIn31X/output/BadStripAnalysis/GR09/$RUN/ExpressTightlyFiltered
0052 mv BadAPVOccupancy_${RUN}.root BadComponents_${RUN}.txt HotStripsOccupancy_${RUN}.root /data/local1/cmstkmtc/CRAFTReproIn31X/output/BadStripAnalysis/GR09/$RUN/ExpressTightlyFiltered
0053 mv TkMapBadComponents_offline* /data/local1/cmstkmtc/CRAFTReproIn31X/output/BadStripAnalysis/GR09/$RUN/ExpressTightlyFiltered/TkMap
0054 
0055 echo "Run $RUN finished"
0056 
0057 done;
0058 
0059 echo "Preparing the sqlite and metadata files"
0060 FIRSTRUN=`cat RunList.txt | awk '{if(NR==1) print $1}'`
0061 
0062 ID1=`uuidgen -t`
0063 cp dbfile.db SiStripHotAPVs@${ID1}.db
0064 cat template_SiStripHotAPVs.txt | sed -e "s@insertFirstRun@$FIRSTRUN@g" -e "s@insertIOV@$IOVLIST@" > SiStripHotAPVs@${ID1}.txt
0065 
0066 ID2=`uuidgen -t`
0067 cp dbfile.db SiStripHotStrips@${ID2}.db
0068 cat template_SiStripHotStrips.txt | sed -e "s@insertFirstRun@$FIRSTRUN@g" -e "s@insertIOV@$IOVLIST@" > SiStripHotStrips@${ID2}.txt
0069 
0070 ID3=`uuidgen -t`
0071 cp dbfile.db SiStripHotComponents_merged@${ID3}.db
0072 cat template_SiStripHotComponents_merged.txt | sed -e "s@insertFirstRun@$FIRSTRUN@g" -e "s@insertIOV@$IOVLIST@" > SiStripHotComponents_merged@${ID3}.txt
0073 
0074 echo "-----------------------------------"
0075 echo "Sqlite and metadata files are ready"
0076 echo "1st Sqlite: SiStripHotAPVs@${ID1}.db, 1st Metadata: SiStripHotAPVs@${ID1}.txt"
0077 echo "2nd Sqlite: SiStripHotStrips@${ID2}.db, 2nd Metadata: SiStripHotStrips@${ID2}.txt"
0078 echo "3rd Sqlite: SiStripHotComponents_merged@${ID3}.db, 3rd Metadata: SiStripHotComponents_merged@${ID3}.txt"
0079 echo "-----------------------------------"
0080 echo "Now the sqlite and corresponding metadata files have to be moved to the Popcon dropbox!"
0081 echo "Do: scp <sqlite-file> <metadata-file> <username>@cmsusr5:/nfshome0/popcondev/SiStripJob"