Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:14:54

0001 #! /bin/bash
0002 
0003 
0004 #preferred_dir="/data/ecalod-22/dump-data"
0005 preferred_dir=`pwd`
0006 log_dir=$preferred_dir/log/
0007 conf_dir=$preferred_dir/conf/
0008 #cmssw_dir="/nfshome0/ecaldev/DUMP/CMSSW_1_3_0_pre3/src"
0009 cmssw_dir=`pwd`
0010 
0011 # in case you wanted to force  execution inside the preferred_dir
0012 #if [ "$PWD" != $preferred_dir ]; then
0013 #
0014 # echo ""
0015 # echo "this script should be executed from $preferred_dir"
0016 # echo "please do:"
0017 # echo "            cd $preferred_dir"
0018 # echo ""
0019 ## exit
0020 #
0021 #fi
0022 
0023 mkdir -p  $preferred_dir/log/
0024 mkdir -p  $preferred_dir/conf
0025 
0026 
0027 if [ ! -n "$1" ]
0028 
0029 then
0030 
0031 echo ""
0032 echo "This script produces Root TGraphs of for given crystal (cry) and all its neigbors in a sideXside matrix around it "
0033 echo ""
0034 echo "Options:"
0035 echo ""
0036 echo "      -p|--path_file        file_path       path to the data to be analyzed (default is /data/ecalod-22/daq-data/)"
0037 echo "      -d|--data_file        file_name       data file to be analyzed"
0038 echo ""
0039 echo "      -f|--first_ev         f_ev            first (as written to file) event that will be analyzed; default is 1"
0040 echo "      -l|--last_ev          l_ev            last  (as written to file) event that will be analyzed; default is 9999"
0041 echo "      -eb|--ieb_id          ieb_id          selects sm barrel id (1...36); default is all"
0042 echo "      -cry|--cryGraph        ic              graphss from channel ic will be created"
0043 echo "      -s|--side         side              side of the square centered on cry where graphs are created"
0044 
0045 echo ""
0046 echo ""
0047 exit
0048 
0049 fi
0050 
0051 
0052 data_path="/data/ecalod-22/daq-data/"
0053 data_file="none"
0054 
0055 cfg_path="$conf_dir"
0056 
0057 
0058 ieb=1
0059 
0060 cry_ic=1;
0061 cryString="false";
0062 
0063 side=3
0064 
0065 first_event=1
0066 last_event=9999
0067 
0068 
0069 
0070   while [ $# -gt 0 ]; do    # till where there are parameters available...
0071     case "$1" in
0072 
0073       -p|--path_file)
0074                 data_path="$2"
0075                 ;;
0076 
0077       -d|--data_file)
0078                 data_file="$2"
0079                 ;;
0080 
0081 
0082       -f|--first_ev)
0083                 first_event="$2"
0084                 ;;
0085 
0086 
0087       -l|--last_ev)
0088                 last_event="$2"
0089                 ;;
0090 
0091 
0092       -eb|--ieb_id)
0093                 ieb="$2"
0094                 ;;
0095 
0096       -cry|--cryGraph)
0097                 cry_ic="$2"
0098                 cryString="true"
0099                 ;;
0100 
0101       -s|--side)
0102                 side="$2"
0103                 ;;
0104 
0105     esac
0106     shift       # Verifica la serie successiva di parametri.
0107 
0108 done
0109 
0110 echo ""
0111 echo ""
0112 echo "data to be analyzed:                          $data_file"
0113 echo "first event analyzed will be:                 $first_event"
0114 first_event=$(($first_event-1))
0115 
0116 echo "last event analyzed will be:                  $last_event"
0117 echo "supermodule selected:                         $ieb"
0118 
0119 
0120 if [[  $cryString = "true"  ]]
0121 then
0122         echo "channel selected for graphs:                  $cry_ic"
0123 fi
0124 
0125         echo "side:                                         $side"
0126 
0127 
0128 echo ""
0129 echo ""
0130 
0131 
0132 
0133 
0134 cat > "$cfg_path$data_file".graph.$$.cfg <<EOF
0135 
0136 
0137 
0138 process TESTGRAPHDUMPER = { 
0139 
0140 # if getting data from a .root pool file
0141        source = PoolSource {
0142            untracked uint32 skipEvents = $first_event
0143            untracked vstring fileNames = { 'file:$data_path$data_file' }
0144            untracked bool   debugFlag     = true
0145           }
0146 
0147   untracked PSet maxEvents = {untracked int32 input = $last_event}
0148 
0149      module ecalEBunpacker = EcalDCCTBUnpackingModule{ }
0150 
0151 # verbosity =0:  only headings
0152      module graphDumperModule = EcalGraphDumperModule{
0153 
0154         # selection on sm number in the barrel (1... 36; 1 with tb unpacker)
0155         # if not specified or value set to -1, no selection will be applied
0156         untracked int32 ieb_id      = $ieb
0157         
0158          # specify list of channels to be graphed around
0159          untracked vint32  listChannels = { $cry_ic }
0160 
0161          # side of the square centered on listChannels containing the channels you want to see
0162          # needs to be an odd number
0163          untracked int32  side = $side
0164 
0165          untracked string fileName =  '$data_file' 
0166 
0167       }
0168      
0169 
0170      path p = {ecalEBunpacker, graphDumperModule}
0171 
0172 
0173 }
0174 
0175 
0176 
0177 
0178 
0179 EOF
0180 
0181 
0182 echo "initializing cmssw..."
0183 export SCRAM_ARCH=slc3_ia32_gcc323
0184 #. /nfshome0/cmssw/cmsset_default.sh
0185 cd $cmssw_dir;
0186 eval `scramv1 ru -sh`;
0187 cd -;
0188 echo "... running"
0189 cmsRun "$cfg_path$data_file".graph.$$.cfg >& "$log_dir$data_file".$$.graph
0190 
0191 echo ""
0192 echo ""
0193 
0194 mv *.graph.root log/
0195 echo "File root with graphs was created:" 
0196 ls -ltrFh $preferred_dir/log/*.graph.root | tail -1 | awk '{print $9}'
0197 
0198 echo ""
0199 echo ""
0200 echo "Now you can browse..."
0201 echo ""
0202 echo ""
0203 
0204 root -l $CMSSW_BASE/src/EventFilter/EcalTBRawToDigi/data/macro/InteractiveDisplay.C