]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliMCQA.cxx
Important bugfix which affects the raw data events written without the common data...
[u/mrichter/AliRoot.git] / STEER / AliMCQA.cxx
index a3e1b8057745253756ec1852d21f636ae722bcb8..e8c15e3bb870814360ffd565d55fcec9619a130e 100644 (file)
@@ -38,6 +38,7 @@
 #include <TROOT.h>
 #include <TVirtualMC.h>
 
+#include "AliLog.h"
 #include "AliMC.h"
 #include "AliMCQA.h"
 #include "AliModule.h"
@@ -150,15 +151,20 @@ AliMCQA::AliMCQA(Int_t ndets):
   //
   AliMC * mc = gAlice->GetMCApp();
   for(i=0;i<fNvolumes;++i) {
-    AliModule *mod = dynamic_cast<AliModule*>
-      ((*gAlice->Modules())[mc->DetFromMate(gMC->VolId2Mate(i+1))]);
-    (*fVolNames)[i]=new TNamed(gMC->VolName(i+1),mod->GetName());
+    Int_t mat = gMC->VolId2Mate(i+1);
+    if (mat > 0) {
+       AliModule *mod = dynamic_cast<AliModule*>
+           ((*gAlice->Modules())[mc->DetFromMate(gMC->VolId2Mate(i+1))]);
+       (*fVolNames)[i] = new TNamed(gMC->VolName(i+1),mod->GetName());
+    } else {
+       (*fVolNames)[i] = new TNamed(gMC->VolName(i+1), "Assembly");
+    }
   }
 
   fQAHist->Add(new TH1F("hMCMcalls","Monte Carlo calls per module",
                        fNdets, -0.5, fNdets-0.5));
   h = dynamic_cast<TH1F*>(dir->FindObject("hMCMcalls"));
-   h->GetListOfFunctions()->Add(new TExec("ex","gAlice->GetMCQA()->AddModuleName()"));
+  h->GetListOfFunctions()->Add(new TExec("ex","gAlice->GetMCQA()->AddModuleName()"));
 
   dir->Remove(dir->FindObject("hMCMcalls"));
   //
@@ -172,7 +178,7 @@ AliMCQA::AliMCQA(Int_t ndets):
 //_______________________________________________________________________
 void AliMCQA::Copy(TObject &) const
 {
-  Fatal("Copy ctor","Not implemented!\n");
+  AliFatal("Not implemented!");
 }
 
 //_______________________________________________________________________