File indexing completed on 2024-04-06 12:00:05
0001
0002
0003
0004 preferred_dir=`pwd`
0005 log_dir=$preferred_dir/log/
0006 conf_dir=$preferred_dir/conf/
0007
0008 cmssw_dir=`pwd`
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 mkdir -p $preferred_dir/log/
0023 mkdir -p $preferred_dir/conf
0024
0025 if [ ! -n "$1" ]
0026
0027 then
0028
0029 echo ""
0030 echo "This script produces a text file containing the Ecal raw data in hexadecimal format."
0031 echo ""
0032 echo "Options:"
0033 echo ""
0034 echo " -p|--path_file file_path data file to be analyzed preceeded by path"
0035 echo ""
0036 echo " -f|--first_ev f_ev first (as written to file) event that will be analyzed; default is 1"
0037 echo " -l|--last_ev l_ev last (as written to file) event that will be analyzed; default is 9999"
0038
0039 echo " -bf|--beg_fed_id b_f_id fed_id: EE- is 601-609, EB is 610-645, EE- is 646-654; default is 0"
0040 echo " -ef|--end_fed_id e_f_id when using 'single sm' fed corresponds to construction number; default is 654"
0041
0042 echo ""
0043 echo ""
0044 exit
0045
0046 fi
0047
0048
0049
0050
0051 data_path="/data/ecalod-22/daq-data/"
0052 data_file="none"
0053
0054 cfg_path="$conf_dir"
0055
0056 beg_fed_id=0
0057 end_fed_id=654
0058
0059 first_event=1
0060 last_event=9999
0061
0062
0063
0064 while [ $
0065 case "$1" in
0066
0067 -p|--path_file)
0068 data_path="$2"
0069 ;;
0070
0071 -f|--first_ev)
0072 first_event="$2"
0073 ;;
0074
0075 -l|--last_ev)
0076 last_event="$2"
0077 ;;
0078
0079 -bf|--beg_fed_id)
0080 beg_fed_id="$2"
0081 ;;
0082
0083 -ef|--end_fed_id)
0084 end_fed_id="$2"
0085 ;;
0086
0087 esac
0088 shift
0089
0090 done
0091
0092 data_file=${data_path
0093 extension=${data_file
0094
0095 echo ""
0096 echo ""
0097 echo "data to be analyzed: $data_file"
0098 echo "first event analyzed will be: $first_event"
0099 first_event=$(($first_event-1))
0100
0101 echo "last event analyzed will be: $last_event"
0102 echo "first fed that will be dumped: $beg_fed_id"
0103 echo "last fed that will be dumped: $end_fed_id"
0104
0105
0106 echo ""
0107 echo ""
0108
0109 if [[ $extension == "root" ]]; then
0110 input_module="
0111 # if getting data from a .root pool file
0112 source = PoolSource {
0113 untracked uint32 skipEvents = $first_event
0114 untracked vstring fileNames = { 'file:$data_path' }
0115 untracked bool debugFlag = true
0116 }"
0117 else
0118 input_module="
0119 source = NewEventStreamFileReader{
0120 untracked uint32 skipEvents = $first_event
0121 untracked vstring fileNames = { 'file:$data_path' }
0122 untracked uint32 debugVebosity = 10
0123 untracked bool debugFlag = true
0124 }"
0125 fi
0126
0127 cat > "$cfg_path$data_file".hex.$$.cfg <<EOF
0128 process HEXDUMP = {
0129
0130
0131 module hexDump = EcalHexDisplay{
0132 untracked int32 verbosity = 0
0133 untracked bool writeDCC = false
0134
0135
0136
0137 untracked int32 beg_fed_id = $beg_fed_id
0138 untracked int32 end_fed_id = $end_fed_id
0139
0140
0141 untracked int32 first_event = $first_event
0142 untracked int32 last_event = $last_event
0143 untracked string filename = 'dump.bin'
0144 }
0145
0146 module counter = AsciiOutputModule{}
0147
0148 service = MessageLogger{
0149 untracked vstring destinations = { "cout" }
0150 untracked PSet cout = {
0151 untracked string threshold = "WARNING"
0152 untracked PSet default = { untracked int32 limit = 0 }
0153 }
0154 }
0155
0156
0157 untracked PSet maxEvents = {untracked int32 input = $last_event}
0158
0159 $input_module
0160
0161 path p = { hexDump }
0162 endpath ep = { counter }
0163
0164
0165 }
0166
0167
0168
0169
0170
0171
0172
0173 EOF
0174
0175 echo "initializing cmssw..."
0176
0177 cd $cmssw_dir;
0178 eval `scramv1 ru -sh`;
0179 cd -;
0180 echo "... running"
0181 cmsRun "$cfg_path$data_file".hex.$$.cfg >& "$log_dir$data_file".$$.hex
0182
0183 echo ""
0184 echo ""
0185 echo ""
0186 echo "-------------------------------------------------------------------------------------------------------------------------"
0187 echo "hexadecimal dump completed, now edit "$log_dir$data_file".$$.hex to see the results"
0188 echo "-------------------------------------------------------------------------------------------------------------------------"
0189 echo ""
0190 echo ""
0191