]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add class AliMUONConstants with MUON specific constants using static memeber data...
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 Jun 2000 14:02:38 +0000 (14:02 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 Jun 2000 14:02:38 +0000 (14:02 +0000)
MUON/AliMUON.cxx
MUON/AliMUONConstants.cxx [new file with mode: 0644]
MUON/AliMUONConstants.h [new file with mode: 0644]
MUON/AliMUONDisplay.cxx
MUON/AliMUONv0.cxx
MUON/AliMUONv1.cxx
MUON/MUONLinkDef.h
MUON/Makefile

index 688e2265afb7c602f7d2e8c37e2b03edfb15ddd1..e6ab172047cefdd3d2d54c2ba45bcfa4ef11a41b 100644 (file)
  **************************************************************************/
 /*
 $Log$
+Revision 1.19  2000/06/22 13:40:51  morsch
+scope problem on HP, "i" declared once
+pow changed to TMath::Power (PH, AM)
+
 Revision 1.18  2000/06/15 07:58:48  morsch
 Code from MUON-dev joined
 
@@ -111,7 +115,7 @@ Log message added
 #include "AliMUONHitMap.h"
 #include "AliMUONHitMapA1.h"
 #include "AliMUONChamberTrigger.h"
-
+#include "AliMUONConstants.h"
 #include "AliMUONClusterFinder.h"
 #include "AliMUONTriggerDecision.h"
 #include "AliRun.h"
@@ -133,9 +137,6 @@ Log message added
 //     for trigger chambers,
 //          according to (Z1 = zch) and  (Z2 = zch + DTPLANES)
 //          for the first and second chambers in the station, respectively
-static const Float_t kDefaultChambersZ[kNCH] =
-{518., 538., 680., 700., 965., 985., 1239., 1259., 1439., 1459.,
- 1603.5, 1618.5, 1703.5, 1718.5}; 
 
 ClassImp(AliMUON)
 //___________________________________________
@@ -165,29 +166,29 @@ AliMUON::AliMUON(const char *name, const char *title)
 <img src="gif/alimuon.gif">
 */
 //End_Html
+
    fHits     = new TClonesArray("AliMUONHit",1000);
    gAlice->AddHitList(fHits);
    fPadHits = new TClonesArray("AliMUONPadHit",10000);
    fNPadHits  =  0;
    fIshunt     =  0;
 
-   fNdch      = new Int_t[kNCH];
+   fNdch      = new Int_t[AliMUONConstants::NCh()];
 
-   fDchambers = new TObjArray(kNCH);
+   fDchambers = new TObjArray(AliMUONConstants::NCh());
 
    Int_t i;
    
-   for (i=0; i<kNCH ;i++) {
+   for (i=0; i<AliMUONConstants::NCh() ;i++) {
        (*fDchambers)[i] = new TClonesArray("AliMUONDigit",10000); 
        fNdch[i]=0;
    }
 
-   fNrawch      = new Int_t[kNTrackingCh];
+   fNrawch      = new Int_t[AliMUONConstants::NTrackingCh()];
 
-   fRawClusters = new TObjArray(kNTrackingCh);
+   fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh());
 
-   for (i=0; i<kNTrackingCh;i++) {
+   for (i=0; i<AliMUONConstants::NTrackingCh();i++) {
        (*fRawClusters)[i] = new TClonesArray("AliMUONRawCluster",10000); 
        fNrawch[i]=0;
    }
@@ -209,18 +210,13 @@ AliMUON::AliMUON(const char *name, const char *title)
 //
 //
 //
-//  inner diameter
-   const Float_t kDmin[7]={ 35.,  47.,  66.,   80.,  80., 100., 100.};
-//
-//  outer diameter
-   const Float_t kDmax[7]={183., 245., 316.6,  520.,  520., 830., 880.};
-//
+
     Int_t ch;
 
-    fChambers = new TObjArray(kNCH);
+    fChambers = new TObjArray(AliMUONConstants::NCh());
 
     // Loop over stations
-    for (Int_t st = 0; st < kNCH / 2; st++) {
+    for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) {
       // Loop over 2 chambers in the station
        for (Int_t stCH = 0; stCH < 2; stCH++) {
 //
@@ -230,7 +226,7 @@ AliMUON::AliMUON(const char *name, const char *title)
 
            ch = 2 * st + stCH;
 //
-           if (ch < kNTrackingCh) {
+           if (ch < AliMUONConstants::NTrackingCh()) {
                (*fChambers)[ch] = new AliMUONChamber();
            } else {
                (*fChambers)[ch] = new AliMUONChamberTrigger();
@@ -240,11 +236,11 @@ AliMUON::AliMUON(const char *name, const char *title)
            
            chamber->SetGid(0);
            // Default values for Z of chambers
-           chamber->SetZ(kDefaultChambersZ[ch]);
+           chamber->SetZ(AliMUONConstants::DefaultChamberZ(ch));
 //
-           chamber->InitGeo(kDefaultChambersZ[ch]);
-           chamber->SetRInner(kDmin[st]/2);
-           chamber->SetROuter(kDmax[st]/2);
+           chamber->InitGeo(AliMUONConstants::DefaultChamberZ(ch));
+           chamber->SetRInner(AliMUONConstants::Dmin(st)/2);
+           chamber->SetROuter(AliMUONConstants::Dmax(st)/2);
 //
        } // Chamber stCH (0, 1) in 
     }     // Station st (0...)
@@ -257,8 +253,8 @@ AliMUON::AliMUON(const char *name, const char *title)
    fCurIterPad   = 0;
 
    // cp new design of AliMUONTriggerDecision
-   fTriggerCircuits = new TObjArray(kNTriggerCircuit);
-   for (Int_t circ=0; circ<kNTriggerCircuit; circ++) {
+   fTriggerCircuits = new TObjArray(AliMUONConstants::NTriggerCircuit());
+   for (Int_t circ=0; circ<AliMUONConstants::NTriggerCircuit(); circ++) {
      (*fTriggerCircuits)[circ] = new AliMUONTriggerCircuit();     
    }
    // cp new design of AliMUONTriggerDecision
@@ -275,36 +271,35 @@ AliMUON::AliMUON(const AliMUON& rMUON)
 
 AliMUON::~AliMUON()
 {
-
     printf("Calling AliMUON destructor !!!\n");
     
-  Int_t i;
-  fIshunt  = 0;
-  delete fHits;
-  delete fPadHits;
-
-  delete fGlobalTrigger;
-  fNGlobalTrigger = 0;
-
-  delete fLocalTrigger;
-  fNLocalTrigger = 0;
-
-  for (i=0;i<kNCH;i++) {
-      delete (*fDchambers)[i];
-      fNdch[i]=0;
-  }
-  delete fDchambers;
-
-  for (i=0;i<kNTrackingCh;i++) {
-      delete (*fRawClusters)[i];
-      fNrawch[i]=0;
-  }
-  delete fRawClusters;
+    Int_t i;
+    fIshunt  = 0;
+    delete fHits;
+    delete fPadHits;
+    
+    delete fGlobalTrigger;
+    fNGlobalTrigger = 0;
+    
+    delete fLocalTrigger;
+    fNLocalTrigger = 0;
 
-  for (Int_t circ=0; circ<kNTriggerCircuit; circ++) {
-    delete (*fTriggerCircuits)[circ];
-  }
-  delete fTriggerCircuits;
+    for (i=0;i<AliMUONConstants::NCh();i++) {
+       delete (*fDchambers)[i];
+       fNdch[i]=0;
+    }
+    delete fDchambers;
+    
+    for (i=0;i<AliMUONConstants::NTrackingCh();i++) {
+       delete (*fRawClusters)[i];
+       fNrawch[i]=0;
+    }
+    delete fRawClusters;
+    
+    for (Int_t circ=0; circ<AliMUONConstants::NTriggerCircuit(); circ++) {
+       delete (*fTriggerCircuits)[circ];
+    }
+    delete fTriggerCircuits;
 }
  
 //___________________________________________
@@ -541,56 +536,55 @@ Int_t AliMUON::DistancetoPrimitive(Int_t , Int_t )
 //___________________________________________
 void AliMUON::MakeBranch(Option_t* option)
 {
-  // Create Tree branches for the MUON.
-  
-  const Int_t kBufferSize = 4000;
-  char branchname[30];
-  sprintf(branchname,"%sCluster",GetName());
-
-  AliDetector::MakeBranch(option);
-
-  if (fPadHits   && gAlice->TreeH()) {
-    gAlice->TreeH()->Branch(branchname,&fPadHits, kBufferSize);
-    printf("Making Branch %s for clusters\n",branchname);
-  }
-
+    // Create Tree branches for the MUON.
+    const Int_t kBufferSize = 4000;
+    char branchname[30];
+    sprintf(branchname,"%sCluster",GetName());
+    
+    AliDetector::MakeBranch(option);
+    
+    if (fPadHits   && gAlice->TreeH()) {
+       gAlice->TreeH()->Branch(branchname,&fPadHits, kBufferSize);
+       printf("Making Branch %s for clusters\n",branchname);
+    }
+    
 // one branch for digits per chamber
-  Int_t i;
-  
-  for (i=0; i<kNCH ;i++) {
-      sprintf(branchname,"%sDigits%d",GetName(),i+1);
-      
-      if (fDchambers   && gAlice->TreeD()) {
-         gAlice->TreeD()->Branch(branchname,&((*fDchambers)[i]), kBufferSize);
-         printf("Making Branch %s for digits in chamber %d\n",branchname,i+1);
-      }        
-  }
-
-  printf("Make Branch - TreeR address %p\n",gAlice->TreeR());
-
+    Int_t i;
+    
+    for (i=0; i<AliMUONConstants::NCh() ;i++) {
+       sprintf(branchname,"%sDigits%d",GetName(),i+1);
+       
+       if (fDchambers   && gAlice->TreeD()) {
+           gAlice->TreeD()->Branch(branchname,&((*fDchambers)[i]), kBufferSize);
+           printf("Making Branch %s for digits in chamber %d\n",branchname,i+1);
+       }       
+    }
+    
+    printf("Make Branch - TreeR address %p\n",gAlice->TreeR());
+    
 // one branch for raw clusters per chamber
-  for (i=0; i<kNTrackingCh ;i++) {
-      sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
-      
-      if (fRawClusters   && gAlice->TreeR()) {
-        gAlice->TreeR()->Branch(branchname,&((*fRawClusters)[i]), kBufferSize);
-        printf("Making Branch %s for raw clusters in chamber %d\n",branchname,i+1);
-      }        
-  }
-
+    for (i=0; i<AliMUONConstants::NTrackingCh() ;i++) {
+       sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
+       
+       if (fRawClusters   && gAlice->TreeR()) {
+           gAlice->TreeR()->Branch(branchname,&((*fRawClusters)[i]), kBufferSize);
+           printf("Making Branch %s for raw clusters in chamber %d\n",branchname,i+1);
+       }       
+    }
+    
 // one branch for global trigger
-  sprintf(branchname,"%sGlobalTrigger",GetName());
-  if (fGlobalTrigger && gAlice->TreeR()) {  
-    gAlice->TreeR()->Branch(branchname,&fGlobalTrigger,kBufferSize);
-    printf("Making Branch %s for Global Trigger\n",branchname);
-  }
+    sprintf(branchname,"%sGlobalTrigger",GetName());
+    if (fGlobalTrigger && gAlice->TreeR()) {  
+       gAlice->TreeR()->Branch(branchname,&fGlobalTrigger,kBufferSize);
+       printf("Making Branch %s for Global Trigger\n",branchname);
+    }
 // one branch for local trigger
-  sprintf(branchname,"%sLocalTrigger",GetName());
-  if (fLocalTrigger && gAlice->TreeR()) {  
-    gAlice->TreeR()->Branch(branchname,&fLocalTrigger,kBufferSize);
-    printf("Making Branch %s for Local Trigger\n",branchname);
-  }
-
+    sprintf(branchname,"%sLocalTrigger",GetName());
+    if (fLocalTrigger && gAlice->TreeR()) {  
+       gAlice->TreeR()->Branch(branchname,&fLocalTrigger,kBufferSize);
+       printf("Making Branch %s for Local Trigger\n",branchname);
+    }
+    
 }
 
 //___________________________________________
@@ -613,7 +607,7 @@ void AliMUON::SetTreeAddress()
   }
 
   if (treeD) {
-      for (int i=0; i<kNCH; i++) {
+      for (int i=0; i<AliMUONConstants::NCh(); i++) {
          sprintf(branchname,"%sDigits%d",GetName(),i+1);
          if (fDchambers) {
              branch = treeD->GetBranch(branchname);
@@ -625,7 +619,7 @@ void AliMUON::SetTreeAddress()
   // printf("SetTreeAddress --- treeR address  %p \n",treeR);
 
   if (treeR) {
-      for (int i=0; i<kNTrackingCh; i++) {
+      for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) {
          sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
          if (fRawClusters) {
              branch = treeR->GetBranch(branchname);
@@ -658,7 +652,7 @@ void AliMUON::ResetDigits()
     //
     // Reset number of digits and the digits array for this detector
     //
-    for ( int i=0;i<kNCH;i++ ) {
+    for ( int i=0;i<AliMUONConstants::NCh();i++ ) {
        if ((*fDchambers)[i])    ((TClonesArray*)(*fDchambers)[i])->Clear();
        if (fNdch)  fNdch[i]=0;
     }
@@ -669,7 +663,7 @@ void AliMUON::ResetRawClusters()
     //
     // Reset number of raw clusters and the raw clust array for this detector
     //
-    for ( int i=0;i<kNTrackingCh;i++ ) {
+    for ( int i=0;i<AliMUONConstants::NTrackingCh();i++ ) {
        if ((*fRawClusters)[i])    ((TClonesArray*)(*fRawClusters)[i])->Clear();
        if (fNrawch)  fNrawch[i]=0;
     }
@@ -698,9 +692,9 @@ void AliMUON::SetChambersZ(const Float_t *Z)
 {
   // Set Z values for all chambers (tracking and trigger)
   // from the array pointed to by "Z"
-  for (Int_t ch = 0; ch < kNCH; ch++)
-    ((AliMUONChamber*) ((*fChambers)[ch]))->SetZ(Z[ch]);
-  return;
+    for (Int_t ch = 0; ch < AliMUONConstants::NCh(); ch++)
+       ((AliMUONChamber*) ((*fChambers)[ch]))->SetZ(Z[ch]);
+    return;
 }
 
 //___________________________________________
@@ -708,7 +702,7 @@ void AliMUON::SetChambersZToDefault()
 {
   // Set Z values for all chambers (tracking and trigger)
   // to default values
-  SetChambersZ(kDefaultChambersZ);
+  SetChambersZ(AliMUONConstants::DefaultChamberZ());
   return;
 }
 
@@ -858,6 +852,7 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
     static TFile *file;
     char *addBackground = strstr(option,"Add");
 
+
     AliMUONChamber*  iChamber;
     AliMUONSegmentation*  segmentation;
 
@@ -870,8 +865,8 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
     Int_t digits[5]; 
 
     AliMUON *pMUON  = (AliMUON *) gAlice->GetModule("MUON");
-    AliMUONHitMap * hitMap[kNCH];
-    for (Int_t i=0; i<kNCH; i++) {hitMap[i]=0;}
+    AliMUONHitMap * hitMap[AliMUONConstants::NCh()];
+    for (Int_t i=0; i<AliMUONConstants::NCh(); i++) {hitMap[i]=0;}
     if (addBackground ) {
        if(first) {
            fFileName=filename;
@@ -921,7 +916,9 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
     Int_t countadr=0;
     for (int icat=0; icat<2; icat++) { 
        Int_t counter=0;
-       for (Int_t i =0; i<kNCH; i++) {
+       Int_t nmuon[AliMUONConstants::NCh()];
+
+       for (Int_t i =0; i<AliMUONConstants::NCh(); i++) {
            iChamber=(AliMUONChamber*) (*fChambers)[i];
            if (iChamber->Nsec()==1 && icat==1) {
                continue;
@@ -929,6 +926,7 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
                segmentation=iChamber->SegmentationModel(icat+1);
            }
            hitMap[i] = new AliMUONHitMapA1(segmentation, list);
+           nmuon[i]=0;
        }
        //printf("Start loop over tracks \n");     
 //
@@ -937,9 +935,8 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
 
        TTree *treeH = gAlice->TreeH();
        Int_t ntracks =(Int_t) treeH->GetEntries();
-       Int_t nmuon[kNCH]={0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-       Float_t xhit[kNCH][2];
-       Float_t yhit[kNCH][2];
+       Float_t xhit[AliMUONConstants::NCh()][2];
+       Float_t yhit[AliMUONConstants::NCh()][2];
        
        for (Int_t track=0; track<ntracks; track++) {
            gAlice->ResetHits();
@@ -952,7 +949,7 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
                mHit=(AliMUONHit*)pMUON->NextHit()) 
            {
                Int_t   nch   = mHit->fChamber-1;  // chamber number
-               if (nch > kNCH-1) continue;
+               if (nch > AliMUONConstants::NCh()-1) continue;
                iChamber = &(pMUON->Chamber(nch));
                 // new 17.07.99
                if (addBackground) {
@@ -1239,7 +1236,7 @@ void AliMUON::Digitise(Int_t nev,Int_t bgrEvent,Option_t *option,Option_t *opt,T
        pMUON->ResetDigits();
        list->Delete();
        
-       for(Int_t ii=0;ii<kNCH;++ii) {
+       for(Int_t ii=0;ii<AliMUONConstants::NCh();++ii) {
            if (hitMap[ii]) {
                hm=hitMap[ii];
                delete hm;
@@ -1325,7 +1322,6 @@ void AliMUON::Trigger(Int_t nev){
   Int_t pairLike[3]    = {0,0,0};
 
   ResetTrigger();
-
   AliMUONTriggerDecision* decision= new AliMUONTriggerDecision(1);
   decision->Trigger();   
   decision->GetGlobalTrigger(singlePlus, singleMinus, singleUndef,
@@ -1334,7 +1330,7 @@ void AliMUON::Trigger(Int_t nev){
   AddGlobalTrigger(singlePlus, singleMinus, singleUndef, pairUnlike, pairLike);
   Int_t i;
   
-  for (Int_t icirc=0; icirc<kNTriggerCircuit; icirc++) { 
+  for (Int_t icirc=0; icirc<AliMUONConstants::NTriggerCircuit(); icirc++) { 
       if(decision->GetITrigger(icirc)==1) {
          Int_t localtr[7]={0,0,0,0,0,0,0};      
          Int_t loLpt[2]={0,0}; Int_t loHpt[2]={0,0}; Int_t loApt[2]={0,0};
@@ -1436,7 +1432,6 @@ void AliMUON::Streamer(TBuffer &R__b)
       TClonesArray         *digitsaddress;
       TClonesArray         *rawcladdress;
       Int_t i;
-      
       if (R__b.IsReading()) {
          Version_t R__v = R__b.ReadVersion(); if (R__v) { }
          AliDetector::Streamer(R__b);
@@ -1455,12 +1450,12 @@ void AliMUON::Streamer(TBuffer &R__b)
          R__b >> fAccMax; 
          R__b >> fChambers;
          R__b >> fTriggerCircuits;
-         for (i =0; i<kNTriggerCircuit; i++) {
+         for (i =0; i<AliMUONConstants::NTriggerCircuit(); i++) {
              iTriggerCircuit=(AliMUONTriggerCircuit*) (*fTriggerCircuits)[i];
              iTriggerCircuit->Streamer(R__b);
          }
 // Stream chamber related information
-         for (i =0; i<kNCH; i++) {
+         for (i =0; i<AliMUONConstants::NCh(); i++) {
              iChamber=(AliMUONChamber*) (*fChambers)[i];
              iChamber->Streamer(R__b);
              if (iChamber->Nsec()==1) {
@@ -1480,7 +1475,7 @@ void AliMUON::Streamer(TBuffer &R__b)
                  response->Streamer(R__b);       
              digitsaddress=(TClonesArray*) (*fDchambers)[i];
              digitsaddress->Streamer(R__b);
-             if (i < kNTrackingCh) {
+             if (i < AliMUONConstants::NTrackingCh()) {
                  rawcladdress=(TClonesArray*) (*fRawClusters)[i];
                  rawcladdress->Streamer(R__b);
              }
@@ -1497,8 +1492,8 @@ void AliMUON::Streamer(TBuffer &R__b)
          R__b << fGlobalTrigger; 
          R__b << fDchambers;
          R__b << fRawClusters;
-         R__b.WriteArray(fNdch, kNCH);
-         R__b.WriteArray(fNrawch, kNTrackingCh);
+         R__b.WriteArray(fNdch, AliMUONConstants::NCh());
+         R__b.WriteArray(fNrawch, AliMUONConstants::NTrackingCh());
          
          R__b << fAccCut;
          R__b << fAccMin;
@@ -1506,11 +1501,11 @@ void AliMUON::Streamer(TBuffer &R__b)
          
          R__b << fChambers;
          R__b << fTriggerCircuits;
-         for (i =0; i<kNTriggerCircuit; i++) {
+         for (i =0; i<AliMUONConstants::NTriggerCircuit(); i++) {
              iTriggerCircuit=(AliMUONTriggerCircuit*) (*fTriggerCircuits)[i];
              iTriggerCircuit->Streamer(R__b);
          }
-         for (i =0; i<kNCH; i++) {
+         for (i =0; i<AliMUONConstants::NCh(); i++) {
              iChamber=(AliMUONChamber*) (*fChambers)[i];
              iChamber->Streamer(R__b);
              if (iChamber->Nsec()==1) {
@@ -1530,7 +1525,7 @@ void AliMUON::Streamer(TBuffer &R__b)
                  response->Streamer(R__b);
              digitsaddress=(TClonesArray*) (*fDchambers)[i];
              digitsaddress->Streamer(R__b);
-             if (i < kNTrackingCh) {
+             if (i < AliMUONConstants::NTrackingCh()) {
                  rawcladdress=(TClonesArray*) (*fRawClusters)[i];
                  rawcladdress->Streamer(R__b);
              }
diff --git a/MUON/AliMUONConstants.cxx b/MUON/AliMUONConstants.cxx
new file mode 100644 (file)
index 0000000..077ea74
--- /dev/null
@@ -0,0 +1,35 @@
+ /**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+#include "AliMUONConstants.h"
+
+
+ClassImp(AliMUONConstants)
+
+Int_t   AliMUONConstants::fgNCh = 14;
+Int_t   AliMUONConstants::fgNTrackingCh = 10;
+Int_t   AliMUONConstants::fgNTriggerCh = 4;
+Int_t   AliMUONConstants::fgNTriggerCircuit = 234;
+Float_t AliMUONConstants::fgDefaultChamberZ[14] =
+{518., 538., 680., 700., 965., 985., 1239., 1259., 1439., 1459.,
+                  1610, 1625., 1710., 1725.}; 
+Float_t  AliMUONConstants::fgDmin[7] = { 35.,  47.,  66.,   80.,  80., 100., 100.};    
+Float_t  AliMUONConstants::fgDmax[7]  = {183., 245., 316.6,  520.,  520., 830., 880.};  
+
+void AliMUONConstants::Streamer(TBuffer &R__b) {} 
diff --git a/MUON/AliMUONConstants.h b/MUON/AliMUONConstants.h
new file mode 100644 (file)
index 0000000..ce51c94
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef ALIMUONCONSTANTS_H
+#define ALIMUONCONSTANTS_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/*$Id $*/
+
+#include <TObject.h>
+#include <TArrayF.h>
+#include <TArrayI.h>
+
+
+class AliMUONConstants : public TObject {
+ public:
+    // return number of chambers
+    static Int_t    NCh() {return fgNCh;}
+    // return number of tracking chambers
+    static Int_t    NTrackingCh() {return fgNTrackingCh;}
+    // return number of trigger chambers
+    static Int_t    NTriggerCh() {return fgNTriggerCh;}
+    // return number of trigger circuits
+    static Int_t    NTriggerCircuit() {return fgNTriggerCircuit;}
+    // return poistion of chamber i
+    static Float_t  DefaultChamberZ(Int_t i) {return fgDefaultChamberZ[i];}
+    // return pointer to array of positions
+    static Float_t* DefaultChamberZ() {return fgDefaultChamberZ;}
+    // return chamber i inner diameter
+    static Float_t  Dmin(Int_t i) {return fgDmin[i];}
+    // return chamber i outer diameter
+    static Float_t  Dmax(Int_t i) {return fgDmax[i];}
+ private:
+    AliMUONConstants(){}
+    virtual ~AliMUONConstants(){}
+ private:
+    static AliMUONConstants* fgConstants; // !
+    static Int_t  fgNCh;                //  Number of Chambers    
+    static Int_t  fgNTrackingCh;        //  Number of Tracking Chambers
+    static Int_t  fgNTriggerCh;         //  Number of Trigger Chambers
+    static Int_t  fgNTriggerCircuit;    //  Number of Trigger Circuits
+//
+    static Float_t  fgDefaultChamberZ[14];    // ! Z-positions of chambers
+    static Float_t  fgDmin[7];               // ! inner diameter
+    static Float_t  fgDmax[7];               // ! outer diameter
+//
+    ClassDef(AliMUONConstants, 1)     // Class definition in ROOT context
+};
+       
+#endif
+
+
+
+
+
+
+
+
index 8b926cc72e28e01c0fba7d23a2762e760d22f47a..1baf2f86b733d346ffa068b4163faccc772376e7 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.2  2000/06/15 07:58:48  morsch
+Code from MUON-dev joined
+
 Revision 1.1.2.15  2000/06/14 14:37:53  morsch
 method Trigger() modified
 
@@ -122,7 +125,7 @@ it is now really the Z position of the chambers.
 #include "AliMUONSegmentation.h"
 #include "AliMUONResponse.h"
 #include "AliMUONChamber.h"
-
+#include "AliMUONConstants.h"
 // to manage the same zoom on both cathodes
 
 
@@ -1150,7 +1153,7 @@ void AliMUONDisplay::NextChamber(Int_t delta)
   // to go from chamber to next chamber if delta = 1
   // or previous chamber otherwise
     if (delta == 1) {
-       if (fChamber < kNCH) fChamber++;
+       if (fChamber < AliMUONConstants::NCh()) fChamber++;
     } else {
        if (fChamber > 1) fChamber--;
     }
index 482bd86f3226a3d4b58643170d2289e3b1a35f77..fcdbfc0f20a92d6c9deccfe9d72e701cbd1c60d9 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.9  2000/06/15 07:58:49  morsch
+Code from MUON-dev joined
+
 Revision 1.8.4.9  2000/06/12 19:20:49  morsch
 Constructor sets default geometry, segmentation and response parameters.
 
@@ -65,6 +68,7 @@ Gammas and neutrons are also scored in the stepmanager
 #include "AliMUONSegmentationTrigger.h"
 #include "AliMUONSegmentationTriggerX.h"
 #include "AliMUONSegmentationTriggerY.h"
+#include "AliMUONConstants.h"
 
 ClassImp(AliMUONv0)
  
@@ -393,7 +397,7 @@ void AliMUONv0::CreateGeometry()
 
      AliMUONChamber *iChamber;
      // Loop over all chambers (tracking and trigger)
-     for (Int_t ch = 0; ch < kNCH; ch++) {
+     for (Int_t ch = 0; ch < AliMUONConstants::NCh(); ch++) {
         char alu[8];
         char gas[8];
      
@@ -401,7 +405,7 @@ void AliMUONv0::CreateGeometry()
         // Z of the chamber
         zpos=iChamber->Z(); 
         dAlu=iChamber->DAlu();
-        if (ch < kNTrackingCh) {
+        if (ch < AliMUONConstants::NTrackingCh()) {
           // tracking chambers
             sprintf(alu,"CA0%1d",ch);
             sprintf(gas,"CG0%1d",ch);   
@@ -459,8 +463,9 @@ void AliMUONv0::Init()
    // 
    // Initialize Tracking Chambers
    //
+
    printf("\n\n\n Start Init for version 0 - CPC chamber type\n\n\n");
-   for (Int_t i=0; i<kNCH; i++) {
+   for (Int_t i=0; i<AliMUONConstants::NCh(); i++) {
        ( (AliMUONChamber*) (*fChambers)[i])->Init();
    }
 }
@@ -487,7 +492,7 @@ void AliMUONv0::StepManager()
   idvol=-1;
   id=gMC->CurrentVolID(copy);
   
-    for (Int_t i=1; i<=kNCH; i++) {
+    for (Int_t i=1; i<=AliMUONConstants::NCh(); i++) {
       if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){ 
          vol[0]=i; 
          idvol=i-1;
index c97ef32b12f4e8e09b1568ff2e1fdc7afa9793cf..66069a8f3f790b577385c2cb08e33d784d8d08f1 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.3  2000/06/22 14:10:05  morsch
+HP scope problems corrected (PH)
+
 Revision 1.2  2000/06/15 07:58:49  morsch
 Code from MUON-dev joined
 
@@ -50,6 +53,7 @@ Log messages included.
 #include "AliMUONChamber.h"
 #include "AliMUONHit.h"
 #include "AliMUONPadHit.h"
+#include "AliMUONConstants.h"
 
 ClassImp(AliMUONv1)
  
@@ -1459,8 +1463,7 @@ void AliMUONv1::Init()
 
    printf("\n\n\n Start Init for version 1 - CPC chamber type\n\n\n");
    Int_t i;
-   
-   for (i=0; i<kNCH; i++) {
+   for (i=0; i<AliMUONConstants::NCh(); i++) {
        ( (AliMUONChamber*) (*fChambers)[i])->Init();
    }
    
@@ -1486,7 +1489,7 @@ void AliMUONv1::Init()
 
    //cp 
    printf("\n\n\n Start Init for Trigger Circuits\n\n\n");
-   for (i=0; i<kNTriggerCircuit; i++) {
+   for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) {
      ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
    }
    printf(" Finished Init for Trigger Circuits\n\n\n");
@@ -1508,7 +1511,6 @@ void AliMUONv1::StepManager()
   
   static Float_t eloss, eloss2, xhit, yhit, tof, tlength;
   const  Float_t kBig=1.e10;
-  
   //  modifs perso
   static Float_t hits[15];
 
@@ -1526,7 +1528,7 @@ void AliMUONv1::StepManager()
   idvol=-1;
   id=gMC->CurrentVolID(copy);
   
-    for (Int_t i=1; i<=kNCH; i++) {
+    for (Int_t i=1; i<=AliMUONConstants::NCh(); i++) {
       if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){ 
          vol[0]=i; 
          idvol=i-1;
index 5399d0ca4040b1027db378aec96942e094d19287..1c1073b0da1c367d1c01dee8574cef838ffe78d2 100644 (file)
@@ -45,6 +45,7 @@
 #pragma link C++ class  AliMUONTrackHit;
 #pragma link C++ class  AliMUONTrackParam;
 #pragma link C++ class  AliMUONTriggerConstants;
+#pragma link C++ class  AliMUONConstants-;
 #endif
 
 
index c860b179a21115b8e75e82640b45080cb0b278c6..996fd6e23825f728377c74ee1f72f783fadfa6d7 100644 (file)
@@ -31,7 +31,7 @@ SRCS         = AliMUONChamber.cxx AliMUONChamberTrigger.cxx \
                AliMUONTrack.cxx AliMUONTrackHit.cxx AliMUONTrackParam.cxx \
                AliMUONTriggerCircuit.cxx AliMUONTriggerLut.cxx \
                AliMUONGlobalTrigger.cxx AliMUONLocalTrigger.cxx \
-               AliMUONTriggerConstants.cxx        
+               AliMUONTriggerConstants.cxx  AliMUONConstants.cxx      
 
 # C++ Headers