Reversing previous commit (Gines)
authormartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Oct 2004 11:46:15 +0000 (11:46 +0000)
committermartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Oct 2004 11:46:15 +0000 (11:46 +0000)
86 files changed:
MUON/AliMUON.cxx
MUON/AliMUONChamber.cxx
MUON/AliMUONChamberGeometry.cxx
MUON/AliMUONChamberTrigger.cxx
MUON/AliMUONClusterFinderAZ.cxx
MUON/AliMUONClusterFinderVS.cxx
MUON/AliMUONClusterInput.cxx
MUON/AliMUONClusterReconstructor.cxx
MUON/AliMUONConstants.cxx
MUON/AliMUONConstants.h
MUON/AliMUONDDLTracker.cxx
MUON/AliMUONDDLTrigger.cxx
MUON/AliMUONData.cxx
MUON/AliMUONDataInterface.cxx
MUON/AliMUONDigit.cxx
MUON/AliMUONDigitizer.cxx
MUON/AliMUONDigitizerv1.cxx
MUON/AliMUONDigitizerv2.cxx
MUON/AliMUONDisplay.cxx
MUON/AliMUONEventReconstructor.cxx
MUON/AliMUONFactory.cxx
MUON/AliMUONGeometryBuilder.cxx
MUON/AliMUONGeometryConstituent.cxx
MUON/AliMUONGeometryEnvelope.cxx
MUON/AliMUONGeometryEnvelopeStore.cxx
MUON/AliMUONGeometrySVMap.cxx
MUON/AliMUONGeometryTransformStore.cxx
MUON/AliMUONGlobalTrigger.cxx
MUON/AliMUONHit.cxx
MUON/AliMUONHitForRec.cxx
MUON/AliMUONHitMapA1.cxx
MUON/AliMUONLoader.cxx
MUON/AliMUONMerger.cxx
MUON/AliMUONPadHit.cxx
MUON/AliMUONPoints.cxx
MUON/AliMUONRawData.cxx
MUON/AliMUONRawStream.cxx
MUON/AliMUONRecoDisplay.cxx
MUON/AliMUONRecoEvent.cxx
MUON/AliMUONRecoTrack.cxx
MUON/AliMUONReconstructor.cxx
MUON/AliMUONResponseV0.cxx
MUON/AliMUONSDigitizerv1.cxx
MUON/AliMUONSegment.cxx
MUON/AliMUONSegment.h
MUON/AliMUONSegmentIndex.cxx
MUON/AliMUONSegmentManuIndex.cxx
MUON/AliMUONSegmentPosition.cxx
MUON/AliMUONSegmentationDetectionElement.cxx
MUON/AliMUONSegmentationSlat.cxx
MUON/AliMUONSegmentationSlat.h
MUON/AliMUONSegmentationSlatModule.cxx
MUON/AliMUONSegmentationSlatN.cxx
MUON/AliMUONSegmentationTrigger.cxx
MUON/AliMUONSegmentationTriggerX.cxx
MUON/AliMUONSegmentationTriggerY.cxx
MUON/AliMUONSegmentationV0.cxx
MUON/AliMUONSegmentationV01.cxx
MUON/AliMUONSlatGeometryBuilder.cxx
MUON/AliMUONSt1GeometryBuilder.cxx
MUON/AliMUONSt1GeometryBuilderV2.cxx
MUON/AliMUONSt1Response.cxx
MUON/AliMUONSt1ResponseParameter.cxx
MUON/AliMUONSt1ResponseRule.cxx
MUON/AliMUONSt1Segmentation.cxx
MUON/AliMUONSt1SpecialMotif.cxx
MUON/AliMUONSt2GeometryBuilder.cxx
MUON/AliMUONSubEventTracker.cxx
MUON/AliMUONSubEventTrigger.cxx
MUON/AliMUONSubEventTrigger.h
MUON/AliMUONTrack.cxx
MUON/AliMUONTrack.h
MUON/AliMUONTrackHit.cxx
MUON/AliMUONTrackHit.h
MUON/AliMUONTrackK.cxx
MUON/AliMUONTrackParam.cxx
MUON/AliMUONTransientDigit.cxx
MUON/AliMUONTriggerCircuit.cxx
MUON/AliMUONTriggerDecision.cxx
MUON/AliMUONTriggerGeometryBuilder.cxx
MUON/AliMUONTriggerLut.cxx
MUON/AliMUONVGeometryBuilder.cxx
MUON/AliMUONproto.cxx
MUON/AliMUONv1.cxx
MUON/AliMUONv3.cxx
MUON/MUONCheck.C

index 74f787d..651467d 100644 (file)
@@ -64,7 +64,6 @@
 #include "AliMUONDigitizerv2.h"
 #include "AliMUONSDigitizerv1.h"
 #include "AliMUONRawData.h"
-#include "AliLog.h"
 
 // Defaults parameters for Z positions of chambers
 // taken from values for "stations" in AliMUON::AliMUON
@@ -180,14 +179,14 @@ AliMUON::AliMUON(const AliMUON& rMUON)
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONMergerModule", "Not implemented.");
 }
 
 //____________________________________________________________________
 AliMUON::~AliMUON()
 {
 // Destructor
-  AliDebug(1,"Calling AliMUON destructor");
+  if(fDebug) printf("%s: Calling AliMUON destructor !!!\n",ClassName());
   fIshunt  = 0;
   if (fMerger) delete fMerger;
 
@@ -210,7 +209,7 @@ AliMUON& AliMUON::operator = (const AliMUON& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }
@@ -432,9 +431,11 @@ void AliMUON::SDigits2Digits()
 // write TreeD here 
 
     if (!fMerger) {
-               AliDebug(1,"Create default AliMUONMerger ");
-               AliDebug(1," no merging, just digitization of 1 event will be done");
-       fMerger = new AliMUONMerger();
+      if (gAlice->GetDebug()>0) {
+       cerr<<"AliMUON::SDigits2Digits: create default AliMUONMerger "<<endl;
+       cerr<<" no merging, just digitization of 1 event will be done"<<endl;
+      }
+      fMerger = new AliMUONMerger();
     }
     fMerger->Init();
     fMerger->Digitise();
@@ -466,7 +467,7 @@ void AliMUON::Digits2Raw()
   AliMUONRawData* rawData;
 
   rawData = new AliMUONRawData(fLoader);
-  if (!rawData->WriteRawData()) AliInfo("pb writting raw data");
+  if (!rawData->WriteRawData()) Info("MUON","pb writting raw data");
   delete rawData;
   return;
 }
@@ -476,9 +477,10 @@ AliLoader* AliMUON::MakeLoader(const char* topfoldername)
 //builds standard getter (AliLoader type)
 //if detector wants to use castomized getter, it must overload this method
 
- AliDebug(1,Form("Creating standard getter for detector %s. Top folder is %s.",
-         GetName(),topfoldername));
+ if (GetDebug())
+   Info("MakeLoader",
+        "Creating standard getter for detector %s. Top folder is %s.",
+         GetName(),topfoldername);
  fLoader   = new AliLoader(GetName(),topfoldername);
  fMUONData = new AliMUONData(fLoader,GetName(),GetName()); 
  fMUONData->SetSplitLevel(fSplitLevel);
index 68e78d3..710005f 100644 (file)
@@ -22,7 +22,6 @@
 // --- MUON includes ---
 #include "AliMUONChamber.h"
 #include "AliMUONChamberGeometry.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONChamber)       
 
@@ -72,7 +71,7 @@ AliMUONChamber::AliMUONChamber(const AliMUONChamber& rChamber)
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONMergerModule", "Not implemented.");
  // Dummy copy constructor
 }
 
@@ -92,7 +91,7 @@ AliMUONChamber & AliMUONChamber::operator =(const AliMUONChamber& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }
@@ -209,7 +208,7 @@ void AliMUONChamber::DisIntegration(Float_t eloss, Float_t /*tof*/,
                if (nnew >= 500) // Perform a bounds check on nnew since it is assumed
                                 // newclust only contains 500 elements.
                {
-                       AliError("Limit of 500 pad responses reached.");
+                       Error("DisIntegration", "Limit of 500 pad responses reached.");
                        return;
                };
                //
index 1690c00..93ef7d3 100644 (file)
@@ -17,7 +17,6 @@
 #include "AliMUONGeometryEnvelopeStore.h"
 #include "AliMUONGeometryTransformStore.h"     
 #include "AliMUONConstants.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONChamberGeometry)
 
@@ -74,7 +73,8 @@ AliMUONChamberGeometry::AliMUONChamberGeometry()
 AliMUONChamberGeometry::AliMUONChamberGeometry(const AliMUONChamberGeometry& rhs)
   : TObject(rhs)
 {
-  AliFatal("Copy constructor is not implemented.");
+  Fatal("Copy constructor", 
+        "Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -95,7 +95,8 @@ AliMUONChamberGeometry::operator = (const AliMUONChamberGeometry& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  AliFatal("Assignment operator is not implemented.");
+  Fatal("operator=", 
+        "Assignment operator is not implemented.");
     
   return *this;  
 }
index 57f73fd..289ea24 100644 (file)
@@ -63,7 +63,7 @@ void AliMUONChamberTrigger::DisIntegration(Float_t /*eloss*/, Float_t tof,
     
     segmentation->GetPadI(xhit,yhit,0,ix,iy);
     segmentation->SetPad(ix,iy);
-       
+
 // treatment of GEANT hits w/o corresponding strip (due to the fact that
 // the 2 geometries are computed in a very slightly different way) 
     if (ix==0&&iy==0) {
index fa2c0ef..e653dab 100644 (file)
@@ -41,7 +41,6 @@
 #include "AliMUONClusterInput.h"
 #include "AliMUONPixel.h"
 #include "AliMC.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONClusterFinderAZ)
  
@@ -80,7 +79,7 @@ AliMUONClusterFinderAZ::AliMUONClusterFinderAZ(const AliMUONClusterFinderAZ& rhs
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONClusterFinderAZModule", "Not implemented.");
 }
 
 //_____________________________________________________________________________
@@ -158,7 +157,8 @@ newev:
       muon->ResetRawClusters();
       nent = (Int_t) treeR->GetEntries();
       if (nent != 1) {
-               AliError(Form("nent = %d not equal to 1",nent));
+       cout << "Error in MUONdrawClust" << endl;
+       cout << " nent = " <<  nent << " not equal to 1" << endl;
        //exit(0);
       }
     } // if (treeR)
@@ -2499,7 +2499,7 @@ AliMUONClusterFinderAZ::operator=(const AliMUONClusterFinderAZ& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }    
index a2c713a..f27e356 100644 (file)
@@ -25,7 +25,6 @@
 #include "AliMUONResponse.h"
 #include "AliMUONClusterInput.h"
 #include "AliMUONHitMapA1.h"
-#include "AliLog.h"
 
 //_____________________________________________________________________
 // This function is minimized in the double-Mathieson fit
@@ -71,7 +70,7 @@ AliMUONClusterFinderVS::AliMUONClusterFinderVS(const AliMUONClusterFinderVS & cl
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONClusterFinderAZModule", "Not implemented.");
 }
 //____________________________________________________________________________
 void AliMUONClusterFinderVS::ResetRawClusters()
@@ -147,14 +146,16 @@ void AliMUONClusterFinderVS::SplitByLocalMaxima(AliMUONRawCluster *c)
            fXInit[0]=c->GetX(1);
            fYInit[0]=c->GetY(1);
        }
-       AliDebug(1,"cas (1) CombiSingleMathiesonFit(c)");
+       if (fDebugLevel)
+           fprintf(stderr,"\n cas (1) CombiSingleMathiesonFit(c)\n");
        chi2=CombiSingleMathiesonFit(c);
 //     Int_t ndf = fgNbins[0]+fgNbins[1]-2;
 //     Float_t prob = TMath::Prob(Double_t(chi2),ndf);
 //     prob1->Fill(prob);
 //     chi2_1->Fill(chi2);
        oldchi2=chi2;
-       AliDebug(1,Form(" chi2 %f ",chi2));        
+       if (fDebugLevel)
+           fprintf(stderr," chi2 %f ",chi2);
 
        c->SetX(0, fXFit[0]);
        c->SetY(0, fYFit[0]);
@@ -203,13 +204,16 @@ void AliMUONClusterFinderVS::SplitByLocalMaxima(AliMUONRawCluster *c)
 //         chi2_2->Fill(chi2);
            
 // Was this any better ??
-           AliDebug(1,Form(" Old and new chi2 %f %f ", oldchi2, chi2));
+           if (fDebugLevel)
+             fprintf(stderr," Old and new chi2 %f %f ", oldchi2, chi2);
            if (fFitStat!=0 && chi2>0 && (2.*chi2 < oldchi2)) {
-             AliDebug(1,"Split");
+             if (fDebugLevel)
+               fprintf(stderr," Split\n");
                // Split cluster into two according to fit result
                Split(c);
            } else {
-             AliDebug(1,"Do not Split");
+             if (fDebugLevel)
+               fprintf(stderr," Don't Split\n");
                // Don't split
                AddRawCluster(*c);
            }
@@ -350,37 +354,39 @@ void AliMUONClusterFinderVS::SplitByLocalMaxima(AliMUONRawCluster *c)
 // 1 maximum is initialised with the maximum of the combination found (X->cathode 2, Y->cathode 1)
 // 1 maximum is initialised with the other maximum of the first cathode  
            if (accepted[0]){
-               AliDebug(1,"ico=0");
+               if (fDebugLevel) fprintf(stderr,"ico=0\n");
                fXInit[0]=xm[0][1];
                fYInit[0]=ym[0][0];
                fXInit[1]=xm[3][0];
                fYInit[1]=ym[3][0];
            } else if (accepted[1]){
-               AliDebug(1,"ico=1");
+               if (fDebugLevel) fprintf(stderr,"ico=1\n");
                fXInit[0]=xm[1][1];
                fYInit[0]=ym[1][0];
                fXInit[1]=xm[2][0];
                fYInit[1]=ym[2][0];
            } else if (accepted[2]){
-               AliDebug(1,"ico=2");
+               if (fDebugLevel) fprintf(stderr,"ico=2\n");
                fXInit[0]=xm[2][1];
                fYInit[0]=ym[2][0];
                fXInit[1]=xm[1][0];
                fYInit[1]=ym[1][0];
            } else if (accepted[3]){
-               AliDebug(1,"ico=3");
+               if (fDebugLevel) fprintf(stderr,"ico=3\n");
                fXInit[0]=xm[3][1];
                fYInit[0]=ym[3][0];
                fXInit[1]=xm[0][0];
                fYInit[1]=ym[0][0];
            }
-               AliDebug(1,"cas (2) CombiDoubleMathiesonFit(c)");
+           if (fDebugLevel)
+               fprintf(stderr,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
            chi2=CombiDoubleMathiesonFit(c);
 //         Int_t ndf = fgNbins[0]+fgNbins[1]-6;
 //         Float_t prob = TMath::Prob(chi2,ndf);
 //         prob2->Fill(prob);
 //         chi2_2->Fill(chi2);
-           AliDebug(1,Form(" chi2 %f\n",chi2));
+           if (fDebugLevel)
+               fprintf(stderr," chi2 %f\n",chi2);
 
 // If reasonable chi^2 add result to the list of rawclusters
            if (chi2<10) {
@@ -390,31 +396,32 @@ void AliMUONClusterFinderVS::SplitByLocalMaxima(AliMUONRawCluster *c)
 // 1 maximum is initialised with the maximum of the combination found (X->cathode 2, Y->cathode 1)
 // 1 maximum is initialised with the other maximum of the second cathode  
                if (accepted[0]){
-                       AliDebug(1,"ico=0");
+                   if (fDebugLevel) fprintf(stderr,"ico=0\n");
                    fXInit[0]=xm[0][1];
                    fYInit[0]=ym[0][0];
                    fXInit[1]=xm[3][1];
                    fYInit[1]=ym[3][1];
                } else if (accepted[1]){
-                       AliDebug(1,"ico=1");
+                   if (fDebugLevel) fprintf(stderr,"ico=1\n");
                    fXInit[0]=xm[1][1];
                    fYInit[0]=ym[1][0];
                    fXInit[1]=xm[2][1];
                    fYInit[1]=ym[2][1];
                } else if (accepted[2]){
-                       AliDebug(1,"ico=2");
+                   if (fDebugLevel) fprintf(stderr,"ico=2\n");
                    fXInit[0]=xm[2][1];
                    fYInit[0]=ym[2][0];
                    fXInit[1]=xm[1][1];
                    fYInit[1]=ym[1][1];
                } else if (accepted[3]){
-                       AliDebug(1,"ico=3");
+                   if (fDebugLevel) fprintf(stderr,"ico=3\n");
                    fXInit[0]=xm[3][1];
                    fYInit[0]=ym[3][0];
                    fXInit[1]=xm[0][1];
                    fYInit[1]=ym[0][1];
                }
-               AliDebug(1,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
+               if (fDebugLevel)
+                   fprintf(stderr,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
                chi2=CombiDoubleMathiesonFit(c);
 //             Int_t ndf = fgNbins[0]+fgNbins[1]-6;
 //             Float_t prob = TMath::Prob(chi2,ndf);
@@ -2101,7 +2108,7 @@ AliMUONClusterFinderVS& AliMUONClusterFinderVS
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }
index 60bbf5c..0b0b54f 100644 (file)
@@ -25,7 +25,6 @@
 #include "AliMUONResponse.h"
 #include "AliMUONRawCluster.h"
 #include "AliMUONDigit.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONClusterInput)
 
@@ -66,7 +65,7 @@ AliMUONClusterInput::AliMUONClusterInput(const AliMUONClusterInput& clusterInput
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONClusterInput", "Not implemented.");
 }
 
 void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig1, TClonesArray* dig2)
@@ -223,7 +222,7 @@ AliMUONClusterInput& AliMUONClusterInput
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }
index 9abd297..9395478 100644 (file)
@@ -35,7 +35,6 @@
 #include "AliMUONClusterInput.h"
 #include "AliMUONRawCluster.h"
 #include "AliRawReader.h" // for raw data
-#include "AliLog.h"
 
 
 const Int_t AliMUONClusterReconstructor::fgkDefaultPrintLevel = 0;
@@ -105,7 +104,7 @@ AliMUONClusterReconstructor::AliMUONClusterReconstructor (const AliMUONClusterRe
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONClusterReconstructor", "Not implemented.");
 }
 
 //_______________________________________________________________________
@@ -116,7 +115,7 @@ AliMUONClusterReconstructor::operator=(const AliMUONClusterReconstructor& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }
@@ -159,7 +158,8 @@ void AliMUONClusterReconstructor::Digits2Clusters()
        //TClonesArray *
        muonDigits = fMUONData->Digits(ich); 
        ndig=muonDigits->GetEntriesFast();
-       AliDebug(1,Form("1 Found %d digits in %p chamber %d", ndig, (void*)muonDigits,ich));
+       if(fDebug)
+         printf("1 Found %d digits in %p chamber %d\n", ndig, (void*)muonDigits,ich);
        TClonesArray &lhits1 = *dig1;
        Int_t n = 0;
        for (k = 0; k < ndig; k++) {
@@ -171,7 +171,8 @@ void AliMUONClusterReconstructor::Digits2Clusters()
        fMUONData->GetCathode(1);
        muonDigits =  fMUONData->Digits(ich);  
        ndig=muonDigits->GetEntriesFast();
-       AliDebug(1,Form("2 Found %d digits in %p %d", ndig, (void*)muonDigits, ich));
+       if(fDebug)
+         printf("\n 2 Found %d digits in %p %d", ndig, (void*)muonDigits, ich);
        TClonesArray &lhits2 = *dig2;
        n=0;
        
@@ -204,5 +205,5 @@ void AliMUONClusterReconstructor::Digits2Clusters(AliRawReader* /*rawReader*/)
 
 //  Perform cluster finding form raw data
 
-   AliFatal("clusterization not implemented for raw data input");
+   Fatal("Digits2Clusters","clusterization not implemented for raw data input");
 }
index 7d714b1..e66a0ed 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "AliMUONConstants.h"
 
+
 ClassImp(AliMUONConstants)
 
 Int_t   AliMUONConstants::fgNCh = 14;
@@ -26,9 +27,14 @@ Int_t   AliMUONConstants::fgNTriggerCircuit = 234;
 Int_t   AliMUONConstants::fgNofDetElements[14] =
 { 4, 4, 4, 4, 18, 18, 26, 26, 26, 26, 18, 18, 18, 18 };
 
-Float_t AliMUONConstants::fgDefaultChamberZ[14] =
-{-533.5, -546.5, -678.5, -693.5, -964.0, -986.0, -1251.5, -1278.5, -1416.5, -1443.5,
- -1603.5, -1620.5, -1703.5, -1720.5};
+Float_t AliMUONConstants::fgDefaultChamberZ[14] = 
+  {-533.5, -546.5, -678.5, -693.5, // St12
+   -966.9, -997.9, -1274.5, -1305.5, -1408.6, -1439.6, // St345  update sept04 Ch. Finck 
+   -1603.5, -1620.5, -1703.5, -1720.5}; // M1 & M2
+
+Float_t  AliMUONConstants::fgDzCh   = 15.5/2.;
+Float_t  AliMUONConstants::fgDzSlat = 8.5/2.;
+
 
 Float_t  AliMUONConstants::fgDmin[7] = {  36.4,  46.2,  66.0,   80.,   80., 100., 100.};    
 Float_t  AliMUONConstants::fgDmax[7]  = {183., 245., 395.,  560.,  563., 850., 900.};  
index acb3693..1af0eb3 100644 (file)
@@ -30,6 +30,10 @@ class AliMUONConstants : public TObject {
     static Float_t  Dmax(Int_t i) {return fgDmax[i];}
     // return maximum zoom for event display
     static Int_t    MaxZoom() {return fgMaxZoom;}
+    // return half-distance between two half-chambers
+    static Float_t    DzCh() {return fgDzCh;}
+    // return half-distance between two slats
+    static Float_t    DzSlat() {return fgDzSlat;}
 
     // Conversion functions between chamber Id and detection element Id
     static  Int_t GetChamberId(Int_t detElemId); 
@@ -49,6 +53,10 @@ class AliMUONConstants : public TObject {
     static Float_t  fgDefaultChamberZ[14];    // ! Z-positions of chambers
     static Float_t  fgDmin[7];                // ! inner diameter
     static Float_t  fgDmax[7];                // ! outer diameter
+
+    static Float_t  fgDzCh;             // half-distance between two half-chambers 
+    static Float_t  fgDzSlat;           // half-distance between two slat on the same chamber
+
 //
     static Int_t    fgMaxZoom;                // Maximum Zoom for event display
     ClassDef(AliMUONConstants, 0)             // MUON global constants 
index 28682b8..bbb70fd 100644 (file)
@@ -12,7 +12,7 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
+
 #include "AliMUONDDLTracker.h"
 #include "AliRawDataHeader.h"
 
index 6488c6f..f756c67 100644 (file)
@@ -12,7 +12,7 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
+
 #include "AliMUONDDLTrigger.h"
 
 ClassImp(AliMUONDDLTrigger)
index b3d852b..dd02c28 100644 (file)
@@ -32,7 +32,6 @@
 #include "AliMUONRawCluster.h"
 #include "AliMUONTrack.h"
 #include "AliMUONTriggerTrack.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONData)
  
@@ -113,7 +112,7 @@ AliMUONData::AliMUONData(const AliMUONData& rMUONData):TNamed(rMUONData)
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONData", "Not implemented.");
 }
 
 //_____________________________________________________________________________
@@ -162,7 +161,7 @@ AliMUONData& AliMUONData::operator=(const AliMUONData& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }    
@@ -323,7 +322,7 @@ Bool_t   AliMUONData::IsRawClusterBranchesInTree()
 {
   // Checking if there are RawCluster Branches In TreeR
   if (TreeR()==0x0) {
-    AliError("No treeR in memory");
+    Error("TreeR","No treeR in memory");
     return kFALSE;
   }
   else {
@@ -340,7 +339,7 @@ Bool_t   AliMUONData::IsDigitsBranchesInTree()
 {
   // Checking if there are RawCluster Branches In TreeR
   if (TreeD()==0x0) {
-    AliError("No treeD in memory");
+    Error("TreeD","No treeD in memory");
     return kFALSE;
   }
   else {
@@ -357,7 +356,7 @@ Bool_t   AliMUONData::IsTriggerBranchesInTree()
 {
   // Checking if there are Trigger Branches In TreeR
  if (TreeR()==0x0) {
-    AliError("No treeR in memory");
+    Error("TreeR","No treeR in memory");
     return kFALSE;
   }
   else {
@@ -374,7 +373,7 @@ Bool_t   AliMUONData::IsTriggerBranchesInTreeD()
 {
   // Checking if there are Trigger Branches In TreeR
  if (TreeD()==0x0) {
-    AliError("No treeD in memory");
+    Error("TreeD","No treeD in memory");
     return kFALSE;
   }
   else {
@@ -392,7 +391,7 @@ Bool_t   AliMUONData::IsTrackBranchesInTree()
 {
   // Checking if there are Track Branches In TreeT
   if (TreeT()==0x0) {
-    AliError("No treeT in memory");
+    Error("TreeT","No treeT in memory");
     return kFALSE;
   }
   else {
@@ -409,7 +408,7 @@ Bool_t   AliMUONData::IsTriggerTrackBranchesInTree()
 {
   // Checking if there are TriggerTrack Branches In TreeT
   if (TreeT()==0x0) {
-    AliError("No treeT in memory");
+    Error("TreeT","No treeT in memory");
     return kFALSE;
   }
   else {
@@ -562,7 +561,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     sprintf(branchname,"%sHits",GetName());  
     branch = TreeH()->GetBranch(branchname);
     if (branch) {  
-      AliInfo(Form("MakeBranch","Branch %s is already in tree.",GetName()));
+      Info("MakeBranch","Branch %s is already in tree.",GetName());
       return ;
     }
     branch = TreeH()->Branch(branchname,&fHits,kBufferSize);
@@ -591,7 +590,7 @@ void AliMUONData::MakeBranch(Option_t* option)
       branch = 0x0;
       branch = TreeD()->GetBranch(branchname);
       if (branch) {  
-       AliInfo(Form("Branch %s is already in tree.",GetName()));
+       Info("MakeBranch","Branch %s is already in tree.",GetName());
        return;
       }
       TClonesArray * digits = Digits(iDetectionPlane); 
@@ -613,7 +612,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     }
     branch = TreeD()->GetBranch(branchname);
     if (branch) {  
-      AliInfo(Form("Branch GlobalTrigger is already in treeD."));
+      Info("MakeBranch","Branch GlobalTrigger is already in treeD.");
       return ;
     }
     branch = TreeD()->Branch(branchname, &fGlobalTrigger, kBufferSize);
@@ -631,7 +630,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     }
     branch = TreeD()->GetBranch(branchname);
     if (branch) {  
-      AliInfo(Form("Branch LocalTrigger is already in treeD."));
+      Info("MakeBranch","Branch LocalTrigger is already in treeD.");
       return;
     }
     branch = TreeD()->Branch(branchname, &fLocalTrigger, kBufferSize);
@@ -661,7 +660,7 @@ void AliMUONData::MakeBranch(Option_t* option)
       branch = 0x0;
       branch = TreeS()->GetBranch(branchname);
       if (branch) {  
-       AliInfo(Form("Branch %s is already in tree.",GetName()));
+       Info("MakeBranch","Branch %s is already in tree.",GetName());
        return;
       }
       TClonesArray * sdigits = SDigits(iDetectionPlane); 
@@ -695,7 +694,7 @@ void AliMUONData::MakeBranch(Option_t* option)
       branch = 0x0;
       branch = TreeR()->GetBranch(branchname);
       if (branch) {  
-       AliInfo(Form("Branch %s is already in tree.",GetName()));
+       Info("MakeBranch","Branch %s is already in tree.",GetName());
        return;
       }
       branch = TreeR()->Branch(branchname, &((*fRawClusters)[i]),kBufferSize);
@@ -716,7 +715,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     }
     branch = TreeR()->GetBranch(branchname);
     if (branch) {  
-      AliInfo(Form("Branch GlobalTrigger is already in treeR."));
+      Info("MakeBranch","Branch GlobalTrigger is already in treeR.");
       return ;
     }
     branch = TreeR()->Branch(branchname, &fGlobalTrigger, kBufferSize);
@@ -734,7 +733,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     }
     branch = TreeR()->GetBranch(branchname);
     if (branch) {  
-      AliInfo(Form("Branch LocalTrigger is already in treeR."));
+      Info("MakeBranch","Branch LocalTrigger is already in treeR.");
       return;
     }
     branch = TreeR()->Branch(branchname, &fLocalTrigger, kBufferSize);
@@ -747,7 +746,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     sprintf(branchname,"%sTrack",GetName());  
     branch = TreeT()->GetBranch(branchname);
     if (branch) {  
-      AliInfo(Form("Branch %s is already in tree.",GetName()));
+      Info("MakeBranch","Branch %s is already in tree.",GetName());
       return ;
     }
     branch = TreeT()->Branch(branchname,&fRecTracks,kBufferSize);
@@ -760,7 +759,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     sprintf(branchname,"%sTriggerTrack",GetName());  
     branch = TreeT()->GetBranch(branchname);
     if (branch) {  
-      AliInfo(Form("Branch %s is already in tree.",GetName()));
+      Info("MakeBranch","Branch %s is already in tree.",GetName());
       return ;
     }
     branch = TreeT()->Branch(branchname,&fRecTriggerTracks,kBufferSize);
@@ -894,7 +893,7 @@ void AliMUONData::SetTreeAddress(Option_t* option)
       branch->SetAddress(&fHits);
     }
     else { //can be invoked before branch creation
-      AliWarning(Form("(%s) Failed for Hits. Can not find branch in tree.",GetName()));
+      Warning("SetTreeAddress","(%s) Failed for Hits. Can not find branch in tree.",GetName());
     }
   }
   
@@ -926,7 +925,7 @@ void AliMUONData::SetTreeAddress(Option_t* option)
        if (branch) {
          branch->SetAddress( &digits );
        }
-       else AliWarning(Form("(%s) Failed for Digits Detection plane %d. Can not find branch in tree.",GetName(),i));
+       else Warning("SetTreeAddress","(%s) Failed for Digits Detection plane %d. Can not find branch in tree.",GetName(),i);
       }
     }
   }
@@ -934,13 +933,13 @@ void AliMUONData::SetTreeAddress(Option_t* option)
     sprintf(branchname,"%sLocalTrigger",GetName());
     branch = TreeD()->GetBranch(branchname);
     if (branch) branch->SetAddress(&fLocalTrigger);
-    else AliWarning(Form("(%s) Failed for LocalTrigger. Can not find branch in treeD.",GetName()));
+    else Warning("SetTreeAddress","(%s) Failed for LocalTrigger. Can not find branch in treeD.",GetName());
   }
   if ( TreeD() && fGlobalTrigger && cGLT) {
     sprintf(branchname,"%sGlobalTrigger",GetName());
     branch = TreeD()->GetBranch(branchname);
     if (branch) branch->SetAddress(&fGlobalTrigger);
-    else AliWarning(Form("(%s) Failed for GlobalTrigger. Can not find branch in treeD.",GetName()));
+    else Warning("SetTreeAddress","(%s) Failed for GlobalTrigger. Can not find branch in treeD.",GetName());
   }
 
   //
@@ -963,7 +962,7 @@ void AliMUONData::SetTreeAddress(Option_t* option)
        branch = TreeS()->GetBranch(branchname);
        TClonesArray * sdigits = SDigits(i);
        if (branch) branch->SetAddress( &sdigits );
-       else AliWarning(Form("(%s) Failed for SDigits Detection plane %d. Can not find branch in tree.",GetName(),i));
+       else Warning("SetTreeAddress","(%s) Failed for SDigits Detection plane %d. Can not find branch in tree.",GetName(),i);
       }
     }
   }
@@ -993,7 +992,7 @@ void AliMUONData::SetTreeAddress(Option_t* option)
       if (fRawClusters) {
        branch = TreeR()->GetBranch(branchname);
        if (branch) branch->SetAddress( &((*fRawClusters)[i]) );
-       else AliWarning(Form("(%s) Failed for RawClusters Detection plane %d. Can not find branch in tree.",GetName(),i));
+       else Warning("SetTreeAddress","(%s) Failed for RawClusters Detection plane %d. Can not find branch in tree.",GetName(),i);
       }
     }
   }
@@ -1001,13 +1000,13 @@ void AliMUONData::SetTreeAddress(Option_t* option)
     sprintf(branchname,"%sLocalTrigger",GetName());
     branch = TreeR()->GetBranch(branchname);
     if (branch) branch->SetAddress(&fLocalTrigger);
-    else AliWarning(Form("(%s) Failed for LocalTrigger. Can not find branch in treeR.",GetName()));
+    else Warning("SetTreeAddress","(%s) Failed for LocalTrigger. Can not find branch in treeR.",GetName());
   }
   if ( TreeR() && fGlobalTrigger && cTC) {
     sprintf(branchname,"%sGlobalTrigger",GetName());
     branch = TreeR()->GetBranch(branchname);
     if (branch) branch->SetAddress(&fGlobalTrigger);
-    else AliWarning(Form("(%s) Failed for GlobalTrigger. Can not find branch in treeR.",GetName()));
+    else Warning("SetTreeAddress","(%s) Failed for GlobalTrigger. Can not find branch in treeR.",GetName());
   }
 
   if ( TreeT() ) {
@@ -1020,7 +1019,7 @@ void AliMUONData::SetTreeAddress(Option_t* option)
     sprintf(branchname,"%sTrack",GetName());  
     branch = TreeT()->GetBranch(branchname);
     if (branch) branch->SetAddress(&fRecTracks);
-    else AliWarning(Form("(%s) Failed for Tracks. Can not find branch in tree.",GetName()));
+    else Warning("SetTreeAddress","(%s) Failed for Tracks. Can not find branch in tree.",GetName());
   }
 // trigger tracks
   if ( TreeT() ) {
@@ -1033,7 +1032,7 @@ void AliMUONData::SetTreeAddress(Option_t* option)
     sprintf(branchname,"%sTriggerTrack",GetName());  
     branch = TreeT()->GetBranch(branchname);
     if (branch) branch->SetAddress(&fRecTriggerTracks);
-    else AliWarning(Form("(%s) Failed for Trigger Tracks. Can not find branch in tree.",GetName()));
+    else Warning("SetTreeAddress","(%s) Failed for Trigger Tracks. Can not find branch in tree.",GetName());
   }
 
 
index 2bfa83b..f1a10d8 100644 (file)
@@ -13,7 +13,6 @@
 #include "AliMUONHit.h"
 #include "AliMUONDigit.h"
 #include "AliMUONRawCluster.h"
-#include "AliLog.h"
 
 
 ClassImp(AliMUONDataInterface)
@@ -32,7 +31,7 @@ AliMUONDataInterface::AliMUONDataInterface(const AliMUONDataInterface& rhs)
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONDataInterface", "Not implemented.");
 }
 
 AliMUONDataInterface::~AliMUONDataInterface()
@@ -52,7 +51,7 @@ AliMUONDataInterface::operator=(const AliMUONDataInterface& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }    
@@ -86,15 +85,15 @@ Bool_t AliMUONDataInterface::LoadLoaders(TString filename, TString foldername)
        fRunloader = AliRunLoader::Open(filename, foldername, "READ");
        if (fRunloader == NULL)
        {
-               AliError(Form("Could not find or load the run loader for the file: %s and folder: %s", 
-                       (const char*)filename, (const char*)foldername));
+               Error("LoadLoaders", "Could not find or load the run loader for the file: %s and folder: %s", 
+                       (const char*)filename, (const char*)foldername);
                return kFALSE;
        };
        fMuonloader = fRunloader->GetLoader("MUONLoader");
        if (fMuonloader == NULL)
        {
-               AliError(Form("Could not find the MUON loader in file: %s and folder: %s", 
-                       (const char*)filename, (const char*)foldername));
+               Error("LoadLoaders", "Could not find the MUON loader in file: %s and folder: %s", 
+                       (const char*)filename, (const char*)foldername);
                fRunloader = NULL;
                return kFALSE;
        };
@@ -183,7 +182,7 @@ Bool_t AliMUONDataInterface::FetchTreeK()
                fRunloader->LoadKinematics("READ");
                if (fRunloader->TreeK() == NULL)
                {
-                       AliError("Could not load TreeK.");
+                       Error("FetchTreeK", "Could not load TreeK.");
                        return kFALSE;
                };
        };
@@ -201,7 +200,7 @@ Bool_t AliMUONDataInterface::FetchTreeH()
                fMuonloader->LoadHits("READ");
                if (fMuonloader->TreeH() == NULL)
                {
-                       AliError("Could not load TreeH.");
+                       Error("FetchTreeH", "Could not load TreeH.");
                        return kFALSE;
                };
                fData.SetTreeAddress("H");
@@ -226,7 +225,7 @@ Bool_t AliMUONDataInterface::FetchTreeS()
                fMuonloader->LoadSDigits("READ");
                if (fMuonloader->TreeS() == NULL)
                {
-                       AliError("Could not load TreeS.");
+                       Error("FetchTreeS", "Could not load TreeS.");
                        return kFALSE;
                };
                fData.SetTreeAddress("S");
@@ -251,7 +250,7 @@ Bool_t AliMUONDataInterface::FetchTreeD()
                fMuonloader->LoadDigits("READ");
                if (fMuonloader->TreeD() == NULL)
                {
-                       AliError("Could not load TreeD.");
+                       Error("FetchTreeD", "Could not load TreeD.");
                        return kFALSE;
                };
                fData.SetTreeAddress("D");
@@ -276,7 +275,7 @@ Bool_t AliMUONDataInterface::FetchTreeR()
                fMuonloader->LoadRecPoints("READ");
                if (fMuonloader->TreeR() == NULL)
                {
-                       AliError("Could not load TreeR.");
+                       Error("FetchTreeR", "Could not load TreeR.");
                        return kFALSE;
                };
                
@@ -596,7 +595,7 @@ Int_t AliMUONDataInterface::NumberOfEvents()
 
        if (fRunloader == NULL)
        {
-               AliError("File not set.");
+               Error("NumberOfEvents", "File not set.");
                return -1;
        };
        return fRunloader->GetNumberOfEvents();
@@ -610,7 +609,7 @@ Int_t AliMUONDataInterface::NumberOfParticles()
 
        if (fRunloader == NULL)
        {
-               AliError("File not set.");
+               Error("NumberOfParticles", "File not set.");
                return -1;
        };
        if ( ! FetchTreeK() ) return -1;
@@ -625,12 +624,12 @@ TParticle* AliMUONDataInterface::Particle(Int_t particle)
 
        if (fRunloader == NULL)
        {
-               AliError("File not set.");
+               Error("Particle", "File not set.");
                return NULL;
        };
        if (fEventnumber < 0)
        {
-               AliError("Event not chosen.");
+               Error("Particle", "Event not chosen.");
                return NULL;
        };
        if ( ! FetchTreeK() ) return NULL;
@@ -649,12 +648,12 @@ Int_t AliMUONDataInterface::NumberOfTracks()
 
        if (fRunloader == NULL)
        {
-               AliError("File not set.");
+               Error("NumberOfTracks", "File not set.");
                return -1;
        };
        if (fEventnumber < 0)
        {
-               AliError( "Event not chosen.");
+               Error("NumberOfTracks", "Event not chosen.");
                return -1;
        };
        if ( ! FetchTreeH() ) return -1;
@@ -669,12 +668,12 @@ Int_t AliMUONDataInterface::NumberOfHits(Int_t track)
 
        if (fRunloader == NULL)
        {
-               AliError("File not set.");
+               Error("NumberOfHits", "File not set.");
                return -1;
        };
        if (fEventnumber < 0)
        {
-               AliError("Event not chosen.");
+               Error("NumberOfHits", "Event not chosen.");
                return -1;
        };
        if ( ! FetchTreeH() ) return -1;
@@ -695,12 +694,12 @@ AliMUONHit* AliMUONDataInterface::Hit(Int_t track, Int_t hit)
 
        if (fRunloader == NULL)
        {
-               AliError("File not set.");
+               Error("Hit", "File not set.");
                return NULL;
        };
        if (fEventnumber < 0)
        {
-               AliError("Event not chosen.");
+               Error("Hit", "Event not chosen.");
                return NULL;
        };
        if ( ! FetchTreeH() ) return NULL;
@@ -724,12 +723,12 @@ Int_t AliMUONDataInterface::NumberOfSDigits(Int_t chamber, Int_t cathode)
        
        if (fRunloader == NULL)
        {
-               AliError("File not set.");
+               Error("NumberOfSDigits", "File not set.");
                return -1;
        };
        if (fEventnumber < 0)
        {
-               AliError("Event not chosen.");
+               Error("NumberOfSDigits", "Event not chosen.");
                return -1;
        };
 
@@ -754,12 +753,12 @@ AliMUONDigit* AliMUONDataInterface::SDigit(Int_t chamber, Int_t cathode, Int_t s
        
        if (fRunloader == NULL)
        {
-               AliError("File not set.");
+               Error("SDigit", "File not set.");
                return NULL;
        };
        if (fEventnumber < 0)
        {
-               AliError("Event not chosen.");
+               Error("SDigit", "Event not chosen.");
                return NULL;
        };
 
@@ -784,12 +783,12 @@ Int_t AliMUONDataInterface::NumberOfDigits(Int_t chamber, Int_t cathode)
        
        if (fRunloader == NULL)
        {
-               AliError("File not set.");
+               Error("NumberOfDigits", "File not set.");
                return -1;
        };
        if (fEventnumber < 0)
        {
-               AliError("Event not chosen.");
+               Error("NumberOfDigits", "Event not chosen.");
                return -1;
        };
        
@@ -814,12 +813,12 @@ AliMUONDigit* AliMUONDataInterface::Digit(Int_t chamber, Int_t cathode, Int_t di
        
        if (fRunloader == NULL)
        {
-               AliError("File not set.");
+               Error("Digit", "File not set.");
                return NULL;
        };
        if (fEventnumber < 0)
        {
-               AliError("Event not chosen.");
+               Error("Digit", "Event not chosen.");
                return NULL;
        };
 
@@ -843,12 +842,12 @@ Int_t AliMUONDataInterface::NumberOfRawClusters(Int_t chamber)
 
        if (fRunloader == NULL)
        {
-               AliError("File not set.");
+               Error("NumberOfRawClusters", "File not set.");
                return -1;
        };
        if (fEventnumber < 0)
        {
-               AliError("Event not chosen.");
+               Error("NumberOfRawClusters", "Event not chosen.");
                return -1;
        };
 
@@ -873,12 +872,12 @@ AliMUONRawCluster* AliMUONDataInterface::RawCluster(Int_t chamber, Int_t cluster
 
        if (fRunloader == NULL)
        {
-               AliError("File not set.");
+               Error("RawCluster", "File not set.");
                return NULL;
        };
        if (fEventnumber < 0)
        {
-               AliError("Event not chosen.");
+               Error("RawCluster", "Event not chosen.");
                return NULL;
        };
 
@@ -901,12 +900,12 @@ Int_t AliMUONDataInterface::NumberOfLocalTriggers()
 
        if (fRunloader == NULL)
        {
-               AliError("File not set.");
+               Error("NumberOfLocalTriggers", "File not set.");
                return -1;
        };
        if (fEventnumber < 0)
        {
-               AliError("Event not chosen.");
+               Error("NumberOfLocalTriggers", "Event not chosen.");
                return -1;
        };
 
@@ -929,12 +928,12 @@ AliMUONLocalTrigger* AliMUONDataInterface::LocalTrigger(Int_t trigger)
 
        if (fRunloader == NULL)
        {
-               AliError("File not set.");
+               Error("LocalTrigger", "File not set.");
                return NULL;
        };
        if (fEventnumber < 0)
        {
-               AliError( "Event not chosen.");
+               Error("LocalTrigger", "Event not chosen.");
                return NULL;
        };
 
index 4aa774b..3fff34d 100644 (file)
@@ -17,7 +17,6 @@
 
 #include "AliMUONDigit.h"
 
-
 ClassImp(AliMUONDigit)
 //_____________________________________________________________________________
  AliMUONDigit::AliMUONDigit(const AliMUONDigit& digits):TObject(digits)
index 971cce6..735d435 100644 (file)
@@ -31,7 +31,6 @@
 #include "AliMUONTransientDigit.h"
 #include "AliMUONHitMapA1.h"
 #include "AliMUONTriggerDecision.h"
-#include "AliLog.h"
 
 
 /////////////////////////////////////////////////////////////////////////////////////
@@ -93,7 +92,7 @@ AliMUONDigitizer::AliMUONDigitizer(const AliMUONDigitizer& rhs)
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONDigitizer", "Not implemented.");
 }
 
 //___________________________________________
@@ -115,7 +114,7 @@ AliMUONDigitizer::operator=(const AliMUONDigitizer& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }    
@@ -137,12 +136,12 @@ void AliMUONDigitizer::Exec(Option_t* option)
 // 2) Loop over the generated transient digits and write them to the output
 //    stream. Done in CreateDigits()
 
-       AliDebug(1, "Running digitiser.");
+       if (GetDebug() > 0) Info("Exec", "Running digitiser.");
        ParseOptions(option);
 
        if (fManager->GetNinputs() == 0)
        {
-               AliWarning("No inputs set, nothing to do.");
+               Warning("Exec", "No inputs set, nothing to do.");
                return;
        };
 
@@ -152,15 +151,16 @@ void AliMUONDigitizer::Exec(Option_t* option)
 
        InitArrays();
        
-       AliDebug(2, Form("Event Number is %d.", fManager->GetOutputEventNr()));
+       if (GetDebug() > 1) Info("Exec", "Event Number is %d.", fManager->GetOutputEventNr());
 
        // Loop over files to merge and to digitize
        fSignal = kTRUE;
        for (Int_t inputFile = 0; inputFile < fManager->GetNinputs(); inputFile++)
        {
                fMask = fManager->GetMask(inputFile);
-               AliDebug(2, Form("Digitising folder %d, with fMask = %d: %s", inputFile, fMask,
-                            (const char*)fManager->GetInputFolderName(inputFile)));
+               if (GetDebug() > 1) 
+                       Info("Exec", "Digitising folder %d, with fMask = %d: %s", inputFile, fMask,
+                            (const char*)fManager->GetInputFolderName(inputFile));
 
                if (inputFile != 0)
                        // If this is the first file then we already have the loaders loaded.
@@ -206,7 +206,8 @@ void AliMUONDigitizer::UpdateTransientDigit(AliMUONTransientDigit* mTD)
 // Update the transient digit that is already in the fTDList by adding the new
 // transient digits charges and track lists to the existing one.
 
-       AliDebug(4,Form( "Updating transient digit 0x%X", (void*)mTD));
+       if (GetDebug() > 3)
+               Info("UpdateTransientDigit", "Updating transient digit 0x%X", (void*)mTD);
        // Choosing the maping of the cathode plane of the chamber:
        Int_t iNchCpl= mTD->Chamber() + (mTD->Cathode()-1) * AliMUONConstants::NCh();
        AliMUONTransientDigit *pdigit = 
@@ -220,10 +221,13 @@ void AliMUONDigitizer::UpdateTransientDigit(AliMUONTransientDigit* mTD)
        Int_t ntracks = mTD->GetNTracks();
        if (ntracks > kMAXTRACKS)  // Truncate the number of tracks to kMAXTRACKS if we have to.
        {
-               AliDebug(1,Form( 
-                       "TransientDigit returned the number of tracks to be %d, which is bigger than kMAXTRACKS.",
-                       ntracks));
-               AliDebug(1,Form( "Reseting the number of tracks to be %d.", kMAXTRACKS));
+               if (GetDebug() > 0)
+               {
+                       Warning("UpdateTransientDigit", 
+                               "TransientDigit returned the number of tracks to be %d, which is bigger than kMAXTRACKS.",
+                               ntracks);
+                       Warning("UpdateTransientDigit", "Reseting the number of tracks to be %d.", kMAXTRACKS);
+               }
                ntracks = kMAXTRACKS;
        };
        
@@ -239,7 +243,8 @@ void AliMUONDigitizer::AddTransientDigit(AliMUONTransientDigit* mTD)
 // Adds the transient digit to the fTDList and sets the appropriate entry
 // in the fHitMap arrays. 
 
-       AliDebug(4,Form( "Adding transient digit 0x%X", (void*)mTD));
+       if (GetDebug() > 3)
+               Info("AddTransientDigit", "Adding transient digit 0x%X", (void*)mTD);
        // Choosing the maping of the cathode plane of the chamber:
        Int_t iNchCpl= mTD->Chamber() + (mTD->Cathode()-1) * AliMUONConstants::NCh();
        fTDList->AddAtAndExpand(mTD, fTDCounter);
@@ -265,7 +270,7 @@ void AliMUONDigitizer::CreateDigits()
 // Loops over the fTDList for each cathode, gets the correct signal for the 
 // digit and adds the new digit to the output stream.
 
-       AliDebug(2, "Creating digits...");
+       if (GetDebug() > 1) Info("CreateDigits", "Creating digits...");
        for (Int_t icat = 0; icat < 2; icat++)
        {
                //
@@ -280,7 +285,8 @@ void AliMUONDigitizer::CreateDigits()
                        // of digits from both cathodes.
                        if (icat != td->Cathode() - 1) continue;
                        
-                       AliDebug(3,Form( "Creating digit from transient digit 0x%X", (void*)td));
+                       if (GetDebug() > 2)
+                               Info("CreateDigits", "Creating digit from transient digit 0x%X", (void*)td);
 
                        Int_t q = GetSignalFrom(td);
                        if (q > 0) AddDigit(td, q);
@@ -315,10 +321,13 @@ void AliMUONDigitizer::AddDigit(AliMUONTransientDigit* td, Int_t responseCharge)
        Int_t nptracks = td->GetNTracks();
        if (nptracks > kMAXTRACKS)
        {
-               AliDebug(1, Form(
-                       "TransientDigit returned the number of tracks to be %d, which is bigger than kMAXTRACKS.",
-                       nptracks));
-               AliDebug(1, Form("Reseting the number of tracks to be %d.", kMAXTRACKS));
+               if (GetDebug() > 0)
+               {
+                       Warning("AddDigit", 
+                               "TransientDigit returned the number of tracks to be %d, which is bigger than kMAXTRACKS.",
+                               nptracks);
+                       Warning("AddDigit", "Reseting the number of tracks to be %d.", kMAXTRACKS);
+               }
                nptracks = kMAXTRACKS;
        };
        
@@ -340,7 +349,7 @@ void AliMUONDigitizer::AddDigit(AliMUONTransientDigit* td, Int_t responseCharge)
                };
        };
 
-       AliDebug(4,Form( "Adding digit with charge %d.", responseCharge));
+       if (GetDebug() > 3) Info("AddDigit", "Adding digit with charge %d.", responseCharge);
 
        OnWriteTransientDigit(td);
        AddDigit(td->Chamber(), tracks, charges, digits);
@@ -372,18 +381,19 @@ Bool_t AliMUONDigitizer::FetchLoaders(const char* foldername, AliRunLoader*& run
 // The muon loader is then loaded from the fetched run loader. 
 // kTRUE is returned if no error occurred otherwise kFALSE is returned. 
 
-       AliDebug(3, Form("Fetching run loader and muon loader from folder: %s", foldername));
+       if (GetDebug() > 2)
+               Info("FetchLoaders", "Fetching run loader and muon loader from folder: %s", foldername);
 
        runloader = AliRunLoader::GetRunLoader(foldername);
        if (runloader == NULL)
        {
-               AliError(Form("RunLoader not found in folder: %s", foldername));
+               Error("FetchLoaders", "RunLoader not found in folder: %s", foldername);
                return kFALSE; 
        }                                                                                       
        muonloader = (AliMUONLoader*) runloader->GetLoader("MUONLoader");
        if (muonloader == NULL) 
        {
-               AliError(Form("MUONLoader not found in folder: %s", foldername));
+               Error("FetchLoaders", "MUONLoader not found in folder: %s", foldername);
                return kFALSE; 
        }
        return kTRUE;
@@ -399,28 +409,29 @@ Bool_t AliMUONDigitizer::FetchGlobalPointers(AliRunLoader* runloader)
 // AliMUONData fetched from the MUON module. 
 // kTRUE is returned if no error occurred otherwise kFALSE is returned. 
 
-        AliDebug(3, Form("Fetching gAlice, MUON module and AliMUONData from runloader 0x%X.",
+        if (GetDebug() > 2)
+               Info("FetchGlobalPointers", "Fetching gAlice, MUON module and AliMUONData from runloader 0x%X.",
                        (void*)runloader
-                   ));
+                   );
 
        if (runloader->GetAliRun() == NULL) runloader->LoadgAlice();
        gAlice = runloader->GetAliRun();
        if (gAlice == NULL)
        {
-               AliError(Form("Could not find the AliRun object in runloader 0x%X.", (void*)runloader));
+               Error("FetchGlobalPointers", "Could not find the AliRun object in runloader 0x%X.", (void*)runloader);
                return kFALSE;
        };
        fMUON = (AliMUON*) gAlice->GetDetector("MUON");
        if (fMUON == NULL)
        {
-               AliError(Form("Could not find the MUON module in runloader 0x%X.", (void*)runloader));
+               Error("FetchGlobalPointers", "Could not find the MUON module in runloader 0x%X.", (void*)runloader);
                return kFALSE;
        };
 
        AliMUONLoader *muonloader = (AliMUONLoader*) runloader->GetLoader("MUONLoader");
        if (muonloader == NULL) 
        {
-               AliError( "MUONLoader not found ");
+               Error("FetchGlobalPointers", "MUONLoader not found ");
                return kFALSE; 
        }
 
@@ -428,7 +439,7 @@ Bool_t AliMUONDigitizer::FetchGlobalPointers(AliRunLoader* runloader)
        if (fMUONData == NULL) fMUONData = new AliMUONData(muonloader,"MUON","MUON");
        if (fMUONData == NULL)
        {
-               AliError(Form("Could not find AliMUONData object in runloader 0x%X.", (void*)runloader));
+               Error("FetchGlobalPointers", "Could not find AliMUONData object in runloader 0x%X.", (void*)runloader);
                return kFALSE;
        };
 
@@ -438,7 +449,7 @@ Bool_t AliMUONDigitizer::FetchGlobalPointers(AliRunLoader* runloader)
 Bool_t  AliMUONDigitizer::FetchTriggerPointer(AliMUONLoader* loader)
 {
   if (fMUONData == NULL) {
-    AliError("MUONData not found");
+    Error("FetchTriggerPointer", "MUONData not found");
     return kFALSE;
   }
 
@@ -463,7 +474,7 @@ void AliMUONDigitizer::ParseOptions(Option_t* options)
                optionString.Data() == "deb"   // maintained for compatability.
           )
        {
-               AliInfo("Called with option \"debug\".");
+               Info("ParseOptions", "Called with option \"debug\".");
                SetDebug(99);
        };
 };
@@ -478,8 +489,8 @@ void AliMUONDigitizer::InitArrays()
 //
 // Note: the fTDList and fHitMap arrays must be NULL before calling this method.
 
-       AliDebug(2, "Initialising internal arrays.");
-       AliDebug(4, "Creating transient digits list.");
+       if (GetDebug() > 1) Info("InitArrays", "Initialising internal arrays.");
+       if (GetDebug() > 3) Info("InitArrays", "Creating transient digits list.");
        fTDList = new TObjArray;
        
        // Array of pointer of the AliMUONHitMapA1:
@@ -489,11 +500,11 @@ void AliMUONDigitizer::InitArrays()
        // Loop over chambers for the definition AliMUONHitMap
        for (Int_t i = 0; i < AliMUONConstants::NCh(); i++) 
        {
-               AliDebug(4,Form( "Creating hit map for chamber %d, cathode 1.", i+1));
+               if (GetDebug() > 3) Info("InitArrays", "Creating hit map for chamber %d, cathode 1.", i+1);
                AliMUONChamber* chamber = &(fMUON->Chamber(i));
                AliSegmentation* c1Segmentation = chamber->SegmentationModel(1); // Cathode plane 1
                fHitMap[i] = new AliMUONHitMapA1(c1Segmentation, fTDList);
-               AliDebug(4,Form( "Creating hit map for chamber %d, cathode 2.", i+1));
+               if (GetDebug() > 3) Info("InitArrays", "Creating hit map for chamber %d, cathode 2.", i+1);
                AliSegmentation* c2Segmentation = chamber->SegmentationModel(2); // Cathode plane 2
                fHitMap[i+AliMUONConstants::NCh()] = new AliMUONHitMapA1(c2Segmentation, fTDList);
        };
@@ -504,17 +515,17 @@ void AliMUONDigitizer::CleanupArrays()
 {
 // The arrays fTDList and fHitMap are deleted and the pointers set to NULL.
 
-       AliDebug(2, "Deleting internal arrays.");
+       if (GetDebug() > 1) Info("CleanupArrays", "Deleting internal arrays.");
        for(Int_t i = 0; i < 2*AliMUONConstants::NCh(); i++)
        {
-               AliDebug(4,Form( "Deleting hit map for chamber %d, cathode %d.", 
-                       i%AliMUONConstants::NCh()+1, i/AliMUONConstants::NCh()+1));
+               if (GetDebug() > 3) Info("CleanupArrays", "Deleting hit map for chamber %d, cathode %d.", 
+                       i%AliMUONConstants::NCh()+1, i/AliMUONConstants::NCh()+1);
                delete fHitMap[i];
        };
        delete [] fHitMap;
        fHitMap = NULL;
        
-       AliDebug(4, "Deleting transient digits list.");
+       if (GetDebug() > 3) Info("CleanupArrays", "Deleting transient digits list.");
        fTDList->Delete();
        delete fTDList;
        fTDList = NULL;
index 541b860..17c2965 100644 (file)
@@ -39,7 +39,6 @@
 #include "AliMUONHit.h"
 #include "AliMUONTransientDigit.h"
 #include "AliMUONTriggerDecision.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONDigitizerv1)
 
@@ -76,14 +75,15 @@ void AliMUONDigitizerv1::GenerateTransientDigits()
 // Note: Charge correlation is applied to the tracking chambers. 
 
        TTree* treeH = fGime->TreeH();
-       AliDebug(2, Form("Generating transient digits using treeH = 0x%X"
-                       , (void*)treeH));
+       if (GetDebug() > 1)
+               Info("GenerateTransientDigits", "Generating transient digits using treeH = 0x%X"
+                       , (void*)treeH);
        //
        // Loop over tracks
        Int_t ntracks = (Int_t) treeH->GetEntries();
        for (Int_t itrack = 0; itrack < ntracks; itrack++) 
        {
-               AliDebug(3, Form("Processing track %d...", itrack));
+               if (GetDebug() > 2) Info("GenerateTransientDigits", "Processing track %d...", itrack);
                fMUONData->ResetHits();
                treeH->GetEvent(itrack);
                //
@@ -95,14 +95,19 @@ void AliMUONDigitizerv1::GenerateTransientDigits()
                        Int_t ichamber = mHit->Chamber()-1;  // chamber number
                        if (ichamber > AliMUONConstants::NCh()-1) 
                        {
-                               AliError(Form("Hit 0x%X has a invalid chamber number: %d", ichamber));
+                               Error("GenerateTransientDigits", 
+                                       "Hit 0x%X has a invalid chamber number: %d", ichamber);
                                continue;
                        }
                        //
                        //Dumping Hit content:
-                       AliDebug(3,Form("Hit %d: chamber = %d\tX = %f\tY = %f\tZ = %f\teloss = %f",
+                       if (GetDebug() > 2) 
+                       {
+                               Info("GenerateTransientDigits", 
+                                       "Hit %d: chamber = %d\tX = %f\tY = %f\tZ = %f\teloss = %f",
                                        ihit, mHit->Chamber(), mHit->X(), mHit->Y(), mHit->Z(), mHit->Eloss()
-                                   ));
+                                   );
+                       }
                        // 
                        // Inititializing Correlation
                        AliMUONChamber& chamber = fMUON->Chamber(ichamber);
@@ -128,11 +133,13 @@ void AliMUONDigitizerv1::MakeTransientDigitsFromHit(Int_t track, Int_t iHit, Ali
 // fired for a given hit. We then loop over the fired pads and add an AliMUONTransientDigit
 // for each pad.
 
-       AliDebug(4,Form("Making transient digit for hit number %d.", iHit));
+       if (GetDebug() > 3)
+               Info("MakeTransientDigitsFromHit", "Making transient digit for hit number %d.", iHit);
                
        //
        // Calls the charge disintegration method of the current chamber 
-       AliDebug(5,"Calling AliMUONChamber::DisIngtegration...");
+       if (GetDebug() > 4)
+               Info("MakeTransientDigitsFromHit", "Calling AliMUONChamber::DisIngtegration...");
 
        Float_t newdigit[6][500];  // Pad information
        Int_t nnew=0;              // Number of touched Pads per hit
@@ -162,9 +169,10 @@ void AliMUONDigitizerv1::MakeTransientDigitsFromHit(Int_t track, Int_t iHit, Ali
                };
                digits[5] = iHit+fMask;    // Hit number in the list
 
-               AliDebug(5,Form("MakeTransientDigitsFromHit", 
+               if (GetDebug() > 4)
+                       Info("MakeTransientDigitsFromHit", 
                                "DisIntegration result %d: PadX %d\tPadY %d\tPlane %d\tCharge %d\tHit %d",
-                               iTD, digits[0], digits[1], digits[2], digits[3], digits[5]));
+                               iTD, digits[0], digits[1], digits[2], digits[3], digits[5]);
 
                AliMUONTransientDigit* mTD = new AliMUONTransientDigit(ichamber, digits);
                mTD->AddToTrackList(track + fMask, charge);
@@ -193,7 +201,7 @@ void AliMUONDigitizerv1::FillTriggerOutput()
 {
 // Derived to fill TreeD and resets the trigger array in fMUONData.
 
-       AliDebug(3,"Filling trees with trigger.");
+       if (GetDebug() > 2) Info("FillTriggerOutput", "Filling trees with trigger.");
        fMUONData->Fill("GLT");
        fMUONData->ResetTrigger();
 };
@@ -214,7 +222,8 @@ Int_t AliMUONDigitizerv1::GetSignalFrom(AliMUONTransientDigit* td)
 // Derived to apply the chamber response model to the digit. 
 // Using AliMUONChamber::ResponseModel() for this.
 
-       AliDebug(4, "Applying response of chamber to TransientDigit signal.");
+       if (GetDebug() > 3)
+               Info("GetSignalFrom", "Applying response of chamber to TransientDigit signal.");
        //
        //  Digit Response (noise, threshold, saturation, ...)
        Int_t q = td->Signal(); 
@@ -230,7 +239,8 @@ Bool_t AliMUONDigitizerv1::InitOutputData(AliMUONLoader* muonloader)
 // Derived to initialize the output digits tree TreeD, create it if necessary
 // and sets the fMUONData tree address to treeD.
 
-       AliDebug(3, "Creating digits branch and setting the tree address.");
+       if (GetDebug() > 2)
+               Info("InitOutputData", "Creating digits branch and setting the tree address.");
 
        fMUONData->SetLoader(muonloader);
 
@@ -240,7 +250,7 @@ Bool_t AliMUONDigitizerv1::InitOutputData(AliMUONLoader* muonloader)
                muonloader->MakeDigitsContainer();
                if (muonloader->TreeD() == NULL)
                {
-                       AliError("Could not create TreeD.");
+                       Error("InitOutputData", "Could not create TreeD.");
                        return kFALSE;
                };
        };
@@ -256,7 +266,7 @@ void AliMUONDigitizerv1::FillOutputData()
 {
 // Derived to fill TreeD and resets the digit array in fMUONData.
 
-       AliDebug(3, "Filling trees with digits.");
+       if (GetDebug() > 2) Info("FillOutputData", "Filling trees with digits.");
        fMUONData->Fill("D");
        fMUONData->ResetDigits();
 };
@@ -266,7 +276,7 @@ void AliMUONDigitizerv1::CleanupOutputData(AliMUONLoader* muonloader)
 {
 // Derived to write the digits tree and then unload the digits tree once written.
 
-       AliDebug(3, "Writing digits and releasing pointers.");
+       if (GetDebug() > 2) Info("CleanupOutputData", "Writing digits and releasing pointers.");
        muonloader->WriteDigits("OVERWRITE");
        muonloader->UnloadDigits();
 };
@@ -278,7 +288,8 @@ Bool_t AliMUONDigitizerv1::InitInputData(AliMUONLoader* muonloader)
 // Derived to initialise the input to read from TreeH the hits tree. 
 // If the hits are not loaded then we load the hits using the muon loader.
 
-       AliDebug(3, "Loading hits in READ mode and setting the tree address.");
+       if (GetDebug() > 2)
+               Info("InitInputData", "Loading hits in READ mode and setting the tree address.");
 
        fMUONData->SetLoader(muonloader);
 
@@ -287,7 +298,7 @@ Bool_t AliMUONDigitizerv1::InitInputData(AliMUONLoader* muonloader)
                muonloader->LoadHits("READ");
                if (muonloader->TreeH() == NULL)
                {
-                       AliError("Can not load the hits tree.");
+                       Error("InitInputData", "Can not load the hits tree.");
                        return kFALSE;
                };
        };
@@ -301,7 +312,7 @@ void AliMUONDigitizerv1::CleanupInputData(AliMUONLoader* muonloader)
 {
 // Derived to release the loaded hits and unload them.
 
-       AliDebug(3, "Releasing loaded hits.");
+       if (GetDebug() > 2) Info("CleanupInputData", "Releasing loaded hits.");
        fMUONData->ResetHits();
        muonloader->UnloadHits();
 };
index 4480b2d..6780262 100644 (file)
@@ -34,7 +34,6 @@
 #include "AliMUONDigit.h"
 #include "AliMUONDigitizerv2.h"
 #include "AliMUONTransientDigit.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONDigitizerv2)
 
@@ -62,7 +61,9 @@ void AliMUONDigitizerv2::GenerateTransientDigits()
 // Loop over all chambers and s-digits in the input stream and create 
 // AliMUONTransientDigit objects from them. These are then added to fTDList.
 
-       AliDebug(2,"Generating transient digits using treeH = 0x%X");
+       if (GetDebug() > 1) 
+               Info("GenerateTransientDigits", "Generating transient digits using treeH = 0x%X");
+
        //
        // Loop over SDigits
        Int_t ndig, k;
@@ -97,7 +98,10 @@ void AliMUONDigitizerv2::MakeTransientDigitFromSDigit(Int_t iChamber, AliMUONDig
 // Makes a transient digit from the specified s-digit from the specified chamber. 
 // Once the digit is created it is added to the fTDList.
 
-       AliDebug(4,Form("Making transient digit from s-digit for chamber %d.", iChamber));
+       if (GetDebug() > 3)
+               Info("MakeTransientDigitFromSDigit", 
+                       "Making transient digit from s-digit for chamber %d.", iChamber);
+       
        Int_t digits[6];
        //
        // Creating a new TransientDigits from SDigit
@@ -112,8 +116,10 @@ void AliMUONDigitizerv2::MakeTransientDigitFromSDigit(Int_t iChamber, AliMUONDig
                
        digits[5] = sDigit->Hit();    // Hit number in the list
 
-       AliDebug(5,Form("Made digit from sDigit 0x%X: PadX %d\tPadY %d\tPlane %d\tCharge %d\tHit %d",
-                       (void*)sDigit, digits[0], digits[1], digits[2], digits[3], digits[5]));
+       if (GetDebug() > 4)
+               Info("MakeTransientDigitFromSDigit", 
+                       "Made digit from sDigit 0x%X: PadX %d\tPadY %d\tPlane %d\tCharge %d\tHit %d",
+                       (void*)sDigit, digits[0], digits[1], digits[2], digits[3], digits[5]);
        
        AliMUONTransientDigit* mTD = new AliMUONTransientDigit(iChamber, digits);
        // Copy list of tracks and trackcharge
@@ -142,7 +148,9 @@ Bool_t AliMUONDigitizerv2::InitInputData(AliMUONLoader* muonloader)
 // If the s-digits are not loaded then the muon loader is used to load the
 // s-digits into memory.
 
-       AliDebug(3,"Loading s-digits in READ mode and setting the tree address.");
+       if (GetDebug() > 2)
+               Info("InitInputData", "Loading s-digits in READ mode and setting the tree address.");
+
        fMUONData->SetLoader(muonloader);
 
        if (muonloader->TreeS() == NULL)
@@ -150,7 +158,7 @@ Bool_t AliMUONDigitizerv2::InitInputData(AliMUONLoader* muonloader)
                muonloader->LoadSDigits("READ");
                if (muonloader->TreeS() == NULL)
                {
-                       AliError("Can not load the s-digits tree.");
+                       Error("InitInputData", "Can not load the s-digits tree.");
                        return kFALSE;
                };
        };
@@ -164,7 +172,7 @@ void AliMUONDigitizerv2::CleanupInputData(AliMUONLoader* muonloader)
 {
 // Overridden to release and unload s-digits from memory.
 
-       AliDebug(3,"Releasing loaded s-digits.");
+       if (GetDebug() > 2) Info("CleanupInputData", "Releasing loaded s-digits.");
        fMUONData->ResetSDigits();
        muonloader->UnloadSDigits();
 };
index 035b290..c61e51d 100644 (file)
@@ -39,6 +39,7 @@
 #include <TGeometry.h>
 #include <TMarker3DBox.h>
 #include <TParticle.h>
+#include <TPolyLine3D.h>
 
 #include "AliMUONDisplay.h"
 #include "AliRun.h"
@@ -58,7 +59,6 @@
 #include "AliMUONChamber.h"
 #include "AliMUONConstants.h"
 #include "AliMC.h"
-#include "AliLog.h"
 // to manage the same zoom on both cathodes
 
 
@@ -233,7 +233,7 @@ AliMUONDisplay::AliMUONDisplay(const AliMUONDisplay & display)
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONDisplay", "Not implemented.");
 }
 
 
@@ -1486,7 +1486,7 @@ AliMUONDisplay & AliMUONDisplay::operator = (const AliMUONDisplay & rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }
index d048b13..11b7613 100644 (file)
@@ -57,7 +57,6 @@
 #include "AliLoader.h"
 #include "AliMUONTrackK.h" //AZ
 #include "AliMC.h"
-#include "AliLog.h"
 
 //************* Defaults parameters for reconstruction
 const Double_t AliMUONEventReconstructor::fgkDefaultMinBendingMomentum = 3.0;
@@ -160,7 +159,7 @@ AliMUONEventReconstructor::AliMUONEventReconstructor (const AliMUONEventReconstr
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONEventReconstructor", "Not implemented.");
 }
 
 AliMUONEventReconstructor & 
@@ -170,7 +169,7 @@ AliMUONEventReconstructor::operator=(const AliMUONEventReconstructor& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }
@@ -229,13 +228,13 @@ void AliMUONEventReconstructor::SetReconstructionParametersToDefaults(void)
   // scaled to the real distance between chambers in a station
   fSegmentMaxDistBending[0] = TMath::Abs( 1.5 *
     ((&(pMUON->Chamber(1)))->Z() - (&(pMUON->Chamber(0)))->Z()) / 20.0);
-  fSegmentMaxDistBending[1] =  TMath::Abs( 1.5 *
+  fSegmentMaxDistBending[1] = TMath::Abs( 1.5 *
     ((&(pMUON->Chamber(3)))->Z() - (&(pMUON->Chamber(2)))->Z()) / 20.0);
-  fSegmentMaxDistBending[2] =  TMath::Abs( 3.0 *
+  fSegmentMaxDistBending[2] = TMath::Abs( 3.0 *
     ((&(pMUON->Chamber(5)))->Z() - (&(pMUON->Chamber(4)))->Z()) / 20.0);
-  fSegmentMaxDistBending[3] =  TMath::Abs( 6.0 *
+  fSegmentMaxDistBending[3] = TMath::Abs( 6.0 *
     ((&(pMUON->Chamber(7)))->Z() - (&(pMUON->Chamber(6)))->Z()) / 20.0);
-  fSegmentMaxDistBending[4] =  TMath::Abs( 6.0 *
+  fSegmentMaxDistBending[4] = TMath::Abs( 6.0 *
     ((&(pMUON->Chamber(9)))->Z() - (&(pMUON->Chamber(8)))->Z()) / 20.0);
   
   fBendingResolution = fgkDefaultBendingResolution;
@@ -345,8 +344,9 @@ void AliMUONEventReconstructor::NextBkgGeantEvent(void)
     sprintf(treeName, "TreeK%d", fBkgGeantEventNumber);
     fBkgGeantTK = (TTree*)gDirectory->Get(treeName);
     if (!fBkgGeantTK) {
-               AliError(Form("cannot find Kine Tree for background event: %d",fBkgGeantEventNumber));
-       exit(0);
+      cout << "ERROR: cannot find Kine Tree for background event: " <<
+       fBkgGeantEventNumber << endl;
+      exit(0);
     }
   }
   if (fBkgGeantTK) 
@@ -356,7 +356,8 @@ void AliMUONEventReconstructor::NextBkgGeantEvent(void)
   sprintf(treeName, "TreeH%d", fBkgGeantEventNumber);
   fBkgGeantTH = (TTree*)gDirectory->Get(treeName);
   if (!fBkgGeantTH) {
-         AliError(Form("cannot find Hits Tree for background event: %d",fBkgGeantEventNumber));
+    cout << "ERROR: cannot find Hits Tree for background event: " <<
+      fBkgGeantEventNumber << endl;
       exit(0);
   }
   if (fBkgGeantTH && fBkgGeantHits) {
@@ -489,13 +490,13 @@ void AliMUONEventReconstructor::MakeEventToBeReconstructed(void)
          Int_t retval = fLoader->LoadHits();
          if ( retval)
           {
-            AliError("Error occured while loading hits.");
+            Error("MakeEventToBeReconstructed","Error occured while loading hits.");
             return;
           }
          treeH = fLoader->TreeH();
          if (treeH == 0x0)
           {
-           AliError("Can not get TreeH");
+           Error("MakeEventToBeReconstructed","Can not get TreeH");
            return;
           }
        }
@@ -779,7 +780,9 @@ void AliMUONEventReconstructor::AddHitsForRecFromRawClusters(TTree* TR)
 
   nTRentries = Int_t(TR->GetEntries());
   if (nTRentries != 1) {
-    AliError(Form("nTRentries = %d not equal to 1 ",nTRentries));
+    cout << "Error in AliMUONEventReconstructor::AddHitsForRecFromRawClusters"
+        << endl;
+    cout << "nTRentries = " << nTRentries << " not equal to 1" << endl;
     exit(0);
   }
   fLoader->TreeR()->GetEvent(0); // only one entry  
@@ -866,7 +869,6 @@ void AliMUONEventReconstructor::MakeSegmentsPerStation(Int_t Station)
   Bool_t last2st;
   Double_t bendingSlope, distBend, distNonBend, extBendCoor, extNonBendCoor,
       impactParam = 0., maxImpactParam = 0., minImpactParam = 0.; // =0 to avoid compilation warnings.
-  AliMUON *pMUON  = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
   if (fPrintLevel >= 1)
     cout << "enter MakeSegmentsPerStation (0...) " << Station << endl;
   // first and second chambers (0...) in the station
@@ -886,8 +888,7 @@ void AliMUONEventReconstructor::MakeSegmentsPerStation(Int_t Station)
   else last2st = kFALSE;
   // extrapolation factor from Z of first chamber to Z of second chamber
   // dZ to be changed to take into account fine structure of chambers ????
-  Double_t extrapFact =
-    (&(pMUON->Chamber(ch2)))->Z() / (&(pMUON->Chamber(ch1)))->Z();
+  Double_t extrapFact;
   // index for current segment
   Int_t segmentIndex = 0;
   // Loop over HitsForRec in the first chamber of the station
@@ -899,8 +900,6 @@ void AliMUONEventReconstructor::MakeSegmentsPerStation(Int_t Station)
     // extrapolation,
     // on the straight line joining the HitForRec to the vertex (0,0,0),
     // to the Z of the second chamber of the station
-    extBendCoor = extrapFact * hit1Ptr->GetBendingCoor();
-    extNonBendCoor = extrapFact * hit1Ptr->GetNonBendingCoor();
     // Loop over HitsForRec in the second chamber of the station
     for (Int_t hit2 = fIndexOfFirstHitForRecPerChamber[ch2];
         hit2 < fIndexOfFirstHitForRecPerChamber[ch2] + fNHitsForRecPerChamber[ch2];
@@ -910,6 +909,9 @@ void AliMUONEventReconstructor::MakeSegmentsPerStation(Int_t Station)
       // absolute values of distances, in bending and non bending planes,
       // between the HitForRec in the second chamber
       // and the previous extrapolation
+      extrapFact = hit2Ptr->GetZ()/ hit1Ptr->GetZ();
+      extBendCoor = extrapFact * hit1Ptr->GetBendingCoor();
+      extNonBendCoor = extrapFact * hit1Ptr->GetNonBendingCoor();
       distBend = TMath::Abs(hit2Ptr->GetBendingCoor() - extBendCoor);
       distNonBend = TMath::Abs(hit2Ptr->GetNonBendingCoor() - extNonBendCoor);
       if (last2st) {
@@ -1038,7 +1040,9 @@ Bool_t AliMUONEventReconstructor::MakeTriggerTracks(void)
     treeR->GetEvent(0); // only one entry  
 
     if (!(fMUONData->IsTriggerBranchesInTree())) {
-      AliWarning(Form("Trigger information is not avalaible, nTRentries = %d not equal to 1",nTRentries));
+      cout << "Warning in AliMUONEventReconstructor::MakeTriggerTracks"
+          << endl;
+      cout << "Trigger information is not avalaible, nTRentries = " << nTRentries << " not equal to 1" << endl;
       return kFALSE;
     }
 
@@ -1105,7 +1109,8 @@ Int_t AliMUONEventReconstructor::MakeTrackCandidatesWithTwoSegments(AliMUONSegme
   // the first segment being pointed to by "BegSegment".
   // Returns the number of such track candidates.
   Int_t endStation, iEndSegment, nbCan2Seg;
-  AliMUONSegment *endSegment, *extrapSegment;
+  AliMUONSegment *endSegment;
+  AliMUONSegment *extrapSegment = NULL;
   AliMUONTrack *recTrack;
   Double_t mcsFactor;
   if (fPrintLevel >= 1) cout << "enter MakeTrackCandidatesWithTwoSegments" << endl;
@@ -1116,8 +1121,6 @@ Int_t AliMUONEventReconstructor::MakeTrackCandidatesWithTwoSegments(AliMUONSegme
     GetBendingMomentumFromImpactParam(BegSegment->GetBendingImpact());
   mcsFactor    = fChamberThicknessInX0 * mcsFactor * mcsFactor;
   // linear extrapolation to end station
-  extrapSegment =
-    BegSegment->CreateSegmentFromLinearExtrapToStation(endStation, mcsFactor);
   // number of candidates with 2 segments to 0
   nbCan2Seg = 0;
   // Loop over segments in the end station
@@ -1126,6 +1129,8 @@ Int_t AliMUONEventReconstructor::MakeTrackCandidatesWithTwoSegments(AliMUONSegme
     endSegment = (AliMUONSegment*) ((*fSegmentsPtr[endStation])[iEndSegment]);
     // test compatibility between current segment and "extrapSegment"
     // 4 because 4 quantities in chi2
+    extrapSegment =
+      BegSegment->CreateSegmentFromLinearExtrapToStation(endSegment->GetZ(), mcsFactor);
     if ((endSegment->
         NormalizedChi2WithSegment(extrapSegment,
                                   fMaxSigma2Distance)) <= 4.0) {
@@ -1157,7 +1162,8 @@ Int_t AliMUONEventReconstructor::MakeTrackCandidatesWithOneSegmentAndOnePoint(Al
   // in stations(1..) 4 and 5,
   // the segment being pointed to by "BegSegment".
   Int_t ch, ch1, ch2, endStation, iHit, iHitMax, iHitMin, nbCan1Seg1Hit;
-  AliMUONHitForRec *extrapHitForRec, *hit;
+  AliMUONHitForRec *extrapHitForRec= NULL;
+  AliMUONHitForRec *hit;
   AliMUONTrack *recTrack;
   Double_t mcsFactor;
   if (fPrintLevel >= 1)
@@ -1175,9 +1181,6 @@ Int_t AliMUONEventReconstructor::MakeTrackCandidatesWithOneSegmentAndOnePoint(Al
   nbCan1Seg1Hit = 0;
   // Loop over chambers of the end station
   for (ch = ch2; ch >= ch1; ch--) {
-    // linear extrapolation to chamber
-    extrapHitForRec =
-      BegSegment->CreateHitForRecFromLinearExtrapToChamber(ch, mcsFactor);
     // limits for the hit index in the loop
     iHitMin = fIndexOfFirstHitForRecPerChamber[ch];
     iHitMax = iHitMin + fNHitsForRecPerChamber[ch];
@@ -1187,6 +1190,9 @@ Int_t AliMUONEventReconstructor::MakeTrackCandidatesWithOneSegmentAndOnePoint(Al
       hit = (AliMUONHitForRec*) ((*fHitsForRecPtr)[iHit]);
       // test compatibility between current HitForRec and "extrapHitForRec"
       // 2 because 2 quantities in chi2
+      // linear extrapolation to chamber
+      extrapHitForRec =
+       BegSegment->CreateHitForRecFromLinearExtrapToChamber( hit->GetZ(), mcsFactor);
       if ((hit->
           NormalizedChi2WithHitForRec(extrapHitForRec,
                                       fMaxSigma2Distance)) <= 2.0) {
@@ -1252,8 +1258,8 @@ void AliMUONEventReconstructor::FollowTracks(void)
 {
   // Follow tracks in stations(1..) 3, 2 and 1
   // too long: should be made more modular !!!!
-  AliMUONHitForRec *bestHit, *extrapHit, *extrapCorrHit, *hit;
-  AliMUONSegment *bestSegment, *extrapSegment, *extrapCorrSegment, *segment;
+  AliMUONHitForRec *bestHit, *extrapHit, *hit;
+  AliMUONSegment *bestSegment, *extrapSegment, *segment;
   AliMUONTrack *track, *nextTrack;
   AliMUONTrackParam *trackParam1, trackParam[2], trackParamVertex;
   // -1 to avoid compilation warnings
@@ -1294,7 +1300,6 @@ void AliMUONEventReconstructor::FollowTracks(void)
       // extrapolation to station
       trackParam1->ExtrapToStation(station, trackParam);
       extrapSegment = new AliMUONSegment(); //  empty segment
-      extrapCorrSegment = new AliMUONSegment(); //  empty corrected segment
       // multiple scattering factor corresponding to one chamber
       // and momentum in bending plane (not total)
       mcsFactor = 0.0136 * trackParam1->GetInverseBendingMomentum();
@@ -1314,14 +1319,6 @@ void AliMUONEventReconstructor::FollowTracks(void)
       extrapSegment->UpdateFromStationTrackParam
        (trackParam, mcsFactor, dZ1, dZ2, dZ3, station,
         trackParam1->GetInverseBendingMomentum());
-      // same thing for corrected segment
-      // better to use copy constructor, after checking that it works properly !!!!
-      extrapCorrSegment->SetBendingCoorReso2(fBendingResolution * fBendingResolution);
-      extrapCorrSegment->
-       SetNonBendingCoorReso2(fNonBendingResolution * fNonBendingResolution);
-      extrapCorrSegment->UpdateFromStationTrackParam
-       (trackParam, mcsFactor, dZ1, dZ2, dZ3, station,
-        trackParam1->GetInverseBendingMomentum());
       bestChi2 = 5.0;
       bestSegment = NULL;
       if (fPrintLevel >= 10) {
@@ -1337,18 +1334,14 @@ void AliMUONEventReconstructor::FollowTracks(void)
        segment = (AliMUONSegment*) ((*fSegmentsPtr[station])[iSegment]);
        // correction of corrected segment (fBendingCoor and fNonBendingCoor)
        // according to real Z value of "segment" and slopes of "extrapSegment"
-       extrapCorrSegment->
-         SetBendingCoor(extrapSegment->GetBendingCoor() +
-                        extrapSegment->GetBendingSlope() *
-                        (segment->GetHitForRec1()->GetZ() -
-                         (&(pMUON->Chamber(2 * station)))->Z()));
-       extrapCorrSegment->
-         SetNonBendingCoor(extrapSegment->GetNonBendingCoor() +
-                           extrapSegment->GetNonBendingSlope() *
-                           (segment->GetHitForRec1()->GetZ() -
-                            (&(pMUON->Chamber(2 * station)))->Z()));
+       (&(trackParam[0]))->ExtrapToZ(segment->GetZ());
+       (&(trackParam[1]))->ExtrapToZ(segment->GetZ());
+       extrapSegment->SetBendingCoor((&(trackParam[0]))->GetBendingCoor());
+       extrapSegment->SetNonBendingCoor((&(trackParam[0]))->GetNonBendingCoor());
+       extrapSegment->SetBendingSlope((&(trackParam[0]))->GetBendingSlope());
+       extrapSegment->SetNonBendingSlope((&(trackParam[0]))->GetNonBendingSlope());
        chi2 = segment->
-         NormalizedChi2WithSegment(extrapCorrSegment, maxSigma2Distance);
+         NormalizedChi2WithSegment(extrapSegment, maxSigma2Distance);
        if (chi2 < bestChi2) {
          // update best Chi2 and Segment if better found
          bestSegment = segment;
@@ -1357,6 +1350,8 @@ void AliMUONEventReconstructor::FollowTracks(void)
       }
       if (bestSegment) {
        // best segment found: add it to track candidate
+       (&(trackParam[0]))->ExtrapToZ(bestSegment->GetZ());
+       (&(trackParam[1]))->ExtrapToZ(bestSegment->GetZ());
        track->AddSegment(bestSegment);
        // set track parameters at these two TrakHit's
        track->SetTrackParamAtHit(track->GetNTrackHits() - 2, &(trackParam[0]));
@@ -1373,7 +1368,6 @@ void AliMUONEventReconstructor::FollowTracks(void)
        // should consider all possibilities ????
        // multiple scattering ???? do about like for extrapSegment !!!!
        extrapHit = new AliMUONHitForRec(); //  empty hit
-       extrapCorrHit = new AliMUONHitForRec(); //  empty corrected hit
        bestChi2 = 3.0;
        bestHit = NULL;
        if (fPrintLevel >= 10) {
@@ -1383,41 +1377,22 @@ void AliMUONEventReconstructor::FollowTracks(void)
        }
        // Loop over chambers of the station
        for (chInStation = 0; chInStation < 2; chInStation++) {
-         // coordinates of extrapolated hit
-         extrapHit->
-           SetBendingCoor((&(trackParam[chInStation]))->GetBendingCoor());
-         extrapHit->
-           SetNonBendingCoor((&(trackParam[chInStation]))->GetNonBendingCoor());
-         // resolutions from "extrapSegment"
-         extrapHit->SetBendingReso2(extrapSegment->GetBendingCoorReso2());
-         extrapHit->SetNonBendingReso2(extrapSegment->GetNonBendingCoorReso2());
-         // same things for corrected hit
-         // better to use copy constructor, after checking that it works properly !!!!
-         extrapCorrHit->
-           SetBendingCoor((&(trackParam[chInStation]))->GetBendingCoor());
-         extrapCorrHit->
-           SetNonBendingCoor((&(trackParam[chInStation]))->GetNonBendingCoor());
-         extrapHit->SetBendingReso2(extrapSegment->GetBendingCoorReso2());
-         extrapHit->SetNonBendingReso2(extrapSegment->GetNonBendingCoorReso2());
-         // Loop over hits in the chamber
          ch = 2 * station + chInStation;
          for (iHit = fIndexOfFirstHitForRecPerChamber[ch];
               iHit < fIndexOfFirstHitForRecPerChamber[ch] +
                 fNHitsForRecPerChamber[ch];
               iHit++) {
            hit = (AliMUONHitForRec*) ((*fHitsForRecPtr)[iHit]);
-           // correction of corrected hit (fBendingCoor and fNonBendingCoor)
-           // according to real Z value of "hit" and slopes of right "trackParam"
-           extrapCorrHit->
-             SetBendingCoor((&(trackParam[chInStation]))->GetBendingCoor() +
-                            (&(trackParam[chInStation]))->GetBendingSlope() *
-                            (hit->GetZ() -
-                             (&(trackParam[chInStation]))->GetZ()));
-           extrapCorrHit->
-             SetNonBendingCoor((&(trackParam[chInStation]))->GetNonBendingCoor() +
-                               (&(trackParam[chInStation]))->GetNonBendingSlope() *
-                               (hit->GetZ() -
-                                (&(trackParam[chInStation]))->GetZ()));
+           // coordinates of extrapolated hit
+           (&(trackParam[chInStation]))->ExtrapToZ(hit->GetZ());
+           extrapHit->
+             SetBendingCoor((&(trackParam[chInStation]))->GetBendingCoor());
+           extrapHit->
+             SetNonBendingCoor((&(trackParam[chInStation]))->GetNonBendingCoor());
+           // resolutions from "extrapSegment"
+           extrapHit->SetBendingReso2(extrapSegment->GetBendingCoorReso2());
+           extrapHit->SetNonBendingReso2(extrapSegment->GetNonBendingCoorReso2());
+           // Loop over hits in the chamber
            // condition for hit not already in segment ????
            chi2 = hit->NormalizedChi2WithHitForRec(extrapHit, maxSigma2Distance);
            if (chi2 < bestChi2) {
@@ -1430,6 +1405,7 @@ void AliMUONEventReconstructor::FollowTracks(void)
        }
        if (bestHit) {
          // best hit found: add it to track candidate
+         (&(trackParam[chBestHit]))->ExtrapToZ(bestHit->GetZ());
          track->AddHitForRec(bestHit);
          // set track parameters at this TrackHit
          track->SetTrackParamAtHit(track->GetNTrackHits() - 1,
@@ -1445,17 +1421,13 @@ void AliMUONEventReconstructor::FollowTracks(void)
          // and corresponding TrackHit's, ...
          track->Remove();
          delete extrapSegment;
-         delete extrapCorrSegment;
          delete extrapHit;
-         delete extrapCorrHit;
          break; // stop the search for this candidate:
          // exit from the loop over station
        }
        delete extrapHit;
-       delete extrapCorrHit;
       }
       delete extrapSegment;
-      delete extrapCorrSegment;
       // Sort track hits according to increasing Z
       track->GetTrackHitsPtr()->Sort();
       // Update track parameters at first track hit (smallest Z)
index f3504a4..1f1c002 100644 (file)
@@ -30,7 +30,6 @@
 #include "AliMUONSegmentationSlatN.h"
 #include "AliMUONSegmentationTriggerX.h"
 #include "AliMUONSegmentationTriggerY.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONFactory)
 
@@ -49,7 +48,7 @@ AliMUONFactory::AliMUONFactory(const AliMUONFactory& rhs)
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONFactory", "Not implemented.");
 }
 
 //__________________________________________________________________________
@@ -66,7 +65,7 @@ AliMUONFactory&  AliMUONFactory::operator=(const AliMUONFactory& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }    
@@ -246,10 +245,13 @@ void AliMUONFactory::BuildStation3()
                             0,0,3,0,
                             0,0,2,0};
        
-       Float_t shift = 1.5/2.;
-       Float_t xpos5[9]    = {4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5};
-       Float_t ypos5       = -(20.+4.*(40.-2.*shift));
-       
+       Float_t shift = 0.; // no more constant overlap between slats
+
+       Float_t xpos5[9]    = {1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25};
+       Float_t ypos5[9]    = {-146.5, -112.8, -75.5, -37.8, 0.0, 37.8, 75.5, 112.8, 146.5};    
+
+       for (Int_t i = 0; i < 9; i++) ypos5[i] -= 20.; // origin in segmentation at the bottom of the slat !
+
        Int_t chamber=5;
        fMUON->SetNsec(chamber-1,2);
        AliMUONSegmentationSlat *seg51=new AliMUONSegmentationSlat(4);
@@ -257,7 +259,7 @@ void AliMUONFactory::BuildStation3()
        seg51->SetShift(shift);  
        seg51->SetNPCBperSector(npcb5); 
        seg51->SetSlatXPositions(xpos5);
-       seg51->SetSlatYPosition(ypos5);
+       seg51->SetSlatYPositions(ypos5);
        seg51->SetPadSize(10.,0.5);
        seg51->SetDAnod(0.25);
        seg51->SetPadDivision(nseg3);
@@ -268,7 +270,7 @@ void AliMUONFactory::BuildStation3()
        seg52->SetShift(shift);  
        seg52->SetNPCBperSector(npcb5); 
        seg52->SetSlatXPositions(xpos5);
-       seg52->SetSlatYPosition(ypos5);
+       seg52->SetSlatYPositions(ypos5);
        seg52->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg52->SetDAnod(0.25);
        seg52->SetPadDivision(nseg3);
@@ -283,7 +285,7 @@ void AliMUONFactory::BuildStation3()
        seg61->SetShift(shift);  
        seg61->SetNPCBperSector(npcb5); 
        seg61->SetSlatXPositions(xpos5);
-       seg61->SetSlatYPosition(ypos5);
+       seg61->SetSlatYPositions(ypos5);
        seg61->SetPadSize(10.,0.5);
        seg61->SetDAnod(0.25);
        seg61->SetPadDivision(nseg3);
@@ -294,7 +296,7 @@ void AliMUONFactory::BuildStation3()
        seg62->SetShift(shift);  
        seg62->SetNPCBperSector(npcb5); 
        seg62->SetSlatXPositions(xpos5);
-       seg62->SetSlatYPosition(ypos5);
+       seg62->SetSlatYPositions(ypos5);
        seg62->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg62->SetDAnod(0.25);
        seg62->SetPadDivision(nseg3);
@@ -319,7 +321,8 @@ void AliMUONFactory::BuildStation4()
        fMUON->SetNsec(chamber-1,2);
 //
        AliMUONSegmentationSlat *seg71=new AliMUONSegmentationSlat(4);
-       Float_t shift = 1.5/2.;
+       Float_t shift = 0.;
+
        Int_t npcb7[52] = {0,0,0,2,
                           0,0,0,3,
                           0,0,2,2,
@@ -333,14 +336,21 @@ void AliMUONFactory::BuildStation4()
                           0,0,2,2, 
                           0,0,0,3,
                           0,0,0,2};
-       Float_t xpos7[13]   = {4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 44., 4.5, 4.5, 4.5, 4.5, 4.5, 4.5};
-       Float_t ypos7       = -(20.+6.*(40.-2.*shift));  
+       Float_t xpos7[13]   = {1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 39.45, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25};
+       Float_t ypos7[13]   = {-204.1, -175.5, -138.5, -109.2, -72.6, -38.2, 0.0, 
+                              38.2, 72.6, 109.2, 138.5, 175.5, 204.1};
+       Float_t ypos8[13]   = {-208.6, -180.0, -143.0, -113.6, -76.05, -38.2, 0.0, 
+                              38.2, 76.05, 113.6, 143.0, 180.0, 208.6};
+       for (Int_t i = 0; i < 13; i++) {
+         ypos7[i] -= 20.;
+         ypos8[i] -= 20.;
+       }
        
        seg71->SetNSlats(13);  
        seg71->SetShift(shift);  
        seg71->SetNPCBperSector(npcb7); 
        seg71->SetSlatXPositions(xpos7);
-       seg71->SetSlatYPosition(ypos7);
+       seg71->SetSlatYPositions(ypos7);
        
        seg71->SetPadSize(10.,0.5);
        seg71->SetDAnod(0.25);
@@ -354,7 +364,7 @@ void AliMUONFactory::BuildStation4()
        seg72->SetShift(shift);   
        seg72->SetNPCBperSector(npcb7); 
        seg72->SetSlatXPositions(xpos7);
-       seg72->SetSlatYPosition(ypos7);
+       seg72->SetSlatYPositions(ypos7);
        seg72->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg72->SetDAnod(0.25);
        seg72->SetPadDivision(nseg4);
@@ -372,7 +382,7 @@ void AliMUONFactory::BuildStation4()
        seg81->SetShift(shift);  
        seg81->SetNPCBperSector(npcb7); 
        seg81->SetSlatXPositions(xpos7);
-       seg81->SetSlatYPosition(ypos7);
+       seg81->SetSlatYPositions(ypos8);
        seg81->SetPadSize(10.,0.5);
        seg81->SetDAnod(0.25);
        seg81->SetPadDivision(nseg4);
@@ -385,7 +395,7 @@ void AliMUONFactory::BuildStation4()
        seg82->SetShift(shift);  
        seg82->SetNPCBperSector(npcb7); 
        seg82->SetSlatXPositions(xpos7);
-       seg82->SetSlatYPosition(ypos7);
+       seg82->SetSlatYPositions(ypos8);
        seg82->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg82->SetDAnod(0.25);
        seg82->SetPadDivision(nseg4);
@@ -409,7 +419,8 @@ void AliMUONFactory::BuildStation5()
        AliMUONSegmentationSlat *seg91=new AliMUONSegmentationSlat(4);
 
        Int_t   nseg4[4]={4, 4, 2, 1};
-       Float_t shift = 1.5/2.;
+       Float_t shift = 0.;
+
        Int_t   npcb9[52] = {0,0,0,3,
                             0,0,0,4,
                             0,0,2,3,
@@ -424,14 +435,18 @@ void AliMUONFactory::BuildStation5()
                             0,0,0,4, 
                             0,0,0,3};   
        
-       Float_t xpos9[13]   = {4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 44., 4.5, 4.5, 4.5, 4.5, 4.5, 4.5};
-       Float_t ypos9       = -(20.+6.*(40.-2.*shift));
+       Float_t xpos9[13]   = {1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 39.45, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25};
+       Float_t ypos9[13]   = {-224.8, -188.05, -151.0, -113.7, -76.1, -38.2, 0.0, 
+                              38.2, 76.1, 113.7, 151.0, 188.05, 224.8};
+
+       for (Int_t i = 0; i < 13; i++)  ypos9[i] -= 20.;
+
        
        seg91->SetNSlats(13);  
        seg91->SetShift(shift);  
        seg91->SetNPCBperSector(npcb9); 
        seg91->SetSlatXPositions(xpos9);
-       seg91->SetSlatYPosition(ypos9);
+       seg91->SetSlatYPositions(ypos9);
        seg91->SetPadSize(10.,0.5);
        seg91->SetDAnod(0.25);
        seg91->SetPadDivision(nseg4);
@@ -444,7 +459,7 @@ void AliMUONFactory::BuildStation5()
        seg92->SetShift(shift);   
        seg92->SetNPCBperSector(npcb9); 
        seg92->SetSlatXPositions(xpos9);
-       seg92->SetSlatYPosition(ypos9);
+       seg92->SetSlatYPositions(ypos9);
        seg92->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg92->SetDAnod(0.25);
        seg92->SetPadDivision(nseg4);
@@ -462,7 +477,7 @@ void AliMUONFactory::BuildStation5()
        seg101->SetShift(shift);  
        seg101->SetNPCBperSector(npcb9); 
        seg101->SetSlatXPositions(xpos9);
-       seg101->SetSlatYPosition(ypos9);
+       seg101->SetSlatYPositions(ypos9);
        seg101->SetPadSize(10.,0.5);
        seg101->SetDAnod(0.25);
        seg101->SetPadDivision(nseg4);
@@ -475,7 +490,7 @@ void AliMUONFactory::BuildStation5()
        seg102->SetShift(shift);   
        seg102->SetNPCBperSector(npcb9); 
        seg102->SetSlatXPositions(xpos9);
-       seg102->SetSlatYPosition(ypos9);
+       seg102->SetSlatYPositions(ypos9);
        seg102->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg102->SetDAnod(0.25);
        seg102->SetPadDivision(nseg4);
@@ -563,8 +578,14 @@ void AliMUONFactory::Build(AliMUON* where, const char* what)
       BuildStation5();
       BuildStation6();
     } 
-    else
-         AliDebug(0,"Non default version of MUON selected. You have to construct yourself the MUON elements !!");
+    else {
+      if(fMUON->GetDebug()) {
+       printf("\nAliMUONFactory: --------AliMUONFactory------------------------------");
+       printf("\nAliMUONFactory:  Non default version of MUON selected               ");
+       printf("\nAliMUONFactory:  You have to construct yourself the MUON elements !!");       
+       printf("\nAliMUONFactory: ----------------------------------------------------");
+      }
+    }
 }
 
 //__________________________________________________________________________
@@ -594,6 +615,6 @@ void AliMUONFactory::BuildStation(AliMUON* where, Int_t stationNumber)
       case 5:  BuildStation5(); break;
       case 6:  BuildStation6(); break;
     
-      default: AliFatal("Wrong station number");
+      default: Fatal("Build", "Wrong station number");
     }  
 }         
index 4990d3e..9739f5a 100644 (file)
@@ -37,7 +37,6 @@
 #include "AliMUONGeometryConstituent.h"        
 #include "AliMagF.h"
 #include "AliRun.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONGeometryBuilder)
  
@@ -78,7 +77,7 @@ AliMUONGeometryBuilder::AliMUONGeometryBuilder(const AliMUONGeometryBuilder& rig
 {  
   // copy constructor (not implemented)
 
-  AliFatal("Copy constructor not provided.");
+  Fatal("AliMUONGeometryBuilder", "Copy constructor not provided.");
 }
 
 //______________________________________________________________________________
@@ -103,7 +102,7 @@ AliMUONGeometryBuilder::operator=(const AliMUONGeometryBuilder& right)
   // check assignement to self
   if (this == &right) return *this;
 
-  AliFatal("Assignement operator not provided.");
+  Fatal("operator =", "Assignement operator not provided.");
     
   return *this;  
 }    
@@ -233,7 +232,7 @@ void AliMUONGeometryBuilder::CreateGeometry()
         // virtual envelope + nof constituents = 0 
         //         => not allowed;
         //            empty virtual envelope has no sense 
-        AliFatal("Virtual envelope must have constituents.");
+        Fatal("CreateGeometry", "Virtual envelope must have constituents.");
         return;
       }
 
@@ -241,7 +240,7 @@ void AliMUONGeometryBuilder::CreateGeometry()
         // non virtual envelope + nof constituents > 0 
         //        => not allowed;
         //           use VMC to place constituents
-        AliFatal("Non virtual envelope cannot have constituents.");
+        Fatal("CreateGeometry", "Non virtual envelope cannot have constituents.");
         return;
       }
 
@@ -288,75 +287,78 @@ void AliMUONGeometryBuilder::CreateGeometry()
 //_____________________________________________________________________________
 void AliMUONGeometryBuilder::CreateMaterials()
 {
-// Definition of common materials
-// --
+  // 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;
+  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: C6 H6 O
+  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: vetronite -> replacing by G10 Ch. Finck
+  //     spacer: noryl Ch. Finck
+  //     panel sandwich: carbon, nomex, carbon replacing rohacell by nomex Ch. Finck
+
+  // G10: SiO2(60%) + C8H14O4(40%)
+  Float_t aglass[5] = {12.01, 28.09, 16., 1.01,  16.};
+  Float_t zglass[5] = { 6.,   14.,    8., 1.,    8.};
+  Float_t wglass[5] = { 0.22, 0.28, 0.32, 0.03,  0.15};
+  Float_t dglass    = 1.7;
 
   // rohacell: C9 H13 N1 O2
   Float_t arohac[4] = {12.01,  1.01, 14.010, 16.};
@@ -364,58 +366,78 @@ void AliMUONGeometryBuilder::CreateMaterials()
   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);
-
+  // Nomex: C22 H10 N2 O5
+  Float_t aNomex[4] = {12.01,  1.01, 14.010, 16.};
+  Float_t zNomex[4] = { 6.,    1.,    7.,     8.};
+  Float_t wNomex[4] = { 22.,   10.,   2.,     5.};
+  Float_t dNomex    = 0.024; //honey comb
+  Float_t dNomex2   = 1.43;  //bulk material
+
+
+  // Noryl: C8 H8 O polyphenylene oxyde (di-methyl not sure)
+  Float_t aNoryl[3] = {12.01,  1.01, 16.};
+  Float_t zNoryl[3] = { 6.,    1.,    8.};
+  Float_t wNoryl[3] = { 8.,    8.,    1.};
+  Float_t dNoryl    = 1.06;
+
+  fMUON->AliMaterial(31, "COPPER$",   63.54,    29.,   8.96,   1.4, 0.);
+  fMUON->AliMixture( 32, "G10$",      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); 
+  fMUON->AliMixture( 35, "Nomex$",    aNomex, zNomex, dNomex, -4, wNomex); 
+  fMUON->AliMixture( 36, "Noryl$",    aNoryl, zNoryl, dNoryl, -3, wNoryl); 
+  fMUON->AliMixture( 37, "Nomex_bulk$",aNomex, zNomex, dNomex2, -4, wNomex); 
+
+  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);
+  //
+  // slat medium
+  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, "G10               ", 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);
+  fMUON->AliMedium(15, "Nomex             ", 35, 0, iSXFLD, sXMGMX, tmaxfd, 
+                  maxStepAlu, maxDestepAlu, epsil, stmin);
+  fMUON->AliMedium(16, "Noryl             ", 36, 0, iSXFLD, sXMGMX, tmaxfd, 
+                  maxStepAlu, maxDestepAlu, epsil, stmin);
+  fMUON->AliMedium(17, "Nomex bulk        ", 37, 0, iSXFLD, sXMGMX, tmaxfd, 
+                  maxStepAlu, maxDestepAlu, epsil, stmin);
   //.Materials specific to stations
   // created via builders
   
index 241a4ab..b46a77c 100644 (file)
@@ -24,7 +24,6 @@
 #include <TGeoMatrix.h>
 
 #include "AliMUONGeometryConstituent.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONGeometryConstituent)
 
@@ -131,7 +130,8 @@ AliMUONGeometryConstituent::AliMUONGeometryConstituent(
                                         const AliMUONGeometryConstituent& rhs)
   : TNamed(rhs)
 {
-  AliFatal("Copy constructor is not implemented.");
+  Fatal("Copy constructor", 
+        "Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -149,7 +149,8 @@ AliMUONGeometryConstituent::operator = (const AliMUONGeometryConstituent& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  AliFatal("Assignment operator is not implemented.");
+  Fatal("operator=", 
+        "Assignment operator is not implemented.");
     
   return *this;  
 }
index 1020152..42ca882 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "AliMUONGeometryEnvelope.h"
 #include "AliMUONGeometryConstituent.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONGeometryEnvelope)
 
@@ -99,7 +98,8 @@ AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(
                                         const AliMUONGeometryEnvelope& rhs)
   : TNamed(rhs)
 {
-  AliFatal("Copy constructor is not implemented.");
+  Fatal("Copy constructor", 
+        "Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -123,7 +123,8 @@ AliMUONGeometryEnvelope::operator = (const AliMUONGeometryEnvelope& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  AliFatal("Assignment operator is not implemented.");
+  Fatal("operator=", 
+        "Assignment operator is not implemented.");
     
   return *this;  
 }
index 628bdda..c78e2a9 100644 (file)
@@ -17,7 +17,6 @@
 #include "AliMUONGeometryTransformStore.h"
 #include "AliMUONGeometryEnvelope.h"
 #include "AliMUONConstants.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONGeometryEnvelopeStore)
 
@@ -52,7 +51,8 @@ AliMUONGeometryEnvelopeStore::AliMUONGeometryEnvelopeStore()
 AliMUONGeometryEnvelopeStore::AliMUONGeometryEnvelopeStore(const AliMUONGeometryEnvelopeStore& rhs)
   : TObject(rhs)
 {
-  AliFatal("Copy constructor is not implemented.");
+  Fatal("Copy constructor", 
+        "Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -75,7 +75,8 @@ AliMUONGeometryEnvelopeStore::operator = (const AliMUONGeometryEnvelopeStore& rh
   // check assignement to self
   if (this == &rhs) return *this;
 
-  AliFatal("Assignment operator is not implemented.");
+  Fatal("operator=", 
+        "Assignment operator is not implemented.");
     
   return *this;  
 }
@@ -115,7 +116,7 @@ Bool_t AliMUONGeometryEnvelopeStore::AlignEnvelope(
   
   const TGeoCombiTrans* kTransform = fDETransforms->Get(detElemId);
   if (!kTransform) {
-    AliWarning("Transformation not found.");
+    Warning("AlignEnvelope", "Transformation not found.");
     return false;
   };
 
@@ -137,8 +138,12 @@ void  AliMUONGeometryEnvelopeStore::AddEnvelope(const TString& name,
 // to the list of envelopes.
 // ---                                            
 
-  if (!isVirtual) AliDebug(1,Form("Adding non-virtual envelope %s id %d",name.Data(),id));
-//  else AliDebug(1,Form("Adding virtual envelope %s id %d",name.Data(),id));
+  if (fDebug) {
+    cout << "... Adding ";
+    if (!isVirtual) cout << " non-";
+    cout << "virtual envelope " << name 
+         << "  id " << id << endl;
+  }  
 
   AliMUONGeometryEnvelope* envelope 
     = new AliMUONGeometryEnvelope(name, id, isVirtual, only);
index ff429b5..27c15a0 100644 (file)
@@ -20,7 +20,6 @@
 #include <TObjString.h>
 
 #include "AliMUONGeometrySVMap.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONGeometrySVMap)
 
@@ -44,7 +43,8 @@ AliMUONStringIntMap::AliMUONStringIntMap()
 AliMUONStringIntMap::AliMUONStringIntMap(const AliMUONStringIntMap& rhs)
   : TObject(rhs)
 {
-  AliFatal("Copy constructor is not implemented.");
+  Fatal("Copy constructor", 
+        "Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -54,7 +54,8 @@ AliMUONStringIntMap::operator = (const AliMUONStringIntMap& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  AliFatal("Assignment operator is not implemented.");
+  Fatal("operator=", 
+        "Assignment operator is not implemented.");
     
   return *this;  
 }
@@ -76,7 +77,7 @@ Bool_t  AliMUONStringIntMap::Add(const TString& first, Int_t second)
 
   Int_t second2 = Get(first);
   if ( second2 > 0 ) {
-    AliError(Form("%s is already present in the map", first.Data()));
+    Error("Add", "%s is already present in the map", first.Data());
     return false;
   }
   
@@ -188,7 +189,8 @@ AliMUONGeometrySVMap::AliMUONGeometrySVMap()
 AliMUONGeometrySVMap::AliMUONGeometrySVMap(const AliMUONGeometrySVMap& rhs)
   : TObject(rhs)
 {
-  AliFatal("Copy constructor is not implemented.");
+  Fatal("Copy constructor", 
+        "Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -204,7 +206,8 @@ AliMUONGeometrySVMap::operator = (const AliMUONGeometrySVMap& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  AliFatal("Assignment operator is not implemented.");
+  Fatal("operator=", 
+        "Assignment operator is not implemented.");
     
   return *this;  
 }
@@ -323,10 +326,16 @@ void  AliMUONGeometrySVMap::PrintPositions() const
 
     const double* translation = matrix->GetTranslation();
     cout << "   translation: "
+#if defined (__DECCXX)
+         << translation[0] << ", " 
+         << translation[1] << ", "
+         << translation[2] << endl;
+#else
          << std::fixed
          << std::setw(7) << std::setprecision(4) << translation[0] << ", " 
          << std::setw(7) << std::setprecision(4) << translation[1] << ", "
          << std::setw(7) << std::setprecision(4) << translation[2] << endl;
+#endif
   }
 }     
 
index 1d483f4..d425038 100644 (file)
@@ -13,7 +13,6 @@
 #include <TObjString.h>
 
 #include "AliMUONGeometryTransformStore.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONGeometryTransformStore)
 
@@ -51,7 +50,8 @@ AliMUONGeometryTransformStore::AliMUONGeometryTransformStore(
                                    const AliMUONGeometryTransformStore& rhs)
   : TObject(rhs)
 {
-  AliFatal("Copy constructor is not implemented.");
+  Fatal("Copy constructor", 
+        "Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -67,7 +67,8 @@ AliMUONGeometryTransformStore::operator = (const AliMUONGeometryTransformStore&
   // check assignement to self
   if (this == &rhs) return *this;
 
-  AliFatal("Assignment operator is not implemented.");
+  Fatal("operator=", 
+        "Assignment operator is not implemented.");
     
   return *this;  
 }
@@ -134,8 +135,8 @@ void AliMUONGeometryTransformStore::Add(Int_t detElemId,
     fDETransforms.AddAt(newTransform, GetDetElementIndex(detElemId));
   } 
   else 
-    AliWarning(Form("The aligned volume %s is already present", 
-            alignedVolume.Data()));  
+    Warning("Add", "The aligned volume %s is already present", 
+            alignedVolume.Data());  
 }                    
     
 //______________________________________________________________________________
@@ -153,13 +154,26 @@ void  AliMUONGeometryTransformStore::Print(Option_t* /*option*/) const
 
     const double* translation = matrix->GetTranslation();
     cout << "   translation: "
+#if defined (__DECCXX)
+         << translation[0] << ", " 
+         << translation[1] << ", "
+         << translation[2] << endl;
+#else
          << std::fixed
          << std::setw(7) << std::setprecision(4) << translation[0] << ", " 
          << std::setw(7) << std::setprecision(4) << translation[1] << ", "
          << std::setw(7) << std::setprecision(4) << translation[2] << endl;
+#endif
         
     const double* rotation = matrix->GetRotationMatrix();
     cout << "   rotation matrix:  "
+#if defined (__DECCXX)
+         << rotation[0] << ", " << rotation[1] << ", " << rotation[2] << endl
+        << "                     "         
+         << rotation[3] << ", " << rotation[4] << ", " << rotation[5] << endl      
+        << "                     "         
+         << rotation[6] << ", " << rotation[7] << ", " << rotation[8] << endl;
+#else
          << std::fixed
          << std::setw(7) << std::setprecision(4) 
          << rotation[0] << ", " << rotation[1] << ", " << rotation[2] << endl
@@ -167,7 +181,7 @@ void  AliMUONGeometryTransformStore::Print(Option_t* /*option*/) const
          << rotation[3] << ", " << rotation[4] << ", " << rotation[5] << endl      
         << "                     "         
          << rotation[6] << ", " << rotation[7] << ", " << rotation[8] << endl;
-
+#endif
   }
 }     
 
@@ -183,7 +197,7 @@ AliMUONGeometryTransformStore::Get(Int_t detElemId) const
   if ( index >= 0 && index < fNofDetElems )
     return (const TGeoCombiTrans*)fDETransforms.At(index);
   else {
-    AliWarning(Form("Index %d out of limits", index));
+    Warning("Get","Index %d out of limits", index);
     return 0;  
   }  
 }  
index 35e835f..f11b4cb 100644 (file)
@@ -11,8 +11,8 @@
  * 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$ */
 
 #include "AliMUONGlobalTrigger.h"
index b418222..d6c6e37 100644 (file)
@@ -83,7 +83,7 @@ AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t iChamber, Int_t idpart,
     fPTot      = momentum;
     fPx        = momentum * TMath::Sin(theta) * TMath::Cos(phi);
     fPy        = momentum * TMath::Sin(theta) * TMath::Sin(phi);
-    fPx        = momentum * TMath::Cos(theta) ;
+    fPz        = momentum * TMath::Cos(theta) ;
     fAge       = tof;
     fXref      = 0.;
     fYref      = 0.;
@@ -111,7 +111,7 @@ AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t iChamber, Int_t idpart,
     fPTot      = momentum;
     fPx        = momentum * TMath::Sin(theta) * TMath::Cos(phi);
     fPy        = momentum * TMath::Sin(theta) * TMath::Sin(phi);
-    fPx        = momentum * TMath::Cos(theta) ;
+    fPz        = momentum * TMath::Cos(theta) ;
     fAge       = tof;
     fXref      = Xref;
     fYref      = Yref;
index 67f23a1..1537a7d 100644 (file)
@@ -23,7 +23,6 @@
 #include "AliMUONHitForRec.h" 
 #include "AliMUONRawCluster.h"
 #include "AliMUONHit.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONHitForRec) // Class implementation in ROOT context
 
@@ -103,7 +102,7 @@ AliMUONHitForRec::AliMUONHitForRec (const AliMUONHitForRec& rhs)
 {
 // Protected copy constructor
 
-  AliFatal( "Not implemented.");
+  Fatal("AliMUONHitForRec", "Not implemented.");
 }
 
   //__________________________________________________________________________
@@ -113,7 +112,7 @@ AliMUONHitForRec & AliMUONHitForRec::operator=(const AliMUONHitForRec& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal( "Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }
index 8786063..21b9825 100644 (file)
@@ -21,7 +21,6 @@
 #include "AliMUONHitMapA1.h"
 #include "AliSegmentation.h"
 #include "AliMUONDigit.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONHitMapA1)
 
@@ -55,7 +54,7 @@ AliMUONHitMapA1::AliMUONHitMapA1(const AliMUONHitMapA1 & hitMap)
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONHitMapA1", "Not implemented.");
 }
 
  
@@ -165,7 +164,7 @@ AliMUONHitMapA1 & AliMUONHitMapA1::operator = (const AliMUONHitMapA1 & rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal( "Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }
index 853c74a..bd2c00c 100644 (file)
@@ -21,7 +21,6 @@
 //AliRoot includes
 #include "AliMUONLoader.h"
 #include "AliMUONConstants.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONLoader)
 //___________________________________________________________________
@@ -50,7 +49,7 @@ AliMUONLoader::AliMUONLoader(const AliMUONLoader& rhs)
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONLoader", "Not implemented.");
 }
 
 //_______________________________________________________________________________
@@ -66,7 +65,7 @@ AliMUONLoader::operator=(const AliMUONLoader& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }    
index 1584e49..1993a03 100644 (file)
@@ -20,7 +20,6 @@
 #include <TError.h>
 //#include <TTree.h> 
 //#include <TDirectory.h>
-#include "AliLog.h"
 
 #include "AliMUONMerger.h"
 #include "AliMUON.h"
@@ -59,7 +58,7 @@ AliMUONMerger::AliMUONMerger(const AliMUONMerger&)
 {
 // Protected copy constructor
 
-  Fatal("copy constructor","Not implemented.");
+  Fatal("AliMUONMergerModule", "Not implemented.");
 }
 
 //------------------------------------------------------------------------
index 722865c..8d9c134 100644 (file)
@@ -12,7 +12,7 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
+
 /* $Id$ */
 
 #include "AliMUONPadHit.h"
index 6ff6ab1..e13c891 100644 (file)
@@ -41,7 +41,6 @@
 #include "AliMUON.h"
 #include "AliMUONHit.h"
 #include "AliMUONDigit.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONPoints)
 
@@ -79,7 +78,7 @@ AliMUONPoints::AliMUONPoints(const AliMUONPoints& points)
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONPoints", "Not implemented.");
 }
         
 //_____________________________________________________________________________
@@ -248,7 +247,7 @@ AliMUONPoints& AliMUONPoints::operator= (const AliMUONPoints& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }
index 037b1f0..a53023f 100644 (file)
@@ -42,7 +42,6 @@
 
 #include "AliMUONLocalTrigger.h"
 #include "AliMUONGlobalTrigger.h"
-#include "AliLog.h"
 
 const Int_t AliMUONRawData::fgkDefaultPrintLevel = 0;
 
@@ -97,7 +96,7 @@ AliMUONRawData::AliMUONRawData (const AliMUONRawData& rhs)
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONRawData", "Not implemented.");
 }
 
 //_______________________________________________________________________
@@ -108,7 +107,7 @@ AliMUONRawData::operator=(const AliMUONRawData& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }
@@ -432,7 +431,7 @@ Int_t AliMUONRawData::WriteTriggerDDL()
   Int_t index;
   Int_t iEntries = 0;
   Int_t iLocCard, locCard;
-  Char_t locDec, trigY, posY, devX, posX;
+  Char_t locDec, trigY, posY, devX, posX,regOut;
   Int_t version = 1; // software version
   Int_t eventType =1; // trigger type: 1 for physics ?
   Int_t serialNb = 0xF; // serial nb of card: all bits on for the moment
@@ -445,7 +444,7 @@ Int_t AliMUONRawData::WriteTriggerDDL()
   }
 
   if (!nEntries)
-    AliError("No Trigger information available");
+    Error("AliMUONRawData::WriteTriggerDDL","No Trigger information available");
 
   buffer = new Int_t [680]; // [16(local)*5 words + 4 words]*8(reg) + 8 words = 680
 
@@ -471,12 +470,18 @@ Int_t AliMUONRawData::WriteTriggerDDL()
 
       // Regional card header
       word = 0;
-      AliBitPacking::PackWord((UInt_t)serialNb,word,27,31); //see  AliMUONSubEventTrigger.h for details
-      AliBitPacking::PackWord((UInt_t)iReg,word,22,26);
-      AliBitPacking::PackWord((UInt_t)version,word,14,21);
+      regOut  = 0;
+      AliBitPacking::PackWord((UInt_t)serialNb,word,24,28); //see  AliMUONSubEventTrigger.h for details
+      AliBitPacking::PackWord((UInt_t)version,word,16,23);
+      AliBitPacking::PackWord((UInt_t)iReg,word,12,15);
+      AliBitPacking::PackWord((UInt_t)regOut,word,0,7); // whenever regional output will be implemented
+
       subEvent->SetRegWord(word);
       memcpy(&buffer[index++],subEvent->GetAddress(),4);
 
+      buffer[index++] = 0;// 2 words of regional input
+      buffer[index++] = 0;
+
       for (Int_t iLoc = 0; iLoc < 16; iLoc++) {
 
        iLocCard = iLoc + iReg*16 + iDDL*128;
@@ -528,9 +533,6 @@ Int_t AliMUONRawData::WriteTriggerDDL()
 
        }
       } // local card 
-      buffer[index++] = 0;// 2 words of regional input
-      buffer[index++] = 0;
-      buffer[index++] = 0;// regional output
 
       delete subEvent; 
 
index 53e5af2..3bc7e81 100644 (file)
@@ -29,7 +29,6 @@
 #include "AliMUONRawStream.h"
 
 #include "AliRawReader.h"
-#include "AliLog.h"
 
 
 ClassImp(AliMUONRawStream)
@@ -50,13 +49,13 @@ AliMUONRawStream::AliMUONRawStream(AliRawReader* rawReader)
 AliMUONRawStream::AliMUONRawStream(const AliMUONRawStream& stream) :
   TObject(stream)
 {
-  AliFatal("copy constructor not implemented");
+  Fatal("AliMUONRawStream", "copy constructor not implemented");
 }
 
 AliMUONRawStream& AliMUONRawStream::operator = (const AliMUONRawStream& 
                                              /* stream */)
 {
-  AliFatal("assignment operator not implemented");
+  Fatal("operator =", "assignment operator not implemented");
   return *this;
 }
 
@@ -73,7 +72,7 @@ Bool_t AliMUONRawStream::Next()
 // read the next raw digit
 // returns kFALSE if there is no digit left
 
-  AliFatal("method not implemented for raw data input");
+  Fatal("Next","method not implemented for raw data input");
 
 
   return kFALSE;
index f08fd91..41a4ff9 100644 (file)
@@ -72,7 +72,6 @@
 #include "AliMUONRecoEvent.h"
 #include "AliMUONRecoTrack.h"
 #include "AliMUONHit.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONRecoDisplay)
 
@@ -126,7 +125,7 @@ AliMUONRecoDisplay::AliMUONRecoDisplay(const AliMUONRecoDisplay& rhs)
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONRecoDisplay", "Not implemented.");
 }
 
 //-------------------------------------------------------------------
@@ -152,7 +151,7 @@ AliMUONRecoDisplay::operator=(const AliMUONRecoDisplay& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }    
@@ -451,20 +450,20 @@ void AliMUONRecoDisplay::ShowNextEvent(Int_t delta)
       TFolder* topfold = (TFolder*)config->GetTopFolder();
       if (topfold == 0x0)
        {
-         AliError("Can not get Alice top folder");
+         Error("Exec","Can not get Alice top folder");
          return; 
        }
       TString fmdfoldname(config->GetDataFolderName()+"/"+"MUON");
       TFolder* fmdfold = (TFolder*)topfold->FindObject(fmdfoldname);
       if (fmdfold == 0x0)
        {
-         AliError("Can not get MUON folder");
+         Error("Exec","Can not get MUON folder");
          return; 
        }
       TTree* treeH = dynamic_cast<TTree*>(fmdfold->FindObject("TreeH"));
       if (treeH == 0x0)
        {
-         AliError("Can not get TreeH");
+         Error("Exec","Can not get TreeH");
          return;
        }
 /******************************************************************/     
index 430178a..eebef1a 100644 (file)
@@ -54,7 +54,6 @@
 #include "AliMUONTrackHit.h"
 #include "AliRun.h"
 #include "AliHeader.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONRecoEvent)
 
@@ -74,7 +73,7 @@ AliMUONRecoEvent::AliMUONRecoEvent(const AliMUONRecoEvent& rhs)
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONRecoEventModule", "Not implemented.");
 }
 
 //-------------------------------------------------------------------
@@ -94,7 +93,7 @@ AliMUONRecoEvent::operator=(const AliMUONRecoEvent& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }    
index 572ed7f..3b34ab0 100644 (file)
@@ -82,7 +82,6 @@ void AliMUONRecoTrack::SetHitPosition(Int_t chamber, Double_t x, Double_t y, Dou
    fPosY[chamber] = y;
    fPosZ[chamber] = z;
 }
-
 //-------------------------------------------------------------------          
 void AliMUONRecoTrack::TrackInfo()
 {
index 8c43883..cfe54e0 100644 (file)
@@ -12,7 +12,7 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
+
 /* $Id$ */
 
 ///////////////////////////////////////////////////////////////////////////////
index 662cb00..970c5eb 100644 (file)
@@ -21,7 +21,6 @@
 #include "AliMUONResponseV0.h"
 #include "AliSegmentation.h"
 
-
 ClassImp(AliMUONResponseV0)
        
 //__________________________________________________________________________
index 577e0f3..ece2293 100644 (file)
@@ -30,7 +30,6 @@
 #include "AliMUONData.h"
 #include "AliMUONDigit.h"
 #include "AliMUONTransientDigit.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONSDigitizerv1)
 
@@ -66,7 +65,8 @@ void AliMUONSDigitizerv1::AddDigit(Int_t chamber, Int_t tracks[kMAXTRACKS], Int_
 Int_t AliMUONSDigitizerv1::GetSignalFrom(AliMUONTransientDigit* td)
 {
 // Returns the transient digit signal as is without applying the chamber response.
-       AliDebug(4,"Returning TransientDigit signal.");
+
+       if (GetDebug() > 3) Info("GetSignalFrom", "Returning TransientDigit signal.");
        return td->Signal(); 
 };
 
@@ -74,7 +74,9 @@ Int_t AliMUONSDigitizerv1::GetSignalFrom(AliMUONTransientDigit* td)
 Bool_t AliMUONSDigitizerv1::InitOutputData(AliMUONLoader* muonloader)
 {
 // Overridden to initialise the output tree to be TreeS rather than TreeD.
-       AliDebug(3,"Creating s-digits branch and setting the tree address.");
+
+       if (GetDebug() > 2)
+               Info("InitOutputData", "Creating s-digits branch and setting the tree address.");
 
        fMUONData->SetLoader(muonloader);
 
@@ -84,7 +86,7 @@ Bool_t AliMUONSDigitizerv1::InitOutputData(AliMUONLoader* muonloader)
                muonloader->MakeSDigitsContainer();
                if (muonloader->TreeS() == NULL)
                {
-                       AliError("Could not create TreeS.");
+                       Error("InitOutputData", "Could not create TreeS.");
                        return kFALSE;
                };
        };
@@ -100,7 +102,7 @@ void AliMUONSDigitizerv1::FillOutputData()
 {
 // Overridden to fill TreeS rather than TreeD.
 
-       AliDebug(3,"Filling trees with s-digits.");
+       if (GetDebug() > 2) Info("FillOutputData", "Filling trees with s-digits.");
        fMUONData->Fill("S");
        fMUONData->ResetSDigits();
 };
@@ -109,7 +111,8 @@ void AliMUONSDigitizerv1::FillOutputData()
 void AliMUONSDigitizerv1::CleanupOutputData(AliMUONLoader* muonloader)
 {
 // Overridden to write and then cleanup TreeS that was initialised in InitOutputData.
-       AliDebug(3,"Writing s-digits and releasing pointers.");
+
+       if (GetDebug() > 2) Info("CleanupOutputData", "Writing s-digits and releasing pointers.");
        muonloader->WriteSDigits("OVERWRITE");
        fMUONData->ResetSDigits();
        muonloader->UnloadSDigits();
index bc871f8..134d5cf 100644 (file)
@@ -32,7 +32,6 @@
 #include "AliMUONHitForRec.h" 
 #include "AliMUONTrackParam.h" 
 #include "AliRun.h" // for gAlice
-#include "AliLog.h" 
 
 ClassImp(AliMUONSegment) // Class implementation in ROOT context
 
@@ -58,6 +57,7 @@ AliMUONSegment::AliMUONSegment()
   fNonBendingCoorReso2 = 0.0; // Covariance(coordinate C1 in first chamber)
   fNonBendingSlopeReso2 = 0.0; // Covariance(slope)
   fNonBendingCoorSlopeReso2 = 0.0; // Covariance(C1,slope)
+  fZ = 0.0; // z in first plane
   fNonBendingImpact = 0.0; // Impact parameter in non bending plane
   fInTrack = kFALSE; // TRUE if segment belongs to one track
 }
@@ -79,6 +79,7 @@ AliMUONSegment::AliMUONSegment(AliMUONHitForRec* Hit1, AliMUONHitForRec* Hit2)
   fHitForRecPtr1 = Hit1;
   fHitForRecPtr2 = Hit2;
   dz = Hit1->GetZ() - Hit2->GetZ();
+  fZ = Hit1->GetZ();
   // bending plane
   fBendingCoor = Hit1->GetBendingCoor();
   fBendingSlope = (fBendingCoor - Hit2->GetBendingCoor()) / dz;
@@ -105,7 +106,7 @@ AliMUONSegment::AliMUONSegment (const AliMUONSegment& theMUONSegment)
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONSegment", "Not implemented.");
 }
 
 AliMUONSegment & AliMUONSegment::operator=(const AliMUONSegment& rhs)
@@ -114,7 +115,7 @@ AliMUONSegment & AliMUONSegment::operator=(const AliMUONSegment& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }
@@ -176,7 +177,7 @@ Double_t AliMUONSegment::NormalizedChi2WithSegment(AliMUONSegment* Segment, Doub
 }
 
   //__________________________________________________________________________
-AliMUONSegment* AliMUONSegment::CreateSegmentFromLinearExtrapToStation (Int_t Station, Double_t MCSfactor) const
+AliMUONSegment* AliMUONSegment::CreateSegmentFromLinearExtrapToStation ( Double_t z, Double_t MCSfactor) const
 {
   // Extrapolates linearly the current Segment (this) to station (0..) "Station".
   // Multiple Coulomb scattering calculated from "MCSfactor"
@@ -189,10 +190,9 @@ AliMUONSegment* AliMUONSegment::CreateSegmentFromLinearExtrapToStation (Int_t St
   // The caller has the responsibility to delete this object.
   AliMUONSegment* extrapSegment = new AliMUONSegment(); // creates empty new segment
   // dZ from first hit of current Segment to first chamber of station "Station"
-  AliMUON *pMUON = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
-  Double_t dZ =
-    (&(pMUON->Chamber(2 * Station)))->Z() - (this->fHitForRecPtr1)->GetZ();
+  Double_t dZ =  z - this->GetZ();
   // Data in bending plane
+  extrapSegment->fZ = z;
   //  coordinate
   extrapSegment->fBendingCoor = this->fBendingCoor + this->fBendingSlope * dZ;
   //  slope
@@ -220,7 +220,7 @@ AliMUONSegment* AliMUONSegment::CreateSegmentFromLinearExtrapToStation (Int_t St
 }
 
   //__________________________________________________________________________
-AliMUONHitForRec* AliMUONSegment::CreateHitForRecFromLinearExtrapToChamber (Int_t Chamber, Double_t MCSfactor) const
+AliMUONHitForRec* AliMUONSegment::CreateHitForRecFromLinearExtrapToChamber ( Double_t z, Double_t MCSfactor) const
 {
   // Extrapolates linearly the current Segment (this) to chamber(0..) "Chamber".
   // Multiple Coulomb scattering calculated from "MCSfactor"
@@ -231,10 +231,9 @@ AliMUONHitForRec* AliMUONSegment::CreateHitForRecFromLinearExtrapToChamber (Int_
   // The caller has the responsibility to delete this object.
   AliMUONHitForRec* extrapHitForRec = new AliMUONHitForRec(); // creates empty new HitForRec
   // dZ from first hit of current Segment to chamber
-  AliMUON *pMUON = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
-  Double_t dZ =
-    (&(pMUON->Chamber(Chamber)))->Z() - (this->fHitForRecPtr1)->GetZ();
+  Double_t dZ = z - this->GetZ();
   // Data in bending plane
+  extrapHitForRec->SetZ(z);
   //  coordinate
   extrapHitForRec->SetBendingCoor(this->fBendingCoor + this->fBendingSlope * dZ);
   //  covariance, including multiple Coulomb scattering over dZ due to one chamber
@@ -320,6 +319,8 @@ void AliMUONSegment::UpdateFromStationTrackParam(AliMUONTrackParam *TrackParam,
   fNonBendingCoor = param0->GetNonBendingCoor(); // coordinate
   fNonBendingSlope = param0->GetNonBendingSlope(); // slope
 
+  fZ = param0->GetZ(); // z
+
   // Resolutions
   // cReso2 and sReso2 have to be subtracted here from the parametrization
   // because they are added in the functions "NormalizedChi2WithSegment"
index e912024..f91c386 100644 (file)
@@ -37,13 +37,15 @@ class AliMUONSegment : public TObject
   void SetBendingCoorReso2(Double_t BendingCoorReso2) {fBendingCoorReso2 = BendingCoorReso2;}
   Double_t GetNonBendingCoorReso2(void) const {return fNonBendingCoorReso2;}
   void SetNonBendingCoorReso2(Double_t NonBendingCoorReso2) {fNonBendingCoorReso2 = NonBendingCoorReso2;}
+  Double_t GetZ(void) const {return fZ;}
+  
   Double_t GetBendingImpact(void) const {return fBendingImpact;}
   Bool_t GetInTrack(void) const {return fInTrack;}
   void SetInTrack(Bool_t InTrack) {fInTrack = InTrack;}
 
-  AliMUONSegment* CreateSegmentFromLinearExtrapToStation (Int_t Station, Double_t MCSfactor) const;
+  AliMUONSegment* CreateSegmentFromLinearExtrapToStation (Double_t z, Double_t MCSfactor) const;
   Double_t NormalizedChi2WithSegment(AliMUONSegment* Segment, Double_t Sigma2Cut) const;
-  AliMUONHitForRec* CreateHitForRecFromLinearExtrapToChamber (Int_t Chamber, Double_t MCSfactor) const;
+  AliMUONHitForRec* CreateHitForRecFromLinearExtrapToChamber (Double_t z, Double_t MCSfactor) const;
   void UpdateFromStationTrackParam(AliMUONTrackParam *TrackParam, Double_t MCSfactor, Double_t Dz1, Double_t Dz2, Double_t Dz3, Int_t Station, Double_t InverseMomentum);
 
   // What is necessary for sorting TClonesArray's; sufficient too ????
@@ -73,6 +75,7 @@ class AliMUONSegment : public TObject
   Double_t fNonBendingSlopeReso2; // Covariance(slope)
   Double_t fNonBendingCoorSlopeReso2; // Covariance(C1,slope)
   Double_t fNonBendingImpact; // Impact parameter in non bending plane
+  Double_t fZ;                // Z of the segment
   Bool_t fInTrack; // TRUE if segment belongs to one track
   
   ClassDef(AliMUONSegment, 1) // Segment for reconstruction in ALICE dimuon spectrometer
index 98ee5bb..3e3ec09 100644 (file)
@@ -28,7 +28,6 @@
 #include <TString.h>
 
 #include "AliMUONSegmentIndex.h"
-#include "AliLog.h"
 
 //___________________________________________
 ClassImp(AliMUONSegmentIndex)
@@ -79,5 +78,5 @@ TString AliMUONSegmentIndex::Name(Int_t padx, Int_t pady, Int_t cathode)
 void AliMUONSegmentIndex::Print() const
 {
   // Printing information of AliMUONSegmentIndex
-  AliInfo(Form("Name=%s Id=%d PadX=%d PadY=%d Cathode=%d\n",fName.Data(),fChannelId,fPadX,fPadY,fCathode));   
+  Info("Print", "Name=%s Id=%d PadX=%d PadY=%d Cathode=%d\n",fName.Data(),fChannelId,fPadX,fPadY,fCathode);   
 }
index 8e068f9..038922d 100644 (file)
@@ -28,7 +28,6 @@
 #include <TString.h>
 
 #include "AliMUONSegmentManuIndex.h"
-#include "AliLog.h"
 
 //___________________________________________
 ClassImp(AliMUONSegmentManuIndex)
@@ -79,5 +78,5 @@ TString AliMUONSegmentManuIndex::Name(Int_t manuid, Int_t manuchannel)
 void AliMUONSegmentManuIndex::Print() const
 {
   // Printing AliMUONSegmentManuIndex information
-  AliInfo(Form("Name=%s Id=%d BusPatch=%d ManuId=%d ManuChannelId=%d\n",fName.Data(),fChannelId,fBusPatchId,fManuId,fManuChannelId));   
+  Info("Print","Name=%s Id=%d BusPatch=%d ManuId=%d ManuChannelId=%d\n",fName.Data(),fChannelId,fBusPatchId,fManuId,fManuChannelId);   
 }
index c3b52e3..5aae595 100644 (file)
@@ -28,7 +28,6 @@
 #include <TMath.h>
 
 #include "AliMUONSegmentPosition.h"
-#include "AliLog.h"
 
 //___________________________________________
 ClassImp(AliMUONSegmentPosition)
@@ -94,5 +93,5 @@ TString AliMUONSegmentPosition::Name(Float_t x, Float_t y, Int_t cathode)
 void AliMUONSegmentPosition::Print() const
 {
   // Printing AliMUONSegmentManuIndex information
-  AliInfo(Form("Name=%s Id=%d X=%f Y=%f Cathode=%d\n",fName.Data(),fChannelId, fX, fY,fCathode));   
+  Info("Print","Name=%s Id=%d X=%f Y=%f Cathode=%d\n",fName.Data(),fChannelId, fX, fY,fCathode);   
 }
index 43b45c7..373d627 100644 (file)
@@ -41,7 +41,6 @@
 #include "AliMUONSegmentManuIndex.h"
 #include "AliMUONSegmentPosition.h"
 #include "AliMUONSegmentIndex.h"
-#include "AliLog.h"
 
 //___________________________________________
 ClassImp(AliMUONSegmentationDetectionElement)
@@ -82,7 +81,7 @@ AliMUONSegmentationDetectionElement::AliMUONSegmentationDetectionElement(const A
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONSegmentationDetectionElementModule", "Not implemented.");
 }
 //_________________________________________________
 AliMUONSegmentationDetectionElement::~AliMUONSegmentationDetectionElement(){
@@ -132,7 +131,7 @@ AliMUONSegmentIndex *  AliMUONSegmentationDetectionElement::FindIndexFromPositio
     }
   }
  if (!foundsegmentindex) {
-   AliWarning(Form("Not found Index for position x=%5.2f y=%5.2f \n",x,y));
+   Warning("FindIndexFromPosition","Not found Index for position x=%5.2f y=%5.2f \n",x,y);
  }    
  return foundsegmentindex;
 }
@@ -158,8 +157,8 @@ AliMUONSegmentIndex * AliMUONSegmentationDetectionElement::GetIndex( const char
   // Getting AliMUONSegmentIndex from name of AliMUONSegmentManuIndex
   if (fMapManuIndexIndex) return  (AliMUONSegmentIndex*)  fMapManuIndexIndex->GetValue(SegmentManuIndexName);
   else {
-    AliWarning(Form("SegmentManuIndex %s out of DetectionElement Mapping %s",
-           SegmentManuIndexName,fDetectionElementType.Data()));
+    Warning("GetIndex","SegmentManuIndex %s out of DetectionElement Mapping %s",
+           SegmentManuIndexName,fDetectionElementType.Data());
     return 0x0;
   }
 }
@@ -175,8 +174,8 @@ AliMUONSegmentManuIndex * AliMUONSegmentationDetectionElement::GetManuIndex( con
   // Getting ManuIndex from manuname
   if (fMapIndexManuIndex) return (AliMUONSegmentManuIndex*) fMapIndexManuIndex->GetValue(SegmentIndexName);
   else {
-    AliWarning(Form("SegmentIndex %s out of Detection Element mapping %s",
-           SegmentIndexName,fDetectionElementType.Data()));
+    Warning("GetManuIndex","SegmentIndex %s out of Detection Element mapping %s",
+           SegmentIndexName,fDetectionElementType.Data());
     return 0x0;
   }
 }
@@ -197,7 +196,7 @@ void  AliMUONSegmentationDetectionElement::GetPadI(Float_t x, Float_t y, Int_t c
     pady = segmentindex->GetPadY();
   }
   else {
-    AliWarning(Form("Not found Index for position x=%5.2f y=%5.2f \n",x,y));
+    Warning("GetPadI","Not found Index for position x=%5.2f y=%5.2f \n",x,y);
   }    
 }
 //_________________________________________________
@@ -212,8 +211,8 @@ AliMUONSegmentPosition  * AliMUONSegmentationDetectionElement::GetPosition( cons
   // Getting position from indexname
   if (fMapIndexPosition) return (AliMUONSegmentPosition*) fMapIndexPosition->GetValue(SegmentIndexName);
   else {
-    AliWarning(Form("SegmentIndex %s out of DetectionElement mapping %s",
-           SegmentIndexName, fDetectionElementType.Data()));
+    Warning("GetPosition","SegmentIndex %s out of DetectionElement mapping %s",
+           SegmentIndexName, fDetectionElementType.Data());
     return 0x0;
   }
 }
@@ -229,8 +228,8 @@ AliMUONSegmentIndex * AliMUONSegmentationDetectionElement::GetIndexFromPosition(
   // Getting index form positionname
   if (fMapPositionIndex) return  (AliMUONSegmentIndex*)  fMapPositionIndex->GetValue(PositionName);
   else {
-    AliWarning(Form("SegmentPosition %s out of DetectionElement Mapping %s",
-           PositionName,fDetectionElementType.Data()));
+    Warning("GetIndexFromPosition","SegmentPosition %s out of DetectionElement Mapping %s",
+           PositionName,fDetectionElementType.Data());
     return 0x0;
   }
 }
@@ -241,8 +240,8 @@ AliMUONSegmentManuIndex * AliMUONSegmentationDetectionElement::FindManuIndex( co
   // Getting AliMUONSegmentManuIndex objecto from manu index
   if (fMapManuIndexIndex) return (AliMUONSegmentManuIndex*) fMapManuIndexIndex->FindObject(ManuIndexName);
   else  {
-    AliWarning(Form("SegmentManuIndex %s out of DetectionElement mapping %s",
-           ManuIndexName,fDetectionElementType.Data()));
+    Warning("FindManuIndex","SegmentManuIndex %s out of DetectionElement mapping %s",
+           ManuIndexName,fDetectionElementType.Data());
     return 0x0;
   }
 }
@@ -253,8 +252,8 @@ AliMUONSegmentIndex * AliMUONSegmentationDetectionElement::FindIndex(const char*
   // Getting 
   if (fMapIndexPosition) return (AliMUONSegmentIndex *) fMapIndexPosition->FindObject(IndexName);
   else {
-    AliWarning(Form("SegmentIndex %s out of DetectionElement mapping %s",
-           IndexName,fDetectionElementType.Data()));
+    Warning("FindIndex","SegmentIndex %s out of DetectionElement mapping %s",
+           IndexName,fDetectionElementType.Data());
     return 0x0;
   }
 }
@@ -288,11 +287,11 @@ void    AliMUONSegmentationDetectionElement::Init(const char * DetectionElementT
   Int_t icathode;
   //Bendingplane
   icathode=0;
-  AliInfo(Form("%s", fSegmentationMappingFileBending.Data()));
+  Info("ReadingSegmentationMappingFile","%s", fSegmentationMappingFileBending.Data());
   ReadingSegmentationMappingFile(fSegmentationMappingFileBending ,icathode);
   //NonBendingplane
   icathode=1;
-  AliInfo(Form("Reading mapping file is %s\n", fSegmentationMappingFileNonBending.Data()));
+  Info("Init","Reading mapping file is %s\n", fSegmentationMappingFileNonBending.Data());
   ReadingSegmentationMappingFile(fSegmentationMappingFileNonBending,icathode);
   
 }
@@ -301,7 +300,7 @@ void AliMUONSegmentationDetectionElement::ReadingSegmentationMappingFile(TString
 { 
   ifstream in( infile,  ios::in);
   if (!in) {
-    AliError("File not found.");
+    Error("ReadingSegmentationMappingFile", "File not found.");
   }
   else {
     Int_t id, ix, iy, idmanu, idchannel;
index 13798bb..22fa022 100644 (file)
@@ -27,8 +27,7 @@
 #include "AliMUON.h"
 #include "AliMUONChamber.h"
 #include "AliRun.h"
-#include "AliLog.h"
-
+#include "AliMUONConstants.h"
 //___________________________________________
 ClassImp(AliMUONSegmentationSlat)
 
@@ -57,7 +56,7 @@ AliMUONSegmentationSlat::AliMUONSegmentationSlat(const AliMUONSegmentationSlat&
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONSegmentationSlatModule", "Not implemented.");
 }
 
 AliMUONSegmentationSlat::~AliMUONSegmentationSlat(){
@@ -81,12 +80,11 @@ AliMUONSegmentationSlat::operator=(const AliMUONSegmentationSlat& rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }    
           
-
 //-----------------------------------------------------------
 void AliMUONSegmentationSlat::SetPadSize(Float_t p1, Float_t p2)
 {
@@ -95,6 +93,7 @@ void AliMUONSegmentationSlat::SetPadSize(Float_t p1, Float_t p2)
     fDpx=p1;
     fDpy=p2;
 }
+
 //-----------------------------------------------------------
 Float_t AliMUONSegmentationSlat::GetAnod(Float_t xhit) const
 {
@@ -102,20 +101,23 @@ Float_t AliMUONSegmentationSlat::GetAnod(Float_t xhit) const
     Float_t wire= (xhit>0)? Int_t(xhit/fWireD)+0.5:Int_t(xhit/fWireD)-0.5;
     return fWireD*wire;
 }
+
 //-----------------------------------------------------------
 void AliMUONSegmentationSlat::GetNParallelAndOffset(Int_t /*iX*/, Int_t /*iY*/, Int_t *Nparallel, Int_t *Offset) 
 {
-  *Nparallel=1;
-  *Offset=0;
+  *Nparallel = 1;
+  *Offset = 0;
 }
 //-----------------------------------------------------------
 void AliMUONSegmentationSlat::GiveTestPoints(Int_t & /*n*/, Float_t */*x*/, Float_t */*y*/)  const 
 {;}
+
 //-----------------------------------------------------------
 Float_t AliMUONSegmentationSlat::Distance2AndOffset(Int_t /*iX*/, Int_t /*iY*/, Float_t /*X*/, Float_t /*Y*/, Int_t * /*dummy*/) 
 {
   return 0.;
 }
+
 //-----------------------------------------------------------
 Float_t AliMUONSegmentationSlat::Dpx(Int_t isec) const
 {
@@ -143,8 +145,8 @@ void AliMUONSegmentationSlat::SetPadDivision(Int_t ndiv[4])
 // Pad sizes are defined as integral fractions ndiv of a basis pad size
 // fDpx
 // 
-    for (Int_t i=0; i<4; i++) {
-       (*fNDiv)[i]=ndiv[i];
+    for (Int_t i = 0; i < 4; i++) {
+       (*fNDiv)[i] = ndiv[i];
     }
 }
 
@@ -156,7 +158,7 @@ void AliMUONSegmentationSlat::GlobalToLocal(
 //
     Float_t zlocal;
     Int_t i;
-    Int_t index=-1;
+    Int_t index = -1;
     Float_t eps = 1.e-4;
     
 // Transform According to slat plane z-position: negative side is shifted down 
@@ -165,32 +167,37 @@ void AliMUONSegmentationSlat::GlobalToLocal(
     zlocal = z-fChamber->Z();
 
 //     zlocal = (x>0) ? zlocal-2.*fDz : zlocal+2.*fDz;
-    zlocal = (x>0) ? zlocal+2.*fDz : zlocal-2.*fDz;      //Change?
+//      zlocal = (x>0) ? zlocal+2.*fDz : zlocal-2.*fDz;      //Change?
+
+
+  
 
 //  Set the signs for the symmetry transformation and transform to first quadrant
     SetSymmetry(x);
-    Float_t xabs=TMath::Abs(x);
+    Float_t xabs = TMath::Abs(x);
 
 
 // Find slat number                      
-    for (i=0; i<fNSlats; i+=1) {       //Loop on all slats (longuer but more secure)
-       index=i;
+    for (i = 0; i < fNSlats; i++) {       //Loop on all slats (longuer but more secure)
+       index = i;
        if ((y >= fYPosition[i]-eps) && (y <= fYPosition[i]+fSlatY+eps)) break;
     }
-    
+
 //
 // Transform to local coordinate system
 
     
     if (index >= fNSlats || index < 0 ) {
-      islat = -1; xlocal=-1; ylocal = -1; }
-    else {
-      ylocal = y   -fYPosition[index];
-      xlocal = xabs-fXPosition[index];
+      islat  = -1; 
+      xlocal = -1; 
+      ylocal = -1; 
+    } else {
       islat  = index;
+      xlocal = xabs - fXPosition[index];
+      ylocal = y    - fYPosition[index];
     }
 }
-
+//_________________________________________________
 void AliMUONSegmentationSlat::GlobalToLocal(
     Int_t ix, Int_t iy, Int_t &islat, Int_t &ixlocal, Int_t &iylocal) const
 {
@@ -215,6 +222,7 @@ void AliMUONSegmentationSlat::GlobalToLocal(
     islat=index;
 }
 
+//_________________________________________________
 void AliMUONSegmentationSlat::
 LocalToGlobal(Int_t islat, Float_t  xlocal, Float_t  ylocal, Float_t  &x, Float_t  &y, Float_t &z) const
 {
@@ -226,16 +234,21 @@ LocalToGlobal(Int_t islat, Float_t  xlocal, Float_t  ylocal, Float_t  &x, Float_
 // lower plane (y<0)  odd slat number is shifted down
 //
 
-    x = (xlocal+fXPosition[islat])*fSym;
-    y=(ylocal+fYPosition[islat]);
+    x = (xlocal + fXPosition[islat])*fSym;
+    y = (ylocal + fYPosition[islat]);
 
-    z = (TMath::Even(islat)) ?     fDz : -fDz ; //Change for new referential
-    z = (x>0)                ? z+2.*fDz : z-2.*fDz ; 
+//     z = (TMath::Even(islat)) ?     fDz : -fDz ; //Change for new referential
+//     z = (x>0)                ? z+2.*fDz : z-2.*fDz ; 
+//     z+=fChamber->Z();
 
-    z+=fChamber->Z();
-}
+// z-position
+    z = (TMath::Even(islat)) ?      -fDzSlat : fDzSlat ; //Change for new referential
+    z = (x>0)                ?  -z + fDzCh : z - fDzCh; 
+    z += fChamber->Z();
 
+}
 
+//_________________________________________________
 void AliMUONSegmentationSlat::LocalToGlobal (
     Int_t islat, Int_t ixlocal, Int_t iylocal, Int_t &ix, Int_t &iy) const
 {
@@ -252,19 +265,21 @@ void AliMUONSegmentationSlat::LocalToGlobal (
     iy=iy;
 }
 
-
+//_________________________________________________
 void AliMUONSegmentationSlat::SetSymmetry(Int_t   ix)
 {
 // Set set signs for symmetry transformation
-    fSym=TMath::Sign(1,ix);
+    fSym = TMath::Sign(1,ix);
 }
 
+//_________________________________________________
 void AliMUONSegmentationSlat::SetSymmetry(Float_t  x)
 {
 // Set set signs for symmetry transformation
-    fSym=Int_t (TMath::Sign((Float_t)1.,x));
+    fSym = Int_t (TMath::Sign((Float_t)1.,x));
 }
 
+//_________________________________________________
 void AliMUONSegmentationSlat::
 GetPadI(Float_t x, Float_t y, Float_t z, Int_t &ix, Int_t &iy)
 {
@@ -275,16 +290,17 @@ GetPadI(Float_t x, Float_t y, Float_t z, Int_t &ix, Int_t &iy)
     
     GlobalToLocal(x,y,z,islat,xlocal,ylocal);
     if (islat == -1) {
-       ix=0; iy=0; return;
+       ix = 0; iy = 0; 
+       return;
     }
     
     Slat(islat)->GetPadI(xlocal, ylocal, ix, iy);
-    for (i=0; i<islat; i++) iy+=Slat(islat)->Npy();
+    for (i = 0; i < islat; i++) iy += Slat(islat)->Npy();
 
-    ix=ix*Int_t(TMath::Sign((Float_t)1.,x));    
+    ix = ix*Int_t(TMath::Sign((Float_t)1.,x));    
 }
 
-
+//_________________________________________________
 void AliMUONSegmentationSlat::
 GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y, Float_t &z)
 {
@@ -296,18 +312,19 @@ GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y, Float_t &z)
     GlobalToLocal(ix,iy,islat,ixlocal,iylocal);
     Slat(islat)->GetPadC(ixlocal, iylocal, x, y);
 // Slat offset
-    x+=fXPosition[islat];
-    y+=fYPosition[islat];    
+    x += fXPosition[islat];
+    y += fYPosition[islat];    
 
 // Symmetry transformation of half planes
-    x=x*TMath::Sign(1,ix);
+    x = x * TMath::Sign(1,ix);
 
 // z-position
-    z = (TMath::Even(islat)) ?      fDz : -fDz ; //Change for new referential
-    z = (x>0)                ?  z+2.*fDz : z-2.*fDz ; 
+    z  = (TMath::Even(islat)) ?      -fDzSlat : fDzSlat ; //Change for new referential
+    z  = (x>0)                ?  -z + fDzCh : z - fDzCh; 
     z += fChamber->Z();
 }
 
+//_________________________________________________
 Int_t AliMUONSegmentationSlat::ISector()
 {
 // Returns current sector during tracking
@@ -317,6 +334,7 @@ Int_t AliMUONSegmentationSlat::ISector()
     return 100*fSlatIndex+iregion;
 }
 
+//_________________________________________________
 Int_t AliMUONSegmentationSlat::Sector(Int_t ix, Int_t iy)
 {
 // Returns sector for pad coordiantes (ix,iy)
@@ -328,7 +346,7 @@ Int_t AliMUONSegmentationSlat::Sector(Int_t ix, Int_t iy)
     return 100*islat+iregion;
 }
 
-
+//_________________________________________________
 void AliMUONSegmentationSlat::SetPad(Int_t ix, Int_t iy)
 {
     //
@@ -344,6 +362,7 @@ void AliMUONSegmentationSlat::SetPad(Int_t ix, Int_t iy)
     fCurrentSlat->SetPad(ixlocal, iylocal);
 }
 
+//_________________________________________________
 void  AliMUONSegmentationSlat::SetHit(Float_t xhit, Float_t yhit, Float_t zhit)
 {   //
     // Sets current hit coordinates
@@ -361,7 +380,7 @@ void  AliMUONSegmentationSlat::SetHit(Float_t xhit, Float_t yhit, Float_t zhit)
     fCurrentSlat->SetHit(xlocal, ylocal);
 }
 
-
+//_________________________________________________
 void AliMUONSegmentationSlat::
 FirstPad(Float_t xhit, Float_t yhit, Float_t zhit, Float_t dx, Float_t dy)
 {
@@ -380,7 +399,7 @@ FirstPad(Float_t xhit, Float_t yhit, Float_t zhit, Float_t dx, Float_t dy)
 
 }
 
-
+//_________________________________________________
 void AliMUONSegmentationSlat::NextPad()
 {
 // Stepper for the iteration over pads
@@ -388,7 +407,7 @@ void AliMUONSegmentationSlat::NextPad()
     fCurrentSlat->NextPad();
 }
 
-
+//_________________________________________________
 Int_t AliMUONSegmentationSlat::MorePads()
 // Stopping condition for the iterator over pads
 //
@@ -397,6 +416,7 @@ Int_t AliMUONSegmentationSlat::MorePads()
     return fCurrentSlat->MorePads();
 }
 
+//_________________________________________________
 void AliMUONSegmentationSlat::
 IntegrationLimits(Float_t& x1,Float_t& x2,Float_t& y1, Float_t& y2)
 {
@@ -407,6 +427,7 @@ IntegrationLimits(Float_t& x1,Float_t& x2,Float_t& y1, Float_t& y2)
 
 }
 
+//_________________________________________________
 void AliMUONSegmentationSlat::
 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
 {
@@ -424,7 +445,7 @@ Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
 
 }
 
-
+//_________________________________________________
 Int_t  AliMUONSegmentationSlat::Ix()
 {
 // Return current pad coordinate ix during stepping
@@ -441,7 +462,7 @@ Int_t  AliMUONSegmentationSlat::Ix()
     return ix;
 }
 
-
+//_________________________________________________
 Int_t  AliMUONSegmentationSlat::Iy()
 {
 // Return current pad coordinate iy during stepping
@@ -452,11 +473,10 @@ Int_t  AliMUONSegmentationSlat::Iy()
     return iy;
 }
 
-
-
-   // Signal Generation Condition during Stepping
+//_________________________________________________
 Int_t AliMUONSegmentationSlat::SigGenCond(Float_t x, Float_t y, Float_t z)
 { 
+ // Signal Generation Condition during Stepping
 //
 //  True if signal generation condition fullfilled
     Float_t xlocal, ylocal;
@@ -465,9 +485,10 @@ Int_t AliMUONSegmentationSlat::SigGenCond(Float_t x, Float_t y, Float_t z)
     return Slat(islat)->SigGenCond(xlocal, ylocal, z);
 }
 
-// Initialise signal generation at coord (x,y,z)
+//_________________________________________________
 void  AliMUONSegmentationSlat::SigGenInit(Float_t x, Float_t y, Float_t z)
 {
+
 // Initialize the signal generation condition
 //
     Float_t xlocal, ylocal;
@@ -477,8 +498,7 @@ void  AliMUONSegmentationSlat::SigGenInit(Float_t x, Float_t y, Float_t z)
     Slat(islat)->SigGenInit(xlocal, ylocal, z);
 }
 
-
-
+//_________________________________________________
 void AliMUONSegmentationSlat::Init(Int_t chamber)
 {
 //    
@@ -493,12 +513,15 @@ void AliMUONSegmentationSlat::Init(Int_t chamber)
     Int_t ndiv[4];
 // Pad division
     for (i=0; i<4; i++) ndiv[i]=(*fNDiv)[i];
-//
-    fDz=0.813;
+
 // Slat height    
     fSlatY=40.;
     for (i=0; i<15; i++) fSlatX[i]=0.;
-    
+// shifts in z direction
+     fDzSlat = AliMUONConstants::DzSlat();
+     fDzCh   = AliMUONConstants::DzCh();
 // Initialize array of slats 
     fSlats  = new TObjArray(fNSlats);
 // Maximum number of strips (pads) in x and y
@@ -522,7 +545,7 @@ void AliMUONSegmentationSlat::Init(Int_t chamber)
 // Initialize slat module
        slat->Init(chamber);
 // y-position of slat module relative to the first (closest to the beam)
-       fYPosition[islat]= fYPosOrigin+islat*(fSlatY-2.*fShift);
+//     fYPosition[islat]= fYPosOrigin+islat*(fSlatY-2.*fShift);
 //
        fNpy+=slat->Npy();
        if (slat->Npx() > fNpx) fNpx=slat->Npx();
@@ -539,10 +562,7 @@ void AliMUONSegmentationSlat::Init(Int_t chamber)
     fId=chamber;
 }
 
-
-
-
-
+//_________________________________________________
 void AliMUONSegmentationSlat::SetNPCBperSector(Int_t *npcb)
 { 
     //  PCB distribution for station 4 (6 rows with 1+3 segmentation regions)
@@ -554,18 +574,28 @@ void AliMUONSegmentationSlat::SetNPCBperSector(Int_t *npcb)
     }
 }
 
-
+//_________________________________________________
 void  AliMUONSegmentationSlat::SetSlatXPositions(Float_t *xpos)
 {
 // Set x-positions of Slats
     for (Int_t islat=0; islat<fNSlats; islat++) fXPosition[islat]=xpos[islat];
 }
 
+//_________________________________________________
+void  AliMUONSegmentationSlat::SetSlatYPositions(Float_t *ypos)
+{
+// Set y-positions of Slats
+    for (Int_t islat=0; islat<fNSlats; islat++) fYPosition[islat]=ypos[islat];
+}
+
+//_________________________________________________
 AliMUONSegmentationSlatModule*  AliMUONSegmentationSlat::Slat(Int_t index) const
   //PH { return ((AliMUONSegmentationSlatModule*) (*fSlats)[index]);}
-{ return ((AliMUONSegmentationSlatModule*) fSlats->At(index));}
-
+{ 
+  return ((AliMUONSegmentationSlatModule*) fSlats->At(index));
+}
 
+//_________________________________________________
 AliMUONSegmentationSlatModule* AliMUONSegmentationSlat::
 CreateSlatModule() const
 {
@@ -573,11 +603,11 @@ CreateSlatModule() const
     return new AliMUONSegmentationSlatModule(4);
 }
 
-
+//_________________________________________________
 void AliMUONSegmentationSlat::Draw(const char* opt)
 {
-// Draw method for event display
-// 
+  // Draw method for event display
+  // 
   if (!strcmp(opt,"eventdisplay")) { 
     const int kColorMUON1 = kYellow;
     const int kColorMUON2 = kBlue; 
@@ -589,9 +619,9 @@ void AliMUONSegmentationSlat::Draw(const char* opt)
     
     //
     // Number of modules per slat
-    for (i=0; i<fNSlats; i++) {
-      npcb[i]=0;
-      for (j=0; j<4; j++) npcb[i]+=fPcb[i][j];
+    for (i = 0; i < fNSlats; i++) {
+      npcb[i] = 0;
+      for (j = 0; j < 4; j++) npcb[i] += fPcb[i][j];
     }  
     //
     TNode* top=gAlice->GetGeometry()->GetNode("alice");
@@ -607,25 +637,24 @@ void AliMUONSegmentationSlat::Draw(const char* opt)
     TNode* nodeSlat;
     Int_t color;
     
-    for (j=0; j<fNSlats; j++)
-      {
-       sprintf(nameSlat,"SLAT%d",100*fId+1+j);
-       Float_t dx = 20.*npcb[j];
-       Float_t dy = 20;
-       new TBRIK(nameSlat,"Slat Module","void",dx,20.,0.25);
-       node->cd();
-       color =  TMath::Even(j) ? kColorMUON1 : kColorMUON2;
+    for (j = 0; j < fNSlats; j++) {
+      sprintf(nameSlat,"SLAT%d",100*fId+1+j);
+      Float_t dx = 20.*npcb[j];
+      Float_t dy = 20;
+      new TBRIK(nameSlat,"Slat Module","void",dx,20.,0.25);
+      node->cd();
+      color =  TMath::Even(j) ? kColorMUON1 : kColorMUON2;
        
-       sprintf(nameNode,"SLAT%d",100*fId+1+j);
-       nodeSlat = 
-         new TNode(nameNode,"Slat Module",nameSlat, dx+fXPosition[j],fYPosition[j]+dy,0,"");
-       nodeSlat->SetLineColor(color);
-       node->cd();
-       sprintf(nameNode,"SLAT%d",100*fId+1+j+fNSlats);
-       nodeSlat = 
-         new TNode(nameNode,"Slat Module",nameSlat,-dx-fXPosition[j],fYPosition[j]+dy,0,"");
-       nodeSlat->SetLineColor(color);
-      }
+      sprintf(nameNode,"SLAT%d",100*fId+1+j);
+      nodeSlat = 
+       new TNode(nameNode,"Slat Module",nameSlat, dx+fXPosition[j],fYPosition[j]+dy,0,"");
+      nodeSlat->SetLineColor(color);
+      node->cd();
+      sprintf(nameNode,"SLAT%d",100*fId+1+j+fNSlats);
+      nodeSlat = 
+       new TNode(nameNode,"Slat Module",nameSlat,-dx-fXPosition[j],fYPosition[j]+dy,0,"");
+      nodeSlat->SetLineColor(color);
+    }
   }
 }
 
index b63991b..2082a92 100644 (file)
@@ -112,7 +112,7 @@ class AliMUONSegmentationSlat : public AliSegmentation
     virtual void SetShift(Float_t shift) {fShift = shift;}
     virtual void SetNPCBperSector(Int_t *npcb);
     virtual void SetSlatXPositions(Float_t *xpos);
-    virtual void SetSlatYPosition(Float_t ypos) {fYPosOrigin = ypos;}    
+    virtual void SetSlatYPositions(Float_t *ypos);    
     virtual AliMUONSegmentationSlatModule* Slat(Int_t index) const;
     
 // Not used
@@ -167,15 +167,16 @@ class AliMUONSegmentationSlat : public AliSegmentation
     Int_t      fNpy;                              // maximum number of pads in y
     Int_t      fSym;                              // signs for symmetry trafo
     Float_t    fShift;                            // Half overlap of pad planes
-    Float_t    fDz;                               // Half distance between slat planes
-    
+    Float_t    fDzSlat;                           // Half distance between slat planes
+    Float_t    fDzCh;                             // Half distance between half-chamber planes
+
     TArrayI*    fNDiv;                             // Pad size division
     // Slats
     TObjArray*  fSlats;                            // Array of Slats
     // Proxy data
     AliMUONSegmentationSlatModule* fCurrentSlat;   // Pointer to current slat
     Int_t       fSlatIndex;                        // Current slat index
-    ClassDef(AliMUONSegmentationSlat,1)            // Segmentation for Muon Chamber built from Slat Modules
+    ClassDef(AliMUONSegmentationSlat,2)            // Segmentation for Muon Chamber built from Slat Modules
 };
        
 
index 8b599d8..7988c2c 100644 (file)
@@ -24,7 +24,6 @@
 #include <TArrayF.h>
 
 #include "AliMUONSegmentationSlatModule.h"
-#include "AliLog.h"
 
 //___________________________________________
 ClassImp(AliMUONSegmentationSlatModule)
@@ -55,7 +54,7 @@ AliMUONSegmentationSlatModule::AliMUONSegmentationSlatModule(
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONSegmentationSlatModule", "Not implemented.");
 }
 
 
@@ -75,7 +74,7 @@ AliMUONSegmentationSlatModule::operator=(
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }    
index 40716f4..6d9697b 100644 (file)
@@ -12,7 +12,7 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
+
 /* $Id$ */
 
 #include <TArrayI.h>
index d3b26e0..289cc1c 100644 (file)
@@ -26,7 +26,6 @@
 #include "AliRun.h"
 #include "AliMUON.h"
 #include "AliMUONChamber.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONSegmentationTrigger)
 
@@ -46,7 +45,7 @@ void AliMUONSegmentationTrigger::Init(Int_t chamber)
   AliMUON *pMUON  = (AliMUON *) gAlice->GetModule("MUON");
   AliMUONChamber* iChamber=&(pMUON->Chamber(chamber));
 
-  AliDebug(2,"Initialize Trigger Chamber Module Geometry");
+  if(pMUON->GetDebug()>1) printf("%s: Initialize Trigger Chamber Module Geometry\n",ClassName());
 
   Float_t zPos=iChamber->Z();
   Float_t z1Pos=AliMUONConstants::DefaultChamberZ(10); //cp changed
@@ -62,7 +61,8 @@ void AliMUONSegmentationTrigger::Init(Int_t chamber)
   Float_t z1pm=z1PosPlus/z1PosMinus;
   Float_t z1mp=z1PosMinus/z1PosPlus;
 
-  AliDebug(2,Form("fZscale = %f ",fZscale));
+  if(pMUON->GetDebug()>1) printf("%s: fZscale = %f \n",ClassName(),fZscale);
+  
 // calculate yCmin and fYcmax 
   Int_t i;  
   for (i=62; i>=0; i--) {
index 96813e0..bb54e5b 100644 (file)
@@ -25,7 +25,6 @@
 #include "AliMUONTriggerConstants.h"
 #include "AliMUONChamber.h"
 #include "AliRun.h"  // gAlice
-#include "AliLog.h"
 
 ClassImp(AliMUONSegmentationTriggerX)
 
@@ -33,7 +32,8 @@ ClassImp(AliMUONSegmentationTriggerX)
 void AliMUONSegmentationTriggerX::Init(Int_t chamber)
 {
 // intialize X segmentation 
-  AliDebug(2,"Initialize Trigger Chamber Geometry X");
+  AliMUON *pMUON  = (AliMUON *) gAlice->GetModule("MUON");
+  if(pMUON->GetDebug()>1) printf("%s: Initialize Trigger Chamber Geometry X\n",ClassName());
   AliMUONSegmentationTrigger::Init(chamber);
 
 // calculate x & y position of X strips
index 4060d55..d6c6507 100644 (file)
@@ -21,7 +21,6 @@
 #include "AliMUONTriggerConstants.h"
 #include "AliMUON.h"
 #include "AliRun.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONSegmentationTriggerY)
 
@@ -36,7 +35,8 @@ AliMUONSegmentationTriggerY::AliMUONSegmentationTriggerY()
 void AliMUONSegmentationTriggerY::Init(Int_t chamber)
 {
 // intialize Y segmentation 
-  AliDebug(2,"Initialize Trigger Chamber Geometry Y");
+  AliMUON *pMUON  = (AliMUON *) gAlice->GetModule("MUON");
+  if(pMUON->GetDebug()>1) printf("%s: Initialize Trigger Chamber Geometry Y\n",ClassName());
   AliMUONSegmentationTrigger::Init(chamber);  
 
 // calculate x & y position of Y strips
index 6f87562..cc70079 100644 (file)
@@ -22,7 +22,6 @@
 #include "AliMUONChamber.h"
 #include "AliRun.h"
 #include "AliMUON.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONSegmentationV0)
 
@@ -38,7 +37,7 @@ AliMUONSegmentationV0::AliMUONSegmentationV0(const AliMUONSegmentationV0& segmen
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONSegmentationV0", "Not implemented.");
 }
 
 
@@ -341,7 +340,7 @@ AliMUONSegmentationV0::operator =(const AliMUONSegmentationV0 & rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }
index 9b91862..758f32a 100644 (file)
@@ -32,7 +32,6 @@
 #include "AliMUON.h"
 #include "AliMUONChamber.h"
 #include "AliRun.h"
-#include "AliLog.h"
 
 
 
@@ -44,7 +43,7 @@ AliMUONSegmentationV01::AliMUONSegmentationV01(const AliMUONSegmentationV01& seg
 {
 // Protected copy constructor
 
-  AliFatal("Not implemented.");
+  Fatal("AliMUONSegmentationV01", "Not implemented.");
 }
 
 AliMUONSegmentationV01::AliMUONSegmentationV01() 
@@ -679,7 +678,7 @@ AliMUONSegmentationV01::operator =(const AliMUONSegmentationV01 & rhs)
 
   if (this == &rhs) return *this;
 
-  AliFatal("Not implemented.");
+  Fatal("operator=", "Not implemented.");
     
   return *this;  
 }
index ad77e7a..58ea345 100644 (file)
 #include "AliMUONChamber.h"
 #include "AliMUONChamberGeometry.h"
 #include "AliMUONGeometryEnvelopeStore.h"
+#include "AliMUONConstants.h"
 #include "AliRun.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONSlatGeometryBuilder)
 
-//Int_t   ConvertSlatNum(Int_t numslat, Int_t quadnum, Int_t fspq);
 
 //______________________________________________________________________________
 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(AliMUON* muon)
@@ -58,7 +57,8 @@ AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder()
 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(const AliMUONSlatGeometryBuilder& rhs)
   : AliMUONVGeometryBuilder(rhs)
 {
-  AliFatal("Copy constructor is not implemented.");
+  Fatal("Copy constructor", 
+        "Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -73,7 +73,8 @@ AliMUONSlatGeometryBuilder::operator = (const AliMUONSlatGeometryBuilder& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  AliFatal("Assignment operator is not implemented.");
+  Fatal("operator=", 
+        "Assignment operator is not implemented.");
     
   return *this;  
 }
@@ -85,968 +86,1036 @@ AliMUONSlatGeometryBuilder::operator = (const AliMUONSlatGeometryBuilder& rhs)
 //______________________________________________________________________________
 void AliMUONSlatGeometryBuilder::CreateGeometry()
 {
-// CreateGeometry is the method containing all the informations concerning Stations 345 geometry.
-// It includes description and placements of support panels and slats.
-// The code comes directly from what was written in AliMUONv1.cxx before, with modifications concerning 
-// the use of Enveloppe method to place the Geant volumes.
-// Now, few changes would allow the creation of a Slat methode where slat could be described by few parameters, 
-// and this builder would then be dedicated only to the
-// placements of the slats. Those modifications could shorten the Station 345 geometry by a non-negligeable factor...
+  // CreateGeometry is the method containing all the informations concerning Stations 345 geometry.
+  // It includes description and placements of support panels and slats.
+  // The code comes directly from what was written in AliMUONv1.cxx before, with modifications concerning 
+  // the use of Enveloppe method to place the Geant volumes.
+  // Now, few changes would allow the creation of a Slat methode where slat could be described by few parameters, 
+  // and this builder would then be dedicated only to the
+  // placements of the slats. Those modifications could shorten the Station 345 geometry by a non-negligeable factor...
  
-     Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
-
-     Float_t angle;
-     Float_t *dum=0;
-
-      // define the id of tracking media:
-     Int_t idCopper = idtmed[1110];
-     Int_t idGlass  = idtmed[1111];
-     Int_t idCarbon = idtmed[1112];
-     Int_t idRoha   = idtmed[1113];
-     Int_t idGas    = idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
-     Int_t idAir    = idtmed[1100]; // medium 1
-
-      // sensitive area: 40*40 cm**2
-     const Float_t kSensLength = 40.; 
-     const Float_t kSensHeight = 40.; 
-     const Float_t kSensWidth  = 0.5; // according to TDR fig 2.120 
-     const Int_t kSensMaterial = idGas;
-     const Float_t kYoverlap   = 1.5; 
-
-     // PCB dimensions in cm; width: 30 mum copper   
-     const Float_t kPcbLength  = kSensLength; 
-     const Float_t kPcbHeight  = 60.; 
-     const Float_t kPcbWidth   = 0.003;   
-     const Int_t kPcbMaterial  = idCopper;
-
-     // Insulating material: 200 mum glass fiber glued to pcb  
-     const Float_t kInsuLength = kPcbLength; 
-     const Float_t kInsuHeight = kPcbHeight; 
-     const Float_t kInsuWidth  = 0.020;   
-     const Int_t kInsuMaterial = idGlass;
-
-     // Carbon fiber panels: 200mum carbon/epoxy skin   
-     const Float_t kPanelLength = kSensLength; 
-     const Float_t kPanelHeight = kSensHeight; 
-     const Float_t kPanelWidth  = 0.020;      
-     const Int_t kPanelMaterial = idCarbon;
-
-     // rohacell between the two carbon panels   
-     const Float_t kRohaLength = kSensLength; 
-     const Float_t kRohaHeight = kSensHeight; 
-     const Float_t kRohaWidth  = 0.5;
-     const Int_t kRohaMaterial = idRoha;
-
-     // Frame around the slat: 2 sticks along length,2 along height  
-     // H: the horizontal ones 
-     const Float_t kHframeLength = kPcbLength; 
-     const Float_t kHframeHeight = 1.5; 
-     const Float_t kHframeWidth  = kSensWidth; 
-     const Int_t kHframeMaterial = idGlass;
-
-     // V: the vertical ones 
-     const Float_t kVframeLength = 4.0; 
-     const Float_t kVframeHeight = kSensHeight + kHframeHeight; 
-     const Float_t kVframeWidth  = kSensWidth;
-     const Int_t kVframeMaterial = idGlass;
-
-     // B: the horizontal border filled with rohacell 
-     const Float_t kBframeLength = kHframeLength; 
-     const Float_t kBframeHeight = (kPcbHeight - kSensHeight)/2. - kHframeHeight; 
-     const Float_t kBframeWidth  = kHframeWidth;
-     const Int_t kBframeMaterial = idRoha;
-
-     // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
-     const Float_t kNulocLength = 2.5; 
-     const Float_t kNulocHeight = 7.5; 
-     const Float_t kNulocWidth  = 0.0030 + 0.0014; // equivalent copper width of vetronite; 
-     const Int_t   kNulocMaterial = idCopper;
-
-     const Float_t kSlatHeight = kPcbHeight; 
-     const Float_t kSlatWidth = kSensWidth + 2.*(kPcbWidth + kInsuWidth + 
-                                              2.* kPanelWidth + kRohaWidth);
-     const Int_t kSlatMaterial = idAir;
-     const Float_t kDslatLength = 2.5;//kVframeLength; // border on left and right 
-
-     Float_t spar[3];  
-     Int_t i, j;
-     Int_t detElemId;
-
-     // the panel volume contains the rohacell
-
-     Float_t twidth = 2 * kPanelWidth + kRohaWidth; 
-     Float_t panelpar[3] = { kPanelLength/2., kPanelHeight/2., twidth/2. }; 
-     Float_t rohapar[3] = { kRohaLength/2., kRohaHeight/2., kRohaWidth/2. }; 
-
-     // insulating material contains PCB-> gas-> 2 borders filled with rohacell
-
-     twidth = 2*(kInsuWidth + kPcbWidth) + kSensWidth;  
-     Float_t insupar[3] = { kInsuLength/2., kInsuHeight/2., twidth/2. }; 
-     twidth -= 2 * kInsuWidth; 
-     Float_t pcbpar[3] = { kPcbLength/2., kPcbHeight/2., twidth/2. }; 
-     Float_t senspar[3] = { kSensLength/2., kSensHeight/2., kSensWidth/2. }; 
-     Float_t theight = 2*kHframeHeight + kSensHeight;
-     Float_t hFramepar[3]={kHframeLength/2., theight/2., kHframeWidth/2.}; 
-     Float_t bFramepar[3]={kBframeLength/2., kBframeHeight/2., kBframeWidth/2.}; 
-     Float_t vFramepar[3]={kVframeLength/2., kVframeHeight/2., kVframeWidth/2.};
-     Float_t nulocpar[3]={kNulocLength/2., kNulocHeight/2., kNulocWidth/2.}; 
-     Float_t xx;
-     Float_t xxmax = (kBframeLength - kNulocLength)/2.; 
-     Int_t index=0;
+  Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
+
+  Float_t angle;
+  Float_t *dum=0;
+
+  // define the id of tracking media:
+  Int_t idAir    = idtmed[1100]; // medium 1
+  Int_t idGas    = idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
+  Int_t idCopper = idtmed[1110];
+  Int_t idG10    = idtmed[1111];
+  Int_t idCarbon = idtmed[1112];
+  Int_t idRoha   = idtmed[1113];
+  Int_t idNomex  = idtmed[1114]; // honey comb
+  Int_t idNoryl  = idtmed[1115]; 
+  Int_t idNomexB = idtmed[1116]; // bulk material 
+
+  // sensitive area: 40*40 cm**2
+  const Float_t kSensLength = 40.; 
+  const Float_t kSensHeight = 40.; 
+  const Float_t kSensWidth  = 0.5; // according to TDR fig 2.120 
+  const Int_t kSensMaterial = idGas;
+  //     const Float_t kYoverlap   = 1.5; 
+
+  // PCB dimensions in cm; width: 30 mum copper   
+  const Float_t kPcbLength  = kSensLength; 
+  const Float_t kPcbHeight  = 58.; // updated Ch. Finck 
+  const Float_t kPcbWidth   = 0.003; 
+  const Int_t kPcbMaterial  = idCopper;
+
+  // Insulating material: 220 mum G10 fiber  glued to pcb  
+  const Float_t kInsuLength = kPcbLength; 
+  const Float_t kInsuHeight = kPcbHeight; 
+  const Float_t kInsuWidth  = 0.022;  // updated Ch. Finck 
+  const Int_t kInsuMaterial = idG10;
+
+  // Carbon fiber panels: 200mum carbon/epoxy skin   
+  const Float_t kCarbonWidth  = 0.020;      
+  const Int_t kCarbonMaterial = idCarbon;
+
+  // Nomex (honey comb) between the two panel carbon skins    
+  const Float_t kNomexLength = kSensLength; 
+  const Float_t kNomexHeight = kSensHeight; 
+  const Float_t kNomexWidth  = 0.8; // updated Ch. Finck 
+  const Int_t kNomexMaterial = idNomex;
+  // Bulk Nomex under panel sandwich Ch. Finck    
+  const Float_t kNomexBWidth  = 0.025; 
+  const Int_t kNomexBMaterial = idNomexB;
+
+  // Panel sandwich 0.02 carbon*2 + 0.8 nomex     
+  const Float_t kPanelLength = kSensLength; 
+  const Float_t kPanelHeight = kSensHeight; 
+  const Float_t kPanelWidth  = 2 * kCarbonWidth + kNomexWidth;
+
+  // spacer around the slat: 2 sticks along length,2 along height  
+  // H: the horizontal ones 
+  const Float_t kHframeLength = kPcbLength; 
+  const Float_t kHframeHeight = 1.95; // updated Ch. Finck 
+  const Float_t kHframeWidth  = kSensWidth; 
+  const Int_t kHframeMaterial = idNoryl;
+
+  // V: the vertical ones; vertical spacers 
+  const Float_t kVframeLength = 2.5; 
+  const Float_t kVframeHeight = kSensHeight + kHframeHeight; 
+  const Float_t kVframeWidth  = kSensWidth;
+  const Int_t kVframeMaterial = idNoryl;
+
+  // B: the horizontal border filled with rohacell: ok Ch. Finck
+  const Float_t kBframeLength = kHframeLength; 
+  const Float_t kBframeHeight = (kPcbHeight - kSensHeight)/2. - kHframeHeight; 
+  const Float_t kBframeWidth  = kHframeWidth;
+  const Int_t kBframeMaterial = idRoha;
+
+  // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper) for electronics
+  const Float_t kNulocLength   = 2.5; 
+  const Float_t kNulocHeight   = kBframeHeight;
+  const Float_t kNulocWidth    = 0.0030 + 0.0014; // equivalent copper width of vetronite; 
+  const Int_t   kNulocMaterial = idCopper;
+
+  // Slat parameters
+  const Float_t kSlatHeight = kPcbHeight; 
+  const Float_t kSlatWidth  = kSensWidth + 2.*(kPcbWidth + kInsuWidth + kPanelWidth 
+                                              + kNomexBWidth); //replaced rohacell with Nomex Ch. Finck 
+  const Int_t   kSlatMaterial = idAir;
+  const Float_t kDslatLength  = -1.25; // position of the slat respect to the beam plane (half vertical spacer) Ch. Finck
+  Float_t zSlat               = AliMUONConstants::DzSlat();// implemented Ch. Finck
+  Float_t dzCh                = AliMUONConstants::DzCh();
+
+  Float_t spar[3];  
+  Int_t i, j;
+  Int_t detElemId;
+
+  // the panel volume contains the nomex
+  Float_t panelpar[3] = { kPanelLength/2., kPanelHeight/2., kPanelWidth/2. }; 
+  Float_t nomexpar[3] = { kNomexLength/2., kNomexHeight/2., kNomexWidth/2. }; 
+  Float_t twidth =  kPanelWidth +  kNomexBWidth; 
+  Float_t nomexbpar[3] = {kNomexLength/2., kNomexHeight/2.,twidth/2. };// bulk nomex 
+
+  // insulating material contains PCB-> gas   
+  twidth = 2*(kInsuWidth + kPcbWidth) + kSensWidth ; 
+  Float_t insupar[3] = {kInsuLength/2., kInsuHeight/2., twidth/2. }; 
+  twidth -= 2 * kInsuWidth; 
+  Float_t pcbpar[3]  = {kPcbLength/2., kPcbHeight/2., twidth/2. }; 
+  Float_t senspar[3] = {kSensLength/2., kSensHeight/2., kSensWidth/2. }; 
+  Float_t theight    = 2 * kHframeHeight + kSensHeight;
+  Float_t hFramepar[3] = {kHframeLength/2., theight/2., kHframeWidth/2.}; 
+  Float_t bFramepar[3] = {kBframeLength/2., kBframeHeight/2., kBframeWidth/2.}; 
+  Float_t vFramepar[3] = {kVframeLength/2., kVframeHeight/2., kVframeWidth/2.};
+  Float_t nulocpar[3]  = {kNulocLength/2.,  kNulocHeight/2.,  kNulocWidth/2.}; 
+
+  Float_t xx;
+  Float_t xxmax = (kBframeLength - kNulocLength)/2.; 
+  Int_t index=0;
       
-    AliMUONChamber *iChamber, *iChamber1, *iChamber2;
-
-    Int_t* fStations = new Int_t[5];
-    for (Int_t i=0; i<5; i++) fStations[i] = 1;
-    fStations[2] = 1;
+  AliMUONChamber *iChamber, *iChamber1, *iChamber2;
 
-    if (fStations[2])
+  Int_t* fStations = new Int_t[5];
+  for (Int_t i=0; i<5; i++) fStations[i] = 1;
+  fStations[2] = 1;
+     
+  if (fStations[2])
     {
-//********************************************************************
-//                            Station 3                             **
-//********************************************************************
-     // indices 1 and 2 for first and second chambers in the station
-     // iChamber (first chamber) kept for other quanties than Z,
-     // assumed to be the same in both chambers
-
-     iChamber = GetChamber(4);
-     iChamber1 = iChamber;
-     iChamber2 = GetChamber(5);
+      //********************************************************************
+       //                            Station 3                             **
+       //********************************************************************
+       // indices 1 and 2 for first and second chambers in the station
+       // iChamber (first chamber) kept for other quanties than Z,
+       // assumed to be the same in both chambers
+
+       iChamber = GetChamber(4);
+      iChamber1 = iChamber;
+      iChamber2 = GetChamber(5);
      
-     //iChamber1->GetGeometry()->SetDebug(kTRUE);
-     //iChamber2->GetGeometry()->SetDebug(kTRUE);
-
-     if (gAlice->GetModule("DIPO")) {
-       // if DIPO is preset, the whole station will be placed in DDIP volume
-       iChamber1->GetGeometry()->SetMotherVolume("DDIP");
-       iChamber2->GetGeometry()->SetMotherVolume("DDIP");
-     }
-
-
-     // volumes for slat geometry (xx=5,..,10 chamber id): 
-     // Sxx0 Sxx1 Sxx2 Sxx3  -->   Slat Mother volumes 
-     // SxxG                          -->   Sensitive volume (gas)
-     // SxxP                          -->   PCB (copper) 
-     // SxxI                          -->   Insulator (vetronite) 
-     // SxxC                          -->   Carbon panel 
-     // SxxR                          -->   Rohacell
-     // SxxH, SxxV                    -->   Horizontal and Vertical frames (vetronite)
-     // SB5x                          -->   Volumes for the 35 cm long PCB
-     // slat dimensions: slat is a MOTHER volume!!! made of air
-
-     // only for chamber 5: slat 1 has a PCB shorter by 5cm!
-
-     Float_t tlength = 35.;
-     Float_t panelpar2[3]  = { tlength/2., panelpar[1],  panelpar[2]}; 
-     Float_t rohapar2[3]   = { tlength/2., rohapar[1],   rohapar[2]}; 
-     Float_t insupar2[3]   = { tlength/2., insupar[1],   insupar[2]}; 
-     Float_t pcbpar2[3]    = { tlength/2., pcbpar[1],    pcbpar[2]}; 
-     Float_t senspar2[3]   = { tlength/2., senspar[1],   senspar[2]}; 
-     Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]}; 
-     Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]}; 
-     Float_t *dum=0;
-     Float_t pcbDLength3   = (kPcbLength - tlength);
-
-     const Int_t kNslats3 = 5;  // number of slats per quadrant
-     const Int_t kNPCB3[kNslats3] = {4, 4, 4, 3, 2}; // n PCB per slat
-     const Float_t kXpos3[kNslats3] = {0., 0., 0., 0., 0.};//{31., 0., 0., 0., 0.};
-     Float_t slatLength3[kNslats3]; 
-
-     // create and position the slat (mother) volumes 
-
-     char idSlatCh5[5];
-     char idSlatCh6[5];
-     Float_t xSlat3;
-     Float_t ySlat3;
-     Float_t angle = 0.;
-     Float_t spar2[3];
-     for (i = 0; i < kNslats3; i++){
-       slatLength3[i] = kPcbLength * kNPCB3[i] + 2. * kDslatLength; 
-       xSlat3 = slatLength3[i]/2. + kVframeLength/2. + kXpos3[i]; 
-       ySlat3 = kSensHeight * i - kYoverlap * i; 
-       spar[0] = slatLength3[i]/2.; 
-       spar[1] = kSlatHeight/2.;
-       spar[2] = kSlatWidth/2. * 1.01; 
-       // take away 5 cm from the first slat in chamber 5
+      //iChamber1->GetGeometry()->SetDebug(kTRUE);
+      //iChamber2->GetGeometry()->SetDebug(kTRUE);
+
+      if (gAlice->GetModule("DIPO")) {
+       // if DIPO is preset, the whole station will be placed in DDIP volume
+       iChamber1->GetGeometry()->SetMotherVolume("DDIP");
+       iChamber2->GetGeometry()->SetMotherVolume("DDIP");
+      }
+
+
+      // volumes for slat geometry (xx=5,..,10 chamber id): 
+      // Sxx0 Sxx1 Sxx2 Sxx3  -->   Slat Mother volumes 
+      // SxxG                          -->   Sensitive volume (gas)
+      // SxxP                          -->   PCB (copper) 
+      // SxxI                          -->   Insulator (G10) 
+      // SxxC                          -->   Carbon panel 
+      // SxxN                          -->   Nomex comb
+      // SxxX                          -->   Nomex bulk
+      // SxxH, SxxV                    -->   Horizontal and Vertical frames (Noryl)
+      // SB5x                          -->   Volumes for the 35 cm long PCB
+      // slat dimensions: slat is a MOTHER volume!!! made of air
+
+      // only for chamber 5: slat 1 has a PCB shorter by 5cm!
+
+      Float_t tlength = 35.;
+      Float_t panelpar2[3]  = { tlength/2., panelpar[1],  panelpar[2]}; 
+      Float_t nomexpar2[3]  = { tlength/2., nomexpar[1],  nomexpar[2]}; 
+      Float_t nomexbpar2[3] = { tlength/2., nomexbpar[1],  nomexbpar[2]}; 
+      Float_t insupar2[3]   = { tlength/2., insupar[1],   insupar[2]}; 
+      Float_t pcbpar2[3]    = { tlength/2., pcbpar[1],    pcbpar[2]}; 
+      Float_t senspar2[3]   = { tlength/2., senspar[1],   senspar[2]}; 
+      Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]}; 
+      Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]}; 
+      Float_t *dum=0;
+      Float_t pcbDLength3   = (kPcbLength - tlength);
+
+      const Int_t   kNslats3         = 5;  // number of slats per quadrant
+      const Int_t   kNPCB3[kNslats3] = {4, 4, 4, 3, 2}; // n PCB per slat
+      const Float_t kXpos3[kNslats3] = {0., 0., 0., 0., 0.};//{31., 0., 0., 0., 0.};
+      const Float_t kYpos3[kNslats3] = {0, 37.8, 37.7, 37.3, 33.7};
+      Float_t slatLength3[kNslats3]; 
+
+      // create and position the slat (mother) volumes 
+
+      char idSlatCh5[5];
+      char idSlatCh6[5];
+      Float_t xSlat3;
+      Float_t ySlat3 = 0;
+      Float_t angle = 0.;
+      Float_t spar2[3];
+      for (i = 0; i < kNslats3; i++){
+
+       slatLength3[i] = kPcbLength * kNPCB3[i] + 2.* kVframeLength; 
+       xSlat3 = slatLength3[i]/2. +  kDslatLength + kXpos3[i]; 
+       ySlat3 += kYpos3[i];
+
+       spar[0] = slatLength3[i]/2.; 
+       spar[1] = kSlatHeight/2.;
+       spar[2] = kSlatWidth/2.; 
+       // take away 5 cm from the first slat in chamber 5
         if (i == 0 || i == 1 || i == 2) { // 1 pcb is shortened by 5cm
-        spar2[0] = spar[0] - pcbDLength3/2.;
-       } else {
-        spar2[0] = spar[0];
-       }
-       spar2[1] = spar[1];
-       spar2[2] = spar[2]; 
-       Float_t dzCh3=spar[2] * 1.01;
-       // zSlat to be checked (odd downstream or upstream?)
-       Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2]; 
-
-       sprintf(idSlatCh5,"LA%d",kNslats3-1+i);
-       gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
-       detElemId = 500 + i + kNslats3-1;
-       GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, ySlat3, zSlat+2.*dzCh3),
-                                                TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
-
-       sprintf(idSlatCh5,"LA%d",3*kNslats3-2+i);
-       gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
-       detElemId = 550 + i + kNslats3-1;
-       GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat-2.*dzCh3),
-                                                TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
-
-       if (i > 0) { 
-        sprintf(idSlatCh5,"LA%d",kNslats3-1-i);
-        gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
-        detElemId = 500 - i + kNslats3-1;
-        GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, zSlat+2.*dzCh3), 
-                                                  TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
-
-        sprintf(idSlatCh5,"LA%d",3*kNslats3-2-i);
-        gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
-        detElemId = 550 - i + kNslats3-1;
-        GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat-2.*dzCh3),
-                                                  TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
-       }
-
-       sprintf(idSlatCh6,"LB%d",kNslats3-1+i);  
-       gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
-       detElemId = 600 + i  + kNslats3-1;
-       GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, ySlat3, zSlat+2.*dzCh3),
-                                                TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
-       sprintf(idSlatCh6,"LB%d",3*kNslats3-2+i);
-       gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
-       detElemId = 650 + i + kNslats3-1;
-       GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat-2.*dzCh3),
-                                                TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
-
-       if (i > 0) { 
-        sprintf(idSlatCh6,"LB%d",kNslats3-1-i);
-        gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
-        detElemId = 600 - i + kNslats3-1;
-        GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, zSlat+2.*dzCh3),
-                                                  TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
-
-        sprintf(idSlatCh6,"LB%d",3*kNslats3-2-i);
-        gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
-        detElemId = 650 - i + kNslats3-1;
-        GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat-2.*dzCh3),
-                                                  TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
-       }
-     }
+         spar2[0] = spar[0] - pcbDLength3/2.;
+       } else {
+         spar2[0] = spar[0];
+       }
+       spar2[1] = spar[1];
+       spar2[2] = spar[2]; 
+       Float_t dzCh3 = dzCh; 
+       Float_t zSlat3 = (i%2 ==0)? -zSlat : zSlat; // seems not that zSlat3 = zSlat4 & 5 refering to plan PQ7EN345-6 ?
+
+       sprintf(idSlatCh5,"LA%d",kNslats3-1+i);
+       gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
+       detElemId = 500 + i + kNslats3-1;
+       GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, ySlat3, -zSlat3 + dzCh3),
+                                    TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
+
+       sprintf(idSlatCh5,"LA%d",3*kNslats3-2+i);
+       gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
+       detElemId = 550 + i + kNslats3-1;
+       GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat3 - dzCh3),
+                                    TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
+
+       if (i > 0) { 
+         sprintf(idSlatCh5,"LA%d",kNslats3-1-i);
+         gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
+         detElemId = 500 - i + kNslats3-1;
+         GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, -zSlat3 + dzCh3), 
+                                      TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
+
+         sprintf(idSlatCh5,"LA%d",3*kNslats3-2-i);
+         gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
+         detElemId = 550 - i + kNslats3-1;
+         GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat3 - dzCh3),
+                                      TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
+       }
+
+       sprintf(idSlatCh6,"LB%d",kNslats3-1+i);  
+       gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
+       detElemId = 600 + i  + kNslats3-1;
+       GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, ySlat3, -zSlat3 + dzCh3),
+                                    TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
+       sprintf(idSlatCh6,"LB%d",3*kNslats3-2+i);
+       gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
+       detElemId = 650 + i + kNslats3-1;
+       GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat3 - dzCh3),
+                                    TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
+
+       if (i > 0) { 
+         sprintf(idSlatCh6,"LB%d",kNslats3-1-i);
+         gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
+         detElemId = 600 - i + kNslats3-1;
+         GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, -zSlat3 + dzCh3),
+                                      TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
+
+         sprintf(idSlatCh6,"LB%d",3*kNslats3-2-i);
+         gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
+         detElemId = 650 - i + kNslats3-1;
+         GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat3 - dzCh3),
+                                      TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
+       }
+      }
      
-     // create the panel volume 
+      // create the panel volume 
  
-     gMC->Gsvolu("S05C","BOX",kPanelMaterial,panelpar,3);
-     gMC->Gsvolu("SB5C","BOX",kPanelMaterial,panelpar2,3);
-     gMC->Gsvolu("S06C","BOX",kPanelMaterial,panelpar,3);
+      gMC->Gsvolu("S05C","BOX",kCarbonMaterial,panelpar,3);
+      gMC->Gsvolu("SB5C","BOX",kCarbonMaterial,panelpar2,3);
+      gMC->Gsvolu("S06C","BOX",kCarbonMaterial,panelpar,3);
  
-     // create the rohacell volume 
+      // create the nomex volume (honey comb)
 
-     gMC->Gsvolu("S05R","BOX",kRohaMaterial,rohapar,3);
-     gMC->Gsvolu("SB5R","BOX",kRohaMaterial,rohapar2,3);
-     gMC->Gsvolu("S06R","BOX",kRohaMaterial,rohapar,3);
+      gMC->Gsvolu("S05N","BOX",kNomexMaterial,nomexpar,3);
+      gMC->Gsvolu("SB5N","BOX",kNomexMaterial,nomexpar2,3);
+      gMC->Gsvolu("S06N","BOX",kNomexMaterial,nomexpar,3);
  
-     // create the insulating material volume 
+      // create the nomex volume (bulk)
+
+      gMC->Gsvolu("S05X","BOX",kNomexBMaterial,nomexbpar,3);
+      gMC->Gsvolu("SB5X","BOX",kNomexBMaterial,nomexbpar2,3);
+      gMC->Gsvolu("S06X","BOX",kNomexBMaterial,nomexbpar,3);
 
-     gMC->Gsvolu("S05I","BOX",kInsuMaterial,insupar,3);
-     gMC->Gsvolu("SB5I","BOX",kInsuMaterial,insupar2,3);
-     gMC->Gsvolu("S06I","BOX",kInsuMaterial,insupar,3);
+      // create the insulating material volume 
+
+      gMC->Gsvolu("S05I","BOX",kInsuMaterial,insupar,3);
+      gMC->Gsvolu("SB5I","BOX",kInsuMaterial,insupar2,3);
+      gMC->Gsvolu("S06I","BOX",kInsuMaterial,insupar,3);
  
-     // create the PCB volume 
+      // create the PCB volume 
 
-     gMC->Gsvolu("S05P","BOX",kPcbMaterial,pcbpar,3);
-     gMC->Gsvolu("SB5P","BOX",kPcbMaterial,pcbpar2,3);
-     gMC->Gsvolu("S06P","BOX",kPcbMaterial,pcbpar,3);
+      gMC->Gsvolu("S05P","BOX",kPcbMaterial,pcbpar,3);
+      gMC->Gsvolu("SB5P","BOX",kPcbMaterial,pcbpar2,3);
+      gMC->Gsvolu("S06P","BOX",kPcbMaterial,pcbpar,3);
  
-     // create the sensitive volumes,
+      // create the sensitive volumes,
 
-     gMC->Gsvolu("S05G","BOX",kSensMaterial,dum,0);
-     gMC->Gsvolu("S06G","BOX",kSensMaterial,dum,0);
+      gMC->Gsvolu("S05G","BOX",kSensMaterial,dum,0);
+      gMC->Gsvolu("S06G","BOX",kSensMaterial,dum,0);
 
-     // create the vertical frame volume 
+      // create the vertical frame volume 
 
-     gMC->Gsvolu("S05V","BOX",kVframeMaterial,vFramepar,3);
-     gMC->Gsvolu("S06V","BOX",kVframeMaterial,vFramepar,3);
+      gMC->Gsvolu("S05V","BOX",kVframeMaterial,vFramepar,3);
+      gMC->Gsvolu("S06V","BOX",kVframeMaterial,vFramepar,3);
 
-     // create the horizontal frame volume 
+      // create the horizontal frame volume 
 
-     gMC->Gsvolu("S05H","BOX",kHframeMaterial,hFramepar,3);
-     gMC->Gsvolu("SB5H","BOX",kHframeMaterial,hFramepar2,3);
-     gMC->Gsvolu("S06H","BOX",kHframeMaterial,hFramepar,3);
+      gMC->Gsvolu("S05H","BOX",kHframeMaterial,hFramepar,3);
+      gMC->Gsvolu("SB5H","BOX",kHframeMaterial,hFramepar2,3);
+      gMC->Gsvolu("S06H","BOX",kHframeMaterial,hFramepar,3);
  
-     // create the horizontal border volume 
+      // create the horizontal border volume 
 
-     gMC->Gsvolu("S05B","BOX",kBframeMaterial,bFramepar,3);
-     gMC->Gsvolu("SB5B","BOX",kBframeMaterial,bFramepar2,3);
-     gMC->Gsvolu("S06B","BOX",kBframeMaterial,bFramepar,3);
+      gMC->Gsvolu("S05B","BOX",kBframeMaterial,bFramepar,3);
+      gMC->Gsvolu("SB5B","BOX",kBframeMaterial,bFramepar2,3);
+      gMC->Gsvolu("S06B","BOX",kBframeMaterial,bFramepar,3);
  
-     index = 0; 
-     for (i = 0; i<kNslats3; i++){
-       for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
-
-        if (i == 0 && quadrant == 2) continue;
-        if (i == 0 && quadrant == 4) continue;
-
-        sprintf(idSlatCh5,"LA%d",ConvertSlatNum(i,quadrant,kNslats3-1));
-        sprintf(idSlatCh6,"LB%d",ConvertSlatNum(i,quadrant,kNslats3-1));
-        Float_t xvFrame  = (slatLength3[i] - kVframeLength)/2.;
-        Float_t xvFrame2  = xvFrame;
-
-        if (i == 0 || i == 1 || i == 2) xvFrame2 -= pcbDLength3/2.;
-
-        // position the vertical frames 
-        if ( i > 2) { 
-          GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
-                                                  (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
-                                                  (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
-                                                  (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
-                                                  (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));    
-        } 
-
-        if (i == 2) {
-          GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
-                                                  (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
-          GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
-                                                  (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
-                                                  (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
-                                                  (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-        }
-
-        if (i == 0 || i == 1) { // no rounded spacer for the moment (Ch. Finck)
-          GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
-                                                  (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
-                                                  (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-        }
-
-        // position the panels and the insulating material 
-        for (j = 0; j < kNPCB3[i]; j++){
-          if (i == 1 && j == 0) continue;
-          if (i == 0 && j == 0) continue;
-          index++;
-          Float_t xx = kSensLength * (-kNPCB3[i]/2. + j + 0.5); 
-          Float_t xx2 = xx - pcbDLength3/2.; 
+      index = 0; 
+      for (i = 0; i<kNslats3; i++){
+       for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
+
+         if (i == 0 && quadrant == 2) continue;
+         if (i == 0 && quadrant == 4) continue;
+
+         sprintf(idSlatCh5,"LA%d",ConvertSlatNum(i,quadrant,kNslats3-1));
+         sprintf(idSlatCh6,"LB%d",ConvertSlatNum(i,quadrant,kNslats3-1));
+         Float_t xvFrame  = (slatLength3[i] - kVframeLength)/2.;
+         Float_t xvFrame2  = xvFrame;
+
+         if (i == 0 || i == 1 || i == 2) xvFrame2 -= pcbDLength3/2.;
+
+         // position the vertical frames 
+         if ( i > 2) { 
+           GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
+                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+           GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
+                                                   (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
+                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
+                                                   (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));   
+         } 
+
+         if (i == 2) {
+           GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
+                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
+           GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
+                                                   (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
+                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
+                                                   (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+         }
+
+         if (i == 0 || i == 1) { // no rounded spacer for the moment (Ch. Finck)
+           GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
+                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
+                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         }
+
+         // position the panels and the insulating material 
+         for (j = 0; j < kNPCB3[i]; j++){
+           if (i == 1 && j == 0) continue;
+           if (i == 0 && j == 0) continue;
+           index++;
+           Float_t xx = kSensLength * (-kNPCB3[i]/2. + j + 0.5); 
+           Float_t xx2 = xx - pcbDLength3/2.; 
         
-          Float_t zPanel = spar[2] - panelpar[2]; 
-
-          if ( (i == 0 || i == 1 || i == 2) && j == kNPCB3[i]-1) { // 1 pcb is shortened by 5cm 
-            GetEnvelopes(4)->AddEnvelopeConstituent("SB5C", idSlatCh5, 2*index-1,TGeoTranslation(xx2,0.,zPanel));
-            GetEnvelopes(4)->AddEnvelopeConstituent("SB5C", idSlatCh5, 2*index,TGeoTranslation(xx2,0.,-zPanel));
-            GetEnvelopes(4)->AddEnvelopeConstituent("SB5I", idSlatCh5, index,TGeoTranslation(xx2,0.,0.));
-          } else {
-            GetEnvelopes(4)->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index-1,TGeoTranslation(xx,0.,zPanel));
-            GetEnvelopes(4)->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index,TGeoTranslation(xx,0.,-zPanel));
-            GetEnvelopes(4)->AddEnvelopeConstituent("S05I", idSlatCh5, index,TGeoTranslation(xx,0.,0.));
-          }
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06C", idSlatCh6, 2*index-1,TGeoTranslation(xx,0.,zPanel));
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06C", idSlatCh6, 2*index,TGeoTranslation(xx,0.,-zPanel));
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06I", idSlatCh6, index,TGeoTranslation(xx,0.,0.));
+           Float_t zPanel = spar[2] - nomexbpar[2]; 
+
+           if ( (i == 0 || i == 1 || i == 2) && j == kNPCB3[i]-1) { // 1 pcb is shortened by 5cm 
+             GetEnvelopes(4)->AddEnvelopeConstituent("SB5X", idSlatCh5, 2*index-1,TGeoTranslation(xx2,0.,zPanel));
+             GetEnvelopes(4)->AddEnvelopeConstituent("SB5X", idSlatCh5, 2*index,TGeoTranslation(xx2,0.,-zPanel));
+             GetEnvelopes(4)->AddEnvelopeConstituent("SB5I", idSlatCh5, index,TGeoTranslation(xx2,0.,0.));
+           } else {
+             GetEnvelopes(4)->AddEnvelopeConstituent("S05X", idSlatCh5, 2*index-1,TGeoTranslation(xx,0.,zPanel));
+             GetEnvelopes(4)->AddEnvelopeConstituent("S05X", idSlatCh5, 2*index,TGeoTranslation(xx,0.,-zPanel));
+             GetEnvelopes(4)->AddEnvelopeConstituent("S05I", idSlatCh5, index,TGeoTranslation(xx,0.,0.));
+           }
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06X", idSlatCh6, 2*index-1,TGeoTranslation(xx,0.,zPanel));
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06X", idSlatCh6, 2*index,TGeoTranslation(xx,0.,-zPanel));
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06I", idSlatCh6, index,TGeoTranslation(xx,0.,0.));
  
-        } 
-       }
-     }
-
-     // position the rohacell volume inside the panel volume
-     gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("SB5R",1,"SB5C",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY"); 
+         } 
+       }
+      }
+
+      // position the nomex volume inside the panel volume
+      gMC->Gspos("S05N",1,"S05C",0.,0.,0.,0,"ONLY"); 
+      gMC->Gspos("SB5N",1,"SB5C",0.,0.,0.,0,"ONLY"); 
+      gMC->Gspos("S06N",1,"S06C",0.,0.,0.,0,"ONLY"); 
   
-     // position the PCB volume inside the insulating material volume
-     gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY"); 
+      // position panel volume inside the bulk nomex material volume
+      gMC->Gspos("S05C",1,"S05X",0.,0.,kNomexBWidth/2.,0,"ONLY"); 
+      gMC->Gspos("SB5C",1,"SB5X",0.,0.,kNomexBWidth/2.,0,"ONLY"); 
+      gMC->Gspos("S06C",1,"S06X",0.,0.,kNomexBWidth/2.,0,"ONLY"); 
+
+      // position the PCB volume inside the insulating material volume
+      gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY"); 
+      gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY"); 
+      gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY"); 
   
-     // position the horizontal frame volume inside the PCB volume
-     gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY"); 
+      // position the horizontal frame volume inside the PCB volume
+      gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY"); 
+      gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY"); 
+      gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY"); 
   
-     // position the sensitive volume inside the horizontal frame volume
-     gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3); 
-     gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3); 
-     gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3); 
+      // position the sensitive volume inside the horizontal frame volume
+      gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3); 
+      gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3); 
+      gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3); 
   
  
-     // position the border volumes inside the PCB volume
-     Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.; 
-     gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY"); 
-     gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY"); 
-     gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY"); 
-
-     gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY"); 
+      // position the border volumes inside the PCB volume
+      Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.; 
+      gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY"); 
+      gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY"); 
+      gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY"); 
+      gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY"); 
+
+      gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY"); 
+      gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY"); 
   
-     // create the NULOC volume and position it in the horizontal frame
-     gMC->Gsvolu("S05N","BOX",kNulocMaterial,nulocpar,3);
-     gMC->Gsvolu("S06N","BOX",kNulocMaterial,nulocpar,3);
-     index = 0;
-     Float_t xxmax2 = xxmax - pcbDLength3/2.;
-     for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) { 
-       index++; 
-       gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S05N",2*index  ,"S05B", xx, 0., kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S06N",2*index  ,"S06B", xx, 0., kBframeWidth/4., 0, "ONLY");
-       if (xx > -xxmax2 && xx< xxmax2) {
-        gMC->Gspos("S05N",2*index-1,"SB5B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
-        gMC->Gspos("S05N",2*index  ,"SB5B", xx, 0., kBframeWidth/4., 0, "ONLY");
-       }
-     }
-
-     // position the volumes approximating the circular section of the pipe
-     Float_t yoffs = kSensHeight/2.-kYoverlap; 
-     Float_t epsilon = 0.001; 
-     Int_t ndiv = 6;
-     Double_t divpar[3];
-     Double_t dydiv= kSensHeight/ndiv;
-     Double_t ydiv = yoffs -dydiv/2.;
-     Int_t imax = 0; 
-     imax = 1; 
-     Double_t rmin = 31.5;  // Corrected in sep04 from PQ-LAT-SR2 de CEA-DSM-DAPNIA-SIS/BE ph HARDY 19-Oct-2002 slat 
-     Double_t xdiv = 0.;
-     for (Int_t idiv = 0;idiv < ndiv; idiv++){ 
-       ydiv += dydiv;
-       xdiv = 0.; 
-       if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
-       divpar[0] = (kPcbLength-xdiv)/2.; 
-       divpar[1] = dydiv/2. - epsilon;
-       divpar[2] = kSensWidth/2.; 
-       Float_t xvol = (kPcbLength+xdiv)/2.;
-       Float_t yvol = ydiv; 
-
-       // Volumes close to the beam pipe for slat i=1 so 4 slats per chamber
-       for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
-        sprintf(idSlatCh5,"LA%d",ConvertSlatNum(1,quadrant,kNslats3-1));
-        sprintf(idSlatCh6,"LB%d",ConvertSlatNum(1,quadrant,kNslats3-1));
-
-        GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5, quadrant*100+imax+4*idiv+1,
-                       TGeoTranslation(xvol-(kPcbLength * (kNPCB3[1])/2.),yvol-kPcbLength+kYoverlap,0.),3,divpar);
-
-        GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6,  quadrant*100+imax+4*idiv+1,
-                       TGeoTranslation(xvol-kPcbLength * kNPCB3[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
-       }
-     }
-
-     // Volumes close to the beam pipe for slat i=0 so 2 slats per chamber (central slat for station 3)
-     //      Gines Martinez, Subatech sep 04
-     // 9 box volumes are used to define the PCB closed to the beam pipe of the slat 122000SR1 of chamber 5 and 6 of St3
-     // Accordingly to plan PQ-LAT-SR1 of CEA-DSM-DAPNIA-SIS/BE ph HARDY 8-Oct-2002
-     // Rmin = 31.5 cm
-     Double_t rmin_122000SR1 = 31.5; //in cm  
-     ndiv  = 9; 
-     dydiv = kSensHeight/ndiv;           // Vertical size of the box volume approximating the rounded PCB
-     ydiv  = -kSensHeight/2 + dydiv/2.-kYoverlap;   // Initializing vertical position of the volume from bottom
-     xdiv  = 0.;                         // Initializing horizontal position of the box volumes
-     for (Int_t idiv=0;idiv<ndiv; idiv++){ 
-       xdiv = TMath::Abs( rmin_122000SR1 * TMath::Sin( TMath::ACos(ydiv/rmin_122000SR1) ) );
-       divpar[0] = (kPcbLength-xdiv)/2.; // Dimension of the box volume
-       divpar[1] = dydiv/2. - epsilon;
-       divpar[2] = kSensWidth/2.; 
-       Float_t xvol = (kPcbLength+xdiv)/2.; //2D traslition for positionning of box volume
-       Float_t yvol =  ydiv;
-       Int_t side;
-       for (side = 1; side <= 2; side++) {
-        sprintf(idSlatCh5,"LA%d",4);      
-        sprintf(idSlatCh6,"LB%d",4);
-        if(side == 2) {
-          sprintf(idSlatCh5,"LA%d",13);           
-          sprintf(idSlatCh6,"LB%d",13);
-        }         
-        GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5,500+side*100+imax+4*idiv+1,
-                       TGeoTranslation(xvol-(kPcbLength * (kNPCB3[0])/2.),yvol+kYoverlap,0.),3,divpar);
-
-        GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6,500+side*100+imax+4*idiv+1,
-                        TGeoTranslation(xvol-kPcbLength * kNPCB3[0]/2.,yvol+kYoverlap,0.),3,divpar);
-       }
-       ydiv += dydiv; // Going from bottom to top
-     }
-     // cout << "Geometry for Station 3...... done" << endl;   
+      // create the NULOC volume and position it in the horizontal frame
+      gMC->Gsvolu("S05E","BOX",kNulocMaterial,nulocpar,3);
+      gMC->Gsvolu("S06E","BOX",kNulocMaterial,nulocpar,3);
+      index = 0;
+      Float_t xxmax2 = xxmax - pcbDLength3/2.;
+      for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) { 
+       index++; 
+       gMC->Gspos("S05E",2*index-1,"S05B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
+       gMC->Gspos("S05E",2*index  ,"S05B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
+       gMC->Gspos("S06E",2*index-1,"S06B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
+       gMC->Gspos("S06E",2*index  ,"S06B", xx, 0., kBframeWidth/2.-  kNulocWidth/2, 0, "ONLY");
+       if (xx > -xxmax2 && xx< xxmax2) {
+         gMC->Gspos("S05E",2*index-1,"SB5B", xx, 0.,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
+         gMC->Gspos("S05E",2*index  ,"SB5B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
+       }
+      }
+
+      // position the volumes approximating the circular section of the pipe
+      Float_t epsilon = 0.001; 
+      Int_t ndiv = 6;
+      Int_t imax = 1;
+      Double_t divpar[3];
+      Double_t dydiv = kSensHeight/ndiv;
+      Double_t ydiv  = (kSensHeight - dydiv)/2.;
+      Double_t rmin  = 31.5;  // Corrected in sep04 from PQ-LAT-SR2 de CEA-DSM-DAPNIA-SIS/BE ph HARDY 19-Oct-2002 slat 
+      Double_t xdiv  = 0.;
+      Float_t xvol;
+      Float_t yvol;
+
+      for (Int_t idiv = 0; idiv < ndiv; idiv++){ 
+       ydiv += dydiv;
+       xdiv = 0.; 
+       if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
+       divpar[0] = (kPcbLength - xdiv)/2.; 
+       divpar[1] = dydiv/2. - epsilon;
+       divpar[2] = kSensWidth/2.; 
+       xvol = (kPcbLength + xdiv)/2.;
+       yvol = ydiv; 
+
+       // Volumes close to the beam pipe for slat i=1 so 4 slats per chamber
+       for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
+         sprintf(idSlatCh5,"LA%d",ConvertSlatNum(1,quadrant,kNslats3-1));
+         sprintf(idSlatCh6,"LB%d",ConvertSlatNum(1,quadrant,kNslats3-1));
+
+         GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5, quadrant*100+imax+4*idiv+1,
+                                                      TGeoTranslation(xvol-(kPcbLength * kNPCB3[1]/2.),yvol-kPcbLength,0.),3,divpar);
+
+         GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6,  quadrant*100+imax+4*idiv+1,
+                                                      TGeoTranslation(xvol-(kPcbLength * kNPCB3[1]/2.),yvol-kPcbLength,0.),3,divpar);
+       }
+      }
+
+      // Volumes close to the beam pipe for slat i=0 so 2 slats per chamber (central slat for station 3)
+      //      Gines Martinez, Subatech sep 04
+      // 9 box volumes are used to define the PCB closed to the beam pipe of the slat 122000SR1 of chamber 5 and 6 of St3
+      // Accordingly to plan PQ-LAT-SR1 of CEA-DSM-DAPNIA-SIS/BE ph HARDY 8-Oct-2002
+      // Rmin = 31.5 cm
+      rmin = 31.5; //in cm  
+      ndiv  = 9; 
+      dydiv = kSensHeight/ndiv;           // Vertical size of the box volume approximating the rounded PCB
+      ydiv  = -kSensHeight/2 + dydiv/2.;   // Initializing vertical position of the volume from bottom
+      xdiv  = 0.;                         // Initializing horizontal position of the box volumes
+
+      for (Int_t idiv = 0; idiv < ndiv; idiv++){ 
+       xdiv = TMath::Abs( rmin * TMath::Sin( TMath::ACos(ydiv/rmin) ) );
+       divpar[0] = (kPcbLength - xdiv)/2.; // Dimension of the box volume
+       divpar[1] = dydiv/2. - epsilon;
+       divpar[2] = kSensWidth/2.; 
+       xvol = (kPcbLength + xdiv)/2.; //2D traslition for positionning of box volume
+       yvol =  ydiv;
+       Int_t side;
+       for (side = 1; side <= 2; side++) {
+         sprintf(idSlatCh5,"LA%d",4);     
+         sprintf(idSlatCh6,"LB%d",4);
+         if(side == 2) {
+           sprintf(idSlatCh5,"LA%d",13);          
+           sprintf(idSlatCh6,"LB%d",13);
+         }        
+         GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5,500+side*100+imax+4*idiv+1,
+                                                      TGeoTranslation(xvol-(kPcbLength * kNPCB3[0]/2.),yvol,0.),3,divpar);
+
+         GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6,500+side*100+imax+4*idiv+1,
+                                                      TGeoTranslation(xvol-(kPcbLength * kNPCB3[0]/2.),yvol,0.),3,divpar);
+       }
+       ydiv += dydiv; // Going from bottom to top
+      }
+      // cout << "Geometry for Station 3...... done" << endl;  
     }
     
-    if (fStations[3]) {
+  if (fStations[3]) {
 
 
-// //********************************************************************
-// //                            Station 4                             **
-// //********************************************************************
-//      // indices 1 and 2 for first and second chambers in the station
-//      // iChamber (first chamber) kept for other quanties than Z,
-//      // assumed to be the same in both chambers
-//      corrected geometry (JP. Cussonneau, Ch. Finck)
+    // //********************************************************************
+    // //                            Station 4                             **
+    // //********************************************************************
+    //      // indices 1 and 2 for first and second chambers in the station
+    //      // iChamber (first chamber) kept for other quanties than Z,
+    //      // assumed to be the same in both chambers
+    //      corrected geometry (JP. Cussonneau, Ch. Finck)
  
-     iChamber = GetChamber(6);
-     iChamber1 = iChamber;
-     iChamber2 = GetChamber(7);
-
-     const Int_t kNslats4 = 7;  // number of slats per quadrant
-     const Int_t kNPCB4[kNslats4] = {5, 6, 5, 5, 4, 3, 2}; // n PCB per slat
-     const Float_t kXpos4[kNslats4] = {38.5, 0., 0., 0., 0., 0., 0.};
-     Float_t slatLength4[kNslats4];     
-
-//      // create and position the slat (mother) volumes 
-
-     char idSlatCh7[5];
-     char idSlatCh8[5];
-     Float_t xSlat4;
-     Float_t ySlat4;
-     angle = 0.;
-
-     for (i = 0; i<kNslats4; i++){
-       slatLength4[i] = kPcbLength * kNPCB4[i] + 2. * kDslatLength; 
-       xSlat4 = slatLength4[i]/2. + kVframeLength/2. + kXpos4[i]; 
-       ySlat4 = kSensHeight * i - kYoverlap *i;
-       
-       spar[0] = slatLength4[i]/2.; 
-       spar[1] = kSlatHeight/2.;
-       spar[2] = kSlatWidth/2.*1.01; 
-       Float_t dzCh4 = spar[2]*1.01;
-       // zSlat to be checked (odd downstream or upstream?)
-       Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2]; 
-
-       sprintf(idSlatCh7,"LC%d",kNslats4-1+i);
-       gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
-       detElemId = 700 + i + kNslats4-1;
-       GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, ySlat4, zSlat+2.*dzCh4),
-                                                TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
-
-       sprintf(idSlatCh7,"LC%d",3*kNslats4-2+i);
-       gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
-       detElemId = 750 + i + kNslats4-1;
-       GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(-xSlat4, ySlat4, zSlat-2.*dzCh4),
-                                                TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
+    iChamber = GetChamber(6);
+    iChamber1 = iChamber;
+    iChamber2 = GetChamber(7);
+
+    const Int_t   kNslats4          = 7;  // number of slats per quadrant
+    const Int_t   kNPCB4[kNslats4]  = {5, 6, 5, 5, 4, 3, 2}; // n PCB per slat
+    const Float_t kXpos4[kNslats4]  = {38.2, 0., 0., 0., 0., 0., 0.};
+    const Float_t kYpos41[kNslats4] = {0., 38.2, 34.40, 36.60, 29.3, 37.0, 28.6};
+    const Float_t kYpos42[kNslats4] = {0., 38.2, 37.85, 37.55, 29.4, 37.0, 28.6};
+
+    Float_t slatLength4[kNslats4];     
+
+    // create and position the slat (mother) volumes 
+
+    char idSlatCh7[5];
+    char idSlatCh8[5];
+    Float_t xSlat4;
+    Float_t ySlat41 = 0;
+    Float_t ySlat42 = 0;
+
+    angle = 0.;
+
+    for (i = 0; i<kNslats4; i++){
+      slatLength4[i] = kPcbLength * kNPCB4[i] + 2. * kVframeLength; 
+      xSlat4 = slatLength4[i]/2. + kDslatLength + kXpos4[i]; 
+      ySlat41 += kYpos41[i];
+      ySlat42 += kYpos42[i];
+
+      spar[0] = slatLength4[i]/2.; 
+      spar[1] = kSlatHeight/2.;
+      spar[2] = kSlatWidth/2.; 
+      Float_t dzCh4 = dzCh;
+      Float_t zSlat4 = (i%2 ==0)? -zSlat : zSlat; 
+
+      sprintf(idSlatCh7,"LC%d",kNslats4-1+i);
+      gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
+      detElemId = 700 + i + kNslats4-1;
+      GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, ySlat41, -zSlat4 + dzCh4),
+                                  TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
+
+      sprintf(idSlatCh7,"LC%d",3*kNslats4-2+i);
+      gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
+      detElemId = 750 + i + kNslats4-1;
+      GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(-xSlat4, ySlat41, zSlat4 - dzCh4),
+                                  TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
  
-       if (i > 0) { 
-        sprintf(idSlatCh7,"LC%d",kNslats4-1-i);
-        gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
-        detElemId = 700 - i + kNslats4-1;
-        GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, -ySlat4, zSlat+2.*dzCh4),
-                                                  TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
-
-        sprintf(idSlatCh7,"LC%d",3*kNslats4-2-i);
-        detElemId = 750 - i + kNslats4-1;
-        gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
-        GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, 
-                                                  TGeoTranslation(-xSlat4, -ySlat4, zSlat-2.*dzCh4),
-                                                  TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
-       }
-
-       sprintf(idSlatCh8,"LD%d",kNslats4-1+i);
-       gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
-       detElemId = 800 + i + kNslats4-1;
-       GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, ySlat4, zSlat+2.*dzCh4),
-                                                TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
-
-       sprintf(idSlatCh8,"LD%d",3*kNslats4-2+i);
-       detElemId = 850 + i + kNslats4-1;
-       gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
-       GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, ySlat4, zSlat-2.*dzCh4),
-                                                TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
-       if (i > 0) { 
-        sprintf(idSlatCh8,"LD%d",kNslats4-1-i);
-        detElemId = 800 - i + kNslats4-1;
-        gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
-        GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, -ySlat4, zSlat+2.*dzCh4),
-                                                  TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
-        sprintf(idSlatCh8,"LD%d",3*kNslats4-2-i);
-        detElemId = 850 - i + kNslats4-1;
-        gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
-        GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, -ySlat4, zSlat-2.*dzCh4),
-                                                  TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
-       }
-     }
+      if (i > 0) { 
+       sprintf(idSlatCh7,"LC%d",kNslats4-1-i);
+       gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
+       detElemId = 700 - i + kNslats4-1;
+       GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, -ySlat41, -zSlat4 + dzCh4),
+                                    TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
+
+       sprintf(idSlatCh7,"LC%d",3*kNslats4-2-i);
+       detElemId = 750 - i + kNslats4-1;
+       gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
+       GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, 
+                                    TGeoTranslation(-xSlat4, -ySlat41, zSlat4 - dzCh4),
+                                    TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
+      }
+
+      sprintf(idSlatCh8,"LD%d",kNslats4-1+i);
+      gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
+      detElemId = 800 + i + kNslats4-1;
+      GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, ySlat42, -zSlat4 + dzCh4),
+                                  TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
+
+      sprintf(idSlatCh8,"LD%d",3*kNslats4-2+i);
+      detElemId = 850 + i + kNslats4-1;
+      gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
+      GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, ySlat42, zSlat4 - dzCh4),
+                                  TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
+      if (i > 0) { 
+       sprintf(idSlatCh8,"LD%d",kNslats4-1-i);
+       detElemId = 800 - i + kNslats4-1;
+       gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
+       GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, -ySlat42, -zSlat4 + dzCh4),
+                                    TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
+       sprintf(idSlatCh8,"LD%d",3*kNslats4-2-i);
+       detElemId = 850 - i + kNslats4-1;
+       gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
+       GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, -ySlat42, zSlat4 - dzCh4),
+                                    TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
+      }
+    }
      
-     // create the panel volume 
+    // create the panel volume 
  
-     gMC->Gsvolu("S07C","BOX",kPanelMaterial,panelpar,3);
-     gMC->Gsvolu("S08C","BOX",kPanelMaterial,panelpar,3);
+    gMC->Gsvolu("S07C","BOX",kCarbonMaterial,panelpar,3);
+    gMC->Gsvolu("S08C","BOX",kCarbonMaterial,panelpar,3);
 
-     // create the rohacell volume 
+    // create the nomex volume 
 
-     gMC->Gsvolu("S07R","BOX",kRohaMaterial,rohapar,3);
-     gMC->Gsvolu("S08R","BOX",kRohaMaterial,rohapar,3);
+    gMC->Gsvolu("S07N","BOX",kNomexMaterial,nomexpar,3);
+    gMC->Gsvolu("S08N","BOX",kNomexMaterial,nomexpar,3);
 
-     // create the insulating material volume 
 
-     gMC->Gsvolu("S07I","BOX",kInsuMaterial,insupar,3);
-     gMC->Gsvolu("S08I","BOX",kInsuMaterial,insupar,3);
+    // create the nomex volume (bulk)
 
-     // create the PCB volume 
+    gMC->Gsvolu("S07X","BOX",kNomexBMaterial,nomexbpar,3);
+    gMC->Gsvolu("S08X","BOX",kNomexBMaterial,nomexbpar,3);
 
-     gMC->Gsvolu("S07P","BOX",kPcbMaterial,pcbpar,3);
-     gMC->Gsvolu("S08P","BOX",kPcbMaterial,pcbpar,3);
+    // create the insulating material volume 
+
+    gMC->Gsvolu("S07I","BOX",kInsuMaterial,insupar,3);
+    gMC->Gsvolu("S08I","BOX",kInsuMaterial,insupar,3);
+
+    // create the PCB volume 
+
+    gMC->Gsvolu("S07P","BOX",kPcbMaterial,pcbpar,3);
+    gMC->Gsvolu("S08P","BOX",kPcbMaterial,pcbpar,3);
  
-     // create the sensitive volumes,
-
-     gMC->Gsvolu("S07G","BOX",kSensMaterial,dum,0);
-     gMC->Gsvolu("S08G","BOX",kSensMaterial,dum,0);
-
-     // create the vertical frame volume 
-
-     gMC->Gsvolu("S07V","BOX",kVframeMaterial,vFramepar,3);
-     gMC->Gsvolu("S08V","BOX",kVframeMaterial,vFramepar,3);
-
-     // create the horizontal frame volume 
-
-     gMC->Gsvolu("S07H","BOX",kHframeMaterial,hFramepar,3);
-     gMC->Gsvolu("S08H","BOX",kHframeMaterial,hFramepar,3);
-
-     // create the horizontal border volume 
-
-     gMC->Gsvolu("S07B","BOX",kBframeMaterial,bFramepar,3);
-     gMC->Gsvolu("S08B","BOX",kBframeMaterial,bFramepar,3);
-
-     index = 0; 
-     for (i = 0; i < kNslats4; i++){
-       for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
-
-        if (i == 0 && quadrant == 2) continue;
-        if (i == 0 && quadrant == 4) continue;
-
-        sprintf(idSlatCh7,"LC%d",ConvertSlatNum(i,quadrant,kNslats4-1));
-        sprintf(idSlatCh8,"LD%d",ConvertSlatNum(i,quadrant,kNslats4-1));
-        Float_t xvFrame  = (slatLength4[i] - kVframeLength)/2.;
-
-        // position the vertical frames 
-        if (i != 1) { 
-          GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-          GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-        } else { // no rounded spacer yet
-          GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          // GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-          GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          // GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-        }
-        // position the panels and the insulating material 
-        for (j = 0; j < kNPCB4[i]; j++){
-          if (i == 1 && j == 0) continue;
-          index++;
-          Float_t xx = kSensLength * (-kNPCB4[i]/2.+j+.5); 
-
-          Float_t zPanel = spar[2] - panelpar[2]; 
-          GetEnvelopes(6)->AddEnvelopeConstituent("S07C", idSlatCh7, 2*index-1,TGeoTranslation(xx,0.,zPanel));
-          GetEnvelopes(6)->AddEnvelopeConstituent("S07C", idSlatCh7, 2*index,TGeoTranslation(xx,0.,-zPanel));
-          GetEnvelopes(6)->AddEnvelopeConstituent("S07I", idSlatCh7, index,TGeoTranslation(xx,0.,0.));
-          GetEnvelopes(7)->AddEnvelopeConstituent("S08C", idSlatCh8, 2*index-1,TGeoTranslation(xx,0.,zPanel));
-          GetEnvelopes(7)->AddEnvelopeConstituent("S08C", idSlatCh8, 2*index,TGeoTranslation(xx,0.,-zPanel));
-          GetEnvelopes(7)->AddEnvelopeConstituent("S08I", idSlatCh8, index,TGeoTranslation(xx,0.,0.));
-        }
-       } 
-     }
-
-     // position the rohacell volume inside the panel volume
-     gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY"); 
-
-     // position the PCB volume inside the insulating material volume
-     gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY"); 
-     // position the horizontal frame volume inside the PCB volume
-     gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY"); 
-     // position the sensitive volume inside the horizontal frame volume
-     gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3); 
-     gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3); 
-     // position the border volumes inside the PCB volume
-     Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.; 
-     gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY"); 
-
-//      // create the NULOC volume and position it in the horizontal frame
-
-     gMC->Gsvolu("S07N","BOX",kNulocMaterial,nulocpar,3);
-     gMC->Gsvolu("S08N","BOX",kNulocMaterial,nulocpar,3);
-     index = 0;
-     for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) { 
-       index++; 
-       gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S07N",2*index  ,"S07B", xx, 0., kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S08N",2*index  ,"S08B", xx, 0., kBframeWidth/4., 0, "ONLY");
-     }
-
-//      // position the volumes approximating the circular section of the pipe
-     Float_t yoffs = kSensHeight/2. - kYoverlap; 
-     Float_t epsilon = 0.001; 
-     Int_t ndiv = 10;
-     Double_t divpar[3];
-     Double_t dydiv= kSensHeight/ndiv;
-     Double_t ydiv = yoffs -dydiv;
-     Int_t imax=0; 
-     imax = 1; 
-     Float_t rmin = 39.5;
-     Float_t shiftR = 0.;
-     for (Int_t idiv = 0; idiv < ndiv; idiv++){ 
-       ydiv += dydiv;
-       Float_t xdiv = 0.; 
-       if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
-       divpar[0] = (kPcbLength-xdiv-shiftR)/2.; 
-       divpar[1] = dydiv/2. - epsilon;
-       divpar[2] = kSensWidth/2.; 
-       Float_t xvol = (kPcbLength+xdiv)/2.+shiftR;
-       Float_t yvol = ydiv + dydiv/2.;
+    // create the sensitive volumes,
+
+    gMC->Gsvolu("S07G","BOX",kSensMaterial,dum,0);
+    gMC->Gsvolu("S08G","BOX",kSensMaterial,dum,0);
+
+    // create the vertical frame volume 
+
+    gMC->Gsvolu("S07V","BOX",kVframeMaterial,vFramepar,3);
+    gMC->Gsvolu("S08V","BOX",kVframeMaterial,vFramepar,3);
+
+    // create the horizontal frame volume 
+
+    gMC->Gsvolu("S07H","BOX",kHframeMaterial,hFramepar,3);
+    gMC->Gsvolu("S08H","BOX",kHframeMaterial,hFramepar,3);
+
+    // create the horizontal border volume 
+
+    gMC->Gsvolu("S07B","BOX",kBframeMaterial,bFramepar,3);
+    gMC->Gsvolu("S08B","BOX",kBframeMaterial,bFramepar,3);
+
+    index = 0; 
+    for (i = 0; i < kNslats4; i++){
+      for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
+
+       if (i == 0 && quadrant == 2) continue;
+       if (i == 0 && quadrant == 4) continue;
+
+       sprintf(idSlatCh7,"LC%d",ConvertSlatNum(i,quadrant,kNslats4-1));
+       sprintf(idSlatCh8,"LD%d",ConvertSlatNum(i,quadrant,kNslats4-1));
+       Float_t xvFrame  = (slatLength4[i] - kVframeLength)/2.;
+
+       // position the vertical frames 
+       if (i != 1) { 
+         GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+         GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+       } else { // no rounded spacer yet
+         GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         // GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+         GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         // GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+       }
+       // position the panels and the insulating material 
+       for (j = 0; j < kNPCB4[i]; j++){
+         if (i == 1 && j == 0) continue;
+         index++;
+         Float_t xx = kSensLength * (-kNPCB4[i]/2.+j+.5); 
+
+         Float_t zPanel = spar[2] - nomexbpar[2]; 
+         GetEnvelopes(6)->AddEnvelopeConstituent("S07X", idSlatCh7, 2*index-1,TGeoTranslation(xx,0.,zPanel));
+         GetEnvelopes(6)->AddEnvelopeConstituent("S07X", idSlatCh7, 2*index,TGeoTranslation(xx,0.,-zPanel));
+         GetEnvelopes(6)->AddEnvelopeConstituent("S07I", idSlatCh7, index,TGeoTranslation(xx,0.,0.));
+         GetEnvelopes(7)->AddEnvelopeConstituent("S08X", idSlatCh8, 2*index-1,TGeoTranslation(xx,0.,zPanel));
+         GetEnvelopes(7)->AddEnvelopeConstituent("S08X", idSlatCh8, 2*index,TGeoTranslation(xx,0.,-zPanel));
+         GetEnvelopes(7)->AddEnvelopeConstituent("S08I", idSlatCh8, index,TGeoTranslation(xx,0.,0.));
+       }
+      } 
+    }
+
+    // position the nomex volume inside the panel volume
+    gMC->Gspos("S07N",1,"S07C",0.,0.,0.,0,"ONLY"); 
+    gMC->Gspos("S08N",1,"S08C",0.,0.,0.,0,"ONLY"); 
+
+    // position panel volume inside the bulk nomex material volume
+    gMC->Gspos("S07C",1,"S07X",0.,0.,kNomexBWidth/2.,0,"ONLY"); 
+    gMC->Gspos("S08C",1,"S08X",0.,0.,kNomexBWidth/2.,0,"ONLY"); 
+
+    // position the PCB volume inside the insulating material volume
+    gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY"); 
+    gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY"); 
+
+    // position the horizontal frame volume inside the PCB volume
+    gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY"); 
+    gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY"); 
+
+    // position the sensitive volume inside the horizontal frame volume
+    gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3); 
+    gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3); 
+
+    // position the border volumes inside the PCB volume
+    Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.; 
+    gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY"); 
+    gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY"); 
+    gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY"); 
+    gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY"); 
+
+    // create the NULOC volume and position it in the horizontal frame
+
+    gMC->Gsvolu("S07E","BOX",kNulocMaterial,nulocpar,3);
+    gMC->Gsvolu("S08E","BOX",kNulocMaterial,nulocpar,3);
+    index = 0;
+    for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) { 
+      index++; 
+      gMC->Gspos("S07E",2*index-1,"S07B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
+      gMC->Gspos("S07E",2*index  ,"S07B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
+      gMC->Gspos("S08E",2*index-1,"S08B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
+      gMC->Gspos("S08E",2*index  ,"S08B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
+    }
+
+    // position the volumes approximating the circular section of the pipe
+
+    Float_t epsilon = 0.001; 
+    Int_t ndiv = 10;
+    Int_t imax = 1; 
+    Double_t divpar[3];
+    Double_t dydiv = kSensHeight/ndiv;
+    Double_t ydiv  = (kSensHeight - dydiv)/2.;
+    Float_t rmin   = 39.5;// Corrected in sep04 from PQ-LAT-NR3 de CEA-DSM-DAPNIA-SIS/BE ph HARDY 19-Oct-2002 slat 
+    Float_t xdiv   = 0.; 
+    Float_t xvol;
+    Float_t yvol;
+
+    for (Int_t idiv = 0; idiv < ndiv; idiv++){ 
+      ydiv += dydiv;
+      xdiv = 0.; 
+      if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
+      divpar[0] = (kPcbLength - xdiv)/2.; 
+      divpar[1] = dydiv/2. - epsilon;
+      divpar[2] = kSensWidth/2.; 
+      xvol = (kPcbLength + xdiv)/2.;
+      yvol = ydiv ;
        
-       for (Int_t quadrant=1; quadrant<=4; quadrant++) {
-        sprintf(idSlatCh7,"LC%d",ConvertSlatNum(1,quadrant,kNslats4-1));
-        sprintf(idSlatCh8,"LD%d",ConvertSlatNum(1,quadrant,kNslats4-1));
+      for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
+       sprintf(idSlatCh7,"LC%d",ConvertSlatNum(1,quadrant,kNslats4-1));
+       sprintf(idSlatCh8,"LD%d",ConvertSlatNum(1,quadrant,kNslats4-1));
         
-        GetEnvelopes(6)->AddEnvelopeConstituentParam("S07G",idSlatCh7, quadrant*100+imax+4*idiv+1,
-                                                     TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
+       GetEnvelopes(6)->AddEnvelopeConstituentParam("S07G",idSlatCh7, quadrant*100+imax+4*idiv+1,
+                                                    TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength,0.),3,divpar);
         
-        GetEnvelopes(7)->AddEnvelopeConstituentParam("S08G", idSlatCh8, quadrant*100+imax+4*idiv+1,
-                                                     TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
-       }
-     }
-     // cout << "Geometry for Station 4...... done" << endl;
-
+       GetEnvelopes(7)->AddEnvelopeConstituentParam("S08G", idSlatCh8, quadrant*100+imax+4*idiv+1,
+                                                    TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength,0.),3,divpar);
+      }
     }
+    // cout << "Geometry for Station 4...... done" << endl;
+
+  }
     
-    if (fStations[4]) {
+  if (fStations[4]) {
       
 
-// //********************************************************************
-// //                            Station 5                             **
-// //********************************************************************
-//      // indices 1 and 2 for first and second chambers in the station
-//      // iChamber (first chamber) kept for other quanties than Z,
-//      // assumed to be the same in both chambers
-//      corrected geometry (JP. Cussonneau, Ch. Finck)
-
-     iChamber = GetChamber(8);
-     iChamber1 = iChamber;
-     iChamber2 = GetChamber(9);
+    // //********************************************************************
+    // //                            Station 5                             **
+    // //********************************************************************
+    //      // indices 1 and 2 for first and second chambers in the station
+    //      // iChamber (first chamber) kept for other quanties than Z,
+    //      // assumed to be the same in both chambers
+    //      corrected geometry (JP. Cussonneau, Ch. Finck)
+
+    iChamber = GetChamber(8);
+    iChamber1 = iChamber;
+    iChamber2 = GetChamber(9);
  
-     const Int_t kNslats5 = 7;  // number of slats per quadrant
-     const Int_t kNPCB5[kNslats5] = {5, 6, 6, 6, 5, 4, 3}; // n PCB per slat
-     const Float_t kXpos5[kNslats5] = {38.5, 0., 0., 0., 0., 0., 0.};
-     Float_t slatLength5[kNslats5]; 
-
-//      // create and position the slat (mother) volumes 
-
-     char idSlatCh9[5];
-     char idSlatCh10[5];
-     Float_t xSlat5;
-     Float_t ySlat5;
-     angle = 0.;
-
-     for (i = 0; i < kNslats5; i++){
-       slatLength5[i] = kPcbLength * kNPCB5[i] + 2. * kDslatLength; 
-       xSlat5 = slatLength5[i]/2. + kVframeLength/2. +kXpos5[i]; 
-       ySlat5 = kSensHeight * i - kYoverlap * i;
+    const Int_t   kNslats5         = 7;  // number of slats per quadrant
+    const Int_t   kNPCB5[kNslats5] = {5, 6, 6, 6, 5, 4, 3}; // n PCB per slat
+    const Float_t kXpos5[kNslats5] = {38.2, 0., 0., 0., 0., 0., 0.};
+    const Float_t kYpos5[kNslats5] = {0., 38.2, 37.9, 37.6, 37.3, 37.05, 36.75};
+    Float_t slatLength5[kNslats5]; 
+
+    // create and position the slat (mother) volumes 
+
+    char idSlatCh9[5];
+    char idSlatCh10[5];
+    Float_t xSlat5;
+    Float_t ySlat5 = 0;
+    angle = 0.;
+
+    for (i = 0; i < kNslats5; i++){
+
+      slatLength5[i] = kPcbLength * kNPCB5[i] + 2.* kVframeLength; 
+      xSlat5 = slatLength5[i]/2. + kDslatLength + kXpos5[i]; 
+      ySlat5 += kYpos5[i];
+
+      spar[0] = slatLength5[i]/2.; 
+      spar[1] = kSlatHeight/2.;
+      spar[2] = kSlatWidth/2.; 
+
+      Float_t dzCh5  = dzCh;
+      Float_t zSlat5 = (i%2 ==0)? -zSlat : zSlat; 
+
+      sprintf(idSlatCh9,"LE%d",kNslats5-1+i);
+      detElemId = 900 + i + kNslats5-1;
+      gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
+      GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, ySlat5, -zSlat5 + dzCh5),
+                                  TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
+
+      sprintf(idSlatCh9,"LE%d",3*kNslats5-2+i);
+      detElemId = 950 + i + kNslats5-1;
+      gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
+      GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat5 - dzCh5),
+                                  TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
  
-       spar[0] = slatLength5[i]/2.; 
-       spar[1] = kSlatHeight/2.;
-       spar[2] = kSlatWidth/2. * 1.01; 
-       Float_t dzCh5 = spar[2]*1.01;
-       // zSlat to be checked (odd downstream or upstream?)
-       Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2]; 
-
-       sprintf(idSlatCh9,"LE%d",kNslats5-1+i);
-       detElemId = 900 + i + kNslats5-1;
-       gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
-       GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, ySlat5, zSlat+2.*dzCh5),
-                                                TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
-
-       sprintf(idSlatCh9,"LE%d",3*kNslats5-2+i);
-       detElemId = 950 + i + kNslats5-1;
-       gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
-       GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat-2.*dzCh5),
-                                                TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
-       if (i > 0) { 
-        sprintf(idSlatCh9,"LE%d",kNslats5-1-i);
-        detElemId = 900 - i + kNslats5-1;
-        gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
-        GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, zSlat+2.*dzCh5),
-                                                  TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
-
-        sprintf(idSlatCh9,"LE%d",3*kNslats5-2-i);
-        detElemId = 950 - i + kNslats5-1;
-        gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
-        GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat-2.*dzCh5),
-                                                  TGeoRotation("rot4",90,180+angle,90,270+angle,0,0)  );
-       }
-
-       sprintf(idSlatCh10,"LF%d",kNslats5-1+i);
-       detElemId = 1000 + i + kNslats5-1;
-       gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
-       GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, ySlat5, zSlat+2.*dzCh5),
-                                                TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
-
-       sprintf(idSlatCh10,"LF%d",3*kNslats5-2+i);
-       detElemId = 1050 + i + kNslats5-1;
-       gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
-       GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat-2.*dzCh5),
-                                                TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
-
-       if (i > 0) { 
-        sprintf(idSlatCh10,"LF%d",kNslats5-1-i);
-        detElemId = 1000 - i + kNslats5-1;
-        gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
-        GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, zSlat+2.*dzCh5),
-                                                  TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
-        sprintf(idSlatCh10,"LF%d",3*kNslats5-2-i);
-        detElemId = 1050 - i + kNslats5-1;
-        gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
-        GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat-2.*dzCh5),
-                                                  TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
-       }
-     }
-     //      // create the panel volume 
+      if (i > 0) { 
+       sprintf(idSlatCh9,"LE%d",kNslats5-1-i);
+       detElemId = 900 - i + kNslats5-1;
+       gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
+       GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, -zSlat5 + dzCh5),
+                                    TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
+
+       sprintf(idSlatCh9,"LE%d",3*kNslats5-2-i);
+       detElemId = 950 - i + kNslats5-1;
+       gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
+       GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat5 - dzCh5),
+                                    TGeoRotation("rot4",90,180+angle,90,270+angle,0,0)  );
+      }
+
+      sprintf(idSlatCh10,"LF%d",kNslats5-1+i);
+      detElemId = 1000 + i + kNslats5-1;
+      gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
+      GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, ySlat5, -zSlat5 + dzCh5),
+                                  TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
+
+      sprintf(idSlatCh10,"LF%d",3*kNslats5-2+i);
+      detElemId = 1050 + i + kNslats5-1;
+      gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
+      GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat5 - dzCh5),
+                                  TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
+
+      if (i > 0) { 
+       sprintf(idSlatCh10,"LF%d",kNslats5-1-i);
+       detElemId = 1000 - i + kNslats5-1;
+       gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
+       GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, -zSlat5 + dzCh5),
+                                    TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
+       sprintf(idSlatCh10,"LF%d",3*kNslats5-2-i);
+       detElemId = 1050 - i + kNslats5-1;
+       gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
+       GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat5 - dzCh5),
+                                    TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
+      }
+    }
+
+    // create the panel volume 
  
-     gMC->Gsvolu("S09C","BOX",kPanelMaterial,panelpar,3);
-     gMC->Gsvolu("S10C","BOX",kPanelMaterial,panelpar,3);
+    gMC->Gsvolu("S09C","BOX",kCarbonMaterial,panelpar,3);
+    gMC->Gsvolu("S10C","BOX",kCarbonMaterial,panelpar,3);
+
+    // create the nomex volume 
+
+    gMC->Gsvolu("S09N","BOX",kNomexMaterial,nomexpar,3);
+    gMC->Gsvolu("S10N","BOX",kNomexMaterial,nomexpar,3);
 
-     // create the rohacell volume 
 
-     gMC->Gsvolu("S09R","BOX",kRohaMaterial,rohapar,3);
-     gMC->Gsvolu("S10R","BOX",kRohaMaterial,rohapar,3);
+    // create the nomex volume (bulk)
 
-     // create the insulating material volume 
+    gMC->Gsvolu("S09X","BOX",kNomexBMaterial,nomexbpar,3);
+    gMC->Gsvolu("S10X","BOX",kNomexBMaterial,nomexbpar,3);
 
-     gMC->Gsvolu("S09I","BOX",kInsuMaterial,insupar,3);
-     gMC->Gsvolu("S10I","BOX",kInsuMaterial,insupar,3);
+    // create the insulating material volume 
 
-     // create the PCB volume 
+    gMC->Gsvolu("S09I","BOX",kInsuMaterial,insupar,3);
+    gMC->Gsvolu("S10I","BOX",kInsuMaterial,insupar,3);
 
-     gMC->Gsvolu("S09P","BOX",kPcbMaterial,pcbpar,3);
-     gMC->Gsvolu("S10P","BOX",kPcbMaterial,pcbpar,3);
+    // create the PCB volume 
+
+    gMC->Gsvolu("S09P","BOX",kPcbMaterial,pcbpar,3);
+    gMC->Gsvolu("S10P","BOX",kPcbMaterial,pcbpar,3);
  
-     // create the sensitive volumes,
-
-     gMC->Gsvolu("S09G","BOX",kSensMaterial,dum,0);
-     gMC->Gsvolu("S10G","BOX",kSensMaterial,dum,0);
-
-     // create the vertical frame volume 
-
-     gMC->Gsvolu("S09V","BOX",kVframeMaterial,vFramepar,3);
-     gMC->Gsvolu("S10V","BOX",kVframeMaterial,vFramepar,3);
-
-     // create the horizontal frame volume 
-
-     gMC->Gsvolu("S09H","BOX",kHframeMaterial,hFramepar,3);
-     gMC->Gsvolu("S10H","BOX",kHframeMaterial,hFramepar,3);
-
-     // create the horizontal border volume 
-
-     gMC->Gsvolu("S09B","BOX",kBframeMaterial,bFramepar,3);
-     gMC->Gsvolu("S10B","BOX",kBframeMaterial,bFramepar,3);
-
-     index = 0; 
-     for (i = 0; i < kNslats5; i++){
-       for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
-
-        if (i == 0 && quadrant == 2) continue;
-        if (i == 0 && quadrant == 4) continue;
-
-        sprintf(idSlatCh9,"LE%d",ConvertSlatNum(i,quadrant,kNslats5-1));
-        sprintf(idSlatCh10,"LF%d",ConvertSlatNum(i,quadrant,kNslats5-1));
-        Float_t xvFrame  = (slatLength5[i] - kVframeLength)/2.;
-
-        // position the vertical frames 
-        if (i != 1) { 
-          GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-          GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-        } else {  // no rounded spacer yet
-          GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          //      GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-          GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          //      GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-        }
-
-        // position the panels and the insulating material 
-        for (j = 0; j < kNPCB5[i]; j++){
-          if (i == 1 && j == 0) continue;
-          index++;
-          Float_t xx = kSensLength * (-kNPCB5[i]/2.+j+.5); 
-
-          Float_t zPanel = spar[2] - panelpar[2]; 
-          GetEnvelopes(8)->AddEnvelopeConstituent("S09C", idSlatCh9, 2*index-1,TGeoTranslation(xx,0.,zPanel));
-          GetEnvelopes(8)->AddEnvelopeConstituent("S09C", idSlatCh9, 2*index,TGeoTranslation(xx,0.,-zPanel));
-          GetEnvelopes(8)->AddEnvelopeConstituent("S09I", idSlatCh9, index,TGeoTranslation(xx,0.,0.));
-          GetEnvelopes(9)->AddEnvelopeConstituent("S10C", idSlatCh10, 2*index-1,TGeoTranslation(xx,0.,zPanel));
-          GetEnvelopes(9)->AddEnvelopeConstituent("S10C", idSlatCh10, 2*index,TGeoTranslation(xx,0.,-zPanel));
-          GetEnvelopes(9)->AddEnvelopeConstituent("S10I", idSlatCh10, index,TGeoTranslation(xx,0.,0.));
-        }
-       } 
-     }
-
-     // position the rohacell volume inside the panel volume
-     gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY"); 
-
-     // position the PCB volume inside the insulating material volume
-     gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY"); 
-     // position the horizontal frame volume inside the PCB volume
-     gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY"); 
-     // position the sensitive volume inside the horizontal frame volume
-     gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3); 
-     gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3); 
-     // position the border volumes inside the PCB volume
-     Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.; 
-     gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY"); 
-
-     //      // create the NULOC volume and position it in the horizontal frame
-
-     gMC->Gsvolu("S09N","BOX",kNulocMaterial,nulocpar,3);
-     gMC->Gsvolu("S10N","BOX",kNulocMaterial,nulocpar,3);
-     index = 0;
-     for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) { 
-       index++; 
-       gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S09N",2*index  ,"S09B", xx, 0., kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S10N",2*index  ,"S10B", xx, 0., kBframeWidth/4., 0, "ONLY");
-     }
-
-     //      // position the volumes approximating the circular section of the pipe
-     Float_t yoffs = kSensHeight/2. - kYoverlap; 
-     Float_t epsilon = 0.001; 
-     Int_t ndiv = 10;
-     Double_t divpar[3];
-     Double_t dydiv = kSensHeight/ndiv;
-     Double_t ydiv = yoffs -dydiv;
-     Int_t imax = 0; 
-     //     for (Int_t islat=0; islat<kNslats3; islat++) imax += kNPCB3[islat]; 
-     imax = 1; 
-     Float_t rmin = 40.;
-     Float_t shiftR = 0.;
-     for (Int_t idiv = 0;idiv < ndiv; idiv++){ 
-       ydiv += dydiv;
-       Float_t xdiv = 0.; 
-       if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
-       divpar[0] = (kPcbLength-xdiv-shiftR)/2.; 
-       divpar[1] = dydiv/2. - epsilon;
-       divpar[2] = kSensWidth/2.; 
-       Float_t xvol = (kPcbLength+xdiv)/2.+ shiftR;
-       Float_t yvol = ydiv + dydiv/2.;
-
-       for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
-        sprintf(idSlatCh9,"LE%d",ConvertSlatNum(1,quadrant,kNslats5-1));
-        sprintf(idSlatCh10,"LF%d",ConvertSlatNum(1,quadrant,kNslats5-1));
-
-        GetEnvelopes(8)->AddEnvelopeConstituentParam("S09G", idSlatCh9, quadrant*100+imax+4*idiv+1,
-                                                     TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
-        GetEnvelopes(9)->AddEnvelopeConstituentParam("S10G", idSlatCh10,  quadrant*100+imax+4*idiv+1,
-                                                     TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
-       }
-     }
-     // cout << "Geometry for Station 5...... done" << endl;
+    // create the sensitive volumes,
+
+    gMC->Gsvolu("S09G","BOX",kSensMaterial,dum,0);
+    gMC->Gsvolu("S10G","BOX",kSensMaterial,dum,0);
+
+    // create the vertical frame volume 
+
+    gMC->Gsvolu("S09V","BOX",kVframeMaterial,vFramepar,3);
+    gMC->Gsvolu("S10V","BOX",kVframeMaterial,vFramepar,3);
+
+    // create the horizontal frame volume 
+
+    gMC->Gsvolu("S09H","BOX",kHframeMaterial,hFramepar,3);
+    gMC->Gsvolu("S10H","BOX",kHframeMaterial,hFramepar,3);
+
+    // create the horizontal border volume 
+
+    gMC->Gsvolu("S09B","BOX",kBframeMaterial,bFramepar,3);
+    gMC->Gsvolu("S10B","BOX",kBframeMaterial,bFramepar,3);
+
+    index = 0; 
+    for (i = 0; i < kNslats5; i++){
+      for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
+
+       if (i == 0 && quadrant == 2) continue;
+       if (i == 0 && quadrant == 4) continue;
+
+       sprintf(idSlatCh9,"LE%d",ConvertSlatNum(i,quadrant,kNslats5-1));
+       sprintf(idSlatCh10,"LF%d",ConvertSlatNum(i,quadrant,kNslats5-1));
+       Float_t xvFrame  = (slatLength5[i] - kVframeLength)/2.; // ok
+
+       // position the vertical frames (spacers)
+       if (i != 1) { 
+         GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+         GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+       } else {  // no rounded spacer yet
+         GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         //       GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+         GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         //       GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+       }
+
+       // position the panels and the insulating material 
+       for (j = 0; j < kNPCB5[i]; j++){
+         if (i == 1 && j == 0) continue;
+         index++;
+         Float_t xx = kSensLength * (-kNPCB5[i]/2.+j+.5); 
+
+         Float_t zPanel = spar[2] - nomexbpar[2]; 
+         GetEnvelopes(8)->AddEnvelopeConstituent("S09X", idSlatCh9, 2*index-1,TGeoTranslation(xx,0.,zPanel));
+         GetEnvelopes(8)->AddEnvelopeConstituent("S09X", idSlatCh9, 2*index,TGeoTranslation(xx,0.,-zPanel));
+         GetEnvelopes(8)->AddEnvelopeConstituent("S09I", idSlatCh9, index,TGeoTranslation(xx,0.,0.));
+
+         GetEnvelopes(9)->AddEnvelopeConstituent("S10X", idSlatCh10, 2*index-1,TGeoTranslation(xx,0.,zPanel));
+         GetEnvelopes(9)->AddEnvelopeConstituent("S10X", idSlatCh10, 2*index,TGeoTranslation(xx,0.,-zPanel));
+         GetEnvelopes(9)->AddEnvelopeConstituent("S10I", idSlatCh10, index,TGeoTranslation(xx,0.,0.));
+       }
+      } 
+    }
+
+    // position the nomex volume inside the panel volume
+    gMC->Gspos("S09N",1,"S09C",0.,0.,0.,0,"ONLY"); 
+    gMC->Gspos("S10N",1,"S10C",0.,0.,0.,0,"ONLY"); 
+
+    // position panel  volume inside the bulk nomex material volume
+    gMC->Gspos("S09C",1,"S09X",0.,0.,kNomexBWidth/2.,0,"ONLY"); 
+    gMC->Gspos("S10C",1,"S10X",0.,0.,kNomexBWidth/2.,0,"ONLY"); 
+
+    // position the PCB volume inside the insulating material volume
+    gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY"); 
+    gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY"); 
+
+    // position the horizontal frame volume inside the PCB volume
+    gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY"); 
+    gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY"); 
+
+    // position the sensitive volume inside the horizontal frame volume
+    gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3); 
+    gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3); 
+
+    // position the border volumes inside the PCB volume
+    Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.; 
+    gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY"); 
+    gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY"); 
+    gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY"); 
+    gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY"); 
+
+    //      // create the NULOC volume and position it in the horizontal frame
+
+    gMC->Gsvolu("S09E","BOX",kNulocMaterial,nulocpar,3);
+    gMC->Gsvolu("S10E","BOX",kNulocMaterial,nulocpar,3);
+    index = 0;
+    for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) { 
+      index++; 
+      gMC->Gspos("S09E",2*index-1,"S09B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
+      gMC->Gspos("S09E",2*index  ,"S09B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
+      gMC->Gspos("S10E",2*index-1,"S10B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
+      gMC->Gspos("S10E",2*index  ,"S10B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
+    }
+
 
+    // position the volumes approximating the circular section of the pipe
+    Float_t epsilon = 0.001; 
+    Int_t ndiv = 10;
+    Int_t imax = 1; 
+    Double_t divpar[3];
+    Double_t dydiv = kSensHeight/ndiv;
+    Double_t ydiv  = (kSensHeight - dydiv)/2.;
+    Float_t rmin   = 39.5;
+    Float_t xdiv   = 0.; 
+    Float_t xvol;
+    Float_t yvol; 
+
+    for (Int_t idiv = 0; idiv < ndiv; idiv++){ 
+      ydiv += dydiv;
+      xdiv = 0.; 
+      if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
+      divpar[0] = (kPcbLength - xdiv)/2.; 
+      divpar[1] = dydiv/2. - epsilon;
+      divpar[2] = kSensWidth/2.; 
+      xvol = (kPcbLength + xdiv)/2.;
+      yvol = ydiv;
+
+      for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
+       sprintf(idSlatCh9,"LE%d",ConvertSlatNum(1,quadrant,kNslats5-1));
+       sprintf(idSlatCh10,"LF%d",ConvertSlatNum(1,quadrant,kNslats5-1));
+
+       GetEnvelopes(8)->AddEnvelopeConstituentParam("S09G", idSlatCh9, quadrant*100+imax+4*idiv+1,
+                                                    TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength,0.),3,divpar);
+       GetEnvelopes(9)->AddEnvelopeConstituentParam("S10G", idSlatCh10,  quadrant*100+imax+4*idiv+1,
+                                                    TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength,0.),3,divpar);
+      }
     }
+    // cout << "Geometry for Station 5...... done" << endl;
+
+  }
 }
 
 
index e282d87..c8ad0fa 100644 (file)
@@ -15,7 +15,6 @@
 #include "AliMUONChamber.h"
 #include "AliMUONChamberGeometry.h"
 #include "AliMUONGeometryEnvelopeStore.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONSt1GeometryBuilder)
 
@@ -44,7 +43,8 @@ AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder(const AliMUONSt1GeometryBui
 {
 // Protected copy constructor
 
-  AliFatal("Copy constructor is not implemented.");
+  Fatal("Copy constructor", 
+        "Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -61,7 +61,8 @@ AliMUONSt1GeometryBuilder::operator = (const AliMUONSt1GeometryBuilder& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  AliFatal("Assignment operator is not implemented.");
+  Fatal("operator=", 
+        "Assignment operator is not implemented.");
     
   return *this;  
 }
index 69d3a77..c177550 100644 (file)
@@ -55,7 +55,6 @@
 #include "AliMUONGeometryEnvelopeStore.h"
 #include "AliRun.h"
 #include "AliMagF.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONSt1GeometryBuilderV2)
 
@@ -143,7 +142,8 @@ AliMUONSt1GeometryBuilderV2::AliMUONSt1GeometryBuilderV2(const AliMUONSt1Geometr
 {
 // Dummy copy constructor
 
- AliFatal("Copy constructor is not implemented.");
+ Fatal("Copy constructor", 
+        "Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -160,7 +160,8 @@ AliMUONSt1GeometryBuilderV2::operator = (const AliMUONSt1GeometryBuilderV2& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  AliFatal("Assignment operator is not implemented.");
+  Fatal("operator=", 
+        "Assignment operator is not implemented.");
     
   return *this;  
 }
index 9ac5bd6..74353b0 100644 (file)
@@ -45,7 +45,6 @@
 #include "AliMUONSt1IniReader.h"
 #include "AliMUONSt1Decoder.h"
 #include "AliMUONTransientDigit.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONSt1Response);
 
@@ -118,7 +117,8 @@ AliMUONSt1Response::AliMUONSt1Response(const AliMUONSt1Response& rhs)
 {
 // Copy constructor
 
-  AliFatal("Copy constructor is not implemented.");
+  Fatal("Copy constructor", 
+        "Copy constructor is not implemented.");
 }
 
 //__________________________________________________________________________
@@ -146,7 +146,8 @@ AliMUONSt1Response::operator=(const AliMUONSt1Response& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  AliFatal("Assignment operator is not implemented.");
+  Fatal("operator=", 
+        "Assignment operator is not implemented.");
     
   return *this;  
 }
@@ -173,7 +174,7 @@ void AliMUONSt1Response::ReadCouplesOfIntRanges(const string& value,
     StringVector lst = decoder::SplitList(lstCpl[n],","); 
                                               // should have 2 elements
     if (lst.size() != 2) {
-      AliWarning("Bad pad definition");
+      Warning("ReadIniFile","Bad pad definition");
       continue;
     }
     IntPairVector lst1 = decoder::DecodeListOfIntRanges(lst[0],";");
@@ -205,7 +206,7 @@ void AliMUONSt1Response::ReadCouplesOfFloatRanges(const string& value,
     StringVector lst = decoder::SplitList(lstCpl[n],","); 
                                               // should have 2 elements
     if (lst.size() != 2) {
-      AliWarning("Bad pad definition");
+      Warning("ReadIniFile","Bad pad definition");
       continue;
     }
     DoublePairVector lst1 = decoder::DecodeListOfFloatRanges(lst[0],";");
@@ -310,7 +311,8 @@ void AliMUONSt1Response::ReadIniFile(Int_t plane)
   TString path = fgkTopDir + fgkDataDir ;
   //read .ini file
   if (gSystem->AccessPathName(path+fIniFileName[plane],kReadPermission)){
-    AliFatal(Form("Unable to Read the file %s",fIniFileName[plane].Data()));
+    Fatal("ReadIniFile",
+          Form("Unable to Read the file %s",fIniFileName[plane].Data()));
     return;
   }
   fRegions.clear();
@@ -418,7 +420,7 @@ void AliMUONSt1Response::ReadIniFile(Int_t plane,const TString& fileName,
             while ((el = static_cast<AliMUONSt1ElectronicElement*>(next()))){
               rule->AddElement(el);
             }
-          } else AliWarning(Form("Can't find region named %s",value.c_str()));
+          } else Warning("ReadIniFile",Form("Can't find region named %s",value.c_str()));
         }
       }
       for (itValue = vals.begin() ; itValue != vals.end(); ++itValue){
@@ -432,7 +434,7 @@ void AliMUONSt1Response::ReadIniFile(Int_t plane,const TString& fileName,
               fDefaultParameters[plane][i]=param;
             }
             if (rule) rule->AddParameter(param);
-          } else AliWarning(Form("Can't find parameter named %s",value.c_str()));
+          } else Warning("ReadIniFile",Form("Can't find parameter named %s",value.c_str()));
         }
       }
       if (rule) fRulesList[plane].AddFirst(rule);
index 2017852..3d519b3 100644 (file)
@@ -31,7 +31,6 @@
 #include <TString.h>
 
 #include "AliMUONSt1ResponseParameter.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONSt1ResponseParameter);
 
@@ -111,7 +110,7 @@ void AliMUONSt1ResponseParameter::SetPedestal(const TString& fileName)
     }
     file.close();
   } else {
-    AliWarning(Form("Can't read file %s",fileName.Data()));
+    Warning("SetPedestal",Form("Can't read file %s",fileName.Data()));
     SetPedestal(150.,10.);
   }
 }
@@ -163,7 +162,7 @@ void AliMUONSt1ResponseParameter::SetNoise(const TString& fileName)
     }
     file.close();
   } else {
-    AliWarning(Form("Can't read file %s",fileName.Data()));
+    Warning("SetNoise",Form("Can't read file %s",fileName.Data()));
     SetNoise(150.,10.);
   }
 }
@@ -239,6 +238,6 @@ Double_t AliMUONSt1ResponseParameter::Choose(TMode mode,TParam param,Int_t GC) c
     case kGauss : return gRandom->Gaus(param.gauss.mean,param.gauss.sigma);
     case kFile  : return param.values[GC];
   }
-  AliFatal("No mode is given");
+  Fatal("Choose","No mode is given");
   return 0;
 }
index 77c7cf3..d95277b 100644 (file)
@@ -30,6 +30,7 @@
 #include "AliMUONSt1ResponseRule.h"
 #include "AliMUONSt1ElectronicElement.h"
 #include "AliMUONSt1ResponseParameter.h"
+
 ClassImp(AliMUONSt1ResponseRule);
 
 //__________________________________________________________________________
index f975bd3..b1c1004 100644 (file)
@@ -37,7 +37,6 @@
 #include "AliRun.h"
 #include "AliMUON.h"
 #include "AliMUONChamber.h"
-#include "AliLog.h"
 
 ClassImp(AliMUONSt1Segmentation)
 
@@ -113,7 +112,8 @@ AliMUONSt1Segmentation::AliMUONSt1Segmentation(const AliMUONSt1Segmentation& rhs
   : AliSegmentation(rhs)
 {
 // Copy constructor
-  AliFatal("Copy constructor is not implemented.");
+  Fatal("Copy constructor", 
+        "Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -138,7 +138,8 @@ AliMUONSt1Segmentation::operator=(const AliMUONSt1Segmentation& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  AliFatal("Assignment operator is not implemented.");
+  Fatal("operator=", 
+        "Assignment operator is not implemented.");
     
   return *this;  
 }
@@ -170,7 +171,7 @@ void AliMUONSt1Segmentation::SetPadSize(Float_t /*p1*/, Float_t /*p2*/)
 // Set pad size Dx*Dy 
 // ---
 
-  AliFatal("Not uniform pad size.");
+  Fatal("SetPadSize", "Not uniform pad size.");
 }
 
 //______________________________________________________________________________
@@ -270,7 +271,7 @@ Float_t AliMUONSt1Segmentation::Dpx() const
 // Get pad size in x
 // ---
 
-  AliFatal( "Not uniform pad size.");
+  Fatal("Dpx", "Not uniform pad size.");
   return 0.;
 }
 
@@ -280,7 +281,7 @@ Float_t AliMUONSt1Segmentation::Dpy() const
 // Get pad size in y
 // ---
 
-  AliFatal("Not uniform pad size.");
+  Fatal("Dpy", "Not uniform pad size.");
   return 0.;
 }
  
@@ -408,7 +409,7 @@ Float_t AliMUONSt1Segmentation::Distance2AndOffset(Int_t iX, Int_t iY,
   AliMpPad pad = fPlaneSegmentation->PadByIndices(AliMpIntPair(iX, iY));
   
   if (!pad.IsValid())
-    AliFatal("Cannot locate pad.");
+    Fatal("Distance2AndOffset", "Cannot locate pad.");
 
   return (pad.Position()*fgkLengthUnit - TVector2(x, y)).Mod2();
 }
@@ -421,7 +422,7 @@ void AliMUONSt1Segmentation::GetNParallelAndOffset(Int_t /*iX*/, Int_t /*iY*/,
 // (specific to LYON, but mandatory for display)
 // ---
 
-  AliFatal( "Not yet implemented.");
+  Fatal("GetNParallelAndOffset", "Not yet implemented.");
 }
 
 
@@ -580,7 +581,7 @@ void AliMUONSt1Segmentation::Draw(const char * /*opt*/)&nb