X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSpList.h;h=f4612751c51df04607a4a2b31cde4398e5bdfeb0;hb=a1ecbc973fb74bf37be8e8916f9a75ea701bd458;hp=24efb7e60409ef8163d31cd7ff71fbe32debe39c;hpb=ac74f489d065b3e59af328b0b5ffb403fa6de594;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSpList.h b/ITS/AliITSpList.h index 24efb7e6040..f4612751c51 100644 --- a/ITS/AliITSpList.h +++ b/ITS/AliITSpList.h @@ -1,115 +1,24 @@ -#ifndef ALIITSPLISTSSDITEM_H -#define ALIITSPLISTSSDITEM_H -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ - -/* $Id$ */ - -#include - - -class AliITSpListItem: public TObject { - public: - // Default Constructor - AliITSpListItem(); - // Standard Signal Constructor - AliITSpListItem(Int_t track,Int_t hit,Int_t module,Int_t index, - Double_t signal); - // Standard Noise Constructor - AliITSpListItem(Int_t module,Int_t index,Double_t signal); - // Class destrutor - virtual ~AliITSpListItem(); - // Copy Oporator - AliITSpListItem(AliITSpListItem &source); - // = Opoerator - virtual AliITSpListItem& operator=(const AliITSpListItem &source); - // Returns the signal value in the list of signals - virtual Double_t GetSignal(Int_t i){ - return ( (i>=0&&i=0&&i=0&&i>(istream &is,AliITSpListItem &source); - - -#endif - -#ifndef ALIITSPLISTSSD_H -#define ALIITSPLISTSSD_H +#ifndef ALIITSPLIST_H +#define ALIITSPLIST_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ +//*********************************************************************** +// +// It consist of a TClonesArray of +// AliITSpListItem objects +// This array can be accessed via 2 indexed +// it is used at digitization level by +// all the 3 ITS subdetectors +// +// *********************************************************************** +#include "TArrayI.h" +#include "TClonesArray.h" +#include "AliLog.h" #include "AliITSMap.h" - -class TObjArray; -class AliITSpListItem; +#include "AliITSpListItem.h" class AliITSpList: public AliITSMap { - private: - // returns the TObjArray index for a give set of map indecies. - Int_t GetIndex(Int_t i,Int_t j){ - if(i<0||i>=fNi || j<0||j>=fNj){ - Warning("GetIndex","Index out of range 0=fNi || j<0||j>=fNj){i=-1;j=-1; return;} } // Returns the signal+noise for a give map coordinate - Double_t GetSignal(Int_t index){ + Double_t GetSignal(Int_t index) { if(GetpListItem(index)==0) return 0.0; return GetpListItem(index)->GetSumSignal(); } // Returns the signal+noise for a give map coordinate - Double_t GetSignal(Int_t i,Int_t j){ + virtual Double_t GetSignal(Int_t i,Int_t j) const { if(GetpListItem(i,j)==0) return 0.0; return GetpListItem(i,j)->GetSumSignal(); } // Returns the signal only for a give map coordinate - Double_t GetSignalOnly(Int_t i,Int_t j){ + Double_t GetSignalOnly(Int_t i,Int_t j)const { if(GetpListItem(i,j)==0) return 0.0; return GetpListItem(i,j)->GetSignal(); } // Returns the noise for a give map coordinate - Double_t GetNoise(Int_t i,Int_t j){ + Double_t GetNoise(Int_t i,Int_t j) const { if(GetpListItem(i,j)==0) return 0.0; return GetpListItem(i,j)->GetNoise(); } // returns the track number which generated the signal at a given map // coordinate. If there is no signal or only noise, then -2 is returned. // k is the track rank number. - Double_t GetTSignal(Int_t i,Int_t j,Int_t k){ + Double_t GetTSignal(Int_t i,Int_t j,Int_t k) const { if(GetpListItem(i,j)==0) return 0.0; return GetpListItem(i,j)->GetSignal(k); } // returns the track number which generated the signal at a given map // coordinate. If there is no signal or only noise, then -2 is returned. // k is the track rank number. - Int_t GetTrack(Int_t i,Int_t j,Int_t k){ + Int_t GetTrack(Int_t i,Int_t j,Int_t k) const { if(GetpListItem(i,j)==0) return -2; return GetpListItem(i,j)->GetTrack(k); } // returns the hit number which generated the signal at a given map // coordinate. If there is no signal or only noise, then -2 is returned. // k is the hit rank number. - Int_t GetHit(Int_t i,Int_t j,Int_t k){ + Int_t GetHit(Int_t i,Int_t j,Int_t k) const { if(GetpListItem(i,j)==0) return -2; return GetpListItem(i,j)->GetHit(k); } // returns the number of Signal values - Int_t GetNSignals(Int_t i,Int_t j){ + Int_t GetNSignals(Int_t i,Int_t j) const { if(GetpListItem(i,j)==0) return 0; return GetpListItem(i,j)->GetNsignals(); } @@ -188,59 +97,54 @@ class AliITSpList: public AliITSMap { void AddSignal(Int_t i,Int_t j,Int_t trk,Int_t ht,Int_t mod,Double_t sig); // Adds a Noise value to the map. Creating and expanding arrays as needed. void AddNoise(Int_t i,Int_t j,Int_t mod,Double_t noise); - // Delete all AliITSpListItems and zero the TObjArray - void ClearMap(); - // Delete a particular AliITSpListItem in the TObjArray. - void DeleteHit(Int_t i,Int_t j); - // returns hit index in TObjArray - Int_t GetHitIndex(Int_t i,Int_t j){return GetIndex(i,j);} + // Delete all AliITSpListItems and zero the TClonesArray + virtual void ClearMap(); + // Delete a particular AliITSpListItem in the TClonesArray. + virtual void DeleteHit(Int_t i,Int_t j); + // returns hit index in TClonesArray + virtual Int_t GetHitIndex(Int_t i,Int_t j) const {return GetIndex(i,j);} // returns "hit" AliITSpListItem as a TObject. - TObject * GetHit(Int_t i,Int_t j){return (TObject*)GetpListItem(i,j);} + TObject * GetHit(Int_t i,Int_t j) const {return (TObject*)GetpListItem(i,j);} // tests hit status. - FlagType TestHit(Int_t i,Int_t j){if(GetpListItem(i,j)==0) return kEmpty; + virtual FlagType TestHit(Int_t i,Int_t j){if(GetpListItem(i,j)==0) return kEmpty; else if(GetSignal(i,j)<=0) return kUnused; else return kUsed;} - // Returns the pointer to the TObjArray of pList Items - TObjArray * GetpListItems(){return fa;} - // returns the pList Item stored in the TObject array - AliITSpListItem* GetpListItem(Int_t index){ - if(fa!=0)return (AliITSpListItem*) (fa->At(index)); - else return 0;} + // returns the pList Item stored in the TClonesArray + AliITSpListItem* GetpListItem(Int_t index) { if((fa[index]).IsUsed()) + return &(fa[index]); + else return NULL;} // returns the pList Item stored in the TObject array - AliITSpListItem* GetpListItem(Int_t i,Int_t j){ - if(fa!=0)return (AliITSpListItem*) (fa->At(GetIndex(i,j))); - else return 0;} + AliITSpListItem* GetpListItem(Int_t i,Int_t j) const { + if((fa[GetIndex(i,j)]).IsUsed())return &(fa[GetIndex(i,j)]); + else return NULL; } // Fill pList from digits. Not functional yet - void FillMap(){;} + virtual void FillMap(){NotImplemented("FillMap");} + virtual void FillMap2() {NotImplemented("FillMap2");} // Sets threshold for significance. Not of relavance in this case. - void SetThreshold(Int_t i){i=0;} + virtual void SetThreshold(Int_t /* i */){NotImplemented("SetThreshold");} + virtual void SetThresholdArr(TArrayI /*thr*/) {NotImplemented("SetThresholdArr");} // Sets a single hit. Not of relavance in this case. - void SetHit(Int_t i,Int_t j,Int_t k){i=j=k=0;} + virtual void SetHit(Int_t /* i */,Int_t /* j */,Int_t /* k */){NotImplemented("SetHit");} // Flags a hit. Not of relavence in this case. - void FlagHit(Int_t i,Int_t j){i=j=0;} - // returns the i,j index numbers from the liniarized index computed - // from GetIndex above. - void GetCell(Int_t index,Int_t &i,Int_t &j){ - if(index<0 || index>=fNi*fNj){ - Warning("GetCell","Index out of range 0<=index=%d<%d", - index,fNi*fNj); - i=-1;j=-1; - return; - } // end if - i = index/fNj; - j = index - fNj*i; - return; - } + virtual void FlagHit(Int_t /* i */,Int_t /* j */){NotImplemented("FlagHit");} + virtual void GetCell(Int_t index,Int_t &i,Int_t &j) const; + // GetIndex returns the TClonesArray index for a given set of map indexes. + static Int_t GetIndex(Int_t i,Int_t j,Int_t maxj){ + return maxj*i+j;} private: + +// private methods + Int_t GetIndex(Int_t i,Int_t j) const { + if(i<0||i>=fNi || j<0||j>=fNj){AliWarning(Form("Index out of range 00) + Warning(method,"This method is not implemented for this class");} +// data members Int_t fNi,fNj; // The max index in i,j. - TObjArray *fa; // array of pList items - Int_t fEnteries; // keepts track of the number of non-zero entries. + AliITSpListItem *fa; // array of pList items + Int_t fEntries; // keepts track of the number of non-zero entries. - ClassDef(AliITSpList,3) // list of signals and track numbers + ClassDef(AliITSpList,5) // list of signals and track numbers }; -// Input and output functions for standard C++ input/output. -ostream & operator<<(ostream &os,AliITSpList &source); -istream & operator>>(istream &is,AliITSpList &source); - #endif