]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New protection against noise clusters in not existing modules + bug fix in geometry...
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Nov 2007 14:21:05 +0000 (14:21 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Nov 2007 14:21:05 +0000 (14:21 +0000)
TRD/AliTRDclusterizer.cxx
TRD/AliTRDdigitizer.cxx
TRD/AliTRDgeometry.cxx
TRD/AliTRDgeometry.h
TRD/AliTRDtransform.cxx
TRD/AliTRDtransform.h

index f09db8bffce9453b4884305900e5978d507202e2..cbffe0451bff20324f0f4680123e856d29dd471d 100644 (file)
@@ -983,49 +983,52 @@ Bool_t AliTRDclusterizer::MakeClusters(Int_t det)
           clusterRCT[0] = row;
           clusterRCT[1] = col;
           clusterRCT[2] = 0;
-         fTransform->Transform(clusterXYZ,clusterRCT,((UInt_t) time),0);
-
-         // Add the cluster to the output array
-         // The track indices will be stored later 
-          Float_t clusterPos[3];
-          clusterPos[0] = clusterXYZ[0];
-          clusterPos[1] = clusterXYZ[1];
-          clusterPos[2] = clusterXYZ[2];
-         Float_t clusterSig[2];
-         clusterSig[0] = clusterXYZ[4];
-         clusterSig[1] = clusterXYZ[5];
-          Double_t clusterCharge  = clusterXYZ[3];
-         Char_t   clusterTimeBin = ((Char_t) clusterRCT[2]);
-         AliTRDcluster *cluster = new AliTRDcluster(idet
-                                                   ,clusterCharge
-                                                   ,clusterPos
-                                                   ,clusterSig
-                                                   ,0x0
-                                                   ,((Char_t) nPadCount)
-                                                   ,signals
-                                                   ,((UChar_t) col)
-                                                   ,((UChar_t) row)
-                                                   ,((UChar_t) time)
-                                                   ,clusterTimeBin
-                                                   ,clusterPosCol
-                                                   ,volid);
-
-         // Temporarily store the row, column and time bin of the center pad
-         // Used to later on assign the track indices
-         cluster->SetLabel( row,0);
-         cluster->SetLabel( col,1);
-         cluster->SetLabel(time,2);
-
-         RecPoints()->Add(cluster);
-
-         // Store the index of the first cluster in the current ROC
-         if (firstClusterROC < 0) 
-            {
-             firstClusterROC = RecPoints()->GetEntriesFast() - 1;
-           }
 
-         // Count the number of cluster in the current ROC
-         nClusterROC++;
+         if (fTransform->Transform(clusterXYZ,clusterRCT,((UInt_t) time),0)) {
+
+           // Add the cluster to the output array
+           // The track indices will be stored later 
+            Float_t clusterPos[3];
+            clusterPos[0] = clusterXYZ[0];
+            clusterPos[1] = clusterXYZ[1];
+            clusterPos[2] = clusterXYZ[2];
+           Float_t clusterSig[2];
+           clusterSig[0] = clusterXYZ[4];
+           clusterSig[1] = clusterXYZ[5];
+            Double_t clusterCharge  = clusterXYZ[3];
+           Char_t   clusterTimeBin = ((Char_t) clusterRCT[2]);
+           AliTRDcluster *cluster = new AliTRDcluster(idet
+                                                     ,clusterCharge
+                                                     ,clusterPos
+                                                     ,clusterSig
+                                                     ,0x0
+                                                     ,((Char_t) nPadCount)
+                                                     ,signals
+                                                     ,((UChar_t) col)
+                                                     ,((UChar_t) row)
+                                                     ,((UChar_t) time)
+                                                     ,clusterTimeBin
+                                                     ,clusterPosCol
+                                                     ,volid);
+
+           // Temporarily store the row, column and time bin of the center pad
+           // Used to later on assign the track indices
+           cluster->SetLabel( row,0);
+           cluster->SetLabel( col,1);
+           cluster->SetLabel(time,2);
+
+           RecPoints()->Add(cluster);
+
+           // Store the index of the first cluster in the current ROC
+           if (firstClusterROC < 0) 
+              {
+               firstClusterROC = RecPoints()->GetEntriesFast() - 1;
+             }
+
+           // Count the number of cluster in the current ROC
+           nClusterROC++;
+
+         } // if: Transform ok ?
 
         } // if: Maximum found ?
 
index 2e36683d57216c3dfb2c4a72888536f86c0e9ba1..564cca3cd55434a9da6d72b5bd6706ce38c9cc27 100644 (file)
@@ -1215,7 +1215,7 @@ Bool_t AliTRDdigitizer::MakeDigits()
     // Don't create noise in detectors that are switched off / not installed, etc.
     if (( calibration->IsChamberInstalled(iDet)) &&
         (!calibration->IsChamberMasked(iDet))    &&
-        ( fGeo->GetSMstatus(sector))) {
+        ( fGeo->ChamberInGeometry(iDet))) {
 
       // Get the calibration objects
       calGainFactorROC      = calibration->GetGainFactorROC(iDet);
@@ -1448,7 +1448,7 @@ Bool_t AliTRDdigitizer::ConvertSDigits()
     // Don't create noise in detectors that are switched off / not installed, etc.
     if (( calibration->IsChamberInstalled(iDet)) &&
         (!calibration->IsChamberMasked(iDet))    &&
-        ( fGeo->GetSMstatus(sector))) {
+        ( fGeo->ChamberInGeometry(iDet))) {
 
       // Get the calibration objects
       calGainFactorROC      = calibration->GetGainFactorROC(iDet);
index 2c2cf4a2f1e1372daf293c42f558d9c37f62b144..c3b811635685b34ccbf88485aff6e919468ab1f9 100644 (file)
@@ -1613,6 +1613,17 @@ void AliTRDgeometry::CreateFrame(Int_t *idtmed)
   gMC->Gsposp("UTA2",3,"UTF2",-xpos,ypos,zpos
                     ,matrix[1],"ONLY",parPlt,kNparPlt);
 
+  // Additional aluminum bar
+  parBOX[0] = 80.0/2.0;
+  parBOX[1] =  1.0/2.0;
+  parBOX[2] = 10.0/2.0;
+  gMC->Gsvolu("UTA3","BOX ",idtmed[1301-1],parBOX,kNparBOX);
+  xpos      =  0.0;
+  ypos      =  1.0/2.0 + fgkSMpltT - fgkFlength/2.0;
+  zpos      =  fgkSheight/2.0 - 1.5 - 10.0/2.0;
+  gMC->Gspos("UTA3",1,"UTF1", xpos, ypos, zpos,        0,"ONLY");
+  gMC->Gspos("UTA3",2,"UTF2", xpos,-ypos, zpos,        0,"ONLY");
+
 }
 
 //_____________________________________________________________________________
@@ -2088,6 +2099,44 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed)
   // Services in front of the super module
   //
 
+  // Gas in-/outlet pipes (INOX)
+  parTube[0] = 0.0;
+  parTube[1] = 0.0;
+  parTube[2] = 0.0;
+  gMC->Gsvolu("UTG3","TUBE",idtmed[1308-1],parTube,0);
+  // The gas inside the in-/outlet pipes (Xe)
+  parTube[0] =  0.0;
+  parTube[1] =  1.2/2.0;
+  parTube[2] = -1.0;
+  gMC->Gsvolu("UTG4","TUBE",idtmed[1309-1],parTube,kNparTube);
+  xpos = 0.0;
+  ypos = 0.0;
+  zpos = 0.0;
+  gMC->Gspos("UTG4",1,"UTG3",xpos,ypos,zpos,0,"ONLY");
+  for (iplan = 0; iplan < kNplan-1; iplan++) { 
+    xpos       = 0.0;
+    ypos       = fClength[iplan][2]/2.0 
+               + fClength[iplan][1] 
+               + fClength[iplan][0];
+    zpos       = 9.0 - fgkSheight/2.0
+               + iplan * (fgkCH + fgkVspace);
+    parTube[0] = 0.0;
+    parTube[1] = 1.5/2.0;
+    parTube[2] = fCwidth[iplan]/2.0 - 2.5;
+    gMC->Gsposp("UTG3",iplan+1         ,"UTI1", xpos, ypos, zpos
+                      ,matrix[2],"ONLY",parTube,kNparTube);
+    gMC->Gsposp("UTG3",iplan+1+1*kNplan,"UTI1", xpos,-ypos, zpos
+                      ,matrix[2],"ONLY",parTube,kNparTube);
+    gMC->Gsposp("UTG3",iplan+1+2*kNplan,"UTI2", xpos, ypos, zpos
+                      ,matrix[2],"ONLY",parTube,kNparTube);
+    gMC->Gsposp("UTG3",iplan+1+3*kNplan,"UTI2", xpos,-ypos, zpos
+                      ,matrix[2],"ONLY",parTube,kNparTube);
+    gMC->Gsposp("UTG3",iplan+1+4*kNplan,"UTI3", xpos, ypos, zpos
+                      ,matrix[2],"ONLY",parTube,kNparTube);
+    gMC->Gsposp("UTG3",iplan+1+5*kNplan,"UTI3", xpos,-ypos, zpos
+                      ,matrix[2],"ONLY",parTube,kNparTube);
+  }
+
   // Gas distribution box
   parBox[0] = 14.50/2.0;
   parBox[1] =  4.52/2.0;
@@ -2155,7 +2204,7 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed)
   parTube[0] =  0.0;
   parTube[1] =  3.0/2.0;
   parTube[2] = 18.0/2.0;
-  gMC->Gsvolu("UTCH","TUBE",idtmed[1308-1],parTube,kNparTube);
+  gMC->Gsvolu("UTCO","TUBE",idtmed[1308-1],parTube,kNparTube);
   parTube[0] =  0.0;
   parTube[1] =  3.0/2.0 - 0.3;
   parTube[2] = 18.0/2.0;
@@ -2163,25 +2212,25 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed)
   xpos       =  0.0;
   ypos       =  0.0;
   zpos       =  0.0;
-  gMC->Gspos("UTCL",1,"UTCH", xpos, ypos, zpos,        0,"ONLY");
+  gMC->Gspos("UTCL",1,"UTCO", xpos, ypos, zpos,        0,"ONLY");
   xpos       =  0.0;
   ypos       =  2.5;
   zpos       = -70.0/2.0 + 7.0;
-  gMC->Gspos("UTCH",1,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
+  gMC->Gspos("UTCO",1,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
   zpos      +=  7.0;
-  gMC->Gspos("UTCH",2,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
+  gMC->Gspos("UTCO",2,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
   zpos      +=  7.0;
-  gMC->Gspos("UTCH",3,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
+  gMC->Gspos("UTCO",3,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
   zpos      +=  7.0;
-  gMC->Gspos("UTCH",4,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
+  gMC->Gspos("UTCO",4,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
   zpos      +=  7.0;
-  gMC->Gspos("UTCH",5,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
+  gMC->Gspos("UTCO",5,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
   zpos      +=  7.0;
-  gMC->Gspos("UTCH",6,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
+  gMC->Gspos("UTCO",6,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
   zpos      +=  7.0;
-  gMC->Gspos("UTCH",7,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
+  gMC->Gspos("UTCO",7,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
   zpos      +=  7.0;
-  gMC->Gspos("UTCH",8,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
+  gMC->Gspos("UTCO",8,"UTCM", xpos, ypos, zpos,matrix[4],"ONLY");
 
   xpos = 40.0;
   ypos =  fgkFlength/2.0 - 23.0/2.0;
@@ -2539,7 +2588,6 @@ Bool_t AliTRDgeometry::CreateClusterMatrixArray()
         path = pne->GetTitle();
       }
       if (!strstr(path,"ALIC")) {
-        AliError(Form("Not a valid path: %s\n",path));
         AliDebug(1,Form("Not a valid path: %s\n",path));
         continue;
       }
@@ -2567,7 +2615,6 @@ Bool_t AliTRDgeometry::CreateClusterMatrixArray()
       rotSector.RotateZ(sectorAngle);
       rotMatrix.MultiplyLeft(&rotSector.Inverse());
 
-      AliWarning(Form("Add matrix: %d\n",lid));
       fClusterMatrixArray->AddAt(new TGeoHMatrix(rotMatrix),lid);       
 
     }    
@@ -2577,3 +2624,22 @@ Bool_t AliTRDgeometry::CreateClusterMatrixArray()
 
 }
 
+//_____________________________________________________________________________
+Bool_t AliTRDgeometry::ChamberInGeometry(Int_t det)
+{
+  //
+  // Checks whether the given detector is part of the current geometry
+  //
+
+  if (!fClusterMatrixArray) {
+    CreateClusterMatrixArray();
+  }  
+
+  if (!GetClusterMatrix(det)) {
+    return kFALSE;
+  }
+  else {
+    return kTRUE;
+  }
+
+}
index f5fe2417e27f2a1e12a0090ee08fe967e2856159..f5f539790319a621c619ffa4df62dd033e418d94 100644 (file)
@@ -44,6 +44,8 @@ class AliTRDgeometry : public AliGeometry {
 
   virtual Bool_t   RotateBack(Int_t det, Double_t *loc, Double_t *glb) const;
 
+          Bool_t   ChamberInGeometry(Int_t det);
+
           void     GroupChamber(Int_t iplan, Int_t icham, Int_t *idtmed);
           void     CreateFrame(Int_t *idtmed);
           void     CreateServices(Int_t *idtmed);
index 3715d5cc69e1ca26f7f329ab12753232bd036a22..3cf621a928696b736ec325d85388e975ee35d8e4 100644 (file)
@@ -201,8 +201,8 @@ void AliTRDtransform::SetDetector(Int_t det)
 }
 
 //_____________________________________________________________________________
-void AliTRDtransform::Transform(Double_t *x, Int_t *i, UInt_t time
-                             , Int_t  /*coordinateType*/)
+Bool_t AliTRDtransform::Transform(Double_t *x, Int_t *i, UInt_t time
+                               , Int_t  /*coordinateType*/)
 {
   //
   // Transforms the local cluster coordinates into calibrated 
@@ -240,7 +240,6 @@ void AliTRDtransform::Transform(Double_t *x, Int_t *i, UInt_t time
 
   if (!fMatrix) {
 
-    AliWarning("No transformation matrix available!");
     x[0] = 0.0;
     x[1] = 0.0;
     x[2] = 0.0;
@@ -249,6 +248,8 @@ void AliTRDtransform::Transform(Double_t *x, Int_t *i, UInt_t time
     x[5] = 0.0;
     i[2] = 0;
 
+    return kFALSE;
+
   }
   else {
  
@@ -303,6 +304,8 @@ void AliTRDtransform::Transform(Double_t *x, Int_t *i, UInt_t time
     x[5] = rowSize*rowSize / 12.0;                                       
     i[2] = TMath::Nint(timeT0Cal);
 
+    return kTRUE;
+
   }
 
 }
index d2d158d185393eb0a3e25b0d41a64fd30e6c25ae..76c50706b1487b02caea22da5f40a770e7e65832 100644 (file)
@@ -37,7 +37,7 @@ class AliTRDtransform : public TObject {
   AliTRDtransform &operator=(const AliTRDtransform &t) { *(new(this) AliTRDtransform(t));
                                                           return *this; }
 
-  virtual void     Transform(Double_t *x
+  virtual Bool_t   Transform(Double_t *x
                            , Int_t    *i
                            , UInt_t    time
                            , Int_t     coordinateType);