]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSvPPRsymm.cxx
Bug fixed in the StepManager to account for the difference in the geometry tree for...
[u/mrichter/AliRoot.git] / ITS / AliITSvPPRsymm.cxx
index 25909e6e6fefd8e80d0c7370040dc18cd7077c9d..154406d06a3f1a93af994d91d9adf3c23f68a28d 100644 (file)
@@ -1,4 +1,4 @@
-/**************************************************************************
+ /**************************************************************************
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
  * Author: The ALICE Off-line Project.                                    *
 
 /*
 $Log$
+Revision 1.21  2001/05/10 00:12:59  nilsen
+Finished fixing up the default segmentation for the PPR geometry.
+
+Revision 1.20  2001/05/09 01:02:22  nilsen
+Finished fixing SetDefaults for the segmentation of SPD, SDD, and SSD.
+
+Revision 1.19  2001/05/03 08:40:15  barbera
+Volume ITSD slightly modified to be consistent with v5. Some improvement in the printouts. The last commit did not complete successfully.
+
+Revision 1.17  2001/05/01 22:40:42  nilsen
+Partical update of SetDefault.
+
+Revision 1.16  2001/04/22 13:48:09  barbera
+New values of media parameters and thickness of SPD end-ladder electronics as given by Fabio Formenti
+
+Revision 1.15  2001/04/04 07:02:16  barbera
+Position of the cylinders holding rails corrected
+
+Revision 1.14  2001/03/29 22:02:30  barbera
+Some changes to the services due to the new drawings from the engineers.
+
 Revision 1.13  2001/03/29 05:28:56  barbera
 Rails material changed from aluminum to carbon fiber according with the decision of the last Technical Board
 
@@ -178,6 +199,16 @@ Introduction of the Copyright and cvs Log
 #include "AliITSgeomSPD.h"
 #include "AliITSgeomSDD.h"
 #include "AliITSgeomSSD.h"
+#include "AliITSDetType.h"
+#include "AliITSresponseSPD.h"
+#include "AliITSresponseSDD.h"
+#include "AliITSresponseSSD.h"
+#include "AliITSsegmentationSPD.h"
+#include "AliITSsegmentationSDD.h"
+#include "AliITSsegmentationSSD.h"
+#include "AliITSClusterFinderSPD.h"
+#include "AliITSClusterFinderSDD.h"
+#include "AliITSClusterFinderSSD.h"
 
 
 ClassImp(AliITSvPPRsymm)
@@ -352,25 +383,25 @@ void AliITSvPPRsymm::CreateGeometry(){
   dchip2 = GetThicknessChip2();    
 
   if(ddet1 < 100. || ddet1 > 300.) {
-     cout << "WARNING: the detector thickness for layer 1 is outside the range of [100,300] microns."
+     cout << "ITS - WARNING: the detector thickness for layer 1 is outside the range of [100,300] microns."
          " The default value of 300 microns will be used." << endl;
          ddet1=300.;
   }
   
   if(ddet2 < 100. || ddet2 > 300.) {
-     cout << "WARNING: the detector thickness for layer 2 is outside the range of [100,300] microns."
+     cout << "ITS - WARNING: the detector thickness for layer 2 is outside the range of [100,300] microns."
          " The default value of 300 microns will be used." << endl;
          ddet2=300.;
   }
   
   if(dchip1 < 150. || dchip1 > 300.) {
-     cout << "WARNING: the chip thickness for layer 1 is outside the range of [150,300] microns."
+     cout << "ITS - WARNING: the chip thickness for layer 1 is outside the range of [150,300] microns."
          " The default value of 300 microns will be used." << endl;
          dchip1=300.;
   }
   
   if(dchip2 < 150. || dchip2 > 300.) {
-     cout << "WARNING: the chip thickness for layer 2 is outside the range of [150,300] microns."
+     cout << "ITS - WARNING: the chip thickness for layer 2 is outside the range of [150,300] microns."
          " The default value of 300 microns will be used." << endl;
          dchip2=300.;
   }      
@@ -384,29 +415,29 @@ void AliITSvPPRsymm::CreateGeometry(){
   fluid = GetCoolingFluid();
 
   if(rails != 0 && rails != 1) {
-     cout << "WARNING: the switch for rails is not set neither to 0 (rails out) nor to 1 (rails in)." 
+     cout << "ITS - WARNING: the switch for rails is not set neither to 0 (rails out) nor to 1 (rails in)." 
      " The default value of 1 (rails in) will be used." << endl;
        
   }  
   
   if(fluid != 0 && fluid != 1) {
-     cout << "WARNING: the switch for cooling fluid is not set neither to 0 (freon) nor to 1 (water)." 
+     cout << "ITS - WARNING: the switch for cooling fluid is not set neither to 0 (freon) nor to 1 (water)." 
      " The default value of 1 (water) will be used." << endl;  
   }       
    
-  cout << "Detector thickness on layer 1 is set to " << ddet1 << " microns." << endl;
-  cout << "Chip thickness on layer 1 is set to " << dchip1 << " microns." << endl;
-  cout << "Detector thickness on layer 2 is set to " << ddet2 << " microns." << endl;
-  cout << "Chip thickness on layer 2 is set to " << dchip2 << " microns." << endl;
+  cout << "ITS: Detector thickness on layer 1 is set to " << ddet1 << " microns." << endl;
+  cout << "ITS: Chip thickness on layer 1 is set to " << dchip1 << " microns." << endl;
+  cout << "ITS: Detector thickness on layer 2 is set to " << ddet2 << " microns." << endl;
+  cout << "ITS: Chip thickness on layer 2 is set to " << dchip2 << " microns." << endl;
   if(rails == 0 ) {
-     cout << "Rails are out." << endl; 
+     cout << "ITS: Rails are out." << endl; 
   } else {
-     cout << "Rails are in." << endl;
+     cout << "ITS: Rails are in." << endl;
   }   
   if(fluid == 0 ) {
-     cout << "The cooling fluid is freon." << endl; 
+     cout << "ITS: The cooling fluid is freon." << endl; 
   } else {
-     cout << "The cooling fluid is water." << endl;
+     cout << "ITS: The cooling fluid is water." << endl;
   }   
 
   ddet1  = ddet1*0.0001/2.; // conversion from tot length in um to half in cm
@@ -930,7 +961,7 @@ void AliITSvPPRsymm::CreateGeometry(){
     
   //     FIELD CAGE HALF LENGTH 
   
-  rlim  = 56.;
+  rlim  = 50.;
   zmax  = 74.;
   ztpc = 284.;
   
@@ -951,34 +982,34 @@ void AliITSvPPRsymm::CreateGeometry(){
   dgh[11] = 62+4.;
   dgh[12] = -97.5;
   dgh[13] = 46;
-  dgh[14] = rlim+0.1;
+  dgh[14] = rlim+6;
   dgh[15] = -zmax;
   dgh[16] = 46;
-  dgh[17] = rlim+0.1;
+  dgh[17] = rlim+6;
   dgh[18] = -48;
   dgh[19] = 6;
-  dgh[20] = rlim+0.1
+  dgh[20] = rlim+6
   dgh[21] = -28.6;
   dgh[22] = 6;
-  dgh[23] = rlim+0.1;
+  dgh[23] = rlim+6;
   dgh[24] = -27.6;
   dgh[25] = 3.295;
-  dgh[26] = rlim+0.1;
+  dgh[26] = rlim+6;
   dgh[27] = 27.6;
   dgh[28] = 3.295;
-  dgh[29] = rlim+0.1;
+  dgh[29] = rlim+6;
   dgh[30] = 28.6;
   dgh[31] = 6;
-  dgh[32] = rlim+0.1;
+  dgh[32] = rlim+6;
   dgh[33] = 48;
   dgh[34] = 6;
-  dgh[35] = rlim+0.1;
+  dgh[35] = rlim+6;
   dgh[36] = zmax;
   dgh[37] = 46;
-  dgh[38] = rlim+0.1;
+  dgh[38] = rlim+6;
   dgh[39] = 97.5;
   dgh[40] = 46;
-  dgh[41] = rlim+0.1;
+  dgh[41] = rlim+6;
   dgh[42] = ztpc;
   dgh[43] = 62;
   dgh[44] = 62+4.;
@@ -1216,9 +1247,9 @@ void AliITSvPPRsymm::CreateGeometry(){
      gMC->Gsvolu("I103", "BOX ", idtmed[254], di103, 3); // contains det and chip  
                                                          // layer 1
      dits[0] = 0.793;
-     dits[1] = 0.015;
+     dits[1] = 0.475;  //0.685; 0.015
      dits[2] = 2.5;
-     gMC->Gsvolu("I105", "BOX ", idtmed[201], dits, 3);  
+     gMC->Gsvolu("I105", "BOX ", idtmed[290], dits, 3);  
 
      di104[0] = 0.843;
      di104[1] = dbus;
@@ -1630,9 +1661,9 @@ void AliITSvPPRsymm::CreateGeometry(){
      gMC->Gsvolu("I124", "TUBS", idtmed[253], dits, 5);  
 
      dits[0] = 0.793;
-     dits[1] = 0.015 ;
+     dits[1] = 0.475;  //0.685; 0.015
      dits[2] = 2.5;
-     gMC->Gsvolu("I105", "BOX ", idtmed[201], dits, 3);  
+     gMC->Gsvolu("I105", "BOX ", idtmed[290], dits, 3);  
 
      di107[0] = 0.793;
      di107[1] = ddet1+dchip1;
@@ -4419,8 +4450,8 @@ void AliITSvPPRsymm::CreateGeometry(){
   dgh[1] = 59.;
   dgh[2] = 0.6;    
   gMC->Gsvolu("ICYL", "TUBE", idtmed[210], dgh, 3);   
-  gMC->Gspos("ICYL", 1, "ALIC", 0., 0., 73.4, 0, "ONLY");       
-  gMC->Gspos("ICYL", 2, "ALIC", 0., 0., -73.4, idrotm[200], "ONLY");  
+  gMC->Gspos("ICYL", 1, "ALIC", 0., 0., 74.1, 0, "ONLY");       
+  gMC->Gspos("ICYL", 2, "ALIC", 0., 0., -74.1, idrotm[200], "ONLY");  
 
   // --- DEFINE SUPPORTS FOR RAILS ATTACHED TO THE CYLINDERS
 
@@ -4647,7 +4678,7 @@ void AliITSvPPRsymm::CreateMaterials(){
   AliMaterial(90,"SPD shield$", 12.011, 6., 1.93/10. , 22.1*10., 999);
   AliMedium(90,"SPD shield$",90, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
 
-  AliMaterial(91, "SPD End ladder$", 55.845, 26., 7.87/10., 1.76*10., 999); 
+  AliMaterial(91, "SPD End ladder$", 47.0447, 21.7963, 3.6374, 4.4711, 999); 
   AliMedium(91, "SPD End ladder$",91, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
 
   AliMaterial(92, "SPD cone$",28.0855, 14., 2.33, 9.36, 999);    
@@ -4765,7 +4796,7 @@ void AliITSvPPRsymm::InitAliITSgeom(){
                        fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
                        if(!(fITSgeom->IsShapeDefined((Int_t)kSPD)))
                              fITSgeom->ReSetShape(kSPD,
-                                                 new AliITSgeomSPD425Short());
+                                        new AliITSgeomSPD425Short(npar,par));
                    } // end for det
                } // end for k
             } // end for j
@@ -4783,19 +4814,20 @@ void AliITSvPPRsymm::InitAliITSgeom(){
                    case 3: case 4:
                        fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
                        if(!(fITSgeom->IsShapeDefined(kSDD))) 
-                           fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD256());
+                           fITSgeom->ReSetShape(kSDD,
+                                             new AliITSgeomSDD256(npar,par));
                            break;
                        case 5:
                            fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
                            if(!(fITSgeom->IsShapeDefined(kSSD))) 
                                fITSgeom->ReSetShape(kSSD,
-                                                  new AliITSgeomSSD275and75());
+                                         new AliITSgeomSSD275and75(npar,par));
                            break;
                        case 6:
                            fITSgeom->CreatMatrix(mod,lay,lad,det,kSSDp,t,r);
                            if(!(fITSgeom->IsShapeDefined(kSSDp))) 
                                fITSgeom->ReSetShape(kSSDp,
-                                                  new AliITSgeomSSD75and275());
+                                          new AliITSgeomSSD75and275(npar,par));
                            break;
                        } // end switch
                } // end for det
@@ -4830,6 +4862,97 @@ void AliITSvPPRsymm::Init(){
     cout << endl;
 }
 //_____________________________________________________________________________
+void AliITSvPPRsymm::SetDefaults(){
+    // sets the default segmentation, response, digit and raw cluster classes
+    const Float_t kconv = 1.0e+04; // convert cm to microns
+
+    cout << "AliITSvPPRasymm::SetDefaults" << endl;
+
+    AliITSDetType *iDetType;
+    AliITSgeomSPD  *s0;
+    AliITSgeomSDD  *s1;
+    AliITSgeomSSD  *s2;
+    Int_t i;
+    Float_t bx[256],bz[280];
+
+    //SPD
+    iDetType=DetType(0);
+    s0 = (AliITSgeomSPD*) fITSgeom->GetShape(kSPD);// Get shape info. Do it this way for now.
+    AliITSresponse *resp0=new AliITSresponseSPD();
+    SetResponseModel(0,resp0);
+    AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(fITSgeom);
+    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(0,seg0);
+    // set digit and raw cluster classes to be used
+    const char *kData0=(iDetType->GetResponseModel())->DataType();
+    if (strstr(kData0,"real")) iDetType->ClassNames("AliITSdigit",
+                                                   "AliITSRawClusterSPD");
+    else iDetType->ClassNames("AliITSdigitSPD","AliITSRawClusterSPD");
+    //iDetType->SimulationModel(new AliITSsimulationSPD(seg0,resp0));
+    //iDetType->ReconstructionModel(new AliITSClusterFinderSPD());
+
+    // SDD
+    iDetType=DetType(1);
+    s1 = (AliITSgeomSDD*) fITSgeom->GetShape(kSDD);// Get shape info. Do it this way for now.
+    AliITSresponseSDD *resp1=new AliITSresponseSDD();
+    resp1->SetDriftSpeed(7.3); // set drift speed to 7.3 microns/ns.
+    SetResponseModel(1,resp1);
+    AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(fITSgeom,resp1);
+    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.
+    bx[0] = 1000./((s1->GetDx()*kconv/seg1->Dpx(0))/resp1->DriftSpeed()); // clock in Mhz
+    seg1->SetNPads(256,bx[0]);// Use AliITSgeomSDD for now
+    SetSegmentationModel(1,seg1);
+    const char *kData1=(iDetType->GetResponseModel())->DataType();
+    const char *kopt=iDetType->GetResponseModel()->ZeroSuppOption();
+    if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){
+       iDetType->ClassNames("AliITSdigit","AliITSRawClusterSDD");
+    } else iDetType->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD");
+    //iDetType->SimulationModel(new AliITSsimulationSDD(seg1,resp1));
+    //iDetType->ReconstructionModel(new AliITSClusterFinderSDD());
+
+    // SSD  Layer 5
+    iDetType=DetType(2);
+    s2 = (AliITSgeomSSD*) fITSgeom->GetShape(kSSD);// Get shape info. Do it this way for now.
+    AliITSresponse *resp2=new AliITSresponseSSD();
+    SetResponseModel(2,resp2);
+    AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(fITSgeom);
+    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(2,seg2); 
+    const char *kData2=(iDetType->GetResponseModel())->DataType();
+    if(strstr(kData2,"real") ) iDetType->ClassNames("AliITSdigit",
+                                                   "AliITSRawClusterSSD");
+    else iDetType->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD");
+    //iDetType->SimulationModel(new AliITSsimulationSSD(seg2,resp2));
+    //iDetType->ReconstructionModel(new AliITSClusterFinderSSD());
+
+    if(kNTYPES>3){
+       Warning("SetDefaults",
+               "Only the four basic detector types are initialised!");
+    }// end if
+    return;
+}
+//_____________________________________________________________________________
 void AliITSvPPRsymm::DrawModule(){
 ////////////////////////////////////////////////////////////////////////
 //     Draw a shaded view of the FMD version 9.
@@ -4912,22 +5035,22 @@ void AliITSvPPRsymm::StepManager(){
   // Only entering charged tracks
   if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
       vol[0] = 1;
-      id = gMC->CurrentVolOffID(0,copy);
+      id = gMC->CurrentVolOffID(2,copy);
       //detector copy in the ladder = 1<->4  (ITS1 < I101 < I103 < I10A)
       vol[1] = copy;
-      gMC->CurrentVolOffID(1,copy1);
+      gMC->CurrentVolOffID(3,copy1);
       //ladder copy in the module   = 1<->2  (I10A < I12A)
-      gMC->CurrentVolOffID(2,copy2);
+      gMC->CurrentVolOffID(4,copy2);
       //module copy in the layer    = 1<->10 (I12A < IT12)
       vol[2] = copy1+(copy2-1)*2;//# of ladders in one module  = 2
   } else if(id == fIdSens[1]){
       vol[0] = 2;
-      id = gMC->CurrentVolOffID(0,copy);
+      id = gMC->CurrentVolOffID(2,copy);
       //detector copy in the ladder = 1<->4  (ITS2 < I1D1 < I1D3 < I20A)
       vol[1] = copy;
-      gMC->CurrentVolOffID(1,copy1);
+      gMC->CurrentVolOffID(3,copy1);
       //ladder copy in the module   = 1<->4  (I20A < I12A)
-      gMC->CurrentVolOffID(2,copy2);
+      gMC->CurrentVolOffID(4,copy2);
       //module copy in the layer    = 1<->10 (I12A < IT12)
       vol[2] = copy1+(copy2-1)*4;//# of ladders in one module  = 4
   } else if(id == fIdSens[2]){