- //
- Int_t id,copy,copy1;
- static Float_t hits[7];
- static Float_t edep;
- static Int_t vol[2];
- TLorentzVector pos;
-
- TClonesArray &lhits = *fHits;
-
- if(!gMC->IsTrackAlive()) return; // particle has disappeared
- Float_t charge = gMC->TrackCharge();
- if(TMath::Abs(charge)<=0.) return; //take only charged particles
- // gMC->Gpcxyz();
- id=gMC->CurrentVolID(copy);
-
-
- // printf("gMC->ckine->ipart %d",gMC->ckine->ipart);
- // Check the sensetive volume
- if(id==fIdSens1 ) {
- if(gMC->IsTrackEntering()) {
- gMC->CurrentVolOffID(2,copy);
- vol[0]=copy;
- gMC->CurrentVolOffID(1,copy1);
- vol[1]=copy1;
- gMC->TrackPosition(pos);
- hits[0] = pos[0];
- hits[1] = pos[1];
- hits[2] = pos[2];
- Float_t etot=gMC->Etot();
- hits[4]=etot;
- Int_t part= gMC->TrackPid();
- hits[5]=part;
- Float_t ttime=gMC->TrackTime();
- hits[6]=ttime*1e9;
- edep=0;
- }
- if(gMC->IsTrackInside()) {
- Float_t de=gMC->Edep();
- edep=edep+de;
- // printf ("E deposition %f\n",edep);
- // for (i=0; i<=6; i++){
- // printf(" HITS on START inside %f\n",hits[i]); }
- }
- if(gMC->IsTrackExiting()) {
- Float_t de=gMC->Edep();
- edep=edep+de;
- hits[3]=edep*1e3;
-
- // for (i=0; i<=6; i++){
- // printf(" HITS on START Exit %f\n",hits[i]); }
- //for (i=0; i<=1; i++) { printf("START vol %d\n",vol[i]);}
-
- new(lhits[fNhits++]) AliSTARThit(fIshunt,gAlice->CurrentTrack(),vol,hits);
- }
- }
-//---------------------------------------------------------------------