NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcHelix Class Reference

Representation and extrapolation of NcTracks in a magnetic field. More...

#include "NcHelix.h"

Inheritance diagram for NcHelix:

Detailed Description

Representation and extrapolation of NcTracks in a magnetic field.


Copyright(c) 2004 NCFS/IIHE, All Rights Reserved. *
*
Authors: The Netherlands Center for Fundamental Studies (NCFS). *
The Inter-university Institute for High Energies (IIHE). *
Website : http://www.iihe.ac.be *
Contact : Nick van Eijndhoven (nickve.nl@gmail.com) *
*
Contributors are mentioned in the code where appropriate. *
*
No part of this software may be used, copied, modified or distributed *
by any means nor transmitted or translated into machine language for *
commercial purposes without written permission by the IIHE representative. *
Permission to use the software strictly for non-commercial purposes *
is hereby granted without fee, provided that the above copyright notice *
appears in all copies and that both the copyright notice and this *
permission notice appear in the supporting documentation. *
This software is provided "as is" without express or implied warranty. *
The authors make no claims that this software is free of error, or is *
consistent with any particular standard of merchantability, or that it *
will meet your requirements for any particular application, other than *
indicated in the corresponding documentation. *
This software should not be relied on for solving a problem whose *
incorrect solution could result in injury to a person or loss of property. *
If you do use this software in such a manner, it is at your own risk. *
The authors disclaim all liability for direct or consequential damage *
resulting from your use of this software. *

// Class NcHelix
// Representation and extrapolation of NcTracks in a magnetic field.
//
// This class is meant to provide a means to display and extrapolate
// NcTrack objects in the presence of a constant homogeneous magnetic field.
//
// For track/event displays the line width, colour etc... can be set using the
// standard facilities (see TAttLine).
// By default the linewith is set to 2 and the colour set to -1 in the constructor.
// The latter results in an automatic colour coding according to the track charge
// with the convention positive=red neutral=green negative=blue.
//
// To indicate the track starting point, the memberfunction SetMarker()
// may be used.
// By default no marker will be displayed.
//
// Examples :
// ==========
//
// Display and extrapolation of individual tracks
// ----------------------------------------------
// Float_t vec[3];
// NcPosition r1;
// Nc3Vector p;
// NcTrack t;
//
// vec[0]=0;
// vec[1]=0;
// vec[2]=0;
// r1.SetVector(vec,"car");
//
// vec[0]=1;
// vec[1]=0;
// vec[2]=0.3;
// p.SetVector(vec,"car");
//
// t.Set3Momentum(p);
// t.SetBeginPoint(r1);
// t.SetCharge(-1);
// t.SetMass(0.139);
//
// // The magnetic field vector in Tesla
// Nc3Vector b;
// vec[0]=0;
// vec[1]=0;
// vec[2]=1;
// b.SetVector(vec,"car");
//
// NcHelix* helix=new NcHelix();
// helix->SetB(b);
// helix->SetTofmax(1e-7);
//
// TCanvas* c1=new TCanvas("c1","c1");
// TView* view=new TView(1);
// view->SetRange(-1000,-1000,-1000,1000,1000,1000);
// view->ShowAxis();
//
// // Track displays
// Double_t range[2]={0,600};
// helix->Display(&t,range,3);
// t.SetCharge(-t.GetCharge());
// helix->Display(&t);
//
// // Track extrapolation
// Double_t pars[3]={550,0.001,3};
// NcPosition* rext=helix->Extrapolate(&t,pars);
// if (rext) rext->Data();
// ======================================================================
//
// Online display of events generated via NcCollider
// --------------------------------------------------
// Int_t nevents=5; // Number of events to be generated
// Int_t jrun=1; // The run number of this batch of generated events
//
// cout << " ***" << endl;
// cout << " *** NcCollider run for " << nevents << " events." << endl;
// cout << " ***" << endl;
//
// NcCollider* gen=new NcCollider();
//
// gen->OpenFortranFile(6,"dump.log");
//
// gen->SetVertexMode(2);
// gen->SetResolution(1e-4);
//
// gen->SetRunNumber(jrun);
// gen->SetPrintFreq(1);
//
// gen->SetSpectatorPmin(0.01);
//
// Int_t zp=1;
// Int_t ap=1;
// Int_t zt=2;
// Int_t at=4;
//
// gen->Init("fixt",zp,ap,zt,at,158);
//
// NcHelix* helix=new NcHelix();
// Float_t vec[3]={0,2,0};
// Nc3Vector b;
// b.SetVector(vec,"car");
// helix->SetB(b);
//
// helix->Refresh(-1); // Refresh display after each event
//
// TCanvas* c1=new TCanvas("c1","c1");
// TView* view=new TView(1);
// view->SetRange(-200,-200,-200,200,200,200);
// view->ShowAxis();
//
// // Prepare random number sequence for this run
// // to obtain the number of participants for each event
// NcRandom rndm(abs(jrun));
// Float_t* rans=new Float_t[nevents];
// rndm.Uniform(rans,nevents,2,ap+at);
// Int_t npart=0;
// Int_t ntk=0;
// for (Int_t i=0; i<nevents; i++)
// {
// npart=rans[i];
// gen->MakeEvent(npart);
// NcEvent* evt=gen->GetEvent();
// if (evt)
// {
// helix->Display(evt);
// c1->Update();
// gSystem->Sleep(5000); // Some delay to keep the display on screen
// }
// }
// ======================================================================
//
//--- Author: Nick van Eijndhoven 17-jun-2004 Utrecht University
//- Modified: NvE $Date: 2010-03-19 11:10:02 +0100 (Fri, 19 Mar 2010) $ NCFS

Definition at line 16 of file NcHelix.h.

Public Member Functions

 NcHelix ()
 
 NcHelix (const NcHelix &h)
 
virtual ~NcHelix ()
 
void Display (NcEvent *e, Double_t *range=0, Int_t iaxis=3, Double_t scale=-1)
 
void Display (NcTrack *t, Double_t *range=0, Int_t iaxis=3, Double_t scale=-1)
 
void Display (TObjArray *a, Double_t *range=0, Int_t iaxis=3, Double_t scale=-1)
 
NcPositionExtrapolate (NcTrack *t, Double_t *pars=0, Double_t scale=-1)
 
Nc3VectorGetB ()
 
Float_t GetTofmax () const
 
void MakeCurve (NcTrack *t, Double_t *range=0, Int_t iaxis=3, Double_t scale=-1)
 
void Refresh (Int_t mode=0)
 
void SetB (Nc3Vector &b)
 
void SetMarker (Int_t marker=8, Float_t size=0.2, Int_t color=-1)
 
void SetTofmax (Float_t tof)
 
void UseEndPoint (Int_t mode=1)
 

Protected Attributes

Nc3Vector fB
 
TObjArray * fCurves
 ! Temp. storage for the curves on the drawing
 
Int_t fEnduse
 
NcPositionfExt
 ! The extrapolation result
 
Int_t fMcol
 
Float_t fMsize
 
Int_t fMstyle
 
Int_t fRefresh
 
Float_t fTofmax
 

Constructor & Destructor Documentation

◆ NcHelix() [1/2]

NcHelix::NcHelix ( )
// Default constructor.

Definition at line 178 of file NcHelix.cxx.

◆ ~NcHelix()

NcHelix::~NcHelix ( )
virtual
// Destructor to delete dynamically allocated memory.

Definition at line 199 of file NcHelix.cxx.

◆ NcHelix() [2/2]

NcHelix::NcHelix ( const NcHelix & h)
// Copy constructor.

Definition at line 219 of file NcHelix.cxx.

Member Function Documentation

◆ Display() [1/3]

void NcHelix::Display ( NcEvent * e,
Double_t * range = 0,
Int_t iaxis = 3,
Double_t scale = -1 )
// Display the helix curves of all tracks of the specified event.
// Various events can be displayed together or individually; please refer to
// the memberfunction Refresh() for further details.
// Please refer to the track display memberfunction for further details
// on the input arguments.
//
// The default values are range=0, iaxis=3 and scale=-1.
//
// Note :
// ------
// Before any display activity, a TCanvas and a TView have to be initiated
// first by the user like for instance
//
// TCanvas* c1=new TCanvas("c1","c1");
// TView* view=new TView(1);
// view->SetRange(-1000,-1000,-1000,1000,1000,1000);
// view->ShowAxis();
//
// The user can also use the 3D viewing facilities from the TCanvas menu
// to open an appropriate view.

Definition at line 821 of file NcHelix.cxx.

◆ Display() [2/3]

void NcHelix::Display ( NcTrack * t,
Double_t * range = 0,
Int_t iaxis = 3,
Double_t scale = -1 )
// Display the helix curve of an NcTrack.
// Various curves can be displayed together or individually; please refer to
// the memberfunction Refresh() for further details.
// It is assumed that the track charge is stored in elementary units
// (i.e. charge=1 for a proton).
// The input argument "scale" specifies the unit scale for the various
// locations where scale=0.01 indicates unit scales in cm etc...
// In case scale<=0, the unit scale for locations is determined from the
// begin, reference or endpoint of the track. If neither of these
// positions is present, all locations are assumed to be given in meter.
// The lower and upper bounds for the range are specified by range[0] and
// range[1] and the argument "iaxis" indicates along which axis this range
// is specified.
// The range can be specified either in the LAB frame or in the Helix frame.
// The latter is the frame in which the Z axis points in the B direction.
//
// The conventions for the "iaxis" argument are the following :
// iaxis = 1 ==> X axis in the LAB frame
// 2 ==> Y axis in the LAB frame
// 3 ==> Z axis in the LAB frame
// -1 ==> X axis in the Helix frame
// -2 ==> Y axis in the Helix frame
// -3 ==> Z axis in the Helix frame
//
// In case range=0 the begin/end/reference points of the NcTrack and the
// maximum time of flight (see the SetTofmax() memberfunction) will be used
// and an appropriate choice for the iaxis parameter will be made automatically
// based on the track kinematics.
// In case the reference point is not present, the begin or endpoint will be used
// as reference point for the 3-momentum specification. If neither of these positions
// is present, (0,0,0) will be taken as the reference point.
//
// The default values are range=0, iaxis=3 and scale=-1.
//
// Note :
// ------
// Before any display activity, a TCanvas and a TView have to be initiated
// first by the user like for instance
//
// TCanvas* c1=new TCanvas("c1","c1");
// TView* view=new TView(1);
// view->SetRange(-1000,-1000,-1000,1000,1000,1000);
// view->ShowAxis();
//
// The user can also use the 3D viewing facilities from the TCanvas menu
// to open an appropriate view.

Definition at line 700 of file NcHelix.cxx.

◆ Display() [3/3]

void NcHelix::Display ( TObjArray * a,
Double_t * range = 0,
Int_t iaxis = 3,
Double_t scale = -1 )
// Display the helix curves of all tracks in the specified array.
// A convenient way to obtain an array with selected tracks from e.g. an NcEvent
// is to make use of its GetTracks() selection facility.
// Various arrays can be displayed together or individually; please refer to
// the memberfunction Refresh() for further details.
// Please refer to the track display memberfunction for further details
// on the input arguments.
//
// The default values are range=0, iaxis=3 and scale=-1.
//
// Note :
// ------
// Before any display activity, a TCanvas and a TView have to be initiated
// first by the user like for instance
//
// TCanvas* c1=new TCanvas("c1","c1");
// TView* view=new TView(1);
// view->SetRange(-1000,-1000,-1000,1000,1000,1000);
// view->ShowAxis();
//
// The user can also use the 3D viewing facilities from the TCanvas menu
// to open an appropriate view.

Definition at line 860 of file NcHelix.cxx.

◆ Extrapolate()

NcPosition * NcHelix::Extrapolate ( NcTrack * t,
Double_t * pars = 0,
Double_t scale = -1 )
// Extrapolate an NcTrack according to the corresponding helix curve
// and provide a pointer to the impact position w.r.t. a specified plane.
// In case the track can never reach the specified plane, the returned
// position pointer is zero.
// Detailed information of all the helix points used in the extrapolation
// can be obtained via the GetN() and GetP() memberfunctions of TPolyLine3D.
// It is assumed that the track charge is stored in elementary units
// (i.e. charge=1 for a proton).
// The input argument "scale" specifies the unit scale for the various
// locations where scale=0.01 indicates unit scales in cm etc...
// In case scale<=0, the unit scale for locations is determined from the
// begin, reference or endpoint of the track. If neither of these
// positions is present, all locations are assumed to be given in meter.
// The extrapolation parameters for the impact plane and required accuracy
// are specified by pars[0], pars[1] and pars[2], respectively.
// pars[0] = coordinate value of the plane for the impact point
// pars[1] = required accuracy on the specified impact plane coordinate
// pars[2] = the axis along which the value of par[0] is specified
//
// The parameters can be specified either w.r.t. the LAB frame or the Helix frame.
// The latter is the frame in which the Z axis points in the B direction.
//
// The conventions for the par[2] argument are the following :
// par[2] = 1 ==> X axis in the LAB frame
// 2 ==> Y axis in the LAB frame
// 3 ==> Z axis in the LAB frame
// -1 ==> X axis in the Helix frame
// -2 ==> Y axis in the Helix frame
// -3 ==> Z axis in the Helix frame
//
// Example :
// ---------
// To obtain an extrapolation to the plane Z=0 in the LAB frame
// with an accuracy of 0.001 cm the input arguments would be
// pars[0]=0 pars[1]=0.001 pars[2]=3 scale=0.01
//
// Note : The default value for the scale is -1.

Definition at line 902 of file NcHelix.cxx.

◆ GetB()

Nc3Vector & NcHelix::GetB ( )
// Provide the magnetic field vector in Tesla.

Definition at line 254 of file NcHelix.cxx.

◆ GetTofmax()

Float_t NcHelix::GetTofmax ( ) const
// Provide the maximum time of flight for straight tracks in seconds.

Definition at line 283 of file NcHelix.cxx.

◆ MakeCurve()

void NcHelix::MakeCurve ( NcTrack * t,
Double_t * range = 0,
Int_t iaxis = 3,
Double_t scale = -1 )
// Make the helix curve for the specified NcTrack.
// Detailed information of all the helix points can be obtained via the
// GetN() and GetP() memberfunctions of TPolyLine3D.
// In case one wants to display or extrapolate an NcTrack it is preferable
// to use the Display() or Extrapolate() memberfunctions.
// It is assumed that the track charge is stored in elementary units
// (i.e. charge=1 for a proton).
// The input argument "scale" specifies the unit scale for the various
// locations where scale=0.01 indicates unit scales in cm etc...
// In case scale<=0, the unit scale for locations is determined from the
// begin, reference or endpoint of the track. If neither of these
// positions is present, all locations are assumed to be given in meter.
// The lower and upper bounds for the range are specified by range[0] and
// range[1] and the argument "iaxis" indicates along which axis this range
// is specified.
// The range can be specified either in the LAB frame or in the Helix frame.
// The latter is the frame in which the Z axis points in the B direction.
//
// The conventions for the "iaxis" argument are the following :
// iaxis = 1 ==> X axis in the LAB frame
// 2 ==> Y axis in the LAB frame
// 3 ==> Z axis in the LAB frame
// -1 ==> X axis in the Helix frame
// -2 ==> Y axis in the Helix frame
// -3 ==> Z axis in the Helix frame
//
// In case range=0 the begin/end/reference points of the NcTrack and the
// maximum time of flight (see the SetTofmax() memberfunction) will be used
// and an appropriate choice for the iaxis parameter will be made automatically
// based on the track kinematics.
// In case the reference point is not present, the begin or endpoint will be used
// as reference point for the 3-momentum specification. If neither of these positions
// is present, (0,0,0) will be taken as the reference point.
//
// The default values are range=0, iaxis=3 and scale=-1.

Definition at line 328 of file NcHelix.cxx.

◆ Refresh()

void NcHelix::Refresh ( Int_t mode = 0)
// Refresh the display screen before showing the next curve.
//
// mode = 0 : refreshing fully under user control.
// 1 : the display screen will be refreshed automatically
// at each individual track display.
// -1 : the display screen will be refreshed automatically
// at each event display.
//
// The default is mode=0.

Definition at line 801 of file NcHelix.cxx.

◆ SetB()

void NcHelix::SetB ( Nc3Vector & b)
// Set the magnetic field vector in Tesla.

Definition at line 236 of file NcHelix.cxx.

◆ SetMarker()

void NcHelix::SetMarker ( Int_t marker = 8,
Float_t size = 0.2,
Int_t color = -1 )
// Specify the marker (style, size and colour) to indicate the starting point
// of a track in a display.
// In case col<0 the marker will have the same color as the track itself.
//
// Defaults are style=8, size=0.2 and col=-1.

Definition at line 294 of file NcHelix.cxx.

◆ SetTofmax()

void NcHelix::SetTofmax ( Float_t tof)
// Set the maximum time of flight for straight tracks in seconds.
// This maximum tof will be used for drawing etc... in case no begin
// and endpoints can be determined from the track info.
// Notes :
// -------
// 1) In case the user specifies an explicit range, it will override
// the maximum tof limit.
// 2) By default the tofmax is set to 10 ns in the NcHelix constructor.

Definition at line 265 of file NcHelix.cxx.

◆ UseEndPoint()

void NcHelix::UseEndPoint ( Int_t mode = 1)
// Select usage of track endpoint in drawing and extrapolation.
// This allows correct event displays even for very long tracks.
//
// mode = 0 : Do not use the track endpoint
// 1 : Use the track endpoint
//
// The default value is mode=1 (which is also set in the constructor).

Definition at line 311 of file NcHelix.cxx.

Member Data Documentation

◆ fB

Nc3Vector NcHelix::fB
protected

Definition at line 36 of file NcHelix.h.

◆ fCurves

TObjArray* NcHelix::fCurves
protected

! Temp. storage for the curves on the drawing

Definition at line 43 of file NcHelix.h.

◆ fEnduse

Int_t NcHelix::fEnduse
protected

Definition at line 42 of file NcHelix.h.

◆ fExt

NcPosition* NcHelix::fExt
protected

! The extrapolation result

Definition at line 44 of file NcHelix.h.

◆ fMcol

Int_t NcHelix::fMcol
protected

Definition at line 41 of file NcHelix.h.

◆ fMsize

Float_t NcHelix::fMsize
protected

Definition at line 40 of file NcHelix.h.

◆ fMstyle

Int_t NcHelix::fMstyle
protected

Definition at line 39 of file NcHelix.h.

◆ fRefresh

Int_t NcHelix::fRefresh
protected

Definition at line 38 of file NcHelix.h.

◆ fTofmax

Float_t NcHelix::fTofmax
protected

Definition at line 37 of file NcHelix.h.


The documentation for this class was generated from the following files: