Cluster fitting improved
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 11 Mar 2007 10:40:23 +0000 (10:40 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 11 Mar 2007 10:40:23 +0000 (10:40 +0000)
No more compatibility with RICH (not needed anymore)
+minors

20 files changed:
HMPID/AliHMPID.h
HMPID/AliHMPIDCluster.cxx
HMPID/AliHMPIDCluster.h
HMPID/AliHMPIDDigit.cxx
HMPID/AliHMPIDDigit.h
HMPID/AliHMPIDDigitizer.cxx
HMPID/AliHMPIDDigitizer.h
HMPID/AliHMPIDHit.cxx
HMPID/AliHMPIDHit.h
HMPID/AliHMPIDParam.h
HMPID/AliHMPIDPreprocessor.h
HMPID/AliHMPIDRecon.h
HMPID/AliHMPIDReconstructor.h
HMPID/AliHMPIDTracker.h
HMPID/AliHMPIDv0.h
HMPID/AliHMPIDv1.h
HMPID/HMPIDbaseLinkDef.h
HMPID/HMPIDrecLinkDef.h
HMPID/HMPIDsimLinkDef.h
HMPID/Hgeom.C

index b1514d5..dec1e1e 100644 (file)
@@ -59,7 +59,5 @@ private:
   ClassDef(AliHMPID,11)                            //Main HMPID class 
 };//class AliHMPID  
 
-typedef AliHMPID AliRICH; // for backward compatibility
-
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 #endif
index a928221..3be7737 100644 (file)
@@ -48,13 +48,13 @@ void AliHMPIDCluster::CoG()
   if ( fQRaw != 0 )   fX/=fQRaw;fY/=fQRaw;                  //final center of gravity
   
  
-  CorrSin();                                               //correct it by sinoid   
+  if(fDigs->GetEntriesFast()>1)CorrSin();                   //correct it by sinoid   
   
-  fQ  = fQRaw;                                             // Before starting fit procedure, Q and QRaw must be equal
-  fCh=pDig->Ch();                                          //initialize chamber number
-  fMaxQpad = maxQpad; fMaxQ=maxQ;                          //store max charge pad to the field
-  fChi2=0;                                                 // no Chi2 to find
-  fNlocMax=0;                                              // no maxima to find
+  fQ  = fQRaw;                                              // Before starting fit procedure, Q and QRaw must be equal
+  fCh=pDig->Ch();                                           //initialize chamber number
+  fMaxQpad = maxQpad; fMaxQ=maxQ;                           //store max charge pad to the field
+  fChi2=0;                                                  // no Chi2 to find
+  fNlocMax=0;                                               // proper status from this method
   fSt=kCoG;
 }//CoG()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -92,9 +92,10 @@ void AliHMPIDCluster::FitFunc(Int_t &iNpars, Double_t *, Double_t &chi2, Double_
   for(Int_t i=0;i<pClu->Size();i++){                                                   //loop on all pads of the cluster
     Double_t dQpadMath = 0;                                                            //pad charge collector  
     for(Int_t j=0;j<iNshape;j++){                                                      //Mathiesons loop as all of them may contribute to this pad
-      dQpadMath+=par[3*j+2]*pClu->Dig(i)->Mathieson(par[3*j],par[3*j+1]);              // par[3*j+2] is charge par[3*j] is x par[3*j+1] is y of current Mathieson
+      dQpadMath+=par[3*j+2]*pClu->Dig(i)->IntMathieson(par[3*j],par[3*j+1]);           // par[3*j+2] is charge par[3*j] is x par[3*j+1] is y of current Mathieson
     }
-    if(dQpadMath>0)chi2 +=TMath::Power((pClu->Dig(i)->Q()-dQpadMath),2)/dQpadMath;     //
+//    if(dQpadMath>0)chi2 +=TMath::Power((pClu->Dig(i)->Q()-dQpadMath),2)/dQpadMath;   //
+    if(dQpadMath>0)chi2 +=TMath::Power((pClu->Dig(i)->Q()-dQpadMath),2);               //
   }                                                                                    //loop on all pads of the cluster     
 }//FitFunction()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -113,6 +114,7 @@ void AliHMPIDCluster::Print(Option_t* opt)const
     case        kEdg  : status="edge     (fit)"   ;break;
     case       kSi1  : status="size 1   (cog)"   ;break;
     case       kNoLoc: status="no LocMax(fit)"   ;break;
+    case       kAbn  : status="Abnormal fit  "   ;break;
     
     default:            status="??????"          ;break;   
   }
@@ -152,18 +154,23 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Bool_t isTryUnfold)
 
  for(Int_t iDig1=0;iDig1<Size();iDig1++) {                                               //first digits loop
     AliHMPIDDigit *pDig1 = Dig(iDig1);                                                   //take next digit    
-    Int_t iHowManyMoreCnt = 0;                                                           //counts how many neighbouring pads has QDC more then current one
+    Int_t iCnt = 0;                                                                      //counts how many neighbouring pads has QDC more then current one
     for(Int_t iDig2=0;iDig2<Size();iDig2++) {                                            //loop on all digits again
       if(iDig1==iDig2) continue;                                                         //the same digit, no need to compare 
       AliHMPIDDigit *pDig2 = Dig(iDig2);                                                 //take second digit to compare with the first one
       Int_t dist = TMath::Sign(Int_t(pDig1->PadChX()-pDig2->PadChX()),1)+TMath::Sign(Int_t(pDig1->PadChY()-pDig2->PadChY()),1);//distance between pads
       if(dist==1)                                                                        //means dig2 is a neighbour of dig1
-         if(pDig2->Q()>=pDig1->Q()) iHowManyMoreCnt++;                                   //count number of pads with Q more then Q of current pad
+         if(pDig2->Q()>=pDig1->Q()) iCnt++;                                              //count number of pads with Q more then Q of current pad
     }//second digits loop
-    if(iHowManyMoreCnt==0&&fNlocMax<kMaxLocMax){                                         //this pad has Q more then any neighbour so it's local maximum
-      pMinuit->mnparm(3*fNlocMax  ,Form("x%i",fNlocMax),pDig1->LorsX(),0.1,0,0,iErrFlg); // X,Y,Q initial values of the loc max pad w
-      pMinuit->mnparm(3*fNlocMax+1,Form("y%i",fNlocMax),pDig1->LorsY(),0.1,0,0,iErrFlg); //
-      pMinuit->mnparm(3*fNlocMax+2,Form("q%i",fNlocMax),pDig1->Q(),0.1,0,100000,iErrFlg);// constrained to be positive
+    if(iCnt==0&&fNlocMax<kMaxLocMax){                                                    //this pad has Q more then any neighbour so it's local maximum
+      Double_t xStart=pDig1->LorsX();Double_t yStart=pDig1->LorsY();
+      Double_t xMin=xStart-AliHMPIDDigit::SizePadX();
+      Double_t xMax=xStart+AliHMPIDDigit::SizePadX();
+      Double_t yMin=yStart-AliHMPIDDigit::SizePadY();
+      Double_t yMax=yStart+AliHMPIDDigit::SizePadY();
+      pMinuit->mnparm(3*fNlocMax  ,Form("x%i",fNlocMax),xStart,0.1,xMin,xMax,iErrFlg);   // X,Y,Q initial values of the loc max pad
+      pMinuit->mnparm(3*fNlocMax+1,Form("y%i",fNlocMax),yStart,0.1,yMin,yMax,iErrFlg);   // X, Y constrained to be near the loc max
+      pMinuit->mnparm(3*fNlocMax+2,Form("q%i",fNlocMax),pDig1->Q(),0.1,0,100000,iErrFlg);// Q constrained to be positive
       fNlocMax++;
     }//if this pad is local maximum
   }//first digits loop
@@ -187,18 +194,28 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Bool_t isTryUnfold)
    Double_t arglist[10];arglist[0] = 10000;arglist[1] = 1.;                              //number of steps and sigma on pads charges  
    pMinuit->mnexcm("SIMPLEX" ,arglist,2,iErrFlg);                                        //start fitting with Simplex
    pMinuit->mnexcm("MIGRAD" ,arglist,2,iErrFlg);                                         //fitting improved by Migrad
-   
+   if(iErrFlg) {
+     Double_t strategy=2;
+     pMinuit->mnexcm("SET STR",&strategy,1,iErrFlg);                                     //change level of strategy 
+     if(!iErrFlg) {
+       pMinuit->mnexcm("SIMPLEX" ,arglist,2,iErrFlg);                                    //start fitting with Simplex
+       pMinuit->mnexcm("MIGRAD" ,arglist,2,iErrFlg);                                     //fitting improved by Migrad
+       Printf("Try to improve fit --> err %d",iErrFlg);
+     }
+   }        
+   if(iErrFlg) fSt=kAbn;                                                                 //no convergence of the fit...
    Double_t dummy; TString sName;                                                        //vars to get results from Minuit
    for(Int_t i=0;i<fNlocMax;i++){                                                        //store the local maxima parameters
       pMinuit->mnpout(3*i   ,sName,  fX, fErrX , dummy, dummy, iErrFlg);                 // X 
       pMinuit->mnpout(3*i+1 ,sName,  fY, fErrY , dummy, dummy, iErrFlg);                 // Y
       pMinuit->mnpout(3*i+2 ,sName,  fQ, fErrQ , dummy, dummy, iErrFlg);                 // Q
       pMinuit->mnstat(fChi2,dummy,dummy,iErrFlg,iErrFlg,iErrFlg);                        // Chi2 of the fit
-
-      if(fNlocMax!=1)fSt=kUnf;                                                           //
-      if(fNlocMax==1&&fSt!=kNoLoc) fSt=kLo1;                                             //
-      if ( !IsInPc()) fSt = kEdg;                                                        //
-      if(fSt==kNoLoc) fNlocMax=0;                                                        //
+      if(fSt!=kAbn) {         
+        if(fNlocMax!=1)fSt=kUnf;                                                           // if unfolded
+        if(fNlocMax==1&&fSt!=kNoLoc) fSt=kLo1;                                             // if only 1 loc max
+        if ( !IsInPc()) fSt = kEdg;                                                        // if Out of Pc
+        if(fSt==kNoLoc) fNlocMax=0;                                                        // if with no loc max (pads with same charge..)
+      }
       new ((*pCluLst)[iCluCnt++]) AliHMPIDCluster(*this);                               //add new unfolded cluster
    }
  }
index c472960..6d190f4 100644 (file)
@@ -10,7 +10,7 @@ class TClonesArray;        //Solve()
 class AliHMPIDCluster :public TObject
 {
 public:
-  enum EClusterStatus {kFrm,kCoG,kLo1,kUnf,kMax,kNot,kEdg,kSi1,kNoLoc,kEmp=-1};      //status flags    
+  enum EClusterStatus {kFrm,kCoG,kLo1,kUnf,kMax,kNot,kEdg,kSi1,kNoLoc,kAbn,kEmp=-1};      //status flags    
   AliHMPIDCluster():TObject( ),fCh(-1),fSi(-1),fSt(kEmp),fBox(-1),fNlocMax(-1),fMaxQpad(-1),fMaxQ(-1),fQRaw(0),fQ(0),fErrQ(-1),fX(0),fErrX(-1),fY(0),fErrY(-1),fChi2(-1),fDigs(0) {} //empty ctor
   
   
@@ -69,8 +69,6 @@ protected:
   ClassDef(AliHMPIDCluster,6) //HMPID cluster class
 };//class AliHMPIDCluster
 
-typedef AliHMPIDCluster AliRICHCluster; // for backward compatibility
-
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void AliHMPIDCluster::DigAdd(AliHMPIDDigit *pDig)
 {
index 6293394..d5f299e 100644 (file)
@@ -27,6 +27,12 @@ const Float_t AliHMPIDDigit::fMaxPcX[]={64.00 , 130.60 ,  64.00 , 130.60 , 64.00
 const Float_t AliHMPIDDigit::fMinPcY[]={ 0.00 , 0.00 , 42.92 ,  42.92,  85.84,  85.84};
 const Float_t AliHMPIDDigit::fMaxPcY[]={40.32 , 40.32, 83.24 ,  83.24, 126.16, 126.16};
 
+const Float_t  AliHMPIDDigit::k1      =0.28278796;
+const Float_t  AliHMPIDDigit::k2      =0.96242952;
+const Float_t  AliHMPIDDigit::kSqrtK3 =0.77459667;
+const Float_t  AliHMPIDDigit::k4      =0.37932926;
+
+Int_t AliHMPIDDigit::fSigmas=4;
 
 
 /*
index 0efc0f8..fef2fcb 100644 (file)
@@ -28,20 +28,20 @@ public:
          void    Draw        (Option_t *opt=""               );                                                                        //TObject::Draw() overloaded
          void    Print       (Option_t *opt=""               )const;                                                                   //TObject::Print() overloaded
 //private part  
-  static Int_t   Abs         (Int_t c,Int_t s,Int_t x,Int_t y)     {return c*100000000+s*1000000+x*1000+y;                           } //(ch,pc,padx,pady)-> abs pad
+  static Int_t   Abs         (Int_t ch,Int_t pc,Int_t x,Int_t y)   {return ch*100000000+pc*1000000+x*1000+y;                         } //(ch,pc,padx,pady)-> abs pad
   static Int_t   A2C         (Int_t pad                      )     {return pad/100000000;                                            } //abs pad -> chamber
   static Int_t   A2P         (Int_t pad                      )     {return pad%100000000/1000000;                                    } //abs pad -> pc
   static Int_t   A2X         (Int_t pad                      )     {return pad%1000000/1000;                                         } //abs pad -> pad X 
   static Int_t   A2Y         (Int_t pad                      )     {return pad%1000;                                                 } //abs pad -> pad Y 
          void    AddTidOffset(Int_t offset                   )     {for (Int_t i=0; i<3; i++) if (fTracks[i]>0) fTracks[i]+=offset;  } //needed for merging
          Int_t   Ch          (                               )const{return A2C(fPad);                                                } //chamber number
-  static Bool_t  IsOverTh    (Float_t q                      )     {return q >= 4;                                                   } //is digit over threshold????
+  static Bool_t  IsOverTh    (Float_t q                      )     {return q >= fSigmas;                                             } //is digit over threshold????
   static Bool_t  IsInside    (Float_t x,Float_t y            )     {return x>0&&y>0&&x<SizeAllX()&&y<SizeAllY();                     } //is point inside chamber boundary?
          Float_t LorsX       (                               )const{return LorsX(A2P(fPad),A2X(fPad));                               } //center of the pad x, [cm]
   static Float_t LorsX       (Int_t pc,Int_t padx            )     {return (padx    +0.5)*SizePadX()+(pc  %2)*(SizePcX()+SizeDead());} //center of the pad x, [cm]
          Float_t LorsY       (                               )const{return LorsY(A2P(fPad),A2Y(fPad));                               } //center of the pad y, [cm]
   static Float_t LorsY       (Int_t pc,Int_t pady            )     {return (pady    +0.5)*SizePadY()+(pc  /2)*(SizePcY()+SizeDead());} //center of the pad y, [cm]
-  inline Float_t Mathieson   (Float_t x,Float_t y            )const;                                                                   //Mathieson distribution 
+  inline Float_t IntMathieson(Float_t x,Float_t y            )const;                                                                   //Mathieson distribution 
          Int_t   PadPcX      (                               )const{return A2X(fPad);}                                                 //pad pc x # 0..79
          Int_t   PadPcY      (                               )const{return A2Y(fPad);}                                                 //pad pc y # 0..47
          Int_t   PadChX      (                               )const{return (Pc()%2)*kPadPcX+PadPcX();}                                 //pad ch x # 0..159
@@ -65,6 +65,7 @@ public:
   static Float_t SizePcY     (                               )     {return fMaxPcY[0];}                                                //PC size y, [cm]    
   static Float_t SizeWin     (                               )     {return 0.5;}                                                       //Quartz window width
   static Float_t SizeRad     (                               )     {return 1.5;}                                                       //Rad width   
+  static Float_t CathAnoCath (                               )     {return 0.445;}                                                     //Cathode-Anode-cathode pitch
   static const Float_t fMinPcX[6];
   static const Float_t fMinPcY[6];
   static const Float_t fMaxPcX[6];
@@ -72,14 +73,16 @@ public:
   
   inline static Bool_t IsInDead(Float_t x,Float_t y        );                                                                        //is point in dead area?
   inline static void   Lors2Pad(Float_t x,Float_t y,Int_t &pc,Int_t &px,Int_t &py);                                                  //(x,y)->(pc,px,py) 
-  
-protected:                  //AliDigit has fTracks[3]
-  Int_t    fPad;            //absolute pad number
-  Float_t  fQ;              //QDC value, fractions are permitted for summable procedure  
-  ClassDef(AliHMPIDDigit,4) //HMPID digit class       
-};//class AliHMPIDDigitN
-
-typedef AliHMPIDDigit AliRICHDigit; // for backward compatibility
+  static Int_t fSigmas;                                                                                                              //sigma cut on charge 
+protected:                                                                   //AliDigit has fTracks[3]
+  static const Float_t k1;                                                   //Mathieson parameters
+  static const Float_t k2;                                                   //
+  static const Float_t kSqrtK3;                                              //
+  static const Float_t k4;                                                   //
+  Int_t    fPad;                                                             //absolute pad number
+  Float_t  fQ;                                                               //QDC value, fractions are permitted for summable procedure  
+  ClassDef(AliHMPIDDigit,4)                                                  //HMPID digit class       
+};//class AliHMPIDDigit
 
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void AliHMPIDDigit::Lors2Pad(Float_t x,Float_t y,Int_t &pc,Int_t &px,Int_t &py)
@@ -122,17 +125,21 @@ Bool_t AliHMPIDDigit::IsInDead(Float_t x,Float_t y)
   return kFALSE;
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Float_t AliHMPIDDigit::Mathieson(Float_t x,Float_t y)const
+Float_t AliHMPIDDigit::IntMathieson(Float_t x,Float_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
-  const Float_t kSqrtK3=0.77459667,k2=0.962,k4=0.379;
+//  K1    =0.28278796
+//  K2    =0.96242952
+//  SqrtK3=0.77459667
+//  K4    =0.37932926
 
-  Float_t ux1=kSqrtK3*TMath::TanH(k2*(x-LorsX()+0.5*SizePadX())/0.425);
-  Float_t ux2=kSqrtK3*TMath::TanH(k2*(x-LorsX()-0.5*SizePadX())/0.425);
-  Float_t uy1=kSqrtK3*TMath::TanH(k2*(y-LorsY()+0.5*SizePadY())/0.425);
-  Float_t uy2=kSqrtK3*TMath::TanH(k2*(y-LorsY()-0.5*SizePadY())/0.425);
+  Float_t ux1=kSqrtK3*TMath::TanH(k2*(x-LorsX()+0.5*SizePadX())/CathAnoCath());
+  Float_t ux2=kSqrtK3*TMath::TanH(k2*(x-LorsX()-0.5*SizePadX())/CathAnoCath());
+  Float_t uy1=kSqrtK3*TMath::TanH(k2*(y-LorsY()+0.5*SizePadY())/CathAnoCath());
+  Float_t uy2=kSqrtK3*TMath::TanH(k2*(y-LorsY()-0.5*SizePadY())/CathAnoCath());
   return 4*k4*(TMath::ATan(ux2)-TMath::ATan(ux1))*k4*(TMath::ATan(uy2)-TMath::ATan(uy1));
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
index 2667f14..7eece0d 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "AliHMPIDDigitizer.h"
 #include "AliHMPID.h"
-#include "AliHMPIDDigit.h"
 #include <AliRun.h>
 #include <AliRunLoader.h>
 #include "AliRunDigitizer.h"
@@ -25,6 +24,7 @@
 
 ClassImp(AliHMPIDDigitizer)
 
+Bool_t AliHMPIDDigitizer::fDoNoise=kTRUE;
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void AliHMPIDDigitizer::Exec(Option_t*)
 {
@@ -80,6 +80,15 @@ void AliHMPIDDigitizer::Sdi2Dig(TClonesArray *pSdiLst,TObjArray *pDigLst)
     pLst[i]=(TClonesArray*)(*pDigLst)[i];
     iCnt[i]=0; if(pLst[i]->GetEntries()!=0) AliErrorClass("Some of digits lists is not empty");         //in principle those lists should be empty                                                                       
   }
+
+  // make noise array
+  Float_t arrNoise[7][6][80][48];
+  if(fDoNoise) {
+    for (Int_t iCh=AliHMPIDDigit::kMinCh;iCh<=AliHMPIDDigit::kMaxCh;iCh++)
+      for (Int_t iPc=AliHMPIDDigit::kMinPc;iPc<=AliHMPIDDigit::kMaxPc;iPc++)
+        for(Int_t iPx=AliHMPIDDigit::kMinPx;iPx<=AliHMPIDDigit::kMaxPx;iPx++)
+          for(Int_t iPy=AliHMPIDDigit::kMinPy;iPy<=AliHMPIDDigit::kMaxPy;iPy++) arrNoise[iCh][iPc][iPx][iPy] = gRandom->Gaus(0,1);
+  }  
   
   pSdiLst->Sort();  
                      
@@ -95,10 +104,22 @@ void AliHMPIDDigitizer::Sdi2Dig(TClonesArray *pSdiLst,TObjArray *pDigLst)
     iPad=pSdig->Pad(); iCh=AliHMPIDDigit::A2C(iPad);                                                            //new sdigit comes, reset collectors
     iNdigPad=1;
     aTids[0]=pSdig->GetTrack(0);aTids[1]=aTids[2]=-1; 
-    q=pSdig->Q();    
+    q=pSdig->Q();
+    if(fDoNoise) q+=arrNoise[iCh][pSdig->Pc()][pSdig->PadPcX()][pSdig->PadPcY()];
+    arrNoise[iCh][pSdig->Pc()][pSdig->PadPcX()][pSdig->PadPcY()]=0;
   }//sdigits loop (sorted)
   
   if(AliHMPIDDigit::IsOverTh(q))  new((*pLst[iCh])[iCnt[iCh]++]) AliHMPIDDigit(iPad,(Int_t)q,aTids);           //add the last one, in case of empty sdigits list q=-1
-                                                                                                               //so digit is not created    
+// add noise pad above threshold with no signal merged...if any
+  if(!fDoNoise) return;
+  aTids[0]=aTids[1]=aTids[2]=-1;
+  for (Int_t iCh=AliHMPIDDigit::kMinCh;iCh<=AliHMPIDDigit::kMaxCh;iCh++)
+    for (Int_t iPc=AliHMPIDDigit::kMinPc;iPc<=AliHMPIDDigit::kMaxPc;iPc++)
+      for(Int_t iPx=AliHMPIDDigit::kMinPx;iPx<=AliHMPIDDigit::kMaxPx;iPx++)
+        for(Int_t iPy=AliHMPIDDigit::kMinPy;iPy<=AliHMPIDDigit::kMaxPy;iPy++) {
+          Float_t q = arrNoise[iCh][iPc][iPx][iPy];
+          if(AliHMPIDDigit::IsOverTh(q)) new((*pLst[iCh])[iCnt[iCh]++]) AliHMPIDDigit(AliHMPIDDigit::Abs(iCh,iPc,iPx,iPy),(Int_t)q,aTids);
+        }
+        
 }//Sdi2Dig()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
index ee39172..c1dda20 100644 (file)
@@ -5,6 +5,7 @@
 
 
 #include <AliDigitizer.h>
+#include "AliHMPIDDigit.h"
 class AliRunDigitizer;
 class TClonesArray;
 class TObjArray;
@@ -16,12 +17,12 @@ public:
            AliHMPIDDigitizer(AliRunDigitizer *pRunDig):AliDigitizer(pRunDig)  {}
   virtual ~AliHMPIDDigitizer()                                                {}
   void     Exec(Option_t* option=0);                //virtual
+  void     DoNoise(Bool_t doNoise)                           {fDoNoise=doNoise;} // Set noise or not
 //   
   static void    Sdi2Dig(TClonesArray *pSDigLst,TObjArray *pDigLst);
 protected:
+  static  Bool_t fDoNoise;
   ClassDef(AliHMPIDDigitizer,0)
 };    
 
-typedef AliHMPIDDigitizer AliRICHDigitizer;  // for backward compatibility
-
 #endif
index 591ee99..d470339 100644 (file)
@@ -45,7 +45,7 @@ void AliHMPIDHit::Hit2Sdi(TClonesArray *pSdiLst,Int_t iHow)const
 
   for(Int_t i=-iHow;i<=iHow;i++){                            //horizontal loop
     for(Int_t j=-iHow;j<=iHow;j++){                          //vertical loop
-      if(dig.Set(fCh,pc,px+i,py+j,fQ*dig.Mathieson(fLx,fLy),fTrack)) continue;
+      if(dig.Set(fCh,pc,px+i,py+j,fQ*dig.IntMathieson(fLx,fLy),fTrack)) continue;
       new((*pSdiLst)[iSdiCnt++]) AliHMPIDDigit(dig);
     }
   }
index d623c44..c17a219 100644 (file)
@@ -62,6 +62,4 @@ Float_t AliHMPIDHit::QdcTot(Float_t &e)
 }  
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
       
-typedef AliHMPIDHit AliRICHHit; // for backward compatibility
-    
 #endif
index f85eee4..b94f62a 100644 (file)
@@ -48,8 +48,6 @@ protected:
   ClassDef(AliHMPIDParam,0)           //HMPID main parameters class
 };
 
-typedef AliHMPIDParam AliRICHParam; // for backward compatibility
-
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 AliHMPIDParam* AliHMPIDParam::Instance()
 {
index 9ef3cb1..2f68193 100644 (file)
@@ -20,6 +20,4 @@ protected:
   ClassDef(AliHMPIDPreprocessor, 0);
 };
 
-typedef AliHMPIDPreprocessor AliRICHPreprocessor; // for backward compatibility
-
 #endif
index 74bb5ed..5c0cb76 100644 (file)
@@ -65,7 +65,5 @@ protected:
   ClassDef(AliHMPIDRecon,0)
 };
 
-typedef AliHMPIDRecon AliRICHRecon; // for backward compatibility
-    
 #endif // #ifdef AliHMPIDRecon_cxx
 
index 33c6395..a3939d7 100644 (file)
@@ -37,8 +37,6 @@ public:
   ClassDef(AliHMPIDReconstructor, 0)   //class for the HMPID reconstruction
 };
 
-typedef AliHMPIDReconstructor AliRICHReconstructor; // for backward compatibility
-
 //__________________________________________________________________________________________________
 AliHMPIDDigit* AliHMPIDReconstructor::UseDig(Int_t padX,Int_t padY,TClonesArray *pDigLst,TMatrixF *pPadMap)
 {
index e83959f..9016348 100644 (file)
@@ -29,6 +29,4 @@ protected:
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
 
-typedef AliHMPIDTracker AliRICHTracker; // for backward compatibility
-
 #endif//AliHMPIDTracker_h
index 3482543..2ddccb0 100644 (file)
@@ -19,6 +19,4 @@ protected:
   ClassDef(AliHMPIDv0,1)  //HMPID coarse version for material budget study and debuging
 };
 
-typedef AliHMPIDv0 AliRICHv0; // for backward compatibility
-       
 #endif
index f56422d..9db5478 100644 (file)
@@ -40,6 +40,4 @@ protected:
   ClassDef(AliHMPIDv1,2)                                                                //HMPID full version for simulation
 };
 
-typedef AliHMPIDv1 AliRICHv1; // for backward compatibility
-               
 #endif
index c4c2cd5..d760368 100644 (file)
@@ -4,13 +4,6 @@
 #pragma link off all functions;
 
 
-#pragma link C++ typedef  AliRICHDigit;
-#pragma link C++ typedef  AliRICHHit;
-#pragma link C++ typedef  AliRICHCluster;
-#pragma link C++ typedef  AliRICHParam;
-#pragma link C++ typedef  AliRICH;
-
-
 #pragma link C++ class  AliHMPIDDigit+;
 #pragma link C++ class  AliHMPIDHit+;
 #pragma link C++ class  AliHMPIDCluster+;
index 1ba11d1..b25a621 100644 (file)
@@ -3,11 +3,6 @@
 #pragma link off all classes;
 #pragma link off all functions;
 
-#pragma link C++ typedef  AliRICHReconstructor;
-#pragma link C++ typedef  AliRICHTracker;
-#pragma link C++ typedef  AliRICHRecon;
-#pragma link C++ typedef  AliRICHPreprocessor;
-
 #pragma link C++ class  AliHMPIDReconstructor+;
 #pragma link C++ class  AliHMPIDTracker+;
 #pragma link C++ class  AliHMPIDRecon+;
index 060002b..ad137c9 100644 (file)
@@ -3,10 +3,6 @@
 #pragma link off all classes;
 #pragma link off all functions;
 
-#pragma link C++ typedef  AliRICHv0;
-#pragma link C++ typedef  AliRICHv1;
-#pragma link C++ typedef  AliRICHDigitizer;
-
 #pragma link C++ class  AliHMPIDv0+;
 #pragma link C++ class  AliHMPIDv1+;
 #pragma link C++ class  AliHMPIDDigitizer+;
index fe46f4f..51c68c8 100644 (file)
@@ -4,7 +4,7 @@ Double_t dx,dy,dz,r1,r2;//tmp vars for volume dimentions
 Double_t cm=1,m=100*cm,mm=0.1*cm,mkm=0.001*cm;//length units  
 TGeoManager *g=0;
 
-void RichGeom(Bool_t isOnlyChambers=kFALSE)
+void Hgeom(Bool_t isOnlyChambers=kFALSE)
 {
   
   g=new TGeoManager("HMPID","Private HMPID geometry");
@@ -12,11 +12,7 @@ void RichGeom(Bool_t isOnlyChambers=kFALSE)
   gGeoManager->MakeBox("ALIC",gGeoManager->GetMedium("Air"),dx=30*m/2,dy=30*m/2,dz=30*m/2); //arbitrary values  
   gGeoManager->SetTopVolume(gGeoManager->GetVolume("ALIC"));
     
-  Rich(isOnlyChambers);
-  
-//  RusGel();
-  
-//  Vhmpid();
+  Hmpid(isOnlyChambers);
   
   gGeoManager->CloseGeometry();
   
@@ -59,9 +55,21 @@ void Materials()
   new TGeoMaterial("HMPID_Apd"      ,a=0     ,z=0 ,den=0);                                   new TGeoMedium("HMPID_Apd"     ,22,gGeoManager->GetMaterial("HMPID_Apd"));
 }//Materials()
 //__________________________________________________________________________________________________
-void Rich(Bool_t isOnlyChambers)
+void Hmpid(Bool_t isOnlyChambers)
 {
-//Rich  chamber
+//HMPID  chamber
+//                                                         z ^
+//                                                           |
+//                                                           | 
+//    <-Y0-> X <--Y1--> X <--Y1--> X <--Y1--> X <-Y0->       |            cath wires: r 50mkm; shift Y0=1.05m;, pitch Y1=2.1; center to PC  4.45mm; material Cu
+//                                                         x *------->y            
+//        
+//    <--Y0--> x <-----------Y1-----------> x <--Y0-->                    anod wires: r 20mkm; shift Y0=2.2mm; pitch Y1=4.0mm; center to PC  2.04mm; material W
+//                                                                       
+//                                                                                                
+//   |________________________________________________|                   pad size y 8.4mm
+// 
+//
   TGeoVolume *pRich=gGeoManager->MakeBox("HMPID",gGeoManager->GetMedium("Air"),dx=(6*mm+1681*mm+6*mm)/2,  //main HMPID volume
                                                                               dy=(6*mm+1466*mm+6*mm)/2,
                                                                               dz=(80*mm+40*mm)*2/2);     //x,y taken from 2033P1  z from p84 TDR  
@@ -175,260 +183,12 @@ void Rich(Bool_t isOnlyChambers)
     pSandBox->AddNode(pSandCover ,copy=2,new TGeoTranslation(  0*mm,0*mm,    -25*mm)); 
 }//Rich()
 //__________________________________________________________________________________________________
-void Sr90(TGeoVolume *pTop)
-{
-    pSrc               =gGeoManager->MakeTube("Src"              ,gGeoManager->GetMedium("Air")        , 0 , 70*mm/2 ,  30*mm/2);       //top container
-      pAlGlass         =gGeoManager->MakeTube("SrcAlGlass"       ,gGeoManager->GetMedium("HMPID_Al")    , 0 , 38*mm/2 ,21.8*mm/2);       //Al glass wall        
-        pPerpexPlug    =gGeoManager->MakeTube("SrcPerpex"        ,gGeoManager->GetMedium("HMPID_Perpex"), 0 , 34*mm/2 ,  20*mm/2);       //Perpex plug         
-          pScrewCentral=gGeoManager->MakeTube("SrcScrewCentral"  ,gGeoManager->GetMedium("HMPID_Steel") , 0 ,  5*mm/2 ,  15*mm/2);       //Steel screw in the center        
-          pScrewSr90   =gGeoManager->MakeTube("SrcScrewSr90"     ,gGeoManager->GetMedium("HMPID_Steel") , 0 ,  2*mm/2 ,  10*mm/2);       //Steel screw to support Sr90 
-            pSr90      =gGeoManager->MakeTube("SrcSr90"          ,gGeoManager->GetMedium("HMPID_Sr90")  , 0 ,  1*mm/2 ,   1*mm/2);       //Sr90 source
-          pHolePerpex  =gGeoManager->MakeTube("SrcHolePerpex"    ,gGeoManager->GetMedium("Air")        , 0 ,  4*mm/2 ,  10*mm/2);       //Air hole in perpex plug      
-        pHoleAl        =gGeoManager->MakeTube("SrcHoleAl"        ,gGeoManager->GetMedium("Air")        , 0 ,  5*mm/2 , 1.8*mm/2);       //Air hole in Al glass bottom
-    pMylarFoil         =gGeoManager->MakeTube("SrcMylarFoil"     ,gGeoManager->GetMedium("HMPID_Mylar") , 0 , 30*mm/2 , 50*mkm/2);       //Mylar foil                
-                
-    pTop->AddNode(pSrc,1,new TGeoTranslation(30*cm,0,1*cm));
-      pSrc ->AddNode(pMylarFoil,1,new TGeoTranslation(0,0,21.8*mm/2+50*mkm/2));
-      pSrc ->AddNode(pAlGlass,1,new TGeoTranslation(0,0,0));                           //Al glass to fake Src volume
-        pAlGlass->AddNode(       pHoleAl      ,1,new TGeoTranslation(6*mm,0, -10*mm));
-        pAlGlass->AddNode(       pPerpexPlug  ,1,new TGeoTranslation(0*mm,0, 0.9*mm));
-          pPerpexPlug->AddNode(  pHolePerpex  ,1,new TGeoTranslation(6*mm,0,  -5*mm));      
-          pPerpexPlug->AddNode(  pScrewCentral,1,new TGeoTranslation(0   ,0, 2.5*mm));  
-          pPerpexPlug->AddNode(  pScrewSr90   ,1,new TGeoTranslation(6*mm,0,   5*mm));  
-            pScrewSr90->AddNode( pSr90        ,1,new TGeoTranslation(0   ,0,-4.5*mm));  
-}//Sr90()    
-//__________________________________________________________________________________________________
-void RusGel()
-{
-//Defines VHMPID aerogel option geometry. 
-//                 top view normal position                                   side view normal position
-//                                                                                                 ^ y
-//                  --------                                                                       | 
-//                  |      |                                                                       |
-//                  |      |          z<-----* y                                          z<-------* x  ----> MUON side
-//                  |      |                 |                                  ----                    
-//                  |      |                 |                                  |  | 
-//                  ________                 v x                                |  |
-//                                                                              |--|
-//                                                                              |  |
-//                                                                              ----       
-//Chamber consists from Al box filled with air where 4 aerogel blocks and APD wall are positioned.
-//  ------------------------------
-//  |-|           |-| |-| |-| |-||
-//  |-|           | | | | | | | ||  
-//  |-|           | | | | | | | ||
-//  |-| APD wall  | | | | | | | ||    z<---* y  top view   
-//  |-|           | | | | | | | ||         |
-//  |-|           | | | | | | | ||         | 
-//  |-|           |_| |_| |_| |_||         v x
-//  ------------------------------          
-// 
-//             ALIC
-//               |
-//             Vbox (Al)
-//               |
-//             Vair (Air) 
-//        _______|________
-//        |              |
-//       4*Vgel         Vwall
-//                       |
-//                      Vcolumn (division along X)
-//                       |
-//                      Vcell   (division along Y)
-//                       |
-//                      Vapd
-
-  Double_t cm=1 , m=100 , mm=0.1                                                     ;//dimentions, default is cm
-  
-  Int_t    iNapdsX        =10                                    ;//number of APDs along x
-  Int_t    iNapdsY        =16                                    ;//number of APDs along y
-  Double_t dCellX         =1.5*mm             *0.5                ;//cell X half size
-  Double_t dCellY         =1.5*mm             *0.5                ;//cell Y half size
-  Double_t dCellZ         =0.5*mm             *0.5                ;//APD wall thickness   
-  Double_t dWallX         =                         iNapdsX*dCellX;//APD wall X half size
-  Double_t dWallY         =                         iNapdsY*dCellY;//APD wall Y half size
-  Double_t dWallZ         =                                 dCellZ;//APD wall half thickness  
-  Double_t dApdR          =0.5*mm                                 ;//APD radius 
-  Double_t dApdZ          =                                 dCellZ;//APD Z half size
-  Double_t dGelX          =                                 dWallX;//gel block X half size
-  Double_t dGelY          =                                 dWallY;//gel block Y half size
-  Double_t dGelZ          =10*mm              *0.5                ;//gel block Z half size
-  Double_t dProxGap       =50*cm                                  ;//half distance between APD wall and last aerogel block
-  Double_t dAirX          =                                 dWallX;//internal air X hald size
-  Double_t dAirY          =                                 dWallY;//internal air Y hald size
-  Double_t dAirZ          =                dWallZ+dProxGap+7*dGelZ;//internal air Z hald size
-  Double_t dBoxWall       =2*mm               *0.5                ;//Al box walls thickness
-  Double_t dBoxX          =                         dAirX+dBoxWall;//Al box x half size 
-  Double_t dBoxY          =                         dAirY+dBoxWall;//Al box y half size 
-  Double_t dBoxZ          =                         dAirZ+dBoxWall;//Al box z half size
-  
-  Int_t copy;    Double_t rmin,rmax,dx,dy,dz;
-//make external Al box
-  TGeoVolume *pBox=gGeoManager->MakeBox("Gbox",gGeoManager->GetMedium("HMPID_Al"),dx=dBoxX,dy=dBoxY,dz=dBoxZ);
-  TGeoRotation *pRot=new TGeoRotation("GboxRot"); pRot->RotateX(90);
-  gGeoManager->GetVolume("ALIC")->AddNode(pBox,copy=1,new TGeoCombiTrans(0*m,-5.2*m,2.5*m,pRot));//normal position
-//position Air to Al box   
-  TGeoVolume *pAir=gGeoManager->MakeBox( "Gair",gGeoManager->GetMedium("Air"),dx=dAirX,dy=dAirY,dz=dAirZ);                   
-  pBox->AddNode(pAir,copy=1); 
-//position 4 gel blocks to Air
-  TGeoVolume *pGel24=gGeoManager->MakeBox( "Ggel24",gGeoManager->GetMedium("HMPID_Gel24"),dx=dGelX,dy=dGelY,dz=dGelZ);     
-    pAir->AddNode(pGel24,copy=1,new TGeoTranslation(0,0,-dAirZ+1*dGelZ)); 
-  TGeoVolume *pGel26=gGeoManager->MakeBox( "Ggel26",gGeoManager->GetMedium("HMPID_Gel26"),dx=dGelX,dy=dGelY,dz=dGelZ);     
-    pAir->AddNode(pGel26,copy=1,new TGeoTranslation(0,0,-dAirZ+5*dGelZ)); 
-  TGeoVolume *pGel28=gGeoManager->MakeBox( "Ggel28",gGeoManager->GetMedium("HMPID_Gel28"),dx=dGelX,dy=dGelY,dz=dGelZ);     
-    pAir->AddNode(pGel28,copy=1,new TGeoTranslation(0,0,-dAirZ+9*dGelZ)); 
-  TGeoVolume *pGel30=gGeoManager->MakeBox( "Ggel30",gGeoManager->GetMedium("HMPID_Gel30"),dx=dGelX,dy=dGelY,dz=dGelZ);     
-    pAir->AddNode(pGel30,copy=1,new TGeoTranslation(0,0,-dAirZ+13*dGelZ)); 
-//position APD wall to air
-  TGeoVolume   *pWall     =gGeoManager->MakeBox ("Gwall",gGeoManager->GetMedium("HMPID_Si"),dx=dWallX , dy=dWallY , dz=dWallZ );  
-  pAir->AddNode(pWall,copy=1,new TGeoTranslation(0,0,dAirZ-dWallZ)); 
-//divide wall into cells
-  Int_t axis,ndiv; Double_t start,step;
-  TGeoVolume *pWallCol =pWall      ->Divide("Gcol",axis=1,ndiv=iNapdsX,start=0,step=0);//divide VhGap along X by NpadsX columns
-  TGeoVolume *pWallCell=pWallCol   ->Divide("Gcel",axis=2,ndiv=iNapdsY,start=0,step=0);//divide VhGapCol along Y by NpadsY cells
-//position APD to wall cell
-  TGeoVolume *pApd=gGeoManager->MakeTube("Gapd",gGeoManager->GetMedium("HMPID_Apd"),rmin=0,rmax=dApdR,dz=dApdZ); pWallCell->AddNode(pApd,copy=1); 
-}//RusGel()
-//__________________________________________________________________________________________________
-void Vhmpid()
-{
-//Defines VHMPID geometry for TIC option.
-//                 top view normal position                                   side view normal position
-//                                                                                                 ^ y
-//                  --------                                                                       | 
-//                  |------|                                                                       |
-//                  |      |          z<-----* y                                          z<-------* x  ----> MUON side
-//                  |      |                 |                                  ----                    
-//                  |      |                 |                                  |  | 
-//                  ________                 v x                                |  |
-//                                                                              |--|
-//                                                                              |  |
-//                                                                              ----       
-//Chamber consists from Al box filled with radiator CF4 and C4F10 quartz window in between , Al mirror and MWPC.
-//  ---------------------------------------------------  top view chamber in test position
-//  |  -------------- MWPC     | quartz window        |
-//  |   . . . . . .            |                      |  
-//  |   \                      |                      |
-//  |    \             CF4     |    C4F10             |  z<-----* y   
-//  |     \ mirror             |                      |         |
-//  |      \                   |                      |         | 
-//  |       \                  |                      |         v x  
-//  ---------------------------------------------------    
-//                                                         z ^
-//                                                           |
-//                                                           | 
-//    <-Y0-> X <--Y1--> X <--Y1--> X <--Y1--> X <-Y0->       |            cath wires: r 50mkm; shift Y0=1.05m;, pitch Y1=2.1; center to PC  4.45mm; material Cu
-//                                                         x *------->y            
-//        
-//    <--Y0--> x <-----------Y1-----------> x <--Y0-->                    anod wires: r 20mkm; shift Y0=2.2mm; pitch Y1=4.0mm; center to PC  2.04mm; material W
-//                                                                       
-//                                                                                                
-//   |________________________________________________|                   pad size y 8.4mm
-// 
-//             ALIC
-//               |
-//             Vbox
-//        _______|______
-//       |       |      |
-//     Vc4f    Vwin   Vcf4
-//                 _____|________
-//                |              |
-//              Vmir             |
-//                               |
-//                             Vgap
-//                               |
-//                             Vcol (column of gap cells) X
-//                               |
-//                             Vcel  cell in the column   Y                  
-//                         ______|______
-//                        |      |      |
-//                      Vpad   Vano   Vcat
-  Double_t cm=1 , m=100 , mm=0.1 , um=1e-4                                                      ;//dimentions, default is cm
-  
-  Int_t    iNpadsX        =                                    AliHMPIDParam::NpadsX()           ;//number of pads along x parametrised
-  Int_t    iNpadsY        =                                    AliHMPIDParam::NpadsY()           ;//number of pads along y parametrised
-  Double_t wCathR         =50  *um                                                              ;//cathode wire radius defined by USER
-  Double_t wCathShift     =1.05*mm                                                              ;//cathode wire shift from pad edge defined by USER
-  Double_t wCathPitch     =2.1 *mm                                                              ;//cathode wire pitch defined by USER
-  Double_t wCathPc        =4.45*mm                                                              ;//distance from pc to cathode wire defined by USER
-  Double_t wAnodR         =20  *um                                                              ;//anod wire radius defined by USER
-  Double_t wAnodShift     =2.2 *mm                                                              ;//anod wire shift from pad edge defined by USER
-  Double_t wAnodPc        =2.04*mm                                                              ;//distance from anod wire center to pc defined by USER
-  Double_t dPadX          =                    0.5*                   AliHMPIDParam::PadSizeX()  ;//pad X half size parametrised
-  Double_t dPadY          =                    0.5*                   AliHMPIDParam::PadSizeY()  ;//pad Y half size parametrised
-  Double_t dPadZ          =1.0 *mm            *0.5                                              ;//CsI film thickness 
-  Double_t dGapX          =                    0.5*                          iNpadsX*2*dPadX    ;//gap x half size n. pads x * pad size
-  Double_t dGapY          =                    0.5*                          iNpadsY*2*dPadY    ;//gap y half size
-  Double_t dGapZ          =                    0.5*                    (2*dPadZ+wCathPc+wCathR) ;//gap half thickness
-  Double_t dMirX          =                    0.5*     2*dGapX/TMath::Cos(45*TMath::DegToRad());//Ag mirror x half size defined by gap size and angle 45 degrees
-  Double_t dMirY          =                    0.5*                           2*dGapY           ;//Ag mirror y half size defined by gap size
-  Double_t dMirZ          =1.0 *mm            *0.5                                              ;//Ag mirror z half size defined by USER
-  Double_t wBoxWall       =2.0 *mm                                                              ;//Al box walls thickness defined by USER
-  Double_t dBoxX          =                    0.5*                         (2*dGapX+2*cm)      ;//Al box x half size defined by gap size 2 cm for tolerance
-  Double_t dBoxY          =                    0.5*                         (2*dGapY+2*cm)      ;//Al box y half size defined by gap size 2 cm for tolerance 
-  Double_t dBoxZ          =1.8*m              *0.5                                              ;//Al box z half size defined by USER
-  Double_t dWinX          =                                                  (dBoxX-wBoxWall)   ;//SiO2 window x half size defined by box size
-  Double_t dWinY          =                                                  (dBoxY-wBoxWall)   ;//SiO2 window y half size defined by box size
-  Double_t dWinZ          =1.0*cm             *0.5                                              ;//SiO2 window z half size defined by USER
-  Double_t dCF4X          =                                                  (dBoxX-wBoxWall)   ;//CF4 radiator x half size defined by box size
-  Double_t dCF4Y          =                                                  (dBoxY-wBoxWall)   ;//CF4 radiator y half size defined by box size
-  Double_t dCF4Z          =                                                  0.4*dBoxZ          ;//CF4 radiator z half size defined by box size or by USER
-  Double_t dC4F10X        =                                                  (dBoxX-wBoxWall)   ;//C4F10 radiator x half size defined by box size
-  Double_t dC4F10Y        =                                                  (dBoxY-wBoxWall)   ;//C4F10 radiator y half size defined by box size
-  Double_t dC4F10Z        =                                      (dBoxZ-dWinZ-dCF4Z-wBoxWall)   ;//C4F10 radiator z half size defined by box, CF4 and window sizes
-  
-  Int_t copy;  
-  Double_t rmin,rmax,dx,dy,dz;
-  
-//make VHMPID type 2 volume  (2 radiators)
-  TGeoVolume *pBox=gGeoManager->MakeBox("Vbox",gGeoManager->GetMedium("HMPID_Al"),dx=dBoxX,dy=dBoxY,dz=dBoxZ);
-  
-  TGeoRotation *pRot=new TGeoRotation("VboxRot"); pRot->RotateX(90);//normal position
-  gGeoManager->GetVolume("ALIC")->AddNode(pBox,copy=1,new TGeoCombiTrans(0*m,-5.2*m,2.5*m,pRot));
-//position C4F10 radiator to Al box   
-  TGeoVolume *pC4F10=gGeoManager->MakeBox("Vc4f",gGeoManager->GetMedium("HMPID_C4F10"),dx=dC4F10X,dy=dC4F10Y,dz=dC4F10Z);      
-  pBox->AddNode(pC4F10,copy=1,new TGeoTranslation(0*cm,0*cm,-dBoxZ+wBoxWall+dC4F10Z)); 
-//position quartz window  to Al box  
-  TGeoVolume *pWindow=gGeoManager->MakeBox( "Vwin",gGeoManager->GetMedium("HMPID_SiO2"),dx=dWinX,dy=dWinY,dz=dWinZ); 
-  pBox->AddNode(pWindow,copy=1,new TGeoTranslation(0*cm,0*cm,-dBoxZ+wBoxWall+2*dCF4Z+dWinZ)); 
-//position CF4 radiator to Al box   
-  TGeoVolume *pCF4=gGeoManager->MakeBox( "Vcf4",gGeoManager->GetMedium("HMPID_CF4"),dx=dCF4X,dy=dCF4Y,dz=dCF4Z);                   
-  pBox->AddNode(pCF4,copy=1,new TGeoTranslation(0*cm,0*cm,dBoxZ-wBoxWall-dCF4Z)); 
-//position mirror to CF4 radiator   
-  TGeoVolume *pMirror=gGeoManager->MakeBox( "Vmir",gGeoManager->GetMedium("HMPID_Ag"),dx=dMirX,dy=dMirY,dz=dMirZ);     
-  TGeoRotation *pMirrorRot=new TGeoRotation("VmirRot"); pMirrorRot->RotateY(45);   
-  pCF4->AddNode(pMirror,copy=1,new TGeoCombiTrans(0*cm,0*cm,dCF4Z-1*cm-dGapX,pMirrorRot)); 
-//position gap to  CF4 radiator   
-  TGeoVolume   *pGap     =gGeoManager->MakeBox ("Vgap"     ,gGeoManager->GetMedium("HMPID_CF4"),dx=dGapX , dy=dGapY , dz=dGapZ );  
-  TGeoRotation *pMwpcRot=new TGeoRotation("VmpcRot"); pMwpcRot->RotateY(90);  
-  pCF4->AddNode(pGap,copy=1,new TGeoCombiTrans(-dBoxX+1*cm,0*cm,dCF4Z-1*cm-dGapX,pMwpcRot)); 
-//divide gap into 80x48 cells
-  Int_t axis,ndiv; Double_t start,step;
-  TGeoVolume *pGapCol =pGap      ->Divide("Vcol",axis=1,ndiv=iNpadsX,start=0,step=0);//divide VhGap along X by NpadsX columns
-  TGeoVolume *pGapCell=pGapCol   ->Divide("Vcel",axis=2,ndiv=iNpadsY,start=0,step=0);//divide VhGapCol along Y by NpadsY cells
-//position pad to gap cell
-  TGeoVolume *pPad=gGeoManager->MakeBox ("Vpad",gGeoManager->GetMedium("HMPID_CsI"),dx=dPadX,dy=dPadY,dz=dPadZ);      
-  pGapCell->AddNode(pPad,copy=1,new TGeoTranslation(0,0,-dGapZ+dPadZ)); 
-//define wire rotation common for both anod and cathode wires
-  TGeoRotation *pWireRot=new TGeoRotation("VwireRot"); pWireRot->RotateY(90); //rotate wires around Y to be along X (initially along Z)
-//position 2 anod  wires to gap cell
-  TGeoVolume *pAnodWire =gGeoManager->MakeTube("Vano",gGeoManager->GetMedium("HMPID_W")  ,rmin=0   , rmax=wAnodR   , dz=dPadX );  
-  pGapCell->AddNode(pAnodWire,copy=1,new TGeoCombiTrans (0, -dPadY+wAnodShift             , -dGapZ+wAnodPc+2*dPadZ , pWireRot)); 
-  pGapCell->AddNode(pAnodWire,copy=2,new TGeoCombiTrans (0,  dPadY-wAnodShift             , -dGapZ+wAnodPc+2*dPadZ , pWireRot)); 
-//position 4 cathode wires to gap cell  
-  TGeoVolume *pCathWire =gGeoManager->MakeTube("Vcat",gGeoManager->GetMedium("HMPID_Cu") ,rmin=0   , rmax=wCathR , dz=dPadX );
-  pGapCell->AddNode(pCathWire,copy=1,new TGeoCombiTrans (0, -dPadY+wCathShift            , -dGapZ+wCathPc+2*dPadZ , pWireRot)); 
-  pGapCell->AddNode(pCathWire,copy=2,new TGeoCombiTrans (0, -dPadY+wCathShift+wCathPitch , -dGapZ+wCathPc+2*dPadZ , pWireRot)); 
-  pGapCell->AddNode(pCathWire,copy=3,new TGeoCombiTrans (0,  dPadY-wCathShift-wCathPitch , -dGapZ+wCathPc+2*dPadZ , pWireRot)); 
-  pGapCell->AddNode(pCathWire,copy=4,new TGeoCombiTrans (0,  dPadY-wCathShift            , -dGapZ+wCathPc+2*dPadZ , pWireRot)); 
-}//Vhmpid()
-//__________________________________________________________________________________________________
 void Axis()
 {
-// Draw axises  on top of geometry    
-  Double_t X[6]={0,0,0,300,0,0};  Double_t Y[6]={0,0,0,0,300,0};  Double_t Z[6]={0,0,0,0,0,300};  
+// Draw axises  on top of geometry
+  Double_t X[6]={0,0,0,300,0,0};  Double_t Y[6]={0,0,0,0,300,0};  Double_t Z[6]={0,0,0,0,0,300};
   TPolyLine3D *pXaxis=new TPolyLine3D(2,X);pXaxis->SetLineColor(kRed);   pXaxis->Draw();
   TPolyLine3D *pYaxis=new TPolyLine3D(2,Y);pYaxis->SetLineColor(kGreen); pYaxis->Draw();
-  TPolyLine3D *pZaxis=new TPolyLine3D(2,Z);pZaxis->SetLineColor(kBlue);  pZaxis->Draw();  
+  TPolyLine3D *pZaxis=new TPolyLine3D(2,Z);pZaxis->SetLineColor(kBlue);  pZaxis->Draw();
 }
 //__________________________________________________________________________________________________