-//______________________________________________________________________
-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;
- return;
-}
-//______________________________________________________________________
-Int_t AliITSpListItem::ShiftIndex(Int_t in,Int_t trk){
- // Shift an index number to occupy the upper four bits. No longer used.
- // Inputs:
- // Int_t in The file number
- // Int_t trk The track number
- // Outputs:
- // none.
- // Return:
- // Int_t The track number with the file number in the upper bits.
- Int_t si = sizeof(Int_t) * 8;
- UInt_t uin,utrk; // use UInt_t to avoid interger overflow-> goes negative.
-
- uin = in;
- utrk = trk;
- for(Int_t i=0;i<si-4;i++) uin *= 2;
- uin += utrk;
- in = uin;
- return in;
-}
-//______________________________________________________________________
-void AliITSpListItem::Print(ostream *os){
- //Standard output format for this class
- // Inputs:
- // ostream *os The output stream
- // Outputs:
- // none.
- // Return:
- // none.
- Int_t i;
-
- *os << fmodule <<","<<findex<<",";
- *os << fkSize <<",";
- for(i=0;i<fkSize;i++) *os << fTrack[i] <<",";
- for(i=0;i<fkSize;i++) *os << fHits[i] <<",";
- for(i=0;i<fkSize;i++) *os << fSignal[i] <<",";
- *os << fTsignal <<","<< fNoise << "," << fSignalAfterElect;
-}
-//______________________________________________________________________
-void AliITSpListItem::Read(istream *is){
- // Standard output streaming function.
- // Inputs:
- // istream *is The input stream
- // Outputs:
- // none.
- // Return:
- // none.
- Int_t i,iss;
-
- *is >> fmodule >> findex;
- *is >> iss; // read in fkSize
- for(i=0;i<fkSize&&i<iss;i++) *is >> fTrack[i];
- for(i=0;i<fkSize&&i<iss;i++) *is >> fHits[i];
- for(i=0;i<fkSize&&i<iss;i++) *is >> fSignal[i];
- *is >> fTsignal >> fNoise >> fSignalAfterElect;
-}
-//______________________________________________________________________
-ostream &operator<<(ostream &os,AliITSpListItem &source){
- // Standard output streaming function.
- // Inputs:
- // ostream &os The output stream
- // AliITSpListItem &source The AliITSpListItem object to be written out.
- // Outputs:
- // none.
- // Return:
- // ostream The output stream
-
- source.Print(&os);
- return os;
-}
-//______________________________________________________________________
-istream &operator>>(istream &os,AliITSpListItem &source){
- // Standard output streaming function.
- // Inputs:
- // istream os The input stream
- // AliITSpListItem &source The AliITSpListItem object to be inputted
- // Outputs:
- // none.
- // Return:
- // istream The input stream.
-
- source.Read(&os);
- return os;
-}
-