* See cxx source for full Copyright notice */
/* $Id$ */
+///////////////////////////////////////////////////////////////////////
+// //
+// Class AliITSmodule //
+// is a superclass for AliITSmoduleSSD, SPD and SDD. //
+// The main function of modules is to simulate DIGITS from //
+// GEANT HITS and produce POINTS from DIGITS //
+// It also make fast simulation without use of DIGITS //
+// //
+// created by: A.Boucham, W.Peryt, S.Radomski, P.Skowronski //
+// R.Barbera, B. Batynia, B. Nilsen //
+// ver. 1.0 CERN, 16.09.1999 //
+// //
+///////////////////////////////////////////////////////////////////////
-//#include "AliITSpoint.h"
-#include "AliITS.h"
-#include "AliITSdigit.h"
-#include "AliITShit.h"
-#include "TObjArray.h"
-#include "TArray.h"
+#include <TObject.h>
+#include <TObjArray.h>
+#include <TArrayI.h> // used in inline functions GetHitTrackIndex,GetHitHitIndex, and GetHitTrackAndHitIndex.
+class AliITS;
+class AliITShit;
-//________________________________________________________________
-//
-// Class AliITSmodule
-// is a superclass for AliITSmoduleSSD, SPD and SDD.
-// The main function of modules is to simulate DIGITS from
-// GEANT HITS and produce POINTS from DIGITS
-// It also make fast simulation without use of DIGITS
-//
-// created by: A.Boucham, W.Peryt, S.Radomski, P.Skowronski
-// R.Barbera, B. Batynia, B. Nilsen
-// ver. 1.0 CERN, 16.09.1999
-//
-//________________________________________________________________
-//
+class AliITSmodule:public TObject{
-class AliITSmodule : public TObject {
-
-public:
+ public:
//________________________________________________________________
//
// Constructors and deconstructor
//________________________________________________________________
- //
-
+ //
AliITSmodule(); // default constructor
- AliITSmodule(Int_t index); // index in TObjectArray in ITS object
-
- virtual ~AliITSmodule() ;
+ AliITSmodule(Int_t index); //index in TObjectArray in ITS object
+ virtual ~AliITSmodule();
//________________________________________________________________
//
- // Position menagenent
+ // Position managenent (id's getters)
//________________________________________________________________
//
-
- Int_t GetIndex() const { return fIndex;}
- //Int_t GetLayer() const { return fLayer;}
- //Int_t GetLadder() const { return fLadder;}
- //Int_t GetDet() const { return fDet;}
-
-
+
+ Int_t GetIndex() const {
+ // get index
+ return fIndex;
+ }
+ void GetID(Int_t &lay,Int_t &lad,Int_t &det);
+ Int_t GetLayer() {
+ // get layer
+ Int_t i,j,k;GetID(i,j,k);return i;
+ }
+ Int_t GetLadder(){
+ // get ladder
+ Int_t i,j,k;GetID(i,j,k);return j;
+ }
+ Int_t GetDet(){
+ // get det
+ Int_t i,j,k;GetID(i,j,k);return k;
+ }
//________________________________________________________________
//
- // Hits menagement
+ // Hits management
//________________________________________________________________
//
-
- Int_t GetNhits() const { return fNhitsM;}
- // returns number of hits in this module
-
- TObjArray *GetHits() const { return fHitsM; }
+ Int_t GetNhits() const {
+ // get num of hits
+ return fHitsM->GetEntriesFast();
+ }
+ AliITS *GetITS() const {
+ // get ITS
+ return fITS;
+ }
+ TObjArray *GetHits() const {
+ // get hits
+ return fHitsM;
+ }
+ AliITShit *GetHit(Int_t i) {
// returns pointer to array (TClonesArray) of pointers to hits
-
- Int_t AddHit(AliITShit *hit);
+ return (AliITShit*)fHitsM->At(i);
+ }
// Adds pointer of hit belonging to this module
// and returns number of hits in this module
-
- //________________________________________________________________
- //
- // Full Simulation
- //________________________________________________________________
- //
-
- virtual void HitToDigit() {};
- // this functon is virtual, becouse each type of a detector
- // make simulation in its own specific methods
-
- //________________________________________________________________
- //
- // Reconstruction
- //________________________________________________________________
- //
-
- virtual void DigitToPoint() {};
- // this functon is virtual, becouse each type of a detector
- // make reconstruction in its own specific methods
- // classes DIGIT and POINT are specyfic to detector type
-
- //________________________________________________________________
- //
- // Fast Simulation
- //________________________________________________________________
- //
-
- virtual void HitToPoint() {};
- // this functon is virtual, becouse each type of a detector
- // make fast simulation in its own specific methods
- // this simulation do not use DIGITS
-
-
-protected:
-
+ Int_t AddHit(AliITShit *hit,Int_t TrackIndex,Int_t HitIndex);
+ Int_t GetHitTrackIndex(Int_t i) {// get hit track index
+ return fTrackIndex->At(i);}
+ Int_t GetHitHitIndex(Int_t i) {
+ // return the hit index number in TreeH for the given sorted hit in
+ // the module.
+ return fHitIndex->At(i);}
+ void GetHitTrackAndHitIndex(Int_t i,Int_t &TrackIndex,Int_t &HitIndex) {
+ // return the hit index number for the given hit. Hits are kept on
+ // file according to their track index and hit index numbers.
+ TrackIndex = fTrackIndex->At(i);HitIndex = fHitIndex->At(i);}
+ // Computes mean global location from hits that make up a track passing
+ // through a volume.
+ Bool_t MedianHitG(AliITShit *h1,AliITShit *h2,
+ Float_t &x,Float_t &y,Float_t &z);
+ void MedianHitG(Int_t index, Float_t hitx1,Float_t hity1,Float_t hitz1,
+ Float_t hitx2,Float_t hity2,Float_t hitz2, Float_t &xMg,
+ Float_t &yMg, Float_t &zMg);
+ // Computes mean local location from hits that make up a track passing
+ // through a volume.
+ Bool_t MedianHitL(AliITShit *h1,AliITShit *h2,
+ Float_t &x,Float_t &y,Float_t &z) const;
+ void MedianHitL(Int_t,AliITShit *,AliITShit *,Float_t &,Float_t &,
+ Float_t &){};
+ Double_t PathLength(Int_t index, AliITShit *itsHit1, AliITShit *itsHit2);
+ // returns both the track and hit index numbers for the given hit. Hits
+ // are kept on file according to their track index and hit index numbers.
+ void MedianHit(Int_t index, Float_t xg,Float_t yg,Float_t zg,
+ Int_t status,Float_t &xMg, Float_t &yMg, Float_t &zMg,
+ Int_t &flag);
+ void PathLength(Int_t index,Float_t x,Float_t y,Float_t z,Int_t status,
+ Int_t &nseg,Float_t &x1,Float_t &y1,Float_t &z1,
+ Float_t &dx1,Float_t &dy1, Float_t &dz1,Int_t &flag) const;
+ Bool_t LineSegmentL(Int_t hindex,Double_t &a,Double_t &b,
+ Double_t &c,Double_t &d,Double_t &e,Double_t &f,
+ Double_t &de);
+ Bool_t LineSegmentL(Int_t hindex,Double_t &a,Double_t &b,
+ Double_t &c,Double_t &d,Double_t &e,Double_t &f,
+ Double_t &de,Int_t &track);
+ // if returns kTRUE; gives the parameterization of the line segment
+ // from this step. x=a+b*t, y=c+d*t, and z=e+f*t for 0.0t<=1.0 and the
+ // energy lost during this step all in the local detector coordinates.
+ // if returns kFALSE; this is a begining step and no energy loss has
+ // occured. This step is used to set up the next steps. Do not use
+ // this parameterization.
+ Bool_t LineSegmentG(Int_t hindex,Double_t &a,Double_t &b,
+ Double_t &c,Double_t &d,Double_t &e,Double_t &f,
+ Double_t &de);
+ Bool_t LineSegmentG(Int_t hindex,Double_t &a,Double_t &b,
+ Double_t &c,Double_t &d,Double_t &e,Double_t &f,
+ Double_t &de,Int_t &track);
+ // if returns kTRUE; gives the parameterization of the line segment
+ // from this step. x=a+b*t, y=c+d*t, and z=e+f*t for 0.0t<=1.0 and the
+ // energy lost during this step all in the global detector coordinates.
+ // if returns kFALSE; this is a begining step and no energy loss has
+ // occured. This step is used to set up the next steps. Do not use
+ // this parameterization.
+
+ protected:
+ AliITSmodule(const AliITSmodule &source);
+ AliITSmodule& operator=(const AliITSmodule &source);
//________________________________________________________________
//
// Data members
//________________________________________________________________
//
-
- AliDetector *fITS; // Pointer to ITS detector
- Int_t fIndex; // Index of this module in ITSmodules TObjectArray
-
- TObjArray *fHitsM; // Pointer to list of hits on this module
- Int_t fNhitsM; // Number of hits
-
- TArrayI *fIdigits; // Indexes of DIGITS belonging to this module
- // in array in ITS
- Int_t fNdigits; // Number of DIGITS
-
- TArrayI *fIpoints; // Indexes of POINTS belonging to this module
- // in array in ITS
- Int_t fNpoints; // Number of POINTS
-
-public:
+ AliITS *fITS; // Pointer to ITS detector
+ Int_t fIndex; //Index of this module in ITSmodules TObjectArray
+ TObjArray *fHitsM; // Pointer to list of hits on this module
+ TArrayI *fTrackIndex; // track index
+ TArrayI *fHitIndex; // hit index
- //________________________________________________________________
- //
- // ROOT compatibility
- //________________________________________________________________
- //
- ClassDef(AliITSmodule,1)
+ ClassDef(AliITSmodule,0) // Copy the hits into a more useful order
+ // Version set to zero so that we do not write out this class.
};
#endif
+
+
+