]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Protection involving the existance of gMC added. Usefull when the ITS is used
authornilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Feb 2004 21:44:51 +0000 (21:44 +0000)
committernilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Feb 2004 21:44:51 +0000 (21:44 +0000)
without a Monte Carlo.

ITS/AliITS.cxx

index 19b0a77616ee84def3ec511ab04e2bb4389359c0..001322c255637cc73f370e3a14d28f6a0c6ca9ca 100644 (file)
@@ -194,7 +194,7 @@ AliITS::AliITS(const char *name, const char *title):AliDetector(name,title){
 
     fIshunt     = 0;  // not zeroed in AliDetector
     fHits       = new TClonesArray("AliITShit", 1560);//not done in AliDetector
-    gAlice->GetMCApp()->AddHitList(fHits);  // Not done in AliDetector.
+    if(gAlice->GetMCApp()) gAlice->GetMCApp()->AddHitList(fHits);// Not done in AliDetector.
 
     fEuclidOut  = 0;
     fITSgeom    = 0;
@@ -360,7 +360,7 @@ void AliITS::Init(){
 
     SetDefaults();
     // Array of TStrings
-    for(i=0;i<fIdN;i++) fIdSens[i] = gMC->VolId(fIdName[i]);
+    if(gMC) for(i=0;i<fIdN;i++) fIdSens[i] = gMC->VolId(fIdName[i]);
 }
 //______________________________________________________________________
 void AliITS::SetDefaults(){