//
//______________________________________________________________________________
-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.
}
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.
}
AliMUONGeometryEnvelope* envelope
- = new AliMUONGeometryEnvelope(name, isVirtual);
+ = new AliMUONGeometryEnvelope(name, isVirtual, only);
envelope->SetTranslation(translation);
fEnvelopes->Add(envelope);
//______________________________________________________________________________
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.
// would be nice to be so simple
AliMUONGeometryEnvelope* envelope
- = new AliMUONGeometryEnvelope(name, isVirtual);
+ = new AliMUONGeometryEnvelope(name, isVirtual, only);
envelope->SetRotation(rotation);
envelope->SetTranslation(translation);
}
//______________________________________________________________________________
-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.
}
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.
}
AliMUONGeometryEnvelope* envelope
- = new AliMUONGeometryEnvelope(name, copyNo);
+ = new AliMUONGeometryEnvelope(name, copyNo, only);
envelope->SetTranslation(translation);
fEnvelopes->Add(envelope);
//______________________________________________________________________________
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.
// would be nice to be so simple
AliMUONGeometryEnvelope* envelope
- = new AliMUONGeometryEnvelope(name, copyNo);
+ = new AliMUONGeometryEnvelope(name, copyNo, only);
envelope->SetRotation(rotation);
envelope->SetTranslation(translation);
// 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
// Author: Ivana Hrivnacova, IPN Orsay
#include <TGeoMatrix.h>
+#include <TString.h>
#include <TObjArray.h>
#include "AliMUONGeometryEnvelope.h"
//______________________________________________________________________________
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);
//______________________________________________________________________________
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);
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();
// get methods
Bool_t IsVirtual() const;
+ Bool_t IsMANY() const;
Int_t GetCopyNo() const;
const TGeoCombiTrans* GetTransformation() const;
const TObjArray* GetConstituents() const;
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)
inline Bool_t AliMUONGeometryEnvelope::IsVirtual() const
{ return fIsVirtual; }
+inline Bool_t AliMUONGeometryEnvelope::IsMANY() const
+{ return fIsMANY; }
+
inline Int_t AliMUONGeometryEnvelope::GetCopyNo() const
{ return fCopyNo; }
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;
// 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
(*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 ) {
PlaceVolume(constituent->GetName(), geometry->GetMotherVolume(),
constituent->GetCopyNo(), total,
- constituent->GetNpar(), constituent->GetParam());
+ constituent->GetNpar(), constituent->GetParam(), only);
}
}
}
//______________________________________________________________________________
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
// ---
}
// 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);
}
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