]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONClusterInput.cxx
Updated constants & method
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterInput.cxx
index 9f4f1951d9ff55876f939a4958049691639df024..6fb69987e432b4936a557fe7574b3f39a327097a 100644 (file)
 
 /* $Id$ */
 
+#include <TClonesArray.h>
+#include <TMinuit.h>
+
 #include "AliRun.h"
 #include "AliMUON.h"
 #include "AliMUONChamber.h"
+#include "AliMUONConstants.h"
 #include "AliMUONClusterInput.h"
-#include "AliSegmentation.h"
-#include "AliMUONResponse.h"
+#include "AliMUONMathieson.h"
 #include "AliMUONRawCluster.h"
 #include "AliMUONDigit.h"
-
-#include <TClonesArray.h>
-#include <TMinuit.h>
+#include "AliLog.h"
 
 ClassImp(AliMUONClusterInput)
 
 AliMUONClusterInput* AliMUONClusterInput::fgClusterInput = 0; 
 TMinuit* AliMUONClusterInput::fgMinuit = 0; 
+AliMUONMathieson* AliMUONClusterInput::fgMathieson = 0; 
+
+AliMUONClusterInput::AliMUONClusterInput()
+  : TObject(),
+    fCluster(0),
+    fChargeCorrel(1.) // in case not defined
 
-AliMUONClusterInput::AliMUONClusterInput(){
-  fgClusterInput = 0; 
-  fgMinuit = 0; 
+{
   fDigits[0]=0;
   fDigits[1]=0;
   fSegmentation[0]=0;
   fSegmentation[1]=0;
-  fResponse=0;
-  fCluster=0;
 }
 
 AliMUONClusterInput* AliMUONClusterInput::Instance()
@@ -58,10 +61,14 @@ AliMUONClusterInput::~AliMUONClusterInput()
 {
 // Destructor
     delete fgMinuit;
+    delete fgMathieson;
 }
+
 AliMUONClusterInput::AliMUONClusterInput(const AliMUONClusterInput& clusterInput):TObject(clusterInput)
 {
-  
+// Protected copy constructor
+
+  AliFatal("Not implemented.");
 }
 
 void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig1, TClonesArray* dig2)
@@ -79,10 +86,23 @@ void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig1, TClonesAr
     pMUON = (AliMUON*) gAlice->GetModule("MUON");
     iChamber =  &(pMUON->Chamber(chamber));
 
+    fgMathieson = new AliMUONMathieson();
     fSegmentation[0]=iChamber->SegmentationModel(1);
     fSegmentation[1]=iChamber->SegmentationModel(2);
-    fResponse=iChamber->ResponseModel();
     fNseg = 2;
+    if (chamber < AliMUONConstants::NTrackingCh()) {
+      if (chamber > 1 ) {
+       fgMathieson->SetPitch(AliMUONConstants::Pitch());
+       fgMathieson->SetSqrtKx3AndDeriveKx2Kx4(AliMUONConstants::SqrtKx3());
+       fgMathieson->SetSqrtKy3AndDeriveKy2Ky4(AliMUONConstants::SqrtKy3());
+       fChargeCorrel = AliMUONConstants::ChargeCorrel();
+      } else {
+       fgMathieson->SetPitch(AliMUONConstants::PitchSt1());
+       fgMathieson->SetSqrtKx3AndDeriveKx2Kx4(AliMUONConstants::SqrtKx3St1());
+       fgMathieson->SetSqrtKy3AndDeriveKy2Ky4(AliMUONConstants::SqrtKy3St1());
+       fChargeCorrel = AliMUONConstants::ChargeCorrelSt1();
+      }
+    }
 }
 
 void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig)
@@ -96,7 +116,6 @@ void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig)
     iChamber =  &(pMUON->Chamber(chamber));
 
     fSegmentation[0]=iChamber->SegmentationModel(1);
-    fResponse=iChamber->ResponseModel();
     fNseg=1;
 }
 
@@ -155,7 +174,7 @@ Float_t AliMUONClusterInput::DiscrChargeCombiS1(Int_t i,Double_t *par, Int_t cat
    fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]);
 //  First Cluster
    fSegmentation[cath]->SetHit(par[0],par[1],fZ);
-   Float_t q1=fResponse->IntXY(fSegmentation[cath]);
+   Float_t q1=fgMathieson->IntXY(fSegmentation[cath]);
     
    Float_t value = fQtot[cath]*q1;
    return value;
@@ -174,11 +193,11 @@ Float_t AliMUONClusterInput::DiscrChargeS2(Int_t i,Double_t *par)
    fSegmentation[0]->SetPad(fix[i][0], fiy[i][0]);
 //  First Cluster
    fSegmentation[0]->SetHit(par[0],par[1],fZ);
-   Float_t q1=fResponse->IntXY(fSegmentation[0]);
+   Float_t q1=fgMathieson->IntXY(fSegmentation[0]);
     
 //  Second Cluster
    fSegmentation[0]->SetHit(par[2],par[3],fZ);
-   Float_t q2=fResponse->IntXY(fSegmentation[0]);
+   Float_t q2=fgMathieson->IntXY(fSegmentation[0]);
     
    Float_t value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
    return value;
@@ -197,11 +216,11 @@ Float_t AliMUONClusterInput::DiscrChargeCombiS2(Int_t i,Double_t *par, Int_t cat
    fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]);
 //  First Cluster
    fSegmentation[cath]->SetHit(par[0],par[1],fZ);
-   Float_t q1=fResponse->IntXY(fSegmentation[cath]);
+   Float_t q1=fgMathieson->IntXY(fSegmentation[cath]);
     
 //  Second Cluster
    fSegmentation[cath]->SetHit(par[2],par[3],fZ);
-   Float_t q2=fResponse->IntXY(fSegmentation[cath]);
+   Float_t q2=fgMathieson->IntXY(fSegmentation[cath]);
    Float_t value;
    if (cath==0) {
        value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
@@ -212,8 +231,13 @@ Float_t AliMUONClusterInput::DiscrChargeCombiS2(Int_t i,Double_t *par, Int_t cat
 }
 
 AliMUONClusterInput& AliMUONClusterInput
-::operator = (const AliMUONClusterInput& /*rhs*/)
+::operator = (const AliMUONClusterInput& rhs)
 {
-// Dummy assignment operator
-    return *this;
+// Protected assignement operator
+
+  if (this == &rhs) return *this;
+
+  AliFatal("Not implemented.");
+    
+  return *this;  
 }