Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Millepede input binary is obtained through the following steps:

  1. Reconstruct real data with GBL (to this purpose, you need to include the GblDriver and GblOutputDriver in your steering file).

    1. For Montecarlo data:

      1. run the readoout with the steering file (for instance, for test run data: HPS2014ReadoutNoPileup.lcsim)
      2. run the recon with the steering file (for instance, for test run data: HPS2014OfflineNoPileUp.lcsim)
    2. For real data you can use as steering file: /org/hps/steering/recon/EngineeringRun2015FullReconGbl2.lcsimwhatever steering file (usually the most update version will work)  but remember to include the mentioned GblOutputDriver drivers as mentioned above, if they are not present (usually they are not, for production purposes):
      <driver name="GBLOutputDriver"/>
      ...
       <driver name="GBLOutputDriver" type="org.hps.recon.tracking.gbl.GBLOutputDriver">
               <debug>0</debug>
               <isMC>false</isMC>        
                <gblFileName>${outputFile}.gbl</gblFileName>
      </driver>
    3. For the purpose of alignment you are reccommended to drop ghost hits, including in the HelicalHitDriver driver the following line:
      <rejectGhostHits>true</rejectGhostHits>

  2. Check that at the end of reconstruction a out.gbl ascii file (or, named as you decided in the GblOutputDriver) is produced.
  3. Remember that by default the geometry is taken from the database. If you want to force the use of your own geometry, you must provide it in the compact.xml file in a given detector. For MonteCarlo data, set the run number to zero during readout and reconstruction. This is done adding the flag -Drun=0 when running the readout. For real data, use the -DdisableSvtAlignmentConstants flag.. IMPORTANT: remember to re-compile hps-java before running each time you change the compact.xml file! (this is the most common error).
  • The out.gbl file is read by a python procedure. You must download with git the current version of the software from the github repository as

...

  • described in the following. This will create a hps-gbl directory. After having configured your account and username for git usage, issue the following commands:

...

  • (the second and third command need to be issued just upon installation, and they are needed since

...

  • some directories with

...

  • utility files are shared with other software packages which will be described later).
    Once you have downloaded the code:
    • remember to install the GBL software, if you already haven't it. In a directory parallel to hps-gbl download the GBL software using svn:

 

                           (or check the newest release, and get it). To compile it:

      • cd GeneralBrokenLines/cpp
      • mkdir build; cd build
      • cmake ../
      • make install
      • make doc (if you want it)
        Note: if you have installed the latest cmake version, it probably won't compile. You must prevent the compilation to search for C++11 support (the default for newest cmake). To do this, you have to set as compilation flag -std=c++0x adding it to the c++ compilation line. Either you do it in the cmake configuration files, or (quickest) you add by hand this flag at the end of the CXX_FLAGS line, in the two files:

 

        • GeneralBrokenLines/cpp/build/CMakeFiles/GBL.dir/flags.make
        • GeneralBrokenLines/cpp/build/examples/CMakeFiles/GBLpp.dir/flags.make

    • the gbl python procedure reads the out.gbl file and prepares the binary read by Millepede. You must run python from the hps-gbl directory. This is the shortest syntax (-h shows all possible options):
      • cd hps-gbl
      • python gbltst-hps.py
  1. [-h] out.gbl
      • $GBLFILE --name $OUTNAME --ntracks $MAXTRKS --nopause --save
      You can provide the input gbl filename, the output file name and the nmber of tracks to be processed as logical names in a shell script.way
      A heap of pdf files are produced containing plots of several quantities for top/bottom halves, with long names that should be self-explaining (but at the moment they are not and they are too long, this must be improved). You will also file a .root file containing the single root histograms, and a .ps file containing a summary of the plots ready to be printed.
      The file gbltst-hps.py contains the instructions to extract the useful information on tracks and hits from the ascii file and write the input file for Millepede. If you want to add/modify some of the output plots/histograms, you have to modify both the gbl_plots.py file (in which they have to be booked) and the gbltst-hps.py file, in which they
  2. have to be filled.
    • have to be filled.
      See the help (or, better, the code) for indication to further functionalities:
      •  python gbltst-hps.py --help
      Note: root must be compiled including the python support, otherwise python stops with an error complaining about root libraries missing. A good idea is to put in your profile and instruction to run automatically $ROOTSYS/bin/thisroot.(c)sh, which provides the correct root-python environment and libraries for your system.
      At the end of python
  3. run
    • processing, you should also find a MilleBinaryISN.dat file (the name could slightly change), which is the input file to be read by Millepede.

 


Running Millepede
  1. Once you have the binary file, millepede is ready run from the hps-mille directory. This directory is setup downloading the Millepede software by github using the following commandRemember to compile the fortran sources of the MillepedeII software. It comes with the git bundle (or you can download it from https://www.wiki.terascale.de/index.php/Millepede_II) but you have to compile it in your system (note: for with gfortran you might have to slightly modify the Makefile by hand, because it could be its version is frozen and not aligned anymore to more modern gfortran versions/libraries).
  2. To run millepede use the following commands:
    • cd hps-mille
    • ./runMP.py -i../hps-gbl/milleBinaryISN.dat -M NAMES
    where NAMES is a list of parameters coded via the following regexp: L(1-6)[AS]?[hs]?[tb]_([tr])([uvw]) having the following meaning:
    1. 1-6: layer number
    2. A: axial, S: stereo
    3. h: hole, s: slot
    4. t: top, b:bottom
    5. _t: translation, _r: rotation
    6. u, v, w: coordinates on the sensor reference system
    if some of the parameters preceded by "?" are omitted, both the choices are selected
    Millepede produces as output, among several files, the millepede.res file which contains the corrections found by Millepede for the floated parameters.
     

Create a new compact based on Millepede corrections

...

  • ./buildCompact.py [-h] -j JARFILE -c compactcompactFile_newyouWantToUpdate.xml -r millepede.res -t

JARFILE is the name of the hps-java jarfile you used/will be using to reconstruct your data files with the aligned (new) geometry. You have to provide the name of the geometry file used for the initial reconstruction of the data, with respect to which the millepede offsets will be added to produce the new geometry file. The flag -t is needed as some of the parameters in the compact.xml file are already been modified by some expressions introducing physical constraints (for global alignment).

ATTENTION: all rotation offsets have to be summed, which means their sign doesn't have to be flipped when building the new compact.xml file. In some cases two "-" signs appear the the xml file: don't worry, this behaves as expected in the  java code.

...

The instruction on how to create a new detector given your new .xml geometry file can be found here: Detector Geometry Overview, section: Adding A New Detector. Remember to rename the compact_new.xml file into compact.xml, write a few lines of clever/useful comment in the .xml file to remember which kind of geometry this is, and recompile hps-java before running with the new geometry.

You If you got to this point, either you already find a perfect alignment or you are ready now to restart the full procedure restarting from point 1 of the list at the beginning of this section.

...