Attachment 'mergeCalibValues.py'

Download

   1 def mergeCalibValues():
   2 
   3     #define input and output files
   4     infile=["constantsFeb2018/gainSorted.txt","constantsMar2018/gainSorted_1_2.txt","constantsMar2018/gainSorted_3.txt","constantsMar2018/gainSorted_4.txt","constantsMar2018/gainSorted_6.txt","constantsFeb2018/mipSorted.txt","constantsMar2018/mipSorted_1_2.txt","constantsMar2018/mipSorted_3.txt","constantsMar2018/mipSorted_4.txt","constantsMar2018/mipSorted_6.txt","constantsFeb2018/pedestalSorted.txt","constantsMar2018/pedestalSorted_1_2.txt","constantsMar2018/pedestalSorted_3.txt","constantsMar2018/pedestalSorted_4.txt","constantsMar2018/pedestalSorted_6.txt"]
   5     outfile=["DB_constants_gain.txt","DB_constants_mip.txt","DB_constants_pedestal.txt"]
   6 
   7     for n in range (0,3):
   8         count=0
   9         out = open(outfile[n], 'w')
  10         for nn in range (0,5):
  11             f = open(infile[n*5+nn], 'r')
  12 
  13             for line in f:
  14 
  15                 #write first head line to output file (only existing for mip and pedestal file)
  16                 if count==0 and n!=0:
  17                     out.write(line)
  18                     count=8
  19 
  20                 #filter out modules that were used in both testbeams (value for feb tb is kept)
  21                 elif line.startswith('-1000'):
  22                     print line
  23                     
  24                 #filter out all other head lines
  25                 elif line.startswith('#Layer') or line.startswith('#Module'):
  26                     print line
  27 
  28                 #write all constants to output file
  29                 else:
  30                     out.write(line)
  31 
  32 mergeCalibValues()

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2018-04-19 07:32:10, 631.5 KB) [[attachment:DB_constants_gain.txt]]
  • [get | view] (2018-05-08 20:12:52, 652.9 KB) [[attachment:DB_constants_gain_corr.txt]]
  • [get | view] (2018-04-19 07:32:28, 593.9 KB) [[attachment:DB_constants_mip.txt]]
  • [get | view] (2018-05-08 20:13:21, 617.3 KB) [[attachment:DB_constants_mip_corr.txt]]
  • [get | view] (2018-04-19 07:32:43, 596.2 KB) [[attachment:DB_constants_pedestal.txt]]
  • [get | view] (2018-05-08 20:13:38, 681.3 KB) [[attachment:DB_constants_pedestal_corr.txt]]
  • [get | view] (2018-04-19 10:17:04, 1.1 KB) [[attachment:DBtoslcio.sh]]
  • [get | view] (2018-04-18 07:34:04, 19.1 KB) [[attachment:Reco.xml]]
  • [get | view] (2018-04-18 07:36:26, 0.6 KB) [[attachment:Reco_sed.sh]]
  • [get | view] (2018-04-18 14:54:27, 10.8 KB) [[attachment:eventDisplay.xml]]
  • [get | view] (2018-04-18 13:25:03, 1.5 KB) [[attachment:mergeCalibValues.py]]
  • [get | view] (2018-04-18 07:36:36, 1.0 KB) [[attachment:myMarlin.sh]]
  • [get | view] (2018-04-18 14:55:10, 19.3 KB) [[attachment:reconstructRawData_slcioIutput.xml]]
  • [get | view] (2018-04-18 13:24:06, 1.1 KB) [[attachment:sortConstantsFeb2018.py]]
  • [get | view] (2018-04-18 13:24:36, 1.7 KB) [[attachment:sortConstantsMar2018.py]]
  • [get | view] (2018-04-18 07:32:42, 2.0 KB) [[attachment:steering.xml]]
  • [get | view] (2018-04-19 09:47:52, 62.3 KB) [[attachment:steering4dqm_tb_2018.xml]]
  • [get | view] (2018-04-18 17:02:01, 16.9 KB) [[attachment:steering_cosmics_2018April.xml]]
  • [get | view] (2018-04-20 14:19:48, 16.4 KB) [[attachment:steering_cosmics_2018April_38Layers.xml]]
  • [get | view] (2018-04-19 09:02:04, 17.1 KB) [[attachment:steering_cosmics_2018April_4812.xml]]
  • [get | view] (2018-05-09 20:03:41, 61.6 KB) [[attachment:test_canvases1.xml]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.