]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New hits structure
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 5 Nov 1999 22:39:06 +0000 (22:39 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 5 Nov 1999 22:39:06 +0000 (22:39 +0000)
TOF/AliTOF.cxx
TOF/AliTOF.h
TOF/AliTOFv0.cxx
TOF/AliTOFv0.h
TOF/AliTOFv1.cxx
TOF/AliTOFv2.cxx
TOF/AliTOFv3.cxx
TOF/AliTOFv4.cxx
TOF/AliTOFv5.cxx
TOF/AliTOFv6.cxx

index 97f8081bfa58b6f5f9c7806c20c301146d10e24a..a72dfae72343c4d1e22cf6de90a7d3d4c73fbe77 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.10  1999/11/01 20:41:57  fca
+Added protections against using the wrong version of FRAME
+
 Revision 1.9  1999/10/15 15:35:19  fca
 New version for frame1099 with and without holes
 
@@ -48,10 +51,11 @@ Introduction of the Copyright and cvs Log
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include <iostream.h>
+
 #include "AliTOF.h"
-#include <TNode.h>
-#include <TTUBE.h>
-#include <TBRIK.h>
+#include "TNode.h"
+#include "TBRIK.h"
 #include "AliRun.h"
 #include "AliConst.h"
  
@@ -83,15 +87,16 @@ AliTOF::AliTOF(const char *name, const char *title)
 }
 
 //_____________________________________________________________________________
-void AliTOF::AddHit(Int_t track, Int_t *vol, Float_t *hits)
+void AliTOF::AddHit(Int_t track, Int_t sector, Int_t plate, Int_t pad_x,Int_t pad_z, Float_t *hits)
 {
   //
   // Add a TOF hit
   //
   TClonesArray &lhits = *fHits;
-  new(lhits[fNhits++]) AliTOFhit(fIshunt,track,vol,hits);
+  new(lhits[fNhits++]) AliTOFhit(fIshunt,track,sector,plate,pad_x,pad_z,hits);
 }
  
 //_____________________________________________________________________________
 void AliTOF::BuildGeometry()
 {
@@ -796,14 +801,17 @@ void AliTOF::Init()
 ClassImp(AliTOFhit)
  
 //___________________________________________
-AliTOFhit::AliTOFhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
+AliTOFhit::AliTOFhit(Int_t shunt, Int_t track, Int_t sector, Int_t plate, Int_t pad_x, Int_t pad_z, Float_t *hits):
   AliHit(shunt, track)
 {
   //
   // Store a TOF hit
   //
-  Int_t i;
-  for (i=0;i<3;i++) fVolume[i] = vol[i];
+  
+  fSector=sector;
+  fPlate=plate;
+  fPad_x=pad_x;
+  fPad_z=pad_z;
   //
   // Position
   fX=hits[0];
index d46df1eb07ef6f98f5403d13fbea31a5c1eee463..050d13331653c22db065473297a7bb8dc5d199ba 100644 (file)
@@ -22,7 +22,7 @@ public:
   AliTOF();
   AliTOF(const char *name, const char *title);
   virtual        ~AliTOF() {}
-  virtual void    AddHit(Int_t, Int_t*, Float_t*);
+  virtual void    AddHit(Int_t, Int_t, Int_t, Int_t, Int_t, Float_t*);
   virtual void    BuildGeometry();
   virtual void    CreateGeometry();
   virtual void    CreateMaterials();
@@ -40,7 +40,10 @@ public:
  
 class AliTOFhit : public AliHit {
 public:
-  Int_t      fVolume[3];  //array of volumes
+  Int_t      fSector;  // number of sector 
+  Int_t      fPlate;   // number of plate
+  Int_t      fPad_x;   // number of pad along x
+  Int_t      fPad_z;   // number of pad along z
   Float_t    fPx;         // px in TOF
   Float_t    fPy;         // py in TOF
   Float_t    fPz;         // pz in TOF
@@ -49,7 +52,7 @@ public:
  
 public:
   AliTOFhit() {}
-  AliTOFhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
+  AliTOFhit(Int_t shunt, Int_t track, Int_t sector, Int_t plate, Int_t pad_x, Int_t pad_z, Float_t *hits);
   virtual ~AliTOFhit() {}
  
   ClassDef(AliTOFhit,1)  // Hits for Time Of Flight
index c50b199b73ebdc5afe5043fccca6a2ec1a4a9526..7310c5f0f370609a31a18b7ca8aa7df496217e79 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.13  1999/11/01 20:41:57  fca
+Added protections against using the wrong version of FRAME
+
 Revision 1.12  1999/10/22 08:04:14  fca
 Correct improper use of negative parameters
 
@@ -57,6 +60,7 @@ Introduction of the Copyright and cvs Log
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include <iostream.h>
 #include <stdlib.h>
 
 #include "AliTOFv0.h"
@@ -221,7 +225,7 @@ void AliTOFv0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
   Float_t zSenStrip;
   zSenStrip = StripWidth-2*DeadBound;//cm
 
-  par[0] = xFLT*0.5;
+  par[0] = xFLT/2;
   par[1] = yPad/2; 
   par[2] = StripWidth/2.;
   
@@ -229,7 +233,7 @@ void AliTOFv0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
   gMC->Gsvolu("FSTR","BOX",idtmed[514],par,3);
 
   // Freon for non-sesitive boundaries
-  par[0] = xFLT*0.5;
+  par[0] = xFLT/2;
   par[1] = 0.110/2;
   par[2] = -1;
   gMC->Gsvolu("FNSF","BOX",idtmed[512],par,3);
@@ -255,7 +259,7 @@ void AliTOFv0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
   gMC->Gspos("FGRL",2,"FSTR",0.,-ycoor,0.,0,"ONLY");
 
   // Freon sensitive layer
-  par[0] = xFLT*0.5;
+  par[0] = -1;
   par[1] = 0.110/2.;
   par[2] = zSenStrip/2.;
   gMC->Gsvolu("FCFC","BOX",idtmed[513],par,3);
@@ -265,9 +269,9 @@ void AliTOFv0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
   gMC->Gsdvn("FLZ","FCFC", nz, 3); 
   gMC->Gsdvn("FLX","FLZ" , nx, 1); 
 
-
 ////  Positioning the Strips  (FSTR) in the FLT volumes  /////
 
   // 3 (Central) Plate 
   Float_t t = zFLT1+zFLT2+zFLT3/2.+7.*2.5;//Half Width of Barrel
   Float_t zpos = 0;
@@ -281,14 +285,14 @@ void AliTOFv0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
  
   do{
      ang = atan(zcoor/t);
-     ang = ang*kRaddeg;
-     AliMatrix (idrotm[nrot],  90.,  0.,90.-ang,90.,-ang,90.);
-     AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang,90.);
+     ang = ang * kRaddeg;
+     AliMatrix (idrotm[nrot],  90.,  0.,90.-ang,90.,-ang, 90.);   
+     AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90.,ang, 90.);
      ycoor = -14.5+ Space; //2 cm over front plate
      ycoor += (1-(UpDown+1)/2)*Gap;
      gMC->Gspos("FSTR",j  ,"FLT3",0.,ycoor, zcoor,idrotm[nrot],  "ONLY");
      gMC->Gspos("FSTR",j+1,"FLT3",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
-     ang  = ang/kRaddeg;
+     ang = ang / kRaddeg;
      
      zcoor=zcoor-(zSenStrip/2)/TMath::Cos(ang)+UpDown*Gap*TMath::Tan(ang)-(zSenStrip/2)/TMath::Cos(ang);
      UpDown*= -1; // Alternate strips 
@@ -309,13 +313,13 @@ void AliTOFv0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
 
   do {
      ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
-     ang = ang*kRaddeg;
-     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang,270.);
+     ang = ang * kRaddeg;
+     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
      ycoor = -29./2.+ Space ; //2 cm over front plate
      ycoor += (1-(UpDown+1)/2)*Gap;
      zcoor = zpos+(zFLT3/2.+7+zFLT2/2); // Moves to the system of the centre of the modulus FLT2
      gMC->Gspos("FSTR",i, "FLT2", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
-     ang  = ang/kRaddeg;
+     ang  = ang / kRaddeg;
      zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+UpDown*Gap*TMath::Tan(ang)-(zSenStrip/2)/TMath::Cos(ang);
      last = StripWidth*TMath::Cos(ang)/2;
      UpDown*=-1;
@@ -333,12 +337,12 @@ void AliTOFv0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlen1,
 
  do {
      ang = atan(zpos/sqrt(2*t*t-zpos*zpos));
-     ang = ang*kRaddeg;
-     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang,270.);
+     ang = ang * kRaddeg;
+     AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.);
      i++;
      zcoor = zpos+(zFLT1/2+zFLT2+zFLT3/2+7.*2.);
      gMC->Gspos("FSTR",i, "FLT1", 0., ycoor, zcoor,idrotm[nrot], "ONLY");
-     ang  = ang /kRaddeg;
+     ang  = ang / kRaddeg;
      zpos = zpos - zSenStrip/TMath::Cos(ang);
      last = StripWidth*TMath::Cos(ang)/2.;
   }  while (zpos>-t+7.+last);
@@ -514,37 +518,51 @@ void AliTOFv0::StepManager()
   // Procedure called at each step in the Time Of Flight
   //
   TLorentzVector mom, pos;
-  Float_t hits[8];
-  Int_t vol[3];
-  Int_t copy, id, i;
+  Float_t hits[8],rho,phi,phid,z;
+  Int_t sector, plate, pad_x, pad_z, strip;
+  Int_t copy, pad_z_id, pad_x_id, strip_id, i;
   Int_t *idtmed = fIdtmed->GetArray()-499;
-  if(gMC->GetMedium()==idtmed[514-1] && 
+  
+  
+  if(gMC->GetMedium()==idtmed[513] && 
      gMC->IsTrackEntering() && gMC->TrackCharge()
-     && gMC->CurrentVolID(copy)==fIdSens) {
+     && gMC->CurrentVolID(copy)==fIdSens) 
+  {
     TClonesArray &lhits = *fHits;
-    //
-    // Record only charged tracks at entrance
-    gMC->CurrentVolOffID(1,copy);
-    vol[2]=copy;
-    gMC->CurrentVolOffID(3,copy);
-    vol[1]=copy;
-    id=gMC->CurrentVolOffID(8,copy);
-    vol[0]=copy;
-    if(id==fIdFTO3) {
-      vol[0]+=22;
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT3) vol[1]+=6;
-    } else if (id==fIdFTO2) {
-      vol[0]+=20;
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT2) vol[1]+=8;
-    } else {
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT1) vol[1]+=14;
-    }
+    
+    //_________getting information about hit volumes_____________
+    
+    pad_z_id=gMC->CurrentVolOffID(2,copy);
+    pad_z=copy;  
+    
+    pad_x_id=gMC->CurrentVolOffID(1,copy);
+    pad_x=copy;  
+    
+    strip_id=gMC->CurrentVolOffID(5,copy);
+    strip=copy;  
+
+    pad_z = (strip-1)*2+pad_z;
+
     gMC->TrackPosition(pos);
     gMC->TrackMomentum(mom);
-    //
+
+    rho = sqrt(pos[0]*pos[0]+pos[1]*pos[1]);
+    phi = TMath::ACos(pos[0]/rho);
+    Float_t as = TMath::ASin(pos[1]/rho);
+    if (as<0) phi = 2*3.141592654-phi;
+
+    z = pos[2];
+   
+    if (z<=  62. && z>=-62.) plate = 3;
+    if (z<= 216. && z>62.)   plate = 4;
+    if (z>=-216. && z<-62.)  plate = 2;
+    if (z>216.)  plate = 5;
+    if (z<-216.) plate = 1;
+
+    phid = phi*kRaddeg;
+    sector = Int_t (phid/20.);
+    sector++;
+
     Double_t ptot=mom.Rho();
     Double_t norm=1/ptot;
     for(i=0;i<3;++i) {
@@ -553,7 +571,8 @@ void AliTOFv0::StepManager()
     }
     hits[6]=ptot;
     hits[7]=pos[3];
-    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),sector, plate, pad_x, pad_z, hits);
   }
 }
 
+
index 8d6dbfe4eed3308948370f9680578f45232770ab..e050a866055fe487b7527ef1cffe6ea83c506c4d 100644 (file)
@@ -34,7 +34,7 @@ public:
   virtual void   StepManager();
   virtual void   DrawModule();
  
-   ClassDef(AliTOFv0,1)  //Time Of Flight version 1
+   ClassDef(AliTOFv0,1)  //Time Of Flight version 0
 };
  
 #endif
index 255e66d971dc3a4d45d64b9c7ca4fac2336107a3..1f04f5e5cdb3cc64f08e627944acb2b478b34545 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.13  1999/11/01 20:41:57  fca
+Added protections against using the wrong version of FRAME
+
 Revision 1.12  1999/10/22 08:04:14  fca
 Correct improper use of negative parameters
 
@@ -57,6 +60,7 @@ Introduction of the Copyright and cvs Log
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include <iostream.h>
 #include <stdlib.h>
 
 #include "AliTOFv1.h"
@@ -522,37 +526,51 @@ void AliTOFv1::StepManager()
   // Procedure called at each step in the Time Of Flight
   //
   TLorentzVector mom, pos;
-  Float_t hits[8];
-  Int_t vol[3];
-  Int_t copy, id, i;
+  Float_t hits[8],rho,phi,phid,z;
+  Int_t sector, plate, pad_x, pad_z, strip;
+  Int_t copy, pad_z_id, pad_x_id, strip_id, i;
   Int_t *idtmed = fIdtmed->GetArray()-499;
-  if(gMC->GetMedium()==idtmed[514-1] && 
+  
+  
+  if(gMC->GetMedium()==idtmed[513] && 
      gMC->IsTrackEntering() && gMC->TrackCharge()
-     && gMC->CurrentVolID(copy)==fIdSens) {
+     && gMC->CurrentVolID(copy)==fIdSens) 
+  {
     TClonesArray &lhits = *fHits;
-    //
-    // Record only charged tracks at entrance
-    gMC->CurrentVolOffID(1,copy);
-    vol[2]=copy;
-    gMC->CurrentVolOffID(3,copy);
-    vol[1]=copy;
-    id=gMC->CurrentVolOffID(8,copy);
-    vol[0]=copy;
-    if(id==fIdFTO3) {
-      vol[0]+=22;
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT3) vol[1]+=6;
-    } else if (id==fIdFTO2) {
-      vol[0]+=20;
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT2) vol[1]+=8;
-    } else {
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT1) vol[1]+=14;
-    }
+    
+    //_________getting information about hit volumes_____________
+    
+    pad_z_id=gMC->CurrentVolOffID(2,copy);
+    pad_z=copy;  
+    
+    pad_x_id=gMC->CurrentVolOffID(1,copy);
+    pad_x=copy;  
+    
+    strip_id=gMC->CurrentVolOffID(5,copy);
+    strip=copy;  
+
+    pad_z = (strip-1)*2+pad_z;
+
     gMC->TrackPosition(pos);
     gMC->TrackMomentum(mom);
-    //
+
+    rho = sqrt(pos[0]*pos[0]+pos[1]*pos[1]);
+    phi = TMath::ACos(pos[0]/rho);
+    Float_t as = TMath::ASin(pos[1]/rho);
+    if (as<0) phi = 2*3.141592654-phi;
+
+    z = pos[2];
+   
+    if (z<=62. && z>=-62) plate = 3;
+    if (z<=216. && z>62.)   plate = 4;
+    if (z>=-216. && z<-62.) plate = 2;
+    if (z>216.)  plate = 5;
+    if (z<-216.) plate = 1;
+
+    phid = phi*kRaddeg;
+    sector = Int_t (phid/20.);
+    sector++;
+
     Double_t ptot=mom.Rho();
     Double_t norm=1/ptot;
     for(i=0;i<3;++i) {
@@ -561,7 +579,8 @@ void AliTOFv1::StepManager()
     }
     hits[6]=ptot;
     hits[7]=pos[3];
-    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),sector, plate, pad_x, pad_z, hits);
   }
 }
 
+
index 379d5a01945e0c358a20c40b45c8f6f7c5c534b4..fed0ce8bbe11edbb152f99144a4286cb498988ce 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.13  1999/11/01 20:41:57  fca
+Added protections against using the wrong version of FRAME
+
 Revision 1.12  1999/10/22 08:04:14  fca
 Correct improper use of negative parameters
 
@@ -58,6 +61,7 @@ Introduction of the Copyright and cvs Log
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include <iostream.h>
 #include <stdlib.h>
 
 #include "AliTOFv2.h"
@@ -520,37 +524,51 @@ void AliTOFv2::StepManager()
   // Procedure called at each step in the Time Of Flight
   //
   TLorentzVector mom, pos;
-  Float_t hits[8];
-  Int_t vol[3];
-  Int_t copy, id, i;
+  Float_t hits[8],rho,phi,phid,z;
+  Int_t sector, plate, pad_x, pad_z, strip;
+  Int_t copy, pad_z_id, pad_x_id, strip_id, i;
   Int_t *idtmed = fIdtmed->GetArray()-499;
-  if(gMC->GetMedium()==idtmed[514-1] && 
+  
+  
+  if(gMC->GetMedium()==idtmed[513] && 
      gMC->IsTrackEntering() && gMC->TrackCharge()
-     && gMC->CurrentVolID(copy)==fIdSens) {
+     && gMC->CurrentVolID(copy)==fIdSens) 
+  {
     TClonesArray &lhits = *fHits;
-    //
-    // Record only charged tracks at entrance
-    gMC->CurrentVolOffID(1,copy);
-    vol[2]=copy;
-    gMC->CurrentVolOffID(3,copy);
-    vol[1]=copy;
-    id=gMC->CurrentVolOffID(8,copy);
-    vol[0]=copy;
-    if(id==fIdFTO3) {
-      vol[0]+=22;
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT3) vol[1]+=6;
-    } else if (id==fIdFTO2) {
-      vol[0]+=20;
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT2) vol[1]+=8;
-    } else {
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT1) vol[1]+=14;
-    }
+    
+    //_________getting information about hit volumes_____________
+    
+    pad_z_id=gMC->CurrentVolOffID(2,copy);
+    pad_z=copy;  
+    
+    pad_x_id=gMC->CurrentVolOffID(1,copy);
+    pad_x=copy;  
+    
+    strip_id=gMC->CurrentVolOffID(5,copy);
+    strip=copy;  
+
+    pad_z = (strip-1)*2+pad_z;
+
     gMC->TrackPosition(pos);
     gMC->TrackMomentum(mom);
-    //
+
+    rho = sqrt(pos[0]*pos[0]+pos[1]*pos[1]);
+    phi = TMath::ACos(pos[0]/rho);
+    Float_t as = TMath::ASin(pos[1]/rho);
+    if (as<0) phi = 2*3.141592654-phi;
+
+    z = pos[2];
+   
+    if (z<=62. && z>=-62) plate = 3;
+    if (z<=216. && z>62.)   plate = 4;
+    if (z>=-216. && z<-62.) plate = 2;
+    if (z>216.)  plate = 5;
+    if (z<-216.) plate = 1;
+
+    phid = phi*kRaddeg;
+    sector = Int_t (phid/20.);
+    sector++;
+
     Double_t ptot=mom.Rho();
     Double_t norm=1/ptot;
     for(i=0;i<3;++i) {
@@ -559,7 +577,8 @@ void AliTOFv2::StepManager()
     }
     hits[6]=ptot;
     hits[7]=pos[3];
-    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),sector, plate, pad_x, pad_z, hits);
   }
 }
 
+
index b1d8d33425480ef08170f2e93e6b9dda5f3d0870..1299abf007a81f31e1975aec72f8e8387eb03b25 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.13  1999/11/02 11:26:39  fca
+added stdlib.h for exit
+
 Revision 1.12  1999/11/01 20:41:57  fca
 Added protections against using the wrong version of FRAME
 
@@ -58,6 +61,7 @@ Introduction of the Copyright and cvs Log
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include <iostream.h>
 #include <stdlib.h>
 
 #include "AliTOFv3.h"
@@ -526,37 +530,51 @@ void AliTOFv3::StepManager()
   // Procedure called at each step in the Time Of Flight
   //
   TLorentzVector mom, pos;
-  Float_t hits[8];
-  Int_t vol[3];
-  Int_t copy, id, i;
+  Float_t hits[8],rho,phi,phid,z;
+  Int_t sector, plate, pad_x, pad_z, strip;
+  Int_t copy, pad_z_id, pad_x_id, strip_id, i;
   Int_t *idtmed = fIdtmed->GetArray()-499;
-  if(gMC->GetMedium()==idtmed[514-1] && 
+  
+  
+  if(gMC->GetMedium()==idtmed[513] && 
      gMC->IsTrackEntering() && gMC->TrackCharge()
-     && gMC->CurrentVolID(copy)==fIdSens) {
+     && gMC->CurrentVolID(copy)==fIdSens) 
+  {
     TClonesArray &lhits = *fHits;
-    //
-    // Record only charged tracks at entrance
-    gMC->CurrentVolOffID(1,copy);
-    vol[2]=copy;
-    gMC->CurrentVolOffID(3,copy);
-    vol[1]=copy;
-    id=gMC->CurrentVolOffID(8,copy);
-    vol[0]=copy;
-    if(id==fIdFTO3) {
-      vol[0]+=22;
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT3) vol[1]+=6;
-    } else if (id==fIdFTO2) {
-      vol[0]+=20;
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT2) vol[1]+=8;
-    } else {
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT1) vol[1]+=14;
-    }
+    
+    //_________getting information about hit volumes_____________
+    
+    pad_z_id=gMC->CurrentVolOffID(2,copy);
+    pad_z=copy;  
+    
+    pad_x_id=gMC->CurrentVolOffID(1,copy);
+    pad_x=copy;  
+    
+    strip_id=gMC->CurrentVolOffID(5,copy);
+    strip=copy;  
+
+    pad_z = (strip-1)*2+pad_z;
+
     gMC->TrackPosition(pos);
     gMC->TrackMomentum(mom);
-    //
+
+    rho = sqrt(pos[0]*pos[0]+pos[1]*pos[1]);
+    phi = TMath::ACos(pos[0]/rho);
+    Float_t as = TMath::ASin(pos[1]/rho);
+    if (as<0) phi = 2*3.141592654-phi;
+
+    z = pos[2];
+   
+    if (z<=62. && z>=-62) plate = 3;
+    if (z<=216. && z>62.)   plate = 4;
+    if (z>=-216. && z<-62.) plate = 2;
+    if (z>216.)  plate = 5;
+    if (z<-216.) plate = 1;
+
+    phid = phi*kRaddeg;
+    sector = Int_t (phid/20.);
+    sector++;
+
     Double_t ptot=mom.Rho();
     Double_t norm=1/ptot;
     for(i=0;i<3;++i) {
@@ -565,7 +583,7 @@ void AliTOFv3::StepManager()
     }
     hits[6]=ptot;
     hits[7]=pos[3];
-    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),sector, plate, pad_x, pad_z, hits);
   }
 }
 
index 294e94484e91f8dfd3139eed24e189daff4d708f..c70e33e8c66339fc0954f4675264f17ed0c4dce9 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.3  1999/11/01 20:41:57  fca
+Added protections against using the wrong version of FRAME
+
 Revision 1.2  1999/10/16 19:22:18  fca
 Corrected Rotation Matrix and CVS log
 
@@ -50,6 +53,7 @@ New version for frame1099 with and without holes
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include <iostream.h>
 #include <stdlib.h>
 
 #include "AliTOFv4.h"
@@ -415,37 +419,44 @@ void AliTOFv4::StepManager()
   // Procedure called at each step in the Time Of Flight
   //
   TLorentzVector mom, pos;
-  Float_t hits[8];
-  Int_t vol[3];
-  Int_t copy, id, i;
+  Float_t hits[8],rho,z,phi,phid;
+  Int_t sector, plate, pad_x, pad_z;
+  Int_t copy, pad_x_id, pad_z_id, i;
   Int_t *idtmed = fIdtmed->GetArray()-499;
   if(gMC->GetMedium()==idtmed[514-1] && 
      gMC->IsTrackEntering() && gMC->TrackCharge()
      && gMC->CurrentVolID(copy)==fIdSens) {
     TClonesArray &lhits = *fHits;
-    //
-    // Record only charged tracks at entrance
-    gMC->CurrentVolOffID(1,copy);
-    vol[2]=copy;
-    gMC->CurrentVolOffID(3,copy);
-    vol[1]=copy;
-    id=gMC->CurrentVolOffID(8,copy);
-    vol[0]=copy;
-    if(id==fIdFTO3) {
-      vol[0]+=22;
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT3) vol[1]+=6;
-    } else if (id==fIdFTO2) {
-      vol[0]+=20;
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT2) vol[1]+=8;
-    } else {
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT1) vol[1]+=14;
-    }
-    gMC->TrackPosition(pos);
-    gMC->TrackMomentum(mom);
-    //
+
+
+    //_________getting information about hit volumes_____________
+    
+    pad_z_id=gMC->CurrentVolOffID(3,copy);
+    pad_z=copy;  
+    
+    pad_x_id=gMC->CurrentVolOffID(2,copy);
+    pad_x=copy;  
+    
+   gMC->TrackPosition(pos);
+   gMC->TrackMomentum(mom);
+
+   rho = sqrt(pos[0]*pos[0]+pos[1]*pos[1]);
+   phi = TMath::ACos(pos[0]/rho);
+   Float_t as = TMath::ASin(pos[1]/rho);
+   if (as<0) phi = 2*3.141592654-phi;
+
+   z = pos[2];
+   
+   if (z<=62. && z>=-62)  plate = 3;
+   if (z<=216. && z>62.)   plate = 4;
+   if (z>=-216. && z<-62.) plate = 2;
+   if (z>216.)  plate = 5;
+   if (z<-216.) plate = 1;
+
+   phid = phi*kRaddeg;
+   sector = Int_t (phid/20.);
+   sector++;
+
     Double_t ptot=mom.Rho();
     Double_t norm=1/ptot;
     for(i=0;i<3;++i) {
@@ -454,7 +465,6 @@ void AliTOFv4::StepManager()
     }
     hits[6]=ptot;
     hits[7]=pos[3];
-    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),sector,plate,pad_x,pad_z,hits);
   }
 }
-
index 2a9f4d8d03e24a242612af97d99cfe9c9c94ab4d..400b382649d27c9f28b81508e4a9d1618fcc1f82 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.3  1999/11/01 20:41:58  fca
+Added protections against using the wrong version of FRAME
+
 Revision 1.2  1999/10/16 19:21:57  fca
 Corrected Rotation Matrix and CVS logAliTOFv4.cxx
 
@@ -51,6 +54,7 @@ New version for frame1099 with and without holes
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include <iostream.h>
 #include <stdlib.h>
 
 #include "AliTOFv5.h"
@@ -417,37 +421,44 @@ void AliTOFv5::StepManager()
   // Procedure called at each step in the Time Of Flight
   //
   TLorentzVector mom, pos;
-  Float_t hits[8];
-  Int_t vol[3];
-  Int_t copy, id, i;
+  Float_t hits[8],rho,z,phi,phid;
+  Int_t sector, plate, pad_x, pad_z;
+  Int_t copy, pad_x_id, pad_z_id, i;
   Int_t *idtmed = fIdtmed->GetArray()-499;
   if(gMC->GetMedium()==idtmed[514-1] && 
      gMC->IsTrackEntering() && gMC->TrackCharge()
      && gMC->CurrentVolID(copy)==fIdSens) {
     TClonesArray &lhits = *fHits;
-    //
-    // Record only charged tracks at entrance
-    gMC->CurrentVolOffID(1,copy);
-    vol[2]=copy;
-    gMC->CurrentVolOffID(3,copy);
-    vol[1]=copy;
-    id=gMC->CurrentVolOffID(8,copy);
-    vol[0]=copy;
-    if(id==fIdFTO3) {
-      vol[0]+=22;
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT3) vol[1]+=6;
-    } else if (id==fIdFTO2) {
-      vol[0]+=20;
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT2) vol[1]+=8;
-    } else {
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT1) vol[1]+=14;
-    }
-    gMC->TrackPosition(pos);
-    gMC->TrackMomentum(mom);
-    //
+
+
+    //_________getting information about hit volumes_____________
+    
+    pad_z_id=gMC->CurrentVolOffID(3,copy);
+    pad_z=copy;  
+    
+    pad_x_id=gMC->CurrentVolOffID(2,copy);
+    pad_x=copy;  
+    
+   gMC->TrackPosition(pos);
+   gMC->TrackMomentum(mom);
+
+   rho = sqrt(pos[0]*pos[0]+pos[1]*pos[1]);
+   phi = TMath::ACos(pos[0]/rho);
+   Float_t as = TMath::ASin(pos[1]/rho);
+   if (as<0) phi = 2*3.141592654-phi;
+
+   z = pos[2];
+   
+   if (z<=62. && z>=-62)  plate = 3;
+   if (z<=216. && z>62.)   plate = 4;
+   if (z>=-216. && z<-62.) plate = 2;
+   if (z>216.)  plate = 5;
+   if (z<-216.) plate = 1;
+
+   phid = phi*kRaddeg;
+   sector = Int_t (phid/20.);
+   sector++;
+
     Double_t ptot=mom.Rho();
     Double_t norm=1/ptot;
     for(i=0;i<3;++i) {
@@ -456,7 +467,6 @@ void AliTOFv5::StepManager()
     }
     hits[6]=ptot;
     hits[7]=pos[3];
-    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),sector,plate,pad_x,pad_z,hits);
   }
 }
-
index 0fd4a38047c0164623b9291377f194a1fecf816f..cdc31868b998a9c1e40901a4a127a0556aa86ac4 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.3  1999/11/01 20:41:58  fca
+Added protections against using the wrong version of FRAME
+
 Revision 1.2  1999/10/16 19:21:57  fca
 Corrected Rotation Matrix and CVS logAliTOFv4.cxx
 
@@ -50,6 +53,7 @@ New version for frame1099 with and without holes
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include <iostream.h>
 #include <stdlib.h>
 
 #include "AliTOFv6.h"
@@ -425,37 +429,44 @@ void AliTOFv6::StepManager()
   // Procedure called at each step in the Time Of Flight
   //
   TLorentzVector mom, pos;
-  Float_t hits[8];
-  Int_t vol[3];
-  Int_t copy, id, i;
+  Float_t hits[8],rho,z,phi,phid;
+  Int_t sector, plate, pad_x, pad_z;
+  Int_t copy, pad_x_id, pad_z_id, i;
   Int_t *idtmed = fIdtmed->GetArray()-499;
   if(gMC->GetMedium()==idtmed[514-1] && 
      gMC->IsTrackEntering() && gMC->TrackCharge()
      && gMC->CurrentVolID(copy)==fIdSens) {
     TClonesArray &lhits = *fHits;
-    //
-    // Record only charged tracks at entrance
-    gMC->CurrentVolOffID(1,copy);
-    vol[2]=copy;
-    gMC->CurrentVolOffID(3,copy);
-    vol[1]=copy;
-    id=gMC->CurrentVolOffID(8,copy);
-    vol[0]=copy;
-    if(id==fIdFTO3) {
-      vol[0]+=22;
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT3) vol[1]+=6;
-    } else if (id==fIdFTO2) {
-      vol[0]+=20;
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT2) vol[1]+=8;
-    } else {
-      id=gMC->CurrentVolOffID(5,copy);
-      if(id==fIdFLT1) vol[1]+=14;
-    }
-    gMC->TrackPosition(pos);
-    gMC->TrackMomentum(mom);
-    //
+
+
+    //_________getting information about hit volumes_____________
+    
+    pad_z_id=gMC->CurrentVolOffID(3,copy);
+    pad_z=copy;  
+    
+    pad_x_id=gMC->CurrentVolOffID(2,copy);
+    pad_x=copy;  
+    
+   gMC->TrackPosition(pos);
+   gMC->TrackMomentum(mom);
+
+   rho = sqrt(pos[0]*pos[0]+pos[1]*pos[1]);
+   phi = TMath::ACos(pos[0]/rho);
+   Float_t as = TMath::ASin(pos[1]/rho);
+   if (as<0) phi = 2*3.141592654-phi;
+
+   z = pos[2];
+   
+   if (z<=62. && z>=-62)  plate = 3;
+   if (z<=216. && z>62.)   plate = 4;
+   if (z>=-216. && z<-62.) plate = 2;
+   if (z>216.)  plate = 5;
+   if (z<-216.) plate = 1;
+
+   phid = phi*kRaddeg;
+   sector = Int_t (phid/20.);
+   sector++;
+
     Double_t ptot=mom.Rho();
     Double_t norm=1/ptot;
     for(i=0;i<3;++i) {
@@ -464,7 +475,6 @@ void AliTOFv6::StepManager()
     }
     hits[6]=ptot;
     hits[7]=pos[3];
-    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+    new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),sector,plate,pad_x,pad_z,hits);
   }
 }
-