Hit Digit Cluster in separate files to follow rules
authorkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Apr 2005 09:59:20 +0000 (09:59 +0000)
committerkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Apr 2005 09:59:20 +0000 (09:59 +0000)
29 files changed:
RICH/AliRICH.cxx
RICH/AliRICH.h
RICH/AliRICHCluster.cxx [new file with mode: 0644]
RICH/AliRICHCluster.h [new file with mode: 0644]
RICH/AliRICHClusterFinder.cxx
RICH/AliRICHClusterFinder.h
RICH/AliRICHDigit.cxx [new file with mode: 0644]
RICH/AliRICHDigit.h [new file with mode: 0644]
RICH/AliRICHDigitizer.cxx
RICH/AliRICHDigitizer.h
RICH/AliRICHDisplFast.cxx [deleted file]
RICH/AliRICHDisplFast.h [deleted file]
RICH/AliRICHHit.cxx [new file with mode: 0644]
RICH/AliRICHHit.h [new file with mode: 0644]
RICH/AliRICHMap.cxx
RICH/AliRICHParam.cxx
RICH/AliRICHParam.h
RICH/AliRICHRecon.cxx
RICH/AliRICHReconstructor.cxx
RICH/AliRICHReconstructor.h
RICH/AliRICHTracker.cxx
RICH/AliRICHv0.cxx
RICH/AliRICHv1.cxx
RICH/RICHbaseLinkDef.h
RICH/RICHsimLinkDef.h
RICH/RichConfig.C
RICH/RichMenu.C
RICH/libRICHbase.pkg
RICH/libRICHsim.pkg

index 9b01e12..fda8903 100644 (file)
 #include <TNtupleD.h>
 #include <AliTracker.h>
 #include <AliRawDataHeader.h>
-#include <Riostream.h>
-
+#include <TLatex.h> //Display()
+#include <TCanvas.h> //Display()
  
-ClassImp(AliRICHhit)
-//__________________________________________________________________________________________________
-void AliRICHhit::Print(Option_t*)const
-{
-  AliInfo(Form("Ch=%1i,TID=%6i,Elos=%9.3f eV,IN(%6.2f,%6.2f,%6.2f)-OUT(%6.2f,%6.2f,%6.2f)=%9.4f"
-      ,fChamber,fTrack,fEloss*1e9,fInX3.X() ,fInX3.Y() ,fInX3.Z(),
-                                  fOutX3.X(),fOutX3.Y(),fOutX3.Z(),Length()));
-}
-//__________________________________________________________________________________________________
-ClassImp(AliRICHdigit)
-//__________________________________________________________________________________________________
-void AliRICHdigit::Print(Option_t*)const
-{
-//Print current digit  
-  AliInfo(Form("cfm=%9i, cs=%2i, x=%3i, y=%3i, q=%8.3f, TID1=%5i, TID2=%5i, TID3=%5i",
-                  fCFM,fChamber,fPadX,fPadY,fQdc,fTracks[0],fTracks[1],fTracks[2]));
-}
-//__________________________________________________________________________________________________
-ClassImp(AliRICHcluster)
-//__________________________________________________________________________________________________
-void AliRICHcluster::Print(Option_t*)const
-{
-//Print current cluster  
-  const char *status=0;
-  switch(fStatus){
-    case      kRaw: status="raw"     ;break;
-    case kResolved: status="resolved";break;
-    case    kEmpty: status="empty"   ;break;
-  }
-  if(fDigits)    
-    ::Info("cluster","cfm=%10i, cs=%2i, SiMa=%6i, Shape=%5i, x=%7.3f, y=%7.3f, Q=%6i, %s with %i digits",
-                             fCFM,fChamber,fSize,fShape,fX,fY,fQdc,status,fDigits->GetEntriesFast());
-  else
-    AliInfo(Form("cfm=%10i, cs=%2i, SiMa=%6i, Shape=%5i, x=%7.3f, y=%7.3f, Q=%6i, %s with %i digits",
-                             fCFM,fChamber,fSize,fShape,fX,fY,fQdc,status,0));
-    
-}
-//__________________________________________________________________________________________________
 ClassImp(AliRICH)    
 //__________________________________________________________________________________________________
 // RICH manager class   
@@ -89,22 +51,22 @@ ClassImp(AliRICH)
 */
 //END_HTML
 //__________________________________________________________________________________________________
-AliRICH::AliRICH():AliDetector(),fpParam(0),  fSdigits(0),fNsdigits(0),fDigitsNew(0),fClusters(0) 
+AliRICH::AliRICH():AliDetector(),fParam(0),  fSdigits(0),fNsdigits(0),fDigs(0),fClus(0) 
 {
 //Default ctor should not contain any new operators
 //AliDetector ctor deals with Hits and Digits  
-  for(int i=0;i<kNchambers;i++) fNdigitsNew[i]  =0;
-  for(int i=0;i<kNchambers;i++) fNclusters[i]=0;
+  for(int i=0;i<kNchambers;i++) fNdigs[i]  =0;
+  for(int i=0;i<kNchambers;i++) fNclus[i]=0;
 //  fCounters.ResizeTo(20); fCounters.Zero();
 }//AliRICH::AliRICH()
 //__________________________________________________________________________________________________
 AliRICH::AliRICH(const char *name, const char *title)
-        :AliDetector(name,title),fpParam(new AliRICHParam),fSdigits(0),fNsdigits(0),fDigitsNew(0),fClusters(0)
+        :AliDetector(name,title),fParam(new AliRICHParam),fSdigits(0),fNsdigits(0),fDigs(0),fClus(0)
 {
 //Named ctor
   AliDebug(1,"Start.");
 //AliDetector ctor deals with Hits and Digits (reset them to 0, does not create them)
-  CreateHits();          gAlice->GetMCApp()->AddHitList(fHits);
+  HitsCreate();          gAlice->GetMCApp()->AddHitList(fHits);
   fCounters.ResizeTo(20); fCounters.Zero();
   AliDebug(1,"Stop.");
 }//AliRICH::AliRICH(const char *name, const char *title)
@@ -114,13 +76,13 @@ AliRICH::~AliRICH()
 //dtor
   AliDebug(1,"Start.");
 
-  if(fpParam)    delete fpParam;
+  if(fParam)     delete fParam;
   
   if(fHits)      delete fHits;
   if(fSdigits)   delete fSdigits;
   if(fDigits)    delete fDigits;
-  if(fDigitsNew) {fDigitsNew->Delete();   delete fDigitsNew;}
-  if(fClusters)  {fClusters->Delete();    delete fClusters;}
+  if(fDigs)      {fDigs->Delete();   delete fDigs;}
+  if(fClus)      {fClus->Delete();   delete fClus;}
   AliDebug(1,"Stop.");    
 }//AliRICH::~AliRICH()
 //__________________________________________________________________________________________________
@@ -138,7 +100,7 @@ void AliRICH::Hits2SDigits()
     for(Int_t iPrimN=0;iPrimN<GetLoader()->TreeH()->GetEntries();iPrimN++){//prims loop
       GetLoader()->TreeH()->GetEntry(iPrimN);
       for(Int_t iHitN=0;iHitN<Hits()->GetEntries();iHitN++){//hits loop 
-        AliRICHhit *pHit=(AliRICHhit*)Hits()->At(iHitN);//get current hit                
+        AliRICHHit *pHit=(AliRICHHit*)Hits()->At(iHitN);//get current hit                
         TVector2 x2 = C(pHit->C())->Mrs2Anod(0.5*(pHit->InX3()+pHit->OutX3()));//hit position in the anod plane
         Int_t iTotQdc=P()->TotQdc(x2,pHit->Eloss());//total charge produced by hit, 0 if hit in dead zone
         if(iTotQdc==0) continue;
@@ -158,7 +120,7 @@ void AliRICH::Hits2SDigits()
           for(pad[0]=area[0];pad[0]<=area[2];pad[0]++){                    
             Double_t padQdc=iTotQdc*P()->FracQdc(anod,pad);
             AliDebug(1,Form("current pad(%3.0f,%3.0f) with QDC  =%6.2f",pad[0],pad[1],padQdc));
-            if(padQdc>0.1) AddSDigit(pHit->C(),pad,padQdc,GetLoader()->GetRunLoader()->Stack()->Particle(pHit->GetTrack())->GetPdgCode(),pHit->GetTrack());
+            if(padQdc>0.1) SDigitAdd(pHit->C(),pad,padQdc,GetLoader()->GetRunLoader()->Stack()->Particle(pHit->GetTrack())->GetPdgCode(),pHit->GetTrack());
           }//affected pads loop 
       }//hits loop
     }//prims loop
@@ -174,6 +136,12 @@ void AliRICH::Hits2SDigits()
 void AliRICH::Digits2Raw()
 {
 //Loops over all digits and creates raw data files in DDL format. GetEvent() is done outside (AliSimulation)
+//RICH has 2 DDL per chamber, even number for right part(2-4-6) odd number for left part(1-3-5) 
+//RICH has no any propriate header just uses the common one
+//Each PC is divided by 8 rows counted from 1 to 8 from top to bottom for left PCs(1-3-5) and from bottom to top for right PCc(2-4-6)     (denoted  rrrrr 5 bits 32 values)
+//Each raw is composed from 10 DILOGIC chips counted from left to right from 1 to 10                                                      (denoted   dddd 4 bits 16 values)
+//Each DILOGIC chip serves 48 channels counted from 0 to 47                                                                               (denoted aaaaaa 6 bits 64 values)
+//So RICH info word is  32 bits word with structure:   0000 0rrr rrdd ddaa aaaa qqqq qqqq qqqq (five 0 five r six a twelve q) with QDC    (denoted q...q 12 bits 4096 values)
   AliDebug(1,"Start.");
   GetLoader()->LoadDigits();
   GetLoader()->TreeD()->GetEntry(0);
@@ -185,23 +153,17 @@ void AliRICH::Digits2Raw()
   UInt_t word32=1;        //32 bits data word 
   
   for(Int_t iChN=1;iChN<=kNchambers;iChN++){ //2 DDL per chamber open both in parallel   
-    file135.open(Form("RICH_%4i.ddl",kRichOffset+2*iChN-1));   //left part of chamber; sectors 1-3-5
-    file246.open(Form("RICH_%4i.ddl",kRichOffset+2*iChN));     //right part of chamber; sectors 2-4-6
+    file135.open(Form("RICH_%4i.ddl",kRichOffset+2*iChN-1));   //left part of chamber; sectors 1-3-5 odd DDL number
+    file246.open(Form("RICH_%4i.ddl",kRichOffset+2*iChN));     //right part of chamber; sectors 2-4-6 even DDL number
 //common DDL header defined by standart, now dummy as the total number of bytes is not yet known    
     file135.write((char*)&header,sizeof(header)); //dummy header just place holder
     file246.write((char*)&header,sizeof(header)); //actual will be written later
-//now coming RICH private header 16 32-bits wors currently signifying nothing
-    for(Int_t i=0;i<16;i++){    
-      word32='t';
-      file135.write((char*)&word32,sizeof(word32)); //dummy header just place holder
-      file246.write((char*)&word32,sizeof(word32)); //actual will be written later
-    }
     
     Int_t counter135=0,counter246=0;//counts total number of records per DDL 
     
     for(Int_t iDigN=0;iDigN<Digits(iChN)->GetEntriesFast();iDigN++){//digits loop for a given chamber
-      AliRICHdigit *pDig=(AliRICHdigit*)Digits(iChN)->At(iDigN);
-      word32=UInt_t (pDig->Q()+0x400*pDig->X()+0x4000*pDig->Y());            //arbitrary structure
+      AliRICHDigit *pDig=(AliRICHDigit*)Digits(iChN)->At(iDigN);
+      word32=UInt_t (pDig->Q()+0x400*pDig->X()+0x4000*pDig->Y());  //arbitrary structure
       switch(pDig->S()){//readout by vertical sectors: 1,3,5-left DDL 2,4,6-right DDL
         case 1: case 3: case 5: file135.write((char*)&word32,sizeof(word32)); counter135++; break;
         case 2: case 4: case 6: file246.write((char*)&word32,sizeof(word32)); counter246++; break;
@@ -425,25 +387,25 @@ void AliRICH::MakeBranch(Option_t* option)
   const char *cS = strstr(option,"S");
 
   if(cH&&TreeH()){//H
-    CreateHits();      //branch will be created in AliDetector::MakeBranch
+    HitsCreate();      //branch will be created in AliDetector::MakeBranch
   }//H     
   AliDetector::MakeBranch(option);//this is after cH because we need to guarantee that fHits array is created
       
   if(cS&&fLoader->TreeS()){//S  
-    CreateSDigits();   MakeBranchInTree(fLoader->TreeS(),"RICH",&fSdigits,kBufferSize,0) ;
+    SDigitsCreate();   MakeBranchInTree(fLoader->TreeS(),"RICH",&fSdigits,kBufferSize,0) ;
   }//S
    
   if(cD&&fLoader->TreeD()){//D
-    CreateDigits();
+    DigitsCreate();
     for(Int_t i=0;i<kNchambers;i++){ 
-      MakeBranchInTree(fLoader->TreeD(),Form("%s%d",GetName(),i+1),&((*fDigitsNew)[i]),kBufferSize,0);
+      MakeBranchInTree(fLoader->TreeD(),Form("%s%d",GetName(),i+1),&((*fDigs)[i]),kBufferSize,0);
     }
   }//D
   
   if(cR&&fLoader->TreeR()){//R
-    CreateClusters();
+    ClustersCreate();
     for(Int_t i=0;i<kNchambers;i++)
-      MakeBranchInTree(fLoader->TreeR(),Form("%sClusters%d",GetName(),i+1), &((*fClusters)[i]), kBufferSize, 0);    
+      MakeBranchInTree(fLoader->TreeR(),Form("%sClusters%d",GetName(),i+1), &((*fClus)[i]), kBufferSize, 0);    
   }//R
   AliDebug(1,"Stop.");   
 }//void AliRICH::MakeBranch(Option_t* option)
@@ -457,20 +419,20 @@ void AliRICH::SetTreeAddress()
     
   if(fLoader->TreeH()){//H
     AliDebug(1,"tree H is requested.");
-    CreateHits();//branch map will be in AliDetector::SetTreeAddress    
+    HitsCreate();//branch map will be in AliDetector::SetTreeAddress    
   }//H
   AliDetector::SetTreeAddress();//this is after TreeH because we need to guarantee that fHits array is created
 
   if(fLoader->TreeS()){//S
     AliDebug(1,"tree S is requested.");
-    branch=fLoader->TreeS()->GetBranch(GetName());        if(branch){CreateSDigits();   branch->SetAddress(&fSdigits);}
+    branch=fLoader->TreeS()->GetBranch(GetName());        if(branch){SDigitsCreate();   branch->SetAddress(&fSdigits);}
   }//S
     
   if(fLoader->TreeD()){//D    
     AliDebug(1,"tree D is requested.");
     for(int i=0;i<kNchambers;i++){      
       branch=fLoader->TreeD()->GetBranch(Form("%s%d",GetName(),i+1)); 
-      if(branch){CreateDigits(); branch->SetAddress(&((*fDigitsNew)[i]));}
+      if(branch){DigitsCreate(); branch->SetAddress(&((*fDigs)[i]));}
     }
   }//D
     
@@ -478,7 +440,7 @@ void AliRICH::SetTreeAddress()
     AliDebug(1,"tree R is requested.");
     for(int i=0;i<kNchambers;i++){         
       branch=fLoader->TreeR()->GetBranch(Form("%sClusters%d" ,GetName(),i+1));
-      if(branch){CreateClusters(); branch->SetAddress(&((*fClusters)[i]));}
+      if(branch){ClustersCreate(); branch->SetAddress(&((*fClus)[i]));}
     }
   }//R
   AliDebug(1,"Stop.");
@@ -569,12 +531,12 @@ void AliRICH::ControlPlots()
     for(Int_t iPrimN=0;iPrimN < GetLoader()->TreeH()->GetEntries();iPrimN++){//hit tree loop
       GetLoader()->TreeH()->GetEntry(iPrimN);      
       for(Int_t j=0;j<Hits()->GetEntries();j++){//hits loop
-        AliRICHhit *pHit = (AliRICHhit*)Hits()->At(j);
+        AliRICHHit *pHit = (AliRICHHit*)Hits()->At(j);
         TParticle *pParticle = GetLoader()->GetRunLoader()->Stack()->Particle(pHit->GetTrack());//get particle produced this hit
-        Double_t Radius = TMath::Sqrt(pParticle->Vx()*pParticle->Vx()+pParticle->Vy()*pParticle->Vy()+pParticle->Vz()*pParticle->Vz());
+        Double_t dRadius = TMath::Sqrt(pParticle->Vx()*pParticle->Vx()+pParticle->Vy()*pParticle->Vy()+pParticle->Vz()*pParticle->Vz());
         switch(pParticle->GetPdgCode()){
-          case kPositron : pElecP->Fill( pParticle->P());pelecRadius->Fill(Radius); break;
-          case kElectron : pElecP->Fill(-pParticle->P());pelecRadius->Fill(Radius); break;
+          case kPositron : pElecP->Fill( pParticle->P());pelecRadius->Fill(dRadius); break;
+          case kElectron : pElecP->Fill(-pParticle->P());pelecRadius->Fill(dRadius); break;
           
           case kMuonPlus : pMuonP->Fill( pParticle->P()); break;
           case kMuonMinus: pMuonP->Fill(-pParticle->P()); break;
@@ -585,8 +547,8 @@ void AliRICH::ControlPlots()
           case kKPlus    : pKaonP->Fill( pParticle->P()); break;
           case kKMinus   : pKaonP->Fill(-pParticle->P()); break;
           
-          case kProton   : pProtP->Fill( pParticle->P()); pprotRadius->Fill(Radius); break;
-          case kProtonBar: pProtP->Fill(-pParticle->P()); pprotbarRadius->Fill(Radius); break;
+          case kProton   : pProtP->Fill( pParticle->P()); pprotRadius->Fill(dRadius); break;
+          case kProtonBar: pProtP->Fill(-pParticle->P()); pprotbarRadius->Fill(dRadius); break;
               
         }//switch PdgCode
             
@@ -596,8 +558,8 @@ void AliRICH::ControlPlots()
     if(isSdig){
       GetLoader()->TreeS()->GetEntry(0);  
       for(Int_t iSdigN=0;iSdigN<SDigits()->GetEntries();iSdigN++){//sdigits loop 
-        AliRICHdigit *pSdig=(AliRICHdigit*)SDigits()->At(iSdigN); //get current sdigit pointer  
-        AliRICHhit   *pHit=Hit(pSdig->GetTrack(0));               //get hit of this sdigit (always one)
+        AliRICHDigit *pSdig=(AliRICHDigit*)SDigits()->At(iSdigN); //get current sdigit pointer  
+        AliRICHHit   *pHit=Hit(pSdig->GetTrack(0));               //get hit of this sdigit (always one)
         TVector2 hit2 =C(pHit->C())->Mrs2Pc(pHit->OutX3());       //this hit position  in local system
         TVector2 sdig2=P()->Pad2Loc(pSdig->Pad());                //center of pad for this sdigit
         pHxSd->Fill(hit2.X()-sdig2.X());        
@@ -611,8 +573,8 @@ void AliRICH::ControlPlots()
     for(Int_t iChamN=1;iChamN<=7;iChamN++){//chambers loop
       if(isDig){
         for(Int_t iDigN=0;iDigN<Digits(iChamN)->GetEntries();iDigN++){//digits loop
-          AliRICHdigit *pDig=(AliRICHdigit*)Digits(iChamN)->At(iDigN);
-          AliRICHhit   *pHit=Hit(pDig->GetTrack(0));           //get first hit of this digit
+          AliRICHDigit *pDig=(AliRICHDigit*)Digits(iChamN)->At(iDigN);
+          AliRICHHit   *pHit=Hit(pDig->GetTrack(0));           //get first hit of this digit
           TVector2 hitV2=C(iChamN)->Mrs2Pc(pHit->OutX3()); 
           TVector2 digV2=P()->Pad2Loc(pDig->Pad());            //center of pad for this digit
           pHxD->Fill(hitV2.X()-digV2.X());        pHyD->Fill(hitV2.Y()-digV2.Y());
@@ -621,7 +583,7 @@ void AliRICH::ControlPlots()
       if(isClus){
         Int_t iNclusCham=Clusters(iChamN)->GetEntries(); if(iNclusCham) pNumClusH1->Fill(iNclusCham);//number of clusters per event
         for(Int_t iClusN=0;iClusN<iNclusCham;iClusN++){//clusters loop
-          AliRICHcluster *pClus=(AliRICHcluster*)Clusters(iChamN)->At(iClusN);
+          AliRICHCluster *pClus=(AliRICHCluster*)Clusters(iChamN)->At(iClusN);
                                        pQdcH1        ->Fill(pClus->Q());   
                                        pSizeH1       ->Fill(pClus->Size());  
                                        pMapH2        ->Fill(pClus->X(),pClus->Y()); //common
@@ -658,14 +620,14 @@ void AliRICH::ControlPlots()
   gBenchmark->Show("ControlPlots");
 }//ControlPlots()
 //__________________________________________________________________________________________________
-AliRICHhit* AliRICH::Hit(Int_t tid)const
+AliRICHHit* AliRICH::Hit(Int_t tid)const
 {
 //defines which hit provided by given tid for the currently loaded event
   GetLoader()->LoadHits();
   for(Int_t iPrimN=0;iPrimN<GetLoader()->TreeH()->GetEntries();iPrimN++){//prims loop      
     GetLoader()->TreeH()->GetEntry(iPrimN);
     for(Int_t iHitN=0;iHitN<Hits()->GetEntries();iHitN++){
-      AliRICHhit *pHit=(AliRICHhit*)Hits()->At(iHitN);
+      AliRICHHit *pHit=(AliRICHHit*)Hits()->At(iHitN);
       if(tid==pHit->Track()) {GetLoader()->UnloadHits();return pHit;}
     }//hits
   }//prims loop
@@ -673,7 +635,7 @@ AliRICHhit* AliRICH::Hit(Int_t tid)const
   return 0;
 }
 //__________________________________________________________________________________________________
-void AliRICH::PrintHits(Int_t iEvtN)
+void AliRICH::HitsPrint(Int_t iEvtN)const
 {
 //Prints a list of RICH hits for a given event. Default is event number 0.
   if(GetLoader()->GetRunLoader()->GetEvent(iEvtN)) return;    
@@ -687,11 +649,10 @@ void AliRICH::PrintHits(Int_t iEvtN)
     iTotalHits+=Hits()->GetEntries();
   }
   GetLoader()->UnloadHits();
-  ResetHits();
   AliInfo(Form("totally %i hits",iTotalHits));
 }
 //__________________________________________________________________________________________________
-void AliRICH::PrintSDigits(Int_t iEvtN)
+void AliRICH::SDigitsPrint(Int_t iEvtN)const
 {
 //prints a list of RICH sdigits  for a given event
   if(GetLoader()->GetRunLoader()->GetEvent(iEvtN)) return;    
@@ -704,7 +665,7 @@ void AliRICH::PrintSDigits(Int_t iEvtN)
   Info("PrintSDigits","totally %i sdigits",SDigits()->GetEntries());
 }
 //__________________________________________________________________________________________________
-void AliRICH::PrintDigits(Int_t iEvtN)
+void AliRICH::DigitsPrint(Int_t iEvtN)const
 {
 //prints a list of RICH digits  for a given event
   if(GetLoader()->GetRunLoader()->GetEvent(iEvtN)) return;    
@@ -721,7 +682,7 @@ void AliRICH::PrintDigits(Int_t iEvtN)
   Info("PrintDigits","totally %i Digits",iTotalDigits);
 }
 //__________________________________________________________________________________________________
-void AliRICH::PrintClusters(Int_t iEvtN)
+void AliRICH::ClustersPrint(Int_t iEvtN)const
 {
 //prints a list of RICH clusters  for a given event
   AliInfo(Form("List of RICH clusters for event %i",iEvtN));
@@ -947,3 +908,158 @@ void AliRICH::CheckPR()const
   printf("\n\n");
   pFile->Write();pFile->Close();
 }
+//__________________________________________________________________________________________________
+void AliRICH::DisplayEvent(Int_t iEvtNmin,Int_t iEvtNmax)const
+{
+  TH2F *pDigitsH2[8];
+
+  Bool_t isDigits  =!GetLoader()->LoadDigits();
+  if(!isDigits){Error("ShoEvent","No digits. Nothing to display.");return;}
+  
+  TCanvas *canvas = new TCanvas("RICHDisplay","RICH Display",0,0,1226,900);   canvas->Divide(3,3);  
+//  gStyle->SetPalette(1);
+
+  
+  for(Int_t iChamber=1;iChamber<=7;iChamber++) {
+    pDigitsH2[iChamber] = new TH2F(Form("pDigitsH2_%i",iChamber),Form("Chamber %i",iChamber),165,0,P()->PcSizeX(),144,0,P()->PcSizeY());
+    pDigitsH2[iChamber]->SetMarkerColor(kGreen); 
+    pDigitsH2[iChamber]->SetMarkerStyle(29); 
+    pDigitsH2[iChamber]->SetMarkerSize(0.4);
+    pDigitsH2[iChamber]->SetStats(kFALSE);
+  }
+  
+  if(iEvtNmax>gAlice->GetEventsPerRun()) iEvtNmax=gAlice->GetEventsPerRun();
+
+  TLatex t;  t.SetTextSize(0.10);
+  t.DrawText(0.1,0.6,"RICH Display");
+  for(Int_t iEventN=iEvtNmin;iEventN<=iEvtNmax;iEventN++) {//events loop
+    canvas->cd(1);
+    t.DrawText(0.2,0.4,Form("Event Number %i",iEventN));        
+
+    GetLoader()->GetRunLoader()->GetEvent(iEventN); //get event
+    GetLoader()->TreeD()->GetEntry(0);              //get list of digits 
+    for(Int_t iChamber=1;iChamber<=7;iChamber++) {//chambers loop
+      pDigitsH2[iChamber]->Reset();    
+      for(Int_t j=0;j<Digits(iChamber)->GetEntries();j++) {//digits loop
+        AliRICHDigit *pDig = (AliRICHDigit*)Digits(iChamber)->At(j);
+        TVector2 x2=AliRICHParam::Pad2Loc(pDig->Pad());
+        pDigitsH2[iChamber]->Fill(x2.X(),x2.Y());
+      }//digits loop
+      if(iChamber==1) canvas->cd(7);
+      if(iChamber==2) canvas->cd(8);
+      if(iChamber==3) canvas->cd(4);
+      if(iChamber==4) canvas->cd(5);
+      if(iChamber==5) canvas->cd(6);
+      if(iChamber==6) canvas->cd(2);
+      if(iChamber==7) canvas->cd(3);
+      pDigitsH2[iChamber]->Draw();
+    }//chambers loop
+    canvas->Update();
+    canvas->Modified();
+    
+    if(iEvtNmin<iEvtNmax) gPad->WaitPrimitive();
+  }//events loop
+}//ShowEvent()
+//__________________________________________________________________________________________________
+void AliRICH::Display()const
+{
+//Provides fast event display
+//For RICH only, full display is .x Display.C    
+  Bool_t isHits    =!GetLoader()->LoadHits();
+  Bool_t isDigits  =!GetLoader()->LoadDigits();
+  Bool_t isClusters=!GetLoader()->LoadRecPoints();
+  
+  if(!isHits && !isDigits && !isClusters){Error("Exec","No hits digits and clusters. Nothing to display.");return;}
+  
+  TCanvas *pCanvas = new TCanvas("Display","RICH Display",0,0,600,600);
+  
+  TH2F *pHitsH2=0,*pDigitsH2=0,*pClustersH2=0;
+  
+  if(isHits)     pHitsH2     = new TH2F("pHitsH2"  ,  "Event Display;x,cm;y,cm",165,0,AliRICHParam::PcSizeX(),
+                                                                                144,0,AliRICHParam::PcSizeY());
+  if(pHitsH2)    pHitsH2->SetStats(kFALSE);
+  
+  if(isDigits)   pDigitsH2   = new TH2F("pDigitsH2"  ,"Event Display",165,0,AliRICHParam::PcSizeX(),
+                                                                      144,0,AliRICHParam::PcSizeY());
+  if(isClusters) pClustersH2 = new TH2F("pClustersH2","Event Display",165,0,AliRICHParam::PcSizeX(),
+                                                                      144,0,AliRICHParam::PcSizeY());
+  
+  for(Int_t iEventN=0;iEventN<gAlice->GetEventsPerRun();iEventN++){//events Loop
+    GetLoader()->GetRunLoader()->GetEvent(iEventN);  
+//display all the staff on chamber by chamber basis           
+    for(Int_t iChamber=1;iChamber<=7;iChamber++){//chambers loop       
+      if(isHits)     pHitsH2    ->Reset();     
+      if(isDigits)   pDigitsH2  ->Reset();     
+      if(isClusters) pClustersH2->Reset();
+//deals with hits
+      for(Int_t i=0;i<GetLoader()->TreeH()->GetEntries();i++){//TreeH loop
+        GetLoader()->TreeH()->GetEntry(i);
+        for(Int_t j=0;j<Hits()->GetEntries();j++){//hits loop
+          AliRICHHit *pHit = (AliRICHHit*)Hits()->At(j);
+          if(pHit->C()==iChamber){
+            TVector3 hitGlobX3= pHit->OutX3();
+            TVector2 hitLocX2 = C(iChamber)->Mrs2Pc(hitGlobX3);
+            pHitsH2->Fill(hitLocX2.X(),hitLocX2.Y(),200);
+          }//if
+        }//hits loop         
+      }//TreeH loop
+      pHitsH2->SetTitle(Form("event %i chamber %2i",iEventN,iChamber));
+      pHitsH2->SetMarkerColor(kRed); pHitsH2->SetMarkerStyle(29); pHitsH2->SetMarkerSize(0.4);
+      pHitsH2->Draw();
+      AliRICHParam::DrawSectors();
+      TLatex l; l.SetNDC(); l.SetTextSize(0.02);
+      if(!isHits)     {l.SetTextColor(kRed)  ;l.DrawLatex(0.1,0.01,"No Hits"    );}
+      if(!isDigits)   {l.SetTextColor(kGreen);l.DrawLatex(0.4,0.01,"No DIGITS"  );}
+      if(!isClusters) {l.SetTextColor(kBlue) ;l.DrawLatex(0.8,0.01,"No CLUSTERS");}
+      pCanvas->Update();        pCanvas->Modified();       gPad->WaitPrimitive();
+//deals with digits      
+      if(isDigits){
+        GetLoader()->TreeD()->GetEntry(0);
+        for(Int_t j=0;j<Digits(iChamber)->GetEntries();j++){//digits loop
+          AliRICHDigit *pDig = (AliRICHDigit*)Digits(iChamber)->At(j);
+         TVector2 x2=AliRICHParam::Pad2Loc(pDig->Pad());
+         pDigitsH2->Fill(x2.X(),x2.Y(),100);
+        }//digits loop
+        pDigitsH2->SetMarkerColor(kGreen); pDigitsH2->SetMarkerStyle(29); pDigitsH2->SetMarkerSize(0.4);
+        pDigitsH2->Draw("same");
+        pCanvas->Update();        pCanvas->Modified();       gPad->WaitPrimitive();
+      }//if(isDigits)      
+//deals with clusters      
+      if(isClusters){
+        GetLoader()->TreeR()->GetEntry(0);
+        for(Int_t j=0;j<Clusters(iChamber)->GetEntries();j++){//clusters loop
+          AliRICHCluster *pClus = (AliRICHCluster*)Clusters(iChamber)->At(j);
+          pClustersH2->Fill(pClus->X(),pClus->Y(),50);
+        }//clusters loop
+        pClustersH2->SetMarkerColor(kBlue); pClustersH2->SetMarkerStyle(29);  pClustersH2->SetMarkerSize(0.4);
+        pClustersH2->Draw("same");
+        pCanvas->Update();        pCanvas->Modified();       gPad->WaitPrimitive();
+      }//if(isClusters)
+    }//chambers loop
+  }//events Loop
+  
+  delete pCanvas;
+  GetLoader()->UnloadHits();
+  if(isDigits)   GetLoader()->UnloadDigits();
+  if(isClusters) GetLoader()->UnloadRecPoints();
+}//Display()
+//__________________________________________________________________________________________________
+Int_t AliRICH::Nparticles(Int_t iPartID,Int_t iEvtN,AliRunLoader *pRL)
+{
+//counts total number of particles of given type (including secondary) for a given event
+  pRL->GetEvent(iEvtN);    
+  if(pRL->LoadHeader()) return 0;
+  if(pRL->LoadKinematics()) return 0;
+  AliStack *pStack=pRL->Stack();
+  
+  Int_t iCounter=0;
+  for(Int_t i=0;i<pStack->GetNtrack();i++){
+    if(pStack->Particle(i)->GetPdgCode()==iPartID) iCounter++;
+  }
+  
+  pRL->UnloadHeader();
+  pRL->UnloadKinematics();
+  return iCounter;
+}
+//__________________________________________________________________________________________________
+
index 3a6bb71..403e16d 100644 (file)
@@ -3,7 +3,7 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-//#include <Riostream.h>
+#include <AliDetector.h>
 #include <TClonesArray.h>
 #include <TObjArray.h>
 #include <TVector.h>
 
 #include "AliRICHDigitizer.h"
 #include "AliRICHParam.h"
-#include <AliDetector.h>
-#include <AliDigit.h>
-#include <AliHit.h>
-
-//__________________AliRICHhit______________________________________________________________________
-class AliRICHhit : public AliHit
-{
-public:
-           AliRICHhit():AliHit(),fChamber(kBad),fEloss(kBad) {fInX3.SetXYZ(0,0,0);fOutX3.SetXYZ(0,0,0);}
-           AliRICHhit(Int_t c,Int_t tid,TVector3 in,TVector3 out,Double_t e):AliHit(0,tid)
-                                          {fChamber=c;fInX3=in; fOutX3=out;fEloss=e; fX=out.X();fY=out.Y();fZ=out.Z();}
-  virtual ~AliRICHhit()                   {;}
-
-  Int_t    C()                       const{return fChamber;}              //chamber number 
-  Int_t    Chamber()                 const{return fChamber;}              //chamber number 
-  Float_t  Eloss()                   const{return fEloss;}                //energy lost by track inside amplification gap  
-  TVector3 InX3()                    const{return fInX3;}                 //track position at the faceplane of the gap 
-  TVector3 OutX3()                   const{return fOutX3;}                //track position at the backplane of the gap 
-  Double_t Length()                  const{return (fOutX3-fInX3).Mag();}  //track length inside the amplification gap
-  void     Print(Option_t *option="")const;                               //virtual
-protected:
-  Int_t     fChamber;                      //chamber number
-  Double_t  fEloss;                        //ionisation energy lost in GAP
-  TVector3  fInX3;                         //position at the entrance of the GAP   
-  TVector3  fOutX3;                        //position at the exit of the GAP
-  ClassDef(AliRICHhit,2)                   //RICH hit class
-};//class AliRICHhit
-
-//__________________AliRICHdigit____________________________________________________________________
-class AliRICHdigit :public AliDigit
-{
-public:
-  AliRICHdigit():AliDigit(),fCFM(0),fChamber(0),fPadX(0),fPadY(0),fQdc(kBad){fTracks[0]=fTracks[1]=fTracks[2]=kBad;}
-  AliRICHdigit(Int_t c,TVector pad,Double_t q,Int_t cfm,Int_t tid0,Int_t tid1,Int_t tid2)  
-       {fPadX=(Int_t)pad[0];fPadY=(Int_t)pad[1];fQdc=q;fChamber=10*c+AliRICHParam::Pad2Sec(pad);fCFM=cfm;fTracks[0]=tid0;fTracks[1]=tid1;fTracks[2]=tid2;}
-  virtual ~AliRICHdigit() {;}  
-  Int_t    Compare(const TObject *pObj) const
-                 {if(Id()==((AliRICHdigit*)pObj)->Id())return 0;else if(Id()>((AliRICHdigit*)pObj)->Id())return 1;else return -1;}  //virtual      
-  virtual Bool_t   IsSortable()                 const{return kTRUE;}                              //sort interface
-  virtual void     Print(Option_t *option="")   const;                                            //virtual
-  Int_t    ChFbMi()                     const{return fCFM;}                               //particle mixture for this digit
-  Int_t    C()                          const{return fChamber/10;}                        //chamber number
-  Int_t    S()                          const{return fChamber-(fChamber/10)*10;}          //sector number
-  Int_t    X()                          const{return fPadX;}                              //x position of the pad
-  Int_t    Y()                          const{return fPadY;}                              //y postion of the pad
-  TVector  Pad()                        const{Float_t v[2]={fPadX,fPadY}; return TVector(2,v);}
-  Int_t    Id()                         const{return fChamber*10000000+fPadX*1000+fPadY;} //absolute id of this pad
-  Double_t Q()                          const{return fQdc;}                               //charge in terms of ADC channels
-  void     AddTidOffset(Int_t offset) 
-    {for (Int_t i=0; i<3; i++) if (fTracks[i]>0) fTracks[i]+=offset;};
-protected:
-  Int_t    fCFM;  //1000000*Ncerenkovs+1000*Nfeedbacks+Nmips  
-  Int_t    fChamber;  //10*chamber number+ sector number 
-  Int_t    fPadX;     //pad number along X
-  Int_t    fPadY;     //pad number along Y
-  Double_t fQdc;      //QDC value, fractions are permitted for summable procedure  
-  ClassDef(AliRICHdigit,3) //RICH digit class       
-};//class AliRICHdigit
-
-//__________________AliRICHcluster__________________________________________________________________
-class AliRICHcluster :public TObject
-{
-public:
-  enum ClusterStatus {kEdge,kShape,kSize,kRaw,kResolved,kEmpty}; 
-                    AliRICHcluster():TObject(),fCFM(0),fSize(0),fShape(0),fQdc(0),fChamber(0),fX(0),fY(0),fStatus(kEmpty),fDigits(0) {}    
-  virtual          ~AliRICHcluster()                 {AliDebug(1,"Start");/*Reset();*/}  
-         void       Reset()                          {DeleteDigits();fCFM=fSize=fShape=fQdc=fChamber=0;fX=fY=0;fStatus=kEmpty;} //cleans the cluster
-         void       DeleteDigits()                   {if(fDigits) {delete fDigits;} fDigits=0;}           //deletes the list of digits  
-  AliRICHcluster&   operator=(const AliRICHcluster&) {return *this;}                                 
-         Int_t      Nlocals()                   const{return fSize-10000*(fSize/10000);}                //number of local maximums
-         Int_t      Size()                      const{return fSize/10000;}                              //number of digits in cluster
-         Int_t      Fsize()                     const{return fSize;}                                    //
-         Int_t      Shape()                     const{return fShape;}                                   //cluster shape rectangulare
-         Int_t      C()                         const{return fChamber/10;}                              //chamber number
-         Int_t      S()                         const{return fChamber-(fChamber/10)*10;}                //sector number
-         Int_t      Fchamber()                  const{return fChamber;}                                 //
-         Int_t      Q()                         const{return fQdc;}                                     //cluster charge in QDC channels 
-         Double_t   X()                         const{return fX;}                                       //cluster x position in LRS
-         Double_t   Y()                         const{return fY;}                                       //cluster y position in LRS 
-         Int_t      Status()                    const{return fStatus;}                                  //
-         void       SetStatus(Int_t status)         {fStatus=status;}                                     //
-         Int_t      Nmips()                     const{return fCFM-1000000*Ncerenkovs()-1000*Nfeedbacks();} //
-         Int_t      Ncerenkovs()                const{return fCFM/1000000;}                                //
-         Int_t      Nfeedbacks()                const{return (fCFM-1000000*Ncerenkovs())/1000;}            //
-         Bool_t     IsPureMip()                 const{return fCFM<1000;}                                   //
-         Bool_t     IsPureCerenkov()            const{return Nmips()==0&&Nfeedbacks()==0;}                 //
-         Bool_t     IsPureFeedback()            const{return Nmips()==0&&Ncerenkovs()==0;}                 //
-         Bool_t     IsSingleMip()               const{return Nmips()==1&&Ncerenkovs()==0&&Nfeedbacks()==0;}  //
-         Bool_t     IsSingleCerenkov()          const{return Nmips()==0&&Ncerenkovs()==1&&Nfeedbacks()==0;}  //
-         Bool_t     IsSingleFeedback()          const{return Nmips()==0&&Ncerenkovs()==0&&Nfeedbacks()==1;}  //
-         Bool_t     IsMip()                     const{return Nmips()!=0;}                                  //
-         Bool_t     IsCerenkov()                const{return Ncerenkovs()!=0;}                             //
-         Bool_t     IsFeedback()                const{return Nfeedbacks()!=0;}                             //
-         Int_t      CombiPid()                  const{return fCFM;}                                        //
-         void       CFM(Int_t c,Int_t f,Int_t m)     {fCFM=1000000*c+1000*f+m;}                            //cluster contributors
-         TObjArray* Digits()                    const{return fDigits;}                                     //  
-  virtual void      Print(Option_t *option="")const;                                                   //
-  inline  void      AddDigit(AliRICHdigit *pDig);                                                      //
-  inline  void      CoG(Int_t nLocals);                                                                //calculates center of gravity
-          void      Fill(AliRICHcluster *pRaw,Double_t x,Double_t y,Double_t q,Int_t cfm)              //form new resolved cluster from raw one
-                    {fCFM=cfm;fChamber=pRaw->Fchamber();fSize=pRaw->Fsize();fQdc=(Int_t)(q*pRaw->Q());fX=x;fY=y;fStatus=kResolved;} 
-         Double_t   DistTo(TVector2 x)          const{return TMath::Sqrt((x.X()-fX)*(x.X()-fX)+(x.Y()-fY)*(x.Y()-fY));} //distance to given point 
-         Double_t   DistX(TVector2 x)           const{return (x.X()-fX);} //distance in x to given point 
-         Double_t   DistY(TVector2 x)           const{return (x.Y()-fY);} //distance to given point 
-protected:
-  Int_t         fCFM;         //1000000*Ncerenkovs+1000*Nfeedbacks+Nmips  
-  Int_t         fSize;        //10000*(how many digits belong to this cluster) + nLocalMaxima     
-  Int_t         fShape;       //100*xdim+ydim box containing the cluster
-  Int_t         fQdc;         //QDC value
-  Int_t         fChamber;     //10*module number+sector number 
-  Double_t      fX;           //local x postion 
-  Double_t      fY;           //local y postion  
-  Int_t         fStatus;      //flag to mark the quality of the cluster   
-  TObjArray    *fDigits;      //! list of digits forming this cluster
-  ClassDef(AliRICHcluster,2)  //RICH cluster class       
-};//class AliRICHcluster
-//__________________________________________________________________________________________________
-void AliRICHcluster::AddDigit(AliRICHdigit *pDig)
-{
-// Adds a given digit to the list of digits belonging to this cluster    
-  if(!fDigits) {fQdc=fSize=fCFM=0;fDigits = new TObjArray;}
-  fQdc+=(Int_t)pDig->Q(); fDigits->Add(pDig);
-  fChamber=10*pDig->C()+pDig->S();
-  fSize+=10000;
-  fStatus=kRaw;
-}
-//__________________________________________________________________________________________________
-void AliRICHcluster::CoG(Int_t nLocals)
-{
-// Calculates naive cluster position as a center of gravity of its digits.
-  Float_t xmin=999,ymin=999,xmax=0,ymax=0;   
-  fX=fY=0;
-  for(Int_t iDig=0;iDig<Size();iDig++) {
-    AliRICHdigit *pDig=(AliRICHdigit*)fDigits->At(iDig);
-    TVector pad=pDig->Pad(); Double_t q=pDig->Q();
-    TVector2 x2=AliRICHParam::Pad2Loc(pad);
-    fX += x2.X()*q;fY +=x2.Y()*q;
-    if(pad[0]<xmin)xmin=pad[0];if(pad[0]>xmax)xmax=pad[0];if(pad[1]<ymin)ymin=pad[1];if(pad[1]>ymax)ymax=pad[1];
-   }
-   fX/=fQdc;fY/=fQdc;//Center of Gravity
-
-   TVector2 center = AliRICHParam::Pad2Loc(AliRICHParam::Loc2Pad(TVector2(fX,fY)));
-   fX += AliRICHParam::CogCorr(fX-center.X());
-
-   fShape=Int_t(100*(xmax-xmin+1)+ymax-ymin+1);//find box containing cluster
-   fSize+=nLocals;
-   fStatus=kRaw;
-}//CoG()
+#include "AliRICHCluster.h"
+#include "AliRICHHit.h"
 
 //__________________AliRICH_________________________________________________________________________
 class AliESD;
@@ -183,105 +37,93 @@ public:
   virtual void          MakeBranch(Option_t *opt=" ");                                                   //interface from AliLoader
   virtual void          CreateMaterials();                                                               //interface from AliMC
   virtual void          CreateGeometry();                                                                //interface from AliMC
+  virtual void          BuildGeometry();                                                                 //interface 
+  virtual void          Print(Option_t *option="")               const;       //prints current RICH status
+//private part  
           void          GeomPadPanelFrame()const;                                                        //defines PPF geometry
           void          GeomAmpGap()       const;                                                        //defines gap geometry + anod wires
           void          GeomRadiators()    const;                                                        //defines radiators geometry
           void          GeomSandBox()      const;                                                        //defines sandbox geometry
           void          GeomRadioSrc()     const;                                                        //defines radio source geometry
           void          GeomAerogel()      const;                                                        //defines aerogel geometry
-  virtual void          BuildGeometry();                                                                 //interface 
-//private part  
   static  Float_t Fresnel(Float_t ene,Float_t pdoti, Bool_t pola);       //deals with Fresnel absorption
-  inline  void    CreateHits();                                          //create hits container as a simple list
-  inline  void    CreateSDigits();                                       //create sdigits container as a simple list
-  inline  void    CreateDigits();                                        //create digits container as 7 lists, one per chamber
-  inline  void    CreateClusters();                                      //create clusters container  as 7 lists, one per chamber
-          void    ResetSDigits()             {fNsdigits=0;  if(fSdigits)  fSdigits ->Clear();}                                 
-          void    ResetDigits()              {if(fDigitsNew)for(int i=0;i<kNchambers;i++){fDigitsNew->At(i)->Clear();fNdigitsNew[i]=0;}} //virtual
-          void    ResetClusters()            {if(fClusters) for(int i=0;i<kNchambers;i++){fClusters ->At(i)->Clear();fNclusters[i]=0;}}
-  TClonesArray*   SDigits()             const{return fSdigits;}
-  TClonesArray*   Digits(Int_t iC)      const{if(fDigitsNew) return (TClonesArray *)fDigitsNew->At(iC-1);else return 0;}
-  TClonesArray*   Clusters(Int_t iC)    const{if(fClusters)  return (TClonesArray *)fClusters->At(iC-1);else return 0;}
-  AliRICHChamber* C(Int_t iC)           const{return fpParam->C(iC);}   //provides pointer to a given chamber
-  AliRICHParam*   P()                   const{return fpParam;}          //provides pointer to a RICH params
+  
+         AliRICHHit*   Hit           (Int_t tid                                              )const;                                                 //first hit of given TID 
+  inline void          HitAdd        (Int_t c,Int_t tid,TVector3 in,TVector3 out,Double_t e=0);                                                      //add new hit
+  inline void          HitsCreate    (                                                       );                                                      //create hits container
+         void          HitsPrint     (Int_t iEvent=0                                         )const;                                                 //prints hits
+            
+         TClonesArray* SDigits       (                                                       )const{return fSdigits;}                                //pointer to sdigits list 
+  inline void          SDigitAdd     (Int_t c,TVector pad,Double_t q,Int_t pid,Int_t tid     )     ;                                                 //add new sdigit
+  inline void          SDigitsCreate (                                                       )     ;                                                 //create sdigits container
+         void          SDigitsReset  (                                                       )     {fNsdigits=0;  if(fSdigits)  fSdigits ->Clear();} //clean a list of sdigits                                
+         void          SDigitsPrint  (Int_t iEvent=0                                         )const;                                                 //prints sdigits 
+         
+    using AliDetector::Digits;  
+         TClonesArray* Digits        (Int_t iC                                               )const{return fDigs ? (TClonesArray *)fDigs->At(iC-1):0;}
+  inline void          DigitAdd      (Int_t c,TVector pad,int q,int cfm,int *tid             )     ;                                                 //add new digit
+  inline void          DigitsCreate  (                                                       )     ;                                                 //create digits
+         void          DigitsReset   (                                                       )     {if(fDigs)for(int i=0;i<kNchambers;i++){fDigs->At(i)->Clear();fNdigs[i]=0;}} //virtual
+         void          DigitsPrint   (Int_t iEvent=0                                         )const;                                                 //prints digits
+          
+         TClonesArray* Clusters      (Int_t iC                                               )const{if(fClus)  return (TClonesArray *)fClus->At(iC-1);else return 0;}
+  inline void          ClusterAdd    (AliRICHCluster &cl                                     )     ;                                                  //add new cluster                        
+  inline void          ClustersCreate(                                                       )     ;                                                  //create clusters container
+         void          ClustersReset (                                                       )     {if(fClus)for(int i=0;i<kNchambers;i++){fClus ->At(i)->Clear();fNclus[i]=0;}}
+         void          ClustersPrint (Int_t iEvent=0                                         )const;                        //prints a list of clusters for a given event
+         
+  AliRICHChamber* C(Int_t iC)           const{return fParam->C(iC);}   //provides pointer to a given chamber
+  AliRICHParam*   P()                   const{return fParam;}          //provides pointer to a RICH params
   AliRICH*        R()                        {return this;}             //provides pointer to RICH main object
   TVector         Counters()            const{return fCounters;}        //provides a set of counters
   void            ControlPlots();                                       //creates ~/RCP.root with a set of QA plots
-  virtual void    Print(Option_t *option="")               const;       //prints current RICH status
-  void            PrintHits    (Int_t iEvent=0);                        //prints a list of hits for a given event
-  void            PrintSDigits (Int_t iEvent=0);                        //prints a list of sdigits for a given event
-  void            PrintDigits  (Int_t iEvent=0);                        //prints a list of digits for a given event
-  void            PrintClusters(Int_t iEvent=0);                        //prints a list of clusters for a given event
+  void            Display()const; //Display event
+  void            DisplayEvent(Int_t,Int_t)const; //Display event
+  static Int_t     Nparticles(Int_t iPid,Int_t iEventN,AliRunLoader *pRunLoader); //counts total number of particle with iPid
   void            PrintTracks  (Int_t iEvent=0);                        //prints a list of tracks for a given event
   void            CheckPR      ()const;                                 //utility-> run staff for stack ??????     
-  AliRICHhit*     Hit(Int_t tid)const;                                  //returns pointer of the first RICH hit created by a given particle 
-  inline void AddHit(Int_t chamber,Int_t tid,TVector3 in3,TVector3 out3,Double_t eloss=0);           //add new hit
-  inline void AddSDigit(Int_t c,TVector pad,Double_t q,Int_t pid,Int_t tid);                         //add new sdigit
-  inline void AddDigit(int c,TVector pad,int q,int cfm,int *tid);                                    //add new digit
-//  void AddDigit(Int_t c,TVector pad,Int_t q)//for real data digits
-//       {TClonesArray &tmp=*((TClonesArray*)fDigitsNew->At(0));new(tmp[fNdigitsNew[0]++])AliRICHdigit(c,pad,q,0,-1,-1,-1);}  
-  inline void AddCluster(AliRICHcluster &cl);                                                        //add new cluster                        
-  using AliModule::AddHit;                                              //to get rid of virtual hidden warning
-  using AliModule::AddDigit;                                            //to get rid of virtual hidden warning 
-  using AliModule::Digits;                                              //to get rid of virtual hidden warning 
 protected:  
   enum                  EMedia {kAir=1,kRoha,kSiO2,kC6F14,kCH4,kCsI,kGridCu,kOpSiO2,kGap,kAl,kGlass,kCu,kW,kSteel,kPerpex,kSr90,kMylar,kGel,kReflector};
   enum                  ECounters {kStepManager=0,kCerProdTot,kCerProdRad,kCerKillTot,kCerKillRad,kCerKillRef,kEleProdTot};
-  AliRICHParam         *fpParam;                   //main RICH parametrization     
+  AliRICHParam         *fParam;                    //main RICH parametrization     
                                                    //fHits and fDigits belong to AliDetector
   TClonesArray         *fSdigits;                  //! list of sdigits  
   Int_t                 fNsdigits;                 //! current number of sdigits
   
-  TObjArray            *fDigitsNew;                //! each chamber holds it's one lists of digits
-  Int_t                 fNdigitsNew[7];            //! array of current numbers of digits
+  TObjArray            *fDigs;                     //! each chamber holds it's one lists of digits
+  Int_t                 fNdigs[7];                 //! array of current numbers of digits
   
-  TObjArray            *fClusters;                 //! each chamber holds it's one lists of clusters 
-  Int_t                 fNclusters[7];             //! array of current numbers of raw clusters
+  TObjArray            *fClus;                     //! each chamber holds it's one lists of clusters 
+  Int_t                 fNclus[7];                 //! array of current numbers of raw clusters
   
   TVector               fCounters;                 //Particle history counters, explanation in StepManager() 
   
-  ClassDef(AliRICH,7)                              //Main RICH class 
+  ClassDef(AliRICH,9)                              //Main RICH class 
 };//class AliRICH  
 
 //__________________________________________________________________________________________________
-void AliRICH::CreateHits()
+void AliRICH::HitsCreate()
 {
   if(fHits) return;
   AliDebug(1,"creating hits container.");
-  fHits=new TClonesArray("AliRICHhit",10000);   fNhits=0;
-}
-//__________________________________________________________________________________________________
-void AliRICH::CreateSDigits()
-{
-  if(fSdigits) return;
-  AliDebug(1,"creating sdigits container.");
-  fSdigits=new TClonesArray("AliRICHdigit",10000); fNsdigits=0;
+  fHits=new TClonesArray("AliRICHHit",10000);   fNhits=0;
 }
 //__________________________________________________________________________________________________
-void AliRICH::CreateDigits()
-{
-  if(fDigitsNew) return;
-  AliDebug(1,"creating digits containers.");
-  fDigitsNew = new TObjArray(kNchambers);  
-  for(Int_t i=0;i<kNchambers;i++) {fDigitsNew->AddAt(new TClonesArray("AliRICHdigit",10000), i); fNdigitsNew[i]=0;}
-}
-//__________________________________________________________________________________________________
-void AliRICH::CreateClusters()
-{
-  if(fClusters) return;
-  AliDebug(1,"creating clusters containers.");
-  fClusters = new TObjArray(kNchambers);  
-  for(Int_t i=0;i<kNchambers;i++) {fClusters->AddAt(new TClonesArray("AliRICHcluster",10000), i); fNclusters[i]=0;}
-}
-//__________________________________________________________________________________________________
-void AliRICH::AddHit(Int_t c,Int_t tid,TVector3 i3,TVector3 o3,Double_t eloss)
+void AliRICH::HitAdd(Int_t c,Int_t tid,TVector3 i3,TVector3 o3,Double_t eloss)
 {
 //add new RICH hit to the list of hits  
   TClonesArray &tmp=*fHits;
-  new(tmp[fNhits++])AliRICHhit(c,tid,i3,o3,eloss);
+  new(tmp[fNhits++])AliRICHHit(c,tid,i3,o3,eloss);
 }//AddHit()
 //__________________________________________________________________________________________________
-void AliRICH::AddSDigit(Int_t c,TVector pad,Double_t q,Int_t pid,Int_t tid) 
+void AliRICH::SDigitsCreate()
+{
+  if(fSdigits) return;
+  AliDebug(1,"creating sdigits container.");
+  fSdigits=new TClonesArray("AliRICHDigit",10000); fNsdigits=0;
+}
+//__________________________________________________________________________________________________
+void AliRICH::SDigitAdd(Int_t c,TVector pad,Double_t q,Int_t pid,Int_t tid) 
 { 
   Int_t cfm;  
   switch(pid){
@@ -289,18 +131,35 @@ void AliRICH::AddSDigit(Int_t c,TVector pad,Double_t q,Int_t pid,Int_t tid)
     case 50000051: cfm=1000;   break;//feedback
     default:       cfm=1;      break;//mip
   }   
-  TClonesArray &tmp=*fSdigits; new(tmp[fNsdigits++])AliRICHdigit(c,pad,q,cfm,tid,kBad,kBad);
+  TClonesArray &tmp=*fSdigits; new(tmp[fNsdigits++])AliRICHDigit(c,pad,q,cfm,tid,-1,-1);
 }
 //__________________________________________________________________________________________________
-void AliRICH::AddDigit(int c,TVector pad,int q,int cfm,int *tid)
+void AliRICH::DigitsCreate()
 {
-  TClonesArray &tmp=*((TClonesArray*)fDigitsNew->At(c-1));
-  new(tmp[fNdigitsNew[c-1]++])AliRICHdigit(c,pad,q,cfm,tid[0],tid[1],tid[2]);
+  if(fDigs) return;
+  AliDebug(1,"creating digits containers.");
+  fDigs = new TObjArray(kNchambers);  
+  for(Int_t i=0;i<kNchambers;i++) {fDigs->AddAt(new TClonesArray("AliRICHDigit",10000), i); fNdigs[i]=0;}
+}
+//__________________________________________________________________________________________________
+void AliRICH::DigitAdd(int c,TVector pad,int q,int cfm,int *tid)
+{
+  TClonesArray &tmp=*((TClonesArray*)fDigs->At(c-1));
+  new(tmp[fNdigs[c-1]++])AliRICHDigit(c,pad,q,cfm,tid[0],tid[1],tid[2]);
 }    
 //__________________________________________________________________________________________________
-void AliRICH::AddCluster(AliRICHcluster &cl)                     
+void AliRICH::ClustersCreate()
+{
+  if(fClus) return;
+  AliDebug(1,"creating clusters containers.");
+  fClus = new TObjArray(kNchambers);  
+  for(Int_t i=0;i<kNchambers;i++) {fClus->AddAt(new TClonesArray("AliRICHCluster",10000), i); fNclus[i]=0;}
+}
+//__________________________________________________________________________________________________
+void AliRICH::ClusterAdd(AliRICHCluster &cl)                     
 {
-  Int_t c=cl.C()-1;TClonesArray &tmp=*((TClonesArray*)fClusters->At(c));
-  new(tmp[fNclusters[c]++])AliRICHcluster(cl);
+  Int_t c=cl.C()-1;TClonesArray &tmp=*((TClonesArray*)fClus->At(c));
+  new(tmp[fNclus[c]++])AliRICHCluster(cl);
 }
+//__________________________________________________________________________________________________
 #endif//#ifndef AliRICH_h
diff --git a/RICH/AliRICHCluster.cxx b/RICH/AliRICHCluster.cxx
new file mode 100644 (file)
index 0000000..479c9a4
--- /dev/null
@@ -0,0 +1,39 @@
+//  **************************************************************************
+//  * 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.                  *
+//  **************************************************************************
+
+#include "AliRICHCluster.h"
+#include <AliLog.h>
+
+ClassImp(AliRICHCluster)
+//__________________________________________________________________________________________________
+void AliRICHCluster::Print(Option_t*)const
+{
+//Print current cluster  
+  const char *status=0;
+  switch(fStatus){
+    case      kRaw: status="raw"     ;break;
+    case kResolved: status="resolved";break;
+    case    kEmpty: status="empty"   ;break;
+  }
+  if(fDigits)    
+    ::Info("cluster","cfm=%10i, cs=%2i, SiMa=%6i, Shape=%5i, x=%7.3f, y=%7.3f, Q=%6i, %s with %i digits",
+                             fCFM,fChamber,fSize,fShape,fX,fY,fQdc,status,fDigits->GetEntriesFast());
+  else
+    AliInfo(Form("cfm=%10i, cs=%2i, SiMa=%6i, Shape=%5i, x=%7.3f, y=%7.3f, Q=%6i, %s with %i digits",
+                             fCFM,fChamber,fSize,fShape,fX,fY,fQdc,status,0));
+    
+}//Print()
+//__________________________________________________________________________________________________
diff --git a/RICH/AliRICHCluster.h b/RICH/AliRICHCluster.h
new file mode 100644 (file)
index 0000000..f4b339b
--- /dev/null
@@ -0,0 +1,104 @@
+#ifndef AliRICHCluster_h
+#define AliRICHCluster_h
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+#include <TObject.h>
+#include <TVector.h>
+#include <TVector2.h>
+#include "AliRICHDigit.h"
+
+class AliRICHCluster :public TObject
+{
+public:
+  enum ClusterStatus {kEdge,kShape,kSize,kRaw,kResolved,kEmpty}; 
+                    AliRICHCluster():TObject(),fCFM(0),fSize(0),fShape(0),fQdc(0),fChamber(0),fX(0),fY(0),fStatus(kEmpty),fDigits(0) {}  //default ctor  
+  virtual          ~AliRICHCluster()                 {AliDebug(1,"Start");/*Reset();*/}                                                  //dtor
+                   // AliRICHcluster(const AliRICHcluster& clus):TObject(clus)                                                         {}  //copy ctor 
+   AliRICHCluster&  operator=(const AliRICHCluster&)                 {return *this;}                                                     //copy operator
+                   
+  
+  
+         void       Reset()                          {DeleteDigits();fCFM=fSize=fShape=fQdc=fChamber=0;fX=fY=0;fStatus=kEmpty;} //cleans the cluster
+         void       DeleteDigits()                   {if(fDigits) {delete fDigits;} fDigits=0;}           //deletes the list of digits  
+         Int_t      Nlocals()                   const{return fSize-10000*(fSize/10000);}                //number of local maximums
+         Int_t      Size()                      const{return fSize/10000;}                              //number of digits in cluster
+         Int_t      Fsize()                     const{return fSize;}                                    //
+         Int_t      Shape()                     const{return fShape;}                                   //cluster shape rectangulare
+         Int_t      C()                         const{return fChamber/10;}                              //chamber number
+         Int_t      S()                         const{return fChamber-(fChamber/10)*10;}                //sector number
+         Int_t      Fchamber()                  const{return fChamber;}                                 //
+         Int_t      Q()                         const{return fQdc;}                                     //cluster charge in QDC channels 
+         Double_t   X()                         const{return fX;}                                       //cluster x position in LRS
+         Double_t   Y()                         const{return fY;}                                       //cluster y position in LRS 
+         Int_t      Status()                    const{return fStatus;}                                  //
+         void       SetStatus(Int_t status)         {fStatus=status;}                                     //
+         Int_t      Nmips()                     const{return fCFM-1000000*Ncerenkovs()-1000*Nfeedbacks();} //
+         Int_t      Ncerenkovs()                const{return fCFM/1000000;}                                //
+         Int_t      Nfeedbacks()                const{return (fCFM-1000000*Ncerenkovs())/1000;}            //
+         Bool_t     IsPureMip()                 const{return fCFM<1000;}                                   //
+         Bool_t     IsPureCerenkov()            const{return Nmips()==0&&Nfeedbacks()==0;}                 //
+         Bool_t     IsPureFeedback()            const{return Nmips()==0&&Ncerenkovs()==0;}                 //
+         Bool_t     IsSingleMip()               const{return Nmips()==1&&Ncerenkovs()==0&&Nfeedbacks()==0;}  //
+         Bool_t     IsSingleCerenkov()          const{return Nmips()==0&&Ncerenkovs()==1&&Nfeedbacks()==0;}  //
+         Bool_t     IsSingleFeedback()          const{return Nmips()==0&&Ncerenkovs()==0&&Nfeedbacks()==1;}  //
+         Bool_t     IsMip()                     const{return Nmips()!=0;}                                  //
+         Bool_t     IsCerenkov()                const{return Ncerenkovs()!=0;}                             //
+         Bool_t     IsFeedback()                const{return Nfeedbacks()!=0;}                             //
+         Int_t      CombiPid()                  const{return fCFM;}                                        //
+         void       CFM(Int_t c,Int_t f,Int_t m)     {fCFM=1000000*c+1000*f+m;}                            //cluster contributors
+         TObjArray* Digits()                    const{return fDigits;}                                     //  
+  virtual void      Print(Option_t *option="")const;                                                   //
+  inline  void      AddDigit(AliRICHDigit *pDig);                                                      //
+  inline  void      CoG(Int_t nLocals);                                                                //calculates center of gravity
+          void      Fill(AliRICHCluster *pRaw,Double_t x,Double_t y,Double_t q,Int_t cfm)              //form new resolved cluster from raw one
+                    {fCFM=cfm;fChamber=pRaw->Fchamber();fSize=pRaw->Fsize();fQdc=(Int_t)(q*pRaw->Q());fX=x;fY=y;fStatus=kResolved;} 
+         Double_t   DistTo(TVector2 x)          const{return TMath::Sqrt((x.X()-fX)*(x.X()-fX)+(x.Y()-fY)*(x.Y()-fY));} //distance to given point 
+         Double_t   DistX(TVector2 x)           const{return (x.X()-fX);} //distance in x to given point 
+         Double_t   DistY(TVector2 x)           const{return (x.Y()-fY);} //distance to given point 
+protected:
+  Int_t         fCFM;         //1000000*Ncerenkovs+1000*Nfeedbacks+Nmips  
+  Int_t         fSize;        //10000*(how many digits belong to this cluster) + nLocalMaxima     
+  Int_t         fShape;       //100*xdim+ydim box containing the cluster
+  Int_t         fQdc;         //QDC value
+  Int_t         fChamber;     //10*module number+sector number 
+  Double_t      fX;           //local x postion 
+  Double_t      fY;           //local y postion  
+  Int_t         fStatus;      //flag to mark the quality of the cluster   
+  TObjArray    *fDigits;      //! list of digits forming this cluster
+  ClassDef(AliRICHCluster,2)  //RICH cluster class       
+};//class AliRICHCluster
+//__________________________________________________________________________________________________
+void AliRICHCluster::AddDigit(AliRICHDigit *pDig)
+{
+// Adds a given digit to the list of digits belonging to this cluster    
+  if(!fDigits) {fQdc=fSize=fCFM=0;fDigits = new TObjArray;}
+  fQdc+=(Int_t)pDig->Q(); fDigits->Add(pDig);
+  fChamber=10*pDig->C()+pDig->S();
+  fSize+=10000;
+  fStatus=kRaw;
+}
+//__________________________________________________________________________________________________
+void AliRICHCluster::CoG(Int_t nLocals)
+{
+// Calculates naive cluster position as a center of gravity of its digits.
+  Float_t xmin=999,ymin=999,xmax=0,ymax=0;   
+  fX=fY=0;
+  for(Int_t iDig=0;iDig<Size();iDig++) {
+    AliRICHDigit *pDig=(AliRICHDigit*)fDigits->At(iDig);
+    TVector pad=pDig->Pad(); Double_t q=pDig->Q();
+    TVector2 x2=AliRICHParam::Pad2Loc(pad);
+    fX += x2.X()*q;fY +=x2.Y()*q;
+    if(pad[0]<xmin)xmin=pad[0];if(pad[0]>xmax)xmax=pad[0];if(pad[1]<ymin)ymin=pad[1];if(pad[1]>ymax)ymax=pad[1];
+   }
+   fX/=fQdc;fY/=fQdc;//Center of Gravity
+
+   TVector2 center = AliRICHParam::Pad2Loc(AliRICHParam::Loc2Pad(TVector2(fX,fY)));
+   fX += AliRICHParam::CogCorr(fX-center.X());
+
+   fShape=Int_t(100*(xmax-xmin+1)+ymax-ymin+1);//find box containing cluster
+   fSize+=nLocals;
+   fStatus=kRaw;
+}//CoG()
+//__________________________________________________________________________________________________
+#endif
index 5b70a4a..858024b 100644 (file)
@@ -28,9 +28,10 @@ void RICHMinMathieson(Int_t &npar, Double_t *gin, Double_t &chi2, Double_t *par,
 
 ClassImp(AliRICHClusterFinder)
 //__________________________________________________________________________________________________
-AliRICHClusterFinder::AliRICHClusterFinder(AliRICH *pRICH)   
+AliRICHClusterFinder::AliRICHClusterFinder(AliRunLoader *pRunLoader)   
 {//main ctor
-  fRICH = pRICH;
+  fRICH = (AliRICH*) pRunLoader->GetAliRun()->GetDetector("RICH");
+
   AliDebug(1,"main ctor Start.");
   
   fDigitMap = 0;
@@ -53,7 +54,7 @@ void AliRICHClusterFinder::Exec(const Option_t *)
     R()->GetLoader()->GetRunLoader()->GetEvent(iEventN);
     
     R()->GetLoader()->MakeTree("R");  R()->MakeBranch("R");
-    R()->ResetDigits();               R()->ResetClusters();
+    R()->ResetDigits();               R()->ClustersReset();
     
     R()->GetLoader()->TreeD()->GetEntry(0);
     for(Int_t iChamber=1;iChamber<=kNchambers;iChamber++){//chambers loop
@@ -63,7 +64,7 @@ void AliRICHClusterFinder::Exec(const Option_t *)
   }//events loop  
   
   R()->ResetDigits();//reset and unload everything
-  R()->ResetClusters();
+  R()->ClustersReset();
   R()->GetLoader()                ->UnloadDigits(); 
   R()->GetLoader()                ->UnloadRecPoints();  
 //  R()->GetLoader()->GetRunLoader()->UnloadHeader();
@@ -83,7 +84,7 @@ void AliRICHClusterFinder::FindClusters(Int_t iChamber)
   fDigitMap=new AliRICHMap(R()->Digits(iChamber));//create digit map for the given chamber
 
   for(Int_t iDigN=0;iDigN<iNdigits;iDigN++){//digits loop for a given chamber    
-    AliRICHdigit *dig=(AliRICHdigit*)R()->Digits(iChamber)->At(iDigN);
+    AliRICHDigit *dig=(AliRICHDigit*)R()->Digits(iChamber)->At(iDigN);
     Int_t i=dig->X();   Int_t j=dig->Y();
     if(fDigitMap->TestHit(i,j)==kUsed) continue;//this digit is already taken, go after next digit
        
@@ -105,7 +106,7 @@ void AliRICHClusterFinder::FindClusters(Int_t iChamber)
   AliDebug(1,"Stop.");  
 }//FindClusters()
 //__________________________________________________________________________________________________
-void AliRICHClusterFinder::FindClusterContribs(AliRICHcluster *pCluster)
+void AliRICHClusterFinder::FindClusterContribs(AliRICHCluster *pCluster)
 {
 //Finds cerenkov-feedback-mip mixture for a given cluster
   AliDebug(1,"Start.");ToAliDebug(1,pCluster->Print());
@@ -122,11 +123,11 @@ void AliRICHClusterFinder::FindClusterContribs(AliRICHcluster *pCluster)
   TArrayI contribs(3*pCluster->Size());
   Int_t *pindex = new Int_t[3*pCluster->Size()];
   for(Int_t iDigN=0;iDigN<pCluster->Size();iDigN++) {//loop on digits of a given cluster
-    contribs[3*iDigN]  =((AliRICHdigit*)pDigits->At(iDigN))->GetTrack(0);
+    contribs[3*iDigN]  =((AliRICHDigit*)pDigits->At(iDigN))->GetTrack(0);
     if (contribs[3*iDigN] >= 10000000) contribs[3*iDigN] = 0;
-    contribs[3*iDigN+1]=((AliRICHdigit*)pDigits->At(iDigN))->GetTrack(1);
+    contribs[3*iDigN+1]=((AliRICHDigit*)pDigits->At(iDigN))->GetTrack(1);
     if (contribs[3*iDigN+1] >= 10000000) contribs[3*iDigN+1] = 0;
-    contribs[3*iDigN+2]=((AliRICHdigit*)pDigits->At(iDigN))->GetTrack(2);
+    contribs[3*iDigN+2]=((AliRICHDigit*)pDigits->At(iDigN))->GetTrack(2);
     if (contribs[3*iDigN+2] >= 10000000) contribs[3*iDigN+2] = 0;
   }//loop on digits of a given cluster
   TMath::Sort(contribs.GetSize(),contribs.GetArray(),pindex);
@@ -145,7 +146,7 @@ void AliRICHClusterFinder::FindClusterContribs(AliRICHcluster *pCluster)
     }
   }//loop on digits to sort Tid
   
-  if (contribs[pindex[3*pCluster->Size()-1]]!=kBad) {
+  if (contribs[pindex[3*pCluster->Size()-1]]!=-1) {
 
      TParticle* particle = pStack->Particle(contribs[pindex[3*pCluster->Size()-1]]);
      Int_t code   = particle->GetPdgCode();
@@ -167,9 +168,9 @@ void AliRICHClusterFinder::FindClusterContribs(AliRICHcluster *pCluster)
 void  AliRICHClusterFinder::FormRawCluster(Int_t i, Int_t j)
 {
 //Builds the raw cluster (before deconvolution). Starts from the first pad (i,j) then calls itself recursevly  for all neighbours.
-  AliDebug(1,Form("Start with digit(%i,%i) Q=%f",i,j,((AliRICHdigit*)fDigitMap->GetHit(i,j))->Q()));
+  AliDebug(1,Form("Start with digit(%i,%i) Q=%f",i,j,((AliRICHDigit*)fDigitMap->GetHit(i,j))->Q()));
   
-  fRawCluster.AddDigit((AliRICHdigit*) fDigitMap->GetHit(i,j));//take this pad in cluster
+  fRawCluster.AddDigit((AliRICHDigit*) fDigitMap->GetHit(i,j));//take this pad in cluster
   fDigitMap->FlagHit(i,j);//flag this pad as taken  
 
   Int_t listX[4], listY[4];    //  Now look recursively for all neighbours
@@ -184,13 +185,13 @@ void AliRICHClusterFinder::FindLocalMaxima()
   AliDebug(1,Form("Cluster size of the Raw cluster ---> %i",fRawCluster.Size()));
   for(Int_t iDig1=0;iDig1<fRawCluster.Size();iDig1++) {
     Int_t iNotMax = 0;
-    AliRICHdigit *pDig1 = (AliRICHdigit *)fRawCluster.Digits()->At(iDig1);
+    AliRICHDigit *pDig1 = (AliRICHDigit *)fRawCluster.Digits()->At(iDig1);
     if(!pDig1) {fNlocals=0;return;}
     TVector pad1 = pDig1->Pad();
     Int_t padQ1 = (Int_t)(pDig1->Q()+0.1);
     Int_t padC1 = pDig1->ChFbMi();
     for(Int_t iDig2=0;iDig2<fRawCluster.Size();iDig2++) {
-      AliRICHdigit *pDig2 = (AliRICHdigit *)fRawCluster.Digits()->At(iDig2);
+      AliRICHDigit *pDig2 = (AliRICHDigit *)fRawCluster.Digits()->At(iDig2);
       if(!pDig2) {fNlocals=0;return;}
       TVector pad2 = pDig2->Pad();
       Int_t padQ2 = (Int_t)(pDig2->Q()+0.1);
@@ -219,7 +220,7 @@ void AliRICHClusterFinder::WriteRawCluster()
   AliDebug(1,"Start.");
   
   FindClusterContribs(&fRawCluster);  
-  R()->AddCluster(fRawCluster);
+  R()->ClusterAdd(fRawCluster);
   
   ToAliDebug(1,fRawCluster.Print()); AliDebug(1,"Stop."); 
 }//WriteRawCluster()
@@ -230,7 +231,7 @@ void AliRICHClusterFinder::WriteResolvedCluster()
   AliDebug(1,"Start.");
   
   FindClusterContribs(&fResolvedCluster);
-  R()->AddCluster(fResolvedCluster);
+  R()->ClusterAdd(fResolvedCluster);
   
   ToAliDebug(1,fResolvedCluster.Print()); AliDebug(1,"Stop.");  
 }//WriteResolvedCluster()
@@ -324,7 +325,7 @@ void RICHMinMathieson(Int_t &npar, Double_t *, Double_t &chi2, Double_t *par, In
 {
 //Mathieson minimization function 
   
-  AliRICHcluster *pRawCluster = ((AliRICHClusterFinder*)gMinuit->GetObjectFit())->GetRawCluster();
+  AliRICHCluster *pRawCluster = ((AliRICHClusterFinder*)gMinuit->GetObjectFit())->GetRawCluster();
 
   TVector2 centroid[50];
   Double_t q[50];
@@ -341,8 +342,8 @@ void RICHMinMathieson(Int_t &npar, Double_t *, Double_t &chi2, Double_t *par, In
   chi2 = 0;
   Int_t qtot = pRawCluster->Q();
   for(Int_t i=0;i<pRawCluster->Size();i++) {
-    TVector  pad=((AliRICHdigit *)pRawCluster->Digits()->At(i))->Pad();
-    Double_t padQ = ((AliRICHdigit *)pRawCluster->Digits()->At(i))->Q();
+    TVector  pad=((AliRICHDigit *)pRawCluster->Digits()->At(i))->Pad();
+    Double_t padQ = ((AliRICHDigit *)pRawCluster->Digits()->At(i))->Q();
     Double_t qfracpar=0;
     for(Int_t j=0;j<nFunctions;j++) {
       qfracpar += q[j]*AliRICHParam::FracQdc(centroid[j],pad);
index 5c03e19..f8900c8 100644 (file)
@@ -12,25 +12,24 @@ class AliHitMap;
 class AliRICHClusterFinder : public TTask
 {
 public:    
-           AliRICHClusterFinder(AliRICH *pRICH);
+           AliRICHClusterFinder(AliRunLoader *pRunLoader);
   virtual ~AliRICHClusterFinder()                                          {;}
   
   AliRICH        *R()                                              {return fRICH;}   //returns pointer to RICH  
   void            Exec(const Option_t *option="");                                   //loop on events and chambers  
   void            FindClusters(Int_t iChamber);                                      //find all clusters for a given chamber
-  void            FindClusterContribs(AliRICHcluster *pCluster);                     //find CFM for the current cluster
+  void            FindClusterContribs(AliRICHCluster *pCluster);                     //find CFM for the current cluster
   void            FormRawCluster(Int_t i, Int_t j);                                  //form a raw cluster
   void            FindLocalMaxima();                                                 //find local maxima in a cluster
   void            FitCoG();                                                          //evaluate the CoG as the best 
   void            WriteRawCluster();                                                 //write in the list of cluster  
   void            WriteResolvedCluster();                                            //write in the list of cluster  
-  AliRICHcluster *GetRawCluster()                           {return &fRawCluster;}   //returns pointer to the current raw cluster
-  Bool_t          GetDebug()                      const{return fRICH->GetDebug();}   //is debug printout needed?
+  AliRICHCluster *GetRawCluster()                           {return &fRawCluster;}   //returns pointer to the current raw cluster
 protected:
   AliRICH                *fRICH;                         //pointer to RICH
   AliHitMap              *fDigitMap;                     //map of digits positions
-  AliRICHcluster         fRawCluster;                    //current raw cluster before deconvolution
-  AliRICHcluster         fResolvedCluster;               //current cluster after deconvolution
+  AliRICHCluster         fRawCluster;                    //current raw cluster before deconvolution
+  AliRICHCluster         fResolvedCluster;               //current cluster after deconvolution
   Int_t                  fNlocals;                       //number of local maxima
   Double_t               fLocalX[100],fLocalY[100];      //list of locals X,Y
   Double_t               fLocalQ[100];                   //list of locals charge Q
diff --git a/RICH/AliRICHDigit.cxx b/RICH/AliRICHDigit.cxx
new file mode 100644 (file)
index 0000000..e3e2532
--- /dev/null
@@ -0,0 +1,28 @@
+//  **************************************************************************
+//  * 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.                  *
+//  **************************************************************************
+
+#include "AliRICHDigit.h"
+#include <AliLog.h>
+
+ClassImp(AliRICHDigit)
+
+//__________________________________________________________________________________________________
+void AliRICHDigit::Print(Option_t*)const
+{
+//Print current digit  
+  AliInfo(Form("cfm=%9i, cs=%2i, x=%3i, y=%3i, q=%8.3f, TID1=%5i, TID2=%5i, TID3=%5i",
+                  fCFM,fChamber,fPadX,fPadY,fQdc,fTracks[0],fTracks[1],fTracks[2]));
+}
+//__________________________________________________________________________________________________
diff --git a/RICH/AliRICHDigit.h b/RICH/AliRICHDigit.h
new file mode 100644 (file)
index 0000000..20c0c1e
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef AliRICHDigit_h
+#define AliRICHDigit_h
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+#include <AliDigit.h>
+#include "AliRICHParam.h"
+
+class AliRICHDigit :public AliDigit
+{
+public:
+  AliRICHDigit():AliDigit(),fCFM(0),fChamber(0),fPadX(0),fPadY(0),fQdc(-1){fTracks[0]=fTracks[1]=fTracks[2]=-1;}
+  AliRICHDigit(Int_t c,TVector pad,Double_t q,Int_t cfm,Int_t tid0,Int_t tid1,Int_t tid2):fCFM(cfm)  
+       {fPadX=(Int_t)pad[0];fPadY=(Int_t)pad[1];fQdc=q;fChamber=10*c+AliRICHParam::Pad2Sec(pad);fTracks[0]=tid0;fTracks[1]=tid1;fTracks[2]=tid2;}
+  virtual ~AliRICHDigit() {;}
+    
+  Int_t    Compare(const TObject *pObj) const
+                 {if(Id()==((AliRICHDigit*)pObj)->Id())return 0;else if(Id()>((AliRICHDigit*)pObj)->Id())return 1;else return -1;}  //virtual      
+  virtual Bool_t   IsSortable()                 const{return kTRUE;}                              //sort interface
+  virtual void     Print(Option_t *option="")   const;                                            //virtual
+//private part  
+  Int_t    ChFbMi()                     const{return fCFM;}                               //particle mixture for this digit
+  Int_t    C()                          const{return fChamber/10;}                        //chamber number
+  Int_t    S()                          const{return fChamber-(fChamber/10)*10;}          //sector number
+  Int_t    X()                          const{return fPadX;}                              //x position of the pad
+  Int_t    Y()                          const{return fPadY;}                              //y postion of the pad
+  TVector  Pad()                        const{Float_t v[2]={fPadX,fPadY}; return TVector(2,v);}
+  Int_t    Id()                         const{return fChamber*10000000+fPadX*1000+fPadY;} //absolute id of this pad
+  Double_t Q()                          const{return fQdc;}                               //charge in terms of ADC channels
+  void     AddTidOffset(Int_t offset) 
+    {for (Int_t i=0; i<3; i++) if (fTracks[i]>0) fTracks[i]+=offset;};
+protected:
+  Int_t    fCFM;  //1000000*Ncerenkovs+1000*Nfeedbacks+Nmips  
+  Int_t    fChamber;  //10*chamber number+ sector number 
+  Int_t    fPadX;     //pad number along X
+  Int_t    fPadY;     //pad number along Y
+  Double_t fQdc;      //QDC value, fractions are permitted for summable procedure  
+  ClassDef(AliRICHDigit,3) //RICH digit class       
+};//class AliRICHDigit
+
+#endif
index dbca6d8..18b4d17 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-
-#include <Riostream.h> 
-
-#include <TTree.h> 
-#include <TObjArray.h>
-#include <TFile.h>
-#include <TDirectory.h>
-#include <TParticle.h>
-
-#include <AliRunLoader.h>
-#include <AliLoader.h>
-
 #include "AliRICHDigitizer.h"
 #include "AliRICH.h"
+#include <AliRun.h>
+#include <AliRunLoader.h>
 #include "AliRunDigitizer.h"
+#include <AliLoader.h>
+#include <AliLog.h>
+
 
 ClassImp(AliRICHDigitizer)
 
 //__________________________________________________________________________________________________
-Bool_t AliRICHDigitizer::Init()
-{
-//This methode is called from AliRunDigitizer after the corresponding file is open
-  if(GetDebug())Info("Init","Start.");
-  AliRunLoader *pOutAL = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName());
-  if (!pOutAL->GetAliRun()) pOutAL->LoadgAlice();
-  fRich=(AliRICH*)pOutAL->GetAliRun()->GetDetector("RICH");//retrive RICH pointer from OUTPUT stream
-  return kTRUE;
-}//Init()
-//__________________________________________________________________________________________________
 void AliRICHDigitizer::Exec(Option_t*)
 {
-//this method invoked   
-  if(GetDebug())Info("Exec","Start with %i input(s) for event %i",fManager->GetNinputs(),fManager->GetOutputEventNr());
-  
-  AliRunLoader *pInAL=0, *pOutAL;//in and out Run loaders
-  AliLoader    *pInRL=0, *pOutRL;//in and out RICH loaders
-  pOutAL = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName());
-  pOutRL = pOutAL->GetLoader("RICHLoader");
-  pOutRL->MakeTree("D");   R()->MakeBranch("D"); //create TreeD with RICH branches in output stream
-  
-  TClonesArray tmpCA("AliRICHdigit");//tmp storage for sdigits sum up from all input files
+//This methode is responsible for merging sdigits to a list of digits
+//Disintegration leeds to the fact that one hit affected several neighbouring pads, which means that the same pad might be
+//affected by few hits.     
+  AliDebug(1,Form("Start with %i input(s) for event %i",fManager->GetNinputs(),fManager->GetOutputEventNr()));
+//First we read all sdigits from all inputs  
+  AliRunLoader *pInRunLoader=0;//in and out Run loaders
+  AliLoader    *pInRichLoader=0;//in and out RICH loaders  
+  TClonesArray tmpCA("AliRICHDigit");//tmp storage for sdigits sum up from all input files
   Int_t total=0;
   for(Int_t inFileN=0;inFileN<fManager->GetNinputs();inFileN++){//files loop
-    pInAL = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inFileN));//get run loader from current input 
-    pInRL = pInAL->GetLoader("RICHLoader"); if(pInRL==0) continue;//no RICH in this input, check the next input
-    if (!pInAL->GetAliRun()) pInAL->LoadgAlice();
-    AliRICH* rich=(AliRICH*)pInAL->GetAliRun()->GetDetector("RICH");
-    pInRL->LoadSDigits(); pInRL->TreeS()->GetEntry(0);
-    if(GetDebug())Info("Exec","input %i has %i sdigits",inFileN,rich->SDigits()->GetEntries());
-    for(Int_t i=0;i<rich->SDigits()->GetEntries();i++){//collect sdigits from current input to tmpCA
-      new(tmpCA[total++]) AliRICHdigit(*(AliRICHdigit*)rich->SDigits()->At(i)); 
-      ((AliRICHdigit*)tmpCA[total-1])->AddTidOffset(fManager->GetMask(inFileN));
+    pInRunLoader  = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inFileN));          //get run loader from current input 
+    pInRichLoader = pInRunLoader->GetLoader("RICHLoader"); if(pInRichLoader==0) continue;       //no RICH in this input, check the next input
+    if (!pInRunLoader->GetAliRun()) pInRunLoader->LoadgAlice();
+    AliRICH* pInRich=(AliRICH*)pInRunLoader->GetAliRun()->GetDetector("RICH");                  //take RICH from current input
+    pInRichLoader->LoadSDigits(); pInRichLoader->TreeS()->GetEntry(0);                          //take list of RICH sdigits from current input 
+    AliDebug(1,Form("input %i has %i sdigits",inFileN,pInRich->SDigits()->GetEntries()));
+    for(Int_t i=0;i<pInRich->SDigits()->GetEntries();i++){//collect sdigits from current input to tmpCA
+      new(tmpCA[total++]) AliRICHDigit(*(AliRICHDigit*)pInRich->SDigits()->At(i)); 
+      ((AliRICHDigit*)tmpCA[total-1])->AddTidOffset(fManager->GetMask(inFileN));//apply TID shift since all inputs count tracks independently starting from 0
     }
-    pInRL->UnloadSDigits();   rich->ResetSDigits();
+    pInRichLoader->UnloadSDigits();   pInRich->ResetSDigits(); //close current input and reset 
   }//files loop
   
-  tmpCA.Sort();                     //sort them according to Id() method
+  tmpCA.Sort();                     //at this point we have a list of all sdigits from all inputs, now sort them according to fPad field
+  
+  AliRunLoader *pOutRunLoader  = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName());    //open output stream (only 1 possible)
+  AliLoader    *pOutRichLoader = pOutRunLoader->GetLoader("RICHLoader");                         //take output RICH loader
+  AliRICH      *pOutRich       = (AliRICH*)pOutRunLoader->GetAliRun()->GetDetector("RICH");      //take output RICH
+  pOutRichLoader->MakeTree("D");   pOutRich->MakeBranch("D");                                    //create TreeD in output stream
   
-  if(GetDebug()) {tmpCA.Print();Info("Exec","Totally %i sdigits in %i inputs",tmpCA.GetEntries(),fManager->GetNinputs());}
-  Int_t cfm=0,chamber=0,id=0; //cfm is cerenkov feedback mip mixture
-  TVector pad(2); pad[0]=0;pad[1]=0;
-  Double_t q=0;
-  Int_t tid[3]={0,0,0};
-  Int_t iNdigitsPerPad=0;//how many sdigits for a given pad
+  TVector pad(2); pad[0]=0; pad[1]=0; Int_t iChamber=0,iCfm=0,aTids[3]={0,0,0},iId=0; Double_t dQdc=0;//current pad info   
+  Int_t iNdigsPerPad=0;                   //how many sdigits for a given pad
   for(Int_t i=0;i<tmpCA.GetEntries();i++){//sdigits loop (sorted)
-    AliRICHdigit *pSdig=(AliRICHdigit*)tmpCA.At(i);//get new sdigit
-    if(pSdig->Id()==id){//still the same pad
-      iNdigitsPerPad++;         q+=pSdig->Q();       cfm+=pSdig->ChFbMi();//sum up charge and cfm
-      if(pSdig->ChFbMi()==1) tid[0] = pSdig->GetTrack(0); // force the first tid to be mip's tid if it exists in the current pad
-      if(iNdigitsPerPad<=3)        tid[iNdigitsPerPad-1]=pSdig->GetTrack(0);
-      else                         if(GetDebug())Warning("Exec","More then 3 sdigits for the given pad");
+    AliRICHDigit *pSdig=(AliRICHDigit*)tmpCA.At(i);//get new sdigit
+    if(pSdig->Id()==iId){//still the same pad
+      iNdigsPerPad++;         dQdc+=pSdig->Q();      iCfm+=pSdig->ChFbMi();//sum up charge and cfm
+      if(pSdig->ChFbMi()==1) aTids[0] = pSdig->GetTrack(0); // force the first tid to be mip's tid if it exists in the current pad
+      if(iNdigsPerPad<=3)        aTids[iNdigsPerPad-1]=pSdig->GetTrack(0);
+      else                         AliWarning("More then 3 sdigits for the given pad");
     }else{//new pad, add the pevious one
-        if(id!=kBad&&R()->P()->IsOverTh(chamber,pad,q)) R()->AddDigit(chamber,pad,(Int_t)q,cfm,tid); //add newly created dig
-        cfm=pSdig->ChFbMi(); chamber=pSdig->C(); id=pSdig->Id();  pad=pSdig->Pad(); q=pSdig->Q();  //init all values by current sdig
-        iNdigitsPerPad=1; tid[0]=pSdig->GetTrack(0); tid[1]=tid[2]=kBad;
+        if(iId!=-1 && AliRICHParam::IsOverTh(iChamber,pad,dQdc)) pOutRich->DigitAdd(iChamber,pad,(Int_t)dQdc,iCfm,aTids); //add newly created dig
+        iChamber=pSdig->C(); pad=pSdig->Pad(); iCfm=pSdig->ChFbMi(); dQdc=pSdig->Q();  iId=pSdig->Id();                    //init all values by current sdig
+        iNdigsPerPad=1; aTids[0]=pSdig->GetTrack(0); aTids[1]=aTids[2]=-1;
       }
   }//sdigits loop (sorted)
-  if(tmpCA.GetEntries()&&R()->P()->IsOverTh(chamber,pad,q)) R()->AddDigit(chamber,pad,(Int_t)q,cfm,tid);//add the last dig
+  if(tmpCA.GetEntries() && AliRICHParam::IsOverTh(iChamber,pad,dQdc)) pOutRich->DigitAdd(iChamber,pad,(Int_t)dQdc,iCfm,aTids);//add the last dig
   
-  pOutRL->TreeD()->Fill();              //fill the tree with the list of digits
-  pOutRL->WriteDigits("OVERWRITE");     //serialize them to file
+  pOutRichLoader->TreeD()->Fill();              //fill the output tree with the list of digits
+  pOutRichLoader->WriteDigits("OVERWRITE");     //serialize them to file
   
-  tmpCA.Clear();
-  pOutRL->UnloadDigits();   R()->ResetDigits();
-            
-  if(GetDebug())Info("Exec","Stop.");
+  tmpCA.Clear();                      //remove all tmp sdigits
+  pOutRichLoader->UnloadDigits();   pOutRich->ResetDigits();
 }//Exec()
-//__________________________________________________________________________________________________
index d6b24ff..8893185 100644 (file)
@@ -5,25 +5,16 @@
 
 
 #include <AliDigitizer.h>
-#include <AliRunDigitizer.h>
-#include <AliRun.h>
+class AliRunDigitizer;
 
-class AliRICH;
-
-class AliRICHDigitizer : public AliDigitizer 
+class AliRICHDigitizer : public AliDigitizer //TObject-TNamed-TTask-AliDigitizer-AliRICHDigitizer
 {
 public:
-           AliRICHDigitizer():fRich(0)                                       {;}
-           AliRICHDigitizer(AliRunDigitizer * manager):AliDigitizer(manager) {if(GetDebug())Info("main ctor","Start.");}
-  virtual ~AliRICHDigitizer()                                                {if(GetDebug())Info("dtor","Start.");}
-
-        
+           AliRICHDigitizer()                                                {}
+           AliRICHDigitizer(AliRunDigitizer *pRunDig):AliDigitizer(pRunDig)  {}
+  virtual ~AliRICHDigitizer()                                                {}
   void     Exec(Option_t* option=0);                //virtual
-  Bool_t   Init();                                  //virtual
-  Bool_t   GetDebug() const {return ((gAlice) ? gAlice->GetDebug() : kFALSE);}
-  AliRICH* R()        const {return fRich;}         //returns pointer to RICH
 protected:
-  AliRICH* fRich; //pointer to main RICH object
   ClassDef(AliRICHDigitizer,0)
 };    
 #endif
diff --git a/RICH/AliRICHDisplFast.cxx b/RICH/AliRICHDisplFast.cxx
deleted file mode 100644 (file)
index 4161408..0000000
+++ /dev/null
@@ -1,211 +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.                  *
- **************************************************************************/
-#include "AliRICHDisplFast.h"
-#include "AliRICH.h"
-#include "AliRICHChamber.h"
-#include "AliRICHParam.h"
-#include <AliLoader.h>
-#include <AliRunLoader.h>
-#include <AliStack.h>
-#include <TCanvas.h>
-#include <TStyle.h>
-#include <TLatex.h>
-#include <TH2F.h>
-#include <TParticle.h>
-
-ClassImp(AliRICHDisplFast)
-//__________________________________________________________________________________________________
-void AliRICHDisplFast::ShowEvent(Int_t iEvtNmin,Int_t iEvtNmax)
-{
-  TH2F *pDigitsH2[8];
-  char titobj[11],titdisp[20];
-
-  AliRICH *pRich = (AliRICH*)gAlice->GetDetector("RICH");
-  Bool_t isDigits  =!pRich->GetLoader()->LoadDigits();
-  if(!isDigits){Error("ShoEvent","No digits. Nothing to display.");return;}
-  
-  TCanvas *canvas = new TCanvas("RICHDisplay","RICH Display",0,0,1226,900);
-  
-  gStyle->SetPalette(1);
-
-  canvas->Divide(3,3);
-  
-  for(Int_t iChamber=1;iChamber<=7;iChamber++) {
-    sprintf(titobj,"pDigitsH2_%i",iChamber);
-    sprintf(titdisp,"Chamber  %i",iChamber);
-    pDigitsH2[iChamber] = new TH2F(titobj,titdisp,165,0,AliRICHParam::PcSizeX(),144,0,AliRICHParam::PcSizeY());
-    pDigitsH2[iChamber]->SetMarkerColor(kGreen); 
-    pDigitsH2[iChamber]->SetMarkerStyle(29); 
-    pDigitsH2[iChamber]->SetMarkerSize(0.4);
-    pDigitsH2[iChamber]->SetStats(kFALSE);
-  }
-  
-  if(iEvtNmax>gAlice->GetEventsPerRun()) iEvtNmax=gAlice->GetEventsPerRun();
-
-  TLatex t;
-  t.SetTextSize(0.10);
-
-  TText *tit = new TText(0.1,0.6,"RICH Display");
-  tit->SetTextSize(0.10);
-
-  for(Int_t iEventN=iEvtNmin;iEventN<=iEvtNmax;iEventN++) {
-        
-    canvas->cd(1);
-    sprintf(titdisp,"Event Number %i",iEventN);
-    t.SetText(0.2,0.4,titdisp);
-    t.Draw();
-    tit->Draw();
-    pRich->GetLoader()->GetRunLoader()->GetEvent(iEventN);
-    pRich->GetLoader()->TreeD()->GetEntry(0);
-    for(Int_t iChamber=1;iChamber<=7;iChamber++) {
-      pDigitsH2[iChamber]->Reset();    
-      for(Int_t j=0;j<pRich->Digits(iChamber)->GetEntries();j++) {//digits loop
-        AliRICHdigit *pDig = (AliRICHdigit*)pRich->Digits(iChamber)->At(j);
-        TVector2 x2=AliRICHParam::Pad2Loc(pDig->Pad());
-        pDigitsH2[iChamber]->Fill(x2.X(),x2.Y());
-      }//digits loop
-      if(iChamber==1) canvas->cd(7);
-      if(iChamber==2) canvas->cd(8);
-      if(iChamber==3) canvas->cd(4);
-      if(iChamber==4) canvas->cd(5);
-      if(iChamber==5) canvas->cd(6);
-      if(iChamber==6) canvas->cd(2);
-      if(iChamber==7) canvas->cd(3);
-      pDigitsH2[iChamber]->Draw();
-    }
-    canvas->Update();
-    canvas->Modified();
-    
-    if(iEvtNmin<iEvtNmax) gPad->WaitPrimitive();
-  }
-}//ShowEvent()
-//__________________________________________________________________________________________________
-void AliRICHDisplFast::Exec(Option_t *)
-{
-  AliRICH *pRich = (AliRICH*)gAlice->GetDetector("RICH");
-  Bool_t isHits    =!pRich->GetLoader()->LoadHits();
-  Bool_t isDigits  =!pRich->GetLoader()->LoadDigits();
-  Bool_t isClusters=!pRich->GetLoader()->LoadRecPoints();
-  
-  if(!isHits && !isDigits && !isClusters){Error("Exec","No hits digits and clusters. Nothing to display.");return;}
-  
-  TCanvas *Display = new TCanvas("Display","RICH Display",0,0,600,600);
-  gStyle->SetPalette(1);
-  
-  TH2F *pHitsH2=0,*pDigitsH2=0,*pClustersH2=0;
-  
-  if(isHits)     pHitsH2     = new TH2F("pHitsH2"  ,  "Event Display;x,cm;y,cm",165,0,AliRICHParam::PcSizeX(),
-                                                                      144,0,AliRICHParam::PcSizeY());
-  if(pHitsH2)    pHitsH2->SetStats(kFALSE);
-  
-  if(isDigits)   pDigitsH2   = new TH2F("pDigitsH2"  ,"Event Display",165,0,AliRICHParam::PcSizeX(),
-                                                                      144,0,AliRICHParam::PcSizeY());
-  if(isClusters) pClustersH2 = new TH2F("pClustersH2","Event Display",165,0,AliRICHParam::PcSizeX(),
-                                                                      144,0,AliRICHParam::PcSizeY());
-  
-  for(Int_t iEventN=0;iEventN<gAlice->GetEventsPerRun();iEventN++){//events Loop
-    pRich->GetLoader()->GetRunLoader()->GetEvent(iEventN);
-
-  
-    Int_t nPrimaries = (Int_t)pRich->GetLoader()->TreeH()->GetEntries();
-    TObjArray * Hits = new TObjArray[nPrimaries];
-  
-    for(Int_t i=0;i<nPrimaries;i++) {
-      pRich->GetLoader()->TreeH()->GetEntry(i);
-      Int_t nHits = pRich->Hits()->GetEntries();
-      for(Int_t k=0;k<nHits;k++)         Hits[i].Add(pRich->Hits()->At(k));
-    
-    }
-//display all the staff on chamber by chamber basis           
-    for(Int_t iChamber=1;iChamber<=7;iChamber++){//chambers loop       
-      if(isHits)     pHitsH2    ->Reset();     
-      if(isDigits)   pDigitsH2  ->Reset();     
-      if(isClusters) pClustersH2->Reset();
-//deals with hits
-      for(Int_t i=0;i<nPrimaries;i++){//prims loop
-        pRich->GetLoader()->TreeH()->GetEntry(i);
-        Int_t nHits = pRich->Hits()->GetEntries();
-        for(Int_t j=0;j<nHits;j++){//hits loop
-          AliRICHhit *pHit = (AliRICHhit*)Hits[i].At(j);
-          if(pHit->C()==iChamber){
-            TVector3 hitGlobX3= pHit->OutX3();
-            TVector2 hitLocX2 = pRich->C(iChamber)->Mrs2Pc(hitGlobX3);
-            pHitsH2->Fill(hitLocX2.X(),hitLocX2.Y(),200);
-          }//if
-        }//hits loop         
-      }//prims loop
-      pHitsH2->SetTitle(Form("event %i chamber %2i",iEventN,iChamber));
-      pHitsH2->SetMarkerColor(kRed); pHitsH2->SetMarkerStyle(29); pHitsH2->SetMarkerSize(0.4);
-      pHitsH2->Draw();
-      AliRICHParam::DrawSectors();
-      TLatex l; l.SetNDC(); l.SetTextSize(0.02);
-      if(!isHits)     {l.SetTextColor(kRed)  ;l.DrawLatex(0.1,0.01,"No Hits"    );}
-      if(!isDigits)   {l.SetTextColor(kGreen);l.DrawLatex(0.4,0.01,"No DIGITS"  );}
-      if(!isClusters) {l.SetTextColor(kBlue) ;l.DrawLatex(0.8,0.01,"No CLUSTERS");}
-      Display->Update();
-      Display->Modified();
-      gPad->WaitPrimitive();
-//deals with digits      
-      if(isDigits){
-        pRich->GetLoader()->TreeD()->GetEntry(0);
-        for(Int_t j=0;j<pRich->Digits(iChamber)->GetEntries();j++){//digits loop
-          AliRICHdigit *pDig = (AliRICHdigit*)pRich->Digits(iChamber)->At(j);
-         TVector2 x2=AliRICHParam::Pad2Loc(pDig->Pad());
-         pDigitsH2->Fill(x2.X(),x2.Y(),100);
-        }//digits loop
-        pDigitsH2->SetMarkerColor(kGreen); pDigitsH2->SetMarkerStyle(29); pDigitsH2->SetMarkerSize(0.4);
-        pDigitsH2->Draw("same");
-        Display->Update();
-        Display->Modified();       
-        gPad->WaitPrimitive();
-      }//if(isDigits)      
-//deals with clusters      
-      if(isClusters){
-        pRich->GetLoader()->TreeR()->GetEntry(0);
-        for(Int_t j=0;j<pRich->Clusters(iChamber)->GetEntries();j++){//clusters loop
-          AliRICHcluster *pClus = (AliRICHcluster*)pRich->Clusters(iChamber)->At(j);
-          pClustersH2->Fill(pClus->X(),pClus->Y(),50);
-        }//clusters loop
-        pClustersH2->SetMarkerColor(kBlue); pClustersH2->SetMarkerStyle(29);  pClustersH2->SetMarkerSize(0.4);
-        pClustersH2->Draw("same");
-        Display->Update();
-        Display->Modified();
-        gPad->WaitPrimitive();
-      }//if(isClusters)
-    }//chambers loop
-    delete [] Hits;
-  }//events Loop
-  pRich->GetLoader()->UnloadHits();
-  if(isDigits)   pRich->GetLoader()->UnloadDigits();
-  if(isClusters) pRich->GetLoader()->UnloadRecPoints();
-}//Exec()
-//__________________________________________________________________________________________________
-Int_t AliRICHDisplFast::Nparticles(Int_t iPartID,Int_t iEvtN,AliRunLoader *pRL)
-{
-//counts total number of particles of given type (including secondary) for a given event
-  pRL->GetEvent(iEvtN);    
-  if(pRL->LoadHeader()) return 0;
-  if(pRL->LoadKinematics()) return 0;
-  AliStack *pStack=pRL->Stack();
-  
-  Int_t iCounter=0;
-  for(Int_t i=0;i<pStack->GetNtrack();i++){
-    if(pStack->Particle(i)->GetPdgCode()==iPartID) iCounter++;
-  }
-  
-  pRL->UnloadHeader();
-  pRL->UnloadKinematics();
-  return iCounter;
-}
diff --git a/RICH/AliRICHDisplFast.h b/RICH/AliRICHDisplFast.h
deleted file mode 100644 (file)
index 2f270cf..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef AliRICHDisplFast_h
-#define AliRICHDisplFast_h
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-#include <TTask.h>
-
-class AliRunLoader;
-
-class AliRICHDisplFast : public TTask 
-{
-public :
-               AliRICHDisplFast() {;}
-  virtual     ~AliRICHDisplFast() {;}      
-  void ShowEvent(Int_t iEvtNmin,Int_t iEvtNmax);                                 //Display looping on events
-  void ShowEvent(Int_t iEvent)                      {ShowEvent(iEvent,iEvent);}  //Display only one event
-  static Int_t    Nparticles   (Int_t iPID,Int_t iEvent=0,AliRunLoader *p=0);    //returns a number of particles of given type
-  virtual void Exec(Option_t *opt=0);                                            //virtual do the main job
-protected:  
-  ClassDef(AliRICHDisplFast,0)                              //Utility class to draw the current event topology
-};
-    
-#endif //AliRICHDisplFast_cxx
-
diff --git a/RICH/AliRICHHit.cxx b/RICH/AliRICHHit.cxx
new file mode 100644 (file)
index 0000000..3cd4d37
--- /dev/null
@@ -0,0 +1,28 @@
+//  **************************************************************************
+//  * 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.                  *
+//  **************************************************************************
+
+#include "AliRICHHit.h"
+#include <AliLog.h>
+ClassImp(AliRICHHit)
+//__________________________________________________________________________________________________
+void AliRICHHit::Print(Option_t*)const
+{
+//Print hit
+  AliInfo(Form("Ch=%1i,TID=%6i,Elos=%9.3f eV,IN(%6.2f,%6.2f,%6.2f)-OUT(%6.2f,%6.2f,%6.2f)=%9.4f"
+      ,fChamber,fTrack,fEloss*1e9,fInX3.X() ,fInX3.Y() ,fInX3.Z(),
+                                  fOutX3.X(),fOutX3.Y(),fOutX3.Z(),Length()));
+}
+//__________________________________________________________________________________________________
diff --git a/RICH/AliRICHHit.h b/RICH/AliRICHHit.h
new file mode 100644 (file)
index 0000000..646931f
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef AliRICHHit_h
+#define AliRICHHit_h
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+#include <AliHit.h>
+#include <TVector3.h>
+
+//RICH hit container
+class AliRICHHit : public AliHit
+{
+public:
+           AliRICHHit()                                                     :AliHit(     ),fChamber(-1),fEloss(-1) {fInX3.SetXYZ(0,0,0);fOutX3.SetXYZ(0,0,0);}
+           AliRICHHit(Int_t c,Int_t tid,TVector3 in,TVector3 out,Double_t e):AliHit(0,tid),fChamber(c ),fEloss(e ) {fInX3=in; fOutX3=out; fX=out.X();fY=out.Y();fZ=out.Z();}
+  virtual ~AliRICHHit()                                                                                            {}
+
+  Int_t    C()                       const{return fChamber;}              //chamber number 
+  Int_t    Chamber()                 const{return fChamber;}              //chamber number 
+  Float_t  Eloss()                   const{return fEloss;}                //energy lost by track inside amplification gap  
+  TVector3 InX3()                    const{return fInX3;}                 //track position at the faceplane of the gap 
+  TVector3 OutX3()                   const{return fOutX3;}                //track position at the backplane of the gap 
+  Double_t Length()                  const{return (fOutX3-fInX3).Mag();}  //track length inside the amplification gap
+  void     Print(Option_t *option="")const;                               //virtual
+protected:
+  Int_t     fChamber;                      //chamber number
+  Double_t  fEloss;                        //ionisation energy lost in GAP
+  TVector3  fInX3;                         //position at the entrance of the GAP   
+  TVector3  fOutX3;                        //position at the exit of the GAP
+  ClassDef(AliRICHHit,2)                   //RICH hit class
+};//class AliRICHhit
+#endif
index a2bf706..b6837a9 100644 (file)
@@ -33,7 +33,7 @@ void  AliRICHMap::FillHits()
 // Loops over the list of digits filling the "pad fired by digits" structure
   if(!fNdigits) return;    
   for(Int_t iDigN=0;iDigN<fNdigits;iDigN++){
-    AliRICHdigit *pDig= (AliRICHdigit*)fDigits->At(iDigN);
+    AliRICHDigit *pDig= (AliRICHDigit*)fDigits->At(iDigN);
     SetHit(pDig->X(),pDig->Y(),iDigN);
   }
 }
index 5583c54..df8a1fa 100644 (file)
@@ -14,7 +14,6 @@
 //  **************************************************************************
 #include "AliRICHParam.h"
 #include "AliRICHChamber.h"
-#include "AliRICHDisplFast.h"
 #include <TCanvas.h>
 #include <TLatex.h>
 #include <THStack.h>
index e69fab0..1740ab5 100644 (file)
@@ -20,7 +20,6 @@
 static const int kNchambers=7;     //number of RICH chambers 
 static const int kNpadsX = 160;    //number of pads along X in single chamber
 static const int kNpadsY = 144;    //number of pads along Y in single chamber
-static const int kBad=-101;        //useful static const to mark initial (uninitalised) values
 static const int kNsectors=6;      //number of sectors per chamber
 
 static const int kCerenkov=50000050;  //??? go to something more general like TPDGCode
@@ -91,7 +90,7 @@ public:
   static TVector2 MathiesonDelta()           {return TVector2(5*0.18,5*0.18);}            //area of 5 sigmas of Mathieson distribution (cm)
   static Int_t    MaxQdc()                   {return 4095;}                               //QDC number of channels          
   
-  static Int_t    HV(Int_t sector)           {if (sector>=1 && sector <=6) return fgHV[sector-1];  else return kBad;} //high voltage for this sector
+  static Int_t    HV(Int_t sector)           {if (sector>=1 && sector <=6) return fgHV[sector-1];  else return -1;} //high voltage for this sector
   static void     SetHV(Int_t sector,Int_t hv){fgHV[sector-1]=hv;}  
 //optical properties methodes  
   static Float_t  PhotonEnergy(Int_t i)    {return 0.1*i+5.5;}             //photon energy (eV) for i-th point
@@ -117,13 +116,13 @@ public:
 //charge response methodes  
   inline static Double_t Mathieson(Double_t x1,Double_t x2,Double_t y1,Double_t y2);               //Mathienson integral over given limits
   inline static Double_t GainSag(Double_t x,Int_t sector);                                         //gain variations in %
-         static Double_t QdcSlope(Int_t sec){switch(sec){case kBad: return 0;  default:   return 33;}} //weight of electon in QDC channels
+         static Double_t QdcSlope(Int_t sec){switch(sec){case -1: return 0;  default:   return 33;}} //weight of electon in QDC channels
          static Double_t Gain(const TVector2 &x2){//gives chamber gain in terms of QDC channels for given point in local ref system
                           if(fgIsWireSag) return QdcSlope(Loc2Sec(x2))*(1+GainSag(x2.X(),Loc2Sec(x2))/100);
                           else            return QdcSlope(Loc2Sec(x2));}
   inline static Double_t FracQdc(const TVector2 &x2,const TVector &pad);                           //charge fraction to pad from hit
   inline static Int_t    TotQdc(TVector2 x2,Double_t eloss);                                       //total charge for hit eloss=0 for photons
-  inline        Bool_t   IsOverTh(Int_t c,TVector pad,Double_t q);                                 //is QDC of the pad registered by FEE  
+  inline static Bool_t   IsOverTh(Int_t c,TVector pad,Double_t q);                                 //is QDC of the pad registered by FEE  
          static Int_t    NsigmaTh()                    {return fgNsigmaTh;}                        //
          static Float_t  SigmaThMean()                 {return fgSigmaThMean;}                     //QDC electronic noise mean
          static Float_t  SigmaThSpread()               {return fgSigmaThSpread;}                   //QDC electronic noise width
@@ -176,15 +175,15 @@ Int_t AliRICHParam::Loc2Sec(const TVector2 &v2)
   Double_t y0=0; Double_t y1=SectorSizeY(); Double_t y2=SectorSizeY()+DeadZone(); Double_t y3=2*SectorSizeY()+DeadZone(); 
   Double_t y4=PcSizeY()-SectorSizeY();      Double_t y5=PcSizeY();
   
-  Int_t sector=kBad;  
+  Int_t sector=-1;  
   if     (v2.X() >= x0 && v2.X() <= x1 )  sector=1;
   else if(v2.X() >= x2 && v2.X() <= x3 )  sector=2;
-  else                                    return kBad;
+  else                                    return -1;
   
   if     (v2.Y() >= y0 && v2.Y() <= y1 )  ;                    //sectors 1 or 2 
   else if(v2.Y() >= y2 && v2.Y() <= y3 )  sector+=2;           //sectors 3 or 4
   else if(v2.Y() >= y4 && v2.Y() <= y5 )  sector+=4;           //sectors 5 or 6
-  else                                    return kBad;
+  else                                    return -1;
   return sector;
 }//Loc2Sec(Double_t x, Double_t y)
 //__________________________________________________________________________________________________
@@ -198,7 +197,7 @@ TVector AliRICHParam::Loc2Pad(const TVector2 &loc)
 //   -------> x  
   TVector pad(2);
   Int_t sec=Loc2Sec(loc);//trasforms x2 to sector reference system
-  if(sec==kBad) {pad[0]=pad[1]=kBad; return pad;}
+  if(sec==-1) {pad[0]=pad[1]=-1; return pad;}
 //first we deal with x  
   if(sec==1||sec==3||sec==5)    pad[0]=           Int_t(            loc.X()   / PadSizeX() )+1; //sector 1 or 3 or 5
   else                          pad[0]=NpadsX() - Int_t( (PcSizeX()-loc.X())  / PadSizeX() )  ; //sector 2 or 4 or 6
@@ -212,7 +211,7 @@ TVector AliRICHParam::Loc2Pad(const TVector2 &loc)
 Int_t AliRICHParam::Pad2Sec(const TVector &pad)
 {
 //Determines sector containing the given pad.
-  Int_t sector=kBad;      
+  Int_t sector=-1;      
   if     (pad[0] >= 1           && pad[0] <=   NpadsXsec() )    {sector=1;}
   else if(pad[0] >  NpadsXsec() && pad[0] <=   NpadsX()    )    {sector=2;} 
   else                                                         AliDebugClass(1,Form("Wrong pad (%3.0f,%3.0f)",pad[0],pad[1]));
@@ -232,7 +231,7 @@ TVector2 AliRICHParam::Pad2Loc(TVector pad)
 //   |  3 4        sector numbers
 //   |  1 2
 //    -------> x  
-  Double_t x=kBad,y=kBad;
+  Double_t x=-1,y=-1;
   if(pad[0] > 0 && pad[0] <= NpadsXsec())//it's 1 or 3 or 5
     x=(pad[0]-0.5)*PadSizeX();
   else if(pad[0] > NpadsXsec() && pad[0] <= NpadsX())//it's 2 or 4 or 6
@@ -273,7 +272,7 @@ Int_t AliRICHParam::TotQdc(TVector2 x2,Double_t eloss)
 //Calculates the total charge produced by the eloss in point x2 (Chamber RS).
 //Returns this change parametrised in QDC channels, or 0 if the hit in the dead zone.
 //eloss=0 means photon which produces 1 electron only eloss > 0 for Mip
-  if(Loc2Sec(x2)==kBad) return 0; //hit in the dead zone     
+  if(Loc2Sec(x2)==-1) return 0; //hit in the dead zone     
   Int_t iNelectrons=Int_t(eloss/IonisationPotential()); if(iNelectrons==0) iNelectrons=1;
   Double_t qdc=0;
   for(Int_t i=1;i<=iNelectrons;i++) qdc+=-Gain(x2)*TMath::Log(gRandom->Rndm());
index ccce9a7..bc27ee5 100644 (file)
@@ -63,7 +63,7 @@ Double_t AliRICHRecon::ThetaCerenkov()
 // Pattern recognition method based on Hough transform
 // Return theta Cerenkov for a given track and list of clusters which are set in ctor  
 
-  if(fpClusters->GetEntries()==0) return kBad;//no clusters at all for a given track
+  if(fpClusters->GetEntries()==0) return -1;//no clusters at all for a given track
   Bool_t kPatRec = kFALSE;  
     
   AliDebug(1,Form("---Track Parameters--- Theta: %f , Phi: %f ",GetTrackTheta()*TMath::RadToDeg(),GetTrackPhi()*TMath::RadToDeg()));
@@ -80,8 +80,8 @@ Double_t AliRICHRecon::ThetaCerenkov()
     SetPhotonEta(-999.);
     SetPhotonWeight(0.);
     if (j == GetMipIndex()) continue; // do not consider MIP cluster as a candidate photon
-    Float_t xtoentr = ((AliRICHcluster*)fpClusters->UncheckedAt(j))->X() - GetShiftX();
-    Float_t ytoentr = ((AliRICHcluster*)fpClusters->UncheckedAt(j))->Y() - GetShiftY();
+    Float_t xtoentr = ((AliRICHCluster*)fpClusters->UncheckedAt(j))->X() - GetShiftX();
+    Float_t ytoentr = ((AliRICHCluster*)fpClusters->UncheckedAt(j))->Y() - GetShiftY();
     SetEntranceX(xtoentr);
     SetEntranceY(ytoentr);
     FindPhiPoint();
@@ -97,7 +97,7 @@ Double_t AliRICHRecon::ThetaCerenkov()
 
   if(candidatePhotons >= 1) kPatRec = kTRUE;
 
-  if(!kPatRec) return kBad;
+  if(!kPatRec) return -1;
 
   SetPhotonsNumber(fpClusters->GetEntries());
 
@@ -112,7 +112,7 @@ Double_t AliRICHRecon::ThetaCerenkov()
     {
       SetThetaCerenkov(999.);
       SetHoughPhotonsNorm(0.);
-      return kBad;
+      return -1;
     }
 
   if(fIsWEIGHT) FindWeightThetaCerenkov();
index db2dcfc..bc5074f 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-
-///////////////////////////////////////////////////////////////////////////////
-//                                                                           //
-// class for RICH reconstruction                                             //
-//                                                                           //
-///////////////////////////////////////////////////////////////////////////////
-
-
 #include "AliRICHReconstructor.h"
-#include "AliRICHClusterFinder.h"
-#include "AliRICHHelix.h"
-#include <AliRunLoader.h>
-#include <AliRun.h>
-#include <AliESD.h>
 
 ClassImp(AliRICHReconstructor)
 
-//__________________________________________________________________________________________________
-void AliRICHReconstructor::Reconstruct(AliRunLoader* pAL) const
-{
-//Finds clusters out of digits
-  AliDebug(1,"Start cluster finder.");AliRICHClusterFinder clus(GetRICH(pAL));  clus.Exec();
-}
-//__________________________________________________________________________________________________
-void AliRICHReconstructor::FillESD(AliRunLoader* /*pAL*/, AliESD* /*pESD*/) const
-{
-//All is done in AliRICHTracker. Nothing to do here.
-}//FillESD
-//__________________________________________________________________________________________________
-AliRICH* AliRICHReconstructor::GetRICH(AliRunLoader* pAL) const
-{
-// get the RICH detector
-
-  if (!pAL->GetAliRun()) pAL->LoadgAlice();
-  if (!pAL->GetAliRun()) {AliError("couldn't get AliRun object"); return NULL;  }
-  AliRICH* pRich = (AliRICH*) pAL->GetAliRun()->GetDetector("RICH");
-  if (!pRich) {AliError("couldn't get RICH detector");    return NULL;  }
-  return pRich;
-}
-//__________________________________________________________________________________________________
index 4d5c8b7..f3f4830 100644 (file)
@@ -4,24 +4,20 @@
  * See cxx source for full Copyright notice                               */
 
 #include <AliReconstructor.h>
-#include <AliLog.h>
 #include "AliRICHTracker.h"
-
-class AliRICH;
+#include "AliRICHClusterFinder.h"
 
 class AliRICHReconstructor: public AliReconstructor 
 {
 public:
-           AliRICHReconstructor(): AliReconstructor()          {AliDebug(1,"Start.");}
-  virtual ~AliRICHReconstructor()                              {AliDebug(1,"Start.");}  
-  virtual AliTracker*  CreateTracker(AliRunLoader*)const       {AliDebug(1,"Start.");return new AliRICHTracker;}    //virtual from AliReconstructor
-  virtual void         Reconstruct(AliRunLoader* pAL) const;              //virtual from AliReconstructor
-  virtual void         FillESD(AliRunLoader* pAL, AliESD* pESD) const;    //virtual from AliReconstructor
-  using AliReconstructor::Reconstruct;                                    //to get rid of virtual hidden warning 
-  using AliReconstructor::FillESD;                                        //to get rid of virtual hidden warning 
-private:
-  AliRICH*             GetRICH(AliRunLoader* pAL) const;
-
+           AliRICHReconstructor(): AliReconstructor()              {}//default ctor
+  virtual ~AliRICHReconstructor()                                  {}//dtor  
+  virtual AliTracker*  CreateTracker(AliRunLoader*           )const{return new AliRICHTracker;}                         //interface from AliReconstructor
+  virtual void         Reconstruct  (AliRunLoader* pRunLoader)const{AliRICHClusterFinder clus(pRunLoader); clus.Exec();}//interface from AliReconstructor
+  using AliReconstructor::Reconstruct;                                                                                  //to get rid of virtual hidden warning 
+//  virtual void         FillESD(AliRunLoader* pAL, AliESD* pESD) const;    //virtual from AliReconstructor
+//  using AliReconstructor::FillESD;                                        //to get rid of virtual hidden warning 
+protected:
   ClassDef(AliRICHReconstructor, 0)   //class for the RICH reconstruction
 };
 
index ec96314..900bf4a 100644 (file)
@@ -9,6 +9,7 @@
 #include <AliStack.h>
 #include <TParticle.h>
 #include <TMath.h>
+#include <AliRun.h>
 ClassImp(AliRICHTracker)
 //__________________________________________________________________________________________________
 Int_t AliRICHTracker::PropagateBack(AliESD *pESD)
@@ -48,11 +49,11 @@ void AliRICHTracker::RecWithESD(AliESD *pESD)
     Int_t iChamber=helix.RichIntersect(pRich->P());        
     AliDebug(1,Form("intersection with %i chamber found",iChamber));
     if(!iChamber) continue;//intersection with no chamber found
-//find MIP cluster candidate (closest to track intersection point cluster)    
+//find MIP cluster candidate (cluster which is closest to track intersection point)    
     Double_t distMip=9999,distX=0,distY=0; //min distance between clusters and track position on PC 
     Int_t iMipId=0; //index of that min distance cluster 
     for(Int_t iClusN=0;iClusN<pRich->Clusters(iChamber)->GetEntries();iClusN++){//clusters loop for intersected chamber
-      AliRICHcluster *pClus=(AliRICHcluster*)pRich->Clusters(iChamber)->UncheckedAt(iClusN);//get pointer to current cluster
+      AliRICHCluster *pClus=(AliRICHCluster*)pRich->Clusters(iChamber)->UncheckedAt(iClusN);//get pointer to current cluster
       Double_t distCurrent=pClus->DistTo(helix.PosPc());//distance between current cluster and helix intersection with PC
       if(distCurrent<distMip){
         distMip=distCurrent;
@@ -144,12 +145,12 @@ void AliRICHTracker::RecWithStack(TNtupleD *hn)
     hnvec[4]=helix.PosPc().X();
     hnvec[5]=helix.PosPc().Y();
     Double_t distMip=9999;   //min distance between clusters and track position on PC 
-    Double_t mipX=kBad;      //min distance between clusters and track position on PC 
-    Double_t mipY=kBad;      //min distance between clusters and track position on PC 
-    Double_t chargeMip=kBad; // charge MIP to find
-    Int_t iMipId=kBad;       //index of that min distance cluster 
+    Double_t mipX=-1;      //min distance between clusters and track position on PC 
+    Double_t mipY=-1;      //min distance between clusters and track position on PC 
+    Double_t chargeMip=-1; // charge MIP to find
+    Int_t iMipId=-1;       //index of that min distance cluster 
     for(Int_t iClusN=0;iClusN<pRich->Clusters(iChamber)->GetEntries();iClusN++){//clusters loop for intersected chamber
-      AliRICHcluster *pClus=(AliRICHcluster*)pRich->Clusters(iChamber)->UncheckedAt(iClusN);//get pointer to current cluster
+      AliRICHCluster *pClus=(AliRICHCluster*)pRich->Clusters(iChamber)->UncheckedAt(iClusN);//get pointer to current cluster
       Double_t distCurrent=pClus->DistTo(helix.PosPc());//ditance between current cluster and helix intersection with PC
       if(distCurrent<distMip){distMip=distCurrent;mipX=pClus->X();
                                                   mipY=pClus->Y();
index 32d292b..f532ed7 100644 (file)
@@ -76,7 +76,7 @@ void AliRICHv0::StepManager()
                       gMC->CurrentVolOffName(2),
                       gMC->CurrentVolOffName(3));
   
-  Float_t a,z,den,rad,abs; a=z=den=rad=abs=kBad;
+  Float_t a,z,den,rad,abs; a=z=den=rad=abs=-1;
   Int_t mid=gMC->CurrentMaterial(a,z,den,rad,abs);
   Info("Material","id=%i a=%7.2f z=%7.2f den=%9.4f rad=%9.2f abs=%9.2f",mid,a,z,den,rad,abs);
   
index b4f3765..ce4a41a 100644 (file)
@@ -62,7 +62,7 @@ void AliRICHv1::StepManager()
       }        
       gMC->TrackPosition(cerX4); gMC->CurrentVolOffID(2,iCurrentChamber);//RICH-RPPF-RPC
        
-      AddHit(iCurrentChamber,gAlice->GetMCApp()->GetCurrentTrackNumber(),cerX4.Vect(),cerX4.Vect());//HIT for PHOTON in conditions CF+CSI+DE
+      HitAdd(iCurrentChamber,gAlice->GetMCApp()->GetCurrentTrackNumber(),cerX4.Vect(),cerX4.Vect());//HIT for PHOTON in conditions CF+CSI+DE
       fCounters(8)++;//4- Ckovs converted to electron on CsI
       GenerateFeedbacks(iCurrentChamber);
     }//photon in PC and DE >0 
@@ -79,7 +79,7 @@ void AliRICHv1::StepManager()
     }else if(gMC->IsTrackExiting()||gMC->IsTrackStop()||gMC->IsTrackDisappeared()){//MIP in GAP exiting or disappeared
       eloss+=gMC->Edep();//take into account last step dEdX
       gMC->TrackPosition(mipOutX4);  
-      AddHit(iCurrentChamber,gAlice->GetMCApp()->GetCurrentTrackNumber(),mipInX4.Vect(),mipOutX4.Vect(),eloss);//HIT for MIP: MIP in GAP Exiting
+      HitAdd(iCurrentChamber,gAlice->GetMCApp()->GetCurrentTrackNumber(),mipInX4.Vect(),mipOutX4.Vect(),eloss);//HIT for MIP: MIP in GAP Exiting
       GenerateFeedbacks(iCurrentChamber,eloss);//MIP+GAP+Exit
     }else//MIP in GAP going inside
       eloss   += gMC->Edep();
@@ -113,7 +113,7 @@ void AliRICHv1::GenerateFeedbacks(Int_t iChamber,Float_t eloss)
   gMC->TrackPosition(x4);  
   TVector2 x2=C(iChamber)->Mrs2Pc(x4);//hit position on photocathode plane
   TVector2 xspe=x2;
-  Int_t sector=P()->Loc2Sec(xspe);  if(sector==kBad) return; //hit in dead zone, nothing to produce
+  Int_t sector=P()->Loc2Sec(xspe);  if(sector==-1) return; //hit in dead zone, nothing to produce
   Int_t iTotQdc=P()->TotQdc(x2,eloss);
   Int_t iNphotons=gMC->GetRandom()->Poisson(P()->C(iChamber)->AlphaFeedback(sector)*iTotQdc);    
   AliDebug(1,Form("N photons=%i",iNphotons));
index 4f61405..ad3b7b7 100644 (file)
@@ -4,4 +4,8 @@
 #pragma link off all functions;
 #pragma link C++ class  AliRICHParam+;
 #pragma link C++ class  AliRICHChamber+;
+#pragma link C++ class  AliRICH+;
+#pragma link C++ class  AliRICHHit+;
+#pragma link C++ class  AliRICHDigit+;
+#pragma link C++ class  AliRICHCluster+;
 #endif
index 27143e2..7eb0194 100644 (file)
@@ -2,14 +2,9 @@
 #pragma link off all globals;
 #pragma link off all classes;
 #pragma link off all functions;
-#pragma link C++ class  AliRICH+;
 #pragma link C++ class  AliRICHv0+;
 #pragma link C++ class  AliRICHv1+;
 #pragma link C++ class  AliRICHDigitizer+;
 #pragma link C++ class  AliGenRadioactive+;
-#pragma link C++ class  AliRICHhit+;
-#pragma link C++ class  AliRICHdigit+;
-#pragma link C++ class  AliRICHcluster+;
-#pragma link C++ class  AliRICHDisplFast+;
 #pragma link C++ enum   RadioNuclei_t;
 #endif
index 76dcaf3..6c45bc4 100644 (file)
@@ -9,9 +9,9 @@ public:
   enum EVersOpts  {kNo=-1,kVer0,kVer1,kTestBeam,kTestRadio,kOnTop,kDeclust=301,kSagita,kFeedback};
   enum EGenTypes  {kGunAlongZ=100,kBox1,kGun7,kPythia7,kHijing,kHijingPara,kRichLib,kSignalHijing,kHijingPara2Proton};
   
-  enum EDetectors {kPIPE=1,kITS,kTPC,kTRD,kTOF,kFRAME,kMAG,kCRT,kHALL,kPHOS,kSTART,kFMD,kABSO,kPMD,kDIPO,kEMCAL,kVZERO,kMUON,kZDC,kSHILD};
+  enum EDetectors {kPIPE=1,kITS,kTPC,kTRD,kTOF,kFRAME,kMAG,kCRT,kHALL,kPHOS,kSTART,kFMD,kABSO,kPMD,kDIPO,kEMCAL,kVZERO,kMUON,kZDC,kSHILD,kRICH,kVHMPID};
   enum EProcesses {kDCAY=1,kPAIR,kCOMP,kPHOT,kPFIS,kDRAY,kANNI,kBREM,kMUNU,kCKOV,kHADR,kLOSS,kMULS,kRAYL,kALL};
-  enum ERawFiles  {kNoRaw=0,kRawDdl,kRawDate,kRawRoot};
+  enum EBatchFlags{kNoRaw=0,kRawDdl,kRawDate,kRawRoot,kRecon,kFillEsd};
 //SLOTS  
   void    AddDetector(Int_t id)          {if(id==kTRD || id==kTOF) fDetBG->SetButton(kFRAME);}
   void    RemoveDetector(Int_t id)       {if(id==kFRAME) {fDetBG->SetButton(kTRD,kFALSE);fDetBG->SetButton(kTOF,kFALSE);}}
@@ -29,10 +29,11 @@ public:
   TGComboBox   *fRichCO;  TGButtonGroup *fRichBG;                                                                              //RICH
   TGComboBox   *fTicCO;   TGButtonGroup *fTicBG;                                                                               //TIC
   TGButton     *fMagCB;                                                                                                     //MAG
-  TGComboBox   *fGenTypeCO,*fGenPidCO,*fGenMinMomCO,*fGenMaxMomCO,*fGenChamberCO; TGGroupFrame *fGenGF,*fGenOptGF; TGNumberEntry *fGenPrimNE;             //GEN
+  TGComboBox   *fGenTypeCO,*fGenPidCO,*fGenMinMomCO,*fGenMaxMomCO,*fGenChamberCO; TGGroupFrame *fGenGF,*fGenOptGF,*fGenPrimGF; TGNumberEntry *fGenPrimNE;             //GEN
   TGButtonGroup *fDetBG;                                                                                                       //DETECTORS
   TGButtonGroup *fProcBG;                                                                                                      //PROCESSES
   TGButtonGroup *fRawBG;                                                                                                       //RAW 
+  TGButtonGroup *fRecoBG;                                                                                                      //RAW   
   char         *fFileName;
 };//class RichConfig
 //__________________________________________________________________________________________________    
@@ -103,7 +104,7 @@ RichConfig::RichConfig(const char *sFileName):TGMainFrame(gClient->GetRoot(),700
   fGenTypeCO->AddEntry("Sr90 source"                  ,kSr90);
   fGenTypeCO->AddEntry("RICH lib"                     ,kRichLib);
   fGenTypeCO->AddEntry("RICH lib+HIJING"              ,kSignalHijing);
-  fGenTypeCO->Select(kHijingPara);
+  fGenTypeCO->Select(kHijing);
   fGenTypeCO->Resize(160,20);
   
   
@@ -136,8 +137,8 @@ RichConfig::RichConfig(const char *sFileName):TGMainFrame(gClient->GetRoot(),700
   for(int i=1;i<=7;i++) fGenChamberCO->AddEntry(Form("Chamber %i",i),i);
   fGenChamberCO->Select(4); fGenChamberCO->Resize(160,20);
   
-  fGenOptGF->AddFrame(pGenPrimGF=new TGGroupFrame(fGenOptGF,"Number of primaries"));
-  pGenPrimGF->AddFrame(fGenPrimNE=new TGNumberEntry(pGenPrimGF,500));  
+  fGenOptGF->AddFrame(fGenPrimGF=new TGGroupFrame(fGenOptGF,"Number of primaries"));
+  fGenPrimGF->AddFrame(fGenPrimNE=new TGNumberEntry(fGenPrimGF,500));  
 //Detectors
   pMainHF->AddFrame(fDetBG=new TGButtonGroup(pMainHF,"Detectors"));
   fDetBG->Connect("Pressed(Int_t)" ,"RichConfig",this,"AddDetector(Int_t)");
@@ -181,12 +182,16 @@ RichConfig::RichConfig(const char *sFileName):TGMainFrame(gClient->GetRoot(),700
     new TGCheckButton(fProcBG,"LOSS Energy losses"          ,kLOSS));  fProcBG->SetButton(kLOSS);       
     new TGCheckButton(fProcBG,"MULS Multiple scattering"    ,kMULS));  fProcBG->SetButton(kMULS);       
     new TGCheckButton(fProcBG,"RAYL"                        ,kRAYL));  fProcBG->SetButton(kRAYL);       
-//RAW
-  pMainHF->AddFrame(fRawBG=new TGButtonGroup(pMainHF,"RAW data"));
+//RichBatch part
+  pMainHF->AddFrame(pBatchVF=new TGVerticalFrame(pMainHF));    
+  pBatchVF->AddFrame(fRawBG=new TGButtonGroup(pBatchVF,"RichBatch"));
     new TGRadioButton(fRawBG,"No RAW files"      ,kNoRaw)) ;   fRawBG->SetButton(kNoRaw);
     new TGRadioButton(fRawBG,"RAW DDL"           ,kRawDdl)) ;
     new TGRadioButton(fRawBG,"RAW DATE"          ,kRawDate)) ;
     new TGRadioButton(fRawBG,"RAW ROOT"          ,kRawRoot)) ;
+  fRawBG->AddFrame(fRecoBG=new TGButtonGroup(fRawBG,""));
+    new TGCheckButton(fRecoBG,"Reconstruct"    ,kRecon)) ;  
+    new TGCheckButton(fRecoBG,"Fill ESD"       ,kFillEsd)) ;
 //File    
   AddFrame(pFileHF=new TGHorizontalFrame(this,100,200));
   pFileHF->AddFrame(pCrtTB=new TGTextButton(pFileHF,"Create"));
@@ -206,22 +211,22 @@ void RichConfig::GeneratorSlot(Int_t type)
   
   if(type==kHijingPara){
     fGenGF->ShowFrame(fGenOptGF);
+    fGenOptGF->ShowFrame(fGenPrimGF);        
+    fGenOptGF->HideFrame(fGenPidCO);
+    fGenOptGF->HideFrame(fGenMinMomCO);
+    fGenOptGF->HideFrame(fGenMaxMomCO);
+    fGenOptGF->HideFrame(fGenChamberCO);
   }
   
   if(type==kGunAlongZ) {
-    fGenOptGF->ShowFrame(fGenMaxMomCO);
-    fGenOptGF->ShowFrame(fGenChamberCO);
-    fGenOptGF->ShowFrame(fGenPrimNE);    
+    fGenGF->ShowFrame(fGenOptGF);
+    fGenOptGF->ShowFrame(fGenPidCO);
+    fGenOptGF->ShowFrame(fGenMinMomCO);
+    fGenOptGF->HideFrame(fGenMaxMomCO);
+    fGenOptGF->HideFrame(fGenChamberCO);
+    fGenOptGF->HideFrame(fGenPrimGF);    
   }
-}        
-
-
-
-
-
-
-
-
+}//GeneratorSlot()        
 //__________________________________________________________________________________________________          
 void RichConfig::CreateConfig()
 {   
@@ -305,14 +310,14 @@ void RichConfig::CreateConfig()
     case kBox1:     
       fprintf(fp,"  AliGenBox *pGen=new AliGenBox(1);\n");  
       fprintf(fp,"  pGen->SetPart(%i); pGen->SetOrigin(0,0,0);\n",fGenPidCO->GetSelected());  
-      fprintf(fp,"  pGen->SetMomentumRange(%3.1f,%3.1f); \n",float(fGenMinMomCO->GetSelected())/10,   float(fGenMaxMomCO->GetSelected())/10);
+      fprintf(fp,"  pGen->SetMomentumRange(%.1f,%.1f); \n",float(fGenMinMomCO->GetSelected())/10,   float(fGenMaxMomCO->GetSelected())/10);
       fprintf(fp,"  pGen->SetThetaRange(pRICH->C(%i)->ThetaD()-3,pRICH->C(%i)->ThetaD()-1); \n",fGenChamberCO->GetSelected(),fGenChamberCO->GetSelected());
       fprintf(fp,"  pGen->SetPhiRange(pRICH->C(%i)->PhiD()-1,pRICH->C(%i)->PhiD()+1); \n",fGenChamberCO->GetSelected(),fGenChamberCO->GetSelected());    
       fprintf(fp,"  pGen->Init();\n");
     break;    
     case kGunAlongZ:   
       fprintf(fp,"  AliGenFixed *pGen=new AliGenFixed(1);\n");
-      fprintf(fp,"  pGen->SetPart(kProton); pGen->SetOrigin(0,0,0); pGen->SetMomentum(15); pGen->SetTheta(0);\n");
+      fprintf(fp,"  pGen->SetPart(%i); pGen->SetOrigin(0,0,0); pGen->SetMomentum(%.1f); pGen->SetTheta(0);\n",fGenPidCO->GetSelected(),float(fGenMinMomCO->GetSelected())/10);
       fprintf(fp,"  pGen->Init();\n");
     break;
     case kGun7:   
@@ -460,11 +465,13 @@ void RichConfig::CreateRichBatch()
   
   fprintf(fp,"  pSim->Run(iNevents);\n  delete pSim;\n\n");
 //reconstraction section  
-  if(fRichCO->GetSelected()==kVer1){
+  if(fRecoBG->GetButton(kRecon)->GetState()){
     fprintf(fp,"  AliReconstruction *pRec=new AliReconstruction;\n");
-    fprintf(fp,"  pRec->SetRunLocalReconstruction(\"ITS TPC TRD TOF RICH\");\n");
-    fprintf(fp,"  pRec->SetFillESD(\"ITS TPC TRD TOF RICH\");\n");
-    fprintf(fp,"  pRec->Run();         delete pRec;\n\n");
+    fprintf(fp,"  pRec->SetRunLocalReconstruction(\"ITS TPC TRD TOF RICH VHMPID\");\n");
+    if(fRecoBG->GetButton(kFillEsd)->GetState())
+      fprintf(fp,"  pRec->SetFillESD(\"ITS TPC TRD TOF RICH VHMPID\");\n");
+    fprintf(fp,"  pRec->Run();\n");         
+    fprintf(fp,"  delete pRec;\n\n");
   }
 //benchmarks  
   fprintf(fp,"  cout<<\"!!!!!!!!!!!!Info in <my/RichBatch.C>: Start time: \";time.Print();\n");
index 2734bbb..5ae221f 100644 (file)
@@ -96,29 +96,28 @@ void RichGet()
   if(!(vl=vl()))   Warning("RICH/menu.C::ReadAlice","No VHMPID loader in file");        
 }
 
-
-//__________________________________________________________________________________________________
-void TestMenu()
-{
-  TControlBar *pMenu = new TControlBar("vertical","RICH test");
-  pMenu->Show();  
-}//TestMenu()
 //__________________________________________________________________________________________________
 void MenuRich()
 {
   TControlBar *pMenu = new TControlBar("vertical","RICH");
-  pMenu->AddButton("Charged flux on RICH"  ,"r->AnaHits()"  ,"????");
-  pMenu->AddButton("Recon with stack", "r()->CheckPR()"                                           , "Create RSR.root with ntuple hn");    
-  pMenu->AddButton("Display Fast"    , "AliRICHDisplFast *d = new AliRICHDisplFast(); d->Exec();" , "Display Fast");
+  pMenu->AddButton("Display"          ,"r->Display();"  , "Display Fast");
+  pMenu->AddButton("Print hits"       ,"rh();"          ,"????");
+  pMenu->AddButton("Print sdigits"    ,"rs();"          ,"????");
+  pMenu->AddButton("Print digits"     ,"rd();"          ,"????");
+  pMenu->AddButton("Print clusters"   ,"rc();"          ,"????");  
+  pMenu->AddButton("Hits plots"       ,"r->AnaHits()"   ,"????");
+  pMenu->AddButton("Recon with stack" ,"r->CheckPR()"                                           , "Create RSR.root with ntuple hn");    
   pMenu->Show();  
 }//TestMenu()
 //__________________________________________________________________________________________________
 void MenuTic()
 {
   TControlBar *pMenu = new TControlBar("vertical","VHMPID");
-  pMenu->AddButton("Print hits"       ,"v->HitsPrint()","????");
-  pMenu->AddButton("Hits cotrol plots","v->HitsAna()"  ,"????");
-  pMenu->AddButton("Display"          ,"v->Display()"  ,"????");
+  pMenu->AddButton("Display"          ,"v->Display();"      ,"????");
+  pMenu->AddButton("Print hits"       ,"vh();"              ,"Print list of hits for current event");
+  pMenu->AddButton("Print sdigits"    ,"vs();"              ,"Print list of sdigits for current event");
+  pMenu->AddButton("Print digits"     ,"vd();"  ,"????");
+  pMenu->AddButton("Hits cotrol plots","v->HitsAna()"      ,"????");
   pMenu->Show();  
 }//TestMenu()
 //__________________________________________________________________________________________________
@@ -163,20 +162,20 @@ AliLoader *rl(){return             al->GetLoader("RICHLoader");}
 AliVHMPID *v() {return (AliVHMPID*)a()->GetDetector("VHMPID");}  //provides pointer to VHMPID detector
 AliLoader *vl(){return             al->GetLoader("VHMPIDLoader");}
 
-void rh(Int_t event=0)    {r->PrintHits(event);}     //utility print hits for 'event' event
-void rs(Int_t event=0)    {r->PrintSDigits(event);}  //utility print sdigits
-void rd(Int_t event=0)    {r->PrintDigits(event);}   //utility print digits
-void rc(Int_t event=0)    {r->PrintClusters(event);} //utility print clusters
-void rt(Int_t event=0)    {r->PrintTracks(event);}   //utility print tracks
-Int_t nem(Int_t event=0)  {AliRICHDisplFast::Nparticles(kElectron  ,event,al);} //utility number of electrons
-Int_t nep(Int_t event=0)  {AliRICHDisplFast::Nparticles(kPositron  ,event,al);} //utility number of positrons
-Int_t nmup(Int_t event=0) {AliRICHDisplFast::Nparticles(kMuonPlus  ,event,al);} //utility number of positive muons
-Int_t nmum(Int_t event=0) {AliRICHDisplFast::Nparticles(kMuonMinus ,event,al);} //utility number of negative muons
-Int_t npi0(Int_t event=0) {AliRICHDisplFast::Nparticles(kPi0       ,event,al);} //utility number of neutral pions 
-Int_t npip(Int_t event=0) {AliRICHDisplFast::Nparticles(kPiPlus    ,event,al);} //utility number of positive pions
-Int_t npim(Int_t event=0) {AliRICHDisplFast::Nparticles(kPiMinus   ,event,al);} //utility number of negative pions
-Int_t nk0(Int_t event=0)  {AliRICHDisplFast::Nparticles(kK0        ,event,al);} //utility number of neutral kaons
-Int_t nkp(Int_t event=0)  {AliRICHDisplFast::Nparticles(kKPlus     ,event,al);} //utility number of positive kaons
-Int_t nkm(Int_t event=0)  {AliRICHDisplFast::Nparticles(kKMinus    ,event,al);} //utility number of negative kaons
-Int_t npp(Int_t event=0)  {AliRICHDisplFast::Nparticles(kProton    ,event,al);} //utility number of protons
-Int_t npm(Int_t event=0)  {AliRICHDisplFast::Nparticles(kProtonBar ,event,al);} //utility number of antiprotons
+void rh(Int_t event=0)    {r->HitsPrint    (event);} void vh(Int_t event=0)    {v->HitsPrint    (event);}  //utility print hits for 'event' event
+void rs(Int_t event=0)    {r->SDigitsPrint (event);} void vs(Int_t event=0)    {v->SDigitsPrint (event);}  //utility print sdigits
+void rd(Int_t event=0)    {r->DigitsPrint  (event);} void vd(Int_t event=0)    {v->DigitsPrint  (event);}  //utility print digits
+void rc(Int_t event=0)    {r->ClustersPrint(event);} void vc(Int_t event=0)    {v->ClustersPrint(event);}  //utility print clusters
+void rt(Int_t event=0)    {r->PrintTracks  (event);}                                                       //utility print tracks
+Int_t nem(Int_t event=0)  {AliRICH::Nparticles(kElectron  ,event,al);} //utility number of electrons
+Int_t nep(Int_t event=0)  {AliRICH::Nparticles(kPositron  ,event,al);} //utility number of positrons
+Int_t nmup(Int_t event=0) {AliRICH::Nparticles(kMuonPlus  ,event,al);} //utility number of positive muons
+Int_t nmum(Int_t event=0) {AliRICH::Nparticles(kMuonMinus ,event,al);} //utility number of negative muons
+Int_t npi0(Int_t event=0) {AliRICH::Nparticles(kPi0       ,event,al);} //utility number of neutral pions 
+Int_t npip(Int_t event=0) {AliRICH::Nparticles(kPiPlus    ,event,al);} //utility number of positive pions
+Int_t npim(Int_t event=0) {AliRICH::Nparticles(kPiMinus   ,event,al);} //utility number of negative pions
+Int_t nk0(Int_t event=0)  {AliRICH::Nparticles(kK0        ,event,al);} //utility number of neutral kaons
+Int_t nkp(Int_t event=0)  {AliRICH::Nparticles(kKPlus     ,event,al);} //utility number of positive kaons
+Int_t nkm(Int_t event=0)  {AliRICH::Nparticles(kKMinus    ,event,al);} //utility number of negative kaons
+Int_t npp(Int_t event=0)  {AliRICH::Nparticles(kProton    ,event,al);} //utility number of protons
+Int_t npm(Int_t event=0)  {AliRICH::Nparticles(kProtonBar ,event,al);} //utility number of antiprotons
index b138354..a71c5bc 100644 (file)
@@ -1,4 +1,4 @@
-SRCS:= AliRICHParam.cxx AliRICHChamber.cxx
+SRCS:= AliRICHParam.cxx AliRICHChamber.cxx AliRICHHit.cxx AliRICHDigit.cxx AliRICHCluster.cxx AliRICH.cxx
 
 HDRS:= $(SRCS:.cxx=.h)
 DHDR:= RICHbaseLinkDef.h
index a185647..a5459ed 100644 (file)
@@ -1,5 +1,4 @@
-SRCS:= AliRICH.cxx AliRICHv0.cxx AliRICHv1.cxx AliRICHDigitizer.cxx \
-       AliGenRadioactive.cxx AliRICHDisplFast.cxx 
+SRCS:= AliRICHv0.cxx AliRICHv1.cxx AliRICHDigitizer.cxx AliGenRadioactive.cxx 
 
 HDRS:= $(SRCS:.cxx=.h)
 DHDR:= RICHsimLinkDef.h