]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSClusterFinder.h
Changes to be able to access reference data files via Alien, in a similar way as...
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinder.h
index 1331ef87091fd5bba2df254969fc9129561df265..d0311bf1b4aa05775cda69c696fea4c4ced8ec0a 100644 (file)
@@ -8,9 +8,10 @@
 
 ////////////////////////////////////////////////
 //  ITS Cluster Finder Class                  //
+//                                            //
+//                                            //
 ////////////////////////////////////////////////
 
-#include <Riostream.h>
 #include <TObject.h>
 #include <TClonesArray.h>
 
@@ -18,39 +19,29 @@ class AliITSMap;
 class AliITSresponse;
 class AliITSsegmentation;
 class AliITSRawCluster;
-class AliITS;
 class AliITSdigit;
 class AliITSRecPoint;
+class AliITSDetTypeRec;
+class AliRawReader;
 
 //----------------------------------------------------------------------
 class AliITSClusterFinder :public TObject{
   public:
     AliITSClusterFinder(); // Default constructor
     // Standard Constructor
-    AliITSClusterFinder(AliITSsegmentation *seg, AliITSresponse *resp);
-    AliITSClusterFinder(AliITSsegmentation *seg, AliITSresponse *resp,
-                        TClonesArray *digits);// Standard+ Constructor
+    AliITSClusterFinder(AliITSDetTypeRec* dettyp);
+    AliITSClusterFinder(AliITSDetTypeRec* dettyp,TClonesArray *digits);// Standard+ Constructor
     virtual ~AliITSClusterFinder(); // Destructor
-    AliITSClusterFinder(const AliITSClusterFinder &source); // copy constructor
-    // assignment operator
-    AliITSClusterFinder& operator=(const AliITSClusterFinder &source);
     //
     // Do the Reconstruction.
     virtual void FindRawClusters(Int_t mod=0); // Finds cluster of digits.
-    //
+     //
     // Sets the debug flag for debugging output
     void SetDebug(Int_t level=1){fDebug=level;}
     // Clears the debug flag so no debugging output will be generated
     void SetNoDebug(){fDebug=0;}
     // Returns the debug flag value
-    Bool_t GetDebug(Int_t level=1)const {return fDebug<=level;}
-    //
-    // Setters and Getters
-    // segmentation
-    virtual void SetSegmentation(AliITSsegmentation *segmentation) {
-        fSegmentation=segmentation;}
-    //Returns fSegmentation
-    virtual AliITSsegmentation* GetSegmentation()const{return fSegmentation;}
+    Bool_t GetDebug(Int_t level=1)const {return fDebug>=level;}
     // Digit
     virtual void SetDigits(TClonesArray *itsDigits) {// set digits
         fDigits=itsDigits;fNdigits = fDigits->GetEntriesFast();}
@@ -58,11 +49,6 @@ class AliITSClusterFinder :public TObject{
         return (AliITSdigit*) fDigits->UncheckedAt(i);}
     virtual TClonesArray* Digits(){return fDigits;}// Gets fDigits
     virtual Int_t   NDigits() const {return fNdigits;}// Get Number of Digits
-    // Response
-    //Return Response
-    virtual AliITSresponse* GetResponse()const{return fResponse;}
-    virtual void SetResponse(AliITSresponse *response) {// set response
-        fResponse=response;}
     // clulsters
     // Set fClusters up
     virtual void SetClusters(TClonesArray *itsClusters){// set clusters
@@ -83,10 +69,14 @@ class AliITSClusterFinder :public TObject{
     virtual void   FillCluster(AliITSRawCluster *,Int_t) {}// fiil cluster
     virtual void   FillCluster(AliITSRawCluster *cluster) {// fill cluster
         FillCluster(cluster,1);}
-    virtual void FindCluster(Int_t,Int_t,AliITSRawCluster *) {}// find cluster
-    //
+
     virtual void SetModule(Int_t module){fModule = module;}// Set module number
-    virtual Int_t GetModule()const{return fModule;}// Returns module number
+    virtual Int_t GetModule()const {return fModule;}// Returns module number
+
+  void SetEvent(Int_t event) { fEvent=event; }
+  virtual void RawdataToClusters(AliRawReader* /*rawReader*/,TClonesArray** /*clusters*/) {
+    Warning("RawdataToClusters","Method not implemented in this class ");}
+
     //
     // RecPoints
     // Given a cluster of digits, creates the nessesary RecPoint. May also
@@ -116,29 +106,91 @@ class AliITSClusterFinder :public TObject{
     //split by local maxima
     virtual void SplitByLocalMaxima(AliITSRawCluster *){}
     // IO functions
-    void Print(ostream *os); // Class ascii print function
+    void Print(ostream *os) const; // Class ascii print function
     void Read(istream *os);  // Class ascii read function
+    virtual void Print(Option_t *option="") const {TObject::Print(option);}
+    virtual Int_t Read(const char *name) {return TObject::Read(name);}
+
+    virtual void SetDetTypeRec(AliITSDetTypeRec* dtr) {fDetTypeRec=dtr;}
+    AliITSDetTypeRec* GetDetTypeRec() const {return fDetTypeRec;}
 
-    // data members
+    void InitGeometry(); 
   protected:
-    Int_t              fDebug;         //! Debug flag/level
-    Int_t              fModule;        //! Module number to be reconstuctted
-    TClonesArray       *fDigits;       //! digits
-    Int_t              fNdigits;       //! num of digits
+  class Ali1Dcluster {
+  public:
+    void SetY(Float_t y) {fY=y;}
+    void SetQ(Float_t q) {fQ=q;}
+    void SetNd(Int_t n)  {fNd=n;}
+    void SetLabels(Int_t *lab) {fLab[0]=lab[0];fLab[1]=lab[1];fLab[2]=lab[2];}
+    Float_t GetY() const {return fY;}
+    Float_t GetQ() const {return fQ;}
+    Int_t GetNd()const {return fNd;}
+    Int_t GetLabel(Int_t lab) const { return fLab[lab]; }
+  protected:
+    Float_t fY; //cluster position
+    Float_t fQ; //cluster charge
+    Int_t fNd;  //number of digits
+    Int_t fLab[3]; //track label
+  };
+  class AliBin {
+  public:
+    AliBin():fIndex(0),fMask(0xFFFFFFFE),fQ(0){}
+    void SetIndex(UInt_t idx) {fIndex=idx;}
+    void SetQ(UShort_t q)  {fQ=q;}
+    void SetMask(UInt_t m) {fMask=m;}
+    void Reset() {fIndex=0; fMask=0xFFFFFFFE; fQ=0;}
+
+    void Use() {fMask&=0xFFFFFFFE;}
+    Bool_t IsNotUsed() const {return (fMask&1);}
+    Bool_t IsUsed() const {return !(IsNotUsed());}
+
+    UInt_t   GetIndex() const {return fIndex;}
+    UShort_t GetQ()     const {return fQ;}
+    UInt_t   GetMask()  const {return fMask;}
+  protected:
+    UInt_t fIndex; //digit index
+    UInt_t fMask; //peak mask
+    UShort_t fQ;  //signal
+  };
+  void MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m,AliITSRecPoint &c);
+  static Bool_t IsMaximum(Int_t k, Int_t max, const AliBin *bins);
+  static void FindPeaks(Int_t k,Int_t m,AliBin*b,Int_t*idx,UInt_t*msk,Int_t&n);
+  static void MarkPeak(Int_t k, Int_t max, AliBin *bins, UInt_t m);
+  static void FindCluster(Int_t k,Int_t maxz,AliBin *bins,Int_t &n,Int_t *idx);
 
-    AliITSresponse     *fResponse;     //! response
-    AliITSsegmentation *fSegmentation; //! segmentation
-    TClonesArray       *fClusters;     //! Array of clusters
-    Int_t              fNRawClusters;  //! in case we split the cluster
-                                       // and want to keep track of 
-                                       // the cluster which was splitted
+  static void CheckLabels2(Int_t lab[10]);
+  static void AddLabel(Int_t lab[10], Int_t label);      
+   // data members       
+
+   Int_t              fDebug;         //! Debug flag/level
+   Int_t              fModule;        //! Module number to be reconstuctted
+   TClonesArray       *fDigits;       //! digits 
+   Int_t              fNdigits;       //! num of digits 
+   AliITSDetTypeRec* fDetTypeRec; //ITS object for reconstruction
+   TClonesArray       *fClusters;     //! Array of clusters
+   Int_t              fNRawClusters;  //! in case we split the cluster
+   // and want to keep track of 
+   // the cluster which was splitted
     AliITSMap          *fMap;          //! map
     Int_t              fNperMax;       //! NperMax
     Int_t              fDeclusterFlag; //! DeclusterFlag
     Int_t              fClusterSize;   //! ClusterSize
     Int_t              fNPeaks;        //! NPeaks  
+    // Data members needed to fill AliCluster objects
+    Int_t fNdet[2200];           // detector index  
+    Int_t fNlayer[2200];         // detector layer
+
+   Int_t fNModules;             // total number of modules    
+   Int_t fEvent;                //event number
+   
+   AliITSClusterFinder(const AliITSClusterFinder &source); // copy constructor
+    // assignment operator
+    AliITSClusterFinder& operator=(const AliITSClusterFinder &source);
+    
 
-    ClassDef(AliITSClusterFinder,3) //Class for clustering and reconstruction of space points
+    ClassDef(AliITSClusterFinder,8) //Class for clustering and reconstruction of space points
 };
 // Input and output functions for standard C++ input/output.
 ostream &operator<<(ostream &os,AliITSClusterFinder &source);