F.A.Q.

Installation

Q: Where i can find "step-by-step" installation instructions.
A: Read "INSTALL" file in your current PHAST directory (i.e. in the directory you get after unpacking PHAST tar archive)

Q: What gcc version / ROOT version / Linux version I need to run PHAST ?
A: Here is not complete list of platforms where PHAST had been tested and used:

 - gcc 2.95.2  ROOT v3.00.06   RedHat 6.1 (LXPLUS)
 - gcc 2.95.2  ROOT v3.03.09   RedHat 7.3 (LXPLUS)
 - gcc 2.95.2  ROOT v3.05.05   RedHat 7.3 (LXPLUS)
 - gcc 2.96    ROOT v3.03.09   RedHat 7.2
 - gcc 2.96    ROOT v3.05.02   RedHat 7.2
 - gcc 3.2     ROOT v3.05.02   RedHat 8.0
 - gcc 3.2.2   ROOT v3.10.01   RedHat 9.0
 - gcc 3.2.2   ROOT v4.00.08   RedHat 9.0
 - gcc 3.2.3   ROOT v4.01.02   SLC3 (Scientific Linux at CERN)
 - gcc 3.2.3   ROOT v4.03.01   SLC3 (Scientific Linux at CERN)
 - gcc 3.2.3   ROOT v4.03.04   RedHat 9.0
 - gcc 3.2.3   ROOT v4.03.04   SLC3 (Scientific Linux at CERN)
 - gcc 3.2.3   ROOT v5.02.00   ES3A
 - gcc 3.2.3   ROOT v5.02.00   ES3A
 - gcc 3.4.5   ROOT v5.10.00c  SLC4 (Scientific Linux at CERN)
 - gcc 3.4.6   ROOT v5.14.00b  SLC4 (32-bit and 64-bit mode)
 - gcc 4.1.2   ROOT v5.24.00   SLC5 (32-bit and 64-bit mode)
 - gcc 4.3.2   ROOT v5.28.00b  SLC5 (32-bit and 64-bit mode)

Q: How to compile Phast on platform different from default one (lxplus.cern.ch)
A: Have a look on set of Makefile.* in Phast directory, find what corresponds to your system configuration, change symbolic link Makefile:
to corresponding Makefile.xxxx and make.

Q: Is it possible to install PHAST on system without Fortran compiler, without CERNLIB and/or without RFIO
A: Yes. Use following options of make:
make NO_FORTRAN=1 NO_RFIO=1

Q: On SLC4 machine make ends up with following error:
/usr/bin/ld: cannot find -lRFIO
What shell I do?
A: It means that ROOT is compiled without RFIO support (i.e. there is no $ROOTSYS/lib/libRFIO.so)
On SLC4 platform SHIFT library (RFIO) is included in the system (/usr/lib/libshift.*), so ROOT with RFIO support is not needed anymore. Compile with
make NO_RFIO=1

Q: I can't link Phast in 64 bit mode
A: Phast still have functions which use CERNLIB (e.g. PaTPar::FindCDA()) but CERNLIB is provided as 32 bit library only. So, try
make NO_FORTRAN=1
to disable use of Fortran code and CERNLIB. If your code calls one of disabled functions you will get an error message.

Q: How to compile PHAST with optimization ?
A: Default compilation option (starting from v. 7.015) is "-O2". To compile with "debug information" :
make OPT=-g
Other optimization levels could also be specified. (e.g. make OPT=-O1)
(Remark: do not use level "3", as some of ROOT headers are not compatible with this optimization level)

General

Q: I have a problem (crash at runtime or dictionary compilation problem or ROOT runtime ... etc.)
What to do?
A: First of all, if you run Phast with user function(s), try to run without it or with well tested examples (-u1, -u0). If it works, this means (with high probability) that problem is in user's code
If Phast crashes even without user function(s) try to recompile everything:
 $ make clean
 $ make
If it didn't help, try to take new PHAST version. There is non-zero probability, that problem you discovered had been found and fixed already.
If this also didn't help, write e-mail to coral-weekly@cern.ch with your problem description.

Q: Which units are used in PHAST?
A: [cm], [GeV], [ns], [Tesla]

Q: What is the coordinate system?
A: Right-hand system: Z - along the beam, Y - upward, X - from Saleve to Jura
Origin is at the Polarized Target center.
But it is "nominal" target center. E.g. "Saclay" magnet was moved 35 cm upward.
For setups of COMPASS hardon program, origin is the same as for muon program.

Q: I can't read new mDST with my PHAST which works fine with old mDSTs.
A: This can happen if new mDST had been produced with ROOT version newer than version you use for PHAST compilation. Unfortunately, ROOT versions are not always "forward compatible".
So, switch to newer ROOT version (i.e. redefine your $ROOTSYS and $LD_LIBRARY_PATH) and do make clean ; make

Analysis

Q: What is called beam particle in PHAST?
A: It's a particle, associated to track reconstructed in detectors upstream target.

Q: What is called primary vertex in PHAST?
A: It's a vertex which contains beam track as "incoming" track. Nothing more. Event may contain more then 1 primary vertex.

Q: I see that for the beam track functions ZLast() and ZFirst() (last and first measured point) return the same coordinate. Why?
A: ZFirst() take coordinate from the first saved track parameter (vTPar(0)) while Zlast() returns Z position of detector, corresponding to last bit in track's hitmap.
For beam tracks order of track parameters was reversed to have first one closest to target, while track's hitmap stay unchanged.
If it is too confusing, use Zmin()/Zmax() function which returns Z position of most upstream/downstream detector where this track has hits.

Q: Which particles are tagged as mu prime (i.e. PaParticle::IsMuPrim() function returns "true") ?
A: Particle which is NOT the beam and tagged as "SPECIAL" in CORAL (ask muon ID expert(s) for more details).
Event may contain few mu' particles. Even one vertex may contain few particles tagged as mu'.

Q: Why PaParticle::PID() always returns 5 or -1 ?
A: Currently, only muon identification is rather unambiguous, so PID could be 5, 6 or -1 (unknown)
RICH information is also available on PaTrack, but it's interpretation is left to the end user.

Q: Which particles are identified as muon?
A: Particles already tagged as mu prime in CORAL OR if fraction of radiation lengths traversed by corresponding track X/X0 > 30.

Q: How to pass counters from UserEventN() to UserJobEndN() ?
A: Recommended way: book histogram for counters (1 bin - 1 counter) and fill it in UserEvent().
ROOT histograms could be "seen" everywhere in the code (see UserJobEnd0.cc as example). How to access bin contents, consult ROOT manual.

Q: What is the meaning of RICH information one can get by RichInf() function of PaTrack (NRichInf() elements in total)?
A: This information is just a copy of an array stored in CORAL's CsTrack.
It's better to ask RICH experts about exact meaning of every value.
For current version of RICH package, content of RICH block is following:

//-   partProbs[  0 ]   background Like
//-   partProbs[  1 ]   pion Like
//-   partProbs[  2 ]   kaon Like
//-   partProbs[  3 ]   proton Like
//-   partProbs[  4 ]   pion Like derivative
//-   partProbs[  5 ]   kaon Like derivative
//-   partProbs[  6 ]   proton Like derivative
//-   partProbs[  7 ]   maximum likelihood angle
//-   partProbs[  8 ]   reconstr. ring angle
//-   partProbs[  9 ]   number of photons per part-photon or ring
//-   partProbs[ 10 ]   fitted ring angle
//-   partProbs[ 11 ]   ring chisquare
//-   partProbs[ 12 ]   pion chisquare
//-   partProbs[ 13 ]   kaon chisquare
//-   partProbs[ 14 ]   proton chisquare
//-   ---------------------------------- added
//-   partProbs[ 15 ]   electron Like
//-   partProbs[ 16 ]   muon Like
//-   partProbs[ 17 ]   electron Like derivative
//-   partProbs[ 18 ]   muon Like derivative
//-   partProbs[ 19 ]   electron chisquare
//-   partProbs[ 20 ]   muon chisquare

     (Paolo.Schiavon@cern.ch, 11.04.2005, "coral-weekly" mailing list)

Q: How to get in PHAST refractive index of RICH radiator for run I process ?
A: There are few methods to do this:
1) PaMetaDB::Ref().NminusOne(run) return refractive index for the run # "run" as it was found in calibrations DB at the date which one could see in the first line of ./src/RICH1_ref_index.db file. Normally this "DB snapshot" is updated with every PHAST release.
2) PaSetup::Ref().NminusOne() returns refractive index used at production time. (Unfortunately it was not stored in mDST of early 2002 data production. To recover this information please use special function PaMetaDB::Ref().NminusOneProd(run) instead).

Q: How to estimate beam flux, which corresponds to processed event sample?
A: 2 methods of the flux estimation had been implemented in 2 functions:

     float Phast::IntegratedBeamFlux()
     float Phast::TotalBeamFlux()
See the class documentation for more details
Results of both functions are printed at the end of PHAST job.

Q: I would like to look on the scattered muon at the place downstream the second muon absorber, is there any track information behind SM2 available?
A: In "standard" miniDST from the production this information is not available. Only trajectory parameters in first measured point of track are stored.
But if precision and speed is not very crucial, one may extrapolate available trajectory parameters, to Z position you interesting in (see function PaTPar::Extrapolate()).
From the other hand, user may create his own mDST (see ./coral/README) with all avalable parameters of trajectory. If storage of some hits will be requested, this mode is ON automatically.

Q: What is G3partMass[i] in UserEvent0.cc?
A: It's particles table
(defined in ./lib/G3part.h) which contains information about particles "known" in COMGEANT.

Q: I would like to look on the scattered muon at the place downstream the second muon absorber, is there any track information behind SM2 available?
A: In "standard" miniDST from the production this information is not available. Only trajectory parameters in first measured point of track are stored.
But if precision and speed is not very crucial, one may extrapolate available trajectory parameters, to Z position you interesting in (see function PaTPar::Extrapolate()).
From the other hand, user may create his own mDST (see ./coral/README) with all available parameters of trajectory. If storage of some hits will be requested, this mode is ON automatically.

Q: I work with "MegaDST" (i.e. miniDST with additional hits information). Looking on hits from detectors with F1 chip readout sometimes one may observe more than 1 digit per wire and sometimes they are identical. Is it OK?
A: Yes, it's OK. There are 2 explanations:

  • F1 chip is multi-hit readout, so more then 1 digit per wire is allowed. In this case digits will have different time.
  • In drift detectors pair of hits is created per 1 digit (so called "left/right ambiguity") so one may observe 2 hits with exactly the same time information.

    Monte-Carlo data analysis

    Q: When MC vertex is tagged as "primary" ?
    A: First MC vertex in the list is tagged "primary" if it does not have "mother" track.

    Q: What is pileup MC vertex ?
    A: 2 types of vertices are tagged as "pileup":

  • pseudo vertex - source of pileup MC track. Such "vertex" contains only one track, do not have "mother" track and have Z position very upstream (Z < -800 cm).
  • vertex created by "pileup" track (please note, that products of decay/interaction of pileup track are also tagged as "pileup")

    Q: What are strange numbers PaMCTrack::Pid() function returns?
    A: It's particle ID in the notation similar to GEANT particles table (the same about PaParticle::PID() function).

    Q: Why MC vertex tagged as "primary" do not have "incoming" track (iTrackOfOrigin() == -1)? And where is MC beam track?
    A: PaMCvertex structure is not "symmetric" to PaVertex as it reflects the structure of vertexes, generated by COMGEANT. One feature of the simulated beam is that the beam is normal "outgoing" track in the primary MC vertex with the only difference that it goes "upward" (i.e. Pz < 0).
    To get index of the beam track in MC vertex, one may use PaMCvertex function iBeam(). Currently, it's aways the first in vertex.

    Q: In my kinematics analysis I use 3-momentum of MC beam track (PaMCtrack::Mom3()). As MC beam goes "upward", should I multiply by "-1" all 3 components of MC beam track momentum or only Pz ?
    A: One has to "invert" all 3 components. But if you use PaMCtrack::ParInVtx() to access MC beam track parameters, nothing has to be done as parametrization used in PaTPar do not "know" direction by definition.

    Runtime problems

    Q: I see following warning:
      The StreamerInfo of class PaParticle read from file ...
      has the same version (=8) as the active class but a different checksum.
      You should update the version to ClassDef(PaParticle,9).
      Do not try to write objects with the current class definition,
      the files will not be readable.
    
    What it means?
    A: It's not dangerous and it means that data had been written by ROOT version <= 3.03 and you are using newer one (or other way around). This is because PaParticle contains Byte_t type data-member and implementation of this type seems had been changed in ROOT after v3.03
    This problem will gone itself when both "writers" and "readers" will use newer ROOT version (or both are using old but the same versions).

    Q: At reading of CASTOR files PHAST crashes sometimes and produces a long list of error messages starting from :

    SysError in : error reading from file rfio:/castor/cern.ch/xxxx/mDST-xxxx.root (Timed out)
    ......
    
    What it means and how to cure the problem ?
    A: This problem is related to CASTOR system. Sometimes (during files access) RFIO (Remote File I/O) client-server connection is breaking. From ROOT side it looks like input file is disappear just in the process of reading. As it can happen in any moment of reading/uncompessing/unpacking, ROOT error messages could be very different.
    As attempt to overcome such kind of problems option "-c /some_tmp_dir/" had been introduced in v. 7.005. With this option, instead of direct CASTOR file processing, PHAST makes a copy (via "rfcp") of the CASTOR file into some temporary disk directory (local or /afs) and than process this copy. In the case of any "rfcp" problem, attempt to copy will be repeated many (up to 25) times.
    Be sure that there is sufficient space in your "/some_tmp_dir/" at least for one (biggest) file out of your input files list.

    Q: What does the following error message mean:

    ./phast: error while loading shared libraries: /afs/.../phast.xxx/user/libUser.so: 
      cannot open shared object file: No such file or directory
    
    A: PHAST executable "do not see" one of shared libraries it needs. Check if this file exists and you have "read permission" to it.

    Q: At PHAST startup I see following error message (or similar):

    ./phast: relocation error: /afs/.../phast.xxx/lib/libPhast.so: undefined symbol:
      __Q24ROOT17TGenericClassInfoPCciT1iRC9type_infoPCQ24ROOT13TInitBehaviorPFv_vPFPCv_P6TClassi
    
    A: Seems your PHAST executable had been compiled with different version of ROOT that you have now in $LD_LIBRARY_PATH
    Try to recompile everything "from scratch" with your actual ROOT.

    Q: What does the following error message means:

     Error: Can't find the tree PaSetup
    
    A: This could means that CORAL (or PHAST) job which had produced this mDST file didn't terminated correctly
    (PaSetup object is stored at the very end of job).
    This error message you will see also if you try to process by PHAST not mDST file (e.g. ROOT file with histograms)

    Q: PHAST has a memory leak. I see in "top" that consumed memory is always growing.
    A: I is not a memory leak, while used memory is really growing and proportional to number of processed events. This is due to the fact that PHAST has protection against doubling of events in input file(s). It is done such way: for every processed event its run, spill and event-number-in-spill are stored in sorted container and every following event is searched in this container to be sure that it was not yet processed. So, the size of this container is constantly grows.
    If this check is not important for your analysis, it could be switched off by "-f" option.
    (Nevertheless small increase of allocated memory could be observed because of method for flux estimation: maximum and minimum flux scaler values are stored for every spill of every run of input data sample).

    CORAL+PHAST (mDST production mode)

    Q: I have a problem compiling/linking PHAST with CORAL libraries
    A: If you try to compile/link PHAST with relatively old CORAL versions, try to specify explicitly date when CORAL was checked out
    make CORAL_DATE=YYYYMMMDD
    (e.g. make CORAL_DATE=20051030 for 30.10.2005)

    Q: I try to produce MC mDST running CORAL+Phast on MC data and job stops because following exception was thrown:

     char* exception: DaqEventsManager::GetEvent(): no event.
    A: This is due to a bug which was introduced in Phast v.7.057. This bug was fixed in v. 7.061
    Please, update your Phast and recompile coral.exe

    15.12.2011 S.Gerassimov