]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Replaced TArrayI expansion with Root version.
authornilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Jun 2002 17:31:03 +0000 (17:31 +0000)
committernilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Jun 2002 17:31:03 +0000 (17:31 +0000)
ITS/AliITSmodule.cxx

index 73bbfa895296c9da707e949f8a65fa82c23a9823..28b2a2c3ed59890d2753da1493b5faa21b3d0b57 100644 (file)
 
 /*
 $Log$
+Revision 1.11  2002/06/04 18:43:15  nilsen
+Fix to avoid divide by zero problem in MedianHitG and MedianHitL for track
+that enter and exit the same side of a detector sensitive volume. Needed
+for Fast simulation. Thanks to Nicola Carrer.
+
 Revision 1.10  2002/03/15 17:21:54  nilsen
 Removed zero-ing of fModules variable in constructors.
 
@@ -144,18 +149,10 @@ Int_t AliITSmodule::AddHit(AliITShit* hit,Int_t t,Int_t h) {
     fHitsM->AddLast(new AliITShit(*hit));
     Int_t fNhitsM = fHitsM->GetEntriesFast();
     if(fNhitsM-1>=fTrackIndex->GetSize()){ // need to expand the TArrayI
-       TArrayI *p = new TArrayI(fNhitsM+64);
-       for(Int_t i=0;i<fTrackIndex->GetSize();i++) 
-           (*p)[i] = fTrackIndex->At(i);
-       delete fTrackIndex;
-       fTrackIndex = p;
+      fTrackIndex->Set(fNhitsM+64);
     } // end if
     if(fNhitsM-1>=fHitIndex->GetSize()){ // need to expand the TArrayI
-       TArrayI *p = new TArrayI(fNhitsM+64);
-       for(Int_t i=0;i<fHitIndex->GetSize();i++) 
-           (*p)[i] = fHitIndex->At(i);
-       delete fHitIndex;
-       fHitIndex = p;
+      fHitIndex->Set(fNhitsM+64);
     } // end if
     (*fTrackIndex)[fNhitsM-1] = t;
     (*fHitIndex)[fNhitsM-1]   = h;