+
+// //______________________________________________________________________
+// void AliITSv11::StepManager(){
+// //
+// // Called for every step in the ITS, then calles the AliITShit class
+// // creator with the information to be recoreded about that hit.
+// //
+// Int_t copy, id;
+// TLorentzVector position, momentum;
+// static TLorentzVector position0;
+// static Int_t stat0=0;
+
+// if(!(this->IsActive())){
+// return;
+// } // end if !Active volume.
+
+// if(!(gMC->TrackCharge())) return;
+
+// id=gMC->CurrentVolID(copy);
+
+// Bool_t sensvol = kFALSE;
+// for(Int_t kk=0;kk<6;kk++)if(id == fIdSens[kk])sensvol=kTRUE;
+// if(sensvol && (gMC->IsTrackExiting())){
+// copy = fTrackReferences->GetEntriesFast();
+// TClonesArray &lTR = *fTrackReferences;
+// // Fill TrackReference structure with this new TrackReference.
+// new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
+// } // if Outer ITS mother Volume
+
+
+// Int_t copy1,copy2;
+// Int_t vol[5];
+// TClonesArray &lhits = *fHits;
+// //
+// // Track status
+// vol[3] = 0;
+// vol[4] = 0;
+// if(gMC->IsTrackInside()) vol[3] += 1;
+// if(gMC->IsTrackEntering()) vol[3] += 2;
+// if(gMC->IsTrackExiting()) vol[3] += 4;
+// if(gMC->IsTrackOut()) vol[3] += 8;
+// if(gMC->IsTrackDisappeared()) vol[3] += 16;
+// if(gMC->IsTrackStop()) vol[3] += 32;
+// if(gMC->IsTrackAlive()) vol[3] += 64;
+// //
+// // Fill hit structure.
+// if(!(gMC->TrackCharge())) return;
+// //
+// // Only entering charged tracks
+// if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
+// vol[0] = 1;
+// id = gMC->CurrentVolOffID(2,copy);
+// //detector copy in the ladder = 1<->4 (ITS1 < I101 < I103 < I10A)
+// vol[1] = copy;
+// gMC->CurrentVolOffID(3,copy1);
+// //ladder copy in the module = 1<->2 (I10A < I12A)
+// gMC->CurrentVolOffID(4,copy2);
+// //module copy in the layer = 1<->10 (I12A < IT12)
+// vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
+// } else if(id == fIdSens[1]){
+// vol[0] = 2;
+// id = gMC->CurrentVolOffID(2,copy);
+// //detector copy in the ladder = 1<->4 (ITS2 < I1D1 < I1D3 < I20A)
+// vol[1] = copy;
+// gMC->CurrentVolOffID(3,copy1);
+// //ladder copy in the module = 1<->4 (I20A < I12A)
+// gMC->CurrentVolOffID(4,copy2);
+// //module copy in the layer = 1<->10 (I12A < IT12)
+// vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
+// } else if(id == fIdSens[2]){
+// vol[0] = 3;
+// id = gMC->CurrentVolOffID(1,copy);
+// //detector copy in the ladder = 1<->6 (ITS3 < I302 < I004)
+// vol[1] = copy;
+// id = gMC->CurrentVolOffID(2,copy);
+// //ladder copy in the layer = 1<->14 (I004 < IT34)
+// vol[2] = copy;
+// } else if(id == fIdSens[3]){
+// vol[0] = 4;
+// id = gMC->CurrentVolOffID(1,copy);
+// //detector copy in the ladder = 1<->8 (ITS4 < I402 < I005)
+// vol[1] = copy;
+// id = gMC->CurrentVolOffID(2,copy);
+// //ladder copy in the layer = 1<->22 (I005 < IT34))
+// vol[2] = copy;
+// }else if(id == fIdSens[4]){
+// vol[0] = 5;
+// id = gMC->CurrentVolOffID(1,copy);
+// //detector copy in the ladder = 1<->22 (ITS5 < I562 < I565)
+// vol[1] = copy;
+// id = gMC->CurrentVolOffID(2,copy);
+// //ladder copy in the layer = 1<->34 (I565 < IT56)
+// vol[2] = copy;
+// }else if(id == fIdSens[5]){
+// vol[0] = 6;
+// id = gMC->CurrentVolOffID(1,copy);
+// //detector copy in the ladder = 1<->25 (ITS6 < I566 < I569)
+// vol[1] = copy;
+// id = gMC->CurrentVolOffID(2,copy);
+// //ladder copy in the layer = 1<->38 (I569 < IT56)
+// vol[2] = copy;
+// } else {
+// return; // not an ITS volume?
+// } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
+// //
+// gMC->TrackPosition(position);
+// gMC->TrackMomentum(momentum);
+// vol[4] = stat0;
+// if(gMC->IsTrackEntering()){
+// position0 = position;
+// stat0 = vol[3];
+// return;
+// } // end if IsEntering
+// // Fill hit structure with this new hit.
+
+// new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,
+// gMC->Edep(),gMC->TrackTime(),position,
+// position0,momentum);
+
+// position0 = position;
+// stat0 = vol[3];
+
+// return;
+// }
+
+