Automatic treatment of the magnetic field value
authorbarbera <barbera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 5 Jul 2001 15:07:11 +0000 (15:07 +0000)
committerbarbera <barbera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 5 Jul 2001 15:07:11 +0000 (15:07 +0000)
ITS/AliITSTrackV1.cxx
ITS/AliITSTrackV1.h
ITS/AliITSTrackerV1.cxx
ITS/AliITSTrackerV1.h

index 1f3c7ac67451a1ca6c3f0b38dcf61fbf837ad356..d600acbd1dc015141112987599514dfc36300274 100644 (file)
@@ -12,6 +12,7 @@
 #include "AliITSRad.h"
 #include "AliITSTrackV1.h"
 #include "AliGenerator.h"
+#include "AliMagF.h"
 
 
 ClassImp(AliITSTrackV1)
@@ -35,7 +36,16 @@ AliITSTrackV1::AliITSTrackV1() {
   frtrack=0.; 
   fd2.ResizeTo(6);
   ftgl2.ResizeTo(6); 
-  fdtgl.ResizeTo(6);   
+  fdtgl.ResizeTo(6);
+  
+//////////////////////////////////////// gets magnetic field factor ////////////////////////////////
+
+  AliMagF * fieldPointer = gAlice->Field();
+  fFieldFactor = (Double_t)fieldPointer->Factor();
+  //cout<< " field factor = "<<fFieldFactor<<"\n"; getchar();
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////
+   
 }
 
 
@@ -76,6 +86,8 @@ AliITSTrackV1::AliITSTrackV1(const AliITSTrackV1 &cobj) {
   fC40=cobj.fC40; fC41=cobj.fC41; fC42=cobj.fC42; fC43=cobj.fC43; fC44=cobj.fC44; 
  
   *fClusterInTrack = *cobj.fClusterInTrack;
+  
+  fFieldFactor=cobj.fFieldFactor;
  
   for(i=0; i<cobj.flistCluster->GetSize(); i++) 
     flistCluster->AddLast(cobj.flistCluster->At(i));
@@ -87,6 +99,15 @@ AliITSTrackV1::AliITSTrackV1(AliTPCtrack &obj)
 //Origin  A. Badala' and G.S. Pappalardo:  e-mail Angela.Badala@ct.infn.it, Giuseppe.S.Pappalardo@ct.infn.it 
 // special constructor to convert a TPC track into an ITS track
 
+//////////////////////////////////////// gets magnetic field factor ////////////////////////////////
+
+  AliMagF * fieldPointer = gAlice->Field();
+  fFieldFactor = (Double_t)fieldPointer->Factor();
+  //cout<< " field factor = "<<fFieldFactor<<"\n"; getchar();
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
   fTPCtrack = &obj;
   fVertex.ResizeTo(3); 
   fErrorVertex.ResizeTo(3);
@@ -478,8 +499,8 @@ void AliITSTrackV1::AddEL(AliITSRad *rl, Double_t signdE, Bool_t flagtot, Double
   Double_t phi=fX0;
   
   if(phi<0.174 ) s(5)=s(5)+0.012; 
-   if(phi>6.1 ) s(5)=s(5)+0.012; // to take into account rail 
-   if(phi>2.96 && phi<3.31 ) s(5)=s(5)+0.012;   
+  if(phi>6.1 ) s(5)=s(5)+0.012; // to take into account rail 
+  if(phi>2.96 && phi<3.31 ) s(5)=s(5)+0.012;   
   
    
   Double_t tgl=fX3;
@@ -539,8 +560,7 @@ void AliITSTrackV1::AddEL(AliITSRad *rl, Double_t signdE, Bool_t flagtot, Double
   Double_t sign=1.;
   if(fX4 < 0.) sign=-1.; 
   pt=sign*p/sqcl; 
-  Double_t cc=(0.299792458*0.2)/(pt*100.);
-  //Double_t CC=(0.299792458*0.5)/(pt*100.);
+  Double_t cc=(0.299792458*0.2*fFieldFactor)/(pt*100.);
   fX4=cc;
   
 }
index 05060db73b39a0bc586fb2b936eed7cb2d450d79..b98f78a74503fa864bec4c246ba8734c92efb82c 100644 (file)
@@ -135,17 +135,18 @@ public:
   TMatrix        *fClusterInTrack;      // matrix of clusters belonging to the  track
                                         // row index = layer-1; 
                                         // cols index = master coordinates of the clusters
-  
-  
-  Double_t          fDv;                 // radial impact parameter for vertex  constraint
-  Double_t          fZv;                 // longitudinal impact parameter for vertex constraint
-  Double_t          fsigmaDv;            // sigma for Dv extraction
-  Double_t          fsigmaZv;            // sigma for Zv extraction
-  TVector           fd2;                 // C(2,2)  for primary track
-  TVector           ftgl2;               // C(3,3)  for primary track
-  TVector           fdtgl;               // C(2,3)  for primary track
-
-  Double_t          fxoTPC;              // cohordinate xo of the helix center, got from the TPC track 
+
+  Double_t        fFieldFactor;         // magnetic field factor                                                                                                        
+                                                                                                          
+  Double_t          fDv;                // radial impact parameter for vertex  constraint
+  Double_t          fZv;                // longitudinal impact parameter for vertex constraint
+  Double_t          fsigmaDv;           // sigma for Dv extraction
+  Double_t          fsigmaZv;           // sigma for Zv extraction
+  TVector           fd2;                // C(2,2)  for primary track
+  TVector           ftgl2;              // C(3,3)  for primary track
+  TVector           fdtgl;              // C(2,3)  for primary track
+
+  Double_t          fxoTPC;             // cohordinate xo of the helix center, got from the TPC track 
                   
  // Int_t freq; //provvisorio     
 
index 598fbf4d212ac9703f20436b59eb2e16ddc3f7f9..9dd59526948f058e197e706254b8cd420279e3b0 100644 (file)
@@ -52,6 +52,62 @@ AliITSTrackerV1::AliITSTrackerV1(AliITS* IITTSS, Bool_t flag) {
   Int_t imax=200,jmax=450;
   frl = new AliITSRad(imax,jmax);
 
+///////////////////////////////////////  gets information on geometry ///////////////////////////////////  
+
+  AliITSgeom *g1 = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); 
+  
+  Int_t ll=1, dd=1;
+  TVector det(9);
+  
+  //cout<<" nlad ed ndet \n";
+  Int_t ia;                              // fuori
+  for(ia=0; ia<6; ia++) {
+    fNlad[ia]=g1->GetNladders(ia+1);
+    fNdet[ia]=g1->GetNdetectors(ia+1);
+        //cout<<fNlad[i]<<" "<<fNdet[i]<<"\n"; 
+  }
+  //getchar();
+
+  //cout<<" raggio medio = ";
+  Int_t ib;                                  // fuori
+  for(ib=0; ib<6; ib++) {  
+    g1->GetCenterThetaPhi(ib+1,ll,dd,det);
+    fAvrad[ib]=TMath::Sqrt(det(0)*det(0)+det(1)*det(1));
+        //cout<<fAvrad[ib]<<" ";
+  }
+  //cout<<"\n"; getchar();
+  
+  fDetx[0] = ((AliITSgeomSPD*)(g1->GetShape(1, ll, dd)))->GetDx();
+  fDetz[0] = ((AliITSgeomSPD*)(g1->GetShape(1, ll, dd)))->GetDz();
+  
+  fDetx[1] = ((AliITSgeomSPD*)(g1->GetShape(2, ll, dd)))->GetDx();
+  fDetz[1] = ((AliITSgeomSPD*)(g1->GetShape(2, ll, dd)))->GetDz();
+  
+  fDetx[2] = ((AliITSgeomSDD*)(g1->GetShape(3, ll, dd)))->GetDx();
+  fDetz[2] = ((AliITSgeomSDD*)(g1->GetShape(3, ll, dd)))->GetDz();
+  
+  fDetx[3] = ((AliITSgeomSDD*)(g1->GetShape(4, ll, dd)))->GetDx();
+  fDetz[3] = ((AliITSgeomSDD*)(g1->GetShape(4, ll, dd)))->GetDz();
+  
+  fDetx[4] = ((AliITSgeomSSD*)(g1->GetShape(5, ll, dd)))->GetDx();
+  fDetz[4] = ((AliITSgeomSSD*)(g1->GetShape(5, ll, dd)))->GetDz();
+  
+  fDetx[5] = ((AliITSgeomSSD*)(g1->GetShape(6, ll, dd)))->GetDx();
+  fDetz[5] = ((AliITSgeomSSD*)(g1->GetShape(6, ll, dd)))->GetDz();
+  
+  //cout<<"    Detx     Detz\n";
+  //for(Int_t la=0; la<6; la++) cout<<"    "<<fDetx[la]<<"     "<<fDetz[la]<<"\n";
+  //getchar();
+//////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////// gets magnetic field factor ////////////////////////////////
+
+  AliMagF * fieldPointer = gAlice->Field();
+  fFieldFactor = (Double_t)fieldPointer->Factor();
+  //cout<< " field factor = "<<fFieldFactor<<"\n"; getchar();
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////
+  
 }
 
 AliITSTrackerV1::AliITSTrackerV1(const AliITSTrackerV1 &cobj) {
@@ -68,6 +124,7 @@ AliITSTrackerV1::AliITSTrackerV1(const AliITSTrackerV1 &cobj) {
         Int_t imax=200,jmax=450;
         frl = new AliITSRad(imax,jmax);         
         *frl = *cobj.frl;
+        fFieldFactor = cobj.fFieldFactor;
         Int_t i;
         for(i=0; i<6; i++) {
           fNlad[i] = cobj.fNlad[i];
@@ -91,6 +148,7 @@ AliITSTrackerV1 &AliITSTrackerV1::operator=(AliITSTrackerV1 obj) {
         Int_t imax=200,jmax=450;
         frl = new AliITSRad(imax,jmax);         
         *frl = *obj.frl;
+        fFieldFactor = obj.fFieldFactor;
         Int_t i;
         for(i=0; i<6; i++) {
           fNlad[i] = obj.fNlad[i];
@@ -116,60 +174,7 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber, Int_t minTr, Int_t maxTr, TFile
 
 
   printf("begin DoTracking - file %p\n",file);
-  
-///////////////////////////////////////  gets information on geometry ///////////////////////////////////  
-
-  AliITSgeom *g1 = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); 
-  
-  Int_t ll=1, dd=1;
-  TVector det(9);
-  
-  //cout<<" nlad ed ndet \n";
-  Int_t ia;                              // fuori
-  for(ia=0; ia<6; ia++) {
-    fNlad[ia]=g1->GetNladders(ia+1);
-    fNdet[ia]=g1->GetNdetectors(ia+1);
-        //cout<<fNlad[i]<<" "<<fNdet[i]<<"\n"; 
-  }
-  //getchar();
-
-  //cout<<" raggio medio = ";
-  Int_t ib;                                  // fuori
-  for(ib=0; ib<6; ib++) {  
-    g1->GetCenterThetaPhi(ib+1,ll,dd,det);
-    fAvrad[ib]=TMath::Sqrt(det(0)*det(0)+det(1)*det(1));
-        //cout<<fAvrad[ib]<<" ";
-  }
-  //cout<<"\n"; getchar();
-  
-  fDetx[0] = ((AliITSgeomSPD*)(g1->GetShape(1, ll, dd)))->GetDx();
-  fDetz[0] = ((AliITSgeomSPD*)(g1->GetShape(1, ll, dd)))->GetDz();
-  
-  fDetx[1] = ((AliITSgeomSPD*)(g1->GetShape(2, ll, dd)))->GetDx();
-  fDetz[1] = ((AliITSgeomSPD*)(g1->GetShape(2, ll, dd)))->GetDz();
-  
-  fDetx[2] = ((AliITSgeomSDD*)(g1->GetShape(3, ll, dd)))->GetDx();
-  fDetz[2] = ((AliITSgeomSDD*)(g1->GetShape(3, ll, dd)))->GetDz();
-  
-  fDetx[3] = ((AliITSgeomSDD*)(g1->GetShape(4, ll, dd)))->GetDx();
-  fDetz[3] = ((AliITSgeomSDD*)(g1->GetShape(4, ll, dd)))->GetDz();
-  
-  fDetx[4] = ((AliITSgeomSSD*)(g1->GetShape(5, ll, dd)))->GetDx();
-  fDetz[4] = ((AliITSgeomSSD*)(g1->GetShape(5, ll, dd)))->GetDz();
-  
-  fDetx[5] = ((AliITSgeomSSD*)(g1->GetShape(6, ll, dd)))->GetDx();
-  fDetz[5] = ((AliITSgeomSSD*)(g1->GetShape(6, ll, dd)))->GetDz();
-  
-  //cout<<"    Detx     Detz\n";
-  //for(Int_t la=0; la<6; la++) cout<<"    "<<fDetx[la]<<"     "<<fDetz[la]<<"\n";
-  //getchar();
-//////////////////////////////////////////////////////////////////////////////////////////////////////////  
-  
-  
- //Int_t imax=200,jmax=450;
- //frl = new AliITSRad(imax,jmax);
- //cout<<" dopo costruttore AliITSRad\n"; getchar();
-    
+      
   struct GoodTrack {
     Int_t lab,code;
     Float_t px,py,pz,x,y,z,pxg,pyg,pzg,ptg;
@@ -179,8 +184,8 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber, Int_t minTr, Int_t maxTr, TFile
 
   gAlice->GetEvent(0);
  
-    AliKalmanTrack *kkprov;
-    kkprov->SetConvConst(100/0.299792458/0.2/gAlice->Field()->Factor());  
+  AliKalmanTrack *kkprov;
+  kkprov->SetConvConst(100/0.299792458/0.2/fFieldFactor);  
 
 
   TFile *cf=TFile::Open("AliTPCclusters.root");  
@@ -407,7 +412,7 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber, Int_t minTr, Int_t maxTr, TFile
   list->AddLast(&trackITS);
   
   fPtref=TMath::Abs( (trackITS).GetPt() );
-  //cout << "\n Pt = " << fPtref <<"\n";  //stampa
+  cout << "\n Pt = " << fPtref <<"\n";  //stampa
 
   RecursiveTracking(list);  // nuova ITS 
   list->Delete();
@@ -442,11 +447,11 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber, Int_t minTr, Int_t maxTr, TFile
     // cout<<" progressive track number = "<<j<<"\r";
    // cout<<j<<"\r";
     Int_t numOfCluster=(*fresult).GetNumClust();  
-    //cout<<" progressive track number = "<<j<<"\n";    // stampa
+    cout<<" progressive track number = "<<j<<"\n";    // stampa
     Long_t labITS=(*fresult).GetLabel();
-    //cout << " ITS track label = " << labITS << "\n";         // stampa           
+    cout << " ITS track label = " << labITS << "\n";   // stampa           
     int lab=track->GetLabel();             
-    //cout << " TPC track label = " << lab <<"\n";      // stampa
+    cout << " TPC track label = " << lab <<"\n";      // stampa
         
             
 //propagation to vertex
index 54a29631cd0a318d0eb9b65b17967c4b1fad6d23..12946982d234e7b7e2ec13b8337a4124f91a6569 100644 (file)
@@ -67,6 +67,8 @@ class AliITSTrackerV1 : public TObject {
         Float_t fDetx[6];          // Semidimension of detectors along x axis for a given layer
         Float_t fDetz[6];          // Semidimension of detectors along z axis for a given layer
         
+        Double_t fFieldFactor;      // Magnetic filed factor
+        
 
     ClassDef(AliITSTrackerV1,1)
 };