]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDCalibChamberStatus.cxx
Fix Coverity 15062, 15063
[u/mrichter/AliRoot.git] / TRD / AliTRDCalibChamberStatus.cxx
index a91ef5588d629f281091647f811491c1085feb7c..08ccbf581cb7eddae21426a79153b15c9c8f01b5 100644 (file)
@@ -17,7 +17,7 @@
 //                                                                        //
 // AliTRDCalibChamberStatus: to determine which half chambers are off     //
 // Produce a AliTRDCalChamberStatus calibration object                    //
-// Check with the AliTRDCalDCSFEE info                                    //
+// Check with the AliTRDCalDCSFEEv2 info                                  //
 //                                                                        //
 //                                                                        //
 // Authors:                                                               //
 #include "AliTRDfeeParam.h"
 #include "AliTRDdigitsManager.h"
 #include "AliTRDSignalIndex.h"
-#include "AliTRDrawFastStream.h"
 #include "AliTRDpadPlane.h"
 #include "./Cal/AliTRDCalChamberStatus.h"
-#include "./Cal/AliTRDCalDCS.h"
-#include "./Cal/AliTRDCalDCSFEE.h"
+#include "./Cal/AliTRDCalDCSv2.h"
+#include "./Cal/AliTRDCalDCSFEEv2.h"
 
 #include "AliTRDrawStream.h"
 
@@ -266,76 +265,6 @@ void AliTRDCalibChamberStatus::Init()
 }
 //_____________________________________________________________________
 void AliTRDCalibChamberStatus::ProcessEvent(AliRawReader * rawReader, Int_t nevents_physics)
-{
-  //
-  // Event Processing loop 
-  //
-  //
-  
-  Bool_t notEmpty = kFALSE;
-    
-  AliTRDrawFastStream *rawStream = new AliTRDrawFastStream(rawReader);
-  if (!rawStream) return;
-  rawStream->SetNoErrorWarning();
-  rawStream->SetSharedPadReadout(kFALSE);
-
-  AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager(kTRUE);
-  digitsManager->CreateArrays();
-  
-  Int_t det    = 0;
-  while ((det = rawStream->NextChamber(digitsManager, NULL, NULL)) >= 0) { 
-
-    //nextchamber loop
-    
-    // do the QA analysis
-    if (digitsManager->GetIndexes(det)->HasEntry()) {//QA
-      // printf("there is ADC data on this chamber!\n");
-      
-      AliTRDSignalIndex *indexes = digitsManager->GetIndexes(det);
-      if (indexes->IsAllocated() == kFALSE) {
-       // AliError("Indexes do not exist!");
-       break;
-      }
-      
-      Int_t iRow  = 0;
-      Int_t iCol  = 0;
-      indexes->ResetCounters();
-      
-      while (indexes->NextRCIndex(iRow, iCol)){
-       Int_t iMcm        = (Int_t)(iCol/18);   // current group of 18 col pads
-       
-       Int_t layer = AliTRDgeometry::GetLayer(det);
-       Int_t sm    = AliTRDgeometry::GetSector(det);
-       Int_t stac  = AliTRDgeometry::GetStack(det);
-       Double_t rphi = 0.5;
-       if(iMcm > 3) rphi = 1.5;
-
-       Double_t val[4] = {sm,layer,stac,rphi}; 
-       fHnSparseI->Fill(&val[0]); 
-       notEmpty = kTRUE;
-       
-       //---------//
-       //  Debug  //
-       if(fDebugLevel > 0) {
-         Int_t detector = AliTRDgeometry::GetDetector(layer,stac,sm);
-         Double_t valu[3] = {nevents_physics,detector,rphi};
-         fHnSparseEvtDet->Fill(&valu[0]); 
-       }
-       //  Debug  //
-       //---------//
-      }
-      
-    }
-    digitsManager->ClearArrays(det);
-  }
-
-  if(notEmpty) fCounterEventNotEmpty++;
-
-  if(digitsManager) delete digitsManager;
-  if(rawStream) delete rawStream;
-   
-}//_____________________________________________________________________
-void AliTRDCalibChamberStatus::ProcessEvent3(AliRawReader * rawReader, Int_t nevents_physics)
 {
   //
   // Event Processing loop with AliTRDrawStream
@@ -402,7 +331,7 @@ void AliTRDCalibChamberStatus::ProcessEvent3(AliRawReader * rawReader, Int_t nev
 
   if(notEmpty) fCounterEventNotEmpty++;
 
-  if(digitsManager) delete digitsManager;
+  delete digitsManager;
   delete rawStream;
    
 }
@@ -502,14 +431,14 @@ void AliTRDCalibChamberStatus::AnalyseHisto() /*FOLD00*/
 
 }
 //_____________________________________________________________________
-void AliTRDCalibChamberStatus::CheckEORStatus(AliTRDCalDCS *calDCS) /*FOLD00*/
+void AliTRDCalibChamberStatus::CheckEORStatus(AliTRDCalDCSv2 *calDCS) /*FOLD00*/
 {
   //
-  //  Correct the AliTRDCalChamberStatus according to the AliTRDCalDCS
+  //  Correct the AliTRDCalChamberStatus according to the AliTRDCalDCSv2
   //  Using globale state of the HalfChamberMerger (HCM)
   //
   for(Int_t det = 0; det < 540; det++) {
-    AliTRDCalDCSFEE* calDCSFEEEOR = calDCS->GetCalDCSFEEObj(det);
+    AliTRDCalDCSFEEv2* calDCSFEEEOR = calDCS->GetCalDCSFEEObj(det);
 
     if(!calDCSFEEEOR) continue;
     
@@ -674,7 +603,7 @@ TH2D* AliTRDCalibChamberStatus::PlotSparseI(Int_t sm,Int_t side)
 
 }
 //_____________________________________________________________________
-TH2F *AliTRDCalibChamberStatus::MakeHisto2DSmPlEORStatus(AliTRDCalDCS *calDCS, Int_t sm, Int_t pl) /*FOLD00*/
+TH2F *AliTRDCalibChamberStatus::MakeHisto2DSmPlEORStatus(AliTRDCalDCSv2 *calDCS, Int_t sm, Int_t pl) /*FOLD00*/
 {
   //
   //  Plot globale state of the HalfChamberMerger (HCM)
@@ -687,7 +616,7 @@ TH2F *AliTRDCalibChamberStatus::MakeHisto2DSmPlEORStatus(AliTRDCalDCS *calDCS, I
   Double_t col0    = padPlane0->GetCol0();
 
   char  name[1000];
-  sprintf(name,"%s DCS status sm %d pl %d",GetTitle(),sm,pl);
+  snprintf(name,1000,"%s DCS status sm %d pl %d",GetTitle(),sm,pl);
   TH2F * his = new TH2F( name, name, 88,-TMath::Abs(row0),TMath::Abs(row0)
                                    ,148,-TMath::Abs(col0),TMath::Abs(col0));
 
@@ -700,7 +629,7 @@ TH2F *AliTRDCalibChamberStatus::MakeHisto2DSmPlEORStatus(AliTRDCalDCS *calDCS, I
   for (Int_t k = 0; k < nstack; k++){
     Int_t det = offsetsmpl+k*6;
     Int_t stac = AliTRDgeometry::GetStack(det);
-    AliTRDCalDCSFEE* calDCSFEEEOR = calDCS->GetCalDCSFEEObj(det);
+    AliTRDCalDCSFEEv2* calDCSFEEEOR = calDCS->GetCalDCSFEEObj(det);
     if(!calDCSFEEEOR) { continue;}
     for (Int_t icol=0; icol<ncols; icol++){
       Int_t nrows = 16;
@@ -716,7 +645,8 @@ TH2F *AliTRDCalibChamberStatus::MakeHisto2DSmPlEORStatus(AliTRDCalDCS *calDCS, I
        // Take the value
        Int_t mcm = paramfee->GetMCMfromPad(irow,icol);
        Int_t rob = paramfee->GetROBfromPad(irow,icol);
-       Int_t state = calDCSFEEEOR->GetMCMGlobalState(rob,mcm); 
+       if(mcm < 0) AliWarning("Problem with mcm number");
+       Int_t state = calDCSFEEEOR->GetMCMGlobalState(rob,TMath::Abs(mcm)); 
                his->SetBinContent(binz,biny,state);
       }
     }
@@ -752,7 +682,7 @@ TH2F *AliTRDCalibChamberStatus::MakeHisto2DSmPlEORStatus(AliTRDCalDCS *calDCS, I
 
 }
 //_____________________________________________________________________________
-TCanvas* AliTRDCalibChamberStatus::PlotHistos2DSmEORStatus(AliTRDCalDCS *calDCS, Int_t sm, const Char_t *name)
+TCanvas* AliTRDCalibChamberStatus::PlotHistos2DSmEORStatus(AliTRDCalDCSv2 *calDCS, Int_t sm, const Char_t *name)
 {
   //
   // Make 2D graph
@@ -779,3 +709,4 @@ TCanvas* AliTRDCalibChamberStatus::PlotHistos2DSmEORStatus(AliTRDCalDCS *calDCS,
 }
 
 
+