/[PAMELA software]/DarthVader/TrackerLevel2/src/TrkLevel2.cpp
ViewVC logotype

Diff of /DarthVader/TrackerLevel2/src/TrkLevel2.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.37 by pam-fi, Wed Jun 6 09:36:07 2007 UTC revision 1.40 by pam-fi, Fri Aug 31 14:56:51 2007 UTC
# Line 52  TrkTrack::TrkTrack(){ Line 52  TrkTrack::TrkTrack(){
52          ayv[ip]    = 0;          ayv[ip]    = 0;
53          dedx_x[ip] = 0;          dedx_x[ip] = 0;
54          dedx_y[ip] = 0;          dedx_y[ip] = 0;
55            multmaxx[ip] = 0;
56            multmaxy[ip] = 0;
57            seedx[ip]  = 0;  
58            seedy[ip]  = 0;
59            xpu[ip]    = 0;  
60            ypu[ip]    = 0;  
61    
62      };      };
 //    clx = 0;  
 //    cly = 0;  
 //    clx = new TRefArray(6,0); //forse causa memory leak???  
 //    cly = new TRefArray(6,0); //forse causa memory leak???  
 //    clx = TRefArray(6,0);  
 //    cly = TRefArray(6,0);  
63    
64      TrkParams::SetTrackingMode();      TrkParams::SetTrackingMode();
65      TrkParams::SetPrecisionFactor();      TrkParams::SetPrecisionFactor();
# Line 96  TrkTrack::TrkTrack(const TrkTrack& t){ Line 97  TrkTrack::TrkTrack(const TrkTrack& t){
97          ayv[ip]    = t.ayv[ip];          ayv[ip]    = t.ayv[ip];
98          dedx_x[ip] = t.dedx_x[ip];          dedx_x[ip] = t.dedx_x[ip];
99          dedx_y[ip] = t.dedx_y[ip];          dedx_y[ip] = t.dedx_y[ip];
100            multmaxx[ip] = t.multmaxx[ip];
101            multmaxy[ip] = t.multmaxy[ip];
102            seedx[ip]    = t.seedx[ip];  
103            seedy[ip]    = t.seedy[ip];
104            xpu[ip]      = t.xpu[ip];  
105            ypu[ip]      = t.ypu[ip];  
106      };      };
 //    clx = 0;  
 //    cly = 0;  
 //    if(t.clx)clx = new TRefArray(*(t.clx));  
 //    if(t.cly)cly = new TRefArray(*(t.cly));  
 //    clx = TRefArray(t.clx);  
 //    cly = TRefArray(t.cly);  
107    
108      TrkParams::SetTrackingMode();      TrkParams::SetTrackingMode();
109      TrkParams::SetPrecisionFactor();      TrkParams::SetPrecisionFactor();
# Line 141  void TrkTrack::Copy(TrkTrack& t){ Line 142  void TrkTrack::Copy(TrkTrack& t){
142          t.ayv[ip]    = ayv[ip];          t.ayv[ip]    = ayv[ip];
143          t.dedx_x[ip] = dedx_x[ip];          t.dedx_x[ip] = dedx_x[ip];
144          t.dedx_y[ip] = dedx_y[ip];          t.dedx_y[ip] = dedx_y[ip];
145            t.multmaxx[ip] = multmaxx[ip];
146            t.multmaxy[ip] = multmaxy[ip];
147            t.seedx[ip]    = seedx[ip];  
148            t.seedy[ip]    = seedy[ip];
149            t.xpu[ip]      = xpu[ip];  
150            t.ypu[ip]      = ypu[ip];  
151                            
152      };      };
153    
 //    t.clx = TRefArray(clx);  
 //    t.cly = TRefArray(cly);  
154            
155  };  };
156  //--------------------------------------  //--------------------------------------
# Line 397  Float_t TrkTrack::GetLnLX(){ Line 402  Float_t TrkTrack::GetLnLX(){
402              lnl += (tailx[ip]+1.) * log( (tailx[ip]*pow(resx[ip],2.) + pow(xv[ip]-xm[ip],2.)) / (tailx[ip]*pow(resx[ip],2)) );              lnl += (tailx[ip]+1.) * log( (tailx[ip]*pow(resx[ip],2.) + pow(xv[ip]-xm[ip],2.)) / (tailx[ip]*pow(resx[ip],2)) );
403      if(GetNX()>3)lnl=lnl/(GetNX()-3);      if(GetNX()>3)lnl=lnl/(GetNX()-3);
404      else lnl=0;      else lnl=0;
405      if(lnl==0)cout << " Float_t  TrkTrack::GetLnLX() -- WARNING -- value not defined "<<lnl<<endl;      if(lnl==0){
406            cout << " Float_t  TrkTrack::GetLnLX() -- WARNING -- value not defined "<<lnl<<endl;
407            Dump();
408        }
409      return lnl;      return lnl;
410            
411  }  }
# Line 411  Float_t TrkTrack::GetLnLY(){ Line 419  Float_t TrkTrack::GetLnLY(){
419              lnl += (taily[ip]+1.) * log( (taily[ip]*pow(resy[ip],2.) + pow(yv[ip]-ym[ip],2.)) / (taily[ip]*pow(resy[ip],2)) );              lnl += (taily[ip]+1.) * log( (taily[ip]*pow(resy[ip],2.) + pow(yv[ip]-ym[ip],2.)) / (taily[ip]*pow(resy[ip],2)) );
420      if(GetNY()>2)lnl=lnl/(GetNY()-2);      if(GetNY()>2)lnl=lnl/(GetNY()-2);
421      else lnl=0;      else lnl=0;
422      if(lnl==0)cout << " Float_t  TrkTrack::GetLnLY() -- WARNING -- value not defined "<<lnl<<endl;      if(lnl==0){
423            cout << " Float_t  TrkTrack::GetLnLY() -- WARNING -- value not defined "<<lnl<<endl;
424            Dump();
425        }
426      return lnl;      return lnl;
427            
428  }  }
429    /**
430     * Returns the effective angle, relative to the sensor, on each plane.
431     * @param ip plane (0-5)
432     * @param iv view (0=x 1=y)
433     */
434    Float_t TrkTrack::GetEffectiveAngle(int ip, int iv){
435    
436        if(ip<0 || ip>5){
437            cout << "Float_t TrkTrack::GetEffectiveAngle(int "<<ip<<", int "<<iv<<") ==> wrong input"<<endl;
438            return 0.;
439        }
440    
441        float v[3]={xv[ip],yv[ip],zv[ip]};
442        //-----------------------------------------
443        // effective angle (relative to the sensor)
444        //-----------------------------------------
445        float axv_geo  = axv[ip];
446        float muhall_h = 297.61; //cm**2/Vs
447        float BY = TrkParams::GetBY(v);
448        float axv_eff = 0;
449        if(ip==5) axv_geo = -1*axv_geo;
450        if(ip==5) BY      = -1*BY;
451        axv_eff = 180.*atan( tan(axv_geo*acos(-1.)/180.) + muhall_h * BY * 0.0001)/acos(-1.);
452        //-----------------------------------------
453        // effective angle (relative to the sensor)
454        //-----------------------------------------
455        float ayv_geo = ayv[ip];
456        float muhall_e = 1258.18; //cm**2/Vs
457        float BX = TrkParams::GetBX(v);
458        float ayv_eff = 0;
459        ayv_eff = 180.*atan( tan(ayv_geo*acos(-1.)/180.) + muhall_e * BX * 0.0001)/acos(-1.);
460      
461        if     (iv==0)return axv_eff;
462        else if(iv==1)return ayv_eff;
463        else{
464            cout << "Float_t TrkTrack::GetEffectiveAngle(int "<<ip<<", int "<<iv<<") ==> wrong input"<<endl;
465            return 0.;
466        }
467      
468    };
469    
470  //--------------------------------------  //--------------------------------------
471  //  //
472  //  //
# Line 445  void TrkTrack::Dump(){ Line 497  void TrkTrack::Dump(){
497      cout << endl << "           "; for(int i=0; i<5; i++)cout << coval[4][i]<<" ";      cout << endl << "           "; for(int i=0; i<5; i++)cout << coval[4][i]<<" ";
498      cout << endl << "dedx_x   : "; for(int i=0; i<6; i++)cout << dedx_x[i] << " ";      cout << endl << "dedx_x   : "; for(int i=0; i<6; i++)cout << dedx_x[i] << " ";
499      cout << endl << "dedx_y   : "; for(int i=0; i<6; i++)cout << dedx_y[i] << " ";      cout << endl << "dedx_y   : "; for(int i=0; i<6; i++)cout << dedx_y[i] << " ";
500        cout << endl << "maxs x   : "; for(int i=0; i<6; i++)cout << GetClusterX_MaxStrip(i) << " ";
501        cout << endl << "maxs y   : "; for(int i=0; i<6; i++)cout << GetClusterY_MaxStrip(i) << " ";
502        cout << endl << "mult x   : "; for(int i=0; i<6; i++)cout << GetClusterX_Multiplicity(i) << " ";
503        cout << endl << "mult y   : "; for(int i=0; i<6; i++)cout << GetClusterY_Multiplicity(i) << " ";
504        cout << endl << "seed x   : "; for(int i=0; i<6; i++)cout << GetClusterX_Seed(i) << " ";
505        cout << endl << "seed y   : "; for(int i=0; i<6; i++)cout << GetClusterY_Seed(i) << " ";
506        cout << endl << "xpu      : "; for(int i=0; i<6; i++)cout << xpu[i] << " ";
507        cout << endl << "ypu      : "; for(int i=0; i<6; i++)cout << ypu[i] << " ";
508    
509      cout << endl;      cout << endl;
510  }  }
511  /**  /**
# Line 848  Int_t TrkTrack::GetClusterX_ID(int ip){ Line 909  Int_t TrkTrack::GetClusterX_ID(int ip){
909  Int_t TrkTrack::GetClusterY_ID(int ip){  Int_t TrkTrack::GetClusterY_ID(int ip){
910      return ((Int_t)fabs(ygood[ip]))%10000000-1;      return ((Int_t)fabs(ygood[ip]))%10000000-1;
911  };  };
912    
913  /**  /**
914   * Method to retrieve the ladder (0-4, increasing x) traversed by the track on this plane.   * Method to retrieve the ladder (0-4, increasing x) traversed by the track on this plane.
915   * If no ladder is traversed (dead area) the metod retuns -1.   * If no ladder is traversed (dead area) the metod retuns -1.
# Line 1031  void TrkLevel2::Dump(){ Line 1093  void TrkLevel2::Dump(){
1093                    
1094          //          //
1095      cout << endl << endl << "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-";      cout << endl << endl << "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-";
1096      cout << endl << "good     : "; for(int i=0; i<12; i++) cout << good[i]<<" ";      cout << endl << "good     : "; for(int i=0; i<12; i++) cout << hex <<" 0x"<< good[i]<<dec;
1097      cout << endl << "ntrk()   : " << this->ntrk() ;      cout << endl << "ntrk()   : " << ntrk() ;
1098      cout << endl << "nclsx()  : " << this->nclsx();      cout << endl << "nclsx()  : " << nclsx();
1099      cout << endl << "nclsy()  : " << this->nclsy();      cout << endl << "nclsy()  : " << nclsy();
1100      if(Track){      if(Track){
1101          TClonesArray &t  = *Track;          TClonesArray &t  = *Track;
1102          for(int i=0; i<ntrk(); i++)     ((TrkTrack *)t[i])->Dump();          for(int i=0; i<ntrk(); i++)     ((TrkTrack *)t[i])->Dump();
1103      }            }      
1104      if(SingletX){  //     if(SingletX){
1105          TClonesArray &sx = *SingletX;  //      TClonesArray &sx = *SingletX;
1106          for(int i=0; i<nclsx(); i++) ((TrkSinglet *)sx[i])->Dump();  //      for(int i=0; i<nclsx(); i++) ((TrkSinglet *)sx[i])->Dump();
1107      }  //     }
1108      if(SingletY){  //     if(SingletY){
1109          TClonesArray &sy = *SingletY;  //      TClonesArray &sy = *SingletY;
1110          for(int i=0; i<nclsy(); i++) ((TrkSinglet *)sy[i])->Dump();  //      for(int i=0; i<nclsy(); i++) ((TrkSinglet *)sy[i])->Dump();
1111      }  //     }
1112        cout << endl;
1113  }  }
1114  /**  /**
1115   * \brief Dump processing status   * \brief Dump processing status
# Line 1190  void TrkLevel2::SetFromLevel2Struct(cTrk Line 1253  void TrkLevel2::SetFromLevel2Struct(cTrk
1253              t_track->ayv[ip]    = l2->ayv_nt[i][ip];              t_track->ayv[ip]    = l2->ayv_nt[i][ip];
1254              t_track->dedx_x[ip] = l2->dedx_x[i][ip];              t_track->dedx_x[ip] = l2->dedx_x[i][ip];
1255              t_track->dedx_y[ip] = l2->dedx_y[i][ip];              t_track->dedx_y[ip] = l2->dedx_y[i][ip];
1256                t_track->multmaxx[ip] = l2->multmaxx[i][ip];
1257                t_track->multmaxy[ip] = l2->multmaxy[i][ip];
1258                t_track->seedx[ip]  = l2->seedx[i][ip];  
1259                t_track->seedy[ip]  = l2->seedy[i][ip];
1260                t_track->xpu[ip]    = l2->xpu[i][ip];  
1261                t_track->ypu[ip]    = l2->ypu[i][ip];  
1262              //-----------------------------------------------------              //-----------------------------------------------------
1263              //-----------------------------------------------------              //-----------------------------------------------------
1264              //-----------------------------------------------------              //-----------------------------------------------------

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.23