-
-//__________________________________________
-void AliMUONv1::StepManagerOld()
-{
- // Old Stepmanager for the chambers
- Int_t copy, id;
- static Int_t idvol =-1;
- static Int_t vol[2];
- Int_t ipart;
- TLorentzVector pos;
- TLorentzVector mom;
- Float_t theta,phi;
- Float_t destep, step;
-
- static Float_t sstep;
- static Float_t eloss, eloss2, xhit, yhit, zhit, tof, tlength;
- const Float_t kBig = 1.e10;
- static Float_t hits[15];
-
- TClonesArray &lhits = *fHits;
-
- //
- //
- // Only charged tracks
- if( !(gMC->TrackCharge()) ) return;
- //
- // Only gas gap inside chamber
- // Tag chambers and record hits when track enters
- id=gMC->CurrentVolID(copy);
- vol[0] = GetChamberId(id);
- idvol = vol[0] -1;
-
- if (idvol == -1) return;
-
- //
- // Get current particle id (ipart), track position (pos) and momentum (mom)
- gMC->TrackPosition(pos);
- gMC->TrackMomentum(mom);
-
- ipart = gMC->TrackPid();
-
- //
- // momentum loss and steplength in last step
- destep = gMC->Edep();
- step = gMC->TrackStep();
- // cout<<"------------"<<step<<endl;
- //
- // record hits when track enters ...
- if( gMC->IsTrackEntering()) {
-
- gMC->SetMaxStep(fMaxStepGas);
- Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
- Double_t rt = TMath::Sqrt(tc);
- Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
- Double_t tx = mom[0]/pmom;
- Double_t ty = mom[1]/pmom;
- Double_t tz = mom[2]/pmom;
- Double_t s = ((AliMUONChamber*)(*fChambers)[idvol])
- ->ResponseModel()
- ->Pitch()/tz;
- theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
- phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
- hits[0] = Float_t(ipart); // Geant3 particle type
- hits[1] = pos[0]+s*tx; // X-position for hit
- hits[2] = pos[1]+s*ty; // Y-position for hit
- hits[3] = pos[2]+s*tz; // Z-position for hit
- hits[4] = theta; // theta angle of incidence
- hits[5] = phi; // phi angle of incidence
- hits[8] = 0;//PadHits does not exist anymore (Float_t) fNPadHits; // first padhit
- hits[9] = -1; // last pad hit
- hits[10] = mom[3]; // hit momentum P
- hits[11] = mom[0]; // Px
- hits[12] = mom[1]; // Py
- hits[13] = mom[2]; // Pz
- tof=gMC->TrackTime();
- hits[14] = tof; // Time of flight
- tlength = 0;
- eloss = 0;
- eloss2 = 0;
- sstep=0;
- xhit = pos[0];
- yhit = pos[1];
- zhit = pos[2];
- Chamber(idvol).ChargeCorrelationInit();
- // Only if not trigger chamber
-
-// printf("---------------------------\n");
-// printf(">>>> Y = %f \n",hits[2]);
-// printf("---------------------------\n");
-
-
-
- // if(idvol < AliMUONConstants::NTrackingCh()) {
-// //
-// // Initialize hit position (cursor) in the segmentation model
-// ((AliMUONChamber*) (*fChambers)[idvol])
-// ->SigGenInit(pos[0], pos[1], pos[2]);
-// } else {
-// //geant3->Gpcxyz();
-// //printf("In the Trigger Chamber #%d\n",idvol-9);
-// }
- }
- eloss2+=destep;
- sstep+=step;
-
- // cout<<sstep<<endl;
-
- //
- // Calculate the charge induced on a pad (disintegration) in case
- //
- // Mip left chamber ...
- if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
- gMC->SetMaxStep(kBig);
- eloss += destep;
- tlength += step;
-
- Float_t x0,y0,z0;
- Float_t localPos[3];
- Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
- gMC->Gmtod(globalPos,localPos,1);
-
- if(idvol < AliMUONConstants::NTrackingCh()) {
-// tracking chambers
- x0 = 0.5*(xhit+pos[0]);
- y0 = 0.5*(yhit+pos[1]);
- z0 = 0.5*(zhit+pos[2]);
- } else {
-// trigger chambers
- x0 = xhit;
- y0 = yhit;
- z0 = 0.;
- }
-
-
- // if (eloss >0) MakePadHits(x0,y0,z0,eloss,tof,idvol);
-
-
- hits[6] = tlength; // track length
- hits[7] = eloss2; // de/dx energy loss
-
-
- // if (fNPadHits > (Int_t)hits[8]) {
- // hits[8] = hits[8]+1;
- // hits[9] = 0: // PadHits does not exist anymore (Float_t) fNPadHits;
- //}
-//
-// new hit
-
- new(lhits[fNhits++])
- AliMUONHit(fIshunt, gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
- eloss = 0;
- //
- // Check additional signal generation conditions
- // defined by the segmentation
- // model (boundary crossing conditions)
- // only for tracking chambers
- } else if
- ((idvol < AliMUONConstants::NTrackingCh()) &&
- ((AliMUONChamber*) (*fChambers)[idvol])->SigGenCond(pos[0], pos[1], pos[2]))
- {
- ((AliMUONChamber*) (*fChambers)[idvol])
- ->SigGenInit(pos[0], pos[1], pos[2]);
-
- Float_t localPos[3];
- Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
- gMC->Gmtod(globalPos,localPos,1);
-
- eloss += destep;
-
- // if (eloss > 0 && idvol < AliMUONConstants::NTrackingCh())
- // MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),pos[2],eloss,tof,idvol);
- xhit = pos[0];
- yhit = pos[1];
- zhit = pos[2];
- eloss = 0;
- tlength += step ;
- //
- // nothing special happened, add up energy loss
- } else {
- eloss += destep;
- tlength += step ;
- }
-}
-
-//______________________________________________________________________________
-void AliMUONv1::FinishRun()
-{
-// Print debug info
-// ---
-
- if (GetDebug() <= 1) return;
-
- // Print the global positions of detection elements
- for (Int_t i=0; i<AliMUONConstants::NCh(); i++) {
-
- cout << "Chamber: " << i+1 << endl;
- cout << "===================" << endl;
-
- AliMUONGeometrySVMap* svMap
- = Chamber(i).GetGeometry()->GetSVMap();
-
- svMap->SortPositions();
- svMap->PrintPositions();
- svMap->ClearPositions();
- }
- cout << endl;
-}