Tracker Examples

In this page you will find some instructions to get the measured rigidty, to load the alignment of outer layers on existing root data and compute residuals.

v5 (aka PGTRACK)

Details and current status of the alignment parameters can be found at TDVCalibrationNews.

Details of use of tracker external planes alignment are at TrExtAlignDB

Details of track refit method are at TrTrackR::iTrTrackPar

Getting the rigidity

{
   // event loop
   for (int entry = 0; entry < nentry; entry++) { 
   
      AMSEventR *ev = amschain->GetEvent(entry);

      //
      // Here you put some event selection
      // 

      ParticleR *part = ev->pParticle(0);
      TrTrackR *track = part->pTrTrack();
      //Fitting with INNER pattern and the Choutko Algorithm
      int id = track.iTrTrackPar(1 ,  3,   1);
      if(id<0) continue;

      //----------------------------------------------------------------------------
      //----------------------------------------------------------------------------


      ParticleR *part = ev->pParticle(0);
      TrTrackR *track = part->pTrTrack();
      //Fitting with INNER pattern and the Alcaraz Algorithm
      int id = track.iTrTrackPar(1 ,  3,   2);
      if(id<0) continue;

      //----------------------------------------------------------------------------
      //----------------------------------------------------------------------------

      ParticleR *part = ev->pParticle(0);
      TrTrackR *track = part->pTrTrack();
      //Fitting with INNER pattern and the Chikanian Algorithm
      int id = track.iTrTrackPar(1 ,  3,   3);
      if(id<0) continue;

      //----------------------------------------------------------------------------
      //----------------------------------------------------------------------------

      //Fitting with Maximum span pattern, the Choutko Algorithm
      //and the Perugia alignment stored in the root file
      int id = track.iTrTrackPar(1 ,  0,   1);
      if(id<0) continue;

      //----------------------------------------------------------------------------
      //----------------------------------------------------------------------------

      //Fitting with Maximum span pattern, the Choutko Algorithm
      //and the Madrid alignment stored in the root file
      int id = track.iTrTrackPar(1 ,  0,   11);
      if(id<0) continue;

      //----------------------------------------------------------------------------
      //----------------------------------------------------------------------------

      // Retrieve the rigidity 
      RigidityArray=track->GetPar(id).Rigidity;
      RigidityErr=track->GetPar(id).ErrRinv;
      // Retrieve the Chisq and the Number of degrees of freedom in Y/X
      LogChisqYArray=log10(track->GetPar(id).ChisqY);
      NdofYArray=track.GetPar(id)->NdofY;
      LogChisqXArray=log10(track->GetPar(id).ChisqX);
      NdofXArray=track.GetPar(id)->NdofX;





}

Load External Alignment

#include "TrExtAlignDB.h"

{

for (int entry = 0; entry < nentry; entry++) { // event loop
   AMSEventR *event = amschain->GetEvent(entry);

    //
    // Here you put some event selection
    // 
 
   // To Load outer layer alignment :
   //   PG Alignment
   TrExtAlignDB::RecalcAllExtHitCoo(0);    
   //   CIEMAT Alignment
   TrExtAlignDB::RecalcAllExtHitCoo(1);
   //   No Alignment  
   TrExtAlignDB::RecalcAllExtHitCoo(2);
    

}

Compute Residuals

#include "TrExtAlignDB.h"
{

   for (int entry = 0; entry < nentry; entry++) { // event loop
      AMSEventR *ev = amschain->GetEvent(entry);

      //
      // Here you put some event selection
      // 

      ParticleR *part = ev->pParticle(0);
      TrTrackR *track = part->pTrTrack();
      // Loop On Alignments
      for(int i_ext_alig =0; i_ext_alig<2; i_ext_alig++){

           int id = track->iTrTrackPar(algo,pattern,3+i_ext_alig*10);
           if (id<0) return;
           // Load of current Alignment 
           TrExtAlignDB::RecalcAllExtHitCoo(i_ext_alig);
           double Residual[10][2];
           for(int i_layer=1; i_layer<10; i_layer++){
               if( ! track->TestHitLayerJ(i_layer)) continue;    //check if the track has a hit on the layer i_layer   
               AMSPoint Residual_point=track->GetResidualJ(i_layer,id);
               if(   track->TestHitLayerJHasXY(i_layer) )
                   Residual[i_layer][0]=Residual_point.x();    // x residual computed only in case of XY hit
               else Residual[i_layer][0]=-99999999.;
               Residual[i_layer][1]=Residual_point.y();    // y residual 
           }
       }
   }

}

-- DomenicoDurso - 04-Jul-2012

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r7 - 2012-07-18 - DomenicoDurso
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback