}
+//________________________________________________________________
AliPHOSCalibData & AliPHOSCalibData::operator = (const AliPHOSCalibData & rhs)
{
//Copy-assignment. Does not delete anything (see destructor)
//compiler generated is ok, but ... because -Weffc++ and pointer
//members we have to define it explicitly.
TNamed::operator=(rhs);
- fCalibDataEmc = rhs.fCalibDataEmc;
- fCalibDataCpv = rhs.fCalibDataCpv;
- fEmcBadChannelsMap = rhs.fEmcBadChannelsMap;
- fEmcDataPath = rhs.fEmcDataPath;
- fCpvDataPath = rhs.fCpvDataPath;
- fEmcBadChannelsMapPath = rhs.fEmcBadChannelsMapPath;
-
+ if (this != &rhs) {
+ fCalibDataEmc = rhs.fCalibDataEmc;
+ fCalibDataCpv = rhs.fCalibDataCpv;
+ fEmcBadChannelsMap = rhs.fEmcBadChannelsMap;
+ fEmcDataPath = rhs.fEmcDataPath;
+ fCpvDataPath = rhs.fCpvDataPath;
+ fEmcBadChannelsMapPath = rhs.fEmcBadChannelsMapPath;
+ }
+ else {
+ AliFatal("Self assignment!");
+ }
return *this;
}
AliPHOSDATreeCluster& AliPHOSDATreeCluster::operator=(const AliPHOSDATreeCluster& cluster){
// Copy Operator
- if( fNDigits> 0 ) delete[] fDigits;
- fEnergy = cluster.fEnergy;
- fNDigits = cluster.fNDigits;
- fRow = cluster.fRow;
- fCol = cluster.fCol;
- //fX = cluster.fX;
- //fY = cluster.fY;
- //fZ = cluster.fZ;
- if( fNDigits > 0 ){
- fDigits = new AliPHOSDATreeDigit[fNDigits];
- int ndigits = fNDigits;
- while( ndigits-- ){
- fDigits[ndigits] = cluster.fDigits[ndigits];
+ if (this != &cluster) {
+ if( fNDigits> 0 ) delete[] fDigits;
+ fEnergy = cluster.fEnergy;
+ fNDigits = cluster.fNDigits;
+ fRow = cluster.fRow;
+ fCol = cluster.fCol;
+ //fX = cluster.fX;
+ //fY = cluster.fY;
+ //fZ = cluster.fZ;
+ if( fNDigits > 0 ){
+ fDigits = new AliPHOSDATreeDigit[fNDigits];
+ int ndigits = fNDigits;
+ while( ndigits-- ){
+ fDigits[ndigits] = cluster.fDigits[ndigits];
+ }
+ } else {
+ fDigits = 0;
}
- } else {
- fDigits = 0;
}
return *this;
}
AliPHOSDATreeEvent& AliPHOSDATreeEvent::operator=(const AliPHOSDATreeEvent& evt){
// Copy Operator
- if( fNDigits > 0 ) delete[] fDigits;
- fNDigits = evt.fNDigits;
- if( fNDigits > 0 ){
- fDigits = new AliPHOSDATreeDigit[fNDigits];
- int ndigits = fNDigits;
- while( ndigits-- ){
- fDigits[ndigits] = evt.fDigits[ndigits];
+ if (this != &evt) {
+ if( fNDigits > 0 ) delete[] fDigits;
+ fNDigits = evt.fNDigits;
+ if( fNDigits > 0 ){
+ fDigits = new AliPHOSDATreeDigit[fNDigits];
+ int ndigits = fNDigits;
+ while( ndigits-- ){
+ fDigits[ndigits] = evt.fDigits[ndigits];
+ }
+ } else {
+ fDigits = 0;
}
- } else {
- fDigits = 0;
- }
- //
- if( fNClusters > 0 ) delete[] fClusters;
- fNClusters = evt.fNClusters;
- if( fNClusters > 0 ){
- fClusters = new AliPHOSDATreeCluster[fNClusters];
- int nclusters = fNClusters;
- while( nclusters-- ){
- fClusters[nclusters] = evt.fClusters[nclusters];
+ //
+ if( fNClusters > 0 ) delete[] fClusters;
+ fNClusters = evt.fNClusters;
+ if( fNClusters > 0 ){
+ fClusters = new AliPHOSDATreeCluster[fNClusters];
+ int nclusters = fNClusters;
+ while( nclusters-- ){
+ fClusters[nclusters] = evt.fClusters[nclusters];
+ }
+ } else {
+ fClusters = 0;
}
- } else {
- fClusters = 0;
}
return *this;
}
{
//Copy-assignment, emulates compiler generated, possibly wrong.
AliPHOSPID::operator = (rhs);
- fIDOptions = rhs.fIDOptions;
- fClusterizer = rhs.fClusterizer;
- fTSMaker = rhs.fTSMaker;
- fFormula = rhs.fFormula;
- fDispersion = rhs.fDispersion;
- fCpvEmcDistance = rhs.fCpvEmcDistance;
- fTimeGate = rhs.fTimeGate;
-
+ if (this != &rhs) {
+ fIDOptions = rhs.fIDOptions;
+ fClusterizer = rhs.fClusterizer;
+ fTSMaker = rhs.fTSMaker;
+ fFormula = rhs.fFormula;
+ fDispersion = rhs.fDispersion;
+ fCpvEmcDistance = rhs.fCpvEmcDistance;
+ fTimeGate = rhs.fTimeGate;
+ }
+ else {
+ AliFatal("Self assignment!");
+ }
return *this;
}
if(det == 0){
return kTRUE;
}
+ if(np == 0){
+ return kFALSE;
+ }
Double_t c1 = (np*sxy - sx*sy)/det; //slope
Double_t c0 = (sy-c1*sx)/np; //offset
if(c1 == 0){
fddf+=phi*ddphi ;
}
- if(ff==0.||nfit==0. ){
+ if(ff<1.e-09||nfit==0 ){
fQuality=199 ;
return kFALSE ;
}