First step of integration of AliSimulation and AliRICHDigitizer
authorkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Jan 2004 10:34:51 +0000 (10:34 +0000)
committerkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Jan 2004 10:34:51 +0000 (10:34 +0000)
RICH/AliRICH.cxx
RICH/AliRICH.h
RICH/AliRICHDigitizer.cxx
RICH/AliRICHDigitizer.h

index 8473364..4b7c585 100644 (file)
@@ -166,13 +166,6 @@ void AliRICH::Hits2SDigits()
   if(GetDebug()) Info("Hit2SDigits","Stop.");
 }//Hits2SDigits()
 //__________________________________________________________________________________________________
-void AliRICH::SDigits2Digits()
-{
-//Generate digits from sdigits.
-  if(GetDebug()) Info("SDigits2Digits","Start.");
-  if(GetDebug()) Info("SDigits2Digits","Stop.");
-}//SDigits2Digits()
-//__________________________________________________________________________________________________
 void AliRICH::BuildGeometry() 
 {
 //Builds a TNode geometry for event display
index cfdf0b5..5741e24 100644 (file)
@@ -264,7 +264,6 @@ public:
   virtual Int_t   IsVersion()                                            const =0;            
           void    Hits2SDigits();                                                                                 //virtual
   AliDigitizer*   CreateDigitizer(AliRunDigitizer* man) const {return new AliRICHDigitizer(man);}                 //virtual
-          void    SDigits2Digits();                                                                               //virtual
   
   inline  void    CreateHits();    
   inline  void    CreateSDigits();  
index d0a8d02..05d8448 100644 (file)
@@ -27,8 +27,6 @@
 
 #include "AliRICHDigitizer.h"
 #include "AliRICH.h"
-#include "AliRun.h"
-#include "AliPDG.h"
 #include "AliRunDigitizer.h"
 
 ClassImp(AliRICHDigitizer)
@@ -42,51 +40,69 @@ AliRICHDigitizer::AliRICHDigitizer(AliRunDigitizer *pManager)
                  :AliDigitizer(pManager)
 {
 //main ctor which should be used
-  if(GetDebug())Info("main ctor","Start.");
+  Info("main ctor","Start.");
   fRich=(AliRICH*)gAlice->GetDetector("RICH");
+  Rich()->Param()->GenSigmaThMap();
 }//main ctor
 //__________________________________________________________________________________________________
 AliRICHDigitizer::~AliRICHDigitizer()
 {
 //dtor
-  if(GetDebug())Info("dtor","Start.");
+  Info("dtor","Start.");
 }//dtor
 //__________________________________________________________________________________________________
 void AliRICHDigitizer::Exec(Option_t*)
 {
-  if(GetDebug())Info("Exec","Start with %i input(s) and %i",fManager->GetNinputs(),fManager->GetOutputEventNr());
+  Info("Exec","\n\n\n\n");
+  Info("Exec","Start with %i input(s) for event %i",fManager->GetNinputs(),fManager->GetOutputEventNr());
   
-  AliRunLoader *pInAL, *pOutAL;//in and out Run loaders
-  AliLoader    *pInRL, *pOutRL;//in and out RICH loaders
+  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");   Rich()->MakeBranch("D"); //create TreeD with RICH branches in output stream
 
-  
-     
-  AliRICH *pRICH = (AliRICH *) gAlice->GetDetector("RICH");
-  
-  if(!pOutRL->TreeD()) pOutRL->MakeTree("D");  pRICH->MakeBranch("D");
-  
-  
-  for(Int_t inputFile=0;inputFile<fManager->GetNinputs();inputFile++){//files loop
-    pInAL = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inputFile));
-    pInRL = pInAL->GetLoader("RICHLoader");
-    pInRL->LoadSDigits();
-    pInRL->TreeD()->GetEntries();
+  for(Int_t inFileN=0;inFileN<fManager->GetNinputs();inFileN++){//files loop
+    pInAL = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inFileN)); pInRL = pInAL->GetLoader("RICHLoader");
+    pInAL->GetEvent(fManager->GetOutputEventNr());    pInRL->LoadSDigits();    pInRL->TreeS()->GetEntry(0);
+    Info("Exec","Run Loader %p RICH Loader %p RICH %p",pInAL,pInRL,Rich());
+    Rich()->SDigits()->Print();
+    pInRL->UnloadSDigits();
   }//files loop
-
-      
-      
-  pOutRL->TreeD()->Fill();
-
-    
-  pRICH->ResetDigits(); /// ??? should it be here???
   
-  pOutRL->WriteDigits("OVERWRITE");
-
-  pOutRL->UnloadHits();
-  pOutRL->UnloadDigits();
-  if(GetDebug())Info("Exec","Stop");
+//     Rich()->SDigits()->Sort();                     //sort them according to Id() methode
+//       
+//     Int_t combiPid=0,chamber=0,x=0,y=0,tid[3],id=0; Double_t q=0;
+//     Int_t iNdigitsPerPad=0;//how many sdigits for a given pad
+//     for(Int_t i=0;i<Rich()->SDigits()->GetEntries();i++){//sdigits loop (sorted)
+//       AliRICHdigit *pSdig=(AliRICHdigit*)Rich()->SDigits()->At(i);
+//       if(pSdig->Id()==id){//still the same pad
+//         iNdigitsPerPad++;
+//         q+=pSdig->Q();
+//         combiPid+=pSdig->CombiPid();
+//         if(iNdigitsPerPad<=3)
+//           tid[iNdigitsPerPad-1]=pSdig->Tid(0);
+//         else
+//           Warning("SDigits2Digits","More then 3 sdigits for the given pad");
+//       }else{//new pad, add the pevious one
+//         if(id!=kBad&&Rich()->Param()->IsOverTh(chamber,x,y,q)) {
+//            Rich()->AddDigit(chamber,x,y,(Int_t)q,combiPid,tid); //add newly created digit to the list of digits
+//          }
+//         combiPid=pSdig->CombiPid();chamber=pSdig->C();id=pSdig->Id();
+//         x=pSdig->X();y=pSdig->Y();
+//         q=pSdig->Q();
+//         tid[0]=pSdig->Tid(0);
+//         iNdigitsPerPad=1;tid[1]=tid[2]=kBad;
+//       }
+//     }//sdigits loop (sorted)
+//   
+//     if(Rich()->SDigits()->GetEntries()&&Rich()->Param()->IsOverTh(chamber,x,y,q))
+//       Rich()->AddDigit(chamber,x,y,(Int_t)q,combiPid,tid);//add the last digit
+//         
+  pOutRL->TreeD()->Fill();              //fill the tree with the list of digits
+  pOutRL->WriteDigits("OVERWRITE");     //serialize them to file
+            
+  Info("Exec","Stop\n\n\n\n");
 }//Exec()
 //__________________________________________________________________________________________________
index d008fa1..ba8cfa7 100644 (file)
@@ -17,8 +17,9 @@ public:
            AliRICHDigitizer(AliRunDigitizer * manager);
   virtual ~AliRICHDigitizer();
         
-  void   Exec(Option_t* option=0);                //virtual
-  Bool_t GetDebug() const {return gAlice->GetDebug();}
+  void     Exec(Option_t* option=0);                //virtual
+  Bool_t   GetDebug() const {return gAlice->GetDebug();}
+  AliRICH* Rich()     const {return fRich;}
 protected:
   AliRICH* fRich; //pointer to main RICH object
   ClassDef(AliRICHDigitizer,0)