]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/scripts/ShowMult.C
Added new library libFMDutil. This library contains utility classes that
[u/mrichter/AliRoot.git] / FMD / scripts / ShowMult.C
index 70d799f864d1810794c3a5147ed43be21157e8a9..3a41f85344e04b0c73d320dd6c8581f3a4fb5f43 100644 (file)
@@ -1,50 +1,31 @@
 //
+// $Id$
+//
 // Script to dump multiplicity information to std::cout. 
 //
-void
-ShowMult()
-{
-  AliRunLoader* runLoader = AliRunLoader::Open("galice.root");
-  runLoader->LoadgAlice();
-  runLoader->LoadHeader();
-  gAlice                   = runLoader->GetAliRun();
-  AliFMD*       fmd        = static_cast<AliFMD*>(gAlice->GetDetector("FMD"));
-  AliLoader*    fmdLoader  = runLoader->GetLoader("FMDLoader");
-  fmdLoader->LoadRecPoints("READ");
-  
-  Int_t nEvents = runLoader->TreeE()->GetEntries();
-  for (Int_t event = 0; event < nEvents; event++) {
-    cout << "Event # " << event << endl;
-    runLoader->GetEvent(event);
-    TClonesArray* multStrips  = 0;
-    TClonesArray* multRegions = 0;
-    TTree*        treeR  = fmdLoader->TreeR();
-    TBranch*      branchRegions = treeR->GetBranch("FMDPoisson");
-    TBranch*      branchStrips  = treeR->GetBranch("FMDNaiive");
-    branchRegions->SetAddress(&multRegions);
-    branchStrips->SetAddress(&multStrips);
-
-    Int_t total = 0;
-    Int_t nEntries  = treeR->GetEntries();
-    for (Int_t entry = 0; entry < nEntries; entry++) {
-      cout << " Entry # " << entry << endl;
-      treeR->GetEntry(entry);
-
-      Int_t nMults = multStrips->GetLast();
-      for (Int_t i = 0; i < nMults; i++) {
-       // cout << "  Digit # " << i << endl;
-       AliFMDMultStrip* mult = 
-         static_cast<AliFMDMultStrip*>(multStrips->UncheckedAt(i));
-       if (mult->Particles() > 0) mult->Print();
-      }
+// Use the script `Compile.C' to compile this class using ACLic. 
+//
+#include <AliFMDMultStrip.h>
+#include <AliFMDMultRegion.h>
+#include <AliFMDInput.h>
 
-      nMults = multRegions->GetLast();
-      for (Int_t i = 0; i < nMults; i++) {
-       // cout << "  Digit # " << i << endl;
-       AliFMDMultStrip* mult = 
-         static_cast<AliFMDMultStrip*>(multRegions->UncheckedAt(i));
-       if (mult->Particles() > 0) mult->Print();
-      }
-    }
+class ShowMult : public AliFMDInputRecPoints
+{
+public:
+  ShowMult() {}
+  Bool_t ProcessStrip(AliFMDMultStrip* mult) 
+  {
+    mult->Print();
+    return kTRUE;
+  }
+  Bool_t ProcessRegion(AliFMDMultRegion* mult) 
+  {
+    mult->Print();
+    return kTRUE;
   }
-}
+};
+
+//____________________________________________________________________
+//
+// EOF
+//