ROOT logo
#ifndef HMDCTRKCAND_H
#define HMDCTRKCAND_H

#include "TObject.h"

class HMdcTrkCand : public TObject {
protected:
  Char_t  sector;               // sector number
  Char_t  flag;                 // user flag
  Short_t nCandForSeg1;         // number of HMdcTrkCand objects 
                                // for this inner segmen
                                // =0 - no outer segment
                                // >0 this container is first
                                // =-1 one of the next containers
  Int_t   nextCandInd;          // index of next HMdcTrkCand object
                                // =-1 - this object is latest
  Int_t   firstCandInd;         // index of the first HMdcTrkCand object with
                                // the same inner segment
  Int_t   seg1Ind;              // index of HMdcSeg container (inner segment)
  Int_t   seg2Ind;              // index of HMdcSeg container (outer segment)
  Int_t   metaMatchInd;         // first HMetaMatch obj.index created for this

  Float_t dedxInner;            // mean value of t2-t1 for inner segment
  Float_t dedxSigmaInner;       // sigma of t2-t1 distribution in inner segment
  UChar_t dedxNWireInner;       // number of wires in inner segment before truncated mean procedure
  UChar_t dedxNWireCutInner;    // number of wires in inner segment cutted by truncated mean procedure
  Float_t dedxOuter;            // mean value of t2-t1 for outer segment
  Float_t dedxSigmaOuter;       // sigma of t2-t1 distribution in outer segment
  UChar_t dedxNWireOuter;       // number of wires in outer segment before truncated mean procedure
  UChar_t dedxNWireCutOuter;    // number of wires in outer segment cutted by truncated mean procedure
  Float_t dedxCombined;         // mean value of t2-t1 for inner+outer segment
  Float_t dedxSigmaCombined;    // sigma of t2-t1 distribution in inner+outer segment
  UChar_t dedxNWireCombined;    // number of wires in inner+outer segment before truncated mean procedure
  UChar_t dedxNWireCutCombined; // number of wires in inner+outer segment cutted by truncated mean procedure

  Float_t dedx[4];              // mean value of t2-t1 per module
  Float_t dedxSigma[4];         // sigma of t2-t1 distribution per module
  UChar_t dedxNWire[4];         // number of wires per module before truncated mean procedure
  UChar_t dedxNWireCut[4];      // number of wires per module cutted by truncated mean procedure

  enum {kIsSeg1Fake = BIT(14),  // bit in TObject::fBits for "fake" inner segment flag 
        kIsSeg2Fake = BIT(15)}; // bit in TObject::fBits for "fake" outer segment flag 
private: 
  HMdcTrkCand* pFirstCand;   //! first HMdcTrkCand object with
                             //! the same inner segment

public:
  HMdcTrkCand(void) {clear();}
  HMdcTrkCand(Char_t sec, Int_t s1ind, Int_t ind);
  HMdcTrkCand(HMdcTrkCand* fTrkCand, Int_t s2ind, Int_t ind);
  ~HMdcTrkCand(void) {}
  void clear(void);
  
  void setSec(Char_t s)                 {sector=s;}
  void setSeg1Ind(Int_t ind)            {seg1Ind=ind;}
  void setSeg2Ind(Int_t ind)            {seg2Ind=ind;}
  void setNCandForSeg1(Short_t n)       {nCandForSeg1=n;}
  void setFirstCandInd(Int_t i)         {firstCandInd=i;}
  void setNextCandInd(Int_t n)          {nextCandInd=n;}
  void setMetaMatchInd(Int_t ind)       {metaMatchInd=ind;}
  void addSeg2Ind(Int_t ind)            {seg2Ind=ind; nCandForSeg1=1;}
  void setFlag(Char_t fl)               {flag=fl;}
  
  void setFakeFlagSeg1(void)            { SetBit(kIsSeg1Fake); }
  void setFakeFlagSeg2(void)            { SetBit(kIsSeg2Fake); }
  void resetFakeFlagSeg1(void)          { ResetBit(kIsSeg1Fake); }
  void resetFakeFlagSeg2(void)          { ResetBit(kIsSeg2Fake); }
  Bool_t isSeg1Fake(void) const         { return TestBit(kIsSeg1Fake); }
  Bool_t isSeg2Fake(void) const         { return TestBit(kIsSeg2Fake); }
  Bool_t isFake(void) const             { return TestBit(kIsSeg1Fake) || TestBit(kIsSeg2Fake); }
  

  void setdedx(Int_t mod,Float_t dEdx)      {dedx        [mod]=dEdx;}
  void setSigmadedx(Int_t mod,Float_t Sig)  {dedxSigma   [mod]=Sig;}
  void setNWirededx(Int_t mod,UChar_t nW)   {dedxNWire   [mod]=nW;}
  void setNWireCutdedx(Int_t mod,UChar_t nW){dedxNWireCut[mod]=nW;}


  void setdedxInnerSeg(Float_t dedx)    {dedxInner=dedx;}
  void setdedxOuterSeg(Float_t dedx)    {dedxOuter=dedx;}
  void setdedxCombinedSeg(Float_t dedx) {dedxCombined=dedx;}
  void setdedxSeg(Int_t seg,Float_t dedx)
  {
      if(seg==0)     {dedxInner=dedx;}
      else if(seg==1){dedxOuter=dedx;}
      else if(seg==2){dedxCombined=dedx;}
  }
  void setSigmadedxInnerSeg(Float_t sig)    {dedxSigmaInner=sig;}
  void setSigmadedxOuterSeg(Float_t sig)    {dedxSigmaOuter=sig;}
  void setSigmadedxCombinedSeg(Float_t sig) {dedxSigmaCombined=sig;}
  void setSigmadedxSeg(Int_t seg,Float_t sig)
  {
      if(seg==0)     {dedxSigmaInner=sig;}
      else if(seg==1){dedxSigmaOuter=sig;}
      else if(seg==2){dedxSigmaCombined=sig;}
  }
  void setNWirededxInnerSeg(UChar_t nw){dedxNWireInner=nw;}
  void setNWirededxOuterSeg(UChar_t nw){dedxNWireOuter=nw;}
  void setNWirededxCombinedSeg(UChar_t nw){dedxNWireCombined=nw;}
  void setNWirededxSeg(Int_t seg,UChar_t nw)
  {
      if(seg==0)     {dedxNWireInner=nw;}
      else if(seg==1){dedxNWireOuter=nw;}
      else if(seg==2){dedxNWireCombined=nw;}
  }
  void setNWireCutdedxInnerSeg(UChar_t nw){dedxNWireCutInner=nw;}
  void setNWireCutdedxOuterSeg(UChar_t nw){dedxNWireCutOuter=nw;}
  void setNWireCutdedxCombinedSeg(UChar_t nw){dedxNWireCutCombined=nw;}
  void setNWireCutdedxSeg(Int_t seg,UChar_t nw)
  {
      if(seg==0)     {dedxNWireCutInner=nw;}
      else if(seg==1){dedxNWireCutOuter=nw;}
      else if(seg==2){dedxNWireCutCombined=nw;}
  }


  Char_t  getSec(void) const     {return sector;}
  Int_t   getSeg1Ind(void) const {return seg1Ind;}
  Int_t   getSeg2Ind(void) const {return seg2Ind;}
  Int_t   getSegInd(const Int_t seg) const {
    return (seg==0) ? seg1Ind : ((seg==1) ? seg2Ind:-1); }
  Short_t getNCandForSeg1(void) const    {return nCandForSeg1;}
  Int_t   getNextCandInd(void) const     {return nextCandInd;}
  Int_t   getFirstCandInd(void) const    {return firstCandInd;}
  Int_t   getMetaMatchInd(void) const    {return metaMatchInd;}
  Char_t  getFlag(void) const            {return flag;}

  Float_t getdedx(Int_t mod)        {return dedx        [mod];}
  Float_t getSigmadedx(Int_t mod)   {return dedxSigma   [mod];}
  UChar_t getNWirededx(Int_t mod)   {return dedxNWire   [mod];}
  UChar_t getNWireCutdedx(Int_t mod){return dedxNWireCut[mod];}

  Float_t getdedxInnerSeg(void) const    {return dedxInner;}
  Float_t getdedxOuterSeg(void) const    {return dedxOuter;}
  Float_t getdedxCombinedSeg(void) const {return dedxCombined;}
  Float_t getdedxSeg(Int_t seg)
  {
      if(seg==0)     {return dedxInner;}
      else if(seg==1){return dedxOuter;}
      else if(seg==2){return dedxCombined;}
      else {return -1;}
  }
  Float_t getSigmadedxInnerSeg(){return dedxSigmaInner;}
  Float_t getSigmadedxOuterSeg(){return dedxSigmaOuter;}
  Float_t getSigmadedxCombinedSeg(){return dedxSigmaCombined;}
  Float_t getSigmadedxSeg(Int_t seg)
  {
      if(seg==0)     {return dedxSigmaInner;}
      else if(seg==1){return dedxSigmaOuter;}
      else if(seg==2){return dedxSigmaCombined;}
      else {return -1;}
  }
  UChar_t getNWirededxInnerSeg()    {return dedxNWireInner;}
  UChar_t getNWirededxOuterSeg()    {return dedxNWireOuter;}
  UChar_t getNWirededxCombinedSeg() {return dedxNWireCombined;}
  UChar_t getNWirededxSeg(Int_t seg)
  {
      if(seg==0)     {return dedxNWireInner;}
      else if(seg==1){return dedxNWireOuter;}
      else if(seg==2){return dedxNWireCombined;}
      else {return 0;}
  }
  UChar_t getNWireCutdedxInnerSeg(){return dedxNWireCutInner;}
  UChar_t getNWireCutdedxOuterSeg(){return dedxNWireCutOuter;}
  UChar_t getNWireCutdedxCombinedSeg(){return dedxNWireCutCombined;}
  UChar_t getNWireCutdedxSeg(Int_t seg)
  {
      if(seg==0)     {return dedxNWireCutInner;}
      else if(seg==1){return dedxNWireCutOuter;}
      else if(seg==2){return dedxNWireCutCombined;}
      else {return 0;}
  }
  virtual void print(void) const;
  
  ClassDef(HMdcTrkCand,1) // MDC track candidate
};

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