-
- // Detection elements ids
- AliMUONGeometryTransformStore* transforms
- = Chamber(iChamber-1).GetGeometry()->GetTransformStore();
- const TGeoCombiTrans* kTransform
- = transforms->FindBySensitiveVolume(CurrentVolumePath());
-
- Int_t detElemId = 0;
- if (kTransform) detElemId = kTransform->GetUniqueID();
-
- if (!detElemId) {
- cerr << "Chamber id: "
- << setw(3) << iChamber << " "
- << "Current SV: "
- << CurrentVolumePath()
- << " detElemId: "
- << setw(5) << detElemId
- << endl;
- Double_t x, y, z;
- gMC->TrackPosition(x, y, z);
- cerr << " global position: "
- << x << ", " << y << ", " << z
- << endl;
- AliWarning("DetElemId not identified.");
- }
-
- // One hit per chamber
- GetMUONData()->AddHit(fIshunt,
- gAlice->GetMCApp()->GetCurrentTrackNumber(),
- iChamber, ipart,
- fTrackPosition.X(),
- fTrackPosition.Y()+yAngleEffect,
- fTrackPosition.Z(),
- gMC->TrackTime(),
- fTrackMomentum.P(),
- theta,
- phi,
- fStepSum[idvol],
- fDestepSum[idvol],
- fTrackPosition.X(),
- fTrackPosition.Y(),
- fTrackPosition.Z());
-
-// if (GetDebug()){
-// Info("StepManager Exit","Particle exiting from chamber %d",iChamber);
-// Info("StepManager Exit","StepSum %f eloss geant %g ",fStepSum[idvol],fDestepSum[idvol]);
-// Info("StepManager Exit","Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()) ;
-// }
- fStepSum[idvol] =0; // Reset for the next event
- fDestepSum[idvol]=0; // Reset for the next event
- }
-}
-
-//__________________________________________
-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();
+ else if (fAngleEffect && fMagEffect) {
+ if ( (betaxGamma >3.2) && (TMath::Abs(thetawires*kRaddeg)<=15.) ) {
+ betaxGamma=TMath::Log(betaxGamma);
+ eLossParticleELossMip = fElossRatio->Eval(betaxGamma);
+ // 10 degrees is a reference for a model (arbitrary)
+ sigmaEffect10degrees=fAngleEffect10->Eval(eLossParticleELossMip);// in micrometers
+ // Angle with respect to the wires assuming that chambers are perpendicular to the z axis.
+ sigmaEffectThetadegrees = sigmaEffect10degrees/fMagAngleEffectNorma->Eval(thetawires*kRaddeg,bField[0]/10.); // For 5mm gap
+ if ( (iChamber==1) || (iChamber==2) )
+ sigmaEffectThetadegrees/=(1.09833e+00+1.70000e-02*(thetawires*kRaddeg)); // The gap is different (4mm)
+ yAngleEffect=1.e-04*gRandom->Gaus(0,sigmaEffectThetadegrees); // Error due to the angle effect in cm
+ }
+ }