]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RICH/RICHdigit.C
The access to several data members was changed from public to protected. The digitisa...
[u/mrichter/AliRoot.git] / RICH / RICHdigit.C
index 1f84e34f233bfa4ff74f78d6b0754da0862a84cf..1726f28a430d5dc8ea141d913149cb6602daf5c0 100644 (file)
@@ -1,17 +1,17 @@
 // 0 = all
-// 1 = pion
-// 2 = kaon
-// 3 = proton
-// 4 = muon
-// 5 = electron
-// 6 = neutron
+// 1 = not pion
+// 2 = not kaon
+// 3 = not proton
+// 4 = not muon
+// 5 = not electron
+// 6 = not neutron
 
 
 Int_t particle_type=0;
 
 #include "iostream.h"
 
-void RICHdigit (Int_t evNumber1=0,Int_t evNumber2=0) 
+void RICHdigit (Int_t evNumber1=0,Int_t evNumber2=0, Int_t merging=0
 {
 /////////////////////////////////////////////////////////////////////////
 //   This macro is a small example of a ROOT macro
@@ -26,9 +26,11 @@ void RICHdigit (Int_t evNumber1=0,Int_t evNumber2=0)
   if (gClassTable->GetID("AliRun") < 0) {
       gROOT->LoadMacro("loadlibs.C");
       loadlibs();
-   }
-
-
+  }else {
+    delete gAlice;
+    gAlice = 0;
+  }
+  
 // Connect the Root Galice file containing Geometry, Kine and Hits
 
    TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
@@ -43,11 +45,6 @@ void RICHdigit (Int_t evNumber1=0,Int_t evNumber2=0)
        gROOT->LoadMacro("loadlibs.C");
        loadlibs();
     }
-    else {
-      //delete gAlice;
-      gAlice = 0;
-    }
-   
 
 
    if (!gAlice) {
@@ -62,6 +59,25 @@ void RICHdigit (Int_t evNumber1=0,Int_t evNumber2=0)
     }
       
    AliRICH *RICH  = (AliRICH*) gAlice->GetDetector("RICH");
+
+   if (merging)
+     printf("Merging is ON\n");
+   else
+     printf("Merging is OFF\n");
+
+// Creation of merger object
+   AliRICHMerger* merger = new AliRICHMerger();
+   
+// Configuration
+   merger->SetMode(merging);
+   merger->SetSignalEventNumber(0);
+   merger->SetBackgroundEventNumber(0);
+   merger->SetBackgroundFileName("bg.root");
+       
+// Pass
+   RICH->SetMerger(merger);
+
+
 //
 // Event Loop
 //
@@ -71,11 +87,16 @@ void RICHdigit (Int_t evNumber1=0,Int_t evNumber2=0)
        cout << "Particles       :" <<nparticles<<endl;
        if (nev < evNumber1) continue;
        if (nparticles <= 0) return;
-       if (RICH) RICH->Digitise(nev, particle_type);
-       char hname[30];
-       sprintf(hname,"TreeD%d",nev);
-       gAlice->TreeD()->Write(hname);
-       gAlice->TreeD()->Reset();
+       if (RICH) 
+        {
+          //gAlice->MakeTree("D");
+          //RICH->MakeBranch("D");
+          //RICH->Digitise(nev, particle_type);
+          //gAlice->SDigits2Digits("RICH");
+          //gAlice->Tree2Tree("D");
+          RICH->MakeBranch("D");
+          RICH->SDigits2Digits(nev, particle_type);
+        }
    } // event loop 
    file->Close();
 
@@ -85,14 +106,3 @@ void RICHdigit (Int_t evNumber1=0,Int_t evNumber2=0)
 
 
 
-
-
-
-
-
-
-
-
-
-
-