Declaring flange as MANY.
authormartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 28 Jan 2004 15:39:21 +0000 (15:39 +0000)
committermartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 28 Jan 2004 15:39:21 +0000 (15:39 +0000)
MUON/AliMUONChamberGeometry.cxx
MUON/AliMUONChamberGeometry.h
MUON/AliMUONGeometryEnvelope.cxx
MUON/AliMUONGeometryEnvelope.h
MUON/AliMUONTriggerGeometryBuilder.cxx
MUON/AliMUONv1.cxx
MUON/AliMUONv1.h

index 25aa13ccaccc96635386e8516f17963f471b20f2..8fd1860979a01513ead51cab4fe7c9f2668f7be7 100644 (file)
@@ -113,7 +113,8 @@ AliMUONChamberGeometry::FindEnvelope(const TString& name) const
 //
 
 //______________________________________________________________________________
-void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Bool_t isVirtual) 
+void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Bool_t isVirtual,
+                                          const char* only) 
 {
 // Adds the volume with the specified name and transformation
 // to the list of envelopes.
@@ -126,14 +127,15 @@ void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Bool_t isVirtual)
   }  
 
   AliMUONGeometryEnvelope* envelope 
-    = new AliMUONGeometryEnvelope(name, isVirtual);
+    = new AliMUONGeometryEnvelope(name, isVirtual, only);
 
   fEnvelopes->Add(envelope);
 }
 
 //______________________________________________________________________________
 void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Bool_t isVirtual,
-                                          const TGeoTranslation& translation)
+                                          const TGeoTranslation& translation,
+                                         const char* only)
 {
 // Adds the volume with the specified name and transformation
 // to the list of envelopes.
@@ -147,7 +149,7 @@ void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Bool_t isVirtual,
   }  
 
   AliMUONGeometryEnvelope* envelope 
-    = new AliMUONGeometryEnvelope(name, isVirtual);
+    = new AliMUONGeometryEnvelope(name, isVirtual, only);
   envelope->SetTranslation(translation);
 
   fEnvelopes->Add(envelope);
@@ -156,7 +158,8 @@ void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Bool_t isVirtual,
 //______________________________________________________________________________
 void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Bool_t isVirtual, 
                                           const TGeoTranslation& translation,
-                                         const TGeoRotation& rotation)
+                                         const TGeoRotation& rotation,
+                                         const char* only)
 {
 // Adds the volume with the specified name and transformation
 // to the list of envelopes.
@@ -173,7 +176,7 @@ void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Bool_t isVirtual,
            // would be nice to be so simple 
 
   AliMUONGeometryEnvelope* envelope 
-    = new AliMUONGeometryEnvelope(name, isVirtual);
+    = new AliMUONGeometryEnvelope(name, isVirtual, only);
   envelope->SetRotation(rotation);
   envelope->SetTranslation(translation);
 
@@ -181,7 +184,8 @@ void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Bool_t isVirtual,
 }
 
 //______________________________________________________________________________
-void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Int_t copyNo) 
+void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Int_t copyNo,
+                                          const char* only) 
 {
 // Adds the volume with the specified name and transformation
 // to the list of envelopes.
@@ -194,14 +198,15 @@ void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Int_t copyNo)
    }  
 
   AliMUONGeometryEnvelope* envelope 
-    = new AliMUONGeometryEnvelope(name, copyNo);
+    = new AliMUONGeometryEnvelope(name, copyNo, only);
 
   fEnvelopes->Add(envelope);
 }
 
 //______________________________________________________________________________
 void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Int_t copyNo,
-                                          const TGeoTranslation& translation)
+                                          const TGeoTranslation& translation,
+                                         const char* only)
 {
 // Adds the volume with the specified name and transformation
 // to the list of envelopes.
@@ -215,7 +220,7 @@ void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Int_t copyNo,
   }  
 
   AliMUONGeometryEnvelope* envelope 
-    = new AliMUONGeometryEnvelope(name, copyNo);
+    = new AliMUONGeometryEnvelope(name, copyNo, only);
   envelope->SetTranslation(translation);
 
   fEnvelopes->Add(envelope);
@@ -224,7 +229,8 @@ void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Int_t copyNo,
 //______________________________________________________________________________
 void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Int_t copyNo, 
                                           const TGeoTranslation& translation,
-                                         const TGeoRotation& rotation)
+                                         const TGeoRotation& rotation,
+                                         const char* only)
 {
 // Adds the volume with the specified name and transformation
 // to the list of envelopes.
@@ -241,7 +247,7 @@ void  AliMUONChamberGeometry::AddEnvelope(const TString& name, Int_t copyNo,
            // would be nice to be so simple 
 
   AliMUONGeometryEnvelope* envelope 
-    = new AliMUONGeometryEnvelope(name, copyNo);
+    = new AliMUONGeometryEnvelope(name, copyNo, only);
   envelope->SetRotation(rotation);
   envelope->SetTranslation(translation);
 
index d45a8fe076537787a70a6c1936012c6d42cee458..018227edce6ac0b52b30fcba35873afff663d49a 100644 (file)
@@ -36,23 +36,29 @@ class AliMUONChamberGeometry : public TObject
           // adding virtual envelopes  
           // (not placed in MC geometry, only logical assembly of volumes,
          //  cannot have more copies)  
-    void  AddEnvelope(const TString& name, Bool_t isVirtual); 
     void  AddEnvelope(const TString& name, Bool_t isVirtual, 
-                      const TGeoTranslation& translation); 
+                      const char* only="ONLY"); 
     void  AddEnvelope(const TString& name, Bool_t isVirtual, 
                       const TGeoTranslation& translation, 
-                     const TGeoRotation& rotation);
+                     const char* only="ONLY"); 
+    void  AddEnvelope(const TString& name, Bool_t isVirtual, 
+                      const TGeoTranslation& translation, 
+                     const TGeoRotation& rotation,
+                     const char* only="ONLY");
                      
           // adding non-virtual envelopes      
           // (placed in MC geometry with transformation composed
          //  of transformation of chamber and their transformation, 
          //  can have more copies )    
-    void  AddEnvelope(const TString& name, Int_t copyNo); 
     void  AddEnvelope(const TString& name, Int_t copyNo, 
-                      const TGeoTranslation& translation); 
+                      const char* only="ONLY"); 
+    void  AddEnvelope(const TString& name, Int_t copyNo, 
+                      const TGeoTranslation& translation,
+                     const char* only="ONLY"); 
     void  AddEnvelope(const TString& name, Int_t copyNo, 
                       const TGeoTranslation& translation, 
-                     const TGeoRotation& rotation);
+                     const TGeoRotation& rotation,
+                     const char* only="ONLY");
 
           // adding constituents to virtual envelopes  
           // (placed in MC geometry with transformation composed
index ba59ab4998804e6ae9ae8e860a0aa3e9cd3c1776..415e3a1b147fe1cc13c2de49e3e46f015786952b 100644 (file)
@@ -7,6 +7,7 @@
 // Author: Ivana Hrivnacova, IPN Orsay
 
 #include <TGeoMatrix.h>
+#include <TString.h>
 #include <TObjArray.h>
 
 #include "AliMUONGeometryEnvelope.h"
@@ -16,15 +17,19 @@ ClassImp(AliMUONGeometryEnvelope)
 
 //______________________________________________________________________________
 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(const TString& name, 
-                                                 Bool_t isVirtual)
+                                                 Bool_t isVirtual,
+                                                const char* only)
  : TNamed(name, name),
    fIsVirtual(isVirtual),
+   fIsMANY(false),
    fCopyNo(0),
    fTransformation(0),
    fConstituents(0)
 {
 // Standard constructor
 
+  if (TString(only) == TString("MANY")) fIsMANY = true;
+
   // Create the envelope transformation
   fTransformation = new TGeoCombiTrans("");
   fConstituents = new TObjArray(20);
@@ -33,15 +38,19 @@ AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(const TString& name,
 
 //______________________________________________________________________________
 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(const TString& name, 
-                                                 Int_t copyNo)
+                                                 Int_t copyNo, 
+                                                const char* only)
  : TNamed(name, name),
    fIsVirtual(false),
+   fIsMANY(false),
    fCopyNo(copyNo),
    fTransformation(0),
    fConstituents(0)
 {
 // Standard constructor
 
+  if (TString(only) == TString("MANY")) fIsMANY = true;
+
   // Create the envelope transformation
   fTransformation = new TGeoCombiTrans("");
   fConstituents = new TObjArray(20);
index ed09cec86825dae518650ee6c72170bb44f6bce5..9a2d843bd967c67e2817d02d9569bcc78477f24d 100644 (file)
@@ -19,8 +19,10 @@ class TObjArray;
 class AliMUONGeometryEnvelope : public TNamed
 {
   public:
-    AliMUONGeometryEnvelope(const TString& name, Bool_t isVirtual);
-    AliMUONGeometryEnvelope(const TString& name, Int_t copyNo);
+    AliMUONGeometryEnvelope(const TString& name, Bool_t isVirtual, 
+                            const char* only); 
+    AliMUONGeometryEnvelope(const TString& name, Int_t copyNo,
+                            const char* only); 
     AliMUONGeometryEnvelope();
     AliMUONGeometryEnvelope(const AliMUONGeometryEnvelope& rhs);
     virtual ~AliMUONGeometryEnvelope();
@@ -51,6 +53,7 @@ class AliMUONGeometryEnvelope : public TNamed
 
     // get methods
     Bool_t                 IsVirtual() const;  
+    Bool_t                 IsMANY() const;  
     Int_t                  GetCopyNo() const;  
     const TGeoCombiTrans*  GetTransformation() const;
     const TObjArray*       GetConstituents() const;
@@ -58,6 +61,8 @@ class AliMUONGeometryEnvelope : public TNamed
   private:
     Bool_t           fIsVirtual;     // true if envelope is not represented
                                      // by a real volume
+    Bool_t           fIsMANY;        // true if envelope is placed with
+                                     // MANY option
     Int_t            fCopyNo;        // copy number 
                                      // (only non virtual envelope can have 
                                     //  more than one copy)
@@ -74,6 +79,9 @@ class AliMUONGeometryEnvelope : public TNamed
 inline Bool_t AliMUONGeometryEnvelope::IsVirtual() const
 { return fIsVirtual; }  
 
+inline Bool_t AliMUONGeometryEnvelope::IsMANY() const
+{ return fIsMANY; }  
+
 inline Int_t AliMUONGeometryEnvelope::GetCopyNo() const
 { return fCopyNo; }  
 
index f778e8ff8e7d5da8670a561dc2492cbef97e6dac..34e2ae2c8836fe8bbea459bce30690b191cf2b17 100644 (file)
@@ -131,7 +131,7 @@ void AliMUONTriggerGeometryBuilder::CreateGeometry()
            gMC->Gsvolu(volFlange,"TUBE",idAlu1,tpar,3);     // Al
             // changed by ivana
            //gMC->Gspos(volFlange,1,"ALIC",0.,0.,zpos,0,"MANY");
-           iChamber->GetGeometry()->AddEnvelope(volFlange, false);
+           iChamber->GetGeometry()->AddEnvelope(volFlange, false, "MANY");
            
 // scaling factor
            Float_t zRatio = zpos / zpos1;
index 99d5779d1e9f633eead0bb2cadad26df2a108163..d27a48ab51650e4d2a2f55a43bcbeaa97a771797 100644 (file)
@@ -174,6 +174,8 @@ void AliMUONv1::CreateGeometry()
       // Get envelope
       AliMUONGeometryEnvelope* env = (AliMUONGeometryEnvelope*)kEnvelopes->At(k);
       const TGeoCombiTrans* kEnvTrans = env->GetTransformation();
+      const char* only = "ONLY";
+      if (env->IsMANY()) only = "MANY";
 
       if (env->IsVirtual() && env->GetConstituents()->GetEntriesFast() == 0 ) {
         // virtual envelope + nof constituents = 0 
@@ -202,7 +204,7 @@ void AliMUONv1::CreateGeometry()
            (*geometry->GetTransformation()) * 
            (*kEnvTrans);
         PlaceVolume(env->GetName(), geometry->GetMotherVolume(),
-                   env->GetCopyNo(), total, 0, 0);
+                   env->GetCopyNo(), total, 0, 0, only);
       }
 
       if (env->IsVirtual() && env->GetConstituents()->GetEntriesFast() > 0 ) {
@@ -224,7 +226,7 @@ void AliMUONv1::CreateGeometry()
 
           PlaceVolume(constituent->GetName(), geometry->GetMotherVolume(),
                      constituent->GetCopyNo(), total,
-                      constituent->GetNpar(), constituent->GetParam());
+                      constituent->GetNpar(), constituent->GetParam(), only);
         }
       }
     } 
@@ -386,7 +388,7 @@ void AliMUONv1::CreateMaterials()
 //______________________________________________________________________________
 void AliMUONv1::PlaceVolume(const TString& name, const TString& mName, 
                             Int_t copyNo, const TGeoHMatrix& matrix, 
-                           Int_t npar, Double_t* param) const
+                           Int_t npar, Double_t* param, const char* only) const
 {
 // Place the volume specified by name with the given transformation matrix
 // ---
@@ -445,10 +447,10 @@ void AliMUONv1::PlaceVolume(const TString& name, const TString& mName,
   }    
        
   // Place the volume in ALIC
-  if (npar == 0) 
-    gMC->Gspos(name, copyNo, mName, xyz[0], xyz[1], xyz[2] , krot, "ONLY");
+  if (npar == 0)
+    gMC->Gspos(name, copyNo, mName, xyz[0], xyz[1], xyz[2] , krot, only);
   else 
-    gMC->Gsposp(name, copyNo, mName, xyz[0], xyz[1], xyz[2] , krot, "ONLY",
+    gMC->Gsposp(name, copyNo, mName, xyz[0], xyz[1], xyz[2] , krot, only,
                 param, npar);
 
 } 
index 56e5bc54806ea9287c1da8898013060724143826..9a4c5fa4d946fdc8e08e34ab8f7a9c872d79fd09 100644 (file)
@@ -59,7 +59,8 @@ protected:
 private:
    // method
    void PlaceVolume(const TString& name, const TString& mName, Int_t copyNo, 
-             const TGeoHMatrix& matrix, Int_t npar, Double_t* param) const;
+             const TGeoHMatrix& matrix, Int_t npar, Double_t* param,
+            const char* only) const;
 
    ClassDef(AliMUONv1,1)  // MUON Detector class Version 1