]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added protection against missing ESD pointer
authorshahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Jun 2010 13:35:37 +0000 (13:35 +0000)
committershahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Jun 2010 13:35:37 +0000 (13:35 +0000)
ITS/AliITSMultReconstructor.cxx
ITS/AliITSVertexer.cxx

index 53e4338fd2506951354636eb1e40348053e1b050..a7c7a2603e772d3d6bae4ec63011065b93091d5c 100644 (file)
@@ -269,6 +269,8 @@ void AliITSMultReconstructor::Reconstruct(AliESDEvent* esd, TTree* treeRP)
   // After this method has been called, the clusters of the two layers
   // and the tracklets can be retrieved by calling the Get'er methods.
 
+  if (!treeRP) { AliError(" Invalid ITS cluster tree !\n"); return; }
+  if (!esd) {AliError("ESDEvent is not available, use old reconstructor"); return;}
   // reset counters
   if (fMult) delete fMult; fMult = 0;
   fNClustersLay1 = 0;
@@ -276,8 +278,6 @@ void AliITSMultReconstructor::Reconstruct(AliESDEvent* esd, TTree* treeRP)
   fNTracklets = 0; 
   fNSingleCluster = 0;
   //
-  if (!treeRP) { AliError(" Invalid ITS cluster tree !\n"); return; }
-  //
   fESDEvent = esd;
   fTreeRP = treeRP;
   //
@@ -340,7 +340,7 @@ void AliITSMultReconstructor::FindTracklets(const Float_t *vtx)
   //
   LoadClusterArrays(fTreeRP);
   // flag clusters used by ESD tracks
-  ProcessESDTracks();
+  if (fESDEvent) ProcessESDTracks();
 
   if (!vtx) return;
 
@@ -913,6 +913,7 @@ void AliITSMultReconstructor::ProcessESDTracks()
   // Flag the clusters used by ESD tracks
   // Flag primary tracks to be used for multiplicity counting 
   //
+  if (!fESDEvent) return;
   AliESDVertex* vtx = (AliESDVertex*)fESDEvent->GetPrimaryVertexTracks();
   if (!vtx) vtx = (AliESDVertex*)fESDEvent->GetPrimaryVertexSPD();
   if (!vtx) {
index 4c3ca507b94f048c5800524448c9517bc959abc1..ddcd63049c7310638d1a089babb205a5cc08802f 100644 (file)
@@ -68,6 +68,7 @@ void AliITSVertexer::FindMultiplicity(TTree *itsClusterTree){
   // Invokes AliITSMultReconstructor to determine the
   // charged multiplicity in the pixel layers
   if(fMult){delete fMult; fMult = 0;}
+
   Bool_t success=kTRUE;
   Bool_t cosmics=kFALSE; 
   if(!fCurrentVertex)success=kFALSE;