* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-*/
-
+/* $Id$ */
+
///////////////////////////////////////////////////////////////////////////////
// //
// Simple TRD Monte Carlo class //
#include <TLorentzVector.h>
#include "AliRun.h"
-
-#include "AliTRDsimpleMC.h"
#include "AliTRDgeometry.h"
+#include "AliTRDparameter.h"
+#include "AliTRDsimpleMC.h"
#include "AliTRDv1.h"
+#include "AliTRDparameter.h"
+#include "AliMC.h"
ClassImp(AliTRDsimpleMC)
//_____________________________________________________________________________
-AliTRDsimpleMC::AliTRDsimpleMC():AliMC()
+AliTRDsimpleMC::AliTRDsimpleMC()
{
//
// AliTRDsimpleMC default constructor
fTrackEntering = kFALSE;
fTRD = NULL;
+ fPar = NULL;
}
//_____________________________________________________________________________
AliTRDsimpleMC::AliTRDsimpleMC(const char *name, const char *title)
- :AliMC(name,title)
+ :TVirtualMC(name,title,kFALSE)
{
//
// AliTRDsimpleMC default constructor
fTrackEntering = kFALSE;
fTRD = NULL;
+ fPar = NULL;
}
//_____________________________________________________________________________
-AliTRDsimpleMC::AliTRDsimpleMC(const AliTRDsimpleMC &m)
+AliTRDsimpleMC::AliTRDsimpleMC(const AliTRDsimpleMC &m):TVirtualMC(m)
{
//
// AliTRDsimpleMC copy constructor
}
//_____________________________________________________________________________
-void AliTRDsimpleMC::Copy(TObject &m)
+void AliTRDsimpleMC::Copy(TObject &m) const
{
//
// Copy function
// Starts a new track.
//
+ if (!fPar) {
+ fPar = new AliTRDparameter("TRDparameter","Standard TRD parameter");
+ }
+
if (!fTRD) {
fTRD = (AliTRDv1 *) gAlice->GetDetector("TRD");
- AliTRDgeometry *geometry = fTRD->GetGeometry();
- fX0 = geometry->GetTime0(0) - AliTRDgeometry::DrThick();
+ fX0 = fPar->GetTime0(0) - AliTRDgeometry::DrThick();
}
fTRD->ResetHits();
fTrackY = 0.0;
fTrackZ = 0.0;
- gAlice->SetCurrentTrack(-1);
+ gAlice->GetMCApp()->SetCurrentTrack(0);
}
}
+//_____________________________________________________________________________
+void AliTRDsimpleMC::TrackPosition(Double_t &x, Double_t &y, Double_t &z) const
+{
+ //
+ // Track Position
+ //
+
+ x = fTrackX;
+ y = fTrackY;
+ z = fTrackZ;
+
+}
+
//_____________________________________________________________________________
void AliTRDsimpleMC::TrackMomentum(TLorentzVector& momentum) const
{
}
+//_____________________________________________________________________________
+void AliTRDsimpleMC::TrackMomentum(Double_t &px, Double_t &py,
+ Double_t &pz, Double_t &et) const
+{
+ //
+ // Track Momentum
+ //
+
+ px = fTrackPx;
+ py = fTrackPy;
+ pz = fTrackPz;
+ et = fTrackEtot;
+
+}
+
//_____________________________________________________________________________
Int_t AliTRDsimpleMC::VolId(const Text_t* volName) const
{
Int_t volId = -1;
- if (strcmp(volName,"UL05") == 0) {
+ if (strcmp(volName,"UJ00") == 0) {
volId = kVolDrRg;
}
- else if (strcmp(volName,"UL06") == 0) {
+ else if (strcmp(volName,"UK00") == 0) {
volId = kVolAmRg;
}
- else if (strcmp(volName,"UCII") == 0) {
+ else if (strcmp(volName,"UC00") == 0) {
volId = kVolDrCh;
}
}
//_____________________________________________________________________________
-Int_t AliTRDsimpleMC::CurrentVolOffID(Int_t off, Int_t ©No) const
+const char *AliTRDsimpleMC::CurrentVolName() const
+{
+ //
+ // Check for the current volume
+ //
+
+ const char *volName = "UA00";
+
+ // Drift region
+ if ((fTrackX-fX0) < AliTRDgeometry::DrThick()) {
+ volName = "UJ00";
+ }
+ else if ((fTrackX-fX0) < (AliTRDgeometry::DrThick() +
+ AliTRDgeometry::AmThick())) {
+ volName = "UK00";
+ }
+
+ return volName;
+
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDsimpleMC::CurrentVolOffID(Int_t , Int_t ©No) const
{
//
// Check for the current volume