ROOT logo
//*-- Author : R.Schicker
//*-- Modified : M. Sanchez (8.06.2000)
//*-- Modified : R. Holzmann (23.06.2004)
//_HADES_CLASS_DESCRIPTION
/////////////////////////////////////////////////////////////////////////
//
//  HMdcSeg
//
// This is the SEGment class of MDC. This data
// container holds the information about a straight
// track let between a pair of MDCs. The coordinate systems
// corresponds to the sector coordinate system.
// Besides the parametrization of a straight line (z,r,theta,phi)
// the object contains the Chi2 from the fitter (normalized to
// the number of dgree of freedom) and the covariance
// matrix for the errors.
// A parametrization of the straight line through the middle of
// the target can be retrieved from the variables (zprime,rprime,theta,phi).
//
// With Int_t ind getHitInd(Int_t i) one can obtain
// the index number of the two HMdcHits objects in the Hit category.
// If a Hit doesn't exist -1 is returned.
// Int_t getIOSeg(void) gives 0 for inner segment
// (MDCI+MDCII) and 1 for outer segment (MDCIII+MDCIV).
// This object derives from HMdcCellGroup12, so the information
// of the wires contributing to the Segment can be obtained.
//
//
/////////////////////////////////////////////////////////////////////////

#include "hmdcseg.h"

#include "TBuffer.h"

HMdcSeg::HMdcSeg(void) {
  Clear();
}

HMdcSeg::~HMdcSeg(void) {
}

void HMdcSeg::Clear(void) {
    // reset data members to default values
    z=0.;
    r=0.;
    theta=0.;
    phi=0.;
    chi2=0.;
    flag=0;
    ind  = 0;
    ind2 = 0;
    cov.Clear();
    zPrime=0.;
    rPrime=0;
    clusInd = -1;
    resetFakeFlag();
    x1 = 0x7FFF;  // = 32767
    y1 = 0x7FFF;
    x2 = 0x7FFF;
    y2 = 0x7FFF;
    clear();
}

void HMdcSeg::print(void) {
  printf("----------Sec.%i Seg.%i chi2=%g ----------------",getSec()+1,getIOSeg()+1,chi2);
  if(isFake()) printf(" FAKE!");
  printf("\nz'=%.1f r'=%.1f theta=%.1f phi=%.1f (x1=%.1f y1=%.1f x2=%.1f y2=%.1f)\n",
         zPrime,rPrime,theta*57.296,phi*57.296,getX1(),getY1(),getX2(),getY2());
  printf("Cluster info: Cl.index=%i nBins=%i nCells=%i nMergedClus=%i\n",
         clusInd,getNBinsClus(),getNCellsClus(),getNMergedClus());
  printCellGroup();
}

void HMdcSeg::Streamer(TBuffer &R__b)
{
   // Stream an object of class HMdcSeg.

   UInt_t R__s, R__c;
   if (R__b.IsReading()) {
      Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
      HMdcCellGroup12::Streamer(R__b);
      R__b >> z;
      R__b >> r;
      R__b >> theta;
      R__b >> phi;
      R__b >> chi2;
      R__b >> flag;
      cov.Streamer(R__b);
      R__b >> ind;
      if(R__v>2) {
        R__b >> ind2;
      } else {
        UInt_t ind0 = ind;
        ind  = 0;
        ind2 = 0;
        setSec(  (ind0 >> 29) & 0x7);
        setIOSeg((ind0 >> 28) & 0x1);
        Int_t i1  = ( ind0        & 0x3FFF);
        Int_t i2  = ((ind0 >> 14) & 0x3FFF);
        if(i1 > 0) setHitInd(0,i1-1);
        if(i2 > 0) setHitInd(1,i2-1);
      }
      R__b >> zPrime;
      R__b >> rPrime;
      R__b >> clusInd;
      if(R__v>1) {
         R__b >> x1;
         R__b >> y1;
         R__b >> x2;
         R__b >> y2;
      } else {
         x1 = 0x7FFF;  // = 32767
         y1 = 0x7FFF;
         x2 = 0x7FFF;
         y2 = 0x7FFF;
      }
      R__b.CheckByteCount(R__s, R__c, HMdcSeg::IsA());
   } else {
      R__c = R__b.WriteVersion(HMdcSeg::IsA(), kTRUE);
      HMdcCellGroup12::Streamer(R__b);
      R__b << z;
      R__b << r;
      R__b << theta;
      R__b << phi;
      R__b << chi2;
      R__b << flag;
      cov.Streamer(R__b);
      R__b << ind;
      R__b << ind2;
      R__b << zPrime;
      R__b << rPrime;
      R__b << clusInd;
      R__b << x1;
      R__b << y1;
      R__b << x2;
      R__b << y2;
      R__b.SetByteCount(R__c, kTRUE);
   }
}

ClassImp(HMdcSeg)












 hmdcseg.cc:1
 hmdcseg.cc:2
 hmdcseg.cc:3
 hmdcseg.cc:4
 hmdcseg.cc:5
 hmdcseg.cc:6
 hmdcseg.cc:7
 hmdcseg.cc:8
 hmdcseg.cc:9
 hmdcseg.cc:10
 hmdcseg.cc:11
 hmdcseg.cc:12
 hmdcseg.cc:13
 hmdcseg.cc:14
 hmdcseg.cc:15
 hmdcseg.cc:16
 hmdcseg.cc:17
 hmdcseg.cc:18
 hmdcseg.cc:19
 hmdcseg.cc:20
 hmdcseg.cc:21
 hmdcseg.cc:22
 hmdcseg.cc:23
 hmdcseg.cc:24
 hmdcseg.cc:25
 hmdcseg.cc:26
 hmdcseg.cc:27
 hmdcseg.cc:28
 hmdcseg.cc:29
 hmdcseg.cc:30
 hmdcseg.cc:31
 hmdcseg.cc:32
 hmdcseg.cc:33
 hmdcseg.cc:34
 hmdcseg.cc:35
 hmdcseg.cc:36
 hmdcseg.cc:37
 hmdcseg.cc:38
 hmdcseg.cc:39
 hmdcseg.cc:40
 hmdcseg.cc:41
 hmdcseg.cc:42
 hmdcseg.cc:43
 hmdcseg.cc:44
 hmdcseg.cc:45
 hmdcseg.cc:46
 hmdcseg.cc:47
 hmdcseg.cc:48
 hmdcseg.cc:49
 hmdcseg.cc:50
 hmdcseg.cc:51
 hmdcseg.cc:52
 hmdcseg.cc:53
 hmdcseg.cc:54
 hmdcseg.cc:55
 hmdcseg.cc:56
 hmdcseg.cc:57
 hmdcseg.cc:58
 hmdcseg.cc:59
 hmdcseg.cc:60
 hmdcseg.cc:61
 hmdcseg.cc:62
 hmdcseg.cc:63
 hmdcseg.cc:64
 hmdcseg.cc:65
 hmdcseg.cc:66
 hmdcseg.cc:67
 hmdcseg.cc:68
 hmdcseg.cc:69
 hmdcseg.cc:70
 hmdcseg.cc:71
 hmdcseg.cc:72
 hmdcseg.cc:73
 hmdcseg.cc:74
 hmdcseg.cc:75
 hmdcseg.cc:76
 hmdcseg.cc:77
 hmdcseg.cc:78
 hmdcseg.cc:79
 hmdcseg.cc:80
 hmdcseg.cc:81
 hmdcseg.cc:82
 hmdcseg.cc:83
 hmdcseg.cc:84
 hmdcseg.cc:85
 hmdcseg.cc:86
 hmdcseg.cc:87
 hmdcseg.cc:88
 hmdcseg.cc:89
 hmdcseg.cc:90
 hmdcseg.cc:91
 hmdcseg.cc:92
 hmdcseg.cc:93
 hmdcseg.cc:94
 hmdcseg.cc:95
 hmdcseg.cc:96
 hmdcseg.cc:97
 hmdcseg.cc:98
 hmdcseg.cc:99
 hmdcseg.cc:100
 hmdcseg.cc:101
 hmdcseg.cc:102
 hmdcseg.cc:103
 hmdcseg.cc:104
 hmdcseg.cc:105
 hmdcseg.cc:106
 hmdcseg.cc:107
 hmdcseg.cc:108
 hmdcseg.cc:109
 hmdcseg.cc:110
 hmdcseg.cc:111
 hmdcseg.cc:112
 hmdcseg.cc:113
 hmdcseg.cc:114
 hmdcseg.cc:115
 hmdcseg.cc:116
 hmdcseg.cc:117
 hmdcseg.cc:118
 hmdcseg.cc:119
 hmdcseg.cc:120
 hmdcseg.cc:121
 hmdcseg.cc:122
 hmdcseg.cc:123
 hmdcseg.cc:124
 hmdcseg.cc:125
 hmdcseg.cc:126
 hmdcseg.cc:127
 hmdcseg.cc:128
 hmdcseg.cc:129
 hmdcseg.cc:130
 hmdcseg.cc:131
 hmdcseg.cc:132
 hmdcseg.cc:133
 hmdcseg.cc:134
 hmdcseg.cc:135
 hmdcseg.cc:136
 hmdcseg.cc:137
 hmdcseg.cc:138
 hmdcseg.cc:139
 hmdcseg.cc:140
 hmdcseg.cc:141
 hmdcseg.cc:142
 hmdcseg.cc:143
 hmdcseg.cc:144
 hmdcseg.cc:145
 hmdcseg.cc:146
 hmdcseg.cc:147
 hmdcseg.cc:148
 hmdcseg.cc:149
 hmdcseg.cc:150
 hmdcseg.cc:151
 hmdcseg.cc:152
 hmdcseg.cc:153