Logo Search packages:      
Sourcecode: kboincspy version File versions  Download package

lhcdata.h

/***************************************************************************
 *   Copyright (C) 2004 by Roberto Virga                                   *
 *   rvirga@users.sf.net                                                   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef LHCDATA_H
#define LHCDATA_H

#include <qdatetime.h>
#include <qmap.h>
#include <qstringlist.h>

/*
   References:
     F. Schmidt, "SixTrack Version 3.1 User's Reference Manual", CERN/SL/94-56 (AP), March 2000
     http://frs.home.cern.ch/frs/report/six.ps.gz
*/

struct LHCGeom {
  QString keyword,
          title;
};

struct LHCTrac {
  unsigned numl,        // Number of turns in the forward direction
           numlr,       // Number of turns in the backward direction
           napx;        // Number of amplitude variations
  double amp[2];        // Start and end amplitude in the horizontal phase space plane
  unsigned ird,         // Type of amplitude variation
           imc,         // Number of variations of the relative momentum deviation
           idy[2],      // Coupling switches
           idfor,       // Prolonged run switch
           irew,        // Tracking data output rewound switch
           iclo6,       // Use algebra package switch
           nde[2],      // Number of turns at flat bottom and flat top
           nwr[4],      // Data output interval 
           ntwin,       // Computation accuracy switch
           ibidu;       // Create/read full binary dump on unit 32 switch
};
  
struct LHCCoord {
  struct {
    double mm,
           mrad;
  } x, y;
  double plen,          // Path length (mm)
         rmdev,         // Relative momentum deviation
         egy;           // Energy (MeV)
};
       
struct LHCInit {
  unsigned itra;        // Number of particles
  double chi0,          // Starting phase of the initial coordinate
         chid,          // Phase difference between the two particles
         rat;           // Emittance ratio
  unsigned iver;        // Vertical coordinates adjust switch
  LHCCoord coord[2];    // Initial coordinates of the 2 particles
  double regy;          // Energy of the reference particle (MeV)
};

struct LHCSync {
  int harm;             // Harmonic number
  double alc,           // Momentum compaction factor
         u0,            // Circumference voltage (MV)
         phag,          // Acceleration phase (deg)
         tlen,          // Length of the accelerator (m)
         pma;           // Rest mass of the particle (MeV/c^2)
  int ition;            // Transition energy switch
  double dppoff,        // Offset relative momentum deviation
         dpscor,        // Scaling factor for relative momentum deviation
         sigcor;        // Path length difference
};

struct LHCUnit3 {
  LHCGeom geom;
  LHCTrac trac;
  LHCInit init;
  LHCSync sync;
  
  bool parse(const QStringList &lines);
};

struct LHCResult {
  LHCUnit3 unit3;
};

struct LHCHeader {
  QString title[2];     // General and additional title
  QDateTime time;       // Date and time
  QString prog;         // Program name
  struct {
    unsigned fst,       // First particle in the file
             last,      // Last particle in the file
             count;     // Total number of particles
  } part;
  unsigned phdim,       // Code for dimensionality of phase space
           expl;        // Projected number of turns
  struct {
    double hor,         // Horizontal tune
           ver,         // Vertical tune
           lng;         // Longitudinal tune
  } tune;
  double clorb[6];      // Closed orbit vector
  double disp[6];       // Dispersion vector
  double tfer[6][6];    // Six-dimensional transfer map
  double smax,          // Maximum number of different seeds
         seed,          // Actual seed number
         sstart,        // Starting value of the seed
         numlr;         // Number of turns in the reverse direction
  double lyap[2];       // Correction-factor for the Lyapunov
  double ripro;         // Start turn number for ripple prolongation
  
  bool parse(QDataStream &stream);
};

struct LHCDatum {
  unsigned part;        // Particle number
  double phad;          // Angular distance in phase space
  LHCCoord coord;
  
  bool parse(QDataStream &stream, unsigned &bytes);
};

struct LHCOutput {
  LHCHeader header;
  QMap<unsigned,LHCDatum> data[2];
  
  bool parse(QDataStream &stream);
};

struct LHCState {
  QMap<unsigned,LHCOutput> output;
};

#endif

Generated by  Doxygen 1.6.0   Back to index