/[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.36 by pam-fi, Thu May 24 16:45:48 2007 UTC revision 1.39 by pam-fi, Wed Aug 22 07:03:45 2007 UTC
# Line 365  Int_t TrkTrack::GetLeverArmY(){ Line 365  Int_t TrkTrack::GetLeverArmY(){
365      }      }
366      return (last_plane-first_plane+1);      return (last_plane-first_plane+1);
367  }  }
368    /**
369     * Returns the reduced chi-square of track x-projection
370     */
371    Float_t  TrkTrack::GetChi2X(){
372        float chiq=0;
373        for(int ip=0; ip<6; ip++)if(XGood(ip))chiq+= pow((xv[ip]-xm[ip])/resx[ip],2.);
374        if(GetNX()>3)chiq=chiq/(GetNX()-3);
375        else chiq=0;
376        if(chiq==0)cout << " Float_t  TrkTrack::GetChi2X() -- WARNING -- value not defined "<<chiq<<endl;
377        return chiq;
378    }
379    /**
380     * Returns the reduced chi-square of track y-projection
381     */
382    Float_t  TrkTrack::GetChi2Y(){
383        float chiq=0;
384        for(int ip=0; ip<6; ip++)if(YGood(ip))chiq+= pow((yv[ip]-ym[ip])/resy[ip],2.);
385        if(GetNY()>2)chiq=chiq/(GetNY()-2);
386        else chiq=0;
387        if(chiq==0)cout << " Float_t  TrkTrack::GetChi2Y() -- WARNING -- value not defined "<<chiq<<endl;
388        return chiq;
389    }
390    /**
391     * Returns the logarythm of the likeliwood-function of  track x-projection
392     */
393    Float_t TrkTrack::GetLnLX(){
394        float lnl=0;
395        for(int ip=0; ip<6; ip++)
396            if( XGood(ip) && tailx[ip]!=0 )
397                lnl += (tailx[ip]+1.) * log( (tailx[ip]*pow(resx[ip],2.) + pow(xv[ip]-xm[ip],2.)) / (tailx[ip]*pow(resx[ip],2)) );
398        if(GetNX()>3)lnl=lnl/(GetNX()-3);
399        else lnl=0;
400        if(lnl==0){
401            cout << " Float_t  TrkTrack::GetLnLX() -- WARNING -- value not defined "<<lnl<<endl;
402            Dump();
403        }
404        return lnl;
405        
406    }
407    /**
408     * Returns the logarythm of the likeliwood-function of  track y-projection
409     */
410    Float_t TrkTrack::GetLnLY(){
411        float lnl=0;
412        for(int ip=0; ip<6; ip++)
413            if( YGood(ip) && taily[ip]!=0 )
414                lnl += (taily[ip]+1.) * log( (taily[ip]*pow(resy[ip],2.) + pow(yv[ip]-ym[ip],2.)) / (taily[ip]*pow(resy[ip],2)) );
415        if(GetNY()>2)lnl=lnl/(GetNY()-2);
416        else lnl=0;
417        if(lnl==0){
418            cout << " Float_t  TrkTrack::GetLnLY() -- WARNING -- value not defined "<<lnl<<endl;
419            Dump();
420        }
421        return lnl;
422        
423    }
424    /**
425     * Returns the effective angle, relative to the sensor, on each plane.
426     * @param ip plane (0-5)
427     * @param iv view (0=x 1=y)
428     */
429    Float_t TrkTrack::GetEffectiveAngle(int ip, int iv){
430    
431        if(ip<0 || ip>5){
432            cout << "Float_t TrkTrack::GetEffectiveAngle(int "<<ip<<", int "<<iv<<") ==> wrong input"<<endl;
433            return 0.;
434        }
435    
436        float v[3]={xv[ip],yv[ip],zv[ip]};
437        //-----------------------------------------
438        // effective angle (relative to the sensor)
439        //-----------------------------------------
440        float axv_geo  = axv[ip];
441        float muhall_h = 297.61; //cm**2/Vs
442        float BY = TrkParams::GetBY(v);
443        float axv_eff = 0;
444        if(ip==5) axv_geo = -1*axv_geo;
445        if(ip==5) BY      = -1*BY;
446        axv_eff = 180.*atan( tan(axv_geo*acos(-1.)/180.) + muhall_h * BY * 0.0001)/acos(-1.);
447        //-----------------------------------------
448        // effective angle (relative to the sensor)
449        //-----------------------------------------
450        float ayv_geo = ayv[ip];
451        float muhall_e = 1258.18; //cm**2/Vs
452        float BX = TrkParams::GetBX(v);
453        float ayv_eff = 0;
454        ayv_eff = 180.*atan( tan(ayv_geo*acos(-1.)/180.) + muhall_e * BX * 0.0001)/acos(-1.);
455      
456        if     (iv==0)return axv_eff;
457        else if(iv==1)return ayv_eff;
458        else{
459            cout << "Float_t TrkTrack::GetEffectiveAngle(int "<<ip<<", int "<<iv<<") ==> wrong input"<<endl;
460            return 0.;
461        }
462      
463    };
464    
465  //--------------------------------------  //--------------------------------------
466  //  //
467  //  //

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.39

  ViewVC Help
Powered by ViewVC 1.1.23