Versions Compared

Key

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

...

  1. Reconstruct real data with GBL (to this purpose, you need to include the 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 whatever 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"/>
      ...something else in the lcsim file...
       <driver name="GBLOutputDriver" type="org.hps.recon.tracking.gbl.GBLOutputDriver">
               <debug>0</debug>
               <isMC>false</isMC>   <!-- use true for MC data here -->        
                <gblFileName>${outputFile}.gbl</gblFileName>
      </driver>
      Of course, for straight tracks use a proper steering file.
    3. For the purpose of alignment you are recommended 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 and a proper run number to select other calibration constants. IMPORTANT: remember to re-compile hps-java before running each time you change the compact.xml file! (this is the most common error).
  4. The out.gbl file is read by a python procedure, called gbltst-hps.py. 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 use, 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:
    • svn co http://svnsrv.desy.de/public/GeneralBrokenLines/tags/v01-16-04 GeneralBrokenLines
      (or check the newest release, and get it). To compile it:
    • cd GeneralBrokenLines/cpp
    • mkdir build; cd build
    • cmake ../
    • make
    • make install
    • make doc (if you want it)
      Note: if you have installed the latest cmake version, probably it 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 these two files:
      • GeneralBrokenLines/cpp/build/CMakeFiles/GBL.dir/flags.make
      • GeneralBrokenLines/cpp/build/examples/CMakeFiles/GBLpp.dir/flags.make
  5. 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):
    • python gbltst-hps.py $GBLFILE --name $OUTNAME --ntracks $MAXTRKS --nopause --save
      You can provide the input gbl filename, the output file name and the number of tracks to be processed as logical names in a shell script.
      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 needs to 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; it reruns GBL on the tracks. If you want to add/change 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 have to be filled.
      See the help (or, better, the code) for indication to further functionalities:
      •  python gbltst-hps.py --help
      Use the --batch flag if you not running interactively (if you are submitting the job on a batch system, for instance) or you do not want the output histograms to pop out when the elaboration is finished (they can be annoyingly invasive on your screen for about a minute).
      At the end of python processing, you should also find a MilleBinaryISN.dat file (the name could slightly change), which is the input file to be read by Millepede.
      Keep in mind that this procedure is very RAM consuming (all track informations are stored in memory once read from the GBL ascii file). Therefore, in general it is not a good idea to run many multiple sessions, or even single sessions with many events, on the same processor, unless you want to risk your system be stuck. 
      Note on root compilation: root must be compiled including the python support, otherwise python stops with an error complaining about root libraries missing. A good practice 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.
      Note on straight tracks processing. If you want to process straight tracks (no magnetic field) you need to used a slightly different python script:
      • python gbl-hps-ST.py  $GBLFILE --save --nopause
      Of course, you will void histograms for quantities related to helical track parameters, impact parameters, momenta etc.
      Note on truth MC information: for the moment being, if the GBL procedure is being run on Montecarlo data (flag --mc), no output is extracted for MC truth quantities. This needs to be fixed (it was working up to a certain hps-java version, need to be checked if it is a problem of info extraction from the banks by the python script, or it is something more related to the way the information is stored in the readout/reconstruction of the simulated data).
  6. Once you run GBL on the out.gbl file, you can check the quality of the alignment/geometry studying residuals, kinks, pulls and several other useful distributions. All histograms are contained in a file named gbl_$OUTNAME_*.root (the full name can be very long and depends on the used flags). A set of useful root macros can be found here:The master branch contains macros which are compliant to root v5.34, the branch root6 contains macros working with root6 as well (this is the development branch). In the git bundle you can find a README file with some indications about how to run the macros, and what they do.
    Note: due to a reversed sign in the magnetic field coordinates in the GBL procedure, the charge of tracks in the produced rootfile is reversed as well (keep this in mind when analysing this output). In many cases, also the u-v axes have to be flipped to provide the correct orientation of the sensors in the space (this is already done almost everywhere in the macros). By inspecting the trend of residuals and distributions one can judge which are the most critical degrees of freedom to float in the following Millepede iteration.

...