]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSvPPRasymmFMD.cxx
trigger with new coordinate system in MUONdisplay
[u/mrichter/AliRoot.git] / ITS / AliITSvPPRasymmFMD.cxx
index 988b9218b3ea4b2f0dddbb9d586a357a93db3d75..8445ec7a52b8459df825fcc560ebd4023a03aeeb 100644 (file)
@@ -75,6 +75,8 @@
 #include "AliRun.h"
 #include "AliTrackReference.h"
 
+#define GEANTGEOMETRY kTRUE
+
 ClassImp(AliITSvPPRasymmFMD)
  
 //______________________________________________________________________
@@ -93,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) 
@@ -115,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";
@@ -127,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();
@@ -138,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.
@@ -4994,7 +5000,7 @@ void AliITSvPPRasymmFMD::InitAliITSgeom(){
     //   none.
     // Return:
     //   none.
-
+//#if GEANTGEOMETRY
     if(strcmp(gMC->GetName(),"TGeant3")) {
        Error("InitAliITSgeom",
              "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
@@ -5054,8 +5060,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;
@@ -5127,6 +5134,7 @@ void AliITSvPPRasymmFMD::InitAliITSgeom(){
            break;
        } // end switch
     } // end for lay
+//#endif
     return;
 }
 //______________________________________________________________________
@@ -5142,7 +5150,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);
@@ -5150,7 +5158,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();
     //
@@ -5324,16 +5332,25 @@ 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->GetCurrentTrackNumber());
     } // if Outer ITS mother Volume
-    if(!(this->IsActive())){
-       return;
-    } // end if !Active volume.
+
+
     Int_t   copy1,copy2;  
     Int_t   vol[5];
     TClonesArray &lhits = *fHits;