Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:08:47

0001 #!/bin/tcsh
0002 
0003 ### Make list of files
0004 
0005 set runorigped=225529
0006 set runorigled=135077
0007 set runoriglas=224708
0008 
0009 set runold = -1
0010 touch list_of_myruns_led
0011 touch list_of_myruns_las
0012 touch list_of_myruns_ped
0013 
0014 set j=0
0015 cat $1 | grep CMS.HCAL | awk '{print $1"!"$2"!"$3"!"$4"!"$5"!"$6"!"$7}' > tmp.list
0016 
0017 foreach i (`cat tmp.list`)
0018 set run=`echo ${i} | awk -F! '{print $1}'`
0019 set year=`echo ${i} | awk -F! '{print $2}' | awk -F - '{print $3}'`
0020 #set year=`echo "20"${year1}`
0021 set month=`echo ${i} | awk -F! '{print $2}' | awk -F - '{print $2}'`
0022 set mymonth = ""
0023 set lll=1
0024 foreach kkk (JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC)
0025 if( ${kkk} == ${month} ) then
0026 set mymonth=`echo "0"${lll}`
0027 endif
0028 @ lll = ${lll} + "1"
0029 end
0030 set mypm=`echo ${i} | awk -F! '{print $4}'`
0031 set day=`echo ${i} | awk -F! '{print $2}' | awk -F - '{print $1}'`
0032 set hour=`echo ${i} | awk -F! '{print $3}' | awk -F . '{print $1}'`
0033 if(${mypm} == "PM") then
0034 @ hour = ${hour} + "12"
0035 endif
0036 set minute=`echo ${i} | awk -F! '{print $3}' | awk -F . '{print $2}'`
0037 set second=`echo ${i} | awk -F! '{print $3}' | awk -F . '{print $3}'`
0038 #set mytime=`echo ${year}"-"${mymonth}"-"${day}" "${hour}":"${minute}":"${second} ${mypm}`
0039 set time=`echo ${day}"-"${mymonth}"-"${year}"_"${hour}":"${minute}":"${second}`
0040 #echo ${mytime}
0041 #set time=`date -d "${mytime}" '+%d-%m-%y_%H:%M:%S'`
0042 #set time=${mytime}
0043 echo ${time}
0044 
0045 if( ${run} != ${runold} ) then
0046 set j=0
0047 set led=100
0048 echo ${i} | grep LED
0049 if( ${status} == "0" ) then
0050 set led=1
0051 endif
0052 
0053 echo ${i} | grep Laser
0054 if( ${status} == "0" ) then
0055 set led=2
0056 endif
0057 
0058 echo ${i} | grep pedestal
0059 if( ${status} == "0" ) then
0060 set led=3
0061 endif
0062 
0063 
0064 set runold=${run}
0065 @ j = ${j} + "1"
0066 else
0067 if( ${j} == "1" ) then
0068 echo ${i}
0069 set nevents=`echo ${i} | awk -F! '{print $6}'`
0070 if( ${led} == "1" ) then
0071 echo ${run}"_"${runorigled}"_"${time}"_"${nevents} >>list_of_myruns_led
0072 endif
0073 if( ${led} == "2" ) then
0074 echo ${run}"_"${runoriglas}"_"${time}"_"${nevents} >>list_of_myruns_las
0075 endif
0076 if( ${led} == "3" ) then
0077 echo ${run}"_"${runorigped}"_"${time}"_"${nevents} >>list_of_myruns_ped
0078 endif
0079 @ j = ${j} + "1"
0080 endif
0081 endif
0082 end
0083 
0084 
0085