// $Id$
//
+// ----------------------------
// Class AliMUONGeometryBuilder
// ----------------------------
// Manager class for geometry construction via geometry builders.
-//
// Author: Ivana Hrivnacova, IPN Orsay
#include "AliMUONGeometryBuilder.h"
#include "AliMUONGeometryEnvelope.h"
#include "AliMUONGeometryEnvelopeStore.h"
#include "AliMUONGeometryDetElement.h"
-#include "AliMUONGeometryStore.h"
#include "AliMUONGeometryConstituent.h"
+#include "AliMpDEManager.h"
+
#include "AliModule.h"
#include "AliLog.h"
#include "AliRun.h"
#include <TVirtualMC.h>
#include <TGeoManager.h>
-
-ClassImp(AliMUONGeometryBuilder)
-
// static data members
const TString AliMUONGeometryBuilder::fgkDefaultVolPathsFileName = "volpath.dat";
const TString AliMUONGeometryBuilder::fgkDefaultSVMapFileName = "svmap.dat";
const TString AliMUONGeometryBuilder::fgkOutFileNameExtension = ".out";
+/// \cond CLASSIMP
+ClassImp(AliMUONGeometryBuilder)
+/// \endcond
+
// static functions
//______________________________________________________________________________
/// Default constructor
}
-//______________________________________________________________________________
-AliMUONGeometryBuilder::AliMUONGeometryBuilder(const AliMUONGeometryBuilder& right)
- : TObject(right)
-{
-/// Copy constructor (not implemented)
-
- AliFatal("Copy constructor not provided.");
-}
-
//______________________________________________________________________________
AliMUONGeometryBuilder::~AliMUONGeometryBuilder()
{
delete fGeometry;
}
-//______________________________________________________________________________
-AliMUONGeometryBuilder&
-AliMUONGeometryBuilder::operator=(const AliMUONGeometryBuilder& right)
-{
-/// Assignement operator (not implemented)
-
- // check assignement to self
- if (this == &right) return *this;
-
- AliFatal("Assignement operator not provided.");
-
- return *this;
-}
-
//
// private functions
//
fModule->AliMatrix(krot, theta1, phi1, theta2, phi2, theta3, phi3);
}
- // Place the volume in ALIC
+ // Place the volume
if (npar == 0)
gMC->Gspos(name, copyNo, mName, xyz[0], xyz[1], xyz[2] , krot, only);
else
AliMUONGeometryEnvelope* env
= (AliMUONGeometryEnvelope*)kEnvelopes->At(k);
+ // Check consistency of detElemId and module Id
+ if ( env->GetUniqueID() > 0 &&
+ AliMpDEManager::GetGeomModuleId(env->GetUniqueID())
+ != geometry->GetModuleId() ) {
+
+ AliErrorStream()
+ << "Detection element " << env->GetUniqueID()
+ << " is being placed in geometry module " << geometry->GetModuleId()
+ << " but should go in "
+ << AliMpDEManager::GetGeomModuleId(env->GetUniqueID())
+ << endl;
+ AliFatal("Inconsistent IDs");
+ }
+
const TGeoCombiTrans* kEnvTrans = env->GetTransformation();
const char* only = "ONLY";
if (env->IsMANY()) only = "MANY";
void AliMUONGeometryBuilder::CreateGeometryWithoutTGeo()
{
/// Construct geometry using geometry builders.
-/// Virtual modules/enevlopes are not placed
+/// Virtual modules/envelopes are not placed
if (fAlign) {
// Read transformations from ASCII data file
AliMUONGeometryEnvelope* env
= (AliMUONGeometryEnvelope*)kEnvelopes->At(k);
+ // Check consistency of detElemId and module Id
+ if ( env->GetUniqueID() > 0 &&
+ AliMpDEManager::GetGeomModuleId(env->GetUniqueID())
+ != geometry->GetModuleId() ) {
+
+ AliErrorStream()
+ << "Detection element " << env->GetUniqueID()
+ << " is being placed in geometry module " << geometry->GetModuleId()
+ << " but should go in "
+ << AliMpDEManager::GetGeomModuleId(env->GetUniqueID())
+ << endl;
+ AliFatal("Inconsistent IDs");
+ }
+
const TGeoCombiTrans* kEnvTrans = env->GetTransformation();
const char* only = "ONLY";
if (env->IsMANY()) only = "MANY";
if (!env->IsVirtual() && env->GetConstituents()->GetEntriesFast() == 0 ) {
// non virtual envelope + nof constituents = 0
- // => place envelope in ALICE by composed transformation:
+ // => place envelope by composed transformation:
// Tch * [Tglobal] * Tenv
// Compound chamber transformation with the envelope one
if (env->IsVirtual() && env->GetConstituents()->GetEntriesFast() > 0 ) {
// virtual envelope + nof constituents > 0
// => do not place envelope and place constituents
- // in ALICE by composed transformation:
+ // by composed transformation:
// Tch * [Tglobal] * Tenv * Tconst
for (Int_t l=0; l<env->GetConstituents()->GetEntriesFast(); l++) {
{
/// Construct geometry using geometry builders.
- if ( gMC->IsRootGeometrySupported() &&
- TString(gMC->ClassName()) != "TGeant4" ) {
+ if ( gMC->IsRootGeometrySupported() ) {
CreateGeometryWithTGeo();
}
// Read sensitive volume map from a file
fGeometry->ReadSVMap(svmapFileName);
-
+
// Set the chamber (sensitive region) GEANT identifier
//
for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
//______________________________________________________________________________
void AliMUONGeometryBuilder::WriteSVMaps(const TString& fileName,
- Bool_t rebuild)
+ Bool_t rebuild, Bool_t writeEnvelopes)
{
/// Write sensitive volume maps into files per builder
AliMUONVGeometryBuilder* builder
= (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
- Bool_t writeEnvelopes = false;
- if ( gMC->IsRootGeometrySupported() &&
- TString(gMC->ClassName()) != "TGeant4") writeEnvelopes = true;
-
builder->RebuildSVMaps(writeEnvelopes);
}
//_____________________________________________________________________________
void AliMUONGeometryBuilder::SetAlign(const TString& fileName, Bool_t align)
{
-/// Set the option for alignement
+/// Set the option for alignement and the transformations file name
fTransformFileName = fileName;
fAlign = align;