* provided "as is" without express or implied warranty. *
**************************************************************************/
#include <Riostream.h>
+#include <TMath.h>
+#include "AliLog.h"
#include "AliITSpListItem.h"
// ************************************************************************
// the data member "fa" of the AliITSpList class
//************************************************************************
ClassImp(AliITSpListItem)
//______________________________________________________________________
-AliITSpListItem::AliITSpListItem(){
+AliITSpListItem::AliITSpListItem():
+fmodule(-1),
+findex(-1),
+fTsignal(0.0),
+fNoise(0.0),
+fSignalAfterElect(0.0),
+fUsed(kFALSE){
// Default constructor
// Inputs:
// none.
// Return:
// A zeroed/empty AliITSpListItem class.
- fmodule = -1;
- findex = -1;
for(Int_t i=0;i<this->fgksize;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){
+AliITSpListItem::AliITSpListItem(Int_t module,Int_t index,Double_t noise):
+fmodule(module),
+findex(index),
+fTsignal(0.0),
+fNoise(noise),
+fSignalAfterElect(0.0),
+fUsed(kTRUE){
// Standard noise constructor
// Inputs:
// Int_t module The module where this noise occurred
// Return:
// A setup and noise filled AliITSpListItem class.
- this->fmodule = module;
- this->findex = index;
for(Int_t i=0;i<this->fgksize;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){
+ Int_t index,Double_t signal):
+fmodule(module),
+findex(index),
+fTsignal(signal),
+fNoise(0.0),
+fSignalAfterElect(0.0),
+fUsed(kTRUE){
// Standard signal constructor
// Inputs:
// Int_t track The track number which produced this signal
// 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;
this->fSignal[i] = 0.0;
this->fHits[i] = -1;
} // end if i
- this->fTsignal = signal;
- this->fNoise = 0.0;
- this->fSignalAfterElect = 0.0;
}
+
+//______________________________________________________________________
+void AliITSpListItem::Build(Int_t module,Int_t index,Double_t noise){
+ // this method resets all the data members and initializes the
+ // object as in the constructor which has the same arguments
+ fmodule = module;
+ findex = index;
+ fTsignal = 0.;
+ fNoise = noise;
+ fSignalAfterElect = 0.;
+ fUsed = kTRUE;
+ for(Int_t i=0;i<this->fgksize;i++){
+ this->fTrack[i] = -2;
+ this->fSignal[i] = 0.0;
+ this->fHits[i] = -1;
+ }
+}
+
+//______________________________________________________________________
+void AliITSpListItem::Build(Int_t track,Int_t hit,Int_t module,Int_t index,Double_t signal){
+ // this method resets all the data members and initializes the
+ // object as in the constructor which has the same arguments
+ fmodule = module;
+ findex = index;
+ fTsignal = signal;
+ fNoise = 0.;
+ fSignalAfterElect = 0.;
+ fUsed = kTRUE;
+ this->fTrack[0] = track;
+ this->fHits[0] = hit;
+ this->fSignal[0] = signal;
+ for(Int_t i=1;i<this->fgksize;i++){
+ this->fTrack[i] = -2;
+ this->fSignal[i] = 0.0;
+ this->fHits[i] = -1;
+ }
+}
+
+//______________________________________________________________________
+void AliITSpListItem::Build(const AliITSpListItem &source){
+ // this method resets all the data members and initializes the
+ // object as in the constructor which has the same arguments
+ fmodule = source.fmodule;
+ findex = source.findex;
+ fTsignal = source.fTsignal;
+ fNoise = source.fNoise;
+ fSignalAfterElect = source.fSignalAfterElect;
+ fUsed = source.fUsed;
+ for(Int_t i=0;i<this->fgksize;i++){
+ this->fTrack[i] = source.fTrack[i];
+ this->fSignal[i] = source.fSignal[i];
+ this->fHits[i] = source.fHits[i];
+ }
+}
+
//______________________________________________________________________
AliITSpListItem::~AliITSpListItem(){
// Destructor
// none.
// Return:
// A copied AliITSpListItem object
- Int_t i;
+ this->~AliITSpListItem();
+ new(this) AliITSpListItem(source);
+ return *this;
- if(this == &source) return *this;
-
- this->fmodule = source.fmodule;
- this->findex = source.findex;
- for(i=0;i<this->fgksize;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;
- /*
- cout <<"this fTrack[0-9]=";
- for(i=0;i<this->fgksize;i++) cout <<this->fTrack[i]<<",";
- cout <<" fHits[0-9]=";
- for(i=0;i<this->fgksize;i++) cout <<this->fHits[i]<<",";
- cout <<" fSignal[0-9]=";
- for(i=0;i<this->fgksize;i++) cout <<this->fSignal[i]<<",";
- cout << endl;
- cout <<"source fTrack[0-9]=";
- for(i=0;i<this->fgksize;i++) cout <<source.fTrack[i]<<",";
- cout <<" fHits[0-9]=";
- for(i=0;i<this->fgksize;i++) cout <<source.fHits[i]<<",";
- cout <<" fSignal[0-9]=";
- for(i=0;i<this->fgksize;i++) cout <<source.fSignal[i]<<",";
- cout << endl;
- */
- return *this;
}
//______________________________________________________________________
-AliITSpListItem::AliITSpListItem(AliITSpListItem &source) : TObject(source){
+AliITSpListItem::AliITSpListItem(const AliITSpListItem &source) :
+TObject(source),
+fmodule(source.fmodule),
+findex(source.findex),
+fTsignal(source.fTsignal),
+fNoise(source.fNoise),
+fSignalAfterElect(source.fSignalAfterElect),
+fUsed(source.fUsed){
// Copy operator
// Inputs:
// AliITSpListItem &source A AliITSpListItem Object
// none.
// Return:
// A copied AliITSpListItem object
+
+ for(Int_t i=0;i<this->fgksize;i++){
+ this->fTrack[i] = source.fTrack[i];
+ this->fSignal[i] = source.fSignal[i];
+ this->fHits[i] = source.fHits[i];
+ } // end if i
- *this = source;
}
//______________________________________________________________________
void AliITSpListItem::AddSignal(Int_t track,Int_t hit,Int_t module,
Double_t sig;
Bool_t flg=kFALSE;
+ if (TMath::Abs(signal)>2147483647.0) {
+ //PH 2147483647 is the max. integer
+ //PH This apparently is a problem which needs investigation
+ AliWarning(Form("Too big or too small signal value %f",signal));
+ signal = TMath::Sign((Double_t)2147483647,signal);
+ }
if(findex!=index || fmodule!=module)
Warning("AddSignal","index=%d != findex=%d or module=%d != fmodule=%d",
index,findex,module,fmodule);