Showing posts with label History. Show all posts
Showing posts with label History. Show all posts

Monday, 3 June 2019

Loading old Physics Data Files - Part 2

Previously, my attempt at running a FORTRAN program to load my old ZEUS data ntuples failed because CERNLIB isn't compatible with a 64-bit Linux OS:

 Test loading ntuple files
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
LOCB/LOCF: address 0x562cca6e2c80 exceeds the 32 bit address space
or is not in the data segments
This may result in program crash or incorrect results
Therefore we will stop here
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
 
Unfortunately, the recommendation in  /usr/share/doc/libpacklib1-dev/README.64-bit to statically link didn't work for me:

Static linking is the default behavior if you use the "cernlib" script when
linking, like this:

 # Should work everywhere:
 gfortran -o myprogram myprogram.F `cernlib -G Motif pawlib` 
 
Fortunately, Linux Mint still provides a 32-bit version of the latest OS. So, at this point rather than trying to fix it in 64-bit I thought the best approach would be to setup a Virtual Machine.

For the VM host, I decided to use VirtualBox. This is easy to install on Ubuntu from the Software Center.

After downloading the 32-bit Linux Mint ISO I setup a new VM with 4MB of Memory and Dynamically Allocated Storage with 70GB Virtual Size.

After installing Mint, I reinstalled the CERNLIB packages from the Mint Software Manager and loaded up the ntuple in PAW as per my last post

Now, given this was working I could try and load the file using my FORTRAN program:

      program main

      implicit none
      integer istat, NEvents, idnt
      real hmem
      common/pawc/hmem(2000000)

      print *, "Test loading ntuple files"
      call hlimit(2000000)  
     
      call hropen(80,'ntuple','mc97_1.rz','',4096,istat)
 
      if (istat.ne.0) then
          print *, "Failed to open input file"
         stop
      endif

      print *, "Loaded mc96_1.rz"
      call hrin(10, 9999999, 0) 
      call hnoent(10,NEvents)
      print *, NEvents
c      print *, idnt    

      call hrend('ntuple')
      close(80)  

      end program main

And this time, success!

 Test loading ntuple files
 Loaded mc96_1.rz
       51781

There's a few points to bear in mind:
  • common/pawc/hmem(2000000) is required to reserve locations to a common /PAWC/, for the HBOOK working space (an array)
  • call hlimit(2000000) informs HBOOK of the storage limit
  • call hropen opens the direct access rz file
  • call hrin(10, 9999999, 0) reads a histogram from the current directory of the direct access file into the current directory in memory. The 9999999 to to read the highest cycle
  • call hnoent Gets the number of events in the in-memory identifier

Monday, 20 May 2019

Loading old Physics Data Files - Part 1

It's been a while since I built the CERNLIB libraries on my laptop. Since then the old laptop has finally failed and I've installed CERNLIB from the Ubuntu repositories, so I thought it was time to try and load my old data files again.

The data are saved as binary ntuples packaged as .rz files. So, to begin I tested opening them in PAW (Physics Analysis Workstation).

To load, simply run paw, take the default workstation type and enter:
hi/file 1 mc96_2.rz

jonathan@jonathan-Inspiron-5759:~/Development/Physics$ paw
 ******************************************************
 *                                                    *
 *            W E L C O M E    to   P A W             *
 *                                                    *
 *       Version 2.14/04      12 January 2004         *
 *                                                    *
 ******************************************************
 Workstation type (?=HELP) <CR>=1 : 
 Version 1.29/04 of HIGZ started
PAW > hi/file 1 mc96_2.rz 4096
PAW > 

The arguments are:
  • '1' is the 'logical unit' of the file
  • The filename, 'mc96_2.rz'
  • Record length in words (I saved the data back in the day with 4096) It's important this is included or a segmentation error is returned:
PAW > hi/file 1 mc96_2.rz

 *** Break *** Segmentation violation
 Traceq lun = 0, level = 99 

 TRACEQ.  In-line trace-back still not available.
 Longjump 
PAW > 

The structure of the ntuple currently loaded in memory can be seen with nt/print 10
(10 is the ntuple identifier. Again, I originally saved it with this value)

PAW > nt/print 10


 ******************************************************************
 * Ntuple ID = 10     Entries = 5882      ntuple
 ******************************************************************
 * Var numb * Type * Packing *    Range     *  Block   *  Name    *
 ******************************************************************
 *      1   * R*4  *         *              * FLT      * TrigDat(15)
 *      1   * I*4  *         *              * TLT      * TLT(15)
 *      1   * R*4  *         *              * TRK      * VCT_XVC
 *      2   * R*4  *         *              * TRK      * VCT_YVC
 *      3   * R*4  *         *              * TRK      * VCT_ZVC
 *      4   * I*4  *         *              * TRK      * NVTRKC
 *      5   * I*4  *         *              * TRK      * NTRKC
 *      6   * R*4  *         *              * TRK      * CHVCC 
...
 ******************************************************************
 *  Block   *  Entries  * Unpacked * Packed *   Packing Factor    *
 ******************************************************************
 * FLT      *  5882     * 60       * 60     *       1.000         *
 * TLT      *  5882     * 60       * 60     *       1.000         *
 * TRK      *  5882     * 40       * 40     *       1.000         *
 * CAL      *  5882     * 60       * 60     *       1.000         *
 * ELEC     *  5882     * 144      * 144    *       1.000         *
 * ZUFOS1   *  5882     * 16       * 16     *       1.000         *
 * ZUFOS2   *  5882     * 4        * 4      *       1.000         *
 * ZUFOS3   *  5882     * 12       * 12     *       1.000         *
 * ZUFOS4   *  5882     * 96       * 96     *       1.000         *
 * ZUFOS5   *  5882     * 16       * 16     *       1.000         *
 * TEMP     *  5882     * 8        * 8      *       1.000         *
 * TAG1     *  5882     * 4        * 4      *       1.000         *
 * TAG2     *  5882     * 4        * 4      *       1.000         *
 * LUMI1    *  5882     * 12       * 12     *       1.000         *
 * LUMI2    *  5882     * 12       * 12     *       1.000         *
 * GEN      *  5882     * 32       * 29     *       1.103         *
 * MCTRUE   *  5882     * 88       * 88     *       1.000         *
 * BGDTUP   *  5882     * 28       * 28     *       1.000         *
 * Total    *    ---    * 696      * 693    *       1.004         *
 ******************************************************************
 * Blocks = 18           Variables = 126          Columns = 174   *
 ******************************************************************
  
And to page through the data use nt/scan 10

PAW > nt/scan 10
/NTUPLE/SCAN: Only showing first 30 of expressions
+-------+--------------+-------------+--------------+--------------+--------------+-------------+-------------+--------------+-----
| Event |   TrigDat    |   TLT       |   VCT_XVC    |   VCT_YVC    |   VCT_ZVC    |   NVTRKC    |   NTRKC     |   CHVCC      |   FC
+-------+--------------+-------------+--------------+--------------+--------------+-------------+-------------+--------------+-----
|     1 |              |             | -1.43087     |  1.24444     |  18.4673     |  2          |  3          |  3.27624     |  0. 
| *   1 |  0.          |  0          |              |              |              |             |             |              |     
| *   2 |  0.          |  0          |              |              |              |             |             |              |     
| *   3 |  0.          |  0          |              |              |              |             |             |              |     

I've got 174 columns in this particular ntuple. To restrict the selection use:
nt/scan 10 varlis=[Comma separated list of columns]

PAW > nt/scan 10 varlis=ENE44M:ZufoPz
+-------+-------------+--------------+--------------+--------------+
| Event |   ENE44M    |   TEMPLUME   |   TEMPLUMG   |   ZufoPz     |
+-------+-------------+--------------+--------------+--------------+
|     1 |  1000       | -500.        | -500.        |  2.55895     |
|     2 |  1000       | -500.        | -500.        |  11.4667     |
|     3 |  1000       | -500.        | -500.        | -1.63046     |
|     4 |  1000       | -500.        | -500.        |  1.37581     |
|     5 |  1000       | -500.        | -500.        | -2.54238     |
|     6 |  1000       | -500.        | -500.        | -1.91473     |
|     7 |  1000       | -500.        | -500.        |  1.51911     |
|     8 |  1000       | -500.        | -500.        |  0.          |
|     9 |  1000       | -500.        | -500.        |  12.3712     |
|    10 |  1000       | -500.        | -500.        | -4.4222      |
|    11 |  1000       | -500.        | -500.        |  0.0533053   |
|    12 |  1000       | -500.        | -500.        | -0.0746093   |
|    13 |  1000       | -500.        | -500.        |  33.6832     |
|    14 |  1000       | -500.        | -500.        |  0.223857    |
|    15 |  1000       | -500.        | -500.        |  8.72115     |
|    16 |  1000       | -500.        | -500.        |  10.5479     |
|    17 |  1000       | -500.        | -500.        |  2.4528      |
|    18 |  1000       | -500.        | -500.        | -1.17858     |
|    19 |  1000       | -500.        | -500.        |  1.03199     |
+-------+-------------+--------------+--------------+--------------+
 

After this, I knew I could load the data but I really wanted to run the files through my old analysis code in FORTRAN.

Rather than try to compile the old project, I created a simple FORTRAN program to try and load the ntuple:

jonathan@jonathan-Inspiron-5759:~/Development/Physics/New Stuff/Development$ more Zeus1.f
      program main

      print *, "Test loading ntuple files"
     
      call hlimit(2000000)      
      call hropen(80,'ntuple','nommc_1033.rz','',4096,istat)
 
      if (istat.ne.0) then
          print *, "Failed to open input file"
         stop
      endif

      print *, "Loaded nommc_1033.rz"
      end program main

(I'll talk about these commands in the next blog)

Compilation is easy with the official repository, we just need to link against packlib:

gfotrtran Zeus1.f  -lpacklib

And with no problems it created the default executable a.out (that takes me back!)

So with huge anticipation I ran it and, oh...

jonathan@jonathan-Inspiron-5759:~/Development/Physics/New Stuff/Development$ ./a.out
 Test loading ntuple files
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
LOCB/LOCF: address 0x7f57832df7a0 exceeds the 32 bit address space
or is not in the data segments
This may result in program crash or incorrect results
Therefore we will stop here
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
The reason was to be found in the readme file in the same location as the libraries:
/usr/share/doc/libpacklib1-dev/README.64-bit

CERNLIB was never designed to run on machines where the size of a pointer
is 64 bits.  The code implicitly assumes that
 sizeof(void *) == sizeof(int) == 4
in many different places.  The biggest culprits are the ZEBRA and COMIS sets
of routines in the packlib and pawlib libraries, respectively.  This would be
difficult to fix without rewriting megabytes of FORTRAN source code.

My old 2002 laptop was of course 32bit so this wasn't a problem before. My next blog will describe how I got this working.

Monday, 9 November 2015

ZEUS Safety Shift - Part 2

Previously I introduced the ZEUS safety shift, a duty performed mainly by the Ph.D. students who worked with the Particle Physics detector. Now to go on the walk round!

The first step I took was to return back up to the ground floor to check the gas mixing rack (the panel just to left of centre). Here you would check the pressures on various manometers. A process for dealing with any deviations from norms was provided.


Turn 180 degrees and look back. Here you can see the pipes heading off on their way to the Pit. The corridor here leads back to the main entrance doorway (seen from the outside in the earlier post).


Now I would take the lift down floors to the 6th floor, actually 2 floors underground. Go through some doors in front of me out of the lift and I ended up in a large machinery space.

The yellow line on the floor is a fluorescent paint that guides you to the exit in case of a power cut. Turning off the lights resulted in the room being bathed in a eerie glow from this and various indicator lights. This could easily be a set for a sci-fi movie!

Following the line to the silver door in on the far wall, I would turn the corner and see my next target in the gloomy distance.

These were the calorimeter power supply units. The safety check here was to ensure the temperatures remained within safe bounds.


The large air conditioning ducts to the left in the earlier picture also had a habit of making a noise that sounded just like something scuttling through them, just to add to the atmosphere.

As an aside, the 6th floor also had the electronics lab where I spent quite a few hours analysing components of the tracking detector trigger using the test bench seen below.


My next task was to re-enter the Pit and check the far side of the detector, this involved passing under the beam through this concrete lined tunnel

The back of the detector was certainly more cramped than the other side.

The primary check here was to check gas flow through a bubble gauge, the yellow cabinet just to left of centre
I would then make a walk around the front of the detector to perform general checks before the final destination on the round which was inside the Rucksack. Here we would check on the trigger components.
An interesting, and fortunately rare, issue here was that the electronic cards would gradually ease themselves out of their sockets over a period of time due to vibration from the cooling fans. On one of my last shifts, I was on duty with a senior member of the collaboration who hadn't been shift leader for some time. Early on in the night he noticed a problem with the data from the detector that was serious enough to consider turning of data collection entirely. He asked me if I'd seen it before and while I hadn't seen those particular symptoms I said I'd head off to the Rucksack to check it out.

When I got there, I simply gave every card a push. I returned to find all was well with the data. (I remember giving a suitable vague and complex explanation)

And that was it, back to the control room for another couple of hours working on analyses until your next walk round.

I think this sign nicely summed up the end of 8 hours underground. Warning, Danger of Health!


Monday, 21 September 2015

ZEUS Safety Shift - Part 1

The 'Safety Shift' was a duty for all PhD. students working on the ZEUS experiment. This involved spending 8 hours at the detector hall, mostly in the control room, 8 floors underground. Although periodically you would take a walk around the site, checking the detector subsystems. The shift change-over times were 12am, 8am and 4pm. Shifts were on a rota and once you'd done 4 days in a row there would usually be a few weeks before your next one.

During a normal evening shift the only other person you'd see would be the shift leader who would be a more senior member of the collaboration. Personally, I think the safety shift had the better deal, at least we got to go and stretch our legs. During data taking the leader would have to be more or less continuously at the run control desk.

I loved the midnight until 8 shift. This was mainly because after about 1am you would have almost exclusive use of the ZEUS compute farm. And I did enjoy a bit the feeling of being stuck in a sci-fi set!

Here is a plan of the DESY site with the location of the experimental halls. ZEUS was located in the South Hall, just next to the Trabrennbahn. The South Hall complex was affectionately called "The Pit".

Scan of the back of the DESY Lageplan

You approached the hall through the Trabrennbahn car park. At midnight in the middle of winter this could be quite a lonely walk.


Once you swiped your entrance card you would enter the courtyard area and proceed through the small blue door into the hall itself.

Taking the lift down to the bottom you find the control room to your left. This picture was taken from the 2007 ZEUS shut down. The monitor at the bottom left was the desk for the safety shift.



The run control station for the shift leader is shown below. This was from a quiet evening in 1999.


If, instead of turning left, you exited straight out of the lift you would enter the main hall. The most obvious sight you'd see here was the Rucksack. This was a 3-story hut containing a large proportion of the trigger electronics. The whole hut was mounted on rails and could be moved to the right (in this picture) during access periods for the detector.

During normal operation, the detector itself was largely hidden from view by concrete shielding and the Rucksack itself. It was located to the left of the Rucksack in the above picture. Here is a view of the side facing the Rucksack.

Cabling between the detector and Rucksack was designed to be flexible and allow movement.


Part of the safety shift was to walk around the all with an eye out for any obvious problems. Professor Jon Butterworth, in his book Smashing Physics, tells of a time someone on safety shift found water dripping out from the concrete shielding. This wasn't the only time water got loose, my sister pointed out a leak from one of the pipes in the hall when I was giving her a tour. Her question was, "Is it supposed to be doing that?" With a significant amount of high voltage cables and delicate instruments around, this was not something to take lightly...

This view back from the top of the Rucksack stairs shows some of the remainder of the hall. (For orientation the lift was through the entrance where the blue doors can just be seen.)

Next time, I'll go into more detail about some of the checks we had to make, as well as visiting some of the (literally) darker corners of the pit.