Logging of Debug, Info and Error Messages follwing AliRoot Standard http://aliweb...
authormartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Oct 2004 09:57:39 +0000 (09:57 +0000)
committermartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Oct 2004 09:57:39 +0000 (09:57 +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 651467d..74f787d 100644 (file)
@@ -64,6 +64,7 @@
 #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
@@ -179,14 +180,14 @@ AliMUON::AliMUON(const AliMUON& rMUON)
 {
 // Protected copy constructor
 
-  Fatal("AliMUONMergerModule", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 //____________________________________________________________________
 AliMUON::~AliMUON()
 {
 // Destructor
-  if(fDebug) printf("%s: Calling AliMUON destructor !!!\n",ClassName());
+  AliDebug(1,"Calling AliMUON destructor");
   fIshunt  = 0;
   if (fMerger) delete fMerger;
 
@@ -209,7 +210,7 @@ AliMUON& AliMUON::operator = (const AliMUON& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }
@@ -431,11 +432,9 @@ void AliMUON::SDigits2Digits()
 // write TreeD here 
 
     if (!fMerger) {
-      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();
+               AliDebug(1,"Create default AliMUONMerger ");
+               AliDebug(1," no merging, just digitization of 1 event will be done");
+       fMerger = new AliMUONMerger();
     }
     fMerger->Init();
     fMerger->Digitise();
@@ -467,7 +466,7 @@ void AliMUON::Digits2Raw()
   AliMUONRawData* rawData;
 
   rawData = new AliMUONRawData(fLoader);
-  if (!rawData->WriteRawData()) Info("MUON","pb writting raw data");
+  if (!rawData->WriteRawData()) AliInfo("pb writting raw data");
   delete rawData;
   return;
 }
@@ -477,10 +476,9 @@ AliLoader* AliMUON::MakeLoader(const char* topfoldername)
 //builds standard getter (AliLoader type)
 //if detector wants to use castomized getter, it must overload this method
 
- if (GetDebug())
-   Info("MakeLoader",
-        "Creating standard getter for detector %s. Top folder is %s.",
-         GetName(),topfoldername);
+ AliDebug(1,Form("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 710005f..68e78d3 100644 (file)
@@ -22,6 +22,7 @@
 // --- MUON includes ---
 #include "AliMUONChamber.h"
 #include "AliMUONChamberGeometry.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONChamber)       
 
@@ -71,7 +72,7 @@ AliMUONChamber::AliMUONChamber(const AliMUONChamber& rChamber)
 {
 // Protected copy constructor
 
-  Fatal("AliMUONMergerModule", "Not implemented.");
+  AliFatal("Not implemented.");
  // Dummy copy constructor
 }
 
@@ -91,7 +92,7 @@ AliMUONChamber & AliMUONChamber::operator =(const AliMUONChamber& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }
@@ -208,7 +209,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.
                {
-                       Error("DisIntegration", "Limit of 500 pad responses reached.");
+                       AliError("Limit of 500 pad responses reached.");
                        return;
                };
                //
index 93ef7d3..1690c00 100644 (file)
@@ -17,6 +17,7 @@
 #include "AliMUONGeometryEnvelopeStore.h"
 #include "AliMUONGeometryTransformStore.h"     
 #include "AliMUONConstants.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONChamberGeometry)
 
@@ -73,8 +74,7 @@ AliMUONChamberGeometry::AliMUONChamberGeometry()
 AliMUONChamberGeometry::AliMUONChamberGeometry(const AliMUONChamberGeometry& rhs)
   : TObject(rhs)
 {
-  Fatal("Copy constructor", 
-        "Copy constructor is not implemented.");
+  AliFatal("Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -95,8 +95,7 @@ AliMUONChamberGeometry::operator = (const AliMUONChamberGeometry& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  Fatal("operator=", 
-        "Assignment operator is not implemented.");
+  AliFatal("Assignment operator is not implemented.");
     
   return *this;  
 }
index 289ea24..57f73fd 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 e653dab..fa2c0ef 100644 (file)
@@ -41,6 +41,7 @@
 #include "AliMUONClusterInput.h"
 #include "AliMUONPixel.h"
 #include "AliMC.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONClusterFinderAZ)
  
@@ -79,7 +80,7 @@ AliMUONClusterFinderAZ::AliMUONClusterFinderAZ(const AliMUONClusterFinderAZ& rhs
 {
 // Protected copy constructor
 
-  Fatal("AliMUONClusterFinderAZModule", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 //_____________________________________________________________________________
@@ -157,8 +158,7 @@ newev:
       muon->ResetRawClusters();
       nent = (Int_t) treeR->GetEntries();
       if (nent != 1) {
-       cout << "Error in MUONdrawClust" << endl;
-       cout << " nent = " <<  nent << " not equal to 1" << endl;
+               AliError(Form("nent = %d not equal to 1",nent));
        //exit(0);
       }
     } // if (treeR)
@@ -2499,7 +2499,7 @@ AliMUONClusterFinderAZ::operator=(const AliMUONClusterFinderAZ& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }    
index f27e356..a2c713a 100644 (file)
@@ -25,6 +25,7 @@
 #include "AliMUONResponse.h"
 #include "AliMUONClusterInput.h"
 #include "AliMUONHitMapA1.h"
+#include "AliLog.h"
 
 //_____________________________________________________________________
 // This function is minimized in the double-Mathieson fit
@@ -70,7 +71,7 @@ AliMUONClusterFinderVS::AliMUONClusterFinderVS(const AliMUONClusterFinderVS & cl
 {
 // Protected copy constructor
 
-  Fatal("AliMUONClusterFinderAZModule", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 //____________________________________________________________________________
 void AliMUONClusterFinderVS::ResetRawClusters()
@@ -146,16 +147,14 @@ void AliMUONClusterFinderVS::SplitByLocalMaxima(AliMUONRawCluster *c)
            fXInit[0]=c->GetX(1);
            fYInit[0]=c->GetY(1);
        }
-       if (fDebugLevel)
-           fprintf(stderr,"\n cas (1) CombiSingleMathiesonFit(c)\n");
+       AliDebug(1,"cas (1) CombiSingleMathiesonFit(c)");
        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;
-       if (fDebugLevel)
-           fprintf(stderr," chi2 %f ",chi2);
+       AliDebug(1,Form(" chi2 %f ",chi2));        
 
        c->SetX(0, fXFit[0]);
        c->SetY(0, fYFit[0]);
@@ -204,16 +203,13 @@ void AliMUONClusterFinderVS::SplitByLocalMaxima(AliMUONRawCluster *c)
 //         chi2_2->Fill(chi2);
            
 // Was this any better ??
-           if (fDebugLevel)
-             fprintf(stderr," Old and new chi2 %f %f ", oldchi2, chi2);
+           AliDebug(1,Form(" Old and new chi2 %f %f ", oldchi2, chi2));
            if (fFitStat!=0 && chi2>0 && (2.*chi2 < oldchi2)) {
-             if (fDebugLevel)
-               fprintf(stderr," Split\n");
+             AliDebug(1,"Split");
                // Split cluster into two according to fit result
                Split(c);
            } else {
-             if (fDebugLevel)
-               fprintf(stderr," Don't Split\n");
+             AliDebug(1,"Do not Split");
                // Don't split
                AddRawCluster(*c);
            }
@@ -354,39 +350,37 @@ 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]){
-               if (fDebugLevel) fprintf(stderr,"ico=0\n");
+               AliDebug(1,"ico=0");
                fXInit[0]=xm[0][1];
                fYInit[0]=ym[0][0];
                fXInit[1]=xm[3][0];
                fYInit[1]=ym[3][0];
            } else if (accepted[1]){
-               if (fDebugLevel) fprintf(stderr,"ico=1\n");
+               AliDebug(1,"ico=1");
                fXInit[0]=xm[1][1];
                fYInit[0]=ym[1][0];
                fXInit[1]=xm[2][0];
                fYInit[1]=ym[2][0];
            } else if (accepted[2]){
-               if (fDebugLevel) fprintf(stderr,"ico=2\n");
+               AliDebug(1,"ico=2");
                fXInit[0]=xm[2][1];
                fYInit[0]=ym[2][0];
                fXInit[1]=xm[1][0];
                fYInit[1]=ym[1][0];
            } else if (accepted[3]){
-               if (fDebugLevel) fprintf(stderr,"ico=3\n");
+               AliDebug(1,"ico=3");
                fXInit[0]=xm[3][1];
                fYInit[0]=ym[3][0];
                fXInit[1]=xm[0][0];
                fYInit[1]=ym[0][0];
            }
-           if (fDebugLevel)
-               fprintf(stderr,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
+               AliDebug(1,"cas (2) CombiDoubleMathiesonFit(c)");
            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);
-           if (fDebugLevel)
-               fprintf(stderr," chi2 %f\n",chi2);
+           AliDebug(1,Form(" chi2 %f\n",chi2));
 
 // If reasonable chi^2 add result to the list of rawclusters
            if (chi2<10) {
@@ -396,32 +390,31 @@ 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]){
-                   if (fDebugLevel) fprintf(stderr,"ico=0\n");
+                       AliDebug(1,"ico=0");
                    fXInit[0]=xm[0][1];
                    fYInit[0]=ym[0][0];
                    fXInit[1]=xm[3][1];
                    fYInit[1]=ym[3][1];
                } else if (accepted[1]){
-                   if (fDebugLevel) fprintf(stderr,"ico=1\n");
+                       AliDebug(1,"ico=1");
                    fXInit[0]=xm[1][1];
                    fYInit[0]=ym[1][0];
                    fXInit[1]=xm[2][1];
                    fYInit[1]=ym[2][1];
                } else if (accepted[2]){
-                   if (fDebugLevel) fprintf(stderr,"ico=2\n");
+                       AliDebug(1,"ico=2");
                    fXInit[0]=xm[2][1];
                    fYInit[0]=ym[2][0];
                    fXInit[1]=xm[1][1];
                    fYInit[1]=ym[1][1];
                } else if (accepted[3]){
-                   if (fDebugLevel) fprintf(stderr,"ico=3\n");
+                       AliDebug(1,"ico=3");
                    fXInit[0]=xm[3][1];
                    fYInit[0]=ym[3][0];
                    fXInit[1]=xm[0][1];
                    fYInit[1]=ym[0][1];
                }
-               if (fDebugLevel)
-                   fprintf(stderr,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
+               AliDebug(1,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
                chi2=CombiDoubleMathiesonFit(c);
 //             Int_t ndf = fgNbins[0]+fgNbins[1]-6;
 //             Float_t prob = TMath::Prob(chi2,ndf);
@@ -2108,7 +2101,7 @@ AliMUONClusterFinderVS& AliMUONClusterFinderVS
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }
index 0b0b54f..60bbf5c 100644 (file)
@@ -25,6 +25,7 @@
 #include "AliMUONResponse.h"
 #include "AliMUONRawCluster.h"
 #include "AliMUONDigit.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONClusterInput)
 
@@ -65,7 +66,7 @@ AliMUONClusterInput::AliMUONClusterInput(const AliMUONClusterInput& clusterInput
 {
 // Protected copy constructor
 
-  Fatal("AliMUONClusterInput", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig1, TClonesArray* dig2)
@@ -222,7 +223,7 @@ AliMUONClusterInput& AliMUONClusterInput
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }
index 9395478..9abd297 100644 (file)
@@ -35,6 +35,7 @@
 #include "AliMUONClusterInput.h"
 #include "AliMUONRawCluster.h"
 #include "AliRawReader.h" // for raw data
+#include "AliLog.h"
 
 
 const Int_t AliMUONClusterReconstructor::fgkDefaultPrintLevel = 0;
@@ -104,7 +105,7 @@ AliMUONClusterReconstructor::AliMUONClusterReconstructor (const AliMUONClusterRe
 {
 // Protected copy constructor
 
-  Fatal("AliMUONClusterReconstructor", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 //_______________________________________________________________________
@@ -115,7 +116,7 @@ AliMUONClusterReconstructor::operator=(const AliMUONClusterReconstructor& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }
@@ -158,8 +159,7 @@ void AliMUONClusterReconstructor::Digits2Clusters()
        //TClonesArray *
        muonDigits = fMUONData->Digits(ich); 
        ndig=muonDigits->GetEntriesFast();
-       if(fDebug)
-         printf("1 Found %d digits in %p chamber %d\n", ndig, (void*)muonDigits,ich);
+       AliDebug(1,Form("1 Found %d digits in %p chamber %d", ndig, (void*)muonDigits,ich));
        TClonesArray &lhits1 = *dig1;
        Int_t n = 0;
        for (k = 0; k < ndig; k++) {
@@ -171,8 +171,7 @@ void AliMUONClusterReconstructor::Digits2Clusters()
        fMUONData->GetCathode(1);
        muonDigits =  fMUONData->Digits(ich);  
        ndig=muonDigits->GetEntriesFast();
-       if(fDebug)
-         printf("\n 2 Found %d digits in %p %d", ndig, (void*)muonDigits, ich);
+       AliDebug(1,Form("2 Found %d digits in %p %d", ndig, (void*)muonDigits, ich));
        TClonesArray &lhits2 = *dig2;
        n=0;
        
@@ -205,5 +204,5 @@ void AliMUONClusterReconstructor::Digits2Clusters(AliRawReader* /*rawReader*/)
 
 //  Perform cluster finding form raw data
 
-   Fatal("Digits2Clusters","clusterization not implemented for raw data input");
+   AliFatal("clusterization not implemented for raw data input");
 }
index e66a0ed..7d714b1 100644 (file)
@@ -17,7 +17,6 @@
 
 #include "AliMUONConstants.h"
 
-
 ClassImp(AliMUONConstants)
 
 Int_t   AliMUONConstants::fgNCh = 14;
@@ -27,14 +26,9 @@ 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, // 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::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::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 1af0eb3..acb3693 100644 (file)
@@ -30,10 +30,6 @@ 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); 
@@ -53,10 +49,6 @@ 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 bbb70fd..28682b8 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 f756c67..6488c6f 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 dd02c28..b3d852b 100644 (file)
@@ -32,6 +32,7 @@
 #include "AliMUONRawCluster.h"
 #include "AliMUONTrack.h"
 #include "AliMUONTriggerTrack.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONData)
  
@@ -112,7 +113,7 @@ AliMUONData::AliMUONData(const AliMUONData& rMUONData):TNamed(rMUONData)
 {
 // Protected copy constructor
 
-  Fatal("AliMUONData", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 //_____________________________________________________________________________
@@ -161,7 +162,7 @@ AliMUONData& AliMUONData::operator=(const AliMUONData& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }    
@@ -322,7 +323,7 @@ Bool_t   AliMUONData::IsRawClusterBranchesInTree()
 {
   // Checking if there are RawCluster Branches In TreeR
   if (TreeR()==0x0) {
-    Error("TreeR","No treeR in memory");
+    AliError("No treeR in memory");
     return kFALSE;
   }
   else {
@@ -339,7 +340,7 @@ Bool_t   AliMUONData::IsDigitsBranchesInTree()
 {
   // Checking if there are RawCluster Branches In TreeR
   if (TreeD()==0x0) {
-    Error("TreeD","No treeD in memory");
+    AliError("No treeD in memory");
     return kFALSE;
   }
   else {
@@ -356,7 +357,7 @@ Bool_t   AliMUONData::IsTriggerBranchesInTree()
 {
   // Checking if there are Trigger Branches In TreeR
  if (TreeR()==0x0) {
-    Error("TreeR","No treeR in memory");
+    AliError("No treeR in memory");
     return kFALSE;
   }
   else {
@@ -373,7 +374,7 @@ Bool_t   AliMUONData::IsTriggerBranchesInTreeD()
 {
   // Checking if there are Trigger Branches In TreeR
  if (TreeD()==0x0) {
-    Error("TreeD","No treeD in memory");
+    AliError("No treeD in memory");
     return kFALSE;
   }
   else {
@@ -391,7 +392,7 @@ Bool_t   AliMUONData::IsTrackBranchesInTree()
 {
   // Checking if there are Track Branches In TreeT
   if (TreeT()==0x0) {
-    Error("TreeT","No treeT in memory");
+    AliError("No treeT in memory");
     return kFALSE;
   }
   else {
@@ -408,7 +409,7 @@ Bool_t   AliMUONData::IsTriggerTrackBranchesInTree()
 {
   // Checking if there are TriggerTrack Branches In TreeT
   if (TreeT()==0x0) {
-    Error("TreeT","No treeT in memory");
+    AliError("No treeT in memory");
     return kFALSE;
   }
   else {
@@ -561,7 +562,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     sprintf(branchname,"%sHits",GetName());  
     branch = TreeH()->GetBranch(branchname);
     if (branch) {  
-      Info("MakeBranch","Branch %s is already in tree.",GetName());
+      AliInfo(Form("MakeBranch","Branch %s is already in tree.",GetName()));
       return ;
     }
     branch = TreeH()->Branch(branchname,&fHits,kBufferSize);
@@ -590,7 +591,7 @@ void AliMUONData::MakeBranch(Option_t* option)
       branch = 0x0;
       branch = TreeD()->GetBranch(branchname);
       if (branch) {  
-       Info("MakeBranch","Branch %s is already in tree.",GetName());
+       AliInfo(Form("Branch %s is already in tree.",GetName()));
        return;
       }
       TClonesArray * digits = Digits(iDetectionPlane); 
@@ -612,7 +613,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     }
     branch = TreeD()->GetBranch(branchname);
     if (branch) {  
-      Info("MakeBranch","Branch GlobalTrigger is already in treeD.");
+      AliInfo(Form("Branch GlobalTrigger is already in treeD."));
       return ;
     }
     branch = TreeD()->Branch(branchname, &fGlobalTrigger, kBufferSize);
@@ -630,7 +631,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     }
     branch = TreeD()->GetBranch(branchname);
     if (branch) {  
-      Info("MakeBranch","Branch LocalTrigger is already in treeD.");
+      AliInfo(Form("Branch LocalTrigger is already in treeD."));
       return;
     }
     branch = TreeD()->Branch(branchname, &fLocalTrigger, kBufferSize);
@@ -660,7 +661,7 @@ void AliMUONData::MakeBranch(Option_t* option)
       branch = 0x0;
       branch = TreeS()->GetBranch(branchname);
       if (branch) {  
-       Info("MakeBranch","Branch %s is already in tree.",GetName());
+       AliInfo(Form("Branch %s is already in tree.",GetName()));
        return;
       }
       TClonesArray * sdigits = SDigits(iDetectionPlane); 
@@ -694,7 +695,7 @@ void AliMUONData::MakeBranch(Option_t* option)
       branch = 0x0;
       branch = TreeR()->GetBranch(branchname);
       if (branch) {  
-       Info("MakeBranch","Branch %s is already in tree.",GetName());
+       AliInfo(Form("Branch %s is already in tree.",GetName()));
        return;
       }
       branch = TreeR()->Branch(branchname, &((*fRawClusters)[i]),kBufferSize);
@@ -715,7 +716,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     }
     branch = TreeR()->GetBranch(branchname);
     if (branch) {  
-      Info("MakeBranch","Branch GlobalTrigger is already in treeR.");
+      AliInfo(Form("Branch GlobalTrigger is already in treeR."));
       return ;
     }
     branch = TreeR()->Branch(branchname, &fGlobalTrigger, kBufferSize);
@@ -733,7 +734,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     }
     branch = TreeR()->GetBranch(branchname);
     if (branch) {  
-      Info("MakeBranch","Branch LocalTrigger is already in treeR.");
+      AliInfo(Form("Branch LocalTrigger is already in treeR."));
       return;
     }
     branch = TreeR()->Branch(branchname, &fLocalTrigger, kBufferSize);
@@ -746,7 +747,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     sprintf(branchname,"%sTrack",GetName());  
     branch = TreeT()->GetBranch(branchname);
     if (branch) {  
-      Info("MakeBranch","Branch %s is already in tree.",GetName());
+      AliInfo(Form("Branch %s is already in tree.",GetName()));
       return ;
     }
     branch = TreeT()->Branch(branchname,&fRecTracks,kBufferSize);
@@ -759,7 +760,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     sprintf(branchname,"%sTriggerTrack",GetName());  
     branch = TreeT()->GetBranch(branchname);
     if (branch) {  
-      Info("MakeBranch","Branch %s is already in tree.",GetName());
+      AliInfo(Form("Branch %s is already in tree.",GetName()));
       return ;
     }
     branch = TreeT()->Branch(branchname,&fRecTriggerTracks,kBufferSize);
@@ -893,7 +894,7 @@ void AliMUONData::SetTreeAddress(Option_t* option)
       branch->SetAddress(&fHits);
     }
     else { //can be invoked before branch creation
-      Warning("SetTreeAddress","(%s) Failed for Hits. Can not find branch in tree.",GetName());
+      AliWarning(Form("(%s) Failed for Hits. Can not find branch in tree.",GetName()));
     }
   }
   
@@ -925,7 +926,7 @@ void AliMUONData::SetTreeAddress(Option_t* option)
        if (branch) {
          branch->SetAddress( &digits );
        }
-       else Warning("SetTreeAddress","(%s) Failed for Digits Detection plane %d. Can not find branch in tree.",GetName(),i);
+       else AliWarning(Form("(%s) Failed for Digits Detection plane %d. Can not find branch in tree.",GetName(),i));
       }
     }
   }
@@ -933,13 +934,13 @@ void AliMUONData::SetTreeAddress(Option_t* option)
     sprintf(branchname,"%sLocalTrigger",GetName());
     branch = TreeD()->GetBranch(branchname);
     if (branch) branch->SetAddress(&fLocalTrigger);
-    else Warning("SetTreeAddress","(%s) Failed for LocalTrigger. Can not find branch in treeD.",GetName());
+    else AliWarning(Form("(%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 Warning("SetTreeAddress","(%s) Failed for GlobalTrigger. Can not find branch in treeD.",GetName());
+    else AliWarning(Form("(%s) Failed for GlobalTrigger. Can not find branch in treeD.",GetName()));
   }
 
   //
@@ -962,7 +963,7 @@ void AliMUONData::SetTreeAddress(Option_t* option)
        branch = TreeS()->GetBranch(branchname);
        TClonesArray * sdigits = SDigits(i);
        if (branch) branch->SetAddress( &sdigits );
-       else Warning("SetTreeAddress","(%s) Failed for SDigits Detection plane %d. Can not find branch in tree.",GetName(),i);
+       else AliWarning(Form("(%s) Failed for SDigits Detection plane %d. Can not find branch in tree.",GetName(),i));
       }
     }
   }
@@ -992,7 +993,7 @@ void AliMUONData::SetTreeAddress(Option_t* option)
       if (fRawClusters) {
        branch = TreeR()->GetBranch(branchname);
        if (branch) branch->SetAddress( &((*fRawClusters)[i]) );
-       else Warning("SetTreeAddress","(%s) Failed for RawClusters Detection plane %d. Can not find branch in tree.",GetName(),i);
+       else AliWarning(Form("(%s) Failed for RawClusters Detection plane %d. Can not find branch in tree.",GetName(),i));
       }
     }
   }
@@ -1000,13 +1001,13 @@ void AliMUONData::SetTreeAddress(Option_t* option)
     sprintf(branchname,"%sLocalTrigger",GetName());
     branch = TreeR()->GetBranch(branchname);
     if (branch) branch->SetAddress(&fLocalTrigger);
-    else Warning("SetTreeAddress","(%s) Failed for LocalTrigger. Can not find branch in treeR.",GetName());
+    else AliWarning(Form("(%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 Warning("SetTreeAddress","(%s) Failed for GlobalTrigger. Can not find branch in treeR.",GetName());
+    else AliWarning(Form("(%s) Failed for GlobalTrigger. Can not find branch in treeR.",GetName()));
   }
 
   if ( TreeT() ) {
@@ -1019,7 +1020,7 @@ void AliMUONData::SetTreeAddress(Option_t* option)
     sprintf(branchname,"%sTrack",GetName());  
     branch = TreeT()->GetBranch(branchname);
     if (branch) branch->SetAddress(&fRecTracks);
-    else Warning("SetTreeAddress","(%s) Failed for Tracks. Can not find branch in tree.",GetName());
+    else AliWarning(Form("(%s) Failed for Tracks. Can not find branch in tree.",GetName()));
   }
 // trigger tracks
   if ( TreeT() ) {
@@ -1032,7 +1033,7 @@ void AliMUONData::SetTreeAddress(Option_t* option)
     sprintf(branchname,"%sTriggerTrack",GetName());  
     branch = TreeT()->GetBranch(branchname);
     if (branch) branch->SetAddress(&fRecTriggerTracks);
-    else Warning("SetTreeAddress","(%s) Failed for Trigger Tracks. Can not find branch in tree.",GetName());
+    else AliWarning(Form("(%s) Failed for Trigger Tracks. Can not find branch in tree.",GetName()));
   }
 
 
index f1a10d8..2bfa83b 100644 (file)
@@ -13,6 +13,7 @@
 #include "AliMUONHit.h"
 #include "AliMUONDigit.h"
 #include "AliMUONRawCluster.h"
+#include "AliLog.h"
 
 
 ClassImp(AliMUONDataInterface)
@@ -31,7 +32,7 @@ AliMUONDataInterface::AliMUONDataInterface(const AliMUONDataInterface& rhs)
 {
 // Protected copy constructor
 
-  Fatal("AliMUONDataInterface", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 AliMUONDataInterface::~AliMUONDataInterface()
@@ -51,7 +52,7 @@ AliMUONDataInterface::operator=(const AliMUONDataInterface& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }    
@@ -85,15 +86,15 @@ Bool_t AliMUONDataInterface::LoadLoaders(TString filename, TString foldername)
        fRunloader = AliRunLoader::Open(filename, foldername, "READ");
        if (fRunloader == NULL)
        {
-               Error("LoadLoaders", "Could not find or load the run loader for the file: %s and folder: %s", 
-                       (const char*)filename, (const char*)foldername);
+               AliError(Form("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)
        {
-               Error("LoadLoaders", "Could not find the MUON loader in file: %s and folder: %s", 
-                       (const char*)filename, (const char*)foldername);
+               AliError(Form("Could not find the MUON loader in file: %s and folder: %s", 
+                       (const char*)filename, (const char*)foldername));
                fRunloader = NULL;
                return kFALSE;
        };
@@ -182,7 +183,7 @@ Bool_t AliMUONDataInterface::FetchTreeK()
                fRunloader->LoadKinematics("READ");
                if (fRunloader->TreeK() == NULL)
                {
-                       Error("FetchTreeK", "Could not load TreeK.");
+                       AliError("Could not load TreeK.");
                        return kFALSE;
                };
        };
@@ -200,7 +201,7 @@ Bool_t AliMUONDataInterface::FetchTreeH()
                fMuonloader->LoadHits("READ");
                if (fMuonloader->TreeH() == NULL)
                {
-                       Error("FetchTreeH", "Could not load TreeH.");
+                       AliError("Could not load TreeH.");
                        return kFALSE;
                };
                fData.SetTreeAddress("H");
@@ -225,7 +226,7 @@ Bool_t AliMUONDataInterface::FetchTreeS()
                fMuonloader->LoadSDigits("READ");
                if (fMuonloader->TreeS() == NULL)
                {
-                       Error("FetchTreeS", "Could not load TreeS.");
+                       AliError("Could not load TreeS.");
                        return kFALSE;
                };
                fData.SetTreeAddress("S");
@@ -250,7 +251,7 @@ Bool_t AliMUONDataInterface::FetchTreeD()
                fMuonloader->LoadDigits("READ");
                if (fMuonloader->TreeD() == NULL)
                {
-                       Error("FetchTreeD", "Could not load TreeD.");
+                       AliError("Could not load TreeD.");
                        return kFALSE;
                };
                fData.SetTreeAddress("D");
@@ -275,7 +276,7 @@ Bool_t AliMUONDataInterface::FetchTreeR()
                fMuonloader->LoadRecPoints("READ");
                if (fMuonloader->TreeR() == NULL)
                {
-                       Error("FetchTreeR", "Could not load TreeR.");
+                       AliError("Could not load TreeR.");
                        return kFALSE;
                };
                
@@ -595,7 +596,7 @@ Int_t AliMUONDataInterface::NumberOfEvents()
 
        if (fRunloader == NULL)
        {
-               Error("NumberOfEvents", "File not set.");
+               AliError("File not set.");
                return -1;
        };
        return fRunloader->GetNumberOfEvents();
@@ -609,7 +610,7 @@ Int_t AliMUONDataInterface::NumberOfParticles()
 
        if (fRunloader == NULL)
        {
-               Error("NumberOfParticles", "File not set.");
+               AliError("File not set.");
                return -1;
        };
        if ( ! FetchTreeK() ) return -1;
@@ -624,12 +625,12 @@ TParticle* AliMUONDataInterface::Particle(Int_t particle)
 
        if (fRunloader == NULL)
        {
-               Error("Particle", "File not set.");
+               AliError("File not set.");
                return NULL;
        };
        if (fEventnumber < 0)
        {
-               Error("Particle", "Event not chosen.");
+               AliError("Event not chosen.");
                return NULL;
        };
        if ( ! FetchTreeK() ) return NULL;
@@ -648,12 +649,12 @@ Int_t AliMUONDataInterface::NumberOfTracks()
 
        if (fRunloader == NULL)
        {
-               Error("NumberOfTracks", "File not set.");
+               AliError("File not set.");
                return -1;
        };
        if (fEventnumber < 0)
        {
-               Error("NumberOfTracks", "Event not chosen.");
+               AliError( "Event not chosen.");
                return -1;
        };
        if ( ! FetchTreeH() ) return -1;
@@ -668,12 +669,12 @@ Int_t AliMUONDataInterface::NumberOfHits(Int_t track)
 
        if (fRunloader == NULL)
        {
-               Error("NumberOfHits", "File not set.");
+               AliError("File not set.");
                return -1;
        };
        if (fEventnumber < 0)
        {
-               Error("NumberOfHits", "Event not chosen.");
+               AliError("Event not chosen.");
                return -1;
        };
        if ( ! FetchTreeH() ) return -1;
@@ -694,12 +695,12 @@ AliMUONHit* AliMUONDataInterface::Hit(Int_t track, Int_t hit)
 
        if (fRunloader == NULL)
        {
-               Error("Hit", "File not set.");
+               AliError("File not set.");
                return NULL;
        };
        if (fEventnumber < 0)
        {
-               Error("Hit", "Event not chosen.");
+               AliError("Event not chosen.");
                return NULL;
        };
        if ( ! FetchTreeH() ) return NULL;
@@ -723,12 +724,12 @@ Int_t AliMUONDataInterface::NumberOfSDigits(Int_t chamber, Int_t cathode)
        
        if (fRunloader == NULL)
        {
-               Error("NumberOfSDigits", "File not set.");
+               AliError("File not set.");
                return -1;
        };
        if (fEventnumber < 0)
        {
-               Error("NumberOfSDigits", "Event not chosen.");
+               AliError("Event not chosen.");
                return -1;
        };
 
@@ -753,12 +754,12 @@ AliMUONDigit* AliMUONDataInterface::SDigit(Int_t chamber, Int_t cathode, Int_t s
        
        if (fRunloader == NULL)
        {
-               Error("SDigit", "File not set.");
+               AliError("File not set.");
                return NULL;
        };
        if (fEventnumber < 0)
        {
-               Error("SDigit", "Event not chosen.");
+               AliError("Event not chosen.");
                return NULL;
        };
 
@@ -783,12 +784,12 @@ Int_t AliMUONDataInterface::NumberOfDigits(Int_t chamber, Int_t cathode)
        
        if (fRunloader == NULL)
        {
-               Error("NumberOfDigits", "File not set.");
+               AliError("File not set.");
                return -1;
        };
        if (fEventnumber < 0)
        {
-               Error("NumberOfDigits", "Event not chosen.");
+               AliError("Event not chosen.");
                return -1;
        };
        
@@ -813,12 +814,12 @@ AliMUONDigit* AliMUONDataInterface::Digit(Int_t chamber, Int_t cathode, Int_t di
        
        if (fRunloader == NULL)
        {
-               Error("Digit", "File not set.");
+               AliError("File not set.");
                return NULL;
        };
        if (fEventnumber < 0)
        {
-               Error("Digit", "Event not chosen.");
+               AliError("Event not chosen.");
                return NULL;
        };
 
@@ -842,12 +843,12 @@ Int_t AliMUONDataInterface::NumberOfRawClusters(Int_t chamber)
 
        if (fRunloader == NULL)
        {
-               Error("NumberOfRawClusters", "File not set.");
+               AliError("File not set.");
                return -1;
        };
        if (fEventnumber < 0)
        {
-               Error("NumberOfRawClusters", "Event not chosen.");
+               AliError("Event not chosen.");
                return -1;
        };
 
@@ -872,12 +873,12 @@ AliMUONRawCluster* AliMUONDataInterface::RawCluster(Int_t chamber, Int_t cluster
 
        if (fRunloader == NULL)
        {
-               Error("RawCluster", "File not set.");
+               AliError("File not set.");
                return NULL;
        };
        if (fEventnumber < 0)
        {
-               Error("RawCluster", "Event not chosen.");
+               AliError("Event not chosen.");
                return NULL;
        };
 
@@ -900,12 +901,12 @@ Int_t AliMUONDataInterface::NumberOfLocalTriggers()
 
        if (fRunloader == NULL)
        {
-               Error("NumberOfLocalTriggers", "File not set.");
+               AliError("File not set.");
                return -1;
        };
        if (fEventnumber < 0)
        {
-               Error("NumberOfLocalTriggers", "Event not chosen.");
+               AliError("Event not chosen.");
                return -1;
        };
 
@@ -928,12 +929,12 @@ AliMUONLocalTrigger* AliMUONDataInterface::LocalTrigger(Int_t trigger)
 
        if (fRunloader == NULL)
        {
-               Error("LocalTrigger", "File not set.");
+               AliError("File not set.");
                return NULL;
        };
        if (fEventnumber < 0)
        {
-               Error("LocalTrigger", "Event not chosen.");
+               AliError( "Event not chosen.");
                return NULL;
        };
 
index 3fff34d..4aa774b 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "AliMUONDigit.h"
 
+
 ClassImp(AliMUONDigit)
 //_____________________________________________________________________________
  AliMUONDigit::AliMUONDigit(const AliMUONDigit& digits):TObject(digits)
index 735d435..971cce6 100644 (file)
@@ -31,6 +31,7 @@
 #include "AliMUONTransientDigit.h"
 #include "AliMUONHitMapA1.h"
 #include "AliMUONTriggerDecision.h"
+#include "AliLog.h"
 
 
 /////////////////////////////////////////////////////////////////////////////////////
@@ -92,7 +93,7 @@ AliMUONDigitizer::AliMUONDigitizer(const AliMUONDigitizer& rhs)
 {
 // Protected copy constructor
 
-  Fatal("AliMUONDigitizer", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 //___________________________________________
@@ -114,7 +115,7 @@ AliMUONDigitizer::operator=(const AliMUONDigitizer& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }    
@@ -136,12 +137,12 @@ void AliMUONDigitizer::Exec(Option_t* option)
 // 2) Loop over the generated transient digits and write them to the output
 //    stream. Done in CreateDigits()
 
-       if (GetDebug() > 0) Info("Exec", "Running digitiser.");
+       AliDebug(1, "Running digitiser.");
        ParseOptions(option);
 
        if (fManager->GetNinputs() == 0)
        {
-               Warning("Exec", "No inputs set, nothing to do.");
+               AliWarning("No inputs set, nothing to do.");
                return;
        };
 
@@ -151,16 +152,15 @@ void AliMUONDigitizer::Exec(Option_t* option)
 
        InitArrays();
        
-       if (GetDebug() > 1) Info("Exec", "Event Number is %d.", fManager->GetOutputEventNr());
+       AliDebug(2, Form("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);
-               if (GetDebug() > 1) 
-                       Info("Exec", "Digitising folder %d, with fMask = %d: %s", inputFile, fMask,
-                            (const char*)fManager->GetInputFolderName(inputFile));
+               AliDebug(2, Form("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,8 +206,7 @@ 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.
 
-       if (GetDebug() > 3)
-               Info("UpdateTransientDigit", "Updating transient digit 0x%X", (void*)mTD);
+       AliDebug(4,Form( "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 = 
@@ -221,13 +220,10 @@ void AliMUONDigitizer::UpdateTransientDigit(AliMUONTransientDigit* mTD)
        Int_t ntracks = mTD->GetNTracks();
        if (ntracks > kMAXTRACKS)  // Truncate the number of tracks to kMAXTRACKS if we have to.
        {
-               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);
-               }
+               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));
                ntracks = kMAXTRACKS;
        };
        
@@ -243,8 +239,7 @@ void AliMUONDigitizer::AddTransientDigit(AliMUONTransientDigit* mTD)
 // Adds the transient digit to the fTDList and sets the appropriate entry
 // in the fHitMap arrays. 
 
-       if (GetDebug() > 3)
-               Info("AddTransientDigit", "Adding transient digit 0x%X", (void*)mTD);
+       AliDebug(4,Form( "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);
@@ -270,7 +265,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.
 
-       if (GetDebug() > 1) Info("CreateDigits", "Creating digits...");
+       AliDebug(2, "Creating digits...");
        for (Int_t icat = 0; icat < 2; icat++)
        {
                //
@@ -285,8 +280,7 @@ void AliMUONDigitizer::CreateDigits()
                        // of digits from both cathodes.
                        if (icat != td->Cathode() - 1) continue;
                        
-                       if (GetDebug() > 2)
-                               Info("CreateDigits", "Creating digit from transient digit 0x%X", (void*)td);
+                       AliDebug(3,Form( "Creating digit from transient digit 0x%X", (void*)td));
 
                        Int_t q = GetSignalFrom(td);
                        if (q > 0) AddDigit(td, q);
@@ -321,13 +315,10 @@ void AliMUONDigitizer::AddDigit(AliMUONTransientDigit* td, Int_t responseCharge)
        Int_t nptracks = td->GetNTracks();
        if (nptracks > 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);
-               }
+               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));
                nptracks = kMAXTRACKS;
        };
        
@@ -349,7 +340,7 @@ void AliMUONDigitizer::AddDigit(AliMUONTransientDigit* td, Int_t responseCharge)
                };
        };
 
-       if (GetDebug() > 3) Info("AddDigit", "Adding digit with charge %d.", responseCharge);
+       AliDebug(4,Form( "Adding digit with charge %d.", responseCharge));
 
        OnWriteTransientDigit(td);
        AddDigit(td->Chamber(), tracks, charges, digits);
@@ -381,19 +372,18 @@ 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. 
 
-       if (GetDebug() > 2)
-               Info("FetchLoaders", "Fetching run loader and muon loader from folder: %s", foldername);
+       AliDebug(3, Form("Fetching run loader and muon loader from folder: %s", foldername));
 
        runloader = AliRunLoader::GetRunLoader(foldername);
        if (runloader == NULL)
        {
-               Error("FetchLoaders", "RunLoader not found in folder: %s", foldername);
+               AliError(Form("RunLoader not found in folder: %s", foldername));
                return kFALSE; 
        }                                                                                       
        muonloader = (AliMUONLoader*) runloader->GetLoader("MUONLoader");
        if (muonloader == NULL) 
        {
-               Error("FetchLoaders", "MUONLoader not found in folder: %s", foldername);
+               AliError(Form("MUONLoader not found in folder: %s", foldername));
                return kFALSE; 
        }
        return kTRUE;
@@ -409,29 +399,28 @@ Bool_t AliMUONDigitizer::FetchGlobalPointers(AliRunLoader* runloader)
 // AliMUONData fetched from the MUON module. 
 // kTRUE is returned if no error occurred otherwise kFALSE is returned. 
 
-        if (GetDebug() > 2)
-               Info("FetchGlobalPointers", "Fetching gAlice, MUON module and AliMUONData from runloader 0x%X.",
+        AliDebug(3, Form("Fetching gAlice, MUON module and AliMUONData from runloader 0x%X.",
                        (void*)runloader
-                   );
+                   ));
 
        if (runloader->GetAliRun() == NULL) runloader->LoadgAlice();
        gAlice = runloader->GetAliRun();
        if (gAlice == NULL)
        {
-               Error("FetchGlobalPointers", "Could not find the AliRun object in runloader 0x%X.", (void*)runloader);
+               AliError(Form("Could not find the AliRun object in runloader 0x%X.", (void*)runloader));
                return kFALSE;
        };
        fMUON = (AliMUON*) gAlice->GetDetector("MUON");
        if (fMUON == NULL)
        {
-               Error("FetchGlobalPointers", "Could not find the MUON module in runloader 0x%X.", (void*)runloader);
+               AliError(Form("Could not find the MUON module in runloader 0x%X.", (void*)runloader));
                return kFALSE;
        };
 
        AliMUONLoader *muonloader = (AliMUONLoader*) runloader->GetLoader("MUONLoader");
        if (muonloader == NULL) 
        {
-               Error("FetchGlobalPointers", "MUONLoader not found ");
+               AliError( "MUONLoader not found ");
                return kFALSE; 
        }
 
@@ -439,7 +428,7 @@ Bool_t AliMUONDigitizer::FetchGlobalPointers(AliRunLoader* runloader)
        if (fMUONData == NULL) fMUONData = new AliMUONData(muonloader,"MUON","MUON");
        if (fMUONData == NULL)
        {
-               Error("FetchGlobalPointers", "Could not find AliMUONData object in runloader 0x%X.", (void*)runloader);
+               AliError(Form("Could not find AliMUONData object in runloader 0x%X.", (void*)runloader));
                return kFALSE;
        };
 
@@ -449,7 +438,7 @@ Bool_t AliMUONDigitizer::FetchGlobalPointers(AliRunLoader* runloader)
 Bool_t  AliMUONDigitizer::FetchTriggerPointer(AliMUONLoader* loader)
 {
   if (fMUONData == NULL) {
-    Error("FetchTriggerPointer", "MUONData not found");
+    AliError("MUONData not found");
     return kFALSE;
   }
 
@@ -474,7 +463,7 @@ void AliMUONDigitizer::ParseOptions(Option_t* options)
                optionString.Data() == "deb"   // maintained for compatability.
           )
        {
-               Info("ParseOptions", "Called with option \"debug\".");
+               AliInfo("Called with option \"debug\".");
                SetDebug(99);
        };
 };
@@ -489,8 +478,8 @@ void AliMUONDigitizer::InitArrays()
 //
 // Note: the fTDList and fHitMap arrays must be NULL before calling this method.
 
-       if (GetDebug() > 1) Info("InitArrays", "Initialising internal arrays.");
-       if (GetDebug() > 3) Info("InitArrays", "Creating transient digits list.");
+       AliDebug(2, "Initialising internal arrays.");
+       AliDebug(4, "Creating transient digits list.");
        fTDList = new TObjArray;
        
        // Array of pointer of the AliMUONHitMapA1:
@@ -500,11 +489,11 @@ void AliMUONDigitizer::InitArrays()
        // Loop over chambers for the definition AliMUONHitMap
        for (Int_t i = 0; i < AliMUONConstants::NCh(); i++) 
        {
-               if (GetDebug() > 3) Info("InitArrays", "Creating hit map for chamber %d, cathode 1.", i+1);
+               AliDebug(4,Form( "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);
-               if (GetDebug() > 3) Info("InitArrays", "Creating hit map for chamber %d, cathode 2.", i+1);
+               AliDebug(4,Form( "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);
        };
@@ -515,17 +504,17 @@ void AliMUONDigitizer::CleanupArrays()
 {
 // The arrays fTDList and fHitMap are deleted and the pointers set to NULL.
 
-       if (GetDebug() > 1) Info("CleanupArrays", "Deleting internal arrays.");
+       AliDebug(2, "Deleting internal arrays.");
        for(Int_t i = 0; i < 2*AliMUONConstants::NCh(); i++)
        {
-               if (GetDebug() > 3) Info("CleanupArrays", "Deleting hit map for chamber %d, cathode %d.", 
-                       i%AliMUONConstants::NCh()+1, i/AliMUONConstants::NCh()+1);
+               AliDebug(4,Form( "Deleting hit map for chamber %d, cathode %d.", 
+                       i%AliMUONConstants::NCh()+1, i/AliMUONConstants::NCh()+1));
                delete fHitMap[i];
        };
        delete [] fHitMap;
        fHitMap = NULL;
        
-       if (GetDebug() > 3) Info("CleanupArrays", "Deleting transient digits list.");
+       AliDebug(4, "Deleting transient digits list.");
        fTDList->Delete();
        delete fTDList;
        fTDList = NULL;
index 17c2965..541b860 100644 (file)
@@ -39,6 +39,7 @@
 #include "AliMUONHit.h"
 #include "AliMUONTransientDigit.h"
 #include "AliMUONTriggerDecision.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONDigitizerv1)
 
@@ -75,15 +76,14 @@ void AliMUONDigitizerv1::GenerateTransientDigits()
 // Note: Charge correlation is applied to the tracking chambers. 
 
        TTree* treeH = fGime->TreeH();
-       if (GetDebug() > 1)
-               Info("GenerateTransientDigits", "Generating transient digits using treeH = 0x%X"
-                       , (void*)treeH);
+       AliDebug(2, Form("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++) 
        {
-               if (GetDebug() > 2) Info("GenerateTransientDigits", "Processing track %d...", itrack);
+               AliDebug(3, Form("Processing track %d...", itrack));
                fMUONData->ResetHits();
                treeH->GetEvent(itrack);
                //
@@ -95,19 +95,14 @@ void AliMUONDigitizerv1::GenerateTransientDigits()
                        Int_t ichamber = mHit->Chamber()-1;  // chamber number
                        if (ichamber > AliMUONConstants::NCh()-1) 
                        {
-                               Error("GenerateTransientDigits", 
-                                       "Hit 0x%X has a invalid chamber number: %d", ichamber);
+                               AliError(Form("Hit 0x%X has a invalid chamber number: %d", ichamber));
                                continue;
                        }
                        //
                        //Dumping Hit content:
-                       if (GetDebug() > 2) 
-                       {
-                               Info("GenerateTransientDigits", 
-                                       "Hit %d: chamber = %d\tX = %f\tY = %f\tZ = %f\teloss = %f",
+                       AliDebug(3,Form("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);
@@ -133,13 +128,11 @@ 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.
 
-       if (GetDebug() > 3)
-               Info("MakeTransientDigitsFromHit", "Making transient digit for hit number %d.", iHit);
+       AliDebug(4,Form("Making transient digit for hit number %d.", iHit));
                
        //
        // Calls the charge disintegration method of the current chamber 
-       if (GetDebug() > 4)
-               Info("MakeTransientDigitsFromHit", "Calling AliMUONChamber::DisIngtegration...");
+       AliDebug(5,"Calling AliMUONChamber::DisIngtegration...");
 
        Float_t newdigit[6][500];  // Pad information
        Int_t nnew=0;              // Number of touched Pads per hit
@@ -169,10 +162,9 @@ void AliMUONDigitizerv1::MakeTransientDigitsFromHit(Int_t track, Int_t iHit, Ali
                };
                digits[5] = iHit+fMask;    // Hit number in the list
 
-               if (GetDebug() > 4)
-                       Info("MakeTransientDigitsFromHit", 
+               AliDebug(5,Form("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);
@@ -201,7 +193,7 @@ void AliMUONDigitizerv1::FillTriggerOutput()
 {
 // Derived to fill TreeD and resets the trigger array in fMUONData.
 
-       if (GetDebug() > 2) Info("FillTriggerOutput", "Filling trees with trigger.");
+       AliDebug(3,"Filling trees with trigger.");
        fMUONData->Fill("GLT");
        fMUONData->ResetTrigger();
 };
@@ -222,8 +214,7 @@ Int_t AliMUONDigitizerv1::GetSignalFrom(AliMUONTransientDigit* td)
 // Derived to apply the chamber response model to the digit. 
 // Using AliMUONChamber::ResponseModel() for this.
 
-       if (GetDebug() > 3)
-               Info("GetSignalFrom", "Applying response of chamber to TransientDigit signal.");
+       AliDebug(4, "Applying response of chamber to TransientDigit signal.");
        //
        //  Digit Response (noise, threshold, saturation, ...)
        Int_t q = td->Signal(); 
@@ -239,8 +230,7 @@ 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.
 
-       if (GetDebug() > 2)
-               Info("InitOutputData", "Creating digits branch and setting the tree address.");
+       AliDebug(3, "Creating digits branch and setting the tree address.");
 
        fMUONData->SetLoader(muonloader);
 
@@ -250,7 +240,7 @@ Bool_t AliMUONDigitizerv1::InitOutputData(AliMUONLoader* muonloader)
                muonloader->MakeDigitsContainer();
                if (muonloader->TreeD() == NULL)
                {
-                       Error("InitOutputData", "Could not create TreeD.");
+                       AliError("Could not create TreeD.");
                        return kFALSE;
                };
        };
@@ -266,7 +256,7 @@ void AliMUONDigitizerv1::FillOutputData()
 {
 // Derived to fill TreeD and resets the digit array in fMUONData.
 
-       if (GetDebug() > 2) Info("FillOutputData", "Filling trees with digits.");
+       AliDebug(3, "Filling trees with digits.");
        fMUONData->Fill("D");
        fMUONData->ResetDigits();
 };
@@ -276,7 +266,7 @@ void AliMUONDigitizerv1::CleanupOutputData(AliMUONLoader* muonloader)
 {
 // Derived to write the digits tree and then unload the digits tree once written.
 
-       if (GetDebug() > 2) Info("CleanupOutputData", "Writing digits and releasing pointers.");
+       AliDebug(3, "Writing digits and releasing pointers.");
        muonloader->WriteDigits("OVERWRITE");
        muonloader->UnloadDigits();
 };
@@ -288,8 +278,7 @@ 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.
 
-       if (GetDebug() > 2)
-               Info("InitInputData", "Loading hits in READ mode and setting the tree address.");
+       AliDebug(3, "Loading hits in READ mode and setting the tree address.");
 
        fMUONData->SetLoader(muonloader);
 
@@ -298,7 +287,7 @@ Bool_t AliMUONDigitizerv1::InitInputData(AliMUONLoader* muonloader)
                muonloader->LoadHits("READ");
                if (muonloader->TreeH() == NULL)
                {
-                       Error("InitInputData", "Can not load the hits tree.");
+                       AliError("Can not load the hits tree.");
                        return kFALSE;
                };
        };
@@ -312,7 +301,7 @@ void AliMUONDigitizerv1::CleanupInputData(AliMUONLoader* muonloader)
 {
 // Derived to release the loaded hits and unload them.
 
-       if (GetDebug() > 2) Info("CleanupInputData", "Releasing loaded hits.");
+       AliDebug(3, "Releasing loaded hits.");
        fMUONData->ResetHits();
        muonloader->UnloadHits();
 };
index 6780262..4480b2d 100644 (file)
@@ -34,6 +34,7 @@
 #include "AliMUONDigit.h"
 #include "AliMUONDigitizerv2.h"
 #include "AliMUONTransientDigit.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONDigitizerv2)
 
@@ -61,9 +62,7 @@ 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.
 
-       if (GetDebug() > 1) 
-               Info("GenerateTransientDigits", "Generating transient digits using treeH = 0x%X");
-
+       AliDebug(2,"Generating transient digits using treeH = 0x%X");
        //
        // Loop over SDigits
        Int_t ndig, k;
@@ -98,10 +97,7 @@ 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.
 
-       if (GetDebug() > 3)
-               Info("MakeTransientDigitFromSDigit", 
-                       "Making transient digit from s-digit for chamber %d.", iChamber);
-       
+       AliDebug(4,Form("Making transient digit from s-digit for chamber %d.", iChamber));
        Int_t digits[6];
        //
        // Creating a new TransientDigits from SDigit
@@ -116,10 +112,8 @@ void AliMUONDigitizerv2::MakeTransientDigitFromSDigit(Int_t iChamber, AliMUONDig
                
        digits[5] = sDigit->Hit();    // Hit number in the list
 
-       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]);
+       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]));
        
        AliMUONTransientDigit* mTD = new AliMUONTransientDigit(iChamber, digits);
        // Copy list of tracks and trackcharge
@@ -148,9 +142,7 @@ 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.
 
-       if (GetDebug() > 2)
-               Info("InitInputData", "Loading s-digits in READ mode and setting the tree address.");
-
+       AliDebug(3,"Loading s-digits in READ mode and setting the tree address.");
        fMUONData->SetLoader(muonloader);
 
        if (muonloader->TreeS() == NULL)
@@ -158,7 +150,7 @@ Bool_t AliMUONDigitizerv2::InitInputData(AliMUONLoader* muonloader)
                muonloader->LoadSDigits("READ");
                if (muonloader->TreeS() == NULL)
                {
-                       Error("InitInputData", "Can not load the s-digits tree.");
+                       AliError("Can not load the s-digits tree.");
                        return kFALSE;
                };
        };
@@ -172,7 +164,7 @@ void AliMUONDigitizerv2::CleanupInputData(AliMUONLoader* muonloader)
 {
 // Overridden to release and unload s-digits from memory.
 
-       if (GetDebug() > 2) Info("CleanupInputData", "Releasing loaded s-digits.");
+       AliDebug(3,"Releasing loaded s-digits.");
        fMUONData->ResetSDigits();
        muonloader->UnloadSDigits();
 };
index c61e51d..035b290 100644 (file)
@@ -39,7 +39,6 @@
 #include <TGeometry.h>
 #include <TMarker3DBox.h>
 #include <TParticle.h>
-#include <TPolyLine3D.h>
 
 #include "AliMUONDisplay.h"
 #include "AliRun.h"
@@ -59,6 +58,7 @@
 #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
 
-  Fatal("AliMUONDisplay", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 
@@ -1486,7 +1486,7 @@ AliMUONDisplay & AliMUONDisplay::operator = (const AliMUONDisplay & rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }
index 11b7613..d048b13 100644 (file)
@@ -57,6 +57,7 @@
 #include "AliLoader.h"
 #include "AliMUONTrackK.h" //AZ
 #include "AliMC.h"
+#include "AliLog.h"
 
 //************* Defaults parameters for reconstruction
 const Double_t AliMUONEventReconstructor::fgkDefaultMinBendingMomentum = 3.0;
@@ -159,7 +160,7 @@ AliMUONEventReconstructor::AliMUONEventReconstructor (const AliMUONEventReconstr
 {
 // Protected copy constructor
 
-  Fatal("AliMUONEventReconstructor", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 AliMUONEventReconstructor & 
@@ -169,7 +170,7 @@ AliMUONEventReconstructor::operator=(const AliMUONEventReconstructor& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }
@@ -228,13 +229,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;
@@ -344,9 +345,8 @@ void AliMUONEventReconstructor::NextBkgGeantEvent(void)
     sprintf(treeName, "TreeK%d", fBkgGeantEventNumber);
     fBkgGeantTK = (TTree*)gDirectory->Get(treeName);
     if (!fBkgGeantTK) {
-      cout << "ERROR: cannot find Kine Tree for background event: " <<
-       fBkgGeantEventNumber << endl;
-      exit(0);
+               AliError(Form("cannot find Kine Tree for background event: %d",fBkgGeantEventNumber));
+       exit(0);
     }
   }
   if (fBkgGeantTK) 
@@ -356,8 +356,7 @@ void AliMUONEventReconstructor::NextBkgGeantEvent(void)
   sprintf(treeName, "TreeH%d", fBkgGeantEventNumber);
   fBkgGeantTH = (TTree*)gDirectory->Get(treeName);
   if (!fBkgGeantTH) {
-    cout << "ERROR: cannot find Hits Tree for background event: " <<
-      fBkgGeantEventNumber << endl;
+         AliError(Form("cannot find Hits Tree for background event: %d",fBkgGeantEventNumber));
       exit(0);
   }
   if (fBkgGeantTH && fBkgGeantHits) {
@@ -490,13 +489,13 @@ void AliMUONEventReconstructor::MakeEventToBeReconstructed(void)
          Int_t retval = fLoader->LoadHits();
          if ( retval)
           {
-            Error("MakeEventToBeReconstructed","Error occured while loading hits.");
+            AliError("Error occured while loading hits.");
             return;
           }
          treeH = fLoader->TreeH();
          if (treeH == 0x0)
           {
-           Error("MakeEventToBeReconstructed","Can not get TreeH");
+           AliError("Can not get TreeH");
            return;
           }
        }
@@ -780,9 +779,7 @@ void AliMUONEventReconstructor::AddHitsForRecFromRawClusters(TTree* TR)
 
   nTRentries = Int_t(TR->GetEntries());
   if (nTRentries != 1) {
-    cout << "Error in AliMUONEventReconstructor::AddHitsForRecFromRawClusters"
-        << endl;
-    cout << "nTRentries = " << nTRentries << " not equal to 1" << endl;
+    AliError(Form("nTRentries = %d not equal to 1 ",nTRentries));
     exit(0);
   }
   fLoader->TreeR()->GetEvent(0); // only one entry  
@@ -869,6 +866,7 @@ 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
@@ -888,7 +886,8 @@ 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;
+  Double_t extrapFact =
+    (&(pMUON->Chamber(ch2)))->Z() / (&(pMUON->Chamber(ch1)))->Z();
   // index for current segment
   Int_t segmentIndex = 0;
   // Loop over HitsForRec in the first chamber of the station
@@ -900,6 +899,8 @@ 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];
@@ -909,9 +910,6 @@ 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) {
@@ -1040,9 +1038,7 @@ Bool_t AliMUONEventReconstructor::MakeTriggerTracks(void)
     treeR->GetEvent(0); // only one entry  
 
     if (!(fMUONData->IsTriggerBranchesInTree())) {
-      cout << "Warning in AliMUONEventReconstructor::MakeTriggerTracks"
-          << endl;
-      cout << "Trigger information is not avalaible, nTRentries = " << nTRentries << " not equal to 1" << endl;
+      AliWarning(Form("Trigger information is not avalaible, nTRentries = %d not equal to 1",nTRentries));
       return kFALSE;
     }
 
@@ -1109,8 +1105,7 @@ 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;
-  AliMUONSegment *extrapSegment = NULL;
+  AliMUONSegment *endSegment, *extrapSegment;
   AliMUONTrack *recTrack;
   Double_t mcsFactor;
   if (fPrintLevel >= 1) cout << "enter MakeTrackCandidatesWithTwoSegments" << endl;
@@ -1121,6 +1116,8 @@ 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
@@ -1129,8 +1126,6 @@ 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) {
@@ -1162,8 +1157,7 @@ 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= NULL;
-  AliMUONHitForRec *hit;
+  AliMUONHitForRec *extrapHitForRec, *hit;
   AliMUONTrack *recTrack;
   Double_t mcsFactor;
   if (fPrintLevel >= 1)
@@ -1181,6 +1175,9 @@ 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];
@@ -1190,9 +1187,6 @@ 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) {
@@ -1258,8 +1252,8 @@ void AliMUONEventReconstructor::FollowTracks(void)
 {
   // Follow tracks in stations(1..) 3, 2 and 1
   // too long: should be made more modular !!!!
-  AliMUONHitForRec *bestHit, *extrapHit, *hit;
-  AliMUONSegment *bestSegment, *extrapSegment, *segment;
+  AliMUONHitForRec *bestHit, *extrapHit, *extrapCorrHit, *hit;
+  AliMUONSegment *bestSegment, *extrapSegment, *extrapCorrSegment, *segment;
   AliMUONTrack *track, *nextTrack;
   AliMUONTrackParam *trackParam1, trackParam[2], trackParamVertex;
   // -1 to avoid compilation warnings
@@ -1300,6 +1294,7 @@ 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();
@@ -1319,6 +1314,14 @@ 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) {
@@ -1334,14 +1337,18 @@ 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"
-       (&(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());
+       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()));
        chi2 = segment->
-         NormalizedChi2WithSegment(extrapSegment, maxSigma2Distance);
+         NormalizedChi2WithSegment(extrapCorrSegment, maxSigma2Distance);
        if (chi2 < bestChi2) {
          // update best Chi2 and Segment if better found
          bestSegment = segment;
@@ -1350,8 +1357,6 @@ 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]));
@@ -1368,6 +1373,7 @@ 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) {
@@ -1377,22 +1383,41 @@ 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]);
-           // 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
+           // 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()));
            // condition for hit not already in segment ????
            chi2 = hit->NormalizedChi2WithHitForRec(extrapHit, maxSigma2Distance);
            if (chi2 < bestChi2) {
@@ -1405,7 +1430,6 @@ 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,
@@ -1421,13 +1445,17 @@ 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 1f1c002..f3504a4 100644 (file)
@@ -30,6 +30,7 @@
 #include "AliMUONSegmentationSlatN.h"
 #include "AliMUONSegmentationTriggerX.h"
 #include "AliMUONSegmentationTriggerY.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONFactory)
 
@@ -48,7 +49,7 @@ AliMUONFactory::AliMUONFactory(const AliMUONFactory& rhs)
 {
 // Protected copy constructor
 
-  Fatal("AliMUONFactory", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 //__________________________________________________________________________
@@ -65,7 +66,7 @@ AliMUONFactory&  AliMUONFactory::operator=(const AliMUONFactory& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }    
@@ -245,13 +246,10 @@ void AliMUONFactory::BuildStation3()
                             0,0,3,0,
                             0,0,2,0};
        
-       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 !
-
+       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));
+       
        Int_t chamber=5;
        fMUON->SetNsec(chamber-1,2);
        AliMUONSegmentationSlat *seg51=new AliMUONSegmentationSlat(4);
@@ -259,7 +257,7 @@ void AliMUONFactory::BuildStation3()
        seg51->SetShift(shift);  
        seg51->SetNPCBperSector(npcb5); 
        seg51->SetSlatXPositions(xpos5);
-       seg51->SetSlatYPositions(ypos5);
+       seg51->SetSlatYPosition(ypos5);
        seg51->SetPadSize(10.,0.5);
        seg51->SetDAnod(0.25);
        seg51->SetPadDivision(nseg3);
@@ -270,7 +268,7 @@ void AliMUONFactory::BuildStation3()
        seg52->SetShift(shift);  
        seg52->SetNPCBperSector(npcb5); 
        seg52->SetSlatXPositions(xpos5);
-       seg52->SetSlatYPositions(ypos5);
+       seg52->SetSlatYPosition(ypos5);
        seg52->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg52->SetDAnod(0.25);
        seg52->SetPadDivision(nseg3);
@@ -285,7 +283,7 @@ void AliMUONFactory::BuildStation3()
        seg61->SetShift(shift);  
        seg61->SetNPCBperSector(npcb5); 
        seg61->SetSlatXPositions(xpos5);
-       seg61->SetSlatYPositions(ypos5);
+       seg61->SetSlatYPosition(ypos5);
        seg61->SetPadSize(10.,0.5);
        seg61->SetDAnod(0.25);
        seg61->SetPadDivision(nseg3);
@@ -296,7 +294,7 @@ void AliMUONFactory::BuildStation3()
        seg62->SetShift(shift);  
        seg62->SetNPCBperSector(npcb5); 
        seg62->SetSlatXPositions(xpos5);
-       seg62->SetSlatYPositions(ypos5);
+       seg62->SetSlatYPosition(ypos5);
        seg62->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg62->SetDAnod(0.25);
        seg62->SetPadDivision(nseg3);
@@ -321,8 +319,7 @@ void AliMUONFactory::BuildStation4()
        fMUON->SetNsec(chamber-1,2);
 //
        AliMUONSegmentationSlat *seg71=new AliMUONSegmentationSlat(4);
-       Float_t shift = 0.;
-
+       Float_t shift = 1.5/2.;
        Int_t npcb7[52] = {0,0,0,2,
                           0,0,0,3,
                           0,0,2,2,
@@ -336,21 +333,14 @@ void AliMUONFactory::BuildStation4()
                           0,0,2,2, 
                           0,0,0,3,
                           0,0,0,2};
-       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.;
-       }
+       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));  
        
        seg71->SetNSlats(13);  
        seg71->SetShift(shift);  
        seg71->SetNPCBperSector(npcb7); 
        seg71->SetSlatXPositions(xpos7);
-       seg71->SetSlatYPositions(ypos7);
+       seg71->SetSlatYPosition(ypos7);
        
        seg71->SetPadSize(10.,0.5);
        seg71->SetDAnod(0.25);
@@ -364,7 +354,7 @@ void AliMUONFactory::BuildStation4()
        seg72->SetShift(shift);   
        seg72->SetNPCBperSector(npcb7); 
        seg72->SetSlatXPositions(xpos7);
-       seg72->SetSlatYPositions(ypos7);
+       seg72->SetSlatYPosition(ypos7);
        seg72->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg72->SetDAnod(0.25);
        seg72->SetPadDivision(nseg4);
@@ -382,7 +372,7 @@ void AliMUONFactory::BuildStation4()
        seg81->SetShift(shift);  
        seg81->SetNPCBperSector(npcb7); 
        seg81->SetSlatXPositions(xpos7);
-       seg81->SetSlatYPositions(ypos8);
+       seg81->SetSlatYPosition(ypos7);
        seg81->SetPadSize(10.,0.5);
        seg81->SetDAnod(0.25);
        seg81->SetPadDivision(nseg4);
@@ -395,7 +385,7 @@ void AliMUONFactory::BuildStation4()
        seg82->SetShift(shift);  
        seg82->SetNPCBperSector(npcb7); 
        seg82->SetSlatXPositions(xpos7);
-       seg82->SetSlatYPositions(ypos8);
+       seg82->SetSlatYPosition(ypos7);
        seg82->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg82->SetDAnod(0.25);
        seg82->SetPadDivision(nseg4);
@@ -419,8 +409,7 @@ void AliMUONFactory::BuildStation5()
        AliMUONSegmentationSlat *seg91=new AliMUONSegmentationSlat(4);
 
        Int_t   nseg4[4]={4, 4, 2, 1};
-       Float_t shift = 0.;
-
+       Float_t shift = 1.5/2.;
        Int_t   npcb9[52] = {0,0,0,3,
                             0,0,0,4,
                             0,0,2,3,
@@ -435,18 +424,14 @@ void AliMUONFactory::BuildStation5()
                             0,0,0,4, 
                             0,0,0,3};   
        
-       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.;
-
+       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));
        
        seg91->SetNSlats(13);  
        seg91->SetShift(shift);  
        seg91->SetNPCBperSector(npcb9); 
        seg91->SetSlatXPositions(xpos9);
-       seg91->SetSlatYPositions(ypos9);
+       seg91->SetSlatYPosition(ypos9);
        seg91->SetPadSize(10.,0.5);
        seg91->SetDAnod(0.25);
        seg91->SetPadDivision(nseg4);
@@ -459,7 +444,7 @@ void AliMUONFactory::BuildStation5()
        seg92->SetShift(shift);   
        seg92->SetNPCBperSector(npcb9); 
        seg92->SetSlatXPositions(xpos9);
-       seg92->SetSlatYPositions(ypos9);
+       seg92->SetSlatYPosition(ypos9);
        seg92->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg92->SetDAnod(0.25);
        seg92->SetPadDivision(nseg4);
@@ -477,7 +462,7 @@ void AliMUONFactory::BuildStation5()
        seg101->SetShift(shift);  
        seg101->SetNPCBperSector(npcb9); 
        seg101->SetSlatXPositions(xpos9);
-       seg101->SetSlatYPositions(ypos9);
+       seg101->SetSlatYPosition(ypos9);
        seg101->SetPadSize(10.,0.5);
        seg101->SetDAnod(0.25);
        seg101->SetPadDivision(nseg4);
@@ -490,7 +475,7 @@ void AliMUONFactory::BuildStation5()
        seg102->SetShift(shift);   
        seg102->SetNPCBperSector(npcb9); 
        seg102->SetSlatXPositions(xpos9);
-       seg102->SetSlatYPositions(ypos9);
+       seg102->SetSlatYPosition(ypos9);
        seg102->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg102->SetDAnod(0.25);
        seg102->SetPadDivision(nseg4);
@@ -578,14 +563,8 @@ void AliMUONFactory::Build(AliMUON* where, const char* what)
       BuildStation5();
       BuildStation6();
     } 
-    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: ----------------------------------------------------");
-      }
-    }
+    else
+         AliDebug(0,"Non default version of MUON selected. You have to construct yourself the MUON elements !!");
 }
 
 //__________________________________________________________________________
@@ -615,6 +594,6 @@ void AliMUONFactory::BuildStation(AliMUON* where, Int_t stationNumber)
       case 5:  BuildStation5(); break;
       case 6:  BuildStation6(); break;
     
-      default: Fatal("Build", "Wrong station number");
+      default: AliFatal("Wrong station number");
     }  
 }         
index 9739f5a..4990d3e 100644 (file)
@@ -37,6 +37,7 @@
 #include "AliMUONGeometryConstituent.h"        
 #include "AliMagF.h"
 #include "AliRun.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONGeometryBuilder)
  
@@ -77,7 +78,7 @@ AliMUONGeometryBuilder::AliMUONGeometryBuilder(const AliMUONGeometryBuilder& rig
 {  
   // copy constructor (not implemented)
 
-  Fatal("AliMUONGeometryBuilder", "Copy constructor not provided.");
+  AliFatal("Copy constructor not provided.");
 }
 
 //______________________________________________________________________________
@@ -102,7 +103,7 @@ AliMUONGeometryBuilder::operator=(const AliMUONGeometryBuilder& right)
   // check assignement to self
   if (this == &right) return *this;
 
-  Fatal("operator =", "Assignement operator not provided.");
+  AliFatal("Assignement operator not provided.");
     
   return *this;  
 }    
@@ -232,7 +233,7 @@ void AliMUONGeometryBuilder::CreateGeometry()
         // virtual envelope + nof constituents = 0 
         //         => not allowed;
         //            empty virtual envelope has no sense 
-        Fatal("CreateGeometry", "Virtual envelope must have constituents.");
+        AliFatal("Virtual envelope must have constituents.");
         return;
       }
 
@@ -240,7 +241,7 @@ void AliMUONGeometryBuilder::CreateGeometry()
         // non virtual envelope + nof constituents > 0 
         //        => not allowed;
         //           use VMC to place constituents
-        Fatal("CreateGeometry", "Non virtual envelope cannot have constituents.");
+        AliFatal("Non virtual envelope cannot have constituents.");
         return;
       }
 
@@ -287,78 +288,75 @@ 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: 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;
+    Float_t ag1[3]   = { 39.95,12.01,16. };
+    Float_t zg1[3]   = { 18.,6.,8. };
+    Float_t wg1[3]   = { .8,.0667,.13333 };
+    Float_t dg1      = .001821;
+    //
+    //     Ar-buthane-freon gas -- trigger chambers 
+    Float_t atr1[4]  = { 39.95,12.01,1.01,19. };
+    Float_t ztr1[4]  = { 18.,6.,1.,9. };
+    Float_t wtr1[4]  = { .56,.1262857,.2857143,.028 };
+    Float_t dtr1     = .002599;
+    //
+    //     Ar-CO2 gas 
+    Float_t agas[3]  = { 39.95,12.01,16. };
+    Float_t zgas[3]  = { 18.,6.,8. };
+    Float_t wgas[3]  = { .74,.086684,.173316 };
+    Float_t dgas     = .0018327;
+    //
+    //     Ar-Isobutane gas (80%+20%) -- tracking 
+    Float_t ag[3]    = { 39.95,12.01,1.01 };
+    Float_t zg[3]    = { 18.,6.,1. };
+    Float_t wg[3]    = { .8,.057,.143 };
+    Float_t dg       = .0019596;
+    //
+    //     Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger 
+    Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
+    Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
+    Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
+    Float_t dtrig    = .0031463;
+    //
+    //     bakelite 
+
+    Float_t abak[3] = {12.01 , 1.01 , 16.};
+    Float_t zbak[3] = {6.     , 1.   , 8.};
+    Float_t wbak[3] = {6.     , 6.   , 1.}; 
+    Float_t dbak = 1.4;
+
+    Int_t iSXFLD   = gAlice->Field()->Integ();
+    Float_t sXMGMX = gAlice->Field()->Max();
+    //
+    // --- Define the various materials for GEANT --- 
+    fMUON->AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
+    fMUON->AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
+    // Air
+    Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
+    Float_t zAir[4]={6.,7.,8.,18.};
+    Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
+    Float_t dAir = 1.20479E-3;
+    fMUON->AliMixture(15, "AIR$      ", aAir,  zAir, dAir,4, wAir);
+    //    fMUON->AliMaterial(15, "AIR$      ", 14.61, 7.3, .001205, 30423.24, 67500);
+    fMUON->AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
+    fMUON->AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
+    fMUON->AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
+    fMUON->AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
+    fMUON->AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
+    fMUON->AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
+    // materials for slat: 
+    //     Sensitive area: gas (already defined) 
+    //     PCB: copper 
+    //     insulating material and frame: vetronite
+    //     walls: carbon, rohacell, carbon 
+  Float_t aglass[5]={12.01, 28.09, 16.,   10.8,  23.};
+  Float_t zglass[5]={ 6.,   14.,    8.,    5.,   11.};
+  Float_t wglass[5]={ 0.5,  0.105, 0.355, 0.03,  0.01};
+  Float_t dglass=1.74;
 
   // rohacell: C9 H13 N1 O2
   Float_t arohac[4] = {12.01,  1.01, 14.010, 16.};
@@ -366,78 +364,58 @@ void AliMUONGeometryBuilder::CreateMaterials()
   Float_t wrohac[4] = { 9.,   13.,    1.,     2.};
   Float_t drohac    = 0.03;
 
-  // 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();
+  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);
+
 
-  //
-  //    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 b46a77c..241a4ab 100644 (file)
@@ -24,6 +24,7 @@
 #include <TGeoMatrix.h>
 
 #include "AliMUONGeometryConstituent.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONGeometryConstituent)
 
@@ -130,8 +131,7 @@ AliMUONGeometryConstituent::AliMUONGeometryConstituent(
                                         const AliMUONGeometryConstituent& rhs)
   : TNamed(rhs)
 {
-  Fatal("Copy constructor", 
-        "Copy constructor is not implemented.");
+  AliFatal("Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -149,8 +149,7 @@ AliMUONGeometryConstituent::operator = (const AliMUONGeometryConstituent& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  Fatal("operator=", 
-        "Assignment operator is not implemented.");
+  AliFatal("Assignment operator is not implemented.");
     
   return *this;  
 }
index 42ca882..1020152 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "AliMUONGeometryEnvelope.h"
 #include "AliMUONGeometryConstituent.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONGeometryEnvelope)
 
@@ -98,8 +99,7 @@ AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(
                                         const AliMUONGeometryEnvelope& rhs)
   : TNamed(rhs)
 {
-  Fatal("Copy constructor", 
-        "Copy constructor is not implemented.");
+  AliFatal("Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -123,8 +123,7 @@ AliMUONGeometryEnvelope::operator = (const AliMUONGeometryEnvelope& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  Fatal("operator=", 
-        "Assignment operator is not implemented.");
+  AliFatal("Assignment operator is not implemented.");
     
   return *this;  
 }
index c78e2a9..628bdda 100644 (file)
@@ -17,6 +17,7 @@
 #include "AliMUONGeometryTransformStore.h"
 #include "AliMUONGeometryEnvelope.h"
 #include "AliMUONConstants.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONGeometryEnvelopeStore)
 
@@ -51,8 +52,7 @@ AliMUONGeometryEnvelopeStore::AliMUONGeometryEnvelopeStore()
 AliMUONGeometryEnvelopeStore::AliMUONGeometryEnvelopeStore(const AliMUONGeometryEnvelopeStore& rhs)
   : TObject(rhs)
 {
-  Fatal("Copy constructor", 
-        "Copy constructor is not implemented.");
+  AliFatal("Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -75,8 +75,7 @@ AliMUONGeometryEnvelopeStore::operator = (const AliMUONGeometryEnvelopeStore& rh
   // check assignement to self
   if (this == &rhs) return *this;
 
-  Fatal("operator=", 
-        "Assignment operator is not implemented.");
+  AliFatal("Assignment operator is not implemented.");
     
   return *this;  
 }
@@ -116,7 +115,7 @@ Bool_t AliMUONGeometryEnvelopeStore::AlignEnvelope(
   
   const TGeoCombiTrans* kTransform = fDETransforms->Get(detElemId);
   if (!kTransform) {
-    Warning("AlignEnvelope", "Transformation not found.");
+    AliWarning("Transformation not found.");
     return false;
   };
 
@@ -138,12 +137,8 @@ void  AliMUONGeometryEnvelopeStore::AddEnvelope(const TString& name,
 // to the list of envelopes.
 // ---                                            
 
-  if (fDebug) {
-    cout << "... Adding ";
-    if (!isVirtual) cout << " non-";
-    cout << "virtual envelope " << name 
-         << "  id " << id << endl;
-  }  
+  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));
 
   AliMUONGeometryEnvelope* envelope 
     = new AliMUONGeometryEnvelope(name, id, isVirtual, only);
index 27c15a0..ff429b5 100644 (file)
@@ -20,6 +20,7 @@
 #include <TObjString.h>
 
 #include "AliMUONGeometrySVMap.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONGeometrySVMap)
 
@@ -43,8 +44,7 @@ AliMUONStringIntMap::AliMUONStringIntMap()
 AliMUONStringIntMap::AliMUONStringIntMap(const AliMUONStringIntMap& rhs)
   : TObject(rhs)
 {
-  Fatal("Copy constructor", 
-        "Copy constructor is not implemented.");
+  AliFatal("Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -54,8 +54,7 @@ AliMUONStringIntMap::operator = (const AliMUONStringIntMap& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  Fatal("operator=", 
-        "Assignment operator is not implemented.");
+  AliFatal("Assignment operator is not implemented.");
     
   return *this;  
 }
@@ -77,7 +76,7 @@ Bool_t  AliMUONStringIntMap::Add(const TString& first, Int_t second)
 
   Int_t second2 = Get(first);
   if ( second2 > 0 ) {
-    Error("Add", "%s is already present in the map", first.Data());
+    AliError(Form("%s is already present in the map", first.Data()));
     return false;
   }
   
@@ -189,8 +188,7 @@ AliMUONGeometrySVMap::AliMUONGeometrySVMap()
 AliMUONGeometrySVMap::AliMUONGeometrySVMap(const AliMUONGeometrySVMap& rhs)
   : TObject(rhs)
 {
-  Fatal("Copy constructor", 
-        "Copy constructor is not implemented.");
+  AliFatal("Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -206,8 +204,7 @@ AliMUONGeometrySVMap::operator = (const AliMUONGeometrySVMap& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  Fatal("operator=", 
-        "Assignment operator is not implemented.");
+  AliFatal("Assignment operator is not implemented.");
     
   return *this;  
 }
@@ -326,16 +323,10 @@ 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 d425038..1d483f4 100644 (file)
@@ -13,6 +13,7 @@
 #include <TObjString.h>
 
 #include "AliMUONGeometryTransformStore.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONGeometryTransformStore)
 
@@ -50,8 +51,7 @@ AliMUONGeometryTransformStore::AliMUONGeometryTransformStore(
                                    const AliMUONGeometryTransformStore& rhs)
   : TObject(rhs)
 {
-  Fatal("Copy constructor", 
-        "Copy constructor is not implemented.");
+  AliFatal("Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -67,8 +67,7 @@ AliMUONGeometryTransformStore::operator = (const AliMUONGeometryTransformStore&
   // check assignement to self
   if (this == &rhs) return *this;
 
-  Fatal("operator=", 
-        "Assignment operator is not implemented.");
+  AliFatal("Assignment operator is not implemented.");
     
   return *this;  
 }
@@ -135,8 +134,8 @@ void AliMUONGeometryTransformStore::Add(Int_t detElemId,
     fDETransforms.AddAt(newTransform, GetDetElementIndex(detElemId));
   } 
   else 
-    Warning("Add", "The aligned volume %s is already present", 
-            alignedVolume.Data());  
+    AliWarning(Form("The aligned volume %s is already present", 
+            alignedVolume.Data()));  
 }                    
     
 //______________________________________________________________________________
@@ -154,26 +153,13 @@ 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
@@ -181,7 +167,7 @@ void  AliMUONGeometryTransformStore::Print(Option_t* /*option*/) const
          << rotation[3] << ", " << rotation[4] << ", " << rotation[5] << endl      
         << "                     "         
          << rotation[6] << ", " << rotation[7] << ", " << rotation[8] << endl;
-#endif
+
   }
 }     
 
@@ -197,7 +183,7 @@ AliMUONGeometryTransformStore::Get(Int_t detElemId) const
   if ( index >= 0 && index < fNofDetElems )
     return (const TGeoCombiTrans*)fDETransforms.At(index);
   else {
-    Warning("Get","Index %d out of limits", index);
+    AliWarning(Form("Index %d out of limits", index));
     return 0;  
   }  
 }  
index f11b4cb..35e835f 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 d6c6e37..b418222 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);
-    fPz        = momentum * TMath::Cos(theta) ;
+    fPx        = 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);
-    fPz        = momentum * TMath::Cos(theta) ;
+    fPx        = momentum * TMath::Cos(theta) ;
     fAge       = tof;
     fXref      = Xref;
     fYref      = Yref;
index 1537a7d..67f23a1 100644 (file)
@@ -23,6 +23,7 @@
 #include "AliMUONHitForRec.h" 
 #include "AliMUONRawCluster.h"
 #include "AliMUONHit.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONHitForRec) // Class implementation in ROOT context
 
@@ -102,7 +103,7 @@ AliMUONHitForRec::AliMUONHitForRec (const AliMUONHitForRec& rhs)
 {
 // Protected copy constructor
 
-  Fatal("AliMUONHitForRec", "Not implemented.");
+  AliFatal( "Not implemented.");
 }
 
   //__________________________________________________________________________
@@ -112,7 +113,7 @@ AliMUONHitForRec & AliMUONHitForRec::operator=(const AliMUONHitForRec& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal( "Not implemented.");
     
   return *this;  
 }
index 21b9825..8786063 100644 (file)
@@ -21,6 +21,7 @@
 #include "AliMUONHitMapA1.h"
 #include "AliSegmentation.h"
 #include "AliMUONDigit.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONHitMapA1)
 
@@ -54,7 +55,7 @@ AliMUONHitMapA1::AliMUONHitMapA1(const AliMUONHitMapA1 & hitMap)
 {
 // Protected copy constructor
 
-  Fatal("AliMUONHitMapA1", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
  
@@ -164,7 +165,7 @@ AliMUONHitMapA1 & AliMUONHitMapA1::operator = (const AliMUONHitMapA1 & rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal( "Not implemented.");
     
   return *this;  
 }
index bd2c00c..853c74a 100644 (file)
@@ -21,6 +21,7 @@
 //AliRoot includes
 #include "AliMUONLoader.h"
 #include "AliMUONConstants.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONLoader)
 //___________________________________________________________________
@@ -49,7 +50,7 @@ AliMUONLoader::AliMUONLoader(const AliMUONLoader& rhs)
 {
 // Protected copy constructor
 
-  Fatal("AliMUONLoader", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 //_______________________________________________________________________________
@@ -65,7 +66,7 @@ AliMUONLoader::operator=(const AliMUONLoader& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }    
index 1993a03..1584e49 100644 (file)
@@ -20,6 +20,7 @@
 #include <TError.h>
 //#include <TTree.h> 
 //#include <TDirectory.h>
+#include "AliLog.h"
 
 #include "AliMUONMerger.h"
 #include "AliMUON.h"
@@ -58,7 +59,7 @@ AliMUONMerger::AliMUONMerger(const AliMUONMerger&)
 {
 // Protected copy constructor
 
-  Fatal("AliMUONMergerModule", "Not implemented.");
+  Fatal("copy constructor","Not implemented.");
 }
 
 //------------------------------------------------------------------------
index 8d9c134..722865c 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 e13c891..6ff6ab1 100644 (file)
@@ -41,6 +41,7 @@
 #include "AliMUON.h"
 #include "AliMUONHit.h"
 #include "AliMUONDigit.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONPoints)
 
@@ -78,7 +79,7 @@ AliMUONPoints::AliMUONPoints(const AliMUONPoints& points)
 {
 // Protected copy constructor
 
-  Fatal("AliMUONPoints", "Not implemented.");
+  AliFatal("Not implemented.");
 }
         
 //_____________________________________________________________________________
@@ -247,7 +248,7 @@ AliMUONPoints& AliMUONPoints::operator= (const AliMUONPoints& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }
index a53023f..037b1f0 100644 (file)
@@ -42,6 +42,7 @@
 
 #include "AliMUONLocalTrigger.h"
 #include "AliMUONGlobalTrigger.h"
+#include "AliLog.h"
 
 const Int_t AliMUONRawData::fgkDefaultPrintLevel = 0;
 
@@ -96,7 +97,7 @@ AliMUONRawData::AliMUONRawData (const AliMUONRawData& rhs)
 {
 // Protected copy constructor
 
-  Fatal("AliMUONRawData", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 //_______________________________________________________________________
@@ -107,7 +108,7 @@ AliMUONRawData::operator=(const AliMUONRawData& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }
@@ -431,7 +432,7 @@ Int_t AliMUONRawData::WriteTriggerDDL()
   Int_t index;
   Int_t iEntries = 0;
   Int_t iLocCard, locCard;
-  Char_t locDec, trigY, posY, devX, posX,regOut;
+  Char_t locDec, trigY, posY, devX, posX;
   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
@@ -444,7 +445,7 @@ Int_t AliMUONRawData::WriteTriggerDDL()
   }
 
   if (!nEntries)
-    Error("AliMUONRawData::WriteTriggerDDL","No Trigger information available");
+    AliError("No Trigger information available");
 
   buffer = new Int_t [680]; // [16(local)*5 words + 4 words]*8(reg) + 8 words = 680
 
@@ -470,18 +471,12 @@ Int_t AliMUONRawData::WriteTriggerDDL()
 
       // Regional card header
       word = 0;
-      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
-
+      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);
       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;
@@ -533,6 +528,9 @@ 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 3bc7e81..53e5af2 100644 (file)
@@ -29,6 +29,7 @@
 #include "AliMUONRawStream.h"
 
 #include "AliRawReader.h"
+#include "AliLog.h"
 
 
 ClassImp(AliMUONRawStream)
@@ -49,13 +50,13 @@ AliMUONRawStream::AliMUONRawStream(AliRawReader* rawReader)
 AliMUONRawStream::AliMUONRawStream(const AliMUONRawStream& stream) :
   TObject(stream)
 {
-  Fatal("AliMUONRawStream", "copy constructor not implemented");
+  AliFatal("copy constructor not implemented");
 }
 
 AliMUONRawStream& AliMUONRawStream::operator = (const AliMUONRawStream& 
                                              /* stream */)
 {
-  Fatal("operator =", "assignment operator not implemented");
+  AliFatal("assignment operator not implemented");
   return *this;
 }
 
@@ -72,7 +73,7 @@ Bool_t AliMUONRawStream::Next()
 // read the next raw digit
 // returns kFALSE if there is no digit left
 
-  Fatal("Next","method not implemented for raw data input");
+  AliFatal("method not implemented for raw data input");
 
 
   return kFALSE;
index 41a4ff9..f08fd91 100644 (file)
@@ -72,6 +72,7 @@
 #include "AliMUONRecoEvent.h"
 #include "AliMUONRecoTrack.h"
 #include "AliMUONHit.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONRecoDisplay)
 
@@ -125,7 +126,7 @@ AliMUONRecoDisplay::AliMUONRecoDisplay(const AliMUONRecoDisplay& rhs)
 {
 // Protected copy constructor
 
-  Fatal("AliMUONRecoDisplay", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 //-------------------------------------------------------------------
@@ -151,7 +152,7 @@ AliMUONRecoDisplay::operator=(const AliMUONRecoDisplay& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }    
@@ -450,20 +451,20 @@ void AliMUONRecoDisplay::ShowNextEvent(Int_t delta)
       TFolder* topfold = (TFolder*)config->GetTopFolder();
       if (topfold == 0x0)
        {
-         Error("Exec","Can not get Alice top folder");
+         AliError("Can not get Alice top folder");
          return; 
        }
       TString fmdfoldname(config->GetDataFolderName()+"/"+"MUON");
       TFolder* fmdfold = (TFolder*)topfold->FindObject(fmdfoldname);
       if (fmdfold == 0x0)
        {
-         Error("Exec","Can not get MUON folder");
+         AliError("Can not get MUON folder");
          return; 
        }
       TTree* treeH = dynamic_cast<TTree*>(fmdfold->FindObject("TreeH"));
       if (treeH == 0x0)
        {
-         Error("Exec","Can not get TreeH");
+         AliError("Can not get TreeH");
          return;
        }
 /******************************************************************/     
index eebef1a..430178a 100644 (file)
@@ -54,6 +54,7 @@
 #include "AliMUONTrackHit.h"
 #include "AliRun.h"
 #include "AliHeader.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONRecoEvent)
 
@@ -73,7 +74,7 @@ AliMUONRecoEvent::AliMUONRecoEvent(const AliMUONRecoEvent& rhs)
 {
 // Protected copy constructor
 
-  Fatal("AliMUONRecoEventModule", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 //-------------------------------------------------------------------
@@ -93,7 +94,7 @@ AliMUONRecoEvent::operator=(const AliMUONRecoEvent& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }    
index 3b34ab0..572ed7f 100644 (file)
@@ -82,6 +82,7 @@ void AliMUONRecoTrack::SetHitPosition(Int_t chamber, Double_t x, Double_t y, Dou
    fPosY[chamber] = y;
    fPosZ[chamber] = z;
 }
+
 //-------------------------------------------------------------------          
 void AliMUONRecoTrack::TrackInfo()
 {
index cfe54e0..8c43883 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 970c5eb..662cb00 100644 (file)
@@ -21,6 +21,7 @@
 #include "AliMUONResponseV0.h"
 #include "AliSegmentation.h"
 
+
 ClassImp(AliMUONResponseV0)
        
 //__________________________________________________________________________
index ece2293..577e0f3 100644 (file)
@@ -30,6 +30,7 @@
 #include "AliMUONData.h"
 #include "AliMUONDigit.h"
 #include "AliMUONTransientDigit.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONSDigitizerv1)
 
@@ -65,8 +66,7 @@ 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.
-
-       if (GetDebug() > 3) Info("GetSignalFrom", "Returning TransientDigit signal.");
+       AliDebug(4,"Returning TransientDigit signal.");
        return td->Signal(); 
 };
 
@@ -74,9 +74,7 @@ Int_t AliMUONSDigitizerv1::GetSignalFrom(AliMUONTransientDigit* td)
 Bool_t AliMUONSDigitizerv1::InitOutputData(AliMUONLoader* muonloader)
 {
 // Overridden to initialise the output tree to be TreeS rather than TreeD.
-
-       if (GetDebug() > 2)
-               Info("InitOutputData", "Creating s-digits branch and setting the tree address.");
+       AliDebug(3,"Creating s-digits branch and setting the tree address.");
 
        fMUONData->SetLoader(muonloader);
 
@@ -86,7 +84,7 @@ Bool_t AliMUONSDigitizerv1::InitOutputData(AliMUONLoader* muonloader)
                muonloader->MakeSDigitsContainer();
                if (muonloader->TreeS() == NULL)
                {
-                       Error("InitOutputData", "Could not create TreeS.");
+                       AliError("Could not create TreeS.");
                        return kFALSE;
                };
        };
@@ -102,7 +100,7 @@ void AliMUONSDigitizerv1::FillOutputData()
 {
 // Overridden to fill TreeS rather than TreeD.
 
-       if (GetDebug() > 2) Info("FillOutputData", "Filling trees with s-digits.");
+       AliDebug(3,"Filling trees with s-digits.");
        fMUONData->Fill("S");
        fMUONData->ResetSDigits();
 };
@@ -111,8 +109,7 @@ void AliMUONSDigitizerv1::FillOutputData()
 void AliMUONSDigitizerv1::CleanupOutputData(AliMUONLoader* muonloader)
 {
 // Overridden to write and then cleanup TreeS that was initialised in InitOutputData.
-
-       if (GetDebug() > 2) Info("CleanupOutputData", "Writing s-digits and releasing pointers.");
+       AliDebug(3,"Writing s-digits and releasing pointers.");
        muonloader->WriteSDigits("OVERWRITE");
        fMUONData->ResetSDigits();
        muonloader->UnloadSDigits();
index 134d5cf..bc871f8 100644 (file)
@@ -32,6 +32,7 @@
 #include "AliMUONHitForRec.h" 
 #include "AliMUONTrackParam.h" 
 #include "AliRun.h" // for gAlice
+#include "AliLog.h" 
 
 ClassImp(AliMUONSegment) // Class implementation in ROOT context
 
@@ -57,7 +58,6 @@ 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,7 +79,6 @@ 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;
@@ -106,7 +105,7 @@ AliMUONSegment::AliMUONSegment (const AliMUONSegment& theMUONSegment)
 {
 // Protected copy constructor
 
-  Fatal("AliMUONSegment", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 AliMUONSegment & AliMUONSegment::operator=(const AliMUONSegment& rhs)
@@ -115,7 +114,7 @@ AliMUONSegment & AliMUONSegment::operator=(const AliMUONSegment& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }
@@ -177,7 +176,7 @@ Double_t AliMUONSegment::NormalizedChi2WithSegment(AliMUONSegment* Segment, Doub
 }
 
   //__________________________________________________________________________
-AliMUONSegment* AliMUONSegment::CreateSegmentFromLinearExtrapToStation ( Double_t z, Double_t MCSfactor) const
+AliMUONSegment* AliMUONSegment::CreateSegmentFromLinearExtrapToStation (Int_t Station, Double_t MCSfactor) const
 {
   // Extrapolates linearly the current Segment (this) to station (0..) "Station".
   // Multiple Coulomb scattering calculated from "MCSfactor"
@@ -190,9 +189,10 @@ AliMUONSegment* AliMUONSegment::CreateSegmentFromLinearExtrapToStation ( Double_
   // 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"
-  Double_t dZ =  z - this->GetZ();
+  AliMUON *pMUON = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
+  Double_t dZ =
+    (&(pMUON->Chamber(2 * Station)))->Z() - (this->fHitForRecPtr1)->GetZ();
   // Data in bending plane
-  extrapSegment->fZ = z;
   //  coordinate
   extrapSegment->fBendingCoor = this->fBendingCoor + this->fBendingSlope * dZ;
   //  slope
@@ -220,7 +220,7 @@ AliMUONSegment* AliMUONSegment::CreateSegmentFromLinearExtrapToStation ( Double_
 }
 
   //__________________________________________________________________________
-AliMUONHitForRec* AliMUONSegment::CreateHitForRecFromLinearExtrapToChamber ( Double_t z, Double_t MCSfactor) const
+AliMUONHitForRec* AliMUONSegment::CreateHitForRecFromLinearExtrapToChamber (Int_t Chamber, Double_t MCSfactor) const
 {
   // Extrapolates linearly the current Segment (this) to chamber(0..) "Chamber".
   // Multiple Coulomb scattering calculated from "MCSfactor"
@@ -231,9 +231,10 @@ AliMUONHitForRec* AliMUONSegment::CreateHitForRecFromLinearExtrapToChamber ( Dou
   // 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
-  Double_t dZ = z - this->GetZ();
+  AliMUON *pMUON = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
+  Double_t dZ =
+    (&(pMUON->Chamber(Chamber)))->Z() - (this->fHitForRecPtr1)->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
@@ -319,8 +320,6 @@ 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 f91c386..e912024 100644 (file)
@@ -37,15 +37,13 @@ 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 (Double_t z, Double_t MCSfactor) const;
+  AliMUONSegment* CreateSegmentFromLinearExtrapToStation (Int_t Station, Double_t MCSfactor) const;
   Double_t NormalizedChi2WithSegment(AliMUONSegment* Segment, Double_t Sigma2Cut) const;
-  AliMUONHitForRec* CreateHitForRecFromLinearExtrapToChamber (Double_t z, Double_t MCSfactor) const;
+  AliMUONHitForRec* CreateHitForRecFromLinearExtrapToChamber (Int_t Chamber, 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 ????
@@ -75,7 +73,6 @@ 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 3e3ec09..98ee5bb 100644 (file)
@@ -28,6 +28,7 @@
 #include <TString.h>
 
 #include "AliMUONSegmentIndex.h"
+#include "AliLog.h"
 
 //___________________________________________
 ClassImp(AliMUONSegmentIndex)
@@ -78,5 +79,5 @@ TString AliMUONSegmentIndex::Name(Int_t padx, Int_t pady, Int_t cathode)
 void AliMUONSegmentIndex::Print() const
 {
   // Printing information of AliMUONSegmentIndex
-  Info("Print", "Name=%s Id=%d PadX=%d PadY=%d Cathode=%d\n",fName.Data(),fChannelId,fPadX,fPadY,fCathode);   
+  AliInfo(Form("Name=%s Id=%d PadX=%d PadY=%d Cathode=%d\n",fName.Data(),fChannelId,fPadX,fPadY,fCathode));   
 }
index 038922d..8e068f9 100644 (file)
@@ -28,6 +28,7 @@
 #include <TString.h>
 
 #include "AliMUONSegmentManuIndex.h"
+#include "AliLog.h"
 
 //___________________________________________
 ClassImp(AliMUONSegmentManuIndex)
@@ -78,5 +79,5 @@ TString AliMUONSegmentManuIndex::Name(Int_t manuid, Int_t manuchannel)
 void AliMUONSegmentManuIndex::Print() const
 {
   // Printing AliMUONSegmentManuIndex information
-  Info("Print","Name=%s Id=%d BusPatch=%d ManuId=%d ManuChannelId=%d\n",fName.Data(),fChannelId,fBusPatchId,fManuId,fManuChannelId);   
+  AliInfo(Form("Name=%s Id=%d BusPatch=%d ManuId=%d ManuChannelId=%d\n",fName.Data(),fChannelId,fBusPatchId,fManuId,fManuChannelId));   
 }
index 5aae595..c3b52e3 100644 (file)
@@ -28,6 +28,7 @@
 #include <TMath.h>
 
 #include "AliMUONSegmentPosition.h"
+#include "AliLog.h"
 
 //___________________________________________
 ClassImp(AliMUONSegmentPosition)
@@ -93,5 +94,5 @@ TString AliMUONSegmentPosition::Name(Float_t x, Float_t y, Int_t cathode)
 void AliMUONSegmentPosition::Print() const
 {
   // Printing AliMUONSegmentManuIndex information
-  Info("Print","Name=%s Id=%d X=%f Y=%f Cathode=%d\n",fName.Data(),fChannelId, fX, fY,fCathode);   
+  AliInfo(Form("Name=%s Id=%d X=%f Y=%f Cathode=%d\n",fName.Data(),fChannelId, fX, fY,fCathode));   
 }
index 373d627..43b45c7 100644 (file)
@@ -41,6 +41,7 @@
 #include "AliMUONSegmentManuIndex.h"
 #include "AliMUONSegmentPosition.h"
 #include "AliMUONSegmentIndex.h"
+#include "AliLog.h"
 
 //___________________________________________
 ClassImp(AliMUONSegmentationDetectionElement)
@@ -81,7 +82,7 @@ AliMUONSegmentationDetectionElement::AliMUONSegmentationDetectionElement(const A
 {
 // Protected copy constructor
 
-  Fatal("AliMUONSegmentationDetectionElementModule", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 //_________________________________________________
 AliMUONSegmentationDetectionElement::~AliMUONSegmentationDetectionElement(){
@@ -131,7 +132,7 @@ AliMUONSegmentIndex *  AliMUONSegmentationDetectionElement::FindIndexFromPositio
     }
   }
  if (!foundsegmentindex) {
-   Warning("FindIndexFromPosition","Not found Index for position x=%5.2f y=%5.2f \n",x,y);
+   AliWarning(Form("Not found Index for position x=%5.2f y=%5.2f \n",x,y));
  }    
  return foundsegmentindex;
 }
@@ -157,8 +158,8 @@ AliMUONSegmentIndex * AliMUONSegmentationDetectionElement::GetIndex( const char
   // Getting AliMUONSegmentIndex from name of AliMUONSegmentManuIndex
   if (fMapManuIndexIndex) return  (AliMUONSegmentIndex*)  fMapManuIndexIndex->GetValue(SegmentManuIndexName);
   else {
-    Warning("GetIndex","SegmentManuIndex %s out of DetectionElement Mapping %s",
-           SegmentManuIndexName,fDetectionElementType.Data());
+    AliWarning(Form("SegmentManuIndex %s out of DetectionElement Mapping %s",
+           SegmentManuIndexName,fDetectionElementType.Data()));
     return 0x0;
   }
 }
@@ -174,8 +175,8 @@ AliMUONSegmentManuIndex * AliMUONSegmentationDetectionElement::GetManuIndex( con
   // Getting ManuIndex from manuname
   if (fMapIndexManuIndex) return (AliMUONSegmentManuIndex*) fMapIndexManuIndex->GetValue(SegmentIndexName);
   else {
-    Warning("GetManuIndex","SegmentIndex %s out of Detection Element mapping %s",
-           SegmentIndexName,fDetectionElementType.Data());
+    AliWarning(Form("SegmentIndex %s out of Detection Element mapping %s",
+           SegmentIndexName,fDetectionElementType.Data()));
     return 0x0;
   }
 }
@@ -196,7 +197,7 @@ void  AliMUONSegmentationDetectionElement::GetPadI(Float_t x, Float_t y, Int_t c
     pady = segmentindex->GetPadY();
   }
   else {
-    Warning("GetPadI","Not found Index for position x=%5.2f y=%5.2f \n",x,y);
+    AliWarning(Form("Not found Index for position x=%5.2f y=%5.2f \n",x,y));
   }    
 }
 //_________________________________________________
@@ -211,8 +212,8 @@ AliMUONSegmentPosition  * AliMUONSegmentationDetectionElement::GetPosition( cons
   // Getting position from indexname
   if (fMapIndexPosition) return (AliMUONSegmentPosition*) fMapIndexPosition->GetValue(SegmentIndexName);
   else {
-    Warning("GetPosition","SegmentIndex %s out of DetectionElement mapping %s",
-           SegmentIndexName, fDetectionElementType.Data());
+    AliWarning(Form("SegmentIndex %s out of DetectionElement mapping %s",
+           SegmentIndexName, fDetectionElementType.Data()));
     return 0x0;
   }
 }
@@ -228,8 +229,8 @@ AliMUONSegmentIndex * AliMUONSegmentationDetectionElement::GetIndexFromPosition(
   // Getting index form positionname
   if (fMapPositionIndex) return  (AliMUONSegmentIndex*)  fMapPositionIndex->GetValue(PositionName);
   else {
-    Warning("GetIndexFromPosition","SegmentPosition %s out of DetectionElement Mapping %s",
-           PositionName,fDetectionElementType.Data());
+    AliWarning(Form("SegmentPosition %s out of DetectionElement Mapping %s",
+           PositionName,fDetectionElementType.Data()));
     return 0x0;
   }
 }
@@ -240,8 +241,8 @@ AliMUONSegmentManuIndex * AliMUONSegmentationDetectionElement::FindManuIndex( co
   // Getting AliMUONSegmentManuIndex objecto from manu index
   if (fMapManuIndexIndex) return (AliMUONSegmentManuIndex*) fMapManuIndexIndex->FindObject(ManuIndexName);
   else  {
-    Warning("FindManuIndex","SegmentManuIndex %s out of DetectionElement mapping %s",
-           ManuIndexName,fDetectionElementType.Data());
+    AliWarning(Form("SegmentManuIndex %s out of DetectionElement mapping %s",
+           ManuIndexName,fDetectionElementType.Data()));
     return 0x0;
   }
 }
@@ -252,8 +253,8 @@ AliMUONSegmentIndex * AliMUONSegmentationDetectionElement::FindIndex(const char*
   // Getting 
   if (fMapIndexPosition) return (AliMUONSegmentIndex *) fMapIndexPosition->FindObject(IndexName);
   else {
-    Warning("FindIndex","SegmentIndex %s out of DetectionElement mapping %s",
-           IndexName,fDetectionElementType.Data());
+    AliWarning(Form("SegmentIndex %s out of DetectionElement mapping %s",
+           IndexName,fDetectionElementType.Data()));
     return 0x0;
   }
 }
@@ -287,11 +288,11 @@ void    AliMUONSegmentationDetectionElement::Init(const char * DetectionElementT
   Int_t icathode;
   //Bendingplane
   icathode=0;
-  Info("ReadingSegmentationMappingFile","%s", fSegmentationMappingFileBending.Data());
+  AliInfo(Form("%s", fSegmentationMappingFileBending.Data()));
   ReadingSegmentationMappingFile(fSegmentationMappingFileBending ,icathode);
   //NonBendingplane
   icathode=1;
-  Info("Init","Reading mapping file is %s\n", fSegmentationMappingFileNonBending.Data());
+  AliInfo(Form("Reading mapping file is %s\n", fSegmentationMappingFileNonBending.Data()));
   ReadingSegmentationMappingFile(fSegmentationMappingFileNonBending,icathode);
   
 }
@@ -300,7 +301,7 @@ void AliMUONSegmentationDetectionElement::ReadingSegmentationMappingFile(TString
 { 
   ifstream in( infile,  ios::in);
   if (!in) {
-    Error("ReadingSegmentationMappingFile", "File not found.");
+    AliError("File not found.");
   }
   else {
     Int_t id, ix, iy, idmanu, idchannel;
index 22fa022..13798bb 100644 (file)
@@ -27,7 +27,8 @@
 #include "AliMUON.h"
 #include "AliMUONChamber.h"
 #include "AliRun.h"
-#include "AliMUONConstants.h"
+#include "AliLog.h"
+
 //___________________________________________
 ClassImp(AliMUONSegmentationSlat)
 
@@ -56,7 +57,7 @@ AliMUONSegmentationSlat::AliMUONSegmentationSlat(const AliMUONSegmentationSlat&
 {
 // Protected copy constructor
 
-  Fatal("AliMUONSegmentationSlatModule", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 AliMUONSegmentationSlat::~AliMUONSegmentationSlat(){
@@ -80,11 +81,12 @@ AliMUONSegmentationSlat::operator=(const AliMUONSegmentationSlat& rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }    
           
+
 //-----------------------------------------------------------
 void AliMUONSegmentationSlat::SetPadSize(Float_t p1, Float_t p2)
 {
@@ -93,7 +95,6 @@ void AliMUONSegmentationSlat::SetPadSize(Float_t p1, Float_t p2)
     fDpx=p1;
     fDpy=p2;
 }
-
 //-----------------------------------------------------------
 Float_t AliMUONSegmentationSlat::GetAnod(Float_t xhit) const
 {
@@ -101,23 +102,20 @@ 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
 {
@@ -145,8 +143,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];
     }
 }
 
@@ -158,7 +156,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 
@@ -167,37 +165,32 @@ 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++) {       //Loop on all slats (longuer but more secure)
-       index = i;
+    for (i=0; i<fNSlats; i+=1) {       //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 {
+      islat = -1; xlocal=-1; ylocal = -1; }
+    else {
+      ylocal = y   -fYPosition[index];
+      xlocal = xabs-fXPosition[index];
       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
 {
@@ -222,7 +215,6 @@ 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
 {
@@ -234,21 +226,16 @@ 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]);
-
-//     z = (TMath::Even(islat)) ?     fDz : -fDz ; //Change for new referential
-//     z = (x>0)                ? z+2.*fDz : z-2.*fDz ; 
-//     z+=fChamber->Z();
+    x = (xlocal+fXPosition[islat])*fSym;
+    y=(ylocal+fYPosition[islat]);
 
-// z-position
-    z = (TMath::Even(islat)) ?      -fDzSlat : fDzSlat ; //Change for new referential
-    z = (x>0)                ?  -z + fDzCh : z - fDzCh; 
-    z += fChamber->Z();
+    z = (TMath::Even(islat)) ?     fDz : -fDz ; //Change for new referential
+    z = (x>0)                ? z+2.*fDz : z-2.*fDz ; 
 
+    z+=fChamber->Z();
 }
 
-//_________________________________________________
+
 void AliMUONSegmentationSlat::LocalToGlobal (
     Int_t islat, Int_t ixlocal, Int_t iylocal, Int_t &ix, Int_t &iy) const
 {
@@ -265,21 +252,19 @@ 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)
 {
@@ -290,17 +275,16 @@ 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)
 {
@@ -312,19 +296,18 @@ 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)) ?      -fDzSlat : fDzSlat ; //Change for new referential
-    z  = (x>0)                ?  -z + fDzCh : z - fDzCh
+    z = (TMath::Even(islat)) ?      fDz : -fDz ; //Change for new referential
+    z = (x>0)                ?  z+2.*fDz : z-2.*fDz 
     z += fChamber->Z();
 }
 
-//_________________________________________________
 Int_t AliMUONSegmentationSlat::ISector()
 {
 // Returns current sector during tracking
@@ -334,7 +317,6 @@ 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)
@@ -346,7 +328,7 @@ Int_t AliMUONSegmentationSlat::Sector(Int_t ix, Int_t iy)
     return 100*islat+iregion;
 }
 
-//_________________________________________________
+
 void AliMUONSegmentationSlat::SetPad(Int_t ix, Int_t iy)
 {
     //
@@ -362,7 +344,6 @@ 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
@@ -380,7 +361,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)
 {
@@ -399,7 +380,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
@@ -407,7 +388,7 @@ void AliMUONSegmentationSlat::NextPad()
     fCurrentSlat->NextPad();
 }
 
-//_________________________________________________
+
 Int_t AliMUONSegmentationSlat::MorePads()
 // Stopping condition for the iterator over pads
 //
@@ -416,7 +397,6 @@ Int_t AliMUONSegmentationSlat::MorePads()
     return fCurrentSlat->MorePads();
 }
 
-//_________________________________________________
 void AliMUONSegmentationSlat::
 IntegrationLimits(Float_t& x1,Float_t& x2,Float_t& y1, Float_t& y2)
 {
@@ -427,7 +407,6 @@ 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])
 {
@@ -445,7 +424,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
@@ -462,7 +441,7 @@ Int_t  AliMUONSegmentationSlat::Ix()
     return ix;
 }
 
-//_________________________________________________
+
 Int_t  AliMUONSegmentationSlat::Iy()
 {
 // Return current pad coordinate iy during stepping
@@ -473,10 +452,11 @@ 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;
@@ -485,10 +465,9 @@ 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;
@@ -498,7 +477,8 @@ void  AliMUONSegmentationSlat::SigGenInit(Float_t x, Float_t y, Float_t z)
     Slat(islat)->SigGenInit(xlocal, ylocal, z);
 }
 
-//_________________________________________________
+
+
 void AliMUONSegmentationSlat::Init(Int_t chamber)
 {
 //    
@@ -513,15 +493,12 @@ 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
@@ -545,7 +522,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();
@@ -562,7 +539,10 @@ 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)
@@ -574,28 +554,18 @@ 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
 {
@@ -603,11 +573,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; 
@@ -619,9 +589,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");
@@ -637,24 +607,25 @@ 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 2082a92..b63991b 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 SetSlatYPositions(Float_t *ypos);    
+    virtual void SetSlatYPosition(Float_t ypos) {fYPosOrigin = ypos;}    
     virtual AliMUONSegmentationSlatModule* Slat(Int_t index) const;
     
 // Not used
@@ -167,16 +167,15 @@ 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    fDzSlat;                           // Half distance between slat planes
-    Float_t    fDzCh;                             // Half distance between half-chamber planes
-
+    Float_t    fDz;                               // Half distance between slat 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,2)            // Segmentation for Muon Chamber built from Slat Modules
+    ClassDef(AliMUONSegmentationSlat,1)            // Segmentation for Muon Chamber built from Slat Modules
 };
        
 
index 7988c2c..8b599d8 100644 (file)
@@ -24,6 +24,7 @@
 #include <TArrayF.h>
 
 #include "AliMUONSegmentationSlatModule.h"
+#include "AliLog.h"
 
 //___________________________________________
 ClassImp(AliMUONSegmentationSlatModule)
@@ -54,7 +55,7 @@ AliMUONSegmentationSlatModule::AliMUONSegmentationSlatModule(
 {
 // Protected copy constructor
 
-  Fatal("AliMUONSegmentationSlatModule", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 
@@ -74,7 +75,7 @@ AliMUONSegmentationSlatModule::operator=(
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }    
index 6d9697b..40716f4 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 289cc1c..d3b26e0 100644 (file)
@@ -26,6 +26,7 @@
 #include "AliRun.h"
 #include "AliMUON.h"
 #include "AliMUONChamber.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONSegmentationTrigger)
 
@@ -45,7 +46,7 @@ void AliMUONSegmentationTrigger::Init(Int_t chamber)
   AliMUON *pMUON  = (AliMUON *) gAlice->GetModule("MUON");
   AliMUONChamber* iChamber=&(pMUON->Chamber(chamber));
 
-  if(pMUON->GetDebug()>1) printf("%s: Initialize Trigger Chamber Module Geometry\n",ClassName());
+  AliDebug(2,"Initialize Trigger Chamber Module Geometry");
 
   Float_t zPos=iChamber->Z();
   Float_t z1Pos=AliMUONConstants::DefaultChamberZ(10); //cp changed
@@ -61,8 +62,7 @@ void AliMUONSegmentationTrigger::Init(Int_t chamber)
   Float_t z1pm=z1PosPlus/z1PosMinus;
   Float_t z1mp=z1PosMinus/z1PosPlus;
 
-  if(pMUON->GetDebug()>1) printf("%s: fZscale = %f \n",ClassName(),fZscale);
-  
+  AliDebug(2,Form("fZscale = %f ",fZscale));
 // calculate yCmin and fYcmax 
   Int_t i;  
   for (i=62; i>=0; i--) {
index bb54e5b..96813e0 100644 (file)
@@ -25,6 +25,7 @@
 #include "AliMUONTriggerConstants.h"
 #include "AliMUONChamber.h"
 #include "AliRun.h"  // gAlice
+#include "AliLog.h"
 
 ClassImp(AliMUONSegmentationTriggerX)
 
@@ -32,8 +33,7 @@ ClassImp(AliMUONSegmentationTriggerX)
 void AliMUONSegmentationTriggerX::Init(Int_t chamber)
 {
 // intialize X segmentation 
-  AliMUON *pMUON  = (AliMUON *) gAlice->GetModule("MUON");
-  if(pMUON->GetDebug()>1) printf("%s: Initialize Trigger Chamber Geometry X\n",ClassName());
+  AliDebug(2,"Initialize Trigger Chamber Geometry X");
   AliMUONSegmentationTrigger::Init(chamber);
 
 // calculate x & y position of X strips
index d6c6507..4060d55 100644 (file)
@@ -21,6 +21,7 @@
 #include "AliMUONTriggerConstants.h"
 #include "AliMUON.h"
 #include "AliRun.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONSegmentationTriggerY)
 
@@ -35,8 +36,7 @@ AliMUONSegmentationTriggerY::AliMUONSegmentationTriggerY()
 void AliMUONSegmentationTriggerY::Init(Int_t chamber)
 {
 // intialize Y segmentation 
-  AliMUON *pMUON  = (AliMUON *) gAlice->GetModule("MUON");
-  if(pMUON->GetDebug()>1) printf("%s: Initialize Trigger Chamber Geometry Y\n",ClassName());
+  AliDebug(2,"Initialize Trigger Chamber Geometry Y");
   AliMUONSegmentationTrigger::Init(chamber);  
 
 // calculate x & y position of Y strips
index cc70079..6f87562 100644 (file)
@@ -22,6 +22,7 @@
 #include "AliMUONChamber.h"
 #include "AliRun.h"
 #include "AliMUON.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONSegmentationV0)
 
@@ -37,7 +38,7 @@ AliMUONSegmentationV0::AliMUONSegmentationV0(const AliMUONSegmentationV0& segmen
 {
 // Protected copy constructor
 
-  Fatal("AliMUONSegmentationV0", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 
@@ -340,7 +341,7 @@ AliMUONSegmentationV0::operator =(const AliMUONSegmentationV0 & rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }
index 758f32a..9b91862 100644 (file)
@@ -32,6 +32,7 @@
 #include "AliMUON.h"
 #include "AliMUONChamber.h"
 #include "AliRun.h"
+#include "AliLog.h"
 
 
 
@@ -43,7 +44,7 @@ AliMUONSegmentationV01::AliMUONSegmentationV01(const AliMUONSegmentationV01& seg
 {
 // Protected copy constructor
 
-  Fatal("AliMUONSegmentationV01", "Not implemented.");
+  AliFatal("Not implemented.");
 }
 
 AliMUONSegmentationV01::AliMUONSegmentationV01() 
@@ -678,7 +679,7 @@ AliMUONSegmentationV01::operator =(const AliMUONSegmentationV01 & rhs)
 
   if (this == &rhs) return *this;
 
-  Fatal("operator=", "Not implemented.");
+  AliFatal("Not implemented.");
     
   return *this;  
 }
index 58ea345..ad77e7a 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)
@@ -57,8 +58,7 @@ AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder()
 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(const AliMUONSlatGeometryBuilder& rhs)
   : AliMUONVGeometryBuilder(rhs)
 {
-  Fatal("Copy constructor", 
-        "Copy constructor is not implemented.");
+  AliFatal("Copy constructor is not implemented.");
 }
 
 //______________________________________________________________________________
@@ -73,8 +73,7 @@ AliMUONSlatGeometryBuilder::operator = (const AliMUONSlatGeometryBuilder& rhs)
   // check assignement to self
   if (this == &rhs) return *this;
 
-  Fatal("operator=", 
-        "Assignment operator is not implemented.");
+  AliFatal("Assignment operator is not implemented.");
     
   return *this;  
 }
@@ -86,1036 +85,968 @@ 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 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;
+     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;
       
-  AliMUONChamber *iChamber, *iChamber1, *iChamber2;
+    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;
-     
-  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 (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
+     //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
         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 = 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) );
-       }
-      }
+        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) );
+       }
+     }
      
-      // create the panel volume 
+     // create the panel volume 
  
-      gMC->Gsvolu("S05C","BOX",kCarbonMaterial,panelpar,3);
-      gMC->Gsvolu("SB5C","BOX",kCarbonMaterial,panelpar2,3);
-      gMC->Gsvolu("S06C","BOX",kCarbonMaterial,panelpar,3);
+     gMC->Gsvolu("S05C","BOX",kPanelMaterial,panelpar,3);
+     gMC->Gsvolu("SB5C","BOX",kPanelMaterial,panelpar2,3);
+     gMC->Gsvolu("S06C","BOX",kPanelMaterial,panelpar,3);
  
-      // create the nomex volume (honey comb)
+     // create the rohacell volume 
 
-      gMC->Gsvolu("S05N","BOX",kNomexMaterial,nomexpar,3);
-      gMC->Gsvolu("SB5N","BOX",kNomexMaterial,nomexpar2,3);
-      gMC->Gsvolu("S06N","BOX",kNomexMaterial,nomexpar,3);
+     gMC->Gsvolu("S05R","BOX",kRohaMaterial,rohapar,3);
+     gMC->Gsvolu("SB5R","BOX",kRohaMaterial,rohapar2,3);
+     gMC->Gsvolu("S06R","BOX",kRohaMaterial,rohapar,3);
  
-      // 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);
+     // create the insulating material volume 
 
-      // 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);
+     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] - 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.));
+          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.));
  
-         
-       }
-      }
-
-      // 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 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 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 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("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;  
+     // 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;   
     }
     
-  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.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) );
+     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) );
  
-      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) );
-      }
-    }
+       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) );
+       }
+     }
      
-    // create the panel volume 
+     // create the panel volume 
  
-    gMC->Gsvolu("S07C","BOX",kCarbonMaterial,panelpar,3);
-    gMC->Gsvolu("S08C","BOX",kCarbonMaterial,panelpar,3);
+     gMC->Gsvolu("S07C","BOX",kPanelMaterial,panelpar,3);
+     gMC->Gsvolu("S08C","BOX",kPanelMaterial,panelpar,3);
 
-    // create the nomex volume 
+     // create the rohacell volume 
 
-    gMC->Gsvolu("S07N","BOX",kNomexMaterial,nomexpar,3);
-    gMC->Gsvolu("S08N","BOX",kNomexMaterial,nomexpar,3);
+     gMC->Gsvolu("S07R","BOX",kRohaMaterial,rohapar,3);
+     gMC->Gsvolu("S08R","BOX",kRohaMaterial,rohapar,3);
 
+     // create the insulating material volume 
 
-    // create the nomex volume (bulk)
+     gMC->Gsvolu("S07I","BOX",kInsuMaterial,insupar,3);
+     gMC->Gsvolu("S08I","BOX",kInsuMaterial,insupar,3);
 
-    gMC->Gsvolu("S07X","BOX",kNomexBMaterial,nomexbpar,3);
-    gMC->Gsvolu("S08X","BOX",kNomexBMaterial,nomexbpar,3);
+     // create the PCB volume 
 
-    // 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);
+     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] - 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 ;
+     // 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.;
        
-      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,0.),3,divpar);
+        GetEnvelopes(6)->AddEnvelopeConstituentParam("S07G",idSlatCh7, quadrant*100+imax+4*idiv+1,
+                                                     TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
         
-       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;
+        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;
 
-  }
+    }
     
-  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.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) );
+     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;
  
-      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 
+       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) );
  
-    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);
-
+       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 
+     gMC->Gsvolu("S09C","BOX",kPanelMaterial,panelpar,3);
+     gMC->Gsvolu("S10C","BOX",kPanelMaterial,panelpar,3);
 
-    // create the nomex volume (bulk)
+     // create the rohacell volume 
 
-    gMC->Gsvolu("S09X","BOX",kNomexBMaterial,nomexbpar,3);
-    gMC->Gsvolu("S10X","BOX",kNomexBMaterial,nomexbpar,3);
+     gMC->Gsvolu("S09R","BOX",kRohaMaterial,rohapar,3);
+     gMC->Gsvolu("S10R","BOX",kRohaMaterial,rohapar,3);
 
-    // create the insulating material volume 
+     // create the insulating material volume 
 
-    gMC->Gsvolu("S09I","BOX",kInsuMaterial,insupar,3);
-    gMC->Gsvolu("S10I","BOX",kInsuMaterial,insupar,3);
+     gMC->Gsvolu("S09I","BOX",kInsuMaterial,insupar,3);
+     gMC->Gsvolu("S10I","BOX",kInsuMaterial,insupar,3);
 
-    // create the PCB volume 
+     // create the PCB volume 
 
-    gMC->Gsvolu("S09P","BOX",kPcbMaterial,pcbpar,3);
-    gMC->Gsvolu("S10P","BOX",kPcbMaterial,pcbpar,3);
+     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.; // 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");
-    }
-
+     // 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;
 
-    // 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 c8ad0fa..e282d87 100644 (file)
@@ -15,6 +15,7 @@
 #include "AliMUONChamber.h"
 #include "AliMUONChamberGeometry.h"
 #include "AliMUONGeometryEnvelopeStore.h"
+#include "AliLog.h"
 
 ClassImp(AliMUONSt1GeometryBuilder)
 
@@ -43,8 +44,7 @@ AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder(const AliMUONSt1GeometryBui
 {
 // Protected copy constructor
 
-  Fatal("Copy constructor", 
-        "Copy constructor is not implemented.");
+  AliFatal("Copy constructor is not implemented.");
 }