--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+
+#include "AliFastDetector.h"
+#include "AliFastResponse.h"
+#include "AliGeometry.h"
+
+#include <TList.h>
+#include <TIterator.h>
+#include <TString.h>
+
+ClassImp(AliFastDetector)
+AliFastDetector::AliFastDetector()
+{
+// Default Constructor
+ fName = "FastDetector";
+ fTitle = "Fast Detector Base Class";
+ fLnkD = 0;
+ fLnkR = 0;
+
+ fResponses = 0;
+ fSubdetectors = 0;
+}
+
+AliFastDetector::AliFastDetector(char* Name, char* Title):
+ TNamed(Name, Title)
+{
+// Constructor
+ fSubdetectors = new TList();
+ fResponses = new TList();
+}
+
+AliFastDetector::~AliFastDetector()
+{
+// Destructor
+ delete fSubdetectors;
+ delete fResponses;
+}
+
+
+void AliFastDetector::Init()
+{
+//
+// Initialisation
+//
+ TIter nextRes(fResponses);
+ AliFastResponse *res;
+ //
+ // Loop over responses and initialize
+ while((res = (AliFastResponse*)nextRes())) {
+ res->Init();
+ }
+
+ TIter nextDet(fSubdetectors);
+ AliFastDetector *det;
+ //
+ // Loop over subdetectors and initialize
+ while((det = (AliFastDetector*)nextDet())) {
+ det->Init();
+ }
+ //
+ TObject* obj;
+
+ if ((obj = fResponses->FindObject("Efficiency")))
+ {
+
+ fEfficiency = (AliFastResponse*) obj;
+ printf("Detector %s provides Efficiency: %s\n",
+ fName.Data(), fEfficiency->GetTitle());
+ }
+
+ if ((obj = fResponses->FindObject("Resolution")))
+ {
+ fResolution = (AliFastResponse*) obj;
+ printf("Detector %s provides Resolution: %s\n",
+ fName.Data(), fResolution->GetTitle());
+ }
+}
+
+Float_t AliFastDetector::EvaluateEfficiency(AliFastParticle* part)
+{
+ TIter nextDet(fSubdetectors);
+ AliFastDetector *det;
+ //
+ // Loop over subdetectors
+ Float_t eff = 1;
+ while((det = (AliFastDetector*)nextDet())) {
+ eff *= det->EvaluateEfficiency(part);
+ }
+ return eff;
+}
+
+Bool_t AliFastDetector::EvaluateAcceptance(AliFastParticle* part)
+{
+ //
+ // Loop over subdetectors
+ Bool_t acc = kFALSE;
+
+ if (fSubdetectors) {
+ TIter nextDet(fSubdetectors);
+ AliFastDetector *det;
+ while((det = (AliFastDetector*)nextDet()) && !acc) {
+ acc = (acc || det->EvaluateAcceptance(part));
+ }
+ } else {
+ if (fGeometry)
+ acc = fGeometry->Impact((TParticle*) part);
+ }
+
+ return acc;
+}
+
+void AliFastDetector::EvaluateResponse(AliFastParticle* part)
+{
+ ;
+}
+
+void AliFastDetector::
+AddSubdetector(AliFastDetector *Detector, char* Name)
+{
+//
+// Add detector to list
+ fSubdetectors->Add(Detector);
+}
+
+
+
+void AliFastDetector::
+AddResponse(AliFastResponse *Response)
+{
+//
+// Add detector to list
+ fResponses->Add(Response);
+}
+
+
+AliFastDetector* AliFastDetector::FirstSubdetector()
+{
+// Iterator over generators: Initialisation
+ fLnkD = fSubdetectors->FirstLink();
+ if (fLnkD) {
+ return (AliFastDetector*) (fLnkD->GetObject());
+ } else {
+ return 0;
+ }
+}
+
+AliFastDetector* AliFastDetector::NextSubdetector()
+{
+// Iterator over generators: Increment
+ fLnkD = fLnkD->Next();
+ if (fLnkD) {
+ return (AliFastDetector*) (fLnkD->GetObject());
+ } else {
+ return 0;
+ }
+}
+
+
+AliFastResponse* AliFastDetector::FirstResponse()
+{
+// Iterator over generators: Initialisation
+ fLnkR = fResponses->FirstLink();
+ if (fLnkR) {
+ return (AliFastResponse*) (fLnkR->GetObject());
+ } else {
+ return 0;
+ }
+}
+
+AliFastResponse* AliFastDetector::NextResponse()
+{
+// Iterator over generators: Increment
+ fLnkR = fLnkR->Next();
+ if (fLnkR) {
+ return (AliFastResponse*) (fLnkR->GetObject());
+ } else {
+ return 0;
+ }
+}
+
+
--- /dev/null
+#ifndef ALIFASTDETECTOR_H
+#define ALIFASTDETECTOR_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+#include <TNamed.h>
+class TList;
+class TObjLink;
+class AliFastResponse;
+class AliFastParticle;
+class AliGeometry;
+
+class AliFastDetector : public TNamed {
+
+ public:
+ AliFastDetector();
+ AliFastDetector(char* Name, char* Title);
+ virtual ~AliFastDetector();
+ virtual void Init();
+ virtual void SetGeometry(AliGeometry* geom)
+ {fGeometry = geom;}
+
+ virtual AliGeometry* GetGeometry() const
+ {return fGeometry;}
+ //
+ // Add a new subdetector
+ virtual void AddSubdetector(AliFastDetector *Detector, char* Name);
+ virtual TList* Subdetectors() {return fSubdetectors;}
+ //
+ // Add a new response
+ virtual void AddResponse(AliFastResponse *Response);
+ virtual TList* Responses() {return fResponses;}
+ virtual Float_t EvaluateEfficiency(AliFastParticle* part);
+ virtual Bool_t EvaluateAcceptance(AliFastParticle* part);
+ virtual void EvaluateResponse(AliFastParticle* part);
+
+ // Iterators
+ AliFastDetector* FirstSubdetector();
+ AliFastDetector* NextSubdetector();
+ AliFastResponse* FirstResponse();
+ AliFastResponse* NextResponse();
+ protected:
+ TList *fSubdetectors; // List of Subdetectors
+ TList *fResponses; // Responses
+ TObjLink *fLnkD; // Pointer to detector in list
+ TObjLink *fLnkR; // Pointer to response in list
+ AliFastResponse *fEfficiency; // Efficiency Simulation
+ AliFastResponse *fResolution; // Resolution Simulation
+ AliGeometry *fGeometry; // Geometry
+ ClassDef(AliFastDetector,1) // Base class for fast detector
+};
+
+#endif
+
+
+
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+
+#include "AliFastEvent.h"
+
+ClassImp(AliFastEvent)
--- /dev/null
+#ifndef ALIFASTEVENT_H
+#define ALIFASTEVENT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+#include <TObject.h>
+#include <TArrayF.h>
+
+class AliFastEvent : public TObject {
+ public:
+ AliFastEvent(){;}
+ virtual ~AliFastEvent(){;}
+ virtual void SetMultiplicty(Int_t mul)
+ {fMultiplicity = mul;}
+ virtual Int_t GetMultiplicty(Int_t mul)
+ {return fMultiplicity;}
+ virtual void SetVertex(const TArrayF &o)
+ {
+ fEventVertex[0] = o.At(0);
+ fEventVertex[1] = o.At(1);
+ fEventVertex[2] = o.At(2);
+ }
+
+ virtual void GetVertex(TArrayF &o) const
+ {
+ o[0] = fEventVertex.At(0);
+ o[1] = fEventVertex.At(1);
+ o[2] = fEventVertex.At(2);
+ }
+
+ protected:
+ Int_t fMultiplicity; // Event Multiplicity
+ TArrayF fEventVertex; // Event primary vertex
+
+ ClassDef(AliFastEvent,1) // Base class for fast event
+};
+
+#endif
+
+
+
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+
+#include "AliFastParticle.h"
+
+ClassImp(AliFastParticle)
--- /dev/null
+#ifndef ALIFASTPARTICLE_H
+#define ALIFASTPARTICLE_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+#include <TParticle.h>
+class AliFastParticle : public TParticle {
+ public:
+ AliFastParticle(){;}
+ virtual ~AliFastParticle(){;}
+ protected:
+ ClassDef(AliFastParticle,1) // Base class for fast particle
+};
+
+#endif
+
+
+
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+
+#include "AliFastResponse.h"
+#include "AliFastParticle.h"
+
+ClassImp(AliFastResponse)
+
+
+Float_t AliFastResponse::Evaluate(AliFastParticle* part)
+{
+//
+// Basic implementation of this method
+//
+ Float_t theta = part->Theta();
+ Float_t phi = part->Phi();
+ Float_t pt = part->Pt();
+ Float_t eff = Evaluate(pt, theta, phi);
+ return eff;
+}
+
+void AliFastResponse::Evaluate(Float_t p, Float_t theta , Float_t phi,
+ Float_t& pS, Float_t& thetaS, Float_t& phiS)
+{
+//
+// Basic implementation of this method
+//
+ pS = p;
+ thetaS = theta;
+ phiS = phi;
+}
+
--- /dev/null
+#ifndef ALIFASTRESPONSE_H
+#define ALIFASTRESPONSE_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+#include <TNamed.h>
+class AliFastParticle;
+
+class AliFastResponse : public TNamed {
+ public:
+ AliFastResponse(){;}
+ AliFastResponse(char* Name, char* Title) : TNamed(Name, Title) {}
+ virtual ~AliFastResponse(){}
+ virtual void Init() = 0;
+ virtual Float_t Evaluate(Float_t pt, Float_t theta , Float_t phi)
+ {return -1.;}
+ virtual void Evaluate(Float_t p, Float_t theta , Float_t phi,
+ Float_t& pS, Float_t& thetaS, Float_t& phiS);
+ virtual Float_t Evaluate(AliFastParticle* part);
+ protected:
+ ClassDef(AliFastResponse,1) // Base class for fast response
+};
+
+#endif
--- /dev/null
+#ifdef __CINT__
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class AliFastDetector+;
+#pragma link C++ class AliFastResponse+;
+#pragma link C++ class AliFastParticle+;
+#pragma link C++ class AliFastEvent+;
+#endif
+
+
+
+
+
--- /dev/null
+SRCS = \
+AliFastDetector.cxx \
+AliFastResponse.cxx \
+AliFastParticle.cxx \
+AliFastEvent.cxx
+
+HDRS:= $(SRCS:.cxx=.h)
+
+DHDR= FASTSIMLinkDef.h