]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPC.h
Splitting TPC library (T.Kuhr)
[u/mrichter/AliRoot.git] / TPC / AliTPC.h
index e0afc6336c92b1b9caf0dd6567da1af3cbcf2000..f7a64f6ffc5a03675204fa9c08fff155fdc2feff 100644 (file)
@@ -11,9 +11,7 @@
 #include "AliDetector.h"
 #include "AliHit.h" 
 #include "AliDigit.h" 
-#include "TLorentzVector.h" 
-#include "TVirtualMC.h"
-
+#include <TVector.h>
 
 
 class TMatrix;
@@ -25,73 +23,51 @@ class TTree;
 class TFile;
 class AliTPCParam;
 class AliTPCDigitsArray;
-class AliTPCClustersArray;
 class AliTPCTrackHitsV2; // M.I.
 class AliTPCTrackHits; // M.I.  -MI4 old hits - to be removed later
+//class TLorentzVector;
+class AliTPCLoader;
 
 
 class AliTPC : public AliDetector {
-protected:
-  Int_t          fDefaults;
-  Int_t          fSens;             // ISENS
-  Int_t          fSecAL;            // Upper sector selector
-  Int_t          fSecAU;            // Lower sector selector
-  Int_t          fSecLows[6];       // List of lower sectors selected
-  Int_t          fSecUps[12];       // List of upper sectors selected
-  Int_t          fNsectors;         // Number of sectors in TPC
-  //MI changes
-  AliTPCDigitsArray * fDigitsArray;              //!detector digit object  
-  AliTPCClustersArray * fClustersArray; //!detector cluster object
-  AliTPCParam *fTPCParam;           // pointer to TPC parameters 
-  AliTPCTrackHitsV2 *fTrackHits;      //!hits for given track M.I.
-  AliTPCTrackHits *fTrackHitsOld;      //!hits for given track M.I. MIold -
-
-  Int_t  fHitType; // if fNewHit = 1 old data structure if 2 new hits  if 4  old MI stucture
-  //  3 both types 
-  Int_t fDigitsSwitch; // digits type, 0->normal, 1->summable
-
-  //MK changes
-
-  Float_t        fSide;  // selects left(-1), right(+1), or both(0) sides of the TPC
-  Int_t          fNoComp; // number of a drift gas components
-  Int_t          fMixtComp[3]; // drift gas components
-  Float_t        fMixtProp[3]; // mixture proportions
 
 public:
-  AliTPC();
+  AliTPC(); 
   AliTPC(const char *name, const char *title);
+  AliTPC(const AliTPC& t);
+  
+  virtual AliLoader* MakeLoader(const char* topfoldername);
+  
   virtual      ~AliTPC();
   virtual void  AddHit(Int_t a1, Int_t *a2, Float_t *a3);
-  virtual void  AddTrackReference(Int_t label, TVirtualMC *vMC);
-  Int_t         DistancetoPrimitive(Int_t px, Int_t py);
+  Int_t         DistancetoPrimitive(Int_t px, Int_t py) const;
   virtual void  BuildGeometry();
   virtual void  CreateGeometry() {}
   virtual void  CreateMaterials();
-  virtual void  Hits2Clusters(TFile *of, Int_t eventn=0);
-  virtual void  Hits2ExactClustersSector(Int_t isec); // MI change calculate "exact" cluster position
   
+  virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
   virtual void  SDigits2Digits(){;} //MI change -cycling to production
   virtual void  SDigits2Digits2(Int_t eventnumber=0);
 
   virtual void  Hits2SDigits(); // MI - cycling around
   virtual void  Hits2SDigits2(Int_t eventnumber=0);
 
-  virtual void  Digits2Reco(Int_t firstevent=0,Int_t lastevent=0);
-  virtual void  Hits2Digits(Int_t eventnumber=0);   //MI change
+  virtual void  Hits2Digits();
+  virtual void  Hits2Digits(Int_t eventnumber);   //MI change
   virtual void  Hits2DigitsSector(Int_t isec);  //MI change
   virtual void  Init();
   virtual Int_t IsVersion() const =0;
-  virtual void  Digits2Clusters(TFile *of, Int_t eventnumber=0);
-  virtual void  Clusters2Tracks(TFile *of);
 
-  Int_t         GetNsectors()       {return fNsectors;}
-  virtual void  MakeBranch(Option_t *opt=" ", const char *file=0 );
+  virtual void  Digits2Raw();
+
+  Int_t         GetNsectors() const  {return fNsectors;}
+  virtual void  MakeBranch(Option_t *opt=" ");
   virtual void  ResetDigits();
   virtual void  SetSecAL(Int_t sec);
   virtual void  SetSecAU(Int_t sec);
   virtual void  SetSecLows(Int_t s1,Int_t s2,Int_t s3,Int_t s4,Int_t s5, Int_t s6);
   virtual void  SetSecUps (Int_t s1,Int_t s2,Int_t s3,Int_t s4,Int_t s5, Int_t s6,
-                          Int_t s7,Int_t s8,Int_t s9,Int_t s10, Int_t s11, Int_t s12);
+         Int_t s7,Int_t s8,Int_t s9,Int_t s10, Int_t s11, Int_t s12);
   virtual void  SetSens(Int_t sens);
 
 
@@ -102,11 +78,9 @@ public:
   virtual void  StepManager()=0;
   virtual void  DrawDetector() {}
   AliTPCDigitsArray*  GetDigitsArray() {return fDigitsArray;} //MI change
-  AliTPCClustersArray* GetClustersArray(){return fClustersArray;} //MI change
   AliTPCParam *GetParam(){return fTPCParam;} // M.K, M.I changes
   void SetParam(AliTPCParam *param){fTPCParam=param;} // M.K, M.I changes
   void SetDigitsArray(AliTPCDigitsArray* param) {fDigitsArray=param;}  //MI change
-  void SetClustersArray(AliTPCClustersArray *clusters) {fClustersArray = clusters;} //MI change
 
 // additional function neccesary for the new hits 
    virtual void MakeBranch2(Option_t *opt=" ", const char *file=0);  //
@@ -124,22 +98,46 @@ public:
    virtual void LoadPoints3(Int_t dumy);
    virtual void FinishPrimary();
    virtual void RemapTrackHitIDs(Int_t *map);
-   virtual void FindTrackHitsIntersection(TClonesArray * arr);
-   //fill clones array with intersection of current point with the
-   //middle of the row
    void SetHitType(Int_t type){fHitType =type;} //set type of hit container
    void SetDigitsSwitch(Int_t sw){fDigitsSwitch = sw;}
    void SetDefSwitch(Int_t def){fDefaults = def;}
-   virtual void  Merge(TTree * intree, Int_t *mask, Int_t nin, Int_t outid);
    Float_t GetNoise();  //get Current noise  
    void    GenerNoise(Int_t tablasize);  // make noise table
-   Bool_t  IsSectorActive(Int_t sec);    // check if the sector is active
+   Bool_t  IsSectorActive(Int_t sec) const;    // check if the sector is active
    void    SetActiveSectors(Int_t * sectors, Int_t n);  //set active sectors
-   Int_t GetHitType(){return fHitType;}
+   Int_t GetHitType() const {return fHitType;}
    void    SetActiveSectors(Int_t flag=0); //loop over al hits and set active only hitted sectors
-private:
-  //
    Bool_t  TrackInVolume(Int_t id,Int_t track);  //return true if current track is in volume
+
+// static functions
+   static AliTPCParam* LoadTPCParam(TFile *file); 
+protected:
+   Int_t          fDefaults; // defaults switch
+  Int_t          fSens;             // ISENS
+  Int_t          fSecAL;            // Upper sector selector
+  Int_t          fSecAU;            // Lower sector selector
+  Int_t          fSecLows[6];       // List of lower sectors selected
+  Int_t          fSecUps[12];       // List of upper sectors selected
+  Int_t          fNsectors;         // Number of sectors in TPC
+  //MI changes
+  AliTPCDigitsArray * fDigitsArray;              //!detector digit object  
+  AliTPCParam *fTPCParam;           // pointer to TPC parameters 
+  AliTPCTrackHitsV2 *fTrackHits;      //!hits for given track M.I.
+  AliTPCTrackHits *fTrackHitsOld;      //!hits for given track M.I. MIold -
+
+  Int_t  fHitType; // if fNewHit = 1 old data structure if 2 new hits  if 4  old MI stucture
+  //  3 both types 
+  Int_t fDigitsSwitch; // digits type, 0->normal, 1->summable
+
+  //MK changes
+
+  Float_t        fSide;  // selects left(-1), right(+1), or both(0) sides of the TPC
+  Int_t          fNoComp; // number of a drift gas components
+  Int_t          fMixtComp[3]; // drift gas components
+  Float_t        fMixtProp[3]; // mixture proportions 
+   
+ private:
+  //
   void SetDefaults();
   void DigitizeRow(Int_t irow,Int_t isec,TObjArray **rowTriplet);
   Float_t GetSignal(TObjArray *p1, Int_t ntr, AliTPCFastMatrix *m1, 
@@ -157,29 +155,10 @@ private:
   Int_t      fCurrentNoise; //!index of the noise in  the noise table 
   Bool_t*    fActiveSectors; //!bool indicating which sectors are active
 
-  ClassDef(AliTPC,8)  // Time Projection Chamber class
+  ClassDef(AliTPC,10)  // Time Projection Chamber class
 };
 
 
-//_____________________________________________________________________________
-
-class AliTPCdigit : public AliDigit {
-public:
-   Int_t     fSector;     //array of volumes
-   Int_t     fPadRow;     //Row number
-   Int_t     fPad ;       //Pad number
-   Int_t     fTime;       //Time bucket
-   Int_t     fSignal;     //Signal amplitude
-public:
-   AliTPCdigit() {}
-   AliTPCdigit(Int_t *tracks, Int_t *digits);
-   virtual ~AliTPCdigit() {}
-   ClassDef(AliTPCdigit,1)  // Time Projection Chamber digits
-};
 //_____________________________________________________________________________
  
 class AliTPChit : public AliHit {
@@ -199,6 +178,15 @@ public:
    ClassDef(AliTPChit,1)  // Time Projection Chamber hits
 };
 
+//_____________________________________________________________________________
+class AliTPCFastVector : public TVector {
+public :
+  AliTPCFastVector(Int_t size):TVector(size){};
+  virtual ~AliTPCFastVector(){;}
+  Float_t & UncheckedAt(Int_t index) const  {return  fElements[index];} //fast acces  
+  
+};
+
 #endif