Optimized description of the Mathieson distribution + minors
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 7 Apr 2008 13:33:24 +0000 (13:33 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 7 Apr 2008 13:33:24 +0000 (13:33 +0000)
HMPID/AliHMPIDCluster.cxx
HMPID/AliHMPIDDigit.h
HMPID/AliHMPIDParam.cxx
HMPID/AliHMPIDParam.h
HMPID/Hconfig.C

index e086284..06098cc 100644 (file)
@@ -185,12 +185,12 @@ void AliHMPIDCluster::FitFunc(Int_t &iNpars, Double_t* deriv, Double_t &chi2, Do
     for(Int_t i=0;i<nPads;i++){                                                          //loop on all pads of the cluster
       for(Int_t j=0;j<iNshape;j++){                                                      //Mathiesons loop as all of them may contribute to this pad
         Double_t fracMathi = pClu->Dig(i)->IntMathieson(par[3*j],par[3*j+1]);
-        derivPart[3*j  ][i] += par[3*j+2]*(pClu->Dig(i)->Mathieson(par[3*j]-pClu->Dig(i)->LorsX()-0.5*AliHMPIDParam::SizePadX())-
-                                           pClu->Dig(i)->Mathieson(par[3*j]-pClu->Dig(i)->LorsX()+0.5*AliHMPIDParam::SizePadX()))*
-                                           pClu->Dig(i)->IntPartMathi(par[3*j+1],2);
-        derivPart[3*j+1][i] += par[3*j+2]*(pClu->Dig(i)->Mathieson(par[3*j+1]-pClu->Dig(i)->LorsY()-0.5*AliHMPIDParam::SizePadY())-
-                                           pClu->Dig(i)->Mathieson(par[3*j+1]-pClu->Dig(i)->LorsY()+0.5*AliHMPIDParam::SizePadY()))*
-                                           pClu->Dig(i)->IntPartMathi(par[3*j],1);
+        derivPart[3*j  ][i] += par[3*j+2]*(pClu->Dig(i)->MathiesonX(par[3*j]-pClu->Dig(i)->LorsX()-0.5*AliHMPIDParam::SizePadX())-
+                                           pClu->Dig(i)->MathiesonX(par[3*j]-pClu->Dig(i)->LorsX()+0.5*AliHMPIDParam::SizePadX()))*
+                                           pClu->Dig(i)->IntPartMathiY(par[3*j+1]);
+        derivPart[3*j+1][i] += par[3*j+2]*(pClu->Dig(i)->MathiesonY(par[3*j+1]-pClu->Dig(i)->LorsY()-0.5*AliHMPIDParam::SizePadY())-
+                                           pClu->Dig(i)->MathiesonY(par[3*j+1]-pClu->Dig(i)->LorsY()+0.5*AliHMPIDParam::SizePadY()))*
+                                           pClu->Dig(i)->IntPartMathiX(par[3*j]);
         derivPart[3*j+2][i] += fracMathi;
       }
     }
index e2cd281..b6400fa 100644 (file)
@@ -41,9 +41,11 @@ public:
 
          Float_t LorsY       (                               )const{return AliHMPIDParam::LorsY(AliHMPIDParam::A2P(fPad),AliHMPIDParam::A2Y(fPad));                               } //center of the pad y, [cm]
 //  
-  inline Float_t Mathieson   (Float_t x                      )const;                                                                   //Mathieson distribution 
-  inline Float_t IntPartMathi(Float_t z, Int_t axis          )const;                                                                   //integral in 1-dim of Mathieson
-  inline Float_t IntMathieson(Float_t x,Float_t y            )const;                                                                   //integral in 2-dim of Mathieson  
+  inline Double_t MathiesonX   (Double_t x                   )const;                                                                   //Mathieson distribution along wires X 
+  inline Double_t MathiesonY   (Double_t x                   )const;                                                                   //Mathieson distribution perp to wires Y
+  inline Double_t IntPartMathiX(Double_t z                   )const;                                                                   //integral in 1-dim of Mathieson X
+  inline Double_t IntPartMathiY(Double_t z                   )const;                                                                   //integral in 1-dim of Mathieson Y
+  inline Double_t IntMathieson (Double_t x,Double_t y        )const;                                                                   //integral in 2-dim of Mathieson  
          Int_t   PadPcX      (                               )const{return AliHMPIDParam::A2X(fPad);}                                                 //pad pc x # 0..79
          Int_t   PadPcY      (                               )const{return AliHMPIDParam::A2Y(fPad);}                                                 //pad pc y # 0..47
          Int_t   PadChX      (                               )const{return (Pc()%2)*AliHMPIDParam::kPadPcX+PadPcX();}                                 //pad ch x # 0..159
@@ -78,54 +80,80 @@ Int_t AliHMPIDDigit::Compare(const TObject *pObj) const
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-Float_t AliHMPIDDigit::Mathieson(Float_t x)const
+Double_t AliHMPIDDigit::MathiesonX(Double_t x)const
 {
 // Mathieson function.
 // This is the answer to electrostatic problem of charge distrubution in MWPC described elsewhere. (NIM A370(1988)602-603)
 // Arguments: x- position of the center of Mathieson distribution
 //  Returns: value of the Mathieson function
-  Float_t  kK1=0.28278795,kK2=0.96242952, kSqrtK3 =0.77459667, kD=0.445;
-  Float_t lambda = x/kD;
-  Float_t a=1-TMath::TanH(kK2*lambda)*TMath::TanH(kK2*lambda);
-  Float_t b=1+kSqrtK3*kSqrtK3*TMath::TanH(kK2*lambda)*TMath::TanH(kK2*lambda);
-  Float_t mathi = kK1*a/b;
+  
+  Double_t lambda = x/AliHMPIDParam::PitchAnodeCathode();
+  Double_t tanh = TMath::TanH(AliHMPIDParam::K2x()*lambda);
+  Double_t a=1-tanh*tanh;
+  Double_t b=1+AliHMPIDParam::SqrtK3x()*AliHMPIDParam::SqrtK3x()*tanh*tanh;
+  Double_t mathi = AliHMPIDParam::K1x()*a/b;
+  return mathi;
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+Double_t AliHMPIDDigit::MathiesonY(Double_t y)const
+{
+// Mathieson function.
+// This is the answer to electrostatic problem of charge distrubution in MWPC described elsewhere. (NIM A370(1988)602-603)
+// Arguments: x- position of the center of Mathieson distribution
+//  Returns: value of the Mathieson function
+  
+  Double_t lambda = y/AliHMPIDParam::PitchAnodeCathode();
+  Double_t tanh = TMath::TanH(AliHMPIDParam::K2y()*lambda);
+  Double_t a=1-tanh*tanh;
+  Double_t b=1+AliHMPIDParam::SqrtK3y()*AliHMPIDParam::SqrtK3y()*tanh*tanh;
+  Double_t mathi = AliHMPIDParam::K1y()*a/b;
   return mathi;
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-Float_t AliHMPIDDigit::IntPartMathi(Float_t z, Int_t axis)const
+Double_t AliHMPIDDigit::IntPartMathiX(Double_t x)const
 {
 // Integration of Mathieson.
 // This is the answer to electrostatic problem of charge distrubution in MWPC described elsewhere. (NIM A370(1988)602-603)
 // Arguments: x,y- position of the center of Mathieson distribution
 //  Returns: a charge fraction [0-1] imposed into the pad
-  Float_t shift1,shift2;
-  if(axis==1) {
-    shift1 = -LorsX()+0.5*AliHMPIDParam::SizePadX();
-    shift2 = -LorsX()-0.5*AliHMPIDParam::SizePadX();
-  } else {
-    shift1 = -LorsY()+0.5*AliHMPIDParam::SizePadY();
-    shift2 = -LorsY()-0.5*AliHMPIDParam::SizePadY();
-  }
+  Double_t shift1 = -LorsX()+0.5*AliHMPIDParam::SizePadX();
+  Double_t shift2 = -LorsX()-0.5*AliHMPIDParam::SizePadX();
     
-  Float_t  kK2=0.96242952, kSqrtK3 =0.77459667,  kK4=0.37932926, kD=0.445;
+  Double_t ux1=AliHMPIDParam::SqrtK3x()*TMath::TanH(AliHMPIDParam::K2x()*(x+shift1)/AliHMPIDParam::PitchAnodeCathode());
+  Double_t ux2=AliHMPIDParam::SqrtK3x()*TMath::TanH(AliHMPIDParam::K2x()*(x+shift2)/AliHMPIDParam::PitchAnodeCathode());
+  
+  return AliHMPIDParam::K4x()*(TMath::ATan(ux2)-TMath::ATan(ux1));
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-  Float_t ux1=kSqrtK3*TMath::TanH(kK2*(z+shift1)/kD);
-  Float_t ux2=kSqrtK3*TMath::TanH(kK2*(z+shift2)/kD);
+Double_t AliHMPIDDigit::IntPartMathiY(Double_t y)const
+{
+// Integration of Mathieson.
+// This is the answer to electrostatic problem of charge distrubution in MWPC described elsewhere. (NIM A370(1988)602-603)
+// Arguments: x,y- position of the center of Mathieson distribution
+//  Returns: a charge fraction [0-1] imposed into the pad
+  Double_t shift1 = -LorsY()+0.5*AliHMPIDParam::SizePadY();
+  Double_t shift2 = -LorsY()-0.5*AliHMPIDParam::SizePadY();
+    
+  Double_t uy1=AliHMPIDParam::SqrtK3y()*TMath::TanH(AliHMPIDParam::K2y()*(y+shift1)/AliHMPIDParam::PitchAnodeCathode());
+  Double_t uy2=AliHMPIDParam::SqrtK3y()*TMath::TanH(AliHMPIDParam::K2y()*(y+shift2)/AliHMPIDParam::PitchAnodeCathode());
+  
+  return AliHMPIDParam::K4y()*(TMath::ATan(uy2)-TMath::ATan(uy1));
   
-  return kK4*(TMath::ATan(ux2)-TMath::ATan(ux1));
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-Float_t AliHMPIDDigit::IntMathieson(Float_t x,Float_t y)const
+Double_t AliHMPIDDigit::IntMathieson(Double_t x,Double_t y)const
 {
 // Integration of Mathieson.
 // This is the answer to electrostatic problem of charge distrubution in MWPC described elsewhere. (NIM A370(1988)602-603)
 // Arguments: x,y- position of the center of Mathieson distribution
 //  Returns: a charge fraction [0-1] imposed into the pad
 
-  Float_t xm = IntPartMathi(x,1);
-  Float_t ym = IntPartMathi(y,2);
+  Double_t xm = IntPartMathiX(x);
+  Double_t ym = IntPartMathiY(y);
   return 4*xm*ym;
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
index 1657e7b..0e03013 100644 (file)
 ClassImp(AliHMPIDParam)
 
 
+// Mathieson constant definition
+const Double_t AliHMPIDParam::fgkD     = 0.222500;  // ANODE-CATHODE distance 0.445/2
+//                                                                                          K3 = 0.66 along the wires (anode-cathode/wire pitch=0.5625)
+const Double_t AliHMPIDParam::fgkSqrtK3x = TMath::Sqrt(0.66);
+const Double_t AliHMPIDParam::fgkK2x     = TMath::PiOver2()*(1 - 0.5*fgkSqrtK3x);
+const Double_t AliHMPIDParam::fgkK1x     = 0.25*fgkK2x*fgkSqrtK3x/TMath::ATan(fgkSqrtK3x);
+const Double_t AliHMPIDParam::fgkK4x     = fgkK1x/(fgkK2x*fgkSqrtK3x);
+//                                                                                          K3 = 0.87 along the wires (anode-cathode/wire pitch=0.5625)
+const Double_t AliHMPIDParam::fgkSqrtK3y = TMath::Sqrt(0.87);
+const Double_t AliHMPIDParam::fgkK2y     = TMath::PiOver2()*(1 - 0.5*fgkSqrtK3y);
+const Double_t AliHMPIDParam::fgkK1y     = 0.25*fgkK2y*fgkSqrtK3y/TMath::ATan(fgkSqrtK3y);
+const Double_t AliHMPIDParam::fgkK4y     = fgkK1y/(fgkK2y*fgkSqrtK3y);
+//
+  
+
 Float_t AliHMPIDParam::fgkMinPcX[]={0.,0.,0.,0.,0.,0.};
 Float_t AliHMPIDParam::fgkMaxPcX[]={0.,0.,0.,0.,0.,0.};
 Float_t AliHMPIDParam::fgkMinPcY[]={0.,0.,0.,0.,0.,0.};
index 947fa9e..d705e99 100644 (file)
@@ -100,7 +100,19 @@ public:
   Double_t SigGeom     (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh,Double_t beta);//error due to unknown photon origin
   Double_t SigCrom     (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh,Double_t beta);//error due to unknonw photon energy
   Double_t Sigma2      (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh              );//photon candidate sigma^2
+
+  //Mathieson Getters
   
+  static Double_t PitchAnodeCathode()  {return fgkD;}
+  static Double_t SqrtK3x() {return fgkSqrtK3x;}
+  static Double_t K2x    () {return fgkK2x;}
+  static Double_t K1x    () {return fgkK1x;}
+  static Double_t K4x    () {return fgkK4x;}
+  static Double_t SqrtK3y() {return fgkSqrtK3y;}
+  static Double_t K2y    () {return fgkK2y;}
+  static Double_t K1y    () {return fgkK1y;}
+  static Double_t K4y    () {return fgkK4y;}
+  //
   enum EPlaneId {kPc,kRad,kAnod};            //3 planes in chamber 
   enum ETrackingFlags {kMipDistCut=-9,kMipQdcCut=-5,kNoPhotAccept=-11};     //flags for Reconstruction
 
@@ -109,7 +121,18 @@ protected:
   static /*const*/ Float_t fgkMinPcY[6];                                                           //limits PC
   static /*const*/ Float_t fgkMaxPcX[6];                                                           //limits PC
   static /*const*/ Float_t fgkMaxPcY[6]; 
+  
+// Mathieson constants
+// For HMPID --> x direction means parallel      to the wires: K3 = 0.66  (NIM A270 (1988) 602-603) fig.1  
+// For HMPID --> y direction means perpendicular to the wires: K3 = 0.90  (NIM A270 (1988) 602-603) fig.2  
+//
 
+  static const Double_t fgkD;  // ANODE-CATHODE distance 0.445/2
+  
+  static const Double_t fgkSqrtK3x,fgkK2x,fgkK1x,fgkK4x;
+  static const Double_t fgkSqrtK3y,fgkK2y,fgkK1y,fgkK4y;
+//
+    
   static Int_t    fgSigmas;                                                                        //sigma Cut
   static Bool_t   fgInstanceType;                                                                  //kTRUE if from geomatry kFALSE if from ideal geometry
 
index 46de9a5..8a97a6e 100644 (file)
@@ -213,6 +213,9 @@ void HmpConfig::GuiGen(TGCompositeFrame *pMainF)
   fGenNprimCO->AddEntry("N prim=1"    ,1);
   fGenNprimCO->AddEntry("N prim=2"    ,2);
   fGenNprimCO->AddEntry("N prim=5"    ,5);
+  fGenNprimCO->AddEntry("N prim=10"   ,10);
+  fGenNprimCO->AddEntry("N prim=20"   ,20);
+  fGenNprimCO->AddEntry("N prim=50"   ,50);
   fGenNprimCO->AddEntry("N prim=100"  ,100);
   fGenNprimCO->AddEntry("N prim=500"  ,500);
   fGenNprimCO->AddEntry("N prim=1000" ,1000);
@@ -676,7 +679,7 @@ void HmpConfig::WriteBatch()
                                                     fprintf(fp,"  gBenchmark->Show(\"ALICE\");\n");
   
                                                     fprintf(fp,"  gSystem->Exec(\"touch ZZZ______finished_______SSS\");\n");
-                                                    fprintf(fp,"  gSystem->Exec(\"aliroot rec.C\");\n}\n");
+                                                    fprintf(fp,"  gSystem->Exec(\"aliroot rec.C &\");\n}\n");
   fclose(fp);  
   char *sBatchName="rec";
   FILE *fp=fopen(Form("%s.C",sBatchName),"w"); if(!fp){Info("CreateRec","Cannot open output file: %s.C",sBatchName);return;}