* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.4 2003/08/05 16:14:20 morsch
-Some problems with too big fluctuations corrected. (A. de Falco)
+/* $Id: */
-Revision 1.1 2003/01/06 10:13:09 morsch
-First commit.
-
-*/
+// Implementation of AliFastResponse for the Muon Spectrometer resolution.
+// The response depends on the charge of the muon and
+// the background level.
+// The class uses the instance of an object of type AliMUONFastTracking to
+// obtain the smearing parameters.
+// Author: andreas.morsch@cern.ch
#include "AliFastMuonTrackingRes.h"
#include "AliMUONFastTracking.h"
AliFastMuonTrackingRes::AliFastMuonTrackingRes() :
- AliFastResponse("Resolution", "Muon Tracking Resolution")
+ AliFastResponse("Resolution", "Muon Tracking Resolution"),
+ fBackground(0.),
+ fCharge(1.),
+ fFastTracking(0)
+{
+// Default constructor
+}
+
+AliFastMuonTrackingRes::AliFastMuonTrackingRes(const AliFastMuonTrackingRes & res)
+ :AliFastResponse(res),
+ fBackground(0.),
+ fCharge(1.),
+ fFastTracking(0)
{
- SetBackground();
+// Copy constructor
+ res.Copy(*this);
}
void AliFastMuonTrackingRes::Init()
{
+// Initialisation
fFastTracking = AliMUONFastTracking::Instance();
fFastTracking->Init(fBackground);
}
void AliFastMuonTrackingRes::Evaluate(Float_t p, Float_t theta , Float_t phi,
Float_t& pS, Float_t& thetaS, Float_t& phiS)
{
+//
+// Evaluate Gaussian smearing from given kinematics
+//
Double_t meanp = fFastTracking->MeanP (p, theta, phi, Int_t(fCharge));
Double_t sigmap = fFastTracking->SigmaP (p, theta, phi, Int_t(fCharge));
// Float_t dpmax = 5. + ip * 2.5;
// Float_t dpmax = 5. + ip * 2;
Float_t dpmax;
- if (sigmag2<999.) dpmax = 5. * (sigmap + sigmag2);
- else dpmax = 5. * sigmap;
+ if (sigmag2<999.) dpmax = 5. * TMath::Abs(sigmap + sigmag2);
+ else dpmax = 5. * TMath::Abs(sigmap);
Float_t dp = 100;
while (pS<0 || TMath::Abs(dp)>dpmax) {
pS = p + fitp->GetRandom();
thetaS = theta + gRandom->Gaus(meantheta,sigmatheta);
}
-
+AliFastMuonTrackingRes& AliFastMuonTrackingRes::operator=(const AliFastMuonTrackingRes& rhs)
+{
+// Assignment operator
+ rhs.Copy(*this);
+ return *this;
+}