]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSvPPRasymmFMD.cxx
New pathlength option added.
[u/mrichter/AliRoot.git] / ITS / AliITSvPPRasymmFMD.cxx
index 3404b99220d90eaa564b660f73ba79b6901dfdd3..2f16ff403db455b3445dfef728dad5a86a260021 100644 (file)
@@ -14,7 +14,6 @@
  **************************************************************************/
 
 /* $Id$ */
-
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
 //  Inner Traking System version PPR  asymmetric for the FMD                 //
@@ -76,6 +75,8 @@
 #include "AliRun.h"
 #include "AliTrackReference.h"
 
+#define GEANTGEOMETRY kTRUE
+
 ClassImp(AliITSvPPRasymmFMD)
  
 //______________________________________________________________________
@@ -94,12 +95,13 @@ AliITSvPPRasymmFMD::AliITSvPPRasymmFMD() {
     fIdSens       = 0;
     fEuclidOut    = kFALSE; // Don't write Euclide file
     fGeomDetOut   = kFALSE; // Don't write .det file
-    fGeomDetIn    = kFALSE; // Don't Read .det file
+    fGeomDetIn    = kTRUE; // Read .det file
     fMajorVersion = IsVersion();
     fMinorVersion = -1;
     for(i=0;i<60;i++) fRead[i] = '\0';
     for(i=0;i<60;i++) fWrite[i] = '\0';
     for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
+    strncpy(fRead,"$ALICE_ROOT/ITS/ITSgeometry_vPPRasymmFMD.det",60);
 }
 //______________________________________________________________________
 AliITSvPPRasymmFMD::AliITSvPPRasymmFMD(const char *name, const char *title) 
@@ -116,6 +118,7 @@ AliITSvPPRasymmFMD::AliITSvPPRasymmFMD(const char *name, const char *title)
 
     fIdN = 6;
     fIdName = new TString[fIdN];
+    fIdName[0] = name; // removes warning message
     fIdName[0] = "ITS1";
     fIdName[1] = "ITS2";
     fIdName[2] = "ITS3";
@@ -128,7 +131,7 @@ AliITSvPPRasymmFMD::AliITSvPPRasymmFMD(const char *name, const char *title)
     fMinorVersion = 2;
     fEuclidOut    = kFALSE; // Don't write Euclide file
     fGeomDetOut   = kFALSE; // Don't write .det file
-    fGeomDetIn    = kFALSE; // Don't Read .det file
+    fGeomDetIn    = kTRUE; // Read .det file
     SetThicknessDet1();
     SetThicknessDet2();
     SetThicknessChip1();
@@ -139,9 +142,11 @@ AliITSvPPRasymmFMD::AliITSvPPRasymmFMD(const char *name, const char *title)
     strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det",60);
     strncpy(fRead,fEuclidGeomDet,60);
     strncpy(fWrite,fEuclidGeomDet,60);
+    strncpy(fRead,"$ALICE_ROOT/ITS/ITSgeometry_vPPRasymmFMD.det",60);
 }
 //______________________________________________________________________
-AliITSvPPRasymmFMD::AliITSvPPRasymmFMD(const AliITSvPPRasymmFMD &source){
+AliITSvPPRasymmFMD::AliITSvPPRasymmFMD(const AliITSvPPRasymmFMD &source) :
+ AliITS(source){
     //     Copy Constructor for ITS version 10. This function is not to be
     // used. If any other instance of this function, other than "this" is
     // passed, an error message is returned.
@@ -889,6 +894,9 @@ void AliITSvPPRasymmFMD::CreateGeometry(){
     // Services
     AliMatrix(idrotm[200], 90., 0., 90., 90., 180., 0.);
 
+    // New reference frame: z--->  -z;   x ---> -x;   y ---> y
+    AliMatrix(idrotm[199], 90.,180., 90.,90., 180.,0.);
+
     //     CONVERT INTO CM (RL(SI)=9.36 CM)
     for (i = 0; i < 6; ++i) {
        drl[i] = drl[i] / 100. * 9.36;
@@ -955,7 +963,8 @@ void AliITSvPPRasymmFMD::CreateGeometry(){
 
     // --- Place the ghost volume in its mother volume (ALIC) and make it 
     //     invisible
-    gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
+    //    gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
+    gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., idrotm[199], "ONLY");
     //gMC->Gsatt("ITSV", "SEEN", 0);
 
     // --- Define ghost volume containing the six layers and fill it with air 
@@ -4552,8 +4561,8 @@ void AliITSvPPRasymmFMD::CreateGeometry(){
   dgh[1] = 59.;
   dgh[2] = 0.6;    
   gMC->Gsvolu("ICYL", "TUBE", idtmed[210], dgh, 3);   
-  gMC->Gspos("ICYL", 1, "ALIC", 0., 0., 74.1, 0, "ONLY");   
-  gMC->Gspos("ICYL", 2, "ALIC", 0., 0., -74.1, idrotm[200], "ONLY");  
+  gMC->Gspos("ICYL", 1, "ALIC", 0., 0., -74.1,idrotm[199], "ONLY");   
+  gMC->Gspos("ICYL", 2, "ALIC", 0., 0., 74.1, 0, "ONLY"); 
 
   // --- DEFINE SUPPORTS FOR RAILS ATTACHED TO THE CYLINDERS
 
@@ -4576,9 +4585,9 @@ void AliITSvPPRasymmFMD::CreateGeometry(){
   dgh[1] = 12.;         
   dgh[2] = 5.;         
   gMC->Gsvolu("ISR2", "BOX ", idtmed[210], dgh, 3);   
-  gMC->Gspos("ISR2", 1, "ALIC", 53.5, 0., 125.5, 0, "ONLY");
+  gMC->Gspos("ISR2", 1, "ALIC", -53.5, 0., -125.5, idrotm[199], "ONLY");
   gMC->Gsvolu("ISR3", "BOX ", idtmed[210], dgh, 3);   
-  gMC->Gspos("ISR3", 1, "ALIC", -53.5, 0., 125.5, 0, "ONLY");  
+  gMC->Gspos("ISR3", 1, "ALIC", 53.5, 0., -125.5, idrotm[199], "ONLY");  
   
   dgh[0] = 5.-2.;        
   dgh[1] = 12.-2.;         
@@ -4594,9 +4603,9 @@ void AliITSvPPRasymmFMD::CreateGeometry(){
   dgh[1] = 5.;         
   dgh[2] = 2.;         
   gMC->Gsvolu("ISR6", "TUBE", idtmed[210], dgh, 3);   
-  gMC->Gspos("ISR6", 1, "ALIC", 0., 54., 77., 0, "ONLY"); 
-  gMC->Gspos("ISR6", 2, "ALIC", 0., 54., -77., 0, "ONLY"); 
-  gMC->Gspos("ISR6", 3, "ALIC", 0., -54., -77., 0, "ONLY");                   
+  gMC->Gspos("ISR6", 1, "ALIC", 0., 54., -77., idrotm[199], "ONLY"); 
+  gMC->Gspos("ISR6", 2, "ALIC", 0., 54., 77., idrotm[199], "ONLY"); 
+  gMC->Gspos("ISR6", 3, "ALIC", 0., -54., 77., idrotm[199], "ONLY");                   
 
   // --- Outputs the geometry tree in the EUCLID/CAD format 
   
@@ -4995,7 +5004,7 @@ void AliITSvPPRasymmFMD::InitAliITSgeom(){
     //   none.
     // Return:
     //   none.
-
+//#if GEANTGEOMETRY
     if(strcmp(gMC->GetName(),"TGeant3")) {
        Error("InitAliITSgeom",
              "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
@@ -5055,8 +5064,9 @@ void AliITSvPPRasymmFMD::InitAliITSgeom(){
     // tree its self.
     cout << "Reading Geometry informaton from Geant3 common blocks" << endl;
     for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
-    for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++) 
-       itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
+    for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++)
+        strncpy((char*) &itsGeomTreeNames[i][j],names[i][j],4); 
+    // itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
     mod = 0;
     for(i=0;i<nlayers;i++){
        k = 1;
@@ -5128,6 +5138,7 @@ void AliITSvPPRasymmFMD::InitAliITSgeom(){
            break;
        } // end switch
     } // end for lay
+//#endif
     return;
 }
 //______________________________________________________________________
@@ -5143,7 +5154,7 @@ void AliITSvPPRasymmFMD::Init(){
 
     cout << endl;
     for(i=0;i<26;i++) cout << "*";
-    cout << " ITSvPPRasymm" << fMinorVersion << "_Init ";
+    cout << " ITSvPPRasymmFMD" << fMinorVersion << "_Init ";
     for(i=0;i<25;i++) cout << "*";cout << endl;
     //
     if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
@@ -5151,7 +5162,7 @@ void AliITSvPPRasymmFMD::Init(){
     if(fITSgeom!=0) delete fITSgeom;
     fITSgeom = new AliITSgeom();
     if(fGeomDetIn) fITSgeom->ReadNewFile(fRead);
-    if(!fGeomDetIn) this->InitAliITSgeom();
+    else this->InitAliITSgeom();
     if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
     AliITS::Init();
     //
@@ -5325,18 +5336,26 @@ void AliITSvPPRasymmFMD::StepManager(){
     TLorentzVector position, momentum;
     static TLorentzVector position0;
     static Int_t stat0=0;
-    if((id=gMC->CurrentVolID(copy) == fIDMother)&&
-       (gMC->IsTrackEntering()||gMC->IsTrackExiting())){
+
+    if(!(this->IsActive())){
+       return;
+    } // end if !Active volume.
+
+    if(!(gMC->TrackCharge())) return;
+
+    id=gMC->CurrentVolID(copy);
+
+    Bool_t sensvol = kFALSE;
+    for(Int_t kk=0;kk<6;kk++)if(id == fIdSens[kk])sensvol=kTRUE;
+    if(sensvol && (gMC->IsTrackExiting())){
        copy = fTrackReferences->GetEntriesFast();
        TClonesArray &lTR = *fTrackReferences;
        // Fill TrackReference structure with this new TrackReference.
-       new(lTR[copy]) AliTrackReference(gAlice->CurrentTrack());
+       new(lTR[copy]) AliTrackReference(gAlice->GetCurrentTrackNumber());
     } // if Outer ITS mother Volume
-    if(!(this->IsActive())){
-       return;
-    } // end if !Active volume.
+
+
     Int_t   copy1,copy2;  
-//    Float_t hits[8];
     Int_t   vol[5];
     TClonesArray &lhits = *fHits;
     //
@@ -5413,24 +5432,14 @@ void AliITSvPPRasymmFMD::StepManager(){
     //
     gMC->TrackPosition(position);
     gMC->TrackMomentum(momentum);
-/*
-    hits[0]=position[0];
-    hits[1]=position[1];
-    hits[2]=position[2];
-    hits[3]=momentum[0];
-    hits[4]=momentum[1];
-    hits[5]=momentum[2];
-    hits[6]=gMC->Edep();
-    hits[7]=gMC->TrackTime();
-*/
     vol[4] = stat0;
     if(gMC->IsTrackEntering()){
        position0 = position;
        stat0 = vol[3];
+       return;
     } // end if IsEntering
     // Fill hit structure with this new hit.
-//    new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
-    new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,
+    new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,
                                   gMC->Edep(),gMC->TrackTime(),position,
                                   position0,momentum);
     //