#include <TVector.h>
#include <TVirtualMC.h>
-#include "AliConst.h"
-#include "AliHeader.h"
-#include "AliHitMap.h"
+//#include "AliHeader.h"
#include "AliLoader.h"
#include "AliRunDigitizer.h"
#include "AliMC.h"
#include "AliRun.h"
-#include "AliMUONLoader.h"
#include "AliMUON.h"
#include "AliMUONChamberTrigger.h"
#include "AliMUONConstants.h"
-#include "AliMUONDigit.h"
#include "AliMUONHit.h"
-#include "AliMUONHitMapA1.h"
#include "AliMUONMerger.h"
#include "AliMUONPadHit.h"
#include "AliMUONRawCluster.h"
#include "AliMUONTransientDigit.h"
#include "AliMUONTriggerCircuit.h"
+#include "AliMUONGeometryBuilder.h"
#include "AliMUONVGeometryBuilder.h"
#include "AliMUONDigitizerv2.h"
#include "AliMUONSDigitizerv1.h"
fMUONData(0),
fSplitLevel(0),
fChambers(0),
- fGeometryBuilders(0),
fTriggerCircuits(0),
+ fGeometryBuilder(0),
fAccCut(kFALSE),
fAccMin(0.),
fAccMax(0.),
fMUONData(0),
fSplitLevel(0),
fChambers(0),
- fGeometryBuilders(0),
fTriggerCircuits(0),
+ fGeometryBuilder(0),
fAccCut(kFALSE),
fAccMin(0.),
fAccMax(0.),
// Creating List of Chambers
Int_t ch;
fChambers = new TObjArray(AliMUONConstants::NCh());
- fGeometryBuilders = new TObjArray(AliMUONConstants::NCh());
// Loop over stations
for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) {
for (Int_t circ=0; circ<AliMUONConstants::NTriggerCircuit(); circ++) {
fTriggerCircuits->AddAt(new AliMUONTriggerCircuit(),circ);
}
+
+ // Geometry builder
+ fGeometryBuilder = new AliMUONGeometryBuilder(this);
}
//____________________________________________________________________
fIshunt = 0;
if (fMerger) delete fMerger;
- if (fGeometryBuilders){
- fGeometryBuilders->Delete();
- delete fGeometryBuilders;
- }
if (fChambers){
fChambers->Delete();
delete fChambers;
delete fTriggerCircuits;
}
delete fMUONData;
+ delete fGeometryBuilder;
}
//________________________________________________________________________
// Adds the geometry builder to the list
// ---
- fGeometryBuilders->Add(geomBuilder);
+ fGeometryBuilder->AddBuilder(geomBuilder);
}
//____________________________________________________________________
((AliMUONChamber*) fChambers->At(i))->SetMaxAdc(p1);
((AliMUONChamber*) fChambers->At(i+1))->SetMaxAdc(p1);
}
+
//__________________________________________________________________
void AliMUON::SetMaxStepGas(Float_t p1)
{
// Set maximum step size in Alu
fMaxDestepAlu=p1;
}
+
//___________________________________________________________________
void AliMUON::SetAcceptance(Bool_t acc, Float_t angmin, Float_t angmax)
{
return fMaxDestepAlu;
}
+
//____________________________________________________________________
void AliMUON::SetSegmentationModel(Int_t id, Int_t isec, AliSegmentation *segmentation)
{
class AliMUONRawCluster;
class AliMUONReconstHit;
class AliMUONMerger;
+class AliMUONGeometryBuilder;
class AliMUONVGeometryBuilder;
class AliESD;
void AddGeometryBuilder(AliMUONVGeometryBuilder* geomBuilder);
virtual void BuildGeometry();
AliMUONData* GetMUONData() {return fMUONData;}
+ AliMUONGeometryBuilder* GetGeometryBuilder() {return fGeometryBuilder;}
virtual Int_t IsVersion() const {return 0;}
// MUONLoader definition
AliMUONData* fMUONData; // Data container for MUON subsystem
Int_t fSplitLevel; // Splitlevel when making branches in outfiles.
TObjArray* fChambers; // List of Tracking Chambers
- TObjArray *fGeometryBuilders; // List of Geometry Builders
TObjArray* fTriggerCircuits; // List of Trigger Circuits
+ AliMUONGeometryBuilder* fGeometryBuilder; // Geometry buiulder
//
Bool_t fAccCut; //Transport acceptance cut
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * SigmaEffect_thetadegrees *
+ * 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 purpeateose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+// $Id$
+//
+// Class AliMUONGeometryBuilder
+// ----------------------------
+// MUON manager class for geometry construction,
+// separated form AliMUONv1
+//
+// Author: Ivana Hrivnacova, IPN Orsay
+
+#include <TClonesArray.h>
+#include <TGeoMatrix.h>
+#include <TVirtualMC.h>
+
+#include "AliMUONGeometryBuilder.h"
+#include "AliMUON.h"
+#include "AliMUONChamber.h"
+#include "AliMUONConstants.h"
+#include "AliMUONVGeometryBuilder.h"
+#include "AliMUONChamberGeometry.h"
+#include "AliMUONGeometryEnvelope.h"
+#include "AliMUONGeometryConstituent.h"
+#include "AliMagF.h"
+#include "AliRun.h"
+
+ClassImp(AliMUONGeometryBuilder)
+
+//______________________________________________________________________________//___________________________________________
+AliMUONGeometryBuilder::AliMUONGeometryBuilder()
+ : TObject(),
+ fMUON(0),
+ fGlobalTransformation(0),
+ fGeometryBuilders(0)
+{
+// Default constructor
+}
+
+//______________________________________________________________________________//___________________________________________
+AliMUONGeometryBuilder::AliMUONGeometryBuilder(AliMUON* muon)
+ : TObject(),
+ fMUON(muon),
+ fGlobalTransformation(0),
+ fGeometryBuilders(0)
+{
+// Standars constructor
+
+ // Define the global transformation:
+ // Transformation from the old ALICE coordinate system to a new one:
+ // x->-x, z->-z
+ TGeoRotation* rotGlobal
+ = new TGeoRotation("rotGlobal", 90., 180., 90., 90., 180., 0.);
+ fGlobalTransformation = new TGeoCombiTrans(0., 0., 0., rotGlobal);
+
+ fGeometryBuilders = new TObjArray(AliMUONConstants::NCh());
+}
+
+//______________________________________________________________________________
+AliMUONGeometryBuilder::AliMUONGeometryBuilder(const AliMUONGeometryBuilder& right)
+ : TObject(right)
+{
+ // copy constructor (not implemented)
+
+ Fatal("AliMUONGeometryBuilder", "Copy constructor not provided.");
+}
+
+//______________________________________________________________________________
+AliMUONGeometryBuilder::~AliMUONGeometryBuilder()
+{
+// Destructor
+
+ delete fGlobalTransformation;
+
+ if (fGeometryBuilders){
+ fGeometryBuilders->Delete();
+ delete fGeometryBuilders;
+ }
+}
+
+//______________________________________________________________________________
+AliMUONGeometryBuilder&
+AliMUONGeometryBuilder::operator=(const AliMUONGeometryBuilder& right)
+{
+ // assignement operator (not implemented)
+
+ // check assignement to self
+ if (this == &right) return *this;
+
+ Fatal("operator =", "Assignement operator not provided.");
+
+ return *this;
+}
+
+//
+// private functions
+//
+
+//______________________________________________________________________________
+void AliMUONGeometryBuilder::PlaceVolume(const TString& name, const TString& mName,
+ Int_t copyNo, const TGeoHMatrix& matrix,
+ Int_t npar, Double_t* param, const char* only) const
+{
+// Place the volume specified by name with the given transformation matrix
+// ---
+
+ // Do not apply global transformation
+ // if mother volume == DDIP
+ // (as it is applied on this volume)
+ TGeoHMatrix transform(matrix);
+ if (mName == TString("DDIP")) {
+ transform = (*fGlobalTransformation) * transform;
+ // To be changed to (*fGlobalTransformation).inverse()
+ // when available in TGeo
+ // To make this correct also for a general case when
+ // (*fGlobalTransformation) * *fGlobalTransformation) != 1
+ }
+
+ // Decompose transformation
+ const Double_t* xyz = transform.GetTranslation();
+ const Double_t* rm = transform.GetRotationMatrix();
+
+ //cout << "Got translation: "
+ // << xyz[0] << " " << xyz[1] << " " << xyz[2] << endl;
+
+ //cout << "Got rotation: "
+ // << rm[0] << " " << rm[1] << " " << rm[2] << endl
+ // << rm[3] << " " << rm[4] << " " << rm[5] << endl
+ // << rm[6] << " " << rm[7] << " " << rm[8] << endl;
+
+ // Check for presence of rotation
+ // (will be nice to be available in TGeo)
+ const Double_t kTolerance = 1e-04;
+ Bool_t isRotation = true;
+ if (TMath::Abs(rm[0] - 1.) < kTolerance &&
+ TMath::Abs(rm[1] - 0.) < kTolerance &&
+ TMath::Abs(rm[2] - 0.) < kTolerance &&
+ TMath::Abs(rm[3] - 0.) < kTolerance &&
+ TMath::Abs(rm[4] - 1.) < kTolerance &&
+ TMath::Abs(rm[5] - 0.) < kTolerance &&
+ TMath::Abs(rm[6] - 0.) < kTolerance &&
+ TMath::Abs(rm[7] - 0.) < kTolerance &&
+ TMath::Abs(rm[8] - 1.) < kTolerance) isRotation = false;
+
+ Int_t krot = 0;
+ if (isRotation) {
+ TGeoRotation rot;
+ rot.SetMatrix(const_cast<Double_t*>(transform.GetRotationMatrix()));
+ Double_t theta1, phi1, theta2, phi2, theta3, phi3;
+ rot.GetAngles(theta1, phi1, theta2, phi2, theta3, phi3);
+
+ //cout << "angles: "
+ // << theta1 << " " << phi1 << " "
+ // << theta2 << " " << phi2 << " "
+ // << theta3 << " " << phi3 << endl;
+
+ fMUON->AliMatrix(krot, theta1, phi1, theta2, phi2, theta3, phi3);
+ }
+
+ // Place the volume in ALIC
+ 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,
+ param, npar);
+
+}
+
+//
+// public functions
+//
+
+//______________________________________________________________________________
+void AliMUONGeometryBuilder::CreateGeometry()
+{
+//
+// Construct geometry using geometry builders.
+//
+
+ for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
+
+ // Get the builder
+ AliMUONVGeometryBuilder* builder
+ = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
+
+ // Create geometry with each builder
+ if (builder) {
+ builder->CreateGeometry();
+ builder->SetTransformations();
+ }
+ }
+
+ for (Int_t j=0; j<AliMUONConstants::NCh(); j++) {
+
+ AliMUONChamberGeometry* geometry = fMUON->Chamber(j).GetGeometry();
+
+ if (!geometry) continue;
+ // Skip chambers with not defined geometry
+
+ // Loop over envelopes
+ const TObjArray* kEnvelopes = geometry->GetEnvelopes();
+ for (Int_t k=0; k<kEnvelopes->GetEntriesFast(); k++) {
+
+ // 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
+ // => not allowed;
+ // empty virtual envelope has no sense
+ Fatal("CreateGeometry", "Virtual envelope must have constituents.");
+ return;
+ }
+
+ if (!env->IsVirtual() && env->GetConstituents()->GetEntriesFast() > 0 ) {
+ // non virtual envelope + nof constituents > 0
+ // => not allowed;
+ // use VMC to place constituents
+ Fatal("CreateGeometry", "Non virtual envelope cannot have constituents.");
+ return;
+ }
+
+ if (!env->IsVirtual() && env->GetConstituents()->GetEntriesFast() == 0 ) {
+ // non virtual envelope + nof constituents = 0
+ // => place envelope in ALICE by composed transformation:
+ // Tglobal * Tch * Tenv
+
+ // Compound chamber transformation with the envelope one
+ TGeoHMatrix total
+ = (*fGlobalTransformation) *
+ (*geometry->GetTransformation()) *
+ (*kEnvTrans);
+ PlaceVolume(env->GetName(), geometry->GetMotherVolume(),
+ env->GetCopyNo(), total, 0, 0, only);
+ }
+
+ if (env->IsVirtual() && env->GetConstituents()->GetEntriesFast() > 0 ) {
+ // virtual envelope + nof constituents > 0
+ // => do not place envelope and place constituents
+ // in ALICE by composed transformation:
+ // Tglobal * Tch * Tenv * Tconst
+
+ for (Int_t l=0; l<env->GetConstituents()->GetEntriesFast(); l++) {
+ AliMUONGeometryConstituent* constituent
+ = (AliMUONGeometryConstituent*)env->GetConstituents()->At(l);
+
+ // Compound chamber transformation with the envelope one + the constituent one
+ TGeoHMatrix total
+ = (*fGlobalTransformation) *
+ (*geometry->GetTransformation()) *
+ (*kEnvTrans) *
+ (*constituent->GetTransformation());
+
+ PlaceVolume(constituent->GetName(), geometry->GetMotherVolume(),
+ constituent->GetCopyNo(), total,
+ constituent->GetNpar(), constituent->GetParam(), only);
+ }
+ }
+ }
+ }
+}
+
+//_____________________________________________________________________________
+void AliMUONGeometryBuilder::CreateMaterials()
+{
+// Definition of common materials
+// --
+
+ //
+ // Ar-CO2 gas (80%+20%)
+ Float_t ag1[3] = { 39.95,12.01,16. };
+ Float_t zg1[3] = { 18.,6.,8. };
+ Float_t wg1[3] = { .8,.0667,.13333 };
+ Float_t dg1 = .001821;
+ //
+ // Ar-buthane-freon gas -- trigger chambers
+ Float_t atr1[4] = { 39.95,12.01,1.01,19. };
+ Float_t ztr1[4] = { 18.,6.,1.,9. };
+ Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
+ Float_t dtr1 = .002599;
+ //
+ // Ar-CO2 gas
+ Float_t agas[3] = { 39.95,12.01,16. };
+ Float_t zgas[3] = { 18.,6.,8. };
+ Float_t wgas[3] = { .74,.086684,.173316 };
+ Float_t dgas = .0018327;
+ //
+ // Ar-Isobutane gas (80%+20%) -- tracking
+ Float_t ag[3] = { 39.95,12.01,1.01 };
+ Float_t zg[3] = { 18.,6.,1. };
+ Float_t wg[3] = { .8,.057,.143 };
+ Float_t dg = .0019596;
+ //
+ // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
+ Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
+ Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
+ Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
+ Float_t dtrig = .0031463;
+ //
+ // bakelite
+
+ Float_t abak[3] = {12.01 , 1.01 , 16.};
+ Float_t zbak[3] = {6. , 1. , 8.};
+ Float_t wbak[3] = {6. , 6. , 1.};
+ Float_t dbak = 1.4;
+
+ Int_t iSXFLD = gAlice->Field()->Integ();
+ Float_t sXMGMX = gAlice->Field()->Max();
+ //
+ // --- Define the various materials for GEANT ---
+ fMUON->AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
+ fMUON->AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
+ // Air
+ Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
+ Float_t zAir[4]={6.,7.,8.,18.};
+ Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
+ Float_t dAir = 1.20479E-3;
+ fMUON->AliMixture(15, "AIR$ ", aAir, zAir, dAir,4, wAir);
+ // fMUON->AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
+ fMUON->AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
+ fMUON->AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
+ fMUON->AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
+ fMUON->AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
+ fMUON->AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
+ fMUON->AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
+ // materials for slat:
+ // Sensitive area: gas (already defined)
+ // PCB: copper
+ // insulating material and frame: vetronite
+ // walls: carbon, rohacell, carbon
+ Float_t aglass[5]={12.01, 28.09, 16., 10.8, 23.};
+ Float_t zglass[5]={ 6., 14., 8., 5., 11.};
+ Float_t wglass[5]={ 0.5, 0.105, 0.355, 0.03, 0.01};
+ Float_t dglass=1.74;
+
+ // rohacell: C9 H13 N1 O2
+ Float_t arohac[4] = {12.01, 1.01, 14.010, 16.};
+ Float_t zrohac[4] = { 6., 1., 7., 8.};
+ Float_t wrohac[4] = { 9., 13., 1., 2.};
+ Float_t drohac = 0.03;
+
+ fMUON->AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
+ fMUON->AliMixture(32, "Vetronite$",aglass, zglass, dglass, 5, wglass);
+ fMUON->AliMaterial(33, "Carbon$", 12.01, 6., 2.265, 18.8, 49.9);
+ fMUON->AliMixture(34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac);
+
+ Float_t epsil = .001; // Tracking precision,
+ Float_t stemax = -1.; // Maximum displacement for multiple scat
+ Float_t tmaxfd = -20.; // Maximum angle due to field deflection
+ Float_t deemax = -.3; // Maximum fractional energy loss, DLS
+ Float_t stmin = -.8;
+ Float_t maxDestepAlu = fMUON->GetMaxDestepAlu();
+ Float_t maxDestepGas = fMUON->GetMaxDestepGas();
+ Float_t maxStepAlu = fMUON->GetMaxStepAlu();
+ Float_t maxStepGas = fMUON->GetMaxStepGas();
+
+ //
+ // Air
+ fMUON->AliMedium(1, "AIR_CH_US ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
+ //
+ // Aluminum
+
+ fMUON->AliMedium(4, "ALU_CH_US ", 9, 0, iSXFLD, sXMGMX, tmaxfd, maxStepAlu,
+ maxDestepAlu, epsil, stmin);
+ fMUON->AliMedium(5, "ALU_CH_US ", 10, 0, iSXFLD, sXMGMX, tmaxfd, maxStepAlu,
+ maxDestepAlu, epsil, stmin);
+ //
+ // Ar-isoC4H10 gas
+
+ fMUON->AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, tmaxfd, maxStepGas,
+ maxDestepGas, epsil, stmin);
+//
+ // Ar-Isobuthane-Forane-SF6 gas
+
+ fMUON->AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
+
+ fMUON->AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, tmaxfd, maxStepAlu,
+ maxDestepAlu, epsil, stmin);
+
+ fMUON->AliMedium(9, "ARG_CO2 ", 22, 1, iSXFLD, sXMGMX, tmaxfd, maxStepGas,
+ maxDestepAlu, epsil, stmin);
+ // tracking media for slats: check the parameters!!
+ fMUON->AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd,
+ maxStepAlu, maxDestepAlu, epsil, stmin);
+ fMUON->AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd,
+ maxStepAlu, maxDestepAlu, epsil, stmin);
+ fMUON->AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd,
+ maxStepAlu, maxDestepAlu, epsil, stmin);
+ fMUON->AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd,
+ maxStepAlu, maxDestepAlu, epsil, stmin);
+
+
+
+ //.Materials specific to stations
+ // created via builders
+
+ for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
+
+ // Get the builder
+ AliMUONVGeometryBuilder* builder
+ = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
+
+ // Create materials with each builder
+ if (builder) builder->CreateMaterials();
+ }
+}
+
+//______________________________________________________________________________
+void AliMUONGeometryBuilder::InitGeometry()
+{
+ // Initialize geometry
+ // ---
+
+ //
+ // Set the chamber (sensitive region) GEANT identifier
+ //
+ for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
+
+ // Get the builder
+ AliMUONVGeometryBuilder* builder
+ = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
+
+ // Set sesitive volumes with each builder
+ if (builder) builder->SetSensitiveVolumes();
+ }
+}
+
+//_____________________________________________________________________________
+void AliMUONGeometryBuilder::AddBuilder(AliMUONVGeometryBuilder* geomBuilder)
+{
+// Adds the geometry builder to the list
+// ---
+
+ fGeometryBuilders->Add(geomBuilder);
+}
+
--- /dev/null
+#ifndef ALI_MUON_GEOMETRY_BUILDER_H
+#define ALI_MUON_GEOMETRY_BUILDER_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+// $Id$
+//
+// Class AliMUONGeometryBuilder
+// ----------------------------
+// MUON manager class for geometry construction,
+// separated form AliMUONv1
+//
+// Author: Ivana Hrivnacova, IPN Orsay
+
+#include <TObject.h>
+
+class TGeoCombiTrans;
+class TGeoHMatrix;
+class TObjArray;
+
+class AliMUON;
+class AliMUONVGeometryBuilder;
+
+class AliMUONGeometryBuilder : public TObject
+{
+ public:
+ AliMUONGeometryBuilder();
+ AliMUONGeometryBuilder(AliMUON* muon);
+ virtual ~AliMUONGeometryBuilder();
+
+ void CreateGeometry();
+ void CreateMaterials();
+ void InitGeometry();
+
+ void AddBuilder(AliMUONVGeometryBuilder* geomBuilder);
+
+ protected:
+ AliMUONGeometryBuilder(const AliMUONGeometryBuilder& right);
+ AliMUONGeometryBuilder& operator = (const AliMUONGeometryBuilder& right);
+
+ private:
+ // method
+ void PlaceVolume(const TString& name, const TString& mName, Int_t copyNo,
+ const TGeoHMatrix& matrix, Int_t npar, Double_t* param,
+ const char* only) const;
+
+ // data members
+ AliMUON* fMUON; // MUON detector
+ TGeoCombiTrans* fGlobalTransformation;// global transformation
+ // applied to the whole geometry
+ TObjArray* fGeometryBuilders; // List of Geometry Builders
+
+ ClassDef(AliMUONGeometryBuilder,2) // MUON Detector class Version 1
+};
+
+#endif //ALI_MUON_GEOMETRY_BUILDER_H
+
+
+
+
+
+
+
#include <TF1.h>
#include <TClonesArray.h>
#include <TRandom.h>
-#include <TGeoMatrix.h>
#include <TVirtualMC.h>
#include "AliMUONv1.h"
#include "AliMUONFactory.h"
#include "AliMUONHit.h"
#include "AliMUONTriggerCircuit.h"
-#include "AliMUONVGeometryBuilder.h"
-#include "AliMUONChamberGeometry.h"
-#include "AliMUONGeometryEnvelope.h"
-#include "AliMUONGeometryConstituent.h"
+#include "AliMUONGeometryBuilder.h"
#include "AliMagF.h"
#include "AliRun.h"
#include "AliMC.h"
//___________________________________________
AliMUONv1::AliMUONv1()
: AliMUON(),
- fTrackMomentum(), fTrackPosition(),fGlobalTransformation(0)
+ fStepManagerVersionOld(kFALSE),
+ fAngleEffect(kTRUE),
+ fStepMaxInActiveGas(0.6),
+ fStepSum(0x0),
+ fDestepSum(0x0),
+ fTrackMomentum(),
+ fTrackPosition(),
+ fElossRatio(0x0),
+ fAngleEffect10(0x0),
+ fAngleEffectNorma(0x0)
{
-// Constructor
- fChambers = 0;
- fStepManagerVersionOld = kFALSE;
- fAngleEffect = kTRUE;
- fStepMaxInActiveGas = 0.6;
- fStepSum = 0x0;
- fDestepSum = 0x0;
- fElossRatio = 0x0;
- fAngleEffect10 = 0x0;
- fAngleEffectNorma= 0x0;
+// Default constructor
}
+
//___________________________________________
AliMUONv1::AliMUONv1(const char *name, const char *title)
- : AliMUON(name,title), fTrackMomentum(), fTrackPosition()
+ : AliMUON(name,title),
+ fStepManagerVersionOld(kFALSE),
+ fAngleEffect(kTRUE),
+ fStepMaxInActiveGas(0.6),
+ fStepSum(0x0),
+ fDestepSum(0x0),
+ fTrackMomentum(),
+ fTrackPosition(),
+ fElossRatio(0x0),
+ fAngleEffect10(0x0),
+ fAngleEffectNorma(0x0)
{
-// Constructor
+// Standard onstructor
+
// By default include all stations
AliMUONFactory factory;
factory.Build(this, title);
- fStepManagerVersionOld = kFALSE;
- fAngleEffect = kTRUE;
- fStepMaxInActiveGas = 0.6;
-
fStepSum = new Float_t [AliMUONConstants::NCh()];
fDestepSum = new Float_t [AliMUONConstants::NCh()];
for (Int_t i=0; i<AliMUONConstants::NCh(); i++) {
fAngleEffectNorma->SetParameter(1,-6.809e-01);
fAngleEffectNorma->SetParameter(2,5.151e-02);
fAngleEffectNorma->SetParameter(3,-1.490e-03);
-
- // Define the global transformation:
- // Transformation from the old ALICE coordinate system to a new one:
- // x->-x, z->-z
- TGeoRotation* rotGlobal
- = new TGeoRotation("rotGlobal", 90., 180., 90., 90., 180., 0.);
- fGlobalTransformation = new TGeoCombiTrans(0., 0., 0., rotGlobal);
}
//_____________________________________________________________________________
{
// Destructor
- delete fGlobalTransformation;
+ delete [] fStepSum;
+ delete [] fDestepSum;
+ delete fElossRatio;
+ delete fAngleEffect10;
+ delete fAngleEffectNorma;
}
//_____________________________________________________________________________
void AliMUONv1::CreateGeometry()
{
//
-// Construct geometry using geometry builders.
+// Construct geometry using geometry builder
//
- for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
-
- // Get the builder
- AliMUONVGeometryBuilder* builder
- = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
-
- // Create geometry with each builder
- if (builder) {
- builder->CreateGeometry();
- builder->SetTransformations();
- }
- }
-
- for (Int_t j=0; j<AliMUONConstants::NCh(); j++) {
-
- AliMUONChamberGeometry* geometry = Chamber(j).GetGeometry();
-
- if (!geometry) continue;
- // Skip chambers with not defined geometry
-
- // Loop over envelopes
- const TObjArray* kEnvelopes = geometry->GetEnvelopes();
- for (Int_t k=0; k<kEnvelopes->GetEntriesFast(); k++) {
-
- // 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
- // => not allowed;
- // empty virtual envelope has no sense
- Fatal("CreateGeometry", "Virtual envelope must have constituents.");
- return;
- }
-
- if (!env->IsVirtual() && env->GetConstituents()->GetEntriesFast() > 0 ) {
- // non virtual envelope + nof constituents > 0
- // => not allowed;
- // use VMC to place constituents
- Fatal("CreateGeometry", "Non virtual envelope cannot have constituents.");
- return;
- }
-
- if (!env->IsVirtual() && env->GetConstituents()->GetEntriesFast() == 0 ) {
- // non virtual envelope + nof constituents = 0
- // => place envelope in ALICE by composed transformation:
- // Tglobal * Tch * Tenv
-
- // Compound chamber transformation with the envelope one
- TGeoHMatrix total
- = (*fGlobalTransformation) *
- (*geometry->GetTransformation()) *
- (*kEnvTrans);
- PlaceVolume(env->GetName(), geometry->GetMotherVolume(),
- env->GetCopyNo(), total, 0, 0, only);
- }
-
- if (env->IsVirtual() && env->GetConstituents()->GetEntriesFast() > 0 ) {
- // virtual envelope + nof constituents > 0
- // => do not place envelope and place constituents
- // in ALICE by composed transformation:
- // Tglobal * Tch * Tenv * Tconst
-
- for (Int_t l=0; l<env->GetConstituents()->GetEntriesFast(); l++) {
- AliMUONGeometryConstituent* constituent
- = (AliMUONGeometryConstituent*)env->GetConstituents()->At(l);
-
- // Compound chamber transformation with the envelope one + the constituent one
- TGeoHMatrix total
- = (*fGlobalTransformation) *
- (*geometry->GetTransformation()) *
- (*kEnvTrans) *
- (*constituent->GetTransformation());
-
- PlaceVolume(constituent->GetName(), geometry->GetMotherVolume(),
- constituent->GetCopyNo(), total,
- constituent->GetNpar(), constituent->GetParam(), only);
- }
- }
- }
- }
+ fGeometryBuilder->CreateGeometry();
}
-//__________________________________________________________________
-Int_t AliMUONv1::GetChamberId(Int_t volId) const
-{
-// Check if the volume with specified volId is a sensitive volume (gas)
-// of some chamber and returns the chamber number;
-// if not sensitive volume - return 0.
-// ---
-
-/*
- for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++)
- if (volId==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()) return i;
-*/
- for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++)
- if ( ((AliMUONChamber*)(*fChambers)[i-1])->IsSensId(volId) ) return i;
- return 0;
-}
//________________________________________________________________
void AliMUONv1::CreateMaterials()
{
-
- // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
- //
- // Ar-CO2 gas (80%+20%)
- Float_t ag1[3] = { 39.95,12.01,16. };
- Float_t zg1[3] = { 18.,6.,8. };
- Float_t wg1[3] = { .8,.0667,.13333 };
- Float_t dg1 = .001821;
- //
- // Ar-buthane-freon gas -- trigger chambers
- Float_t atr1[4] = { 39.95,12.01,1.01,19. };
- Float_t ztr1[4] = { 18.,6.,1.,9. };
- Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
- Float_t dtr1 = .002599;
- //
- // Ar-CO2 gas
- Float_t agas[3] = { 39.95,12.01,16. };
- Float_t zgas[3] = { 18.,6.,8. };
- Float_t wgas[3] = { .74,.086684,.173316 };
- Float_t dgas = .0018327;
- //
- // Ar-Isobutane gas (80%+20%) -- tracking
- Float_t ag[3] = { 39.95,12.01,1.01 };
- Float_t zg[3] = { 18.,6.,1. };
- Float_t wg[3] = { .8,.057,.143 };
- Float_t dg = .0019596;
- //
- // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
- Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
- Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
- Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
- Float_t dtrig = .0031463;
- //
- // bakelite
-
- Float_t abak[3] = {12.01 , 1.01 , 16.};
- Float_t zbak[3] = {6. , 1. , 8.};
- Float_t wbak[3] = {6. , 6. , 1.};
- Float_t dbak = 1.4;
-
- Float_t epsil, stmin, deemax, tmaxfd, stemax;
-
- Int_t iSXFLD = gAlice->Field()->Integ();
- Float_t sXMGMX = gAlice->Field()->Max();
- //
- // --- Define the various materials for GEANT ---
- AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
- AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
- // Air
- Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
- Float_t zAir[4]={6.,7.,8.,18.};
- Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
- Float_t dAir = 1.20479E-3;
- AliMixture(15, "AIR$ ", aAir, zAir, dAir,4, wAir);
- // AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
- AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
- AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
- AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
- AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
- AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
- AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
- // materials for slat:
- // Sensitive area: gas (already defined)
- // PCB: copper
- // insulating material and frame: vetronite
- // walls: carbon, rohacell, carbon
- Float_t aglass[5]={12.01, 28.09, 16., 10.8, 23.};
- Float_t zglass[5]={ 6., 14., 8., 5., 11.};
- Float_t wglass[5]={ 0.5, 0.105, 0.355, 0.03, 0.01};
- Float_t dglass=1.74;
-
- // rohacell: C9 H13 N1 O2
- Float_t arohac[4] = {12.01, 1.01, 14.010, 16.};
- Float_t zrohac[4] = { 6., 1., 7., 8.};
- Float_t wrohac[4] = { 9., 13., 1., 2.};
- Float_t drohac = 0.03;
-
- AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
- AliMixture(32, "Vetronite$",aglass, zglass, dglass, 5, wglass);
- AliMaterial(33, "Carbon$", 12.01, 6., 2.265, 18.8, 49.9);
- AliMixture(34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac);
-
-
- epsil = .001; // Tracking precision,
- stemax = -1.; // Maximum displacement for multiple scat
- tmaxfd = -20.; // Maximum angle due to field deflection
- deemax = -.3; // Maximum fractional energy loss, DLS
- stmin = -.8;
- //
- // Air
- AliMedium(1, "AIR_CH_US ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
- //
- // Aluminum
-
- AliMedium(4, "ALU_CH_US ", 9, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
- fMaxDestepAlu, epsil, stmin);
- AliMedium(5, "ALU_CH_US ", 10, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
- fMaxDestepAlu, epsil, stmin);
- //
- // Ar-isoC4H10 gas
-
- AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
- fMaxDestepGas, epsil, stmin);
//
- // Ar-Isobuthane-Forane-SF6 gas
-
- AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
-
- AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
- fMaxDestepAlu, epsil, stmin);
-
- AliMedium(9, "ARG_CO2 ", 22, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
- fMaxDestepAlu, epsil, stmin);
- // tracking media for slats: check the parameters!!
- AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd,
- fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
- AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd,
- fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
- AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd,
- fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
- AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd,
- fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
-
-
-
- //.Materials specific to stations
- // created via builders
-
- for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
-
- // Get the builder
- AliMUONVGeometryBuilder* builder
- = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
+// Construct materials using geometry builder
+//
- // Create materials with each builder
- if (builder) builder->CreateMaterials();
- }
+ fGeometryBuilder->CreateMaterials();
}
-//______________________________________________________________________________
-void AliMUONv1::PlaceVolume(const TString& name, const TString& mName,
- Int_t copyNo, const TGeoHMatrix& matrix,
- Int_t npar, Double_t* param, const char* only) const
-{
-// Place the volume specified by name with the given transformation matrix
-// ---
-
- // Do not apply global transformation
- // if mother volume == DDIP
- // (as it is applied on this volume)
- TGeoHMatrix transform(matrix);
- if (mName == TString("DDIP")) {
- transform = (*fGlobalTransformation) * transform;
- // To be changed to (*fGlobalTransformation).inverse()
- // when available in TGeo
- // To make this correct also for a general case when
- // (*fGlobalTransformation) * *fGlobalTransformation) != 1
- }
-
- // Decompose transformation
- const Double_t* xyz = transform.GetTranslation();
- const Double_t* rm = transform.GetRotationMatrix();
-
- //cout << "Got translation: "
- // << xyz[0] << " " << xyz[1] << " " << xyz[2] << endl;
-
- //cout << "Got rotation: "
- // << rm[0] << " " << rm[1] << " " << rm[2] << endl
- // << rm[3] << " " << rm[4] << " " << rm[5] << endl
- // << rm[6] << " " << rm[7] << " " << rm[8] << endl;
-
- // Check for presence of rotation
- // (will be nice to be available in TGeo)
- const Double_t kTolerance = 1e-04;
- Bool_t isRotation = true;
- if (TMath::Abs(rm[0] - 1.) < kTolerance &&
- TMath::Abs(rm[1] - 0.) < kTolerance &&
- TMath::Abs(rm[2] - 0.) < kTolerance &&
- TMath::Abs(rm[3] - 0.) < kTolerance &&
- TMath::Abs(rm[4] - 1.) < kTolerance &&
- TMath::Abs(rm[5] - 0.) < kTolerance &&
- TMath::Abs(rm[6] - 0.) < kTolerance &&
- TMath::Abs(rm[7] - 0.) < kTolerance &&
- TMath::Abs(rm[8] - 1.) < kTolerance) isRotation = false;
-
- Int_t krot = 0;
- if (isRotation) {
- TGeoRotation rot;
- rot.SetMatrix(const_cast<Double_t*>(transform.GetRotationMatrix()));
- Double_t theta1, phi1, theta2, phi2, theta3, phi3;
- rot.GetAngles(theta1, phi1, theta2, phi2, theta3, phi3);
-
- //cout << "angles: "
- // << theta1 << " " << phi1 << " "
- // << theta2 << " " << phi2 << " "
- // << theta3 << " " << phi3 << endl;
-
- AliMatrix(krot, theta1, phi1, theta2, phi2, theta3, phi3);
- }
-
- // Place the volume in ALIC
- 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,
- param, npar);
-
-}
-
//___________________________________________
void AliMUONv1::Init()
{
}
//
- // Set the chamber (sensitive region) GEANT identifier
- //
- for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
-
- // Get the builder
- AliMUONVGeometryBuilder* builder
- = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
-
- // Set sesitive volumes with each builder
- if (builder) builder->SetSensitiveVolumes();
- }
-
-/*
+ // Initialize geometry
//
- // Set the chamber (sensitive region) GEANT identifier
- ((AliMUONChamber*)(*fChambers)[0])->SetGid(gMC->VolId("S01G"));
- ((AliMUONChamber*)(*fChambers)[1])->SetGid(gMC->VolId("S02G"));
-
- ((AliMUONChamber*)(*fChambers)[2])->SetGid(gMC->VolId("S03G"));
- ((AliMUONChamber*)(*fChambers)[3])->SetGid(gMC->VolId("S04G"));
-
- ((AliMUONChamber*)(*fChambers)[4])->SetGid(gMC->VolId("S05G"));
- ((AliMUONChamber*)(*fChambers)[5])->SetGid(gMC->VolId("S06G"));
-
- ((AliMUONChamber*)(*fChambers)[6])->SetGid(gMC->VolId("S07G"));
- ((AliMUONChamber*)(*fChambers)[7])->SetGid(gMC->VolId("S08G"));
-
- ((AliMUONChamber*)(*fChambers)[8])->SetGid(gMC->VolId("S09G"));
- ((AliMUONChamber*)(*fChambers)[9])->SetGid(gMC->VolId("S10G"));
-
- ((AliMUONChamber*)(*fChambers)[10])->SetGid(gMC->VolId("SG1A"));
- ((AliMUONChamber*)(*fChambers)[11])->SetGid(gMC->VolId("SG2A"));
- ((AliMUONChamber*)(*fChambers)[12])->SetGid(gMC->VolId("SG3A"));
- ((AliMUONChamber*)(*fChambers)[13])->SetGid(gMC->VolId("SG4A"));
-*/
+ fGeometryBuilder->InitGeometry();
if(fDebug) printf("\n%s: Finished Init for version 1 - CPC chamber type\n",ClassName());
//cp
//cp
}
+//__________________________________________________________________
+Int_t AliMUONv1::GetChamberId(Int_t volId) const
+{
+// Check if the volume with specified volId is a sensitive volume (gas)
+// of some chamber and returns the chamber number;
+// if not sensitive volume - return 0.
+// ---
+
+/*
+ for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++)
+ if (volId==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()) return i;
+*/
+ for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++)
+ if ( ((AliMUONChamber*)(*fChambers)[i-1])->IsSensId(volId) ) return i;
+
+ return 0;
+}
//_______________________________________________________________________________
void AliMUONv1::StepManager()
{
AliMUONv1(const AliMUONv1& right);
AliMUONv1& operator = (const AliMUONv1& right);
+ virtual Int_t GetChamberId(Int_t volId) const;
+
Bool_t fStepManagerVersionOld; // Version of StepManager, Default is false
Bool_t fAngleEffect; // Angle Effect along wires, Default is true
Float_t fStepMaxInActiveGas; // Step max in active gas default 0.6cm
- virtual Int_t GetChamberId(Int_t volId) const;
// StepManager
Float_t * fStepSum; //!
TF1 * fElossRatio; // Ratio of particle mean eloss with respect MIP's
TF1 * fAngleEffect10; // Angle effect in tracking chambers at theta =10 degres as a function of ElossRatio (Khalil BOUDJEMLINE sep 2003 Ph.D Thesis) (in micrometers)
TF1 * fAngleEffectNorma;// Angle effect: Normalisation form theta=10 degres to theta between 0 and 10 (Khalil BOUDJEMLINE sep 2003 Ph.D Thesis)
- TGeoCombiTrans* fGlobalTransformation; // global transformation
- // applied to the whole geometry
+
private:
// method
void PlaceVolume(const TString& name, const TString& mName, Int_t copyNo,
#pragma link C++ class AliMUONSt1SpecialMotif+;
#pragma link C++ class AliMUONSt1ResponseParameter+;
#pragma link C++ class AliMUONSt1ResponseRule+;
+#pragma link C++ class AliMUONGeometryBuilder+;
+#pragma link C++ class AliMUONVGeometryBuilder+;
#pragma link C++ class AliMUONChamberGeometry+;
#pragma link C++ class AliMUONGeometryConstituent+;
#pragma link C++ class AliMUONGeometryEnvelope+;
#pragma link C++ class AliMUONSt2GeometryBuilder+;
#pragma link C++ class AliMUONSlatGeometryBuilder+;
#pragma link C++ class AliMUONTriggerGeometryBuilder+;
-#pragma link C++ class AliMUONVGeometryBuilder+;
#include "MUONLinkDefMapping.h"
#endif
AliMUONSegmentationDetectionElement.cxx AliMUONSegmentIndex.cxx \
AliMUONSegmentManuIndex.cxx AliMUONSegmentPosition.cxx\
AliMUON.cxx AliMUONv0.cxx AliMUONv1.cxx AliMUONv3.cxx \
+ AliMUONGeometryBuilder.cxx \
AliMUONChamberGeometry.cxx AliMUONGeometryConstituent.cxx AliMUONGeometryEnvelope.cxx \
AliMUONVGeometryBuilder.cxx AliMUONSt1GeometryBuilder.cxx AliMUONSt1GeometryBuilderV2.cxx \
AliMUONSt2GeometryBuilder.cxx AliMUONSlatGeometryBuilder.cxx \