This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Internal compiler error



	Hello EGCS gurus,

enclosed below is a full set of sources compilation of which 
(file SvxLadder.findClusters.cc) causes EGCS to bail out.

				Regards, Pasha.

--------------------------------------------------------------------------------
/data61/top/murat/test28/bug/b1>dir -l
total 192
drwxr-sr-x    2 murat    cdftop_d    4096 May 13 18:29 ./
drwxr-sr-x    3 murat    cdftop_d      20 May 13 18:16 ../
-rw-r--r--    1 murat    cdftop_d    8310 May 13 18:19 SvxLadder.findClusters.cc
-rw-rw-rw-    1 murat    cdftop_d   13303 May 13 18:28 SvxLadder.hh
-r--r--r--    1 murat    cdftop_d    3711 May 13 18:29 SvxReadoutConstants.hh
-r--r--r--    1 murat    cdftop_d     667 May 13 18:18 SvxTypes.hh
-r--r--r--    1 murat    cdftop_d    2221 May 13 18:29 TSvxReadout.hh
--------------------------------------------------------------------------------

/data61/top/murat/test28/bug/b1>/data61/top/murat/egcs-19980502/bin/gcc -v -c SvxLadder.findClusters.cc
Reading specs from /data61/top/murat/egcs-19980502/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.91.26/specs
gcc version egcs-2.91.26 19980502 (gcc2 ss-980401 experimental)
 /data61/top/murat/egcs-19980502/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.91.26/cpp -lang-c++ -v -isystem /data61/top/murat/egcs-19980502/bin/include -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -Dunix -Dmips -Dsgi -Dhost_mips -DMIPSEB -D_MIPSEB -DSYSTYPE_SVR4 -D_SVR4_SOURCE -D_MODERN_C -D__DSO__ -D_MIPS_SIM=_MIPS_SIM_ABI32 -D_MIPS_SZPTR=32 -D__unix__ -D__mips__ -D__sgi__ -D__host_mips__ -D__MIPSEB__ -D_MIPSEB -D__SYSTYPE_SVR4__ -D_SVR4_SOURCE -D_MODERN_C -D__DSO__ -D_MIPS_SIM=_MIPS_SIM_ABI32 -D_MIPS_SZPTR=32 -D__unix -D__mips -D__sgi -D__host_mips -D__MIPSEB -D__SYSTYPE_SVR4 -Asystem(unix) -Asystem(svr4) -Acpu(mips) -Amachine(sgi) -D__EXCEPTIONS -D__CHAR_UNSIGNED__ -D__LANGUAGE_C_PLUS_PLUS -D_LANGUAGE_C_PLUS_PLUS -D__SIZE_TYPE__=unsigned int -D__PTRDIFF_TYPE__=int -D__EXTENSIONS__ -D_SGI_SOURCE -D_LONGLONG -D_MIPS_FPSET=16 -D_MIPS_ISA=_MIPS_ISA_MIPS1 -D_MIPS_SZINT=32 -D_MIPS_SZLONG=32 SvxLadder.findClusters.cc /var/tmp/cca0035E.ii
GNU CPP version egcs-2.91.26 19980502 (gcc2 ss-980401 experimental) [AL 1.1, MM 40] SGI running IRIX 5.x
#include "..." search starts here:
#include <...> search starts here:
 /data61/top/murat/egcs-19980502/include/g++
 /data61/top/murat/egcs-19980502/mips-sgi-irix5.3/include
 /data61/top/murat/egcs-19980502/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.91.26/include
 /usr/include
End of search list.
 /data61/top/murat/egcs-19980502/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.91.26/cc1plus /var/tmp/cca0035E.ii -quiet -dumpbase SvxLadder.findClusters.cc -version -o /var/tmp/cca0035E.s
GNU C++ version egcs-2.91.26 19980502 (gcc2 ss-980401 experimental) (mips-sgi-irix5.3) compiled by GNU C version 2.8.1.
/data61/top/murat/egcs-19980502/include/g++/stl_uninitialized.h: In function `struct SVX_CLUSTER_ * __uninitialized_copy<SVX_CLUSTER_ *, SVX_CLUSTER_ *, SVX_CLUSTER_>(struct SVX_CLUSTER_ *, struct SVX_CLUSTER_ *, struct SVX_CLUSTER_ *, struct SVX_CLUSTER_ *)':
/data61/top/murat/egcs-19980502/include/g++/stl_uninitialized.h:65: Internal compiler error.
/data61/top/murat/egcs-19980502/include/g++/stl_uninitialized.h:65: Please submit a full bug report to `egcs-bugs@cygnus.com'.
--------------------------------------------------------------------------------




static void initCluster(SVX_CLUSTER_& cluster, SVX_HIT_STRIP_& s) {
  cluster.First         = s.Number;
  cluster.Size          = 1;
  cluster.Charge        = s.Charge;
  cluster.Bad           = s.Bad;
  cluster.CenterOfMass  = cluster.First*cluster.Charge;

				        // we need the following only for MC
  cluster.NParticles    = 0;

  for (int i=0; (i<s.NParticles) && (cluster.NParticles<SVX_MAX_MC); i++) {
    cluster.McNumber[cluster.NParticles++] = s.McNumber[i];
  }
}




static void updateCluster(SVX_CLUSTER_ & cluster, SVX_HIT_STRIP_& s) {
  cluster.Size++;
  cluster.Charge       += s.Charge;
  cluster.CenterOfMass += s.Number*s.Charge;

  if (s.Bad > cluster.Bad) {
    cluster.Bad = s.Bad;
  }
				        // MC-specific part (keep only
					// SVX_MAX_MC particles for each
					// cluster
  int   new_mc_particle;
  int   mc;
  for (int i=0; (i<s.NParticles)&&(cluster.NParticles<SVX_MAX_MC); i++) {
    mc              = s.McNumber[i];
    new_mc_particle = 1;
    for (int j=0; j<cluster.NParticles; j++) {
      if (mc == cluster.McNumber[j]) {
	new_mc_particle = 0;
	break;
      }
    }
    if (new_mc_particle) {
      cluster.McNumber[cluster.NParticles++] = mc;
    }
  }
}



static void markStrips(vector<SVX_HIT_STRIP_>& stripList,
		       vector<int>&                badList  ) {

  int n_bad_strips = badList.size();
  int ibad         = 0;
  for (SVX_HIT_STRIP_* s = stripList.begin(); s != stripList.end()  ; s++) {
    (*s).Bad = 0;
    while ((ibad<n_bad_strips) && (badList[ibad]<(*s).Number-1)) ibad++;
 
    if (ibad<n_bad_strips) {
      if (badList[ibad] == (*s).Number-1) {

					// previous strip is bad
	(*s).Bad = 1;
	if (++ibad < n_bad_strips) {
	  if (badList[ibad] == (*s).Number) {

					// strip itself is bad
	    (*s).Bad = 2;
	    if (++ibad < n_bad_strips) {
	      if (badList[ibad] == (*s).Number+1) {

					// next strip itself is bad

		if (! (*s).Bad) (*s).Bad = 1;
		ibad++;
	      }
	    }
	  }
	}
      }
    }
  }
}




/*------------------------------------------------------------------------------
 | A cluster is defined as:
 | - At least one channel ('seed' channel) with a signal greater than
 |   or equal to "seedThreshold";
 | - zero or more channels, adjacent to the seed ones, with a signal
 |   greater than or equal to "sideThreshold".
 | - If a 'bad' channel (either 'noisy' or 'dead') is inside the cluster
 |   or adjacent to the it, the cluster is flagged 'bad".
------------------------------------------------------------------------------*/
int  SVX_LADDER::findClusters(vector<SVX_HIT_STRIP_>&  stripList,
				  vector<SVX_CLUSTER_>&  clusterList) {

  SVX_CLUSTER_  cl;
  int               above_threshold;
				        // declare `par' static to initialize 
					// it just once

  static CLUSTERING_PARAMETERS_& par = SVX_LADDER::ClusteringParameters;

					// these fields could be defined just
					// once per ladder

  cl.Barrel     = this->barrelNumber();
  cl.Wedge      = this->wedgeNumber();
  cl.Layer      = this->layerNumber();
  cl.ZFlag      = par.ZFlag;
  cl.Shared     = 0;
				        // should be radius at which the ladder 
					// is located
  cl.Y          = this->Radius;


  cl.First        = -1;
  above_threshold =  0;

  for (SVX_HIT_STRIP_* s =  stripList.begin(); s != stripList.end()  ; s++) {

					// use only strips above 
					// sideThreshold

    if ((*s).Charge > par.SideThreshold) {
      if ((*s).Charge > par.SeedThreshold) {

					// to be stored cluster should have at
					// least one strip with 
					// charge >= seedThreshold
	above_threshold = 1;
      }
      if (cl.First == -1) {
	initCluster(cl,*s);
      }
      else if ((*s).Number-cl.First == cl.Size) {

					// add strip to already existing cluster
	updateCluster(cl,*s);
      }
      else {
				        // save previous cluster, start new one
	
	cl.CenterOfMass = cl.CenterOfMass/cl.Charge;
	cl.X            = par.XMin+cl.CenterOfMass*par.Pitch;
	clusterList.push_back(cl);
	initCluster(cl,*s);
      }
    }
    else if (above_threshold) {
				        // strip charge is below clustering 
					// threshold
					// there is a found cluster, save it
					// hit strips are assumed to be ordered,
					// so clusters will be ordered 
					// automatically

      cl.CenterOfMass = cl.CenterOfMass/cl.Charge;
      cl.X            = par.XMin+cl.CenterOfMass*par.Pitch;
      clusterList.push_back(cl);
      above_threshold =  0;
      cl.First        = -1;
    }
  }
					// loop over axial strips is over, save
					// last cluster if any
  if (above_threshold) {
    cl.CenterOfMass = cl.CenterOfMass/cl.Charge;
    cl.X            = par.XMin+cl.CenterOfMass*par.Pitch;
    clusterList.push_back(cl);
    above_threshold = 0;
  }
  return 1;
}




int SVX_LADDER::doClustering() {
				        // declare `par' static to initialize 
					// it just once
				        // this is only a matter of convenience

  static CLUSTERING_PARAMETERS_& par = SVX_LADDER::ClusteringParameters;
  if (AxialStripList.size() > 0) {
//------------------------------------------------------------------------------
//  do clustering for axial strips
//  start from looping  over the strips and for each strip define whether it is
//  good           (strip.Bad = 0)
//  ajacent to bad (strip.Bad = 1)
//  bad itself     (strip.Bad = 2)
//------------------------------------------------------------------------------
//     par.SideThreshold = RPhiSideThreshold;
//     par.SeedThreshold = RPhiSeedThreshold;
//     par.XMin          = this->xStripMin();
//     par.Pitch         = this->axialPitch();
//     par.ZFlag         = 0;

//     markStrips(AxialStripList,BadAxialStripList);
//     this->findClusters(AxialStripList,AxialClusterList);
  }

//   if (StereoStripList.size() == 0) return 1;
// //------------------------------------------------------------------------------
// //  list of hit stereo clusters is not empty
// //  now do clustering for stereo strips : again, start from marking strips
// //  as good, ajacent to bad and bad
// //------------------------------------------------------------------------------
//   markStrips(StereoStripList,BadStereoStripList);

//   if (this->type() == _SVX_Z_LADDER_) {

// 					// 90 degree stereo ladder

//     par.SideThreshold = ZSideThreshold;
//     par.SeedThreshold = ZSeedThreshold;
//     par.XMin          = this->zStripMin();
//     par.Pitch         = this->stereoPitch();
//     par.ZFlag         = 1;

//     this->findClusters(StereoStripList,StereoClusterList);
//   }
//   else {
// 					// small angle stereo ladder
// 					// **** do nothing to the moment ***

//     par.SideThreshold = RPhiSideThreshold;
//     par.SeedThreshold = RPhiSeedThreshold;

// 					// it is not clear enough what to call
// 					// XMin for small angle stereo side
// 					// and even why would we need it...
// 					// so cluster coordinate makes sense 
// 					// only in units of strip numbers

//     par.XMin          = this->xStripMin();
//     par.Pitch         = this->axialPitch();
//     par.ZFlag         =  2;

//     this->findClusters(StereoStripList,StereoClusterList);
//   }
  return 1;
}

#ifndef __SVX_LADDER_HH__
#define __SVX_LADDER_HH__
//------------------------------------------------------------------------------
//  this include file describes silicon ladder, description of which is supposed
//  to be the same for SVXII and ISL
//  author : P.Murat (INFN-Pisa & ITEP-Moscow)
//  revision history
//  -----------------
// *0001 Feb 22 1997 P.Murat: move G3Volume to GEOM area
// *0002 Mar 14 1997 P.Murat: new constant SILICON_MAX_MC (fix bug found by
//                            S.Donati)
// *0003 May 03 1997 P.Murat: add new print method
// *0004 Jul 15 1997 P.Murat: change STL list into STL vector for the lists
//                            of hit strips 
// *0005 Aug 13 1997 P.Murat: merge SVXII and ISL into a single detector,
//                            no need in SiliconEnumTypes.hh any more
// *0006 Feb 04 1998 P.Murat: add methods returning pointers to hit strips
//------------------------------------------------------------------------------
#ifndef __CINT__
#include <vector.h>
#include <fstream.h>
#endif

#ifndef SVXII_TSvxReadout
#include "TSvxReadout.hh"
#endif

#ifndef __SVX_TYPES__
#include "SvxTypes.hh"
#endif

class SVX_BARREL;
				        // max number of MC particle numbers to
					// be stored in the strip/cluster  
					// structure
int const SVX_MAX_MC  = 3;
				        // max number of tracks sharing this
					// cluster to be remembered
int const SVX_MAX_TRK = 3;
                                        // hit strip - remember only first 3
                                        // particles, which hit this strip
struct SVX_HIT_STRIP_ {
  short   Number;			// strip number
  short   Charge;			// deposited charge (units ????)
  char    Bad;			        // 0: OK, 1: ajacent to bad; 2: bad
  char    NParticles;			// # MC particles hit this strip
  short   McNumber[SVX_MAX_MC];    	// seq. numbers of the MC particles
};

struct SVX_CLUSTER_ {
  short Number;                         // sequential number of this cluster
  short First;                          // 1st strp of the clstr (strtng frm 0)
  char  Size;                           // cluster size (number of strips)
  char  Bad;                            // quality flag (0/1)
  short Charge;                         // cluster charge
  short Sigma;                          // cluster position resolution [um]
  short McNumber[SVX_MAX_MC];		// array of MC numbers 
  char  NParticles;                     // # of MC particles hit this cluster
  char  Shared;                         // # of tracks, sharing this cluster
  short TrackNumber[SVX_MAX_TRK];	// array of track numbers (ID's ????)
  char  ZFlag;                          // 0/1/2 for axial/Z/stereo cluster
  char  Barrel;                         //
  char  Wedge;                          //
  char  Layer;                          // 
  float X;                              // cluster X in the local coord.system
  float Y;                              // cluster Y in local coordinate system
  float CenterOfMass;		        // cluster X in strip pitch units
};

// class SVX_LADDER  : public G3_BOX {
class SVX_LADDER {
					// constants used by the clustering 
					// algorithm
  struct CLUSTERING_PARAMETERS_ {
    int     SideThreshold;
    int     SeedThreshold;
    double  XMin;
    double  Pitch;
    int     ZFlag;
  };

//------------------------------------------------------------------------------
//  static members
//------------------------------------------------------------------------------
protected:
					// r-phi (axial and stereo) clustering
					// thresholds

  static int                     RPhiSideThreshold;
  static int                     RPhiSeedThreshold;

					// Z-clustering thresholds

  static int                     ZSideThreshold;
  static int                     ZSeedThreshold;
  static CLUSTERING_PARAMETERS_  ClusteringParameters;
//------------------------------------------------------------------------------
//  silicon layer contains lists of clusters, it has sizes, it knows about radial 
//  distance , misalignment etc...
//
//  strip numbering convention:  strip number goes up with local X-coord or 
//  with local Z-coord for Z-strips
//
//  data members :
//------------------------------------------------------------------------------
protected:
                                        // type of the ladder : 90 degree or
                                        // small angle stereo (it always assumed to
					// be double-sided)
  SVX_LADDER_TYPE_       Type;
					// own sequential number
  int                    Number;
                                        // layer number
  int                    LayerNumber;
				        // barrel number
  int                    BarrelNumber;
				        // wedge number
  int                    WedgeNumber;
					// ladder index within the wedge (always 0 
					// for SVXII, (0-2) for ISL
  int                    WedgeIndex;
				        // radius of the ladder center 
  double                 Radius;
                                        // active area (area, covered by strips)
                                        // X-limits in local coord. system
  double                 XStripMin;
  double                 XStripMax;
                                        // active area (area, covered by strips)
                                        // Z-limits in local coord. system
  double                 ZStripMin;
  double                 ZStripMax;
                                        // numbers of R-Phi strips;
  int                    NAxialStrips;
                                        // number of stereo (small-angle or Z)
                                        // strips
  int                    NStereoStrips;
					// number of Z-readout channels: 90-degree
					// stereo layers have Z-channels ganged...

  int                    NStereoChannels;

                                        // stereo angle
  double                 StereoAngle;
                                        // and its tangent
  double                 TanStereoAngle;

  double                 AxialPitch;
  double                 StereoPitch;
					// local X-coordinate of the 1st (#0) 
                                        // axial strip
  double                 X0;
                                        // local X-coordinate of the 1st (#0) 
                                        // stereo strip
  double                 Z0;
                                        // phi angle of the ladder center
  double                 Phi;
                                        // ladder covers phi region 
                                        // [Phi-DPhi,Phi+DPhi]
  double                 DPhi;
                                        // ladder strips cover phi region 
                                        // [Phi-DPhiStrip,Phi+DPhiStrip]
  double                 DPhiStrip;

#ifndef __CINT__
				        // lists of hit strips

  vector<SVX_HIT_STRIP_>    AxialStripList;
  vector<SVX_HIT_STRIP_>    StereoStripList;

				        // lists of clusters

  vector <SVX_CLUSTER_>     AxialClusterList;
  vector <SVX_CLUSTER_>     StereoClusterList;

				        // lists of bad strips (retrieve from 
					// the database in the beginning of
					// each run)

  vector<int>               BadAxialStripList;
  vector<int>               BadStereoStripList;
#endif
					// this is used only by MC: count number
					// of particles hitting the ladder (of
					// course, the same particle may hit the
					// ladder several times)
  int                       NAxialHits;
  int                       NStereoHits;
//------------------------------------------------------------------------------
//  functions
//------------------------------------------------------------------------------
public:
                                        // ****** constructors ******
  SVX_LADDER();
                                        // ****** init functions ******
  int  init();
  int  initEvent();
  int  initGeometry(SVX_BARREL* barrel, int i);

                                        // ****** data access methods ******

  SVX_LADDER_TYPE_   type() { return Type; }

                                        // access to geometrical parameters

//   double xMin             () { return   -G3_BOX::xMax(); }
//   double zMin             () { return   -G3_BOX::zMax(); }
//   double thickness        () { return 2.*G3_BOX::yMax(); }

  double xStripMin        () { return XStripMin; }
  double xStripMax        () { return XStripMax; }
  double zStripMin        () { return ZStripMin; }
  double zStripMax        () { return ZStripMax; }

  int    number           () { return Number; }
  int    barrelNumber     () { return BarrelNumber; }
  int    wedgeNumber      () { return WedgeNumber;  }
  int    layerNumber      () { return LayerNumber;  }

  double phi              () { return Phi;    } 
  double dPhi             () { return DPhi;   }
  double dPhiStrip        () { return DPhiStrip; }

  double   radius         () { return Radius; }
  int      nAxialStrips   () { return NAxialStrips; }
  int      nStereoStrips  () { return NStereoStrips; }

					// no ganging on r-phi side

  int      nAxialChannels () { return NAxialStrips; }
  int      nStereoChannels() { return NStereoChannels; }
  int      nRPhiSideChips () { return NAxialStrips/128; }
  int      nZSideChips    () { return NStereoChannels/128; }

  int      nReadoutChips(int side) {
    return (side == 0) ? nZSideChips() : nRPhiSideChips();
  }

  double   axialPitch     () { return AxialPitch; }
  double   stereoPitch    () { return StereoPitch; }
  double   x0             () { return X0; }
  double   z0             () { return Z0; }

  int    nAxialHits       () { return NAxialHits; }
  int    nStereoHits      () { return NStereoHits; }

  int    rPhiSideThreshold() { return SVX_LADDER::RPhiSideThreshold; }
  int    rPhiSeedThreshold() { return SVX_LADDER::RPhiSeedThreshold; }
  int    zSideThreshold   () { return SVX_LADDER::ZSideThreshold;    }
  int    zSeedThreshold   () { return SVX_LADDER::ZSeedThreshold;    }

                                        // ****** setters ******

  void   setBarrelNumber     (int i) { BarrelNumber = i; }
  void   setWedgeNumber      (int i) { WedgeNumber  = i; }
  void   setLayerNumber      (int i) { LayerNumber  = i; }

  void   setRPhiSideThreshold(int i) { SVX_LADDER::RPhiSideThreshold = i; }
  void   setRPhiSeedThreshold(int i) { SVX_LADDER::RPhiSeedThreshold = i; }
  void   setZSideThreshold   (int i) { SVX_LADDER::ZSideThreshold = i;    }
  void   setZSeedThreshold   (int i) { SVX_LADDER::ZSeedThreshold = i;    }


                                        // ****** other (non-trivial) methods

				        // generate hit produced by a given
					// `mcParticle' with `p1' and `p2' being
					// entrance and exit points

  int    generateHit(float* p1, float* p2, int mcParticle);

  int   adcCounts(short charge);

  int    doClustering();
				        // ****** print methods ******
  int    print (char* text=0);
  int    print (ostream& output, char* text=0);

  double axialClusterResolution (int size);
  double stereoClusterResolution(int size);

				        // it is not very elegant, but
				        // otherwise there is no simple way to 
					// loop over the hit strips
#ifndef __CINT__
  vector<SVX_HIT_STRIP_>* axialStripList () { return &AxialStripList; }
  vector<SVX_HIT_STRIP_>* stereoStripList() { return &StereoStripList; }
#endif

  int    nHitAxialStrips () { 
    return AxialStripList.size(); 
  }

  int    nHitStereoStrips() { 
    return StereoStripList.size(); 
  }

  int    addHitAxialStrip   (SVX_HIT_STRIP_& strip);
  int    addHitStereoStrip  (SVX_HIT_STRIP_& strip);

  SVX_HIT_STRIP_* axialStrip (int i) { return AxialStripList.begin()+i;  }
  SVX_HIT_STRIP_* stereoStrip(int i) { return StereoStripList.begin()+i; }

					// we also need to access cluster 
					// information
#ifndef __CINT__
  vector<SVX_CLUSTER_>* axialClusterList () { return &AxialClusterList ; }
  vector<SVX_CLUSTER_>* stereoClusterList() { return &StereoClusterList; }
#endif

  int nAxialClusters         () { return AxialClusterList.size(); }
  int nStereoClusters        () { return StereoClusterList.size(); }

  SVX_CLUSTER_* axialCluster (int i) { return AxialClusterList.begin()+i;  }
  SVX_CLUSTER_* stereoCluster(int i) { return StereoClusterList.begin()+i; }

                                        // returns 1 if `phi' is within the
                                        // angular region, covered by this
                                        // ladder (geometrically)
  int    coversPhi     (double phi);
                                        // returns 1 if `phi' is within the
                                        // angular region, covered by this
                                        // ladder strips
  int    stripsCoverPhi(double phi);
//------------------------------------------------------------------------------
//  private methods
//------------------------------------------------------------------------------

					// called from doClustering()
#ifndef __CINT__
  int    findClusters(vector<SVX_HIT_STRIP_>&  stripList,
		      vector<SVX_CLUSTER_>&  clusterList);
#endif
};


#endif
					// different types of strips

enum  SVX_STRIP_TYPE_ {_SVX_AXIAL_STRIP_, 
		       _SVX_Z_STRIP_, 
		       _SVX_STEREO_STRIP_};

					// different types of ladders

enum SVX_LADDER_TYPE_ { _SVX_Z_LADDER_, 
			_SVX_STEREO_LADDER_ };

#endif
#include "SvxReadoutConstants.hh"

class TSvxReadout {
public:
					// normal-end-of-record byte
  static char const EOR;
					// fill-end-of-record byte
  static char const EORF;
protected:
					// number of VME readout boards for
					// SVXII and ISL
  int             fNSvxiiVrb;
  int             fNIslVrb;
					// number of port cards read by one
					// VRB
  int             fNPortCardsPerVrb;
					// number of HDI's connected to the same
					// portcard
  int             fNHdiPerPortCard;
					// number of ISL ladders served by 
					// one HDI
  int             fNIslLaddersPerHdi;
					// number of different portcard-ladder
					// combinations
  int             fNIslPortCards;
					// SVXII VRB map
  SvxiiVrb_t*     fSvxiiVrb;
					// ISL VRB map
  IslVrb_t*       fIslVrb;
					// ISL port card map
  IslPortCard_t*  fIslPortCard;
					// index of the 1st port card in the 
					// corresponding array (need it for ISL
					// only)
  int*            fPcFirstIndex;
//------------------------------------------------------------------------------
//  functions:
//------------------------------------------------------------------------------
public:
					// ****** constructors and destructor
  TSvxReadout();
  ~TSvxReadout();
					// ****** access methods

  int             NSvxiiVrb       () { return fNSvxiiVrb; }
  int             NIslVrb         () { return fNIslVrb;   }
  int             NPortCardsPerVrb() { return fNPortCardsPerVrb; }
  int             NHdiPerPortCard () { return fNHdiPerPortCard; }

  int             NIslLaddersPerHdi() { return fNIslLaddersPerHdi; }

  SvxiiVrb_t*     SvxiiVrb    (int i) { return fSvxiiVrb+i; }
  IslVrb_t*       IslVrb      (int i) { return fIslVrb+i;   }
  IslPortCard_t*  IslPortCard (int i) { return fIslPortCard+i; }
  int             PcFirstIndex(int i) { return fPcFirstIndex[i]; }

};

extern TSvxReadout* gSvxReadout;

#endif
					// number of port cards read out by 
					// one VRB (2 per VRB)
int   const  kNPortCardsPerVrb = 2;
					// number of SVXII VME readout boards
int   const  kNSvxiiVrb  = 36;

struct SvxiiVrb_t {
  int  fWedge;
  int  fHalfBarrel[2];
};
					// each VRB read 2 port cards
#ifndef __CINT__
SvxiiVrb_t const kSvxiiVrb[kNSvxiiVrb] = {

					// west barrel
  { 0, 0, 1},
  { 1, 0, 1},
  { 2, 0, 1},
  { 3, 0, 1},
  { 4, 0, 1},
  { 5, 0, 1},
  { 6, 0, 1},
  { 7, 0, 1},
  { 8, 0, 1},
  { 9, 0, 1},
  {10, 0, 1},
  {11, 0, 1},
  				// central barrel
  { 0, 2, 3},
  { 1, 2, 3},
  { 2, 2, 3},
  { 3, 2, 3},
  { 4, 2, 3},
  { 5, 2, 3},
  { 6, 2, 3},
  { 7, 2, 3},
  { 8, 2, 3},
  { 9, 2, 3},
  {10, 2, 3},
  {11, 2, 3},
  				// east barrel
  { 0, 4, 5},
  { 1, 4, 5},
  { 2, 4, 5},
  { 3, 4, 5},
  { 4, 4, 5},
  { 5, 4, 5},
  { 6, 4, 5},
  { 7, 4, 5},
  { 8, 4, 5},
  { 9, 4, 5},
  {10, 4, 5},
  {11, 4, 5}
};
#endif
//------------------------------------------------------------------------------
//  ISL readout structure
//------------------------------------------------------------------------------
int   const  kNIslVrb          = 16;
					// ISL: each HDI reads out data from 
					// 2 ladders
int const    kNIslLaddersPerHdi  = 2;

struct IslVrb_t {
  int  fBarrel;				// physical barrel(0:west,1:central,2:east)
  int  fHalfBarrel;			// half-barrel within the layer
  int  fPcNumber[2];			// portcards 
};

#ifndef __CINT__
IslVrb_t const  kIslVrb[] = {
					// east barrel, half-barrel 0
  {0, 0, 0, 1}, 
  {0, 0, 2, 3}, 
  {0, 0, 4, 5},
					// east barrel, half-barrel 1
  {0, 1, 0, 1}, 
  {0, 1, 2, 3}, 
  {0, 1, 4, 5},
					// central barrel, half-barrel 0
  {1, 0, 6, 7}, 
  {1, 0, 8,-1}, 
					// central barrel, half-barrel 1
  {1, 1, 6, 7}, 
  {1, 1, 8,-1}, 
					// west barrel, half-barrel 0
  {2, 2, 0, 1}, 
  {2, 2, 2, 3}, 
  {2, 2, 4, 5},
					// west barrel, half-barrel 1
  {2, 3, 0, 1}, 
  {2, 3, 2, 3}, 
  {2, 3, 4, 5}
};

#endif
struct IslHdi_t {
  int  fLayer;
  int  fLadder[2];
};

struct IslPortCard_t {
  IslHdi_t fHdi[5];
};

					// constants describing attachment of 
					// port cards to ladders
					// (within the half-barrel)
int const kNIslPortCards = 9;

#ifndef __CINT__
					// keep descriptions of all the 
					// portcards in one array
int const kPcFirstIndex[] = {
  0, 0, 0, 0, 0, 0, 6, 0
};

					// each port card reads out 5 ISL
					// ladders which do not necessarily
					// belong ot the same layer

IslPortCard_t  const kIslPortCard[kNIslPortCards] = 
{
					// layout of the forward half-barrel 
					// readout
  { 7,35, 0,
    5,23, 0,
    7, 1, 2,
    5, 1, 2,
    7, 3, 4 },

  { 7, 5, 6,
    5, 3, 4,
    7, 7, 8,
    5, 5, 6,
    7, 7,10 },

  { 7,11,12,
    5, 7, 8,
    7,13,14,
    5, 9,10,
    7,15,16 },

  { 7,17,18,
    5,11,12,
    7,19,20,
    5,13,14,
    7,21,22 },

  { 7,23,24,
    5,15,16,
    7,25,26,
    5,17,18,
    7,27,28 },

  { 7,29,30,
    5,19,20,
    7,31,32,
    5,21,22,
    7,33,34 },
					// central half-barrel
  { 6,27, 0,
    6, 1, 2,
    6, 3, 4,
    6, 5, 6,
    6, 7, 8 },

  { 6, 9,10,
    6,11,12,
    6,13,14,
    6,15,16,
    6,17,18 },
 
  { 6,19,20,
    6,21,22,
    6,23,24,
    6,25,26,
   -6,-1,-1 }
};
#endif

#endif

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]