]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONClusterInput.cxx
Moved from from MUON/data
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterInput.cxx
index 6fb69987e432b4936a557fe7574b3f39a327097a..7ce5ac175da391972333f0a9158f52a17b99039a 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "AliRun.h"
 #include "AliMUON.h"
-#include "AliMUONChamber.h"
+#include "AliMUONSegmentation.h"
 #include "AliMUONConstants.h"
 #include "AliMUONClusterInput.h"
 #include "AliMUONMathieson.h"
@@ -37,13 +37,14 @@ AliMUONMathieson* AliMUONClusterInput::fgMathieson = 0;
 AliMUONClusterInput::AliMUONClusterInput()
   : TObject(),
     fCluster(0),
-    fChargeCorrel(1.) // in case not defined
-
+    fChargeCorrel(1.),
+    fDetElemId(0)
+  
 {
   fDigits[0]=0;
   fDigits[1]=0;
-  fSegmentation[0]=0;
-  fSegmentation[1]=0;
+  fSegmentation2[0]=0;
+  fSegmentation2[1]=0;
 }
 
 AliMUONClusterInput* AliMUONClusterInput::Instance()
@@ -71,24 +72,26 @@ AliMUONClusterInput::AliMUONClusterInput(const AliMUONClusterInput& clusterInput
   AliFatal("Not implemented.");
 }
 
-void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig1, TClonesArray* dig2)
+void AliMUONClusterInput::SetDigits(Int_t chamber, Int_t idDE, TClonesArray* dig1, TClonesArray* dig2)
 {
-// Set pointer to digits with corresponding segmentations and responses (two cathode planes)
-    fChamber=chamber;
-    fDigits[0]=dig1;
-    fDigits[1]=dig2; 
-    fNDigits[0]=dig1->GetEntriesFast();
-    fNDigits[1]=dig2->GetEntriesFast();
+  // Set pointer to digits with corresponding segmentations and responses (two cathode planes)
+    fChamber = chamber;
+    fDetElemId = idDE;
+    fDigits[0]  = dig1;
+    fDigits[1]  = dig2; 
+    fNDigits[0] = dig1->GetEntriesFast();
+    fNDigits[1] = dig2->GetEntriesFast();
     
+    fgMathieson = new AliMUONMathieson();
+
     AliMUON *pMUON;
-    AliMUONChamber* iChamber;
+    AliMUONSegmentation* pSegmentation;
 
     pMUON = (AliMUON*) gAlice->GetModule("MUON");
-    iChamber =  &(pMUON->Chamber(chamber));
+    pSegmentation = pMUON->GetSegmentation();
+    fSegmentation2[0]= pSegmentation->GetModuleSegmentation(chamber, 0);
+    fSegmentation2[1]= pSegmentation->GetModuleSegmentation(chamber, 1);
 
-    fgMathieson = new AliMUONMathieson();
-    fSegmentation[0]=iChamber->SegmentationModel(1);
-    fSegmentation[1]=iChamber->SegmentationModel(2);
     fNseg = 2;
     if (chamber < AliMUONConstants::NTrackingCh()) {
       if (chamber > 1 ) {
@@ -105,37 +108,41 @@ void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig1, TClonesAr
     }
 }
 
-void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig)
+void AliMUONClusterInput::SetDigits(Int_t chamber, Int_t idDE, TClonesArray* dig)
 {
 // Set pointer to digits with corresponding segmentations and responses (one cathode plane)
-    fDigits[0]=dig;
+
+    fChamber = chamber;
+    fDetElemId = idDE;
+    fDigits[0] = dig;
+
     AliMUON *pMUON;
-    AliMUONChamber* iChamber;
+    AliMUONSegmentation* pSegmentation;
 
     pMUON = (AliMUON*) gAlice->GetModule("MUON");
-    iChamber =  &(pMUON->Chamber(chamber));
+    pSegmentation = pMUON->GetSegmentation();
+    fSegmentation2[0]= pSegmentation->GetModuleSegmentation(chamber, 0);
 
-    fSegmentation[0]=iChamber->SegmentationModel(1);
     fNseg=1;
 }
 
 void  AliMUONClusterInput::SetCluster(AliMUONRawCluster* cluster)
 {
 // Set the current cluster
-    //PH printf("\n %p \n", cluster);
-    fCluster=cluster;
-    Float_t qtot;
-    Int_t   i, cath, ix, iy;
-    AliMUONDigit* digit;
-    fNmul[0]=cluster->GetMultiplicity(0);
-    fNmul[1]=cluster->GetMultiplicity(1);
-    //PH printf("\n %p %p ", fDigits[0], fDigits[1]);
-    
-    for (cath=0; cath<2; cath++) {
-       qtot=0;
-       for (i=0; i<fNmul[cath]; i++) {
-           // pointer to digit
-           digit =(AliMUONDigit*)
+  //PH printf("\n %p \n", cluster);
+  fCluster=cluster;
+  Float_t qtot;
+  Int_t   i, cath, ix, iy;
+  AliMUONDigit* digit;
+  fNmul[0]=cluster->GetMultiplicity(0);
+  fNmul[1]=cluster->GetMultiplicity(1);
+  //PH printf("\n %p %p ", fDigits[0], fDigits[1]);
+  
+  for (cath=0; cath<2; cath++) {
+    qtot=0;
+    for (i=0; i<fNmul[cath]; i++) {
+      // pointer to digit
+      digit =(AliMUONDigit*)
                (fDigits[cath]->UncheckedAt(cluster->GetIndex(i,cath)));
            // pad coordinates
            ix = digit->PadX();
@@ -151,7 +158,7 @@ void  AliMUONClusterInput::SetCluster(AliMUONRawCluster* cluster)
            qtot+=fCharge[i][cath];
            // Current z
            Float_t xc, yc;
-           fSegmentation[cath]->GetPadC(ix,iy,xc,yc,fZ);
+           fSegmentation2[cath]->GetPadC(fDetElemId,ix,iy,xc,yc,fZ);
        } // loop over cluster digits
        fQtot[cath]=qtot;
        fChargeTot[cath]=Int_t(qtot);  
@@ -171,11 +178,12 @@ Float_t AliMUONClusterInput::DiscrChargeCombiS1(Int_t i,Double_t *par, Int_t cat
 // par[0]    x-position of cluster
 // par[1]    y-position of cluster
 
-   fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]);
-//  First Cluster
-   fSegmentation[cath]->SetHit(par[0],par[1],fZ);
-   Float_t q1=fgMathieson->IntXY(fSegmentation[cath]);
-    
+    Float_t q1;
+    fSegmentation2[cath]->SetPad(fDetElemId, fix[i][cath], fiy[i][cath]);
+    //  First Cluster
+    fSegmentation2[cath]->SetHit(fDetElemId, par[0],par[1],fZ);
+    q1 = fgMathieson->IntXY(fDetElemId, fSegmentation2[cath]);
+       
    Float_t value = fQtot[cath]*q1;
    return value;
 }
@@ -190,17 +198,19 @@ Float_t AliMUONClusterInput::DiscrChargeS2(Int_t i,Double_t *par)
 // par[4]    charge fraction of first  cluster
 // 1-par[4]  charge fraction of second cluster
 
-   fSegmentation[0]->SetPad(fix[i][0], fiy[i][0]);
-//  First Cluster
-   fSegmentation[0]->SetHit(par[0],par[1],fZ);
-   Float_t q1=fgMathieson->IntXY(fSegmentation[0]);
-    
-//  Second Cluster
-   fSegmentation[0]->SetHit(par[2],par[3],fZ);
-   Float_t q2=fgMathieson->IntXY(fSegmentation[0]);
-    
-   Float_t value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
-   return value;
+  Float_t q1, q2;
+  
+  fSegmentation2[0]->SetPad(fDetElemId, fix[i][0], fiy[i][0]);
+  //  First Cluster
+  fSegmentation2[0]->SetHit(fDetElemId, par[0],par[1],fZ);
+  q1 = fgMathieson->IntXY(fDetElemId, fSegmentation2[0]);
+
+  //  Second Cluster
+  fSegmentation2[0]->SetHit(fDetElemId,par[2],par[3],fZ);
+  q2 = fgMathieson->IntXY(fDetElemId, fSegmentation2[0]);
+  
+  Float_t value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
+  return value;
 }
 
 Float_t AliMUONClusterInput::DiscrChargeCombiS2(Int_t i,Double_t *par, Int_t cath) 
@@ -213,21 +223,24 @@ Float_t AliMUONClusterInput::DiscrChargeCombiS2(Int_t i,Double_t *par, Int_t cat
 // 1-par[4]  charge fraction of second cluster 
 // par[5]    charge fraction of first  cluster - second cathode
 
-   fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]);
-//  First Cluster
-   fSegmentation[cath]->SetHit(par[0],par[1],fZ);
-   Float_t q1=fgMathieson->IntXY(fSegmentation[cath]);
-    
-//  Second Cluster
-   fSegmentation[cath]->SetHit(par[2],par[3],fZ);
-   Float_t q2=fgMathieson->IntXY(fSegmentation[cath]);
-   Float_t value;
-   if (cath==0) {
-       value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
-   } else {
-       value = fQtot[1]*(par[5]*q1+(1.-par[5])*q2);
-   }
-   return value;
+  Float_t q1, q2;
+
+  fSegmentation2[cath]->SetPad(fDetElemId,fix[i][cath], fiy[i][cath]);
+  //  First Cluster
+  fSegmentation2[cath]->SetHit(fDetElemId,par[0],par[1],fZ);
+  q1 = fgMathieson->IntXY(fDetElemId, fSegmentation2[cath]);
+  
+  //  Second Cluster
+  fSegmentation2[cath]->SetHit(fDetElemId,par[2],par[3],fZ);
+  q2 = fgMathieson->IntXY(fDetElemId, fSegmentation2[cath]);
+  
+  Float_t value;
+  if (cath==0) {
+    value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
+  } else {
+    value = fQtot[1]*(par[5]*q1+(1.-par[5])*q2);
+  }
+  return value;
 }
 
 AliMUONClusterInput& AliMUONClusterInput