Temporary protection if one runs raw->sdigits for the real data.
authorkowal2 <kowal2@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 23 Jul 2010 13:08:29 +0000 (13:08 +0000)
committerkowal2 <kowal2@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 23 Jul 2010 13:08:29 +0000 (13:08 +0000)
This will be removed when we implement the right treatment of the LHC clock phase.

TPC/AliTPC.cxx

index 23a8d2c..19f97c7 100644 (file)
@@ -1058,12 +1058,22 @@ Bool_t AliTPC::Raw2SDigits(AliRawReader* rawReader){
     } // end of the sector digitization
   }
   // get LHC clock phase from the digits tree
+
   TParameter<float> *ph; 
-    ph = (TParameter<float>*)fLoader->TreeD()->GetUserInfo()->FindObject("lhcphase0");
+  Float_t phase;
+  TTree *digtree = fLoader->TreeD();
+  //
+  if(digtree){ // if TreeD exists
+    ph = (TParameter<float>*)digtree->GetUserInfo()->FindObject("lhcphase0");
+    phase = ph->GetVal();
+  }
+  else{ //TreeD does not exist
+    phase = 0.; 
+  }
     //
     // store lhc clock phase in S-digits tree
     //
-    fLoader->TreeS()->GetUserInfo()->Add(new TParameter<float>("lhcphase0",ph->GetVal()));
+    fLoader->TreeS()->GetUserInfo()->Add(new TParameter<float>("lhcphase0",phase));
    //
    fLoader->WriteSDigits("OVERWRITE");