X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STEER%2FAliMCQA.cxx;h=e8c15e3bb870814360ffd565d55fcec9619a130e;hb=ae1a1b1135e59fc3df98ebb8076897df83de506d;hp=f7415e091ffecac882c615610d91d4ae3cfc2863;hpb=116cbefdd457541a56d5dfd1a53b09c3ccc50964;p=u%2Fmrichter%2FAliRoot.git diff --git a/STEER/AliMCQA.cxx b/STEER/AliMCQA.cxx index f7415e091ff..e8c15e3bb87 100644 --- a/STEER/AliMCQA.cxx +++ b/STEER/AliMCQA.cxx @@ -13,7 +13,7 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* $Header$ */ +/* $Id$ */ /////////////////////////////////////////////////////////////////////////////// // // @@ -33,12 +33,13 @@ #include #include #include -#include #include -#include #include #include +#include +#include "AliLog.h" +#include "AliMC.h" #include "AliMCQA.h" #include "AliModule.h" #include "AliRun.h" @@ -148,16 +149,22 @@ AliMCQA::AliMCQA(Int_t ndets): // // Build list of volume names // + AliMC * mc = gAlice->GetMCApp(); for(i=0;i - ((*gAlice->Modules())[gAlice->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 + ((*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(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")); // @@ -169,37 +176,41 @@ AliMCQA::AliMCQA(Int_t ndets): } //_______________________________________________________________________ -void AliMCQA::Copy(AliMCQA &) const +void AliMCQA::Copy(TObject &) const { - Fatal("Copy ctor","Not implemented!\n"); + AliFatal("Not implemented!"); } //_______________________________________________________________________ AliMCQA::~AliMCQA() -{ + { // // Destructor // gROOT->GetListOfBrowsables()->Remove(this); + //if program crashes here - it probobly means that + //one of added browsables was deleted and not removed previously from that list + //skowron + if (fQAList) { fQAList->Delete(); delete fQAList; - fQAList=0; + fQAList = 0; } if (fQAHist) { fQAHist->Delete(); delete fQAHist; - fQAHist=0; + fQAHist = 0; } if (fVolNames) { fVolNames->Delete(); delete fVolNames; - fVolNames=0; + fVolNames = 0; } if (fModNames) { fModNames->Delete(); delete fModNames; - fModNames=0; + fModNames = 0; } delete [] fDetDone; delete fMPaveLabel; @@ -270,7 +281,7 @@ void AliMCQA::StepManager(Int_t id) static Double_t mpim=0; static Double_t mep=0; static Double_t mem=0; - Double_t mass=0; + Double_t mass = 0; Int_t num = gMC->TrackPid(); switch (num) { @@ -295,7 +306,8 @@ void AliMCQA::StepManager(Int_t id) mass=mem; break; default: - mass =gAlice->PDGDB()->GetParticle(num)->Mass(); + if (gAlice->PDGDB()->GetParticle(num)) + mass = gAlice->PDGDB()->GetParticle(num)->Mass(); break; }