]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
coverity and RuleChecker viol fixes
authordsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Dec 2011 14:04:18 +0000 (14:04 +0000)
committerdsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Dec 2011 14:04:18 +0000 (14:04 +0000)
EMCAL/AliCaloFitSubarray.cxx
EMCAL/AliCaloFitSubarray.h
EMCAL/AliEMCALQAChecker.cxx
EMCAL/AliEMCALQADataMakerRec.cxx
EMCAL/AliEMCALQADataMakerRec.h
EMCAL/AliEMCALRawUtils.cxx
EMCAL/AliEMCALRawUtils.h

index ddbc845d25905e284ab3e44ddd6a3ea8c86f8da5..0b6da95ea17184a8d0eeecf38a3cdfc44fc9d405 100644 (file)
@@ -53,6 +53,15 @@ AliCaloFitSubarray::AliCaloFitSubarray(const AliCaloFitSubarray & fitS) :
 {
 }
 
+//_____________________________________________________________________
+AliCaloFitSubarray& AliCaloFitSubarray::operator = (const AliCaloFitSubarray &source)
+{ // assignment operator; use copy ctor
+  if (&source == this) return *this;
+
+  new (this) AliCaloFitSubarray(source);
+  return *this;
+}
+
 AliCaloFitSubarray::~AliCaloFitSubarray()
 {
 }
index ccf6a606ddfbb61bbdfacbb3da17640d7b72f8e3..b0f6be4cb111ea24144265352ffcc9d8c2fa6119 100644 (file)
@@ -27,6 +27,7 @@ class  AliCaloFitSubarray
   explicit AliCaloFitSubarray(const Int_t init);
 
   AliCaloFitSubarray(const AliCaloFitSubarray &fitSubarray);
+  AliCaloFitSubarray& operator = (const AliCaloFitSubarray& source) ;
 
   virtual  ~AliCaloFitSubarray();
 
index 32ca9caeb57e72f8a0924e2417ceeb59de65381a..f72cc668cbea3accf1db2783c1abab4d84d9b50f 100644 (file)
@@ -111,19 +111,12 @@ fText(new TPaveText(0.2,0.7,0.8,0.9,"NDC"))
 }   
 //__________________________________________________________________
 AliEMCALQAChecker& AliEMCALQAChecker::operator = (const AliEMCALQAChecker &qac) 
-{
-  AliQACheckerBase(qac.GetName(), qac.GetTitle()); 
-  fTextSM  = new TText*[fgknSM] ;
-  fLineCol = static_cast<TLine*>(qac.fLineCol->Clone()) ; 
-  fText    = new TPaveText(0.2,0.7,0.8,0.9,"NDC") ;
-  for (Int_t sm = 0 ; sm < fgknSM ; sm++){
-    fTextSM[sm] = static_cast<TText *>(qac.fTextSM[sm]->Clone()) ;
-  }
-       for(Int_t i = 0; i < 4; i++) {
+{ // assignment operator; use copy ctor
+  if (&qac == this) return *this;
 
-               fLineRow[i] = static_cast<TLine*>(qac.fLineRow[i]->Clone()) ; 
-       }
-  return *this ;
+  this->~AliEMCALQAChecker();
+  new (this) AliEMCALQAChecker(qac);
+  return *this;
 }
 
 //______________________________________________________________________________
index 5f31f00a5c577f72aec7840286ae06409d71177d..2e0e3e9e92e9491b6b4c5476b0c1aa5a3edc5367 100644 (file)
@@ -1080,8 +1080,8 @@ void AliEMCALQADataMakerRec::ConvertProfile2H(TProfile * p, TH2 * histo)
   }
 } 
 //____________________________________________________________________________ 
-void AliEMCALQADataMakerRec::GetTruChannelPosition( Int_t &globRow, Int_t &globColumn, Int_t module, Int_t ddl, Int_t branch, Int_t column )
-{
+void AliEMCALQADataMakerRec::GetTruChannelPosition( Int_t &globRow, Int_t &globColumn, Int_t module, Int_t ddl, Int_t branch, Int_t column ) const
+{ // from local to global indices
   Int_t mrow;
   Int_t mcol;
   Int_t trow;
@@ -1196,18 +1196,18 @@ void AliEMCALQADataMakerRec::MakeRawsSTU(AliRawReader* rawReader)
              FillRawsData(kGL1, etaG, phiG);
                                        
              //loop to sum amplitude of FOR in the gamma patch
-             Int_t L1GPatchAmp = 0;
+             Int_t iL1GPatchAmp = 0;
              for (Int_t L1Gx = 0; L1Gx < sizeL1gpatch; L1Gx ++)
                {
                  for (Int_t L1Gy = 0; L1Gy < sizeL1gpatch; L1Gy ++)
                    {
-                     if (etaG+L1Gx < 48 && phiG+L1Gy < 64) L1GPatchAmp += iEMCALtrig[etaG+L1Gx][phiG+L1Gy];
+                     if (etaG+L1Gx < 48 && phiG+L1Gy < 64) iL1GPatchAmp += iEMCALtrig[etaG+L1Gx][phiG+L1Gy];
                      //cout << iEMCALtrig[etaG+L1Gx][phiG+L1Gy] << endl;
                    }
                }
              
-             //if (L1GPatchAmp > 500) cout << "L1G amp =" << L1GPatchAmp << endl;
-             FillRawsData(kGL1V0, iV0Sig, L1GPatchAmp);
+             //if (iL1GPatchAmp > 500) cout << "L1G amp =" << iL1GPatchAmp << endl;
+             FillRawsData(kGL1V0, iV0Sig, iL1GPatchAmp);
              
            }
        }
@@ -1225,17 +1225,17 @@ void AliEMCALQADataMakerRec::MakeRawsSTU(AliRawReader* rawReader)
              FillRawsData(kJL1, etaJ, phiJ);
                                        
              //loop the sum aplitude of FOR in the jet patch
-             Int_t L1JPatchAmp = 0;
+             Int_t iL1JPatchAmp = 0;
              for (Int_t L1Jx = 0; L1Jx < sizeL1jpatch*4; L1Jx ++)
                {
                  for (Int_t L1Jy = 0; L1Jy < sizeL1jpatch*4; L1Jy ++)
                    {
-                     if (etaJ+L1Jx < 48 && phiJ+L1Jy < 64) L1JPatchAmp += iEMCALtrig[etaJ+L1Jx][phiJ+L1Jy];
+                     if (etaJ+L1Jx < 48 && phiJ+L1Jy < 64) iL1JPatchAmp += iEMCALtrig[etaJ+L1Jx][phiJ+L1Jy];
                    }
                }
                
-             //cout << "L1J amp =" << L1JPatchAmp << endl;
-             FillRawsData(kJL1V0, iV0Sig, L1JPatchAmp);
+             //cout << "L1J amp =" << iL1JPatchAmp << endl;
+             FillRawsData(kJL1V0, iV0Sig, iL1JPatchAmp);
            }
        }
     }
index 80a5aa7f682e150d33e0057cbdc096b55f34950b..517805ccd2cad30b8cfaeb865349886342d0187e 100644 (file)
@@ -125,7 +125,7 @@ public:
 
   virtual void   EndOfDetectorCycle(AliQAv1::TASKINDEX_t, TObjArray ** list) ;
   void           GetCalibRefFromOCDB() ;
-  void          GetTruChannelPosition( Int_t &globRow, Int_t &globColumn, Int_t module, Int_t ddl, Int_t branch, Int_t column ) ;
+  void          GetTruChannelPosition( Int_t &globRow, Int_t &globColumn, Int_t module, Int_t ddl, Int_t branch, Int_t column ) const;
   virtual void   InitESDs() ; 
   virtual void   InitDigits() ; 
   virtual void   InitRecPoints() ; 
index 92cc806248e142bc8d7eefed50bce0f85b735ab8..93393bddac24f9af6d6358c55fe0d9e8e402d7e7 100644 (file)
@@ -70,7 +70,7 @@ AliEMCALRawUtils::AliEMCALRawUtils( Algo::fitAlgorithm fitAlgo) : fNoiseThreshol
                                                                  fUseFALTRO(kTRUE),
                                                                  fRawAnalyzer(0),
                                                                  fTriggerRawDigitMaker(0x0)
-{
+{ // ctor; set up fit algo etc
   SetFittingAlgorithm(fitAlgo);
   const TObjArray* maps = AliEMCALRecParam::GetMappings();
   if(!maps) AliFatal("Cannot retrieve ALTRO mappings!!");
@@ -342,7 +342,7 @@ void AliEMCALRawUtils::Raw2Digits(AliRawReader* reader,TClonesArray *digitsArr,
 
 
 void AliEMCALRawUtils::TrimDigits(TClonesArray *digitsArr) 
-{
+{ // rm entries with LGnoHG (unphysical), out of time window, and too bad chi2
   AliEMCALDigit *digit = 0;
   Int_t n = 0;
   Int_t nDigits = digitsArr->GetEntriesFast();
@@ -372,7 +372,7 @@ void AliEMCALRawUtils::TrimDigits(TClonesArray *digitsArr)
 
 
 void AliEMCALRawUtils::SetFittingAlgorithm(Int_t fitAlgo)              
-{
+{ // select which fitting algo should be used
   delete fRawAnalyzer; // delete doesn't do anything if the pointer is 0x0
   fRawAnalyzer = AliCaloRawAnalyzerFactory::CreateAnalyzer( fitAlgo );
   fRawAnalyzer->SetNsampleCut(5); // requirement for fits to be done, for the new methods
index 9f237a0b99b223e19898a23ae2e5696f881324c6..e3324629c97a592d6d1f09fb1a7d379c721d540c 100644 (file)
@@ -79,7 +79,7 @@ private:
   Float_t fTimeMax;                     // maximum threshold for the time of the signal
   Bool_t  fUseFALTRO;                  // use FALTRO and pass it to the digits
   AliCaloRawAnalyzer *fRawAnalyzer;     // e.g. for sample selection for fits
-  AliEMCALTriggerRawDigitMaker* fTriggerRawDigitMaker; 
+  AliEMCALTriggerRawDigitMaker* fTriggerRawDigitMaker; // trigger raw digit info
  
   ClassDef(AliEMCALRawUtils,7)          // utilities for raw signal fitting