-
- if(GetpListItem(index)==0){ // most create AliITSpListItem
- fa->AddAt(new AliITSpListItem(mod,index,noise),index);
- }else{ // AliITSpListItem exists, just add signal to it.
- GetpListItem(index)->AddNoise(mod,index,noise);
- } // end if
- if(index>=fEnteries) fEnteries = index +1;
-}
-//______________________________________________________________________
-
-ClassImp(AliITSpListItem)
-//______________________________________________________________________
-AliITSpListItem::AliITSpListItem(){
- // Default constructor
- // Inputs:
- // none.
- // Outputs:
- // none.
- // Return:
- // A zeroed/empty AliITSpListItem class.
-
- fmodule = -1;
- findex = -1;
- for(Int_t i=0;i<this->fkSize;i++){
- this->fTrack[i] = -2;
- this->fHits[i] = -1;
- this->fSignal[i] = 0.0;
- } // end if i
- fTsignal = 0.0;
- fNoise = 0.0;
- fSignalAfterElect = 0.0;
-}
-//______________________________________________________________________
-AliITSpListItem::AliITSpListItem(Int_t module,Int_t index,Double_t noise){
- // Standard noise constructor
- // Inputs:
- // Int_t module The module where this noise occurred
- // Int_t index The cell index where this noise occurred
- // Double_t noise The value of the noise.
- // Outputs:
- // none.
- // Return:
- // A setup and noise filled AliITSpListItem class.
-
- this->fmodule = module;
- this->findex = index;
- for(Int_t i=0;i<this->fkSize;i++){
- this->fTrack[i] = -2;
- this->fSignal[i] = 0.0;
- this->fHits[i] = -1;
- } // end if i
- this->fTsignal = 0.0;
- this->fSignalAfterElect = 0.0;
- this->fNoise = noise;
-}
-//______________________________________________________________________
-AliITSpListItem::AliITSpListItem(Int_t track,Int_t hit,Int_t module,
- Int_t index,Double_t signal){
- // Standard signal constructor
- // Inputs:
- // Int_t track The track number which produced this signal
- // Int_t hit The hit number which produced this signal
- // Int_t module The module where this signal occurred
- // Int_t index The cell index where this signal occurred
- // Double_t signal The value of the signal (ionization)
- // Outputs:
- // none.
- // Return:
- // A setup and signal filled AliITSpListItem class.
-
- this->fmodule = module;
- this->findex = index;
- this->fTrack[0] = track;
- this->fHits[0] = hit;
- this->fSignal[0] = signal;
- for(Int_t i=1;i<this->fkSize;i++){
- this->fTrack[i] = -2;
- this->fSignal[i] = 0.0;
- this->fHits[i] = -1;
- } // end if i
- this->fTsignal = signal;
- this->fNoise = 0.0;
- this->fSignalAfterElect = 0.0;
-}
-//______________________________________________________________________
-AliITSpListItem::~AliITSpListItem(){
- // Destructor
- // Inputs:
- // none.
- // Outputs:
- // none.
- // Return:
- // A properly destroyed AliITSpListItem class.
-
-}
-//______________________________________________________________________
-AliITSpListItem& AliITSpListItem::operator=(const AliITSpListItem &source){
- // = operator
- // Inputs:
- // AliITSpListItem &source A AliITSpListItem Object
- // Outputs:
- // none.
- // Return:
- // A copied AliITSpListItem object
-
- if(this == &source) return *this;
-
- this->fmodule = source.fmodule;
- this->findex = source.findex;
- for(Int_t i=0;i<this->fkSize;i++){
- this->fTrack[i] = source.fTrack[i];
- this->fSignal[i] = source.fSignal[i];
- this->fHits[i] = source.fHits[i];
- } // end if i
- this->fTsignal = source.fTsignal;
- this->fNoise = source.fNoise;
- this->fSignalAfterElect = source.fSignalAfterElect;
-
- return *this;
-}
-//______________________________________________________________________
-AliITSpListItem::AliITSpListItem(AliITSpListItem &source){
- // Copy operator
- // Inputs:
- // AliITSpListItem &source A AliITSpListItem Object
- // Outputs:
- // none.
- // Return:
- // A copied AliITSpListItem object
-
- *this = source;
-}
-//______________________________________________________________________
-void AliITSpListItem::AddSignal(Int_t track,Int_t hit,Int_t module,
- Int_t index,Double_t signal){
- // Adds this track number and signal to the pList and orders them
- // Inputs:
- // Int_t track The track number which produced this signal
- // Int_t hit The hit number which produced this signal
- // Int_t module The module where this signal occurred
- // Int_t index The cell index where this signal occurred
- // Double_t signal The value of the signal (ionization)
- // Outputs:
- // none.
- // Return:
- // none.
- Int_t i,j,trk,hts;
- Double_t sig;
- Bool_t flg=kFALSE;
-
- if(findex!=index || fmodule!=module)
- Warning("AddSignal","index=%d != findex=%d or module=%d != fmodule=%d",
- index,findex,module,fmodule);
- fTsignal += signal; // Keep track of sum signal.
-
- for(i=0;i<fkSize;i++) if( track==fTrack[i] && hit==fHits[i] ){
- fSignal[i] += signal;
- flg = kTRUE;
- } // end for i & if.
- if(flg){ // resort arrays.
- for(i=1;i<fkSize;i++){
- j = i;
- while(j>0 && fSignal[j]>fSignal[j-1]){
- trk = fTrack[j-1];
- hts = fHits[j-1];
- sig = fSignal[j-1];
- fTrack[j-1] = fTrack[j];
- fHits[j-1] = fHits[j];
- fSignal[j-1] = fSignal[j];
- fTrack[j] = trk;
- fHits[j] = hts;
- fSignal[j] = sig;
- j--;
- } // end while
- } // end if i
- return;
- } // end if added to existing and resorted array
-
- // new entry add it in order.
- // if this signal is <= smallest then don't add it.
- if(signal <= fSignal[fkSize-1]) return;
- for(i=fkSize-2;i>=0;i--){
- if(signal > fSignal[i]){
- fSignal[i+1] = fSignal[i];
- fTrack[i+1] = fTrack[i];
- fHits[i+1] = fHits[i];
- }else{
- fSignal[i+1] = signal;
- fTrack[i+1] = track;
- fHits[i+1] = hit;
- return; // put it in the right place, now exit.
- } // end if
- } // end if; end for i
- // Still haven't found the right place. Must be at top of list.
- fSignal[0] = signal;
- fTrack[0] = track;
- fHits[0] = hit;
- return;
-}
-//______________________________________________________________________
-void AliITSpListItem::AddNoise(Int_t module,Int_t index,Double_t noise){
- // Adds noise to this existing list.
- // Inputs:
- // Int_t module The module where this noise occurred
- // Int_t index The cell index where this noise occurred
- // Double_t noise The value of the noise.
- // Outputs:
- // none.
- // Return:
- // none.
-
- if(findex!=index || fmodule!=module)
- Warning("AddNoise","index=%d != findex=%d or module=%d != fmodule=%d",
- index,findex,module,fmodule);
- fNoise += noise; // Keep track of sum signal.
-}
-//______________________________________________________________________
-void AliITSpListItem::AddSignalAfterElect(Int_t module,Int_t index,Double_t signal){
- // Adds signal after electronics to this existing list.
- // Inputs:
- // Int_t module The module where this noise occurred
- // Int_t index The cell index where this noise occurred
- // Double_t signal The value of the signal.
- // Outputs:
- // none.
- // Return:
- // none.
-
- if(findex!=index || fmodule!=module)
- Warning("AddSignalAfterElect","index=%d != findex=%d or module=%d "
- "!= fmodule=%d",index,findex,module,fmodule);
- fSignalAfterElect += signal; // Keep track of sum signal.
-}
-//______________________________________________________________________
-void AliITSpListItem::Add(AliITSpListItem *pl){
- // Adds the contents of pl to this
- // pl could come from different module and index
- // Inputs:
- // AliITSpListItem *pl an AliITSpListItem to be added to this class.
- // Outputs:
- // none.
- // Return:
- // none.
- Int_t i;
- Double_t sig = 0.0;
- Double_t sigT = 0.0;
-
- for(i=0;i<pl->GetNsignals();i++){
- sig = pl->GetSignal(i);
- if( sig <= 0.0 ) break; // no more signals
- AddSignal(pl->GetTrack(i),pl->GetHit(i),fmodule,findex,sig);
- sigT += sig;
- } // end for i
- fTsignal += (pl->fTsignal - sigT);
- fNoise += pl->fNoise;
- return;
-}
-//______________________________________________________________________
-void AliITSpListItem::AddTo(Int_t fileIndex,AliITSpListItem *pl){
- // Adds the contents of pl to this with track number off set given by
- // fileIndex.
- // Inputs:
- // Int_t fileIndex track number offset value
- // AliITSpListItem *pl an AliITSpListItem to be added to this class.
- // Outputs:
- // none.
- // Return:
- // none.
- Int_t i,trk;
- Double_t sig = 0.0;
-
- Int_t module = pl->GetModule();
- Int_t index = pl->GetIndex();
- for(i=0;i<pl->GetNsignals();i++){
- sig = pl->GetSignal(i);
- if( sig <= 0.0 ) break; // no more signals
- trk = pl->GetTrack(i);
- trk += fileIndex;
- AddSignal(trk,pl->GetHit(i),module,index,sig);
- } // end for i
- fSignalAfterElect += (pl->fSignalAfterElect + pl->fNoise - fNoise);
- fNoise = pl->fNoise;