Write only detector coefficients from HLT (Raphaelle)
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryEnvelope.cxx
index 65ee19b..0eb71d0 100644 (file)
@@ -1,10 +1,27 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
 // $Id$
-//
+
+//-----------------------------------------------------------------------------
 // Class AliMUONGeometryEnvelope
 // -----------------------------
-// Helper class for definititon an assembly of volumes.
+// Helper class for definititon of an assembly of volumes.
 // Author: Ivana Hrivnacova, IPN Orsay
 // 23/01/2004
+//-----------------------------------------------------------------------------
 
 #include <TGeoMatrix.h>
 #include <TString.h>
 
 #include "AliMUONGeometryEnvelope.h"
 #include "AliMUONGeometryConstituent.h"
+#include "AliLog.h"
 
+/// \cond CLASSIMP
 ClassImp(AliMUONGeometryEnvelope)
+/// \endcond
 
 //______________________________________________________________________________
 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(const TString& name, 
+                                                 Int_t id, 
                                                  Bool_t isVirtual,
                                                 const char* only)
  : TNamed(name, name),
    fIsVirtual(isVirtual),
    fIsMANY(false),
-   fCopyNo(0),
+   fCopyNo(1),
    fTransformation(0),
    fConstituents(0)
 {
-// Standard constructor
+/// Standard constructor
 
   if (TString(only) == TString("MANY")) fIsMANY = true;
 
   // Create the envelope transformation
   fTransformation = new TGeoCombiTrans("");
   fConstituents = new TObjArray(20);
+  
+  // Set id
+  SetUniqueID(id);
 }
 
 
 //______________________________________________________________________________
-AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(const TString& name, 
+AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(const TString& name,   
+                                                 Int_t id,
                                                  Int_t copyNo, 
                                                 const char* only)
  : TNamed(name, name),
@@ -47,13 +72,17 @@ AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(const TString& name,
    fTransformation(0),
    fConstituents(0)
 {
-// Standard constructor
+/// Standard constructor for a non virtual enevelope with a specified copy 
+/// number
 
   if (TString(only) == TString("MANY")) fIsMANY = true;
 
   // Create the envelope transformation
   fTransformation = new TGeoCombiTrans("");
   fConstituents = new TObjArray(20);
+  
+  // Set id
+  SetUniqueID(id);
 }
 
 
@@ -61,26 +90,19 @@ AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(const TString& name,
 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope()
  : TNamed(),
    fIsVirtual(0),
+   fIsMANY(false),
+   fCopyNo(0),
    fTransformation(0),
    fConstituents(0)
 {
-// Default constructor
-}
-
-
-//______________________________________________________________________________
-AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(
-                                        const AliMUONGeometryEnvelope& rhs)
-  : TNamed(rhs)
-{
-  Fatal("Copy constructor", 
-        "Copy constructor is not implemented.");
+/// Default constructor
 }
 
 //______________________________________________________________________________
 AliMUONGeometryEnvelope::~AliMUONGeometryEnvelope() 
 {
-//
+/// Destructor
+
   // Add deleting rotation matrices 
   
   delete fTransformation;
@@ -91,19 +113,6 @@ AliMUONGeometryEnvelope::~AliMUONGeometryEnvelope()
   }  
 }
 
-//______________________________________________________________________________
-AliMUONGeometryEnvelope& 
-AliMUONGeometryEnvelope::operator = (const AliMUONGeometryEnvelope& rhs) 
-{
-  // check assignement to self
-  if (this == &rhs) return *this;
-
-  Fatal("operator=", 
-        "Assignment operator is not implemented.");
-    
-  return *this;  
-}
-
 //
 // public methods
 //
@@ -111,9 +120,8 @@ AliMUONGeometryEnvelope::operator = (const AliMUONGeometryEnvelope& rhs)
 //______________________________________________________________________________
 void  AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo) 
 {
-// Adds the volume with the specified name and transformation
-// to the list of envelopes.
-// ---                                            
+/// Add the volume with the specified name and transformation
+/// to the list of envelopes.
 
   fConstituents->Add(new AliMUONGeometryConstituent(name, copyNo, 0, 0));
 }
@@ -122,9 +130,8 @@ void  AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo)
 void  AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo, 
                                           const TGeoTranslation& translation)
 {
-// Adds the volume with the specified name and transformation
-// to the list of envelopes.
-// ---                                            
+/// Add the volume with the specified name and transformation
+/// to the list of envelopes.
 
   fConstituents
     ->Add(new AliMUONGeometryConstituent(name, copyNo, translation, 0, 0));
@@ -135,9 +142,8 @@ void  AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo,
                                           const TGeoTranslation& translation,
                                          const TGeoRotation& rotation)
 {
-// Adds the volume with the specified name and transformation
-// to the list of envelopes.
-// ---                                            
+/// Add the volume with the specified name and transformation
+/// to the list of envelopes.
 
   fConstituents
     ->Add(new AliMUONGeometryConstituent(
@@ -145,12 +151,23 @@ void  AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo,
 }
 
 //______________________________________________________________________________
+void  AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo,
+                                          const TGeoCombiTrans& transform )
+{
+/// Add the volume with the specified name and transformation
+/// to the list of envelopes.
+
+  fConstituents
+    ->Add(new AliMUONGeometryConstituent(
+                     name, copyNo, transform, 0, 0));
+}
+
+//______________________________________________________________________________
 void  AliMUONGeometryEnvelope::AddConstituentParam(const TString& name, 
                                   Int_t copyNo, Int_t npar, Double_t* param) 
 {
-// Adds the volume with the specified name and transformation
-// to the list of envelopes.
-// ---                                            
+/// Add the volume with the specified name and transformation
+/// to the list of envelopes.
 
   fConstituents
     ->Add(new AliMUONGeometryConstituent(name, copyNo, npar, param));
@@ -161,9 +178,8 @@ void  AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
                                   Int_t copyNo, const TGeoTranslation& translation,
                                  Int_t npar, Double_t* param)
 {
-// Adds the volume with the specified name and transformation
-// to the list of envelopes.
-// ---                                            
+/// Add the volume with the specified name and transformation
+/// to the list of envelopes.
 
   fConstituents
     ->Add(new AliMUONGeometryConstituent(
@@ -176,9 +192,8 @@ void  AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
                                  const TGeoRotation& rotation, 
                                  Int_t npar, Double_t* param)
 {
-// Adds the volume with the specified name and transformation
-// to the list of envelopes.
-// ---                                            
+/// Add the volume with the specified name and transformation
+/// to the list of envelopes.
 
   fConstituents
     ->Add(new AliMUONGeometryConstituent(
@@ -186,10 +201,23 @@ void  AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
 }
 
 //______________________________________________________________________________
+void  AliMUONGeometryEnvelope::AddConstituentParam(const TString& name, 
+                                  Int_t copyNo, 
+                                 const TGeoCombiTrans& transform, 
+                                 Int_t npar, Double_t* param)
+{
+/// Add the volume with the specified name and transformation
+/// to the list of envelopes.
+
+  fConstituents
+    ->Add(new AliMUONGeometryConstituent(
+                     name, copyNo, transform, npar, param));
+}
+
+//______________________________________________________________________________
 void  AliMUONGeometryEnvelope::SetTranslation(const TGeoTranslation& translation)
 {
-// Sets the chamber position wrt ALIC.
-// ---
+/// Set the envelope position
 
   fTransformation
     ->SetTranslation(const_cast<Double_t*>(translation.GetTranslation()));
@@ -198,11 +226,24 @@ void  AliMUONGeometryEnvelope::SetTranslation(const TGeoTranslation& translation
 //______________________________________________________________________________
 void  AliMUONGeometryEnvelope::SetRotation(const TGeoRotation& rotation)
 {
-// Sets the chamber rotation wrt ALIC.
-// ---
+/// Set the envelope rotation
 
   TGeoRotation* rot = new TGeoRotation();
   rot->SetMatrix(const_cast<Double_t*>(rotation.GetRotationMatrix()));
 
   fTransformation->SetRotation(rot);
 }  
+
+//______________________________________________________________________________
+void  AliMUONGeometryEnvelope::SetTransform(const TGeoCombiTrans& transform)
+{
+/// Set the envelope transformation
+
+  fTransformation
+    ->SetTranslation(const_cast<Double_t*>(transform.GetTranslation()));
+
+  TGeoRotation* rot = new TGeoRotation();
+  rot->SetMatrix(const_cast<Double_t*>(transform.GetRotationMatrix()));
+
+  fTransformation->SetRotation(rot);
+}