]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
new Hits2SDigits.
authorkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 1 Aug 2003 13:54:45 +0000 (13:54 +0000)
committerkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 1 Aug 2003 13:54:45 +0000 (13:54 +0000)
AliRICHSDigit removed, AliRICHhit AliRICHdigit now defined in AliRICH.h in order to facilitate inline AddHit and AddDigit

24 files changed:
RICH/AliRICH.cxx
RICH/AliRICH.h
RICH/AliRICHCerenkov.cxx [deleted file]
RICH/AliRICHCerenkov.h [deleted file]
RICH/AliRICHChamber.cxx
RICH/AliRICHChamber.h
RICH/AliRICHClusterFinder.cxx
RICH/AliRICHDetect.cxx
RICH/AliRICHDetectV1.cxx
RICH/AliRICHDigitizer.cxx
RICH/AliRICHDisplay.cxx
RICH/AliRICHHit.cxx [deleted file]
RICH/AliRICHHit.h [deleted file]
RICH/AliRICHMerger.cxx
RICH/AliRICHParam.cxx
RICH/AliRICHParam.h
RICH/AliRICHPatRec.cxx
RICH/AliRICHPoints.cxx
RICH/AliRICHPoints.h
RICH/AliRICHv1.cxx
RICH/AliRICHv3.cxx
RICH/RICHLinkDef.h
RICH/libRICH.pkg
RICH/menu.C

index bfcb7e8d2fc74a8ee4185ce0d521fe640350bb71..e1fd0f1faa2b103ceb311efbc8546a240bcb8a39 100644 (file)
 #include "AliMagF.h"
 #include "AliPoints.h"
 #include "AliRICH.h"
-#include "AliRICHCerenkov.h"
 #include "AliRICHClusterFinder.h"
 #include "AliRICHDigit.h"
 #include "AliRICHDigitizer.h"
-#include "AliRICHHit.h"
 #include "AliRICHHitMapA1.h"
 #include "AliRICHMerger.h"
 #include "AliRICHRawCluster.h"
@@ -65,6 +63,8 @@
 static Int_t sMaxIterPad=0;    // Static variables for the pad-hit iterator routines
 static Int_t sCurIterPad=0;
  
+ClassImp(AliRICHhit)
+ClassImp(AliRICHdigit)
 ClassImp(AliRICH)
     
 //___________________________________________
@@ -80,7 +80,7 @@ AliRICH::AliRICH()
   fIshunt     = 0;
   fHits       = 0;
   fSDigits    = 0;
-  fNSDigits   = 0;
+  fNsdigits   = 0;
   fNcerenkovs = 0;
   fDchambers  = 0;
   fRecHits1D = 0;
@@ -94,20 +94,20 @@ AliRICH::AliRICH()
       fNrechits1D[i] = 0;
       fNrechits3D[i] = 0;
   }
-  fFileName = 0;
-  fMerger = 0;
+//kir  fFileName = 0;
+//kir  fMerger = 0;
 }//AliRICH::AliRICH()
 //______________________________________________________________________________
 AliRICH::AliRICH(const char *name, const char *title)
         :AliDetector(name,title)
 {//Named ctor
   if(GetDebug())Info("named ctor","Start.");
-  fHits       = new TClonesArray("AliRICHHit",1000  );
+  fHits       = new TClonesArray("AliRICHhit",1000  );
   fCerenkovs  = new TClonesArray("AliRICHCerenkov",1000);
-  fSDigits    = new TClonesArray("AliRICHSDigit",100000);
+  fSDigits    = new TClonesArray("AliRICHdigit",100000);
   gAlice->AddHitList(fHits);
   gAlice->AddHitList(fCerenkovs);
-  fNSDigits   = 0;
+  fNsdigits   = 0;
   fNcerenkovs = 0;
   fIshunt     = 0;
   fDchambers  =new TObjArray(kNCH);
@@ -128,8 +128,8 @@ AliRICH::AliRICH(const char *name, const char *title)
   for (i=0; i<kNCH; i++) 
     (*fChambers)[i] = new AliRICHChamber();*/  
   
-  fFileName = 0;
-  fMerger = 0;
+//kir  fFileName = 0;
+//kir  fMerger = 0;
   if(GetDebug())Info("named ctor","Stop.");
 }//AliRICH::AliRICH(const char *name, const char *title)
 //______________________________________________________________________________
@@ -165,62 +165,64 @@ AliRICH::~AliRICH()
     }                     
   if(GetDebug()) Info("dtor","Stop.");    
 }//AliRICH::~AliRICH()
-//_____________________________________________________________________________
-Int_t AliRICH::Hits2SDigits(Float_t xhit,Float_t yhit,Float_t eloss, Int_t idvol, ResponseType res)
-{
-//  Calls the charge disintegration method of the current chamber and adds
-//  the simulated cluster to the root tree 
+//______________________________________________________________________________
+void AliRICH::Hits2SDigits(Float_t xhit,Float_t yhit,Float_t eloss, Int_t idvol, ResponseType res)
+{//calls the charge disintegration method of the current chamber and adds all generated sdigits to the list of digits
+
   if(GetDebug()) Info("Hits2SDigits","Start.");
    
-   Int_t clhits[5];
-   Float_t newclust[4][500];
-   Int_t nnew;
-    
-//
-//  Integrated pulse height on chamber
-    
-    clhits[0]=fNhits+1;
+   Int_t iChamber,iPadX,iPadY,iAdc,iTrack;
+   Float_t list[4][500];
+   Int_t iNdigits;
+        
 
-    ((AliRICHChamber*)fChambers->At(idvol))->DisIntegration(eloss, xhit, yhit, nnew, newclust, res);
+  ((AliRICHChamber*)fChambers->At(idvol))->DisIntegration(eloss, xhit, yhit, iNdigits, list, res);
     Int_t ic=0;
     
-//
-//  Add new clusters
-    for (Int_t i=0; i<nnew; i++) {
-       if (Int_t(newclust[0][i]) > 0) {
+  for(Int_t i=0; i<iNdigits; i++) {
+    if(Int_t(list[0][i]) > 0) {
            ic++;
-//  Cluster Charge
-           clhits[1] = Int_t(newclust[0][i]);
-//  Pad: ix
-           clhits[2] = Int_t(newclust[1][i]);
-//  Pad: iy 
-           clhits[3] = Int_t(newclust[2][i]);
-//  Pad: chamber sector
-           clhits[4] = Int_t(newclust[3][i]);
-
-           //printf(" %d %d %d %d %d\n",  clhits[0],  clhits[1],  clhits[2],  clhits[3],  clhits[4]);
+           iAdc = Int_t(list[0][i]);
+           iPadX = Int_t(list[1][i]);
+           iPadY = Int_t(list[2][i]);
+           iChamber = Int_t(list[3][i]);
+
            
-           AddSDigit(clhits);
+           AddSDigit(iChamber,iPadX,iPadY,iAdc,iTrack);
        }
     }
     
    if(gAlice->TreeS()){
        gAlice->TreeS()->Fill();
        gAlice->TreeS()->Write(0,TObject::kOverwrite);
-       //printf("Filled SDigits...\n");
    }
   if(GetDebug()) Info("Hits2SDigits","Stop.");    
-   return nnew;
 }//Int_t AliRICH::Hits2SDigits(Float_t xhit,Float_t yhit,Float_t eloss, Int_t idvol, ResponseType res)
 
+void AliRICH::Hits2SDigits(Int_t iEventN)
+{//Create a list of sdigits corresponding to list of hits. Every hit generates sdigit.
+  if(GetDebug()) Info("Hit2SDigits(iEventN)","Start.");
+  
+  gAlice->GetEvent(iEventN);
+  
+  if(!fLoader->TreeS()) fLoader->MakeTree("S");
+  MakeBranch("S");
+  
+  for(int i=0;i<iEventN+40;i++) AddSDigit(i,13,24,55,2010);
+  
+  fLoader->WriteSDigits("OVERWRITE");
+  
+  if(GetDebug()) Info("Hit2SDigits(iEventN)","Stop.");
+}
+//______________________________________________________________________________
 void AliRICH::Hits2SDigits()
-{//Dummy: sdigits are created during transport. Called from alirun.   
+{//Calls Hits2SDigits(EventNumber) for all events in the current run
   if(GetDebug()) Info("Hit2SDigits","Start.");
-
-  int nparticles = gAlice->GetNtrack();
-  cout << "Particles (RICH):" <<nparticles<<endl;
-  if (nparticles > 0) printf("SDigits were already generated.\n");
-
+  
+  for(Int_t iEventN=0;iEventN<gAlice->GetEventsPerRun();iEventN++)
+    Hits2SDigits(iEventN);
+        
+  if(GetDebug()) Info("Hit2SDigits","Stop.");
 }
 //______________________________________________________________________________
 void AliRICH::SDigits2Digits()
@@ -264,28 +266,6 @@ void AliRICH::Digits2Reco()
   if (nparticles > 0) FindClusters(0,0);
 
 }//void AliRICH::Digits2Reco()  
-//______________________________________________________________________________
-void AliRICH::AddHit(Int_t track, Int_t *vol, Float_t *hits)
-{// Adds the current hit to the RICH hits list
-
-    TClonesArray &lhits = *fHits;
-    new(lhits[fNhits++]) AliRICHHit(fIshunt,track,vol,hits);
-}
-
-void AliRICH::AddCerenkov(Int_t track, Int_t *vol, Float_t *cerenkovs)
-{
-// Adds a RICH cerenkov hit to the Cerenkov Hits list   
-
-    TClonesArray &lcerenkovs = *fCerenkovs;
-    new(lcerenkovs[fNcerenkovs++]) AliRICHCerenkov(fIshunt,track,vol,cerenkovs);
-}
-
-void AliRICH::AddSDigit(Int_t *aSDigit)
-{// Adds the current S digit to the RICH list of S digits   
-
-  TClonesArray &lSDigits = *fSDigits;
-  new(lSDigits[fNSDigits++]) AliRICHSDigit(aSDigit);
-} 
 
 
 void AliRICH::AddDigits(Int_t id, Int_t *tracks, Int_t *charges, Int_t *digits)
@@ -1592,14 +1572,6 @@ Float_t AliRICH::AbsoCH4(Float_t x)
 
 
 //___________________________________________
-void AliRICH::ResetHits()
-{// Reset number of clusters and the cluster array for this detector
-  AliDetector::ResetHits();
-  fNSDigits   = 0;
-  fNcerenkovs = 0;
-  if (fSDigits)  fSDigits->Clear();
-  if (fCerenkovs) fCerenkovs->Clear();
-}
 //____________________________________________
 void AliRICH::ResetDigits()
 {//Reset number of digits and the digits array for this detector
@@ -1687,7 +1659,7 @@ void AliRICH::FindClusters(Int_t nev,Int_t lastEntry)
     //gObjectTable->Print();
 }//void AliRICH::FindClusters(Int_t nev,Int_t lastEntry)
 //______________________________________________________________________________
-AliRICHSDigit* AliRICH::FirstPad(AliRICHHit*  hit,TClonesArray *clusters ) 
+AliRICHSDigit* AliRICH::FirstPad(AliRICHhit*  hit,TClonesArray *clusters ) 
 {// Initialise the pad iterator Return the address of the first sdigit for hit
     TClonesArray *theClusters = clusters;
     Int_t nclust = theClusters->GetEntriesFast();
@@ -1794,9 +1766,9 @@ void AliRICH::DiagnosticsFE(Int_t evNumber1,Int_t evNumber2)
           gAlice->ResetHits();
           treeH->GetEvent(track);
                           
-          for(AliRICHHit* mHit=(AliRICHHit*)pRICH->FirstHit(-1); 
+          for(AliRICHhit* mHit=(AliRICHhit*)pRICH->FirstHit(-1); 
               mHit;
-              mHit=(AliRICHHit*)pRICH->NextHit()) 
+              mHit=(AliRICHhit*)pRICH->NextHit()) 
             {
               //Int_t nch  = mHit->fChamber;              // chamber number
               //Float_t x  = mHit->X();                    // x-pos of hit
@@ -2397,9 +2369,9 @@ AliRICH *pRICH  = (AliRICH*)gAlice->GetDetector("RICH");
         Int_t nhits = pRICH->Hits()->GetEntriesFast();
         if (nhits) Nh+=nhits;
         printf("Hits            : %d\n",nhits);
-        for(AliRICHHit* mHit=(AliRICHHit*)pRICH->FirstHit(-1); 
+        for(AliRICHhit* mHit=(AliRICHhit*)pRICH->FirstHit(-1); 
             mHit;
-            mHit=(AliRICHHit*)pRICH->NextHit()) 
+            mHit=(AliRICHhit*)pRICH->NextHit()) 
           {
             Int_t nch  = mHit->Chamber();              // chamber number
             trackglob[0] = mHit->X();                 // x-pos of hit
@@ -2551,7 +2523,7 @@ AliRICH *pRICH  = (AliRICH*)gAlice->GetDetector("RICH");
                       //printf ("Cerenkov hit number %d/%d, X:%d, Y:%d\n",hit,ncerenkovs,cx,cy); 
                       
                       //TParticle *MIP = (TParticle*)gAlice->Particle(cmother);
-                      AliRICHHit* mipHit = (AliRICHHit*) pRICH->Hits()->UncheckedAt(0);
+                      AliRICHhit* mipHit = (AliRICHhit*) pRICH->Hits()->UncheckedAt(0);
                       mom[0] = current->Px();
                       mom[1] = current->Py();
                       mom[2] = current->Pz();
@@ -3467,18 +3439,18 @@ void AliRICH::MakeBranch(Option_t* option)
 
 
   if(cH&&TreeH()){
-    if(!fHits) fHits=new TClonesArray("AliRICHHit",1000  );
+    if(!fHits) fHits=new TClonesArray("AliRICHhit",1000  );
     if(!fCerenkovs) fCerenkovs  = new TClonesArray("AliRICHCerenkov",1000);
     MakeBranchInTree(TreeH(),"RICHCerenkov", &fCerenkovs, kBufferSize, 0) ;
 
-    //kir if(!fSDigits) fSDigits    = new TClonesArray("AliRICHSDigit",100000);
+    //kir if(!fSDigits) fSDigits    = new TClonesArray("AliRICHdigit",100000);
     //kir MakeBranchInTree(TreeH(),"RICHSDigits", &fSDigits, kBufferSize, 0) ;
   }     
   AliDetector::MakeBranch(option);//this is after cH because we need to guarantee that fHits array is created
       
   if(cS&&fLoader->TreeS()){  
-    if(!fSDigits) fSDigits=new TClonesArray("AliRICHSDigit",100000);
-    MakeBranchInTree(gAlice->TreeS(),"RICHSDigits",&fSDigits,kBufferSize,0) ;
+    if(!fSDigits) fSDigits=new TClonesArray("AliRICHdigit",100000);
+    MakeBranchInTree(fLoader->TreeS(),"RICH",&fSDigits,kBufferSize,0) ;
   }
    
   int i;
@@ -3552,38 +3524,39 @@ void AliRICH::SetTreeAddress()
   TTree *treeS = fLoader->TreeS();
     
   if(treeH){
+    if(GetDebug())Info("SetTreeAddress","tree H is requested.");
+    if(fHits==0x0) fHits=new TClonesArray("AliRICHhit",1000); 
+    
     branch = treeH->GetBranch("RICHCerenkov");
     if(branch){
       if (fCerenkovs == 0x0) fCerenkovs  = new TClonesArray("AliRICHCerenkov",1000); 
         branch->SetAddress(&fCerenkovs);
     }
        
-     branch = treeH->GetBranch("RICHSDigits");
-     if (branch) 
-      {
-        if (fSDigits == 0x0) fSDigits    = new TClonesArray("AliRICHSDigit",100000);
-        branch->SetAddress(&fSDigits);
-         //printf("Setting sdigits branch address at %p in TreeH\n",&fSDigits);
-      }
-     if (fHits == 0x0) fHits       = new TClonesArray("AliRICHHit",1000  ); 
-    }
+//kir      branch = treeH->GetBranch("RICHSDigits");
+//kir      if (branch) 
+//kir       {
+//kir         if (fSDigits == 0x0) fSDigits    = new TClonesArray("AliRICHdigit",100000);
+//kir         branch->SetAddress(&fSDigits);
+//kir       }
+  }//if(treeH)
  
    //this is after TreeH because we need to guarantee that fHits array is created
-   AliDetector::SetTreeAddress();
+  AliDetector::SetTreeAddress();
     
-   if (treeS) {
-      branch = treeS->GetBranch("RICHSDigits");
-      if (branch) 
-        {
-          if (fSDigits == 0x0) fSDigits = new TClonesArray("AliRICHSDigit",100000);
-          branch->SetAddress(&fSDigits);
-          //printf("Setting sdigits branch address at %p in TreeS\n",&fSDigits);
-        }
+  if(treeS){
+    if(GetDebug())Info("SetTreeAddress","tree S is requested.");
+    branch = treeS->GetBranch("RICH");
+    if(branch){
+      if(!fSDigits) fSDigits=new TClonesArray("AliRICHdigit",100000);
+      branch->SetAddress(&fSDigits);
     }
+  }
     
     
-   if (treeD) 
-    {
+  if(treeD){
+    if(GetDebug())Info("SetTreeAddress","tree D is requested.");
+
       if (fDchambers == 0x0) 
         {
            fDchambers = new TObjArray(kNCH);
@@ -3602,8 +3575,9 @@ void AliRICH::SetTreeAddress()
       }
     }
     
-  if (treeR) {
-    
+  if(treeR){
+    if(GetDebug())Info("SetTreeAddress","tree R is requested.");
+
     if (fRawClusters == 0x0 ) 
      {
        fRawClusters = new TObjArray(kNCH);
@@ -3655,7 +3629,7 @@ void AliRICH::SetTreeAddress()
          }
       } 
       
-  }
+  }//if(treeR)
   if(GetDebug())Info("SetTreeAddress","Stop.");
 }//void AliRICH::SetTreeAddress()
 //______________________________________________________________________________
@@ -3666,3 +3640,4 @@ void AliRICH::Print(Option_t *option)const
   GetSegmentationModel(0)->Print(option);
   GetResponseModel(0)->Print(option);
 }//void AliRICH::Print(Option_t *option)const
+
index 8e9b4b519c3059007192215013d0c92f7587ad50..07f2bb1840f0f4898a33527f8fff76041504ff31 100644 (file)
@@ -8,14 +8,17 @@
 
 
 #include <TObjArray.h>
+#include <TClonesArray.h>
 #include <AliDetector.h>
+#include <AliHit.h>
+#include <AliDigit.h>
 #include "AliRICHConst.h"
 #include "AliRICHChamber.h"
+
 static const int kNCH=7;
 
 class TFile;
 
-class AliRICHHit;
 class AliRICHSDigit;
 class AliRICHRawCluster;
 class AliRICHRecHit1D;
@@ -29,32 +32,203 @@ class AliRICHResponse;
 class AliRICHGeometry;
 class AliRICHMerger;
 
+
+
+class AliRICHhit : public AliHit
+{
+public:
+  inline   AliRICHhit();
+  inline   AliRICHhit(Int_t fIshunt, Int_t track, Int_t *vol, Float_t *hits);
+  virtual ~AliRICHhit()         {;}
+    
+  Int_t   Chamber()             {return fChamber;}
+  Float_t Particle()            {return fParticle;}    
+  Float_t Theta()               {return fTheta;}
+  Float_t Phi()                 {return fPhi;}
+  Float_t Tlength()             {return fTlength;}
+  Float_t Eloss()               {return fEloss;}
+  Float_t Loss()                {return fLoss;}
+  Float_t   PHfirst()           {return fPHfirst;}
+  Float_t   PHlast()            {return fPHlast;}
+  Float_t MomX()                {return fMomX;}
+  Float_t MomY()                {return fMomY;}
+  Float_t MomZ()                {return fMomZ;}
+  Float_t CerenkovAngle()       {return fMomX;}
+  Float_t MomFreoX()            {return fMomX;}
+  Float_t MomFreoY()            {return fMomY;}
+  Float_t MomFreoZ()            {return fMomZ;}
+protected:
+  Int_t     fChamber;       // Chamber number
+  Float_t   fParticle;      // Geant3 particle type
+  Float_t   fTheta ;        // Incident theta angle in degrees      
+  Float_t   fPhi   ;        // Incident phi angle in degrees
+  Float_t   fTlength;       // Track length inside the chamber
+  Float_t   fEloss;         // ionisation energy loss in gas   
+  Float_t   fPHfirst;       // first padhit
+  Float_t   fPHlast;        // last padhit
+  Float_t   fLoss;          // did it hit the freon?
+  Float_t   fMomX;          // x Momentum at photochatode entry point
+  Float_t   fMomY;          // y Momentum at photochatode entry point
+  Float_t   fMomZ;          // z Momentum at photochatode entry point
+  Float_t   fNPads;         // Pads hit
+  Float_t   fCerenkovAngle; // Dummy cerenkov angle
+  Float_t   fMomFreoX;      // x Momentum at freon entry point
+  Float_t   fMomFreoY;      // y Momentum at freon entry point
+  Float_t   fMomFreoZ;      // z Momentum at freon entry point            
+        
+  ClassDef(AliRICHhit,1)  //RICH hit class
+};//class AliRICHhit
+//______________________________________________________________________________  
+AliRICHhit::AliRICHhit()
+           :AliHit() 
+{//default ctor  
+  fChamber=-1;
+  fParticle=fTheta=fPhi=fTlength=fEloss=fPHfirst=fPHlast=fLoss=-1;
+  fMomX=fMomY=fMomZ=fNPads=fCerenkovAngle=fMomFreoX=fMomFreoY=fMomFreoZ=-1;
+}//AliRICHhit::default ctor
+//______________________________________________________________________________
+AliRICHhit::AliRICHhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
+            AliHit(shunt, track)
+{//ctor
+  fChamber=vol[0];
+  fParticle=hits[0];
+  fX=hits[1];
+  fY=hits[2];
+  fZ=hits[3];
+  fTheta=hits[4];
+  fPhi=hits[5];
+  fTlength=hits[6];
+  fEloss=hits[7];
+  fPHfirst=(Int_t) hits[8];
+  fPHlast=(Int_t) hits[9];
+  fLoss=hits[13];
+  fMomX=hits[14];
+  fMomY=hits[15];
+  fMomZ=hits[16];
+  fNPads=hits[17];
+  fCerenkovAngle=hits[18];
+  fMomFreoX=hits[19];
+  fMomFreoY=hits[20];
+  fMomFreoZ=hits[21];
+}//AliRICHhit::ctor
+//______________________________________________________________________________
+//______________________________________________________________________________
+//______________________________________________________________________________
+class AliRICHCerenkov: public AliHit 
+{
+public:
+  inline   AliRICHCerenkov();
+  inline   AliRICHCerenkov(Int_t fIshunt, Int_t track, Int_t *vol, Float_t *Cerenkovs);
+  virtual ~AliRICHCerenkov() {;}
+public:
+  Int_t     fChamber;         // Chamber number
+  Float_t   fTheta ;          // Incident theta angle in degrees      
+  Float_t   fPhi   ;          // Incident phi angle in degrees
+  Float_t   fTlength;         // Track length inside the chamber
+  Float_t   fEloss;           // ionisation energy loss in gas
+  Int_t     fPHfirst;         // first padhit
+  Int_t     fPHlast;          // last padhit
+  Int_t     fCMother;         // index of mother particle
+  Float_t   fLoss;            // nature of particle loss
+  Float_t   fIndex;           // Index of photon
+  Float_t   fProduction;      // Point of production
+  Float_t   fMomX;            // Local Momentum
+  Float_t   fMomY;            // Local Momentum
+  Float_t   fMomZ;            // Local Momentum
+  Float_t   fNPads;           // Pads hit
+  Float_t   fCerenkovAngle;   // Cerenkov Angle
+    
+  ClassDef(AliRICHCerenkov,1)  //RICH cerenkov class
+};//class AliRICHCerenkov
+//______________________________________________________________________________
+AliRICHCerenkov::AliRICHCerenkov()
+{//ctor
+    fChamber=-1;
+    fX=fY=fZ=fTheta=fPhi=fTlength=fEloss=-1;
+    fPHfirst=fPHlast=fCMother=-1;
+    fLoss=fIndex=fProduction=fMomX=fMomY=fMomZ=fNPads=fCerenkovAngle=-1;
+}//AliRICHCerenkov::ctor
+//______________________________________________________________________________
+AliRICHCerenkov::AliRICHCerenkov(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits)
+                :AliHit(shunt, track)
+{//ctor
+    fChamber=vol[0];
+    fX=hits[1];
+    fY=hits[2];
+    fZ=hits[3];
+    fTheta=hits[4];
+    fPhi=hits[5];
+    fTlength=hits[6];
+    fEloss=hits[7];
+    fPHfirst=(Int_t) hits[8];
+    fPHlast=(Int_t) hits[9];
+    fCMother=Int_t(hits[10]);
+    fIndex = hits[11];
+    fProduction = hits[12];  
+    fLoss=hits[13];
+    fMomX=hits[14];
+    fMomY=hits[15];
+    fMomZ=hits[16];
+    fNPads=hits[17];
+    fCerenkovAngle=hits[18];
+}//AliRICHCerenkov::ctor
+//______________________________________________________________________________
+//______________________________________________________________________________
+//______________________________________________________________________________
+class AliRICHdigit :public AliDigit
+{
+public:
+           AliRICHdigit() {fPadX=fPadY=fChamber=fAdc=fTracks[0]=fTracks[1]=fTracks[2]=-1;}
+  inline   AliRICHdigit(Int_t iC,Int_t iX,Int_t iY,Int_t iAdc,Int_t iT1,Int_t iT2,Int_t iT3);
+  virtual ~AliRICHdigit() {;}  
+  Int_t C()   const{return fChamber;}
+  Int_t X()   const{return fPadX;}
+  Int_t Y()   const{return fPadY;}
+  Int_t Adc() const{return fAdc;}
+protected:
+  Int_t fChamber;  //module number 
+  Int_t fPadX;    //pad number along X
+  Int_t fPadY;    //pad number along Y
+  Int_t fAdc;     //ADC value
+  ClassDef(AliRICHdigit,1) //RICH digit class       
+};//class AliRICHdigit
+//______________________________________________________________________________
+AliRICHdigit::AliRICHdigit(Int_t iC,Int_t iX,Int_t iY,Int_t iAdc,Int_t iT0,Int_t iT1,Int_t iT2)
+{
+  fChamber=iC;fPadX=iX;fPadY=iY;fAdc=iAdc;
+  fTracks[0]=iT0;fTracks[1]=iT1;fTracks[2]=iT2;
+}//AliRICHdigit::ctor  
+//______________________________________________________________________________
+//______________________________________________________________________________
+//______________________________________________________________________________
 class AliRICH : public AliDetector 
 {
 public:
-            AliRICH();                                            //default ctor
-            AliRICH(const char *name, const char *title);         //named ctor
-            AliRICH(const AliRICH& RICH)                    {;}   //copy ctor  
-  virtual  ~AliRICH();                                            //dtor
+            AliRICH();                                            
+            AliRICH(const char *name, const char *title);         
+            AliRICH(const AliRICH& RICH)                    {;}   
+  virtual  ~AliRICH();                                            
           
   AliRICH& operator=(const AliRICH& rhs) { return *this;}
   virtual Int_t  IsVersion() const =0;
           
-  virtual void  AddHit(Int_t track, Int_t *vol, Float_t *hits);
-          void  AddCerenkov(Int_t track, Int_t *vol, Float_t *cerenkovs);
-          void  AddSDigit(Int_t *clhits);
+  inline  void  AddHit(Int_t track, Int_t *vol, Float_t *hits);//virtual
+  inline  void  AddCerenkov(Int_t track, Int_t *vol, Float_t *cerenkovs);
+  inline  void  AddSDigit(Int_t iC,Int_t iX,Int_t iY,Int_t iAdc,Int_t iT0,Int_t iT1=-1,Int_t iT2=-1);
           void  AddDigits(Int_t id, Int_t *tracks, Int_t *charges, Int_t *digits);
           void  AddRawCluster(Int_t id, const AliRICHRawCluster& cluster);
           void  AddRecHit1D(Int_t id, Float_t* rechit, Float_t* photons, Int_t* padsx, Int_t* padsy);
           void  AddRecHit3D(Int_t id, Float_t* rechit, Float_t omega, Float_t theta, Float_t phi);
-  virtual void  ResetHits();
-  virtual void  ResetDigits();
+  inline  void  ResetHits();    //virtual
+  inline  void  ResetSDigits(); //virtual
+          void  ResetDigits();  //virtual
           void  ResetRawClusters();
           void  ResetRecHits1D();
           void  ResetRecHits3D();
   virtual void  FindClusters(Int_t nev,Int_t lastEntry);
-  virtual void  Hits2SDigits();
-          Int_t Hits2SDigits(Float_t xhit,Float_t yhit,Float_t eloss,Int_t id, ResponseType res);
+          void  Hits2SDigits(); //virtual 
+          void  Hits2SDigits(Int_t iEventN);
+          void  Hits2SDigits(Float_t xhit,Float_t yhit,Float_t eloss,Int_t id, ResponseType res);
   virtual void  SDigits2Digits();
   virtual void  Digits2Reco();
 
@@ -71,10 +245,9 @@ public:
   virtual void   MakeBranchInTreeD(TTree *treeD, const char *file=0);
   virtual void   SetTreeAddress();
    
-  
-   
+     
    
-  AliRICHSDigit* FirstPad(AliRICHHit *hit, TClonesArray *clusters);
+  AliRICHSDigit* FirstPad(AliRICHhit *hit, TClonesArray *clusters);
   AliRICHSDigit* NextPad(TClonesArray *clusters);
    
 
@@ -86,7 +259,7 @@ public:
   AliRICHResponse* GetResponseModel(Int_t iChamberN)                          const{return GetChamber(iChamberN)->GetResponseModel();}
   void     SetReconstructionModel(Int_t iChamberN, AliRICHClusterFinder *pRICHReco){GetChamber(iChamberN)->SetReconstructionModel(pRICHReco);}
 
-  virtual void   SetMerger(AliRICHMerger* thisMerger) {fMerger=thisMerger;}  
+//kir  virtual void   SetMerger(AliRICHMerger* thisMerger) {fMerger=thisMerger;}  
   AliRICHChamber& Chamber(Int_t id) {return *((AliRICHChamber *) (*fChambers)[id]);}
   AliRICHChamber* GetChamber(Int_t iChamberN)     const{return (AliRICHChamber*) (*fChambers)[iChamberN];}
   
@@ -110,7 +283,7 @@ public:
     
 protected:
   TObjArray            *fChambers;           //! List of RICH chambers
-  Int_t                 fNSDigits;           //Current number of sdigits
+  Int_t                 fNsdigits;           //Current number of sdigits
   Int_t                 fNcerenkovs;         //Current number of cerenkovs
   TClonesArray         *fSDigits;            //! List of sdigits
   TObjArray            *fDchambers;          //! Array of lists of digits
@@ -124,27 +297,58 @@ protected:
   Int_t                 fNrechits3D[kNCH];   //Array of current numbers of rec hits 3D 
 
   Int_t fCkovNumber;                         // Number of Cerenkov photons
-  Int_t fCkovQuarz;                          // Cerenkovs crossing quartz
-  Int_t fCkovGap;                            // Cerenkovs crossing gap
-  Int_t fCkovCsi;                            // Cerenkovs crossing csi
-  Int_t fLostRfreo;                          // Cerenkovs reflected in freon
-  Int_t fLostRquar;                          // Cerenkovs reflected in quartz
-  Int_t fLostAfreo;                          // Cerenkovs absorbed in freon 
-  Int_t fLostAquarz;                         // Cerenkovs absorbed in quartz
-  Int_t fLostAmeta;                          // Cerenkovs absorbed in methane
-  Int_t fLostCsi;                            // Cerenkovs below csi quantum efficiency 
-  Int_t fLostWires;                          // Cerenkovs lost in wires
   Int_t fFreonProd;                          // Cerenkovs produced in freon
-  Float_t fMipx;                             // x coord. of MIP
-  Float_t fMipy;                             // y coord. of MIP
   Int_t fFeedbacks;                          // Number of feedback photons
-  Int_t fLostFresnel;                        // Cerenkovs lost by Fresnel reflection
+//kir  Int_t fCkovQuarz;                          // Cerenkovs crossing quartz
+//kir  Int_t fCkovGap;                            // Cerenkovs crossing gap
+//kir  Int_t fCkovCsi;                            // Cerenkovs crossing csi
+//kir  Int_t fLostRfreo;                          // Cerenkovs reflected in freon
+//kir  Int_t fLostRquar;                          // Cerenkovs reflected in quartz
+//kir  Int_t fLostAfreo;                          // Cerenkovs absorbed in freon 
+//kir  Int_t fLostAquarz;                         // Cerenkovs absorbed in quartz
+//kir  Int_t fLostAmeta;                          // Cerenkovs absorbed in methane
+//kir  Int_t fLostCsi;                            // Cerenkovs below csi quantum efficiency 
+//kir  Int_t fLostWires;                          // Cerenkovs lost in wires
+//kir  Float_t fMipx;                             // x coord. of MIP
+//kir  Float_t fMipy;                             // y coord. of MIP
+//kir  Int_t fLostFresnel;                        // Cerenkovs lost by Fresnel reflection
 
-// Background event for event mixing
-  Text_t *fFileName;                         //! File with background hits
-  AliRICHMerger *fMerger;                    //! pointer to merger
+//kir  Text_t *fFileName;                         //! File with background hits
+//kir  AliRICHMerger *fMerger;                    //! pointer to merger
     
   ClassDef(AliRICH,2)                        //Main RICH class 
 };//class AliRICH
-    
+
+//______________________________________________________________________________
+void AliRICH::AddHit(Int_t track, Int_t *vol, Float_t *hits)
+{//Adds the current hit to the RICH hits list
+  TClonesArray &tmp=*fHits;
+  new(tmp[fNhits++])AliRICHhit(fIshunt,track,vol,hits);
+}
+//______________________________________________________________________________
+void AliRICH::AddCerenkov(Int_t track, Int_t *vol, Float_t *cerenkovs)
+{//Adds the current RICH cerenkov hit to the Cerenkovs list   
+  TClonesArray &tmp=*fCerenkovs;
+  new(tmp[fNcerenkovs++]) AliRICHCerenkov(fIshunt,track,vol,cerenkovs);
+}
+//______________________________________________________________________________
+void AliRICH::ResetHits()
+{//Resets hits and cerenkovs
+  AliDetector::ResetHits();
+  fNcerenkovs = 0;
+  if(fCerenkovs)fCerenkovs->Clear();
+}
+//______________________________________________________________________________
+void AliRICH::AddSDigit(Int_t iC,Int_t iX,Int_t iY,Int_t iAdc,Int_t iT0,Int_t iT1,Int_t iT2)
+{//Adds the current Sdigit to the RICH list of Sdigits   
+  TClonesArray &tmp = *fSDigits;
+  new(tmp[fNsdigits++])AliRICHdigit(iC,iX,iY,iAdc,iT0,iT1,iT2);
+} 
+//______________________________________________________________________________    
+void AliRICH::ResetSDigits()
+{//Resets sdigits
+  fNsdigits=0;
+  if(fSDigits)fSDigits->Clear();
+}
+//______________________________________________________________________________
 #endif
diff --git a/RICH/AliRICHCerenkov.cxx b/RICH/AliRICHCerenkov.cxx
deleted file mode 100644 (file)
index f70e072..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/**************************************************************************
- * 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.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-#include "AliRICHCerenkov.h"
-
-ClassImp(AliRICHCerenkov)
-//___________________________________________
-AliRICHCerenkov::AliRICHCerenkov(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
-    AliHit(shunt, track)
-{
-// Constructor for object AliRICHCerenkov
-    fChamber=vol[0];
-    fX=hits[1];
-    fY=hits[2];
-    fZ=hits[3];
-    fTheta=hits[4];
-    fPhi=hits[5];
-    fTlength=hits[6];
-    fEloss=hits[7];
-    fPHfirst=(Int_t) hits[8];
-    fPHlast=(Int_t) hits[9];
-    fCMother=Int_t(hits[10]);
-    fIndex = hits[11];
-    fProduction = hits[12];  
-    fLoss=hits[13];
-    fMomX=hits[14];
-    fMomY=hits[15];
-    fMomZ=hits[16];
-    fNPads=hits[17];
-    fCerenkovAngle=hits[18];
-}
-
diff --git a/RICH/AliRICHCerenkov.h b/RICH/AliRICHCerenkov.h
deleted file mode 100644 (file)
index 0028967..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef ALIRICHCERENKOV_H
-#define ALIRICHCERENKOV_H
-
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-
-
-#include "AliHit.h"
-//------------------------------------------------
-// Cerenkov photon  object
-//------------------------------------------------
-
-class AliRICHCerenkov: public AliHit {
- public:
-    Int_t     fChamber;         // Chamber number
-    Float_t   fTheta ;          // Incident theta angle in degrees      
-    Float_t   fPhi   ;          // Incident phi angle in degrees
-    Float_t   fTlength;         // Track length inside the chamber
-    Float_t   fEloss;           // ionisation energy loss in gas
-    Int_t     fPHfirst;         // first padhit
-    Int_t     fPHlast;          // last padhit
-    Int_t     fCMother;         // index of mother particle
-    Float_t   fLoss;            // nature of particle loss
-    Float_t   fIndex;           // Index of photon
-    Float_t   fProduction;      // Point of production
-    Float_t   fMomX;            // Local Momentum
-    Float_t   fMomY;            // Local Momentum
-    Float_t   fMomZ;            // Local Momentum
-    Float_t   fNPads;           // Pads hit
-    Float_t   fCerenkovAngle;   // Cerenkov Angle
- public:
-    AliRICHCerenkov() {}
-    AliRICHCerenkov(Int_t fIshunt, Int_t track, Int_t *vol, Float_t *Cerenkovs);
-    virtual ~AliRICHCerenkov() {}
-    
-    ClassDef(AliRICHCerenkov,1)  //Cerenkovs object for set:RICH
-};
-#endif
index 2b129b87b5b143433df46185dcdd8d476ca298cb..7f4d671c44dbba77e228f4edc73e2a5bbabb5ca5 100644 (file)
 /* $Id$ */
 
 #include "AliRICHChamber.h"
-
-#include <TLorentzVector.h>
-#include <TParticle.h>
+#include "AliRICHConst.h" //for r2d
+#include "AliRICHParam.h"
 #include <TRandom.h>
-#include <TObjArray.h>
 #include <TRotMatrix.h>
-#include <AliRICHTresholdMap.h>
-#include <AliSegmentation.h>
-#include <AliRICHSegmentationV0.h>
-#include <AliRICHGeometry.h>
-#include <AliRICHResponse.h>
+#include "AliRICHTresholdMap.h"
+#include "AliSegmentation.h"
+#include "AliRICHSegmentationV0.h"
+#include "AliRICHGeometry.h"
+#include "AliRICHResponse.h"
 
 ClassImp(AliRICHChamber)       
-    
+//______________________________________________________________________________    
 AliRICHChamber::AliRICHChamber() 
-{
-// default ctor
-
-    fpRotMatrix = 0;
+{//default ctor
+  fpParam=0;    
+  fpRotMatrix=0;
+  
     fSegmentation = 0;
     fResponse = 0;
     fGeometry = 0;
@@ -44,10 +42,56 @@ AliRICHChamber::AliRICHChamber()
     frMax = 140;
     for(Int_t i=0; i<50; ++i) fIndexMap[i] = 0;
 }
+//______________________________________________________________________________
+AliRICHChamber::AliRICHChamber(Int_t iModuleN,AliRICHParam *pParam)
+{//named ctor. Defines all geometry parameters for the given module.
+ // 4 5 6 |----> X
+ // 1 2 3 | 
+ //   0   V Z  
+  SetCenter(0,pParam->Offset(),0);//put to 2 position   
+  switch(iModuleN){
+    case 0:
+      RotateX(pParam->AngleYZ());
+      fName="RICHc0";fTitle="RICH chamber 0";
+      break;      
+    case 1:
+      RotateZ(pParam->AngleXY());      
+      fName="RICHc1";fTitle="RICH chamber 1";
+      break;      
+    case 2:
+      fName="RICHc2";fTitle="RICH chamber 2";
+      break;      
+    case 3:
+      RotateZ(-pParam->AngleXY());      
+      fName="RICHc3";fTitle="RICH chamber 3";
+      break;      
+    case 4:
+      RotateX(-pParam->AngleYZ());  //ÐÏÒÑÄÏË ×ÁÖÅÎ, ÐÏ×ÏÒÏÔ ÎÅ ËÏÍÕÔÁÔÉ×ÅΠ   
+      RotateZ( pParam->AngleXY());      
+      fName="RICHc4";fTitle="RICH chamber 4";
+      break;      
+    case 5:
+      RotateX(-pParam->AngleYZ());
+      fName="RICHc5";fTitle="RICH chamber 5";
+      break;      
+    case 6:
+      RotateX(-pParam->AngleYZ());            
+      RotateZ(-pParam->AngleXY());      
+      fName="RICHc6";fTitle="RICH chamber 6";
+      break;      
+    default:
+      Fatal("named ctor","Wrong chamber number %i, check muster class ctor",iModuleN);
+  }//switch(iModuleN)
+  RotateZ(pParam->AngleRot());//apply common rotation  
+  new TRotMatrix("rot"+fName,"rot"+fName, Rot().ThetaX()*r2d, Rot().PhiX()*r2d,
+                                          Rot().ThetaY()*r2d, Rot().PhiY()*r2d,
+                                          Rot().ThetaZ()*r2d, Rot().PhiZ()*r2d);
+  fpParam=pParam;
+}
+//______________________________________________________________________________
 
 void AliRICHChamber::LocaltoGlobal(Float_t pos[3],Float_t Globalpos[3])
-{
-// Local coordinates to global coordinates transformation
+{//Local coordinates to global coordinates transformation
 
     Double_t *pMatrix;
     pMatrix =  fpRotMatrix->GetMatrix();
@@ -60,10 +104,7 @@ void AliRICHChamber::LocaltoGlobal(Float_t pos[3],Float_t Globalpos[3])
 }
 
 void AliRICHChamber::GlobaltoLocal(Float_t pos[3],Float_t Localpos[3])
-{
-//
-// Global coordinates to local coordinates transformation
-//
+{// Global coordinates to local coordinates transformation
     TMatrix matrixCopy(3,3);
     Double_t *pMatrixOrig = fpRotMatrix->GetMatrix();
     for(Int_t i=0;i<3;i++)
@@ -83,7 +124,6 @@ void AliRICHChamber::GlobaltoLocal(Float_t pos[3],Float_t Localpos[3])
 void AliRICHChamber::DisIntegration(Float_t eloss, Float_t xhit, Float_t yhit,
                                    Int_t& nnew,Float_t newclust[5][500],ResponseType res) 
 {
-//    
 //  Generates pad hits (simulated cluster) 
 //  using the segmentation and the response model
     
@@ -159,40 +199,24 @@ void AliRICHChamber::DisIntegration(Float_t eloss, Float_t xhit, Float_t yhit,
          //printf("Newcluster:%d\n",i);
        }
       } // Pad loop
-    //if (fSegmentation->ISector()==2)
-      //printf("Nnew:%d\n\n\n\n",nnew);
-}
-
-
-
-
+}//void AliRICHChamber::DisIntegration(...
+//______________________________________________________________________________
 void AliRICHChamber::GenerateTresholds()
-{
-
-// Generates random treshold charges for all pads 
-
-  //printf("Pads : %dx%d\n",fSegmentation->Npx(),fSegmentation->Npy());
-
+{//Generates random treshold charges for all pads 
   Int_t nx = fSegmentation->Npx();
   Int_t ny = fSegmentation->Npy();
 
-  //Int_t size=nx*ny;
-
-  //printf("Size:%d\n",size);
-
   fTresh = new AliRICHTresholdMap(fSegmentation);
-
-  //printf("Generating tresholds...\n");
-
-  for(Int_t i=-nx/2;i<nx/2;i++)
-    {
-      for(Int_t j=-ny/2;j<ny/2;j++)
-       {
-         Int_t pedestal = (Int_t)(gRandom->Gaus(50, 10));
-         //Int_t pedestal =0;
-         fTresh->SetHit(i,j,pedestal);
-         //printf("Pad %d %d has pedestal %d.\n",i,j,pedestal);
-       }
+  for(Int_t i=-nx/2;i<nx/2;i++){
+    for(Int_t j=-ny/2;j<ny/2;j++){
+      Int_t pedestal = (Int_t)(gRandom->Gaus(50, 10));
+      fTresh->SetHit(i,j,pedestal);
     }
-      
-}
+  }      
+}//void AliRICHChamber::GenerateTresholds()
+//______________________________________________________________________________
+void AliRICHChamber::Print(Option_t *option) const
+{
+  Info(fName.Data(),"r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
+                     Rho(), Theta()*r2d,Phi()*r2d ,   X(),    Y(),    Z());
+}//void AliRICHChamber::Print(Option_t *option)const
index 6e2e272c095a834a5af639f84b7ca4f5311e9fd2..ae5c09be50558e61c7812a580734ebcba37d9497 100644 (file)
@@ -6,11 +6,10 @@
 
 /* $Id$ */
 
-#include <Riostream.h>
-
 #include <TRotMatrix.h>
 #include <TVector3.h>
 #include <TMath.h>
+#include <TRotation.h>
 
 #include "AliRICHTresholdMap.h"
 #include "AliSegmentation.h"
@@ -20,8 +19,9 @@
 class AliRICHClusterFinder;
 
 typedef enum {kMip, kCerenkov} ResponseType;
+class AliRICHParam;
 
-class AliRICHChamber : public TObject
+class AliRICHChamber : public TNamed
 {
 public:
     
@@ -29,112 +29,106 @@ public:
    AliRICHTresholdMap*  fTresh;          //map of tresholds
 
 public:
-// ctor & dtor      
-   AliRICHChamber();                                  // default ctor
-   AliRICHChamber(const AliRICHChamber & Chamber){}   // copy ctor 
-   ~AliRICHChamber(){}                                // dtor
-// The following staff is defined in AliRICHChamber.cxx:
-   void LocaltoGlobal(Float_t pos[3],Float_t Localpos[3]);//Transformation from local to global coordinates, chamber-dependant
-   void GlobaltoLocal(Float_t pos[3],Float_t localpos[3]);//Transformation from Global to local coordinates, chamber-dependant 
-   void GenerateTresholds();                              //Generate pad dependent tresholds
-   void DisIntegration(Float_t eloss, Float_t xhit, Float_t yhit, Int_t&x, Float_t newclust[6][500], ResponseType res);// Cluster formation method
-// Inline methods:   
-   void    Init(Int_t id)           {fSegmentation->Init(id);} // Recalculates all the values after some of them have been changed
-   
-   void    SetGid(Int_t id)         {fGid=id;}           // Set and get GEANT id  
-   Int_t   GetGid()            const{return fGid;}       // Get GEANT id  
+           AliRICHChamber();                                        //default ctor
+           AliRICHChamber(Int_t iModuleN,AliRICHParam *pParam);
+           AliRICHChamber(const AliRICHChamber &chamber ) {;}//copy ctor 
+  virtual ~AliRICHChamber()                               {;}//dtor
+  AliRICHChamber& operator=(const AliRICHChamber& rhs){return *this;}
+  void LocaltoGlobal(Float_t pos[3],Float_t Localpos[3]);//Transformation from local to global coordinates, chamber-dependant
+  void GlobaltoLocal(Float_t pos[3],Float_t localpos[3]);//Transformation from Global to local coordinates, chamber-dependant 
+  void GenerateTresholds();                              //Generate pad dependent tresholds
+  void DisIntegration(Float_t eloss, Float_t xhit, Float_t yhit, Int_t&x, Float_t newclust[6][500], ResponseType res);// Cluster formation method
+  void    Init(Int_t id)           {fSegmentation->Init(id);} // Recalculates all the values after some of them have been changed
+  void    SetGid(Int_t id)         {fGid=id;}           // Set and get GEANT id  
+  Int_t   GetGid()            const{return fGid;}       // Get GEANT id  
+  void SetRInner(Float_t rmin)     {frMin=rmin;}        // Set inner radius of sensitive volume   
+  Float_t RInner()            const{return frMin;}      // Return inner radius of sensitive volume 
+  void SetROuter(Float_t rmax)     {frMax=rmax;}        // Set outer radius of sensitive volum  
+  Float_t ROuter()            const{return frMax;}      // Return outer radius of sensitive volum  
+  void    SetZPOS(Float_t p1)      {fzPos=p1;}
+  Float_t ZPosition()         const{return fzPos;}
+  void              SetGeometryModel(AliRICHGeometry* pRICHGeometry)           {fGeometry=pRICHGeometry;}        
+  AliRICHGeometry*  GetGeometryModel()                                    const{return fGeometry;}
+  void              SetResponseModel(AliRICHResponse* pRICHResponse)            {fResponse=pRICHResponse;}
+  AliRICHResponse*  GetResponseModel()                                     const{return fResponse;}
+  void              SetSegmentationModel(AliSegmentation* pRICHSegmentation)   {fSegmentation=pRICHSegmentation;}
+  AliSegmentation*  GetSegmentationModel(Int_t i=0)                       const{return fSegmentation;}
+  void                  SetReconstructionModel(AliRICHClusterFinder *pRICHReconstruction)    {fReconstruction=pRICHReconstruction;}
+  AliRICHClusterFinder* &GetReconstructionModel()                                            {return fReconstruction;}
+  void   SigGenInit(Float_t x, Float_t y, Float_t z)   {fSegmentation->SigGenInit(x, y, z) ;}
+  Int_t  SigGenCond(Float_t x, Float_t y, Float_t z)   {return fSegmentation->SigGenCond(x, y, z);}
+  Int_t  Sector(Float_t x, Float_t y)                  {return fSegmentation->Sector((Int_t)x, (Int_t)y);} // Returns number of sector containing (x,y) position    
+  void   SetPadSize(Float_t p1, Float_t p2)            {fSegmentation->SetPadSize(p1,p2);}
+  Float_t IntPH(Float_t eloss, Float_t yhit)                        {return fResponse->IntPH(eloss,yhit);}
+  Float_t IntPH(Float_t yhit)                                       {return fResponse->IntPH(yhit);}
+  void  SetSigmaIntegration(Float_t p)                             {fResponse->SetSigmaIntegration(p);}
+  void  SetChargeSlope(Float_t p)                                  {fResponse->SetChargeSlope(p);}
+  void  SetChargeSpread(Float_t p1, Float_t p2)                    {fResponse->SetChargeSpread(p1,p2);}
+  void  SetMaxAdc(Float_t p)                                       {fResponse->SetMaxAdc(p);}
+  void  SetSqrtKx3(Float_t p)                                      {fResponse->SetSqrtKx3(p);}
+  void  SetKx2(Float_t p)                                          {fResponse->SetKx2(p);}
+  void  SetKx4(Float_t p)                                          {fResponse->SetKx4(p);}
+  void  SetSqrtKy3(Float_t p)                                      {fResponse->SetSqrtKy3(p);}
+  void  SetKy2(Float_t p)                                          {fResponse->SetKy2(p);}
+  void  SetKy4(Float_t p)                                          {fResponse->SetKy4(p);}    
+  void  SetPitch(Float_t p)                                        {fResponse->SetPitch(p);}
+  void  SetWireSag(Int_t p)                                        {fResponse->SetWireSag(p);}
+  void  SetVoltage(Int_t p)                                        {fResponse->SetVoltage(p);}       
+  void  SetGapThickness(Float_t thickness)                         {fGeometry->SetGapThickness(thickness);} 
+  void  SetProximityGapThickness(Float_t thickness)                {fGeometry->SetProximityGapThickness(thickness);}
+  void  SetQuartzLength(Float_t length)                            {fGeometry->SetQuartzLength(length);}
+  void  SetQuartzWidth(Float_t width)                              {fGeometry->SetQuartzWidth(width);}
+  void  SetQuartzThickness(Float_t thickness)                      {fGeometry->SetQuartzThickness(thickness);}
+  void  SetOuterFreonLength(Float_t length)                        {fGeometry->SetOuterFreonLength(length);}
+  void  SetOuterFreonWidth(Float_t width)                          {fGeometry->SetOuterFreonWidth(width);}
+  void  SetInnerFreonLength(Float_t length)                        {fGeometry->SetInnerFreonLength(length);}
+  void  SetInnerFreonWidth(Float_t width)                          {fGeometry->SetInnerFreonWidth(width);}
+  void  SetFreonThickness(Float_t thickness)                       {fGeometry->SetFreonThickness(thickness);}
+  TRotMatrix* RotMatrix()          const{return fpRotMatrix;}
+  const char* RotMatrixName()      const{return "rot"+fName;}
+  TRotation   Rot()                const{return fRot;}
+  Double_t    Rho()                const{return fCenterV3.Mag();} 
+  Double_t    Theta()              const{return fCenterV3.Theta();}    
+  Double_t    Phi()                const{return fCenterV3.Phi();}    
+  void        RotateX(Double_t a)       {fRot.RotateX(a);fCenterV3.RotateX(a);}
+  void        RotateY(Double_t a)       {fRot.RotateY(a);fCenterV3.RotateY(a);}
+  void        RotateZ(Double_t a)       {fRot.RotateZ(a);fCenterV3.RotateZ(a);}
+  Double_t    X()                  const{return fCenterV3.X();}  
+  Double_t    Y()                  const{return fCenterV3.Y();}   
+  Double_t    Z()                  const{return fCenterV3.Z();}
+  Double_t    GetX()               const{return fX;}
+  Double_t    GetY()               const{return fY;}
+  Double_t    GetZ()               const{return fZ;}    
+  Double_t    GetOffset()          const{return TMath::Sqrt(fX*fX+fY*fY+fZ*fZ);}    
+  inline void SetCenter(Double_t x,Double_t y,Double_t z);
+  TRotMatrix *GetRotMatrix()       const{return fpRotMatrix;}
+  void        SetChamberTransform(Float_t x,Float_t y,Float_t z,TRotMatrix *pRotMatrix) {fX=x; fY=y; fZ=z; fpRotMatrix=pRotMatrix;}
+  
+  virtual void Print(Option_t *sOption)const;      
+protected:
+  Float_t frMin;                                         // Minimum Chamber size
+  Float_t frMax;                                         // Maximum Chamber size 
+  Int_t   fGid;                                          // Id tag 
+  Float_t fzPos;                                         // z-position of this chamber
 
-   void SetRInner(Float_t rmin)     {frMin=rmin;}        // Set inner radius of sensitive volume   
-   Float_t RInner()            const{return frMin;}      // Return inner radius of sensitive volume 
-   
-   void SetROuter(Float_t rmax)     {frMax=rmax;}        // Set outer radius of sensitive volum  
-   Float_t ROuter()            const{return frMax;}      // Return outer radius of sensitive volum  
-   void    SetZPOS(Float_t p1)      {fzPos=p1;}
-   Float_t ZPosition()         const{return fzPos;}
-    
-   void         SetChamberTransform(Float_t x,Float_t y,Float_t z,TRotMatrix *pRotMatrix) {fX=x; fY=y; fZ=z; fpRotMatrix=pRotMatrix;}
-   TRotMatrix * GetRotMatrix()                                                    const   {return fpRotMatrix;}
-   Float_t      GetX()                                                            const   {return fX;}
-   Float_t      GetY()                                                            const   {return fY;}
-   Float_t      GetZ()                                                            const   {return fZ;}    
-   Float_t      GetOffset()                                                       const   {return TMath::Sqrt(fX*fX+fY*fY+fZ*fZ);}    
-    
-   void              SetGeometryModel(AliRICHGeometry* pRICHGeometry)           {fGeometry=pRICHGeometry;}        
-   AliRICHGeometry*  GetGeometryModel()                                    const{return fGeometry;}
-   
-   void              SetResponseModel(AliRICHResponse* pRICHResponse)            {fResponse=pRICHResponse;}
-   AliRICHResponse*  GetResponseModel()                                     const{return fResponse;}
-   
-   void              SetSegmentationModel(AliSegmentation* pRICHSegmentation)   {fSegmentation=pRICHSegmentation;}
-   AliSegmentation*  GetSegmentationModel(Int_t i=0)                       const{return fSegmentation;}
-   
-   void                  SetReconstructionModel(AliRICHClusterFinder *pRICHReconstruction)    {fReconstruction=pRICHReconstruction;}
-   AliRICHClusterFinder* &GetReconstructionModel()                                            {return fReconstruction;}
+  Float_t fX,fY,fZ;                                      // Position of the center of the chamber in MRS (cm)
 
-   void   SigGenInit(Float_t x, Float_t y, Float_t z)   {fSegmentation->SigGenInit(x, y, z) ;}
-   Int_t  SigGenCond(Float_t x, Float_t y, Float_t z)  {return fSegmentation->SigGenCond(x, y, z);}
-   Int_t  Sector(Float_t x, Float_t y)                  {return fSegmentation->Sector((Int_t)x, (Int_t)y);} // Returns number of sector containing (x,y) position    
-   void   SetPadSize(Float_t p1, Float_t p2)            {fSegmentation->SetPadSize(p1,p2);}
-   
-   Float_t IntPH(Float_t eloss, Float_t yhit)                        {return fResponse->IntPH(eloss,yhit);}
-   Float_t IntPH(Float_t yhit)                                       {return fResponse->IntPH(yhit);}
-   void   SetSigmaIntegration(Float_t p)                             {fResponse->SetSigmaIntegration(p);}
-   void   SetChargeSlope(Float_t p)                                  {fResponse->SetChargeSlope(p);}
-   void   SetChargeSpread(Float_t p1, Float_t p2)                    {fResponse->SetChargeSpread(p1,p2);}
-   void   SetMaxAdc(Float_t p)                                       {fResponse->SetMaxAdc(p);}
-   void   SetSqrtKx3(Float_t p)                                      {fResponse->SetSqrtKx3(p);}
-   void   SetKx2(Float_t p)                                          {fResponse->SetKx2(p);}
-   void   SetKx4(Float_t p)                                          {fResponse->SetKx4(p);}
-   void   SetSqrtKy3(Float_t p)                                      {fResponse->SetSqrtKy3(p);}
-   void   SetKy2(Float_t p)                                          {fResponse->SetKy2(p);}
-   void   SetKy4(Float_t p)                                          {fResponse->SetKy4(p);}    
-   void   SetPitch(Float_t p)                                        {fResponse->SetPitch(p);}
-   void   SetWireSag(Int_t p)                                        {fResponse->SetWireSag(p);}
-   void   SetVoltage(Int_t p)                                        {fResponse->SetVoltage(p);}    
-   
-   void   SetGapThickness(Float_t thickness)                         {fGeometry->SetGapThickness(thickness);} 
-   void   SetProximityGapThickness(Float_t thickness)                {fGeometry->SetProximityGapThickness(thickness);}
-   void   SetQuartzLength(Float_t length)                            {fGeometry->SetQuartzLength(length);}
-   void   SetQuartzWidth(Float_t width)                              {fGeometry->SetQuartzWidth(width);}
-   void   SetQuartzThickness(Float_t thickness)                      {fGeometry->SetQuartzThickness(thickness);}
-   void   SetOuterFreonLength(Float_t length)                        {fGeometry->SetOuterFreonLength(length);}
-   void   SetOuterFreonWidth(Float_t width)                          {fGeometry->SetOuterFreonWidth(width);}
-   void   SetInnerFreonLength(Float_t length)                        {fGeometry->SetInnerFreonLength(length);}
-   void   SetInnerFreonWidth(Float_t width)                          {fGeometry->SetInnerFreonWidth(width);}
-   void   SetFreonThickness(Float_t thickness)                       {fGeometry->SetFreonThickness(thickness);}
-   
-   AliRICHChamber& operator=(const AliRICHChamber& rhs){return *this;}
+  AliSegmentation               *fSegmentation;          // ??????????Segmentation model for each chamber
+  AliRICHResponse               *fResponse;              // ??????????Response model for each chamber
+  AliRICHGeometry               *fGeometry;              // ??????????Geometry model for each chamber
+  AliRICHClusterFinder          *fReconstruction;        // ??????????Reconstruction model for each chamber
    
-   inline virtual void Print(Option_t *sOption)const;   
+  TVector3      fCenterV3;        //chamber center position in MRS (cm)
+  TRotation     fRot;             //chamber rotation in MRS
+  TRotMatrix   *fpRotMatrix;      //rotation matrix of the chamber with respect to MRS 
+  AliRICHParam *fpParam;          //main RICH parameters description  
+  ClassDef(AliRICHChamber,1)      //single RICH chamber description
+};//class AliRICHChamber
 
-private:
-   Float_t frMin;                                         // Minimum Chamber size
-   Float_t frMax;                                         // Maximum Chamber size 
-   Int_t   fGid;                                          // Id tag 
-   Float_t fzPos;                                         // z-position of this chamber
-
-   TRotMatrix *fpRotMatrix;                               // Rotation matrix of the chamber with respect to MRS 
-   Float_t fX,fY,fZ;                                      // Position of the center of the chamber in MRS (cm)
-
-   AliSegmentation               *fSegmentation;          // Segmentation model for each chamber
-   AliRICHResponse               *fResponse;              // Response model for each chamber
-   AliRICHGeometry               *fGeometry;              // Geometry model for each chamber
-   AliRICHClusterFinder          *fReconstruction;        // Reconstruction model for each chamber
-   ClassDef(AliRICHChamber,1)                             // A single RICH chamber desription
-};
-    
-inline void AliRICHChamber::Print(Option_t *sOption)const
+void AliRICHChamber::SetCenter(Double_t x,Double_t y,Double_t z)
 {
-   TObject::Print(sOption);
-   cout<<"X="<<fX<<endl;   
-   cout<<"Y="<<fY<<endl;
-   cout<<"Z="<<fZ<<endl;
-   TVector3 vector3(fX,fY,fZ);
-   cout<<"Offset="<<vector3.Mag()<<endl;
-   cout<<"Polar angle="<<vector3.Theta()/TMath::Pi()*180<<endl;
-   cout<<"Azimithal angle="<<vector3.Phi()/TMath::Pi()*180<<endl;
-}// inline void AliRICHChamber::Print(Option_t *sOPtion)
-     
+  fCenterV3.SetXYZ(x,y,z);
+  fX=x;fY=y;fZ=z;
+}
+  
 #endif //AliRICHChamber_h
index 181ce0ffd6b78f73d73743512b485a00fe72e990..722f45f64cc59a2aa4ca389cd1aef1aac08088a7 100644 (file)
@@ -18,9 +18,7 @@
 #include "AliRICHClusterFinder.h"
 #include "AliRun.h"
 #include "AliRICH.h"
-#include "AliRICHHit.h"
 #include "AliRICHHitMapA1.h"
-#include "AliRICHCerenkov.h"
 #include "AliRICHSDigit.h"
 #include "AliRICHDigit.h"
 #include "AliRICHRawCluster.h"
index ba7b1dcffd9b1620808499985d03ea414bdd1283..4ace753ff23c1b40b3e390d44e8906e106bbb918 100644 (file)
 #include "AliRICH.h"
 #include "AliRICHPoints.h"
 #include "AliRICHDetect.h"
-#include "AliRICHHit.h"
 #include "AliRICHDigit.h"
 #include "AliRICHRawCluster.h"
-#include "AliRICHCerenkov.h"
 #include "AliRICHSegmentationV0.h"
 #include "AliRun.h"
 #include "TParticle.h"
@@ -188,7 +186,7 @@ void AliRICHDetect::Detect(Int_t nev, Int_t type)
     Int_t nhits = pHits->GetEntriesFast();
     if (nhits == 0) continue;
     //Int_t nent=(Int_t)gAlice->TreeD()->GetEntries();
-    AliRICHHit *mHit = 0;
+    AliRICHhit *mHit = 0;
     //Int_t npoints=0;
     
     Int_t counter=0, counter1=0;
@@ -237,7 +235,7 @@ void AliRICHDetect::Detect(Int_t nev, Int_t type)
      
 
 
-       mHit = (AliRICHHit*) pHits->UncheckedAt(0);
+       mHit = (AliRICHhit*) pHits->UncheckedAt(0);
        Int_t nch  = mHit->Chamber();
        originalTheta = mHit->Theta();
        originalPhi = mHit->Phi();
index d4ab682b9351fc5c9fa0469c7fbf20ebabdde216..a5869b346f7fcb85dcfbaaea6c554b59f4d24477 100644 (file)
 #include "AliRICH.h"
 #include "AliRICHPoints.h"
 #include "AliRICHDetect.h"
-#include "AliRICHHit.h"
 #include "AliRICHDigit.h"
 #include "AliRICHRawCluster.h"
-#include "AliRICHCerenkov.h"
 #include "AliRICHSegmentationV0.h"
 #include "AliRun.h"
 #include "TParticle.h"
@@ -196,7 +194,7 @@ void AliRICHDetectV1::Detect(Int_t nev, Int_t type)
     Int_t nhits = pHits->GetEntriesFast();
     if (nhits == 0) continue;
     //Int_t nent=(Int_t)gAlice->TreeD()->GetEntries();
-    AliRICHHit *mHit = 0;
+    AliRICHhit *mHit = 0;
     //Int_t npoints=0;
     
     Int_t counter=0, counter1=0;
@@ -240,7 +238,7 @@ void AliRICHDetectV1::Detect(Int_t nev, Int_t type)
     
     //printf("Cerenkovs       : %d\n",counter);
     
-    mHit = (AliRICHHit*) pHits->UncheckedAt(0);
+    mHit = (AliRICHhit*) pHits->UncheckedAt(0);
     Int_t nch  = mHit->Chamber();
     originalTheta = mHit->Theta();
     originalPhi = mHit->Phi();
index 8d009dba1fd53951643ec58f46360ef56de1770c..338014f895f0afeb331bda46f4939fafd535aa18 100644 (file)
@@ -35,7 +35,6 @@
 #include "AliHitMap.h"
 #include "AliRICHHitMapA1.h"
 #include "AliRICH.h"
-#include "AliRICHHit.h"
 #include "AliRICHSDigit.h"
 #include "AliRICHDigit.h"
 #include "AliRICHTransientDigit.h"
@@ -149,7 +148,7 @@ void AliRICHDigitizer::CreateNew(AliRICHSDigit *padhit)
 Bool_t AliRICHDigitizer::Init()
 {
 // Initialisation
-  fHits     = new TClonesArray("AliRICHHit",1000);
+  fHits     = new TClonesArray("AliRICHhit",1000);
   fSDigits  = new TClonesArray("AliRICHSDigit",1000);
   return kTRUE;
 }
@@ -246,7 +245,7 @@ void AliRICHDigitizer::Exec(Option_t* option)
       //
       //   Loop over hits
       for(Int_t i = 0; i < fHits->GetEntriesFast(); ++i) {
-       AliRICHHit* mHit = static_cast<AliRICHHit*>(fHits->At(i));
+       AliRICHhit* mHit = static_cast<AliRICHhit*>(fHits->At(i));
        fNch = mHit->Chamber()-1;  // chamber number
        if (fNch >= kNCH) {
          cerr<<"AliRICHDigitizer: chamber nr. fNch out of range: "<<fNch<<endl;
index 491d1ada03412f7813fcfba2e2f8c524e5e6c8c9..c29de86862bbed6f1405298edd938a063e45df9a 100644 (file)
@@ -60,8 +60,6 @@
 #include "AliRICHPoints.h"
 #include "AliHeader.h"
 
-#include "AliRICHHit.h"
-#include "AliRICHCerenkov.h"
 #include "AliRICHSDigit.h"
 #include "AliRICHDigit.h"
 #include "AliRICHRawCluster.h"
@@ -1050,12 +1048,12 @@ void AliRICHDisplay::LoadHits(Int_t chamber)
        if (pRICHhits == 0) return;
        Int_t nhits = pRICHhits->GetEntriesFast();
        if (nhits == 0) continue;
-       AliRICHHit *mHit;
+       AliRICHhit *mHit;
        AliRICHPoints *points = 0;
        for (Int_t hit=0;hit<nhits;hit++) {
            points = new AliRICHPoints(1);
            fPhits->AddAt(points,npoints);
-            mHit = (AliRICHHit*)pRICHhits->UncheckedAt(hit);
+            mHit = (AliRICHhit*)pRICHhits->UncheckedAt(hit);
            TParticle *current = (TParticle*)gAlice->Particle(mHit->Track());
            if (current->GetPdgCode() == 50000050) {
                points->SetMarkerColor(kBlue);
diff --git a/RICH/AliRICHHit.cxx b/RICH/AliRICHHit.cxx
deleted file mode 100644 (file)
index 0db033d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/**************************************************************************
- * 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.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-#include "AliRICHHit.h"
-ClassImp(AliRICHHit)
-//___________________________________________
-AliRICHHit::AliRICHHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
-    AliHit(shunt, track)
-{
-// Constructor
-    fChamber=vol[0];
-    fParticle=hits[0];
-    fX=hits[1];
-    fY=hits[2];
-    fZ=hits[3];
-    fTheta=hits[4];
-    fPhi=hits[5];
-    fTlength=hits[6];
-    fEloss=hits[7];
-    fPHfirst=(Int_t) hits[8];
-    fPHlast=(Int_t) hits[9];
-    fLoss=hits[13];
-    fMomX=hits[14];
-    fMomY=hits[15];
-    fMomZ=hits[16];
-    fNPads=hits[17];
-    fCerenkovAngle=hits[18];
-    fMomFreoX=hits[19];
-    fMomFreoY=hits[20];
-    fMomFreoZ=hits[21];
-}
diff --git a/RICH/AliRICHHit.h b/RICH/AliRICHHit.h
deleted file mode 100644 (file)
index 071b380..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef ALIRICHHIT_H
-#define ALIRICHHIT_H
-
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-
-
-#include "AliHit.h"
-
-class AliRICHHit : public AliHit {
- protected:
-    Int_t     fChamber;       // Chamber number
-    Float_t   fParticle;      // Geant3 particle type
-    Float_t   fTheta ;        // Incident theta angle in degrees      
-    Float_t   fPhi   ;        // Incident phi angle in degrees
-    Float_t   fTlength;       // Track length inside the chamber
-    Float_t   fEloss;         // ionisation energy loss in gas   
-    Float_t   fPHfirst;       // first padhit
-    Float_t   fPHlast;        // last padhit
-    Float_t   fLoss;          // did it hit the freon?
-    Float_t   fMomX;          // x Momentum at photochatode entry point
-    Float_t   fMomY;          // y Momentum at photochatode entry point
-    Float_t   fMomZ;          // z Momentum at photochatode entry point
-    Float_t   fNPads;         // Pads hit
-    Float_t   fCerenkovAngle; // Dummy cerenkov angle
-    Float_t   fMomFreoX;      // x Momentum at freon entry point
-    Float_t   fMomFreoY;      // y Momentum at freon entry point
-    Float_t   fMomFreoZ;      // z Momentum at freon entry point                  
-
- public:
-    AliRICHHit() {}
-    AliRICHHit(Int_t fIshunt, Int_t track, Int_t *vol, Float_t *hits);
-    virtual ~AliRICHHit() {}
-    
-    Int_t   Chamber()             {return fChamber;}
-    Float_t Particle()            {return fParticle;}    
-    Float_t Theta()               {return fTheta;}
-    Float_t Phi()                 {return fPhi;}
-    Float_t Tlength()             {return fTlength;}
-    Float_t Eloss()               {return fEloss;}
-    Float_t Loss()                {return fLoss;}
-    Float_t   PHfirst()           {return fPHfirst;}
-    Float_t   PHlast()            {return fPHlast;}
-    Float_t MomX()                {return fMomX;}
-    Float_t MomY()                {return fMomY;}
-    Float_t MomZ()                {return fMomZ;}
-    Float_t CerenkovAngle()       {return fMomX;}
-    Float_t MomFreoX()            {return fMomX;}
-    Float_t MomFreoY()            {return fMomY;}
-    Float_t MomFreoZ()            {return fMomZ;}
-    
-    
-    ClassDef(AliRICHHit,1)  //Hits object for set:RICH
-};
-#endif
index 05030f2ce447921735d2122b33ab1b68ba3dc6ca..43105dcc3bbc89f95f7fe24a2676bfcc12734ea1 100644 (file)
@@ -28,7 +28,6 @@
 #include "AliHitMap.h"
 #include "AliRICHHitMapA1.h"
 #include "AliRICH.h"
-#include "AliRICHHit.h"
 #include "AliRICHSDigit.h"
 #include "AliRICHDigit.h"
 #include "AliRICHTransientDigit.h"
@@ -139,7 +138,7 @@ TFile* AliRICHMerger::InitBgr()
   TFile *file = new TFile(fFnBgr);
 // add error checking later
   printf("\n AliRICHMerger has opened %s file with background event \n", fFnBgr);
-  fHitsBgr     = new TClonesArray("AliRICHHit",1000);
+  fHitsBgr     = new TClonesArray("AliRICHhit",1000);
   fSDigitsBgr  = new TClonesArray("AliRICHSDigit",1000);
   return file;
 }
@@ -209,9 +208,9 @@ void AliRICHMerger::Digitise(Int_t nev, Int_t flag)
     treeH->GetEvent(fTrack);
     //
     //   Loop over hits
-    for(AliRICHHit* mHit=(AliRICHHit*)pRICH->FirstHit(-1); 
+    for(AliRICHhit* mHit=(AliRICHhit*)pRICH->FirstHit(-1); 
        mHit;
-       mHit=(AliRICHHit*)pRICH->NextHit()) 
+       mHit=(AliRICHhit*)pRICH->NextHit()) 
     {
          
       fNch = mHit->Chamber()-1;  // chamber number
@@ -314,10 +313,10 @@ void AliRICHMerger::Digitise(Int_t nev, Int_t flag)
       fTrH1->GetEvent(fTrack);
       //
       //   Loop over hits
-      AliRICHHit* mHit;
+      AliRICHhit* mHit;
       for(Int_t i = 0; i < fHitsBgr->GetEntriesFast(); ++i) 
       {        
-       mHit   = (AliRICHHit*) (*fHitsBgr)[i];
+       mHit   = (AliRICHhit*) (*fHitsBgr)[i];
        fNch   = mHit->Chamber()-1;  // chamber number
        iChamber = &(pRICH->Chamber(fNch));
 
index 0b609a45c650a8f9668820536b66c32e7f305629..f4affcebc1d3667f24cdb41b7a872dcfff4c8308 100644 (file)
@@ -7,28 +7,29 @@ ClassImp(AliRICHParam)
 // RICH main parameters manipulator
 AliRICHParam::AliRICHParam()
 {//defines the default parameters
-  Segmentation         (144,160);               //nx,ny   
-  DeadZone             (3*cm);                  //spacer between PC planes
-  PadSize              (8.4*mm,8.0*mm);   
-  Size                 (80*cm,7*cm,60*cm);      //full length, not GEANT half notation
-  AngleRot             (0*deg);                 //rotation of the whole RICH around Z
-  AnglesDeg            (20,19.5);               //XY angle, YZ angle  deg  
-  Offset               (490*cm+1.267*cm);       //1.267???????cm distance from IP to the center of module 
-  GapThickness         (8*cm);               //Gap Thickness
-  ProximityGapThickness(0.4*cm);             //Proximity Gap Thickness
-  QuartzLength         (133*cm);             //Quartz Length
-  QuartzWidth          (127.9*cm);           //Quartz Width
-  QuartzThickness      (0.5*cm);             //Quartz Thickness
-  OuterFreonLength     (133*cm);             //Outer Freon Length
-  OuterFreonWidth      (41.3*cm);            //Outer Freon Width
-  InnerFreonLength     (133*cm);             //Inner Freon Length
-  InnerFreonWidth      (41.3*cm);            //Inner Freon Width
-  FreonThickness       (1.5*cm);             //Freon Thickness
-  RadiatorToPads       (0);               //Distance from radiator to pads
+  Segmentation         (144,160);           //nx,ny   
+  DeadZone             (3*cm);              //spacer between PC planes
+  PadSize              (8.4*mm,8.0*mm);     
+  
+  Size                 (80*cm,7*cm,60*cm);  //full length, not GEANT half notation
+  AngleRot             (-60);               //rotation of the whole RICH around Z, deg
+  Angles               (20,19.5);           //XY angle, YZ angle  deg  
+  Offset               (490*cm+1.267*cm);   //1.267???????cm distance from IP to the center of module 
+  GapThickness         (8*cm);              
+  ProximityGapThickness(0.4*cm);            
+  QuartzLength         (133*cm);            
+  QuartzWidth          (127.9*cm);          
+  QuartzThickness      (0.5*cm);            
+  OuterFreonLength     (133*cm);            
+  OuterFreonWidth      (41.3*cm);           
+  InnerFreonLength     (133*cm);            
+  InnerFreonWidth      (41.3*cm);           
+  FreonThickness       (1.5*cm);            
+  RadiatorToPads       (0);                 
   
-  SigmaIntegration(5.);
   ChargeSlope(27.);
   ChargeSpreadX(0.18);ChargeSpreadY(0.18);
+  SigmaIntegration(5.);
   MaxAdc(4096);
   AlphaFeedback(0.036);
   EIonisation(26.e-9);
index 09ca4fc928a7986d546813474d00f9e09f8988e4..94fe12ea06082eb93271df7f62c2308b3b31abab 100644 (file)
@@ -7,8 +7,10 @@
 class AliRICHParam :public TObject  
 {
 public:
-                 AliRICHParam();  
-  void    Recalc();//Recalculate dependent parameters after changes 
+           AliRICHParam();  
+  virtual ~AliRICHParam()                    {;}  
+  
+  void    Recalc();//Recalculate dependent parameters after changes applied  
   void    Segmentation(Int_t Nx, Int_t Ny)   {fNx=Nx;fNy=Ny;Recalc();}
   Int_t   Nx()                          const{return fNx;}
   Int_t   Ny()                          const{return fNy;}   
@@ -19,14 +21,15 @@ public:
   Float_t PadY()                        const{return fPadY;}
   Float_t PadPlaneWidth()               const{return fPadPlaneWidth;}
   Float_t PadPlaneLength()              const{return fPadPlaneLength;}  
+
   void    Size(Float_t x,Float_t y,Float_t z){fSizeX=x;fSizeY=y;fSizeZ=z;}
-  void    GeantSize(Float_t *pParam)    const{pParam[0]=fSizeX/2;pParam[1]=fSizeY/2;pParam[2]=fSizeZ/2;}  
+  void    GeantSize(Float_t *pArr)      const{pArr[0]=fSizeX/2;pArr[1]=fSizeY/2;pArr[2]=fSizeZ/2;}  
   Float_t SizeX()                       const{return fSizeX;}
   Float_t SizeY()                       const{return fSizeY;}
   Float_t SizeZ()                       const{return fSizeZ;}   
   void    Offset(Float_t offset)             {       fOffset=offset;}  
   Float_t Offset()                      const{return fOffset;}  
-  void    AnglesDeg(Float_t xy,Float_t yz)   {       fAngleXY=xy;fAngleYZ=yz;} 
+  void    Angles(Float_t xy,Float_t yz)      {       fAngleXY=xy;fAngleYZ=yz;} 
   Float_t AngleYZ()                     const{return fAngleYZ*d2r;} 
   Float_t AngleXY()                     const{return fAngleXY*d2r;} 
   void    AngleRot(Float_t angle)            {       fAngleRot=angle;}
@@ -90,21 +93,21 @@ protected:
   Float_t fSizeX;             //chamber length, cm
   Float_t fSizeY;             //chamber thickness, cm
   Float_t fSizeZ;             //chamber width, cm
-  Float_t fAngleRot;          //azimuthal rotation angle in X-Y plane, grad  
-  Float_t fAngleYZ;           //angle between RICH chambers in YZ plane, grad
-  Float_t fAngleXY;           //angle between RICH chambers in XY plane, grad
+  Float_t fAngleRot;          //azimuthal rotation angle in X-Y plane, deg  
+  Float_t fAngleYZ;           //angle between RICH chambers in YZ plane, deg
+  Float_t fAngleXY;           //angle between RICH chambers in XY plane, deg
   Float_t fOffset;            //chambers offset from IP, cm   
   Float_t fGapThickness;            //gap thickness, cm
   Float_t fProximityGapThickness;   //proximity gap thickness, cm
-  Float_t fQuartzLength;            //quartz length
-  Float_t fQuartzWidth;             //quartz width
-  Float_t fQuartzThickness;         //quartz thickness
-  Float_t fOuterFreonLength;        //outer freon length
-  Float_t fOuterFreonWidth;         //outer freon width
-  Float_t fInnerFreonLength;        //inner freon length
-  Float_t fInnerFreonWidth;         //inner freon width
+  Float_t fQuartzLength;            //quartz length, cm
+  Float_t fQuartzWidth;             //quartz width, cm
+  Float_t fQuartzThickness;         //quartz thickness, cm
+  Float_t fOuterFreonLength;        //outer freon length, cm
+  Float_t fOuterFreonWidth;         //outer freon width, cm
+  Float_t fInnerFreonLength;        //inner freon length, cm
+  Float_t fInnerFreonWidth;         //inner freon width, cm
   Float_t fFreonThickness;          //freon thickness
-  Float_t fRadiatorToPads;          //distance from radiator to pads
+  Float_t fRadiatorToPads;          //distance from radiator to pads, cm
 
   Float_t fChargeSlope;              //Slope of the charge distribution
   Float_t fChargeSpreadX;            //Width of the charge distribution in x
index 617cbca1ed563cff3bd7617b67d944cc806b09cd..2b4ee521792dcf95c4c7306eb01dd7a63b639d2c 100644 (file)
@@ -15,8 +15,7 @@
 
 /* $Id$ */
 
-#include "AliRICHHit.h"
-#include "AliRICHCerenkov.h"
+
 #include "AliRICHSDigit.h"
 #include "AliRICHDigit.h"
 #include "AliRICHRawCluster.h"
@@ -186,7 +185,7 @@ Int_t AliRICHPatRec::TrackParam(Int_t itr, Int_t &ich, Float_t rectheta, Float_t
     TTree *treeH = pRICH->TreeH();
     treeH->GetEvent(itr);
  
-    AliRICHHit* mHit=(AliRICHHit*)pRICH->FirstHit(-1);
+    AliRICHhit* mHit=(AliRICHhit*)pRICH->FirstHit(-1);
     if(mHit==0) return 1;
     ich = mHit->Chamber()-1;
     trackglob[0] = mHit->X();
index d544763b167966b3e53986b761b5d9184b4f9176..ca75b6ee5cb92193790b9cce6240e9a27e512ed4 100644 (file)
@@ -39,8 +39,6 @@
 #include "AliRICHDisplay.h"
 #include "AliRICHPoints.h"
 #include "AliRun.h"
-#include "AliRICHHit.h"
-#include "AliRICHCerenkov.h"
 #include "AliRICHSDigit.h"
 #include "AliRICHDigit.h"
 #include "AliRICHRawCluster.h"
@@ -91,7 +89,7 @@ void AliRICHPoints::DumpHit()
   //
   //   Dump hit corresponding to this point
   //
-  AliRICHHit *hit = GetHit();
+  AliRICHhit *hit = GetHit();
   if (hit) hit->Dump();
 }
 
@@ -111,7 +109,7 @@ void AliRICHPoints::InspectHit()
   //
   //   Inspect hit corresponding to this point
   //
-  AliRICHHit *hit = GetHit();
+  AliRICHhit *hit = GetHit();
   if (hit) hit->Inspect();
 }
 
@@ -146,7 +144,7 @@ TParticle *AliRICHPoints::GetParticle() const
 }
 
 //_____________________________________________________________________________
-AliRICHHit *AliRICHPoints::GetHit() const
+AliRICHhit *AliRICHPoints::GetHit() const
 {
   //
   //   Returns pointer to hit index in AliRun::fParticles
@@ -156,7 +154,7 @@ AliRICHHit *AliRICHPoints::GetHit() const
   TClonesArray *pRICHhits  = pRICH->Hits();
   Int_t nhits = pRICHhits->GetEntriesFast();
   if (fHitIndex < 0 || fHitIndex >= nhits) return 0;
-  return (AliRICHHit*)pRICHhits->UncheckedAt(fHitIndex);
+  return (AliRICHhit*)pRICHhits->UncheckedAt(fHitIndex);
 }
 
 //_____________________________________________________________________________
@@ -192,7 +190,7 @@ void AliRICHPoints::ShowRing(Int_t highlight) {
   AliRICHPoints *points = 0;
   TMarker3DBox  *marker = 0;
     
-  AliRICHHit *mHit = GetHit();
+  AliRICHhit *mHit = GetHit();
 
   printf("Hit %d on chamber: %d\n",fHitIndex, mHit->Chamber());
 
index 64c25e532323e51205cc55d627ac45ef9546917d..2174d3c845bdaf5d403384be375660ecb0e8600f 100644 (file)
@@ -22,7 +22,7 @@ public:
   Int_t                 GetTrackIndex(); // *MENU*
   Int_t                 GetDigitIndex() {return fDigitIndex;}
   Int_t                 GetIndex() {return fIndex;}
-  AliRICHHit           *GetHit() const;
+  AliRICHhit           *GetHit() const;
   AliRICHDigit         *GetDigit() const;
   virtual const Text_t *GetName() const;
   virtual Text_t       *GetObjectInfo(Int_t px, Int_t py);
index ce030c1963906fe4a5482fd6156d503bbf3e9841..cb355a851b9f2c32f66f82db14957f2a38973737 100644 (file)
@@ -27,7 +27,6 @@
 #include "AliConst.h" 
 #include "AliPDG.h" 
 #include "AliRICHGeometry.h"
-#include "AliRICHHit.h"
 #include "AliRICHResponse.h"
 #include "AliRICHResponseV0.h"
 #include "AliRICHSegmentationV1.h"
@@ -230,36 +229,24 @@ void AliRICHv1::StepManager()
     TClonesArray &lhits = *fHits;
     TParticle *current = (TParticle*)(*gAlice->Particles())[gAlice->GetCurrentTrackNumber()];
 
- //if (current->Energy()>1)
-   //{
-        
-    // Only gas gap inside chamber
-    // Tag chambers and record hits when track enters 
     
  
     id=gMC->CurrentVolID(copy);
     idvol = copy-1;
     Float_t cherenkovLoss=0;
-    //gAlice->KeepTrack(gAlice->GetCurrentTrackNumber());
     
     gMC->TrackPosition(position);
     pos[0]=position(0);
     pos[1]=position(1);
     pos[2]=position(2);
-    //bzero((char *)ckovData,sizeof(ckovData)*19);
     ckovData[1] = pos[0];                 // X-position for hit
     ckovData[2] = pos[1];                 // Y-position for hit
     ckovData[3] = pos[2];                 // Z-position for hit
     ckovData[6] = 0;                      // dummy track length
-    //ckovData[11] = gAlice->GetCurrentTrackNumber();
-    
-    //printf("\n+++++++++++\nTrack: %d\n++++++++++++\n",gAlice->GetCurrentTrackNumber());
-
-    //AliRICH *RICH = (AliRICH *) gAlice->GetDetector("RICH"); 
     
     /********************Store production parameters for Cerenkov photons************************/ 
-//is it a Cerenkov photon? 
-    if (gMC->TrackPid() == 50000050) { 
+
+    if (gMC->TrackPid() == 50000050) { //is it a Cerenkov photon? 
 
       //if (gMC->VolId("GAP ")==gMC->CurrentVolID(copy))
         //{                    
@@ -276,7 +263,6 @@ void AliRICHv1::StepManager()
                      //printf("I'm in!\n");
                      Int_t mother = current->GetFirstMother(); 
                      
-                     //printf("Second Mother:%d\n",current->GetSecondMother());
                      
                      ckovData[10] = mother;
                      ckovData[11] = gAlice->GetCurrentTrackNumber();
@@ -284,7 +270,6 @@ void AliRICHv1::StepManager()
                      //printf("Produced in FREO\n");
                      fCkovNumber++;
                      fFreonProd=1;
-                     //printf("Index: %d\n",fCkovNumber);
                    }    //first step question
                  }        //freo question
                
@@ -292,20 +277,15 @@ void AliRICHv1::StepManager()
                  if (gMC->VolId("QUAR")==gMC->CurrentVolID(copy))             //is it in quarz?
                    {
                      ckovData[12] = 2;
-                     //printf("Produced in QUAR\n");
                    }    //quarz question
                }        //first step question
                
-               //printf("Before %d\n",fFreonProd);
              }   //track entering question
              
              if (ckovData[12] == 1)                                        //was it produced in Freon?
                //if (fFreonProd == 1)
                {
                  if (gMC->IsTrackEntering()){                                     //is track entering?
-                   //printf("Track entered (2)\n");
-                   //printf("Current volume (should be META): %s\n",gMC->CurrentVolName());
-                   //printf("VolId: %d, CurrentVolID: %d\n",gMC->VolId("META"),gMC->CurrentVolID(copy));
                    if (gMC->VolId("META")==gMC->CurrentVolID(copy))                //is it in gap?      
                      {
                        //printf("Got in META\n");
@@ -324,14 +304,10 @@ void AliRICHv1::StepManager()
                          gMC->StopTrack();
                          ckovData[13] = 5;
                          AddCerenkov(gAlice->GetCurrentTrackNumber(),vol,ckovData);
-                         //printf("Added One (1)!\n");
-                         //printf("Lost one in grid\n");
                        }
                        /**********************************************************************************/
                      }    //gap
                    
-                   //printf("Current volume (should be CSI) (1): %s\n",gMC->CurrentVolName());
-                   //printf("VolId: %d, CurrentVolID: %d\n",gMC->VolId("CSI "),gMC->CurrentVolID(copy));
                    if (gMC->VolId("CSI ")==gMC->CurrentVolID(copy))             //is it in csi?      
                      {
                        //printf("Got in CSI\n");
@@ -376,8 +352,6 @@ void AliRICHv1::StepManager()
                        ckovData[13]=1;
                      if (gMC->CurrentVolID(copy) == gMC->VolId("QUAR")) 
                        ckovData[13]=2;
-                     //gMC->StopTrack();
-                     //AddCerenkov(gAlice->GetCurrentTrackNumber(),vol,ckovData);
                    } //reflection question
                     
                    //        Absorption loss 
@@ -402,8 +376,6 @@ void AliRICHv1::StepManager()
                      }
                      gMC->StopTrack();
                      AddCerenkov(gAlice->GetCurrentTrackNumber(),vol,ckovData);
-                     //printf("Added One (3)!\n");
-                     //printf("Added cerenkov %d\n",fCkovNumber);
                    } //absorption question 
                    
                    
@@ -412,13 +384,11 @@ void AliRICHv1::StepManager()
                      ckovData[13]=21;
                      gMC->StopTrack();
                      AddCerenkov(gAlice->GetCurrentTrackNumber(),vol,ckovData);
-                     //printf("Added One (4)!\n");
                    }   // energy treshold question         
                  }  //number of mechanisms cycle
                  /**********************End of evaluation************************/
                } //freon production question
            } //energy interval question
-       //}//inside the proximity gap question
     } //cerenkov photon question
       
     /**************************************End of Production Parameters Storing*********************/ 
@@ -427,17 +397,9 @@ void AliRICHv1::StepManager()
     /*******************************Treat photons that hit the CsI (Ckovs and Feedbacks)************/ 
     
     if (gMC->TrackPid() == 50000050 || gMC->TrackPid() == 50000051) {
-      //printf("Cerenkov\n");
-      
-      //if (gMC->TrackPid() == 50000051)
-       //printf("Tracking a feedback\n");
       
       if (gMC->VolId("CSI ")==gMC->CurrentVolID(copy))
        {
-         //printf("Current volume (should be CSI) (2): %s\n",gMC->CurrentVolName());
-         //printf("VolId: %d, CurrentVolID: %d\n",gMC->VolId("CSI "),gMC->CurrentVolID(copy));
-         //printf("Got in CSI\n");
-         //printf("Tracking a %d\n",gMC->TrackPid());
          if (gMC->Edep() > 0.){
                gMC->TrackPosition(position);
                gMC->TrackMomentum(momentum);
@@ -460,26 +422,15 @@ void AliRICHv1::StepManager()
 
                gMC->Gmtod(pos,localPos,1);
 
-               //Chamber(idvol).GlobaltoLocal(pos,localPos);
                                                                     
                gMC->Gmtod(mom,localMom,2);
 
-               //Chamber(idvol).GlobaltoLocal(mom,localMom);
                
                gMC->CurrentVolOffID(2,copy);
                vol[0]=copy;
                idvol=vol[0]-1;
 
-               //Int_t sector=((AliRICHChamber*) (*fChambers)[idvol])
-                       //->Sector(localPos[0], localPos[2]);
-               //printf("Sector:%d\n",sector);
-
-               /*if (gMC->TrackPid() == 50000051){
-                 fFeedbacks++;
-                 printf("Feedbacks:%d\n",fFeedbacks);
-               }*/     
                
-        //PH           ((AliRICHChamber*) (*fChambers)[idvol])
                ((AliRICHChamber*)fChambers->At(idvol))
                    ->SigGenInit(localPos[0], localPos[2], localPos[1]);
                if(idvol<kNCH) {        
@@ -489,7 +440,7 @@ void AliRICHv1::StepManager()
                    ckovData[3] = pos[2];                 // Z-position for hit
                    ckovData[4] = theta;                      // theta angle of incidence
                    ckovData[5] = phi;                      // phi angle of incidence 
-                   ckovData[8] = (Float_t) fNSDigits;      // first sdigit
+                   ckovData[8] = (Float_t) fNsdigits;      // first sdigit
                    ckovData[9] = -1;                       // last pad hit
                    ckovData[13] = 4;                       // photon was detected
                    ckovData[14] = mom[0];
@@ -503,18 +454,14 @@ void AliRICHv1::StepManager()
                    
                    //nPads = Hits2SDigits(localPos[0],localPos[2],cherenkovLoss,idvol,kCerenkov);//for photons in CsI kir
                                    
-                   if (fNSDigits > (Int_t)ckovData[8]) {
+                   if (fNsdigits > (Int_t)ckovData[8]) {
                        ckovData[8]= ckovData[8]+1;
-                       ckovData[9]= (Float_t) fNSDigits;
+                       ckovData[9]= (Float_t) fNsdigits;
                    }
 
-                   //printf("Cerenkov loss: %f\n", cherenkovLoss);
 
                    ckovData[17] = nPads;
-                   //printf("nPads:%d",nPads);
-                   
-                   //TClonesArray *Hits = RICH->Hits();
-                   AliRICHHit *mipHit =  (AliRICHHit*) (fHits->UncheckedAt(0));
+                   AliRICHhit *mipHit =  (AliRICHhit*) (fHits->UncheckedAt(0));
                    if (mipHit)
                      {
                        mom[0] = current->Px();
@@ -555,14 +502,7 @@ void AliRICHv1::StepManager()
 
     /**********************************************Charged particles treatment*************************************/
 
-    else if (gMC->TrackCharge())
-    //else if (1 == 1)
-      {
-//If MIP
-       /*if (gMC->IsTrackEntering())
-         {                
-           hits[13]=20;//is track entering?
-         }*/
+    else if (gMC->TrackCharge()){//is MIP?
        if (gMC->VolId("FRE1")==gMC->CurrentVolID(copy) || gMC->VolId("FRE2")==gMC->CurrentVolID(copy))
          {
            gMC->TrackMomentum(momentum);
@@ -576,17 +516,12 @@ void AliRICHv1::StepManager()
            fFreonProd=1;
          }
 
-       if (gMC->VolId("GAP ")== gMC->CurrentVolID(copy)) {
+       if(gMC->VolId("GAP ")==gMC->CurrentVolID(copy)) {//is in GAP?
 // Get current particle id (ipart), track position (pos)  and momentum (mom)
            
            gMC->CurrentVolOffID(3,copy);
            vol[0]=copy;
            idvol=vol[0]-1;
-
-           //Int_t sector=((AliRICHChamber*) (*fChambers)[idvol])
-                       //->Sector(localPos[0], localPos[2]);
-           //printf("Sector:%d\n",sector);
-           
            gMC->TrackPosition(position);
            gMC->TrackMomentum(momentum);
            pos[0]=position(0);
@@ -598,23 +533,11 @@ void AliRICHv1::StepManager()
            mom[3]=momentum(3);
 
            gMC->Gmtod(pos,localPos,1);
-           
-           //Chamber(idvol).GlobaltoLocal(pos,localPos);
-                                                                    
            gMC->Gmtod(mom,localMom,2);
-
-           //Chamber(idvol).GlobaltoLocal(mom,localMom);
-           
            ipart  = gMC->TrackPid();
-           //
-           // momentum loss and steplength in last step
-           destep = gMC->Edep();
-           step   = gMC->TrackStep();
-  
-           //
-           // record hits when track enters ...
-           if( gMC->IsTrackEntering()) {
-//             gMC->SetMaxStep(fMaxStepGas);
+           destep = gMC->Edep();step   = gMC->TrackStep();// momentum loss and steplength in last step
+           if(gMC->IsTrackEntering()){     // record hits when track enters ...
+
                Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
                Double_t rt = TMath::Sqrt(tc);
                theta   = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
@@ -632,7 +555,7 @@ void AliRICHv1::StepManager()
                hits[3] = localPos[2];                 // Z-position for hit
                hits[4] = localTheta;                  // theta angle of incidence
                hits[5] = localPhi;                    // phi angle of incidence 
-               hits[8] = (Float_t) fNSDigits;    // first sdigit
+               hits[8] = (Float_t) fNsdigits;    // first sdigit
                hits[9] = -1;                     // last pad hit
                hits[13] = fFreonProd;           // did id hit the freon?
                hits[14] = mom[0];
@@ -652,17 +575,13 @@ void AliRICHv1::StepManager()
                yhit    = localPos[2];
                // Only if not trigger chamber
                if(idvol<kNCH) {
-                   //
                    //  Initialize hit position (cursor) in the segmentation model 
-          //PH             ((AliRICHChamber*) (*fChambers)[idvol])
                    ((AliRICHChamber*)fChambers->At(idvol))
                        ->SigGenInit(localPos[0], localPos[2], localPos[1]);
                }
            }
            
-           // 
            // Calculate the charge induced on a pad (disintegration) in case 
-           //
            // Mip left chamber ...
            if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
                gMC->SetMaxStep(kBig);
@@ -678,30 +597,25 @@ void AliRICHv1::StepManager()
                        printf("\n\n\n\n\n Neutron Making Pad Hit!!! \n\n\n\n");
                      //nPads = Hits2SDigits(xhit,yhit,eloss,idvol,kMip); //for MIP kir
                      hits[17] = nPads;
-                     //printf("nPads:%d",nPads);
                    }
                }
                
                hits[6]=tlength;
                hits[7]=eloss;
-               if (fNSDigits > (Int_t)hits[8]) {
+               if (fNsdigits > (Int_t)hits[8]) {
                    hits[8]= hits[8]+1;
-                   hits[9]= (Float_t) fNSDigits;
+                   hits[9]= (Float_t) fNsdigits;
                }
                
-               //if(sector !=-1)
-               new(lhits[fNhits++]) AliRICHHit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+               new(lhits[fNhits++]) AliRICHhit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
                eloss = 0; 
-               //
                // Check additional signal generation conditions 
                // defined by the segmentation
                // model (boundary crossing conditions) 
            } else if 
-          //PH         (((AliRICHChamber*) (*fChambers)[idvol])
                (((AliRICHChamber*)fChambers->At(idvol))
                 ->SigGenCond(localPos[0], localPos[2], localPos[1]))
            {
-          //PH         ((AliRICHChamber*) (*fChambers)[idvol])
                ((AliRICHChamber*)fChambers->At(idvol))
                    ->SigGenInit(localPos[0], localPos[2], localPos[1]);
                if (eloss > 0) 
@@ -722,14 +636,6 @@ void AliRICHv1::StepManager()
                eloss   += destep;
                tlength += step ;
            }
-       }
-      }
-    /*************************************************End of MIP treatment**************************************/
+       }//is in GAP?
+      }//is MIP?
 }//void AliRICHv1::StepManager()
-
-
-
-
-
-
-
index a702d60336ae34805b1d30ebbe1cb4f574907709..5f051c2ec4441b5f30bb2d8778cabeb5ffa4ae39 100644 (file)
@@ -30,7 +30,6 @@
 #include "AliMagF.h"
 #include "AliPDG.h"
 #include "AliRICHGeometry.h"
-#include "AliRICHHit.h"
 #include "AliRICHResponseV0.h"
 #include "AliRICHSegmentationV1.h"
 #include "AliRICHv3.h"
@@ -801,7 +800,7 @@ void AliRICHv3::StepManager()
     Float_t        theta,phi;
     Float_t        destep, step;
     Double_t        ranf[2];
-    Int_t          nPads;
+    Int_t          nPads=1;
     Float_t        coscerenkov;
     static Float_t eloss, xhit, yhit, tlength;
     const  Float_t kBig=1.e10;
@@ -1068,7 +1067,7 @@ void AliRICHv3::StepManager()
                    ckovData[3] = pos[2];                 // Z-position for hit
                    ckovData[4] = theta;                      // theta angle of incidence
                    ckovData[5] = phi;                      // phi angle of incidence 
-                   ckovData[8] = (Float_t) fNSDigits;      // first sdigit
+                   ckovData[8] = (Float_t) fNsdigits;      // first sdigit
                    ckovData[9] = -1;                       // last pad hit
                    ckovData[13] = 4;                       // photon was detected
                    ckovData[14] = mom[0];
@@ -1082,9 +1081,9 @@ void AliRICHv3::StepManager()
                    
                    //nPads = Hits2SDigits(localPos[0],localPos[2],cherenkovLoss,idvol,kCerenkov);//for photons in CsI kir
                                    
-                   if (fNSDigits > (Int_t)ckovData[8]) {
+                   if (fNsdigits > (Int_t)ckovData[8]) {
                        ckovData[8]= ckovData[8]+1;
-                       ckovData[9]= (Float_t) fNSDigits;
+                       ckovData[9]= (Float_t) fNsdigits;
                    }
 
                    //printf("Cerenkov loss: %f\n", cherenkovLoss);
@@ -1093,7 +1092,7 @@ void AliRICHv3::StepManager()
                    //printf("nPads:%d",nPads);
                    
                    //TClonesArray *Hits = RICH->Hits();
-                   AliRICHHit *mipHit =  (AliRICHHit*) (fHits->UncheckedAt(0));
+                   AliRICHhit *mipHit =  (AliRICHhit*) (fHits->UncheckedAt(0));
                    if (mipHit)
                      {
                        mom[0] = current->Px();
@@ -1211,7 +1210,7 @@ void AliRICHv3::StepManager()
                hits[3] = localPos[2];                 // Z-position for hit
                hits[4] = localTheta;                  // theta angle of incidence
                hits[5] = localPhi;                    // phi angle of incidence 
-               hits[8] = (Float_t) fNSDigits;    // first sdigit
+               hits[8] = (Float_t) fNsdigits;    // first sdigit
                hits[9] = -1;                     // last pad hit
                hits[13] = fFreonProd;           // did id hit the freon?
                hits[14] = mom[0];
@@ -1263,13 +1262,13 @@ void AliRICHv3::StepManager()
                
                hits[6]=tlength;
                hits[7]=eloss;
-               if (fNSDigits > (Int_t)hits[8]) {
+               if (fNsdigits > (Int_t)hits[8]) {
                    hits[8]= hits[8]+1;
-                   hits[9]= (Float_t) fNSDigits;
+                   hits[9]= (Float_t) fNsdigits;
                }
                
                //if(sector !=-1)
-               new(lhits[fNhits++]) AliRICHHit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+               new(lhits[fNhits++]) AliRICHhit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
                eloss = 0; 
                //
                // Check additional signal generation conditions 
index a190091314f03638dee755f63b2d7d155c5eb61f..f06a5406afeee05154f2be145ad239cdb11ba78f 100644 (file)
@@ -6,15 +6,16 @@
 #pragma link C++ class  AliRICHv0+;
 #pragma link C++ class  AliRICHv1+;
 #pragma link C++ class  AliRICHParam+;
+#pragma link C++ class  AliRICHhit+;
+#pragma link C++ class  AliRICHCerenkov+;
+#pragma link C++ class  AliRICHdigit+;
 #pragma link C++ class  AliRICHv3+;
-#pragma link C++ class  AliRICHHit+;
 #pragma link C++ class  AliRICHDigit+;
 #pragma link C++ class  AliRICHSDigit+;
 #pragma link C++ class  AliRICHTransientDigit+;
 #pragma link C++ class  AliRICHRawCluster+;
 #pragma link C++ class  AliRICHRecHit1D+;
 #pragma link C++ class  AliRICHRecHit3D+;
-#pragma link C++ class  AliRICHCerenkov+;
 #pragma link C++ class  AliRICHSegmentationV0+;
 #pragma link C++ class  AliRICHSegmentationV1+;
 #pragma link C++ class  AliRICHResponse+;
index 263eb762a0da5699279c22c71ba9bcaff40a60eb..62ba45893d32f0439ae9876f7a96bc6cffa7154e 100644 (file)
@@ -4,7 +4,7 @@ SRCS   =  AliRICH.cxx AliRICHv0.cxx AliRICHv1.cxx AliRICHv3.cxx\
         AliRICHSegmentationV1.cxx AliRICHResponse.cxx AliRICHResponseV0.cxx \
         AliRICHClusterFinder.cxx AliRICHHitMapA1.cxx\
         AliRICHChamber.cxx AliRICHDetect.cxx AliRICHDetectV1.cxx AliRICHPatRec.cxx \
-         AliRICHHit.cxx AliRICHCerenkov.cxx AliRICHSDigit.cxx \
+         AliRICHSDigit.cxx \
         AliRICHDigit.cxx AliRICHTransientDigit.cxx \
         AliRICHRawCluster.cxx AliRICHRecHit1D.cxx AliRICHRecHit3D.cxx AliRICHEllipse.cxx \
         AliRICHMerger.cxx AliRICHDigitizer.cxx
index 865ac75168f01d94c7509dbc085054efa8879d1d..fe5470b64dae46ef51b83deed3627e9d09fd8503 100644 (file)
@@ -1,30 +1,27 @@
 void Show()
 {  
 //How to get number of events:  
-  gpRL->LoadHeader();//without this the following will be zero:
-  Info("RICH/menu.C::Show","3 ways to get number of events 1=%i 2=%i 3=%i",
+  Info("RICH/menu.C::Show","3 ways to get number of events 1=%i 2=%f 3=%f",
                           gAlice->GetEventsPerRun(),
-                          gpRL->TreeE()->GetEntries(),
+                          al->TreeE()->GetEntries(),
                           gAlice->TreeE()->GetEntries());
-//
-  return;
-  for(Int_t iEventN=0;iEventN<iNevents;iEventN++){// loop on events
-      Int_t iNparticles=gAlice->GetEvent(iEventN);
-      Int_t iNtracks=gAlice->TreeH()->GetEntries();
-      cout<<"Event "<<iEventN<<" contains "<<iNparticles<<" particles and "<<iNtracks<<" tracks\n";
-
-      for(Int_t iTrackN=0;iTrackN<iNtracks;iTrackN++){ // loop on tracks
-         gAlice->TreeH()->GetEntry(iTrackN);
-        // gAlice->Particle(iTrackN)->Print();
-         for(AliRICHhit *pRICHhit=(AliRICHhit*)pRICH->FirstHit(-1);pRICHhit;pRICHhit->(AliRICHhit*)pRICH->NextHit()){
-             TVector3 mrsV3(pRICHhit->X(),pRICHhit->Y(),pRICHhit->Z());
-             cout<<"Before\n";mrsV3.Dump();
-             TVector3 armV3=pRICH->ToArm(mrsV3);
-             cout<<"After\n";armV3.Dump();
-         }//loop on hits of given track
-      }// loop on tracks
-   }//loop on events
-
+  rl->LoadHits();
+  for(Int_t iEventN=0;iEventN<gAlice->GetEventsPerRun();iEventN++){// loop on events
+    Int_t iNparticles=gAlice->GetEvent(iEventN);
+    Int_t iNtracks=rl->TreeH()->GetEntries();
+    Info("RICH/menu.C::Show","Event %i contains %i particles in total while %i are primary",
+                                     iEventN,    iNparticles,                iNtracks);
+    for(Int_t iTrackN=0;iTrackN<iNtracks;iTrackN++){ // loop on tracks
+      rl->TreeH()->GetEntry(iTrackN);
+      al->Stack()->Particle(iTrackN)->Print();
+      Info("RICH/menu.C::Show","track %i has %i hits",iTrackN,r->Hits()->GetEntries());
+//      for(AliRICHhit *pRichHit=(AliRICHhit*)gpRich->FirstHit(-1);pRichHit;pRichHit=(AliRICHhit*)gpRich->NextHit()){
+//        pRichHit->Dump();        
+//              TVector3 armV3=pRICH->ToArm(mrsV3);
+//              cout<<"After\n";armV3.Dump();
+//      }//loop on hits of given track
+    }// loop on tracks
+  }//loop on events
 }//void Show()
 
 void menu(Int_t iNevents=5)// How many events to generate.
@@ -35,60 +32,92 @@ void menu(Int_t iNevents=5)// How many events to generate.
 
   TControlBar *pMenu = new TControlBar("vertical","RICH main");
        
+  pMenu->AddButton("Debug ON-OFF",     "Debug();",   "Switch debug on-off");   
   if(GetAlice()){//it's from file, reconstruct
     pMenu->AddButton("Show","Show()","Shows the structure of events in files");
+    pMenu->AddButton("Hits2SDigits","r->Hits2SDigits()","Perform first phase converstion");
     pMenu->AddButton("RingViewer","RingViewer()","Show rings with reconstructed info");
   }else{//it's aliroot, simulate
-    pMenu->AddButton("Init",         "Init()",                "Normal init");   
     pMenu->AddButton("Run",           runString.Data(),       "Process!");
   }
-  pMenu->AddButton("Debug ON",     "gAlice->SetDebug(1)",   "Switch debug on");   
-  pMenu->AddButton("Debug OFF",    "gAlice->SetDebug()",    "Switch debug off");     
   pMenu->AddButton("Geo",          "Geo()",                 "Geomentry submenu");
   pMenu->AddButton("Browser",      "new TBrowser;",         "Start ROOT TBrowser");
   pMenu->AddButton("Quit",         ".q",                    "Close session");
   pMenu->Show();
+  a=gAlice;//for manual manipulation convinience
 }//void menu(Int_t iNevents)
 
-void Init()
+
+void Debug()
 {
-  gAlice->Init("~/my/AliceConfig.C");
-}
+  if(gAlice->GetDebug()){
+    Info("RICH/menu.C::Debug","OFF");
+    gAlice->SetDebug(0);
+    if(r)r->SetDebug(0);
+    if(t)t->SetDebug(0);
+    AliLoader::SetDebug(0);
+  }else{
+    Info("RICH/menu.C::Debug","ON");
+    gAlice->SetDebug(1);
+    if(r)r->SetDebug(1);
+    if(t)t->SetDebug(1);
+    AliLoader::SetDebug(1);
+  }
+}//void Debug()
 
-AliRunLoader *rl,*gpRL;
-AliLoader *rrl,*gpRichLoader;
-AliRICH *r,*gpRich;
 AliRun *a;
+AliRunLoader *al;
+AliLoader *rl,*tl,*il;
+
+AliRICH *r;
+AliTPC *t;
+AliITS *i;
+AliPHOS *p;
+
 Bool_t GetAlice()
 {
   if(gAlice){//it's aliroot
-    Info("RICH/menu.C::GetAlice","gAlice!=NULL, it's aliroot, execute Init()");
-    Init();
+    Info("RICH/menu.C::GetAlice","gAlice!=NULL, IT'S ALIROOT, EXECUTE Init()");
+    gAlice->Init("~/my/AliceConfig.C");
+    r=(AliRICH*)gAlice->GetDetector("RICH");
+    t=(AliTPC*)gAlice->GetDetector("TPC");
+    i=(AliITS*)gAlice->GetDetector("ITS");
+    p=(AliPHOS*)gAlice->GetDetector("PHOS");    
     return kFALSE;
   }else{//it's root with ALICE libs loaded
-    Info("RICH/menu.C::GetAlice","gAlice=0, getting it from simulated file.");
-    
-    gpRL=AliRunLoader::Open("galice.root","AlicE","update");
-    if(!gpRL) Fatal("GetAlice","Can't get AliRunLoader");
-    
-    gpRL->LoadgAlice();
+    Info("RICH/menu.C::GetAlice","gAlice=0, GETTING IT FROM SIMULATED FILE.");
+        
+    if(!(al=AliRunLoader::Open("galice.root","AlicE","update"))) Fatal("RICH/menu.C::GetAlice","Can't get AliRunLoader");
+    al->LoadgAlice();
     if(!gAlice) Fatal("RICH/menu.C::GetAlice","No gAlice in file");
-//    gAlice=gpRL->GetAliRun();    
-    
-    gpRich=(AliRICH*)gAlice->GetDetector("RICH"); 
-    if(!gpRich) Fatal("RICH/menu.C::GetAlice","No RICH in file");
-    
-    gpRichLoader=gpRL->GetLoader("RICHLoader");     
-    if(!gpRichLoader) Fatal("RICH/menu.C::GetAlice","No RICH loader in file");    
-    
-    Info("RICH/menu.C::GetAlice","contains %i event(s)",gAlice->GetEventsPerRun());
-    rl=gpRL;rrl=gpRichLoader;r=gpRich;a=gAlice;//for manual manipulation convinience
+//    a=al->GetAliRun();    
+    al->LoadHeader();//loads events tree
+    al->LoadKinematics();//loads the primaries info
+//RICH      
+    if(!(r=(AliRICH*)gAlice->GetDetector("RICH"))) Warning("RICH/menu.C::GetAlice","No RICH in file");
+    if(!(rl=al->GetLoader("RICHLoader")))          Warning("RICH/menu.C::GetAlice","No RICH loader in file");        
+//TPC            
+    if(!(t=(AliTPC*)gAlice->GetDetector("TPC")))   Warning("RICH/menu.C::GetAlice","No TPC in file");
+    if(!(tl=al->GetLoader("TPCLoader")))           Warning("RICH/menu.C::GetAlice","No TPC loader in file");    
+        
+    Info("RICH/menu.C::GetAlice","Run contains %i event(s)",gAlice->GetEventsPerRun());    
     return kTRUE;
   }       
 }//void GetAlice()         
 
+void RingViewer()
+{
+  gStyle->SetPalette(1);
+  TCanvas *view=new TCanvas("Display","ALICE RICH Display",0,0,1200,750);
+  
+  TH2F *pH2=new TH2F("pH2F","RICH DISPLAY",160,0,160,144,0,144);
+  pH2->SetStats(0);
+  pH2->SetMaximum(100);
 
+  Int_t Nevents = gAlice->GetEventsPerRun();
+}
 
+//______________________________________________________________________________
 void Geo()
 {
   TControlBar *pMenu = new TControlBar("vertical","RICH draw");
@@ -107,7 +136,6 @@ void GeoTest()
 {
 
    TBRIK *pAliceBRIK=new TBRIK("aliceBRIK","ALICE mother volume","void",500,500,500);
-   AliRICH *pRICH=(AliRICH*)gAlice->GetDetector("RICH");
    TBRIK *pArmBRIK=new TBRIK("armBRIK","RICH arm1","void",pRICH->GetSizeX(),pRICH->GetSizeY(),pRICH->GetSizeZ());
    
    TNode *pAliceNode=new TNode("aliceNode","Mother volume","aliceBRIK");
@@ -147,19 +175,7 @@ void GeoTest()
    
    aliceNode->Draw();
 }//void GeoTest()
-
-void RingViewer()
-{
-  gStyle->SetPalette(1);
-  TCanvas *view = new TCanvas("Display","ALICE RICH Display",0,0,1200,750);
-  
-  TH2F *p2F = new TH2F("p2F","RICH DISPLAY",160,0,160,144,0,144);
-  p2F->SetStats(0);
-  p2F->SetMaximum(100);
-
-  Int_t Nevents = gAlice->GetEventsPerRun();
-}
-
+//______________________________________________________________________________
 void PrintGeo(Float_t rotDeg=0)
 {
   AliRICHParam *p=new AliRICHParam;  
@@ -176,21 +192,21 @@ void PrintGeo(Float_t rotDeg=0)
   cout<<endl;
   Double_t phi=90*deg+kRot,theta=90*deg-kT;    
   Info("   menu for          0","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
-                                 r,      theta*r2g,  phi*r2g,  
+                                 r,      theta*r2d,  phi*r2d,  
                                                                r*sin(theta)*cos(phi),
                                                                        r*sin(theta)*sin(phi),
                                                                                r*cos(theta));
   
   phi=90*deg+kRot+kP,theta=90*deg;
   Info("   menu for          1","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
-                                 r,      theta*r2g,  phi*r2g,  
+                                 r,      theta*r2d,  phi*r2d,  
                                                                r*sin(theta)*cos(phi),
                                                                        r*sin(theta)*sin(phi),
                                                                                r*cos(theta));
   
   phi=90*deg+kRot,theta=90*deg;
   Info("   menu for          2","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
-                                 r,      theta*r2g,  phi*r2g,  
+                                 r,      theta*r2d,  phi*r2d,  
                                                                r*sin(theta)*cos(phi),
                                                                        r*sin(theta)*sin(phi),
                                                                                r*cos(theta));
@@ -198,7 +214,7 @@ void PrintGeo(Float_t rotDeg=0)
   
   phi=90*deg+kRot-kP,theta=90*deg;
   Info("   menu for          3","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
-                                 r,      theta*r2g,  phi*r2g,  
+                                 r,      theta*r2d,  phi*r2d,  
                                                                r*sin(theta)*cos(phi),
                                                                        r*sin(theta)*sin(phi),
                                                                                r*cos(theta));
@@ -206,7 +222,7 @@ void PrintGeo(Float_t rotDeg=0)
 
   phi=90*deg+kRot+kP,theta=90*deg+kT;
   Info("   menu for          4","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
-                                 r,      theta*r2g,  phi*r2g,  
+                                 r,      theta*r2d,  phi*r2d,  
                                                                r*sin(theta)*cos(phi),
                                                                        r*sin(theta)*sin(phi),
                                                                                r*cos(theta));
@@ -214,14 +230,14 @@ void PrintGeo(Float_t rotDeg=0)
   
   phi=90*deg+kRot,theta=90*deg+kT;
   Info("   menu for          5","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
-                                 r,      theta*r2g,  phi*r2g,  
+                                 r,      theta*r2d,  phi*r2d,  
                                                                 r*sin(theta)*cos(phi),
                                                                        r*sin(theta)*sin(phi),
                                                                                r*cos(theta));
   
   phi=90*deg+kRot-kP,theta=90*deg+kT;
   Info("   menu for          6","r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f",
-                                 r,      theta*r2g,  phi*r2g,  
+                                 r,      theta*r2d,  phi*r2d,  
                                                                r*sin(theta)*cos(phi),
                                                                        r*sin(theta)*sin(phi),
                                                                                r*cos(theta));