]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSvPPRasymmFMD.cxx
Completely reengineered version of CMake build system (Johny)
[u/mrichter/AliRoot.git] / ITS / AliITSvPPRasymmFMD.cxx
index 05c9487a779da5a0baa85d88368b6d7502834b6b..ba3267e8a4ec664cfa95c75d5c99bf997ad75a44 100644 (file)
 
 // See AliITSvPPRasymmFMD::StepManager().
 
-#include <TClonesArray.h>
-#include <TGeometry.h>
-#include <TLorentzVector.h>
-#include <TGeoMatrix.h>
-#include <TGeoPhysicalNode.h>
 #include <TArrayD.h>
 #include <TArrayF.h>
-#include <TString.h>
-#include <TNode.h>
-#include <TTUBE.h>
+#include <TClonesArray.h>
+#include <TGeoGlobalMagField.h>
 #include <TGeoManager.h>
+#include <TGeoMatrix.h>
+#include <TGeoPhysicalNode.h>
 #include <TGeoVolume.h>
+#include <TLorentzVector.h>
+#include <TString.h>
 #include <TVirtualMC.h>
 
 #include "AliITS.h"
@@ -73,15 +71,10 @@ ClassImp(AliITSvPPRasymmFMD)
 //______________________________________________________________________
 AliITSvPPRasymmFMD::AliITSvPPRasymmFMD():
 AliITS(),                    // Default AliITS Constructor
-fGeomDetOut(kFALSE),         // Flag to write .det file out
-fGeomDetIn(kFALSE),          // Flag to read .det file or directly from Geat.
 fByThick(kTRUE),             // Flag to use services materials by thickness
                              // ture, or mass false.
 fMajorVersion(IsVersion()),  // Major version number == IsVersion
 fMinorVersion(2),           // Minor version number
-fEuclidGeomDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"),// file where detector transormation are define.
-fRead("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm.det"),//! file name to read .det file
-fWrite("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"),//! file name to write .det file
 fDet1(200.0),     // thickness of detector in SPD layer 1 [microns]
 fDet2(200.0),     // thickness of detector in SPD layer 2 [microns]
 fChip1(150.0),    // thickness of chip in SPD layer 1 [microns]
@@ -105,15 +98,10 @@ fIgm((AliITSVersion_t)fMajorVersion,fMinorVersion)//! Get access to decoding
 //______________________________________________________________________
 AliITSvPPRasymmFMD::AliITSvPPRasymmFMD(const Char_t *title):
 AliITS(title),               // Standard AliITS Constructor
-fGeomDetOut(kFALSE),         // Flag to write .det file out
-fGeomDetIn(kFALSE),          // Flag to read .det file or directly from Geat.
 fByThick(kTRUE),             // Flag to use services materials by thickness
                              // ture, or mass false.
 fMajorVersion(IsVersion()),  // Major version number == IsVersion
 fMinorVersion(2),            // Minor version number
-fEuclidGeomDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"),// file where detector transormation are define.
-fRead("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm.det"),//! file name to read .det file
-fWrite("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"),//! file name to write .det file
 fDet1(200.0),     // thickness of detector in SPD layer 1 [microns]
 fDet2(200.0),     // thickness of detector in SPD layer 2 [microns]
 fChip1(150.0),    // thickness of chip in SPD layer 1 [microns]
@@ -155,15 +143,10 @@ fIgm((AliITSVersion_t)fMajorVersion,fMinorVersion)//! Get access to decoding
 //______________________________________________________________________
 AliITSvPPRasymmFMD::AliITSvPPRasymmFMD(const char *name, const char *title):
 AliITS(name,title),          // Extended AliITS Constructor
-fGeomDetOut(kFALSE),         // Flag to write .det file out
-fGeomDetIn(kFALSE),          // Flag to read .det file or directly from Geat.
 fByThick(kTRUE),             // Flag to use services materials by thickness
                              // ture, or mass false.
 fMajorVersion(IsVersion()),  // Major version number == IsVersion
 fMinorVersion(2),            // Minor version number
-fEuclidGeomDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"),// file where detector transormation are define.
-fRead("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm.det"),//! file name to read .det file
-fWrite("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"),//! file name to write .det file
 fDet1(200.0),     // thickness of detector in SPD layer 1 [microns]
 fDet2(200.0),     // thickness of detector in SPD layer 2 [microns]
 fChip1(150.0),    // thickness of chip in SPD layer 1 [microns]
@@ -213,18 +196,13 @@ fIgm((AliITSVersion_t)fMajorVersion,fMinorVersion)//! Get access to decoding
 //______________________________________________________________________
 AliITSvPPRasymmFMD::AliITSvPPRasymmFMD(const AliITSvPPRasymmFMD &source):
 AliITS(source.GetName(),source.GetTitle()),// Extended AliITS Constructor
-fGeomDetOut(source.GetWriteDet()),// Flag to write .det file out
-fGeomDetIn(source.GetReadDet()),  // Flag to read .det file or directly 
                                   // from Geat.
 fByThick(source.IsDensityServicesByThickness()),// Flag to use services 
                                                 // materials by thickness
                                                 // ture, or mass false.
 fMajorVersion(source.IsVersion()),  // Major version number == IsVersion
 fMinorVersion(source.GetMinorVersion()),// Minor version number
-fEuclidGeomDet(source.GetEuclidFile()),// file where detector transormation 
                                        // are define.
-fRead(source.GetReadDetFileName()),  //! file name to read .det file
-fWrite(source.GetWriteDetFileName()),//! file name to write .det file
 fDet1(source.GetThicknessDet1()),//thickness of detector in SPD layer 1[micron]
 fDet2(source.GetThicknessDet2()),//thickness of detector in SPD layer 2[micron]
 fChip1(source.GetThicknessChip1()),//thickness of chip in SPD layer 1 [microns]
@@ -395,7 +373,7 @@ void AliITSvPPRasymmFMD::AddAlignableVolumes() const
 
            matLtoT->SetDy(-fChip1*0.0001/2.);
            matLtoT->SetDz(-gtrans[2]);
-           rotMatrix[0]= 0;  rotMatrix[1]= 1;  rotMatrix[2]= 0; // + rotation
+           rotMatrix[0]= 0;  rotMatrix[1]=-1;  rotMatrix[2]= 0; // + rotation
            rotMatrix[3]=-1;  rotMatrix[4]= 0;  rotMatrix[5]= 0; // ! flip in y for the SPD1 only
            rotMatrix[6]= 0;  rotMatrix[7]= 0;  rotMatrix[8]=-1;
            TGeoRotation rot;
@@ -732,63 +710,6 @@ void AliITSvPPRasymmFMD::AddAlignableVolumes() const
   }
 }
 
-//______________________________________________________________________
-void AliITSvPPRasymmFMD::BuildGeometry(){
-    //    Geometry builder for the ITS version 10. Event Display geometry.
-    // Inputs:
-    //   none.
-    // Outputs:
-    //   none.
-    // Return:
-    //   none.
-
-    TNode *node, *top;
-    
-    const Int_t kColorITS=kYellow;
-    //
-    top = gAlice->GetGeometry()->GetNode("alice");
-
-
-    new TTUBE("S_layer1","Layer1 of ITS","void",
-             3.8095,3.8095+1.03*9.36/100.,14.35);
-    top->cd();
-    node = new TNode("Layer1","Layer1","S_layer1",0,0,0,"");
-    node->SetLineColor(kColorITS);
-    fNodes->Add(node);
-
-    new TTUBE("S_layer2","Layer2 of ITS","void",7.,7.+1.03*9.36/100.,14.35);
-    top->cd();
-    node = new TNode("Layer2","Layer2","S_layer2",0,0,0,"");
-    node->SetLineColor(kColorITS);
-    fNodes->Add(node);
-
-    new TTUBE("S_layer3","Layer3 of ITS","void",15.,15.+0.94*9.36/100.,25.1);
-    top->cd();
-    node = new TNode("Layer3","Layer3","S_layer3",0,0,0,"");
-    node->SetLineColor(kColorITS);
-    fNodes->Add(node);
-
-    new TTUBE("S_layer4","Layer4 of ITS","void",24.1,24.1+0.95*9.36/100.,32.1);
-    top->cd();
-    node = new TNode("Layer4","Layer4","S_layer4",0,0,0,"");
-    node->SetLineColor(kColorITS);
-    fNodes->Add(node);
-
-    new TTUBE("S_layer5","Layer5 of ITS","void",
-             38.5,38.5+0.91*9.36/100.,49.405);
-    top->cd();
-    node = new TNode("Layer5","Layer5","S_layer5",0,0,0,"");
-    node->SetLineColor(kColorITS);
-    fNodes->Add(node);
-
-    new TTUBE("S_layer6","Layer6 of ITS","void",
-             43.5765,43.5765+0.87*9.36/100.,55.27);
-    top->cd();
-    node = new TNode("Layer6","Layer6","S_layer6",0,0,0,"");
-    node->SetLineColor(kColorITS);
-    fNodes->Add(node);
-}
-
 //______________________________________________________________________
 void AliITSvPPRasymmFMD::CreateGeometry(){
     //    This routine defines and Creates the geometry for version 10 of 
@@ -5130,11 +5051,6 @@ void AliITSvPPRasymmFMD::CreateGeometry(){
 
   // --- Outputs the geometry tree in the EUCLID/CAD format 
   
-  if (fEuclidOut) {
-    gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
-  }
-
-
   {
     if (!gGeoManager) {
       AliError("TGeoManager doesn't exist !");
@@ -5370,8 +5286,8 @@ void AliITSvPPRasymmFMD::CreateMaterials(){
     // Return:
     //   none.
 
-    Int_t   ifield = gAlice->Field()->Integ();
-    Float_t fieldm = gAlice->Field()->Max();
+    Int_t   ifield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+    Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
 
     Float_t tmaxfd = 0.1; // 1.0; // Degree
     Float_t stemax = 1.0; // cm
@@ -6000,16 +5916,12 @@ void AliITSvPPRasymmFMD::Init(){
                 fMinorVersion));
     //
     /*  obsolete initialization of AliITSgeom from external "det" file
-    if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
-    if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
     AliITSgeom* geom = new AliITSgeom();
     SetITSgeom(geom);
-    if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead);
     else this->InitAliITSgeom();
     */
     UpdateInternalGeometry();
     AliITS::Init();
-    if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite);
 
     //
     fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID.
@@ -6025,92 +5937,13 @@ void AliITSvPPRasymmFMD::SetDefaults(){
     // Return:
     //   none.
 
-    const Float_t kconv = 1.0e+04; // convert cm to microns
-
     if(!fDetTypeSim){
        Warning("SetDefaults","Error fDetTypeSim not defined");
        return;
     }
 
-    AliITSgeomSPD  *s0;
-    AliITSgeomSDD  *s1;
-    AliITSgeomSSD  *s2;
-    Int_t i;
-    Float_t bx[256],bz[280];
-
     fDetTypeSim->SetDefaults();
     
-    //SPD
-    s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);
-    // Get shape info. Do it this way for now.
-    //AliITSCalibrationSPD* resp0=new AliITSCalibrationSPD();
-    AliITSsegmentationSPD* seg0 = 
-       (AliITSsegmentationSPD*)fDetTypeSim->GetSegmentationModel(0);
-    seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
-                    s0->GetDz()*2.*kconv, // for now.
-                    s0->GetDy()*2.*kconv); // x,z,y full width in microns.
-    seg0->SetNPads(256,160);// Number of Bins in x and z
-    for(i=000;i<256;i++) bx[i] =  50.0; // in x all are 50 microns.
-    for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
-    for(i=160;i<280;i++) bz[i] =   0.0; // Outside of detector.
-    bz[ 31] = bz[ 32] = 625.0; // first chip boundry
-    bz[ 63] = bz[ 64] = 625.0; // first chip boundry
-    bz[ 95] = bz[ 96] = 625.0; // first chip boundry
-    bz[127] = bz[128] = 625.0; // first chip boundry
-    bz[160] = 425.0; // Set so that there is no zero pixel size for fNz.
-    seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
-    SetSegmentationModel(kSPD,seg0);
-    // set digit and raw cluster classes to be used
-    const char *kData0=(fDetTypeSim->GetCalibrationModel(
-                           GetITSgeom()->GetStartSPD()))->DataType();
-    if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,
-                                                             "AliITSdigit");
-    else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
-    // SDD
-    s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);
-    // Get shape info. Do it this way for now.
-
-    //AliITSCalibrationSDD* resp1=new AliITSCalibrationSDD("simulated");
-    AliITSsegmentationSDD* seg1 = 
-       (AliITSsegmentationSDD*)fDetTypeSim->GetSegmentationModel(1);
-    seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD
-                    s1->GetDz()*2.*kconv, // for now.
-                    s1->GetDy()*2.*kconv); // x,z,y full width in microns.
-    seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
-    SetSegmentationModel(kSDD,seg1);
-    const char *kData1=(fDetTypeSim->GetCalibrationModel(
-                           GetITSgeom()->GetStartSDD()))->DataType();
-    AliITSCalibrationSDD* rsp = 
-       (AliITSCalibrationSDD*)fDetTypeSim->GetCalibrationModel(
-           GetITSgeom()->GetStartSDD());
-    const char *kopt=rsp->GetZeroSuppOption();
-    if((!strstr(kopt,"ZS")) || strstr(kData1,"real") ){
-       fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit");
-    } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD");
-    // SSD  Layer 5
-
-    s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);
-    // Get shape info. Do it this way for now.
-
-
-    //SetCalibrationModel(GetITSgeom()->GetStartSSD(),
-    // new AliITSCalibrationSSD("simulated"));
-    AliITSsegmentationSSD* seg2 = 
-       (AliITSsegmentationSSD*)fDetTypeSim->GetSegmentationModel(2);
-    seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD
-                    s2->GetDz()*2.*kconv, // for now.
-                    s2->GetDy()*2.*kconv); // x,z,y full width in microns.
-    seg2->SetPadSize(95.,0.); // strip x pitch in microns
-    seg2->SetNPads(768,0); // number of strips on each side.
-    seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
-    seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
-    seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
-    SetSegmentationModel(kSSD,seg2); 
-        const char *kData2=(fDetTypeSim->GetCalibrationModel(
-                               GetITSgeom()->GetStartSSD()))->DataType();
-    if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,
-                                                             "AliITSdigit");
-    else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
     if(fgkNTYPES>3){
        Warning("SetDefaults",
                "Only the four basic detector types are initialised!");
@@ -6496,11 +6329,8 @@ void AliITSvPPRasymmFMD::PrintAscii(ostream *os)const{
 #endif
 #endif
 
-    *os << fGeomDetOut << " " << fGeomDetIn << " " << fByThick << " ";
+    *os << fByThick << " ";
     *os << fMajorVersion << " " << fMinorVersion << " ";
-    *os << "\"" << fEuclidGeomDet.Data() << "\"" << " ";
-    *os << "\"" << fRead.Data() << "\"" << " ";
-    *os << "\"" << fWrite.Data() << "\"" << " ";
     fmt = os->setf(ios::scientific); // set scientific floating point output
     *os << fDet1 << " "  << fDet2 << " " << fChip1 << " " << fChip2 << " ";
     *os << fRails << " " << fFluid << " " << fIDMother;
@@ -6517,16 +6347,9 @@ void AliITSvPPRasymmFMD::ReadAscii(istream *is){
     //   none.
     // Return:
     //   none.
-    Char_t name[120];
 
-    *is >> fGeomDetOut >> fGeomDetIn >> fByThick;
+    *is >> fByThick;
     *is >> fMajorVersion >> fMinorVersion;
-    *is >> name;
-    fEuclidGeomDet = name;
-    *is >> name;
-    fRead = name;
-    *is >> name;
-    fWrite = name;
     *is >> fDet1 >> fDet2 >> fChip1 >> fChip2;
     *is >> fRails >> fFluid >> fIDMother;
     fIgm.SetVersion((AliITSVersion_t)fMajorVersion,fMinorVersion);