]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTriggerQADataMakerRec.cxx
Fix coverity defect
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerQADataMakerRec.cxx
index fd49c55b6c3d56e225683f228a07a7d82a182e25..ab453ee2bf6538dc2a0bac5e813611129165cc79 100644 (file)
@@ -78,7 +78,10 @@ AliMUONVQADataMakerRec(master),
 fDigitMaker(new AliMUONDigitMaker(kFALSE)),
 fCalibrationData(0x0),
 fTriggerProcessor(0x0),
-fDigitStore(0x0)
+fDigitStore(0x0),
+fDigitStoreFromRaw(0x0),
+fTriggerStoreFromRaw(0x0),
+fTriggerStoreReprocessRaw(0x0)
 {
     /// ctor
 }
@@ -89,9 +92,12 @@ AliMUONTriggerQADataMakerRec::~AliMUONTriggerQADataMakerRec()
 {
     /// dtor
   delete fDigitMaker;
-  delete fDigitStore;
   delete fTriggerProcessor;
   delete fCalibrationData;
+  delete fDigitStore;
+  delete fDigitStoreFromRaw;
+  delete fTriggerStoreFromRaw;
+  delete fTriggerStoreReprocessRaw;
 }
 
 //____________________________________________________________________________ 
@@ -200,7 +206,7 @@ void AliMUONTriggerQADataMakerRec::InitRaws()
   // RS: Since there is no sense in cloning trigger scalers per trigger, I am (for the moment) forbidding their cloning
 
   AliCodeTimerAuto("",0);
-  
+    
   const Bool_t expert   = kTRUE ; 
   const Bool_t saveCorr = kTRUE ; 
   const Bool_t image    = kTRUE ; 
@@ -551,8 +557,6 @@ void AliMUONTriggerQADataMakerRec::MakeRaws(AliRawReader* rawReader)
        
     // Init Local/Regional/Global decision with fake values
     //
-    
-    //
 
     UInt_t globalInput[4];
     for (Int_t bit=0; bit<4; bit++){
@@ -566,12 +570,13 @@ void AliMUONTriggerQADataMakerRec::MakeRaws(AliRawReader* rawReader)
     //fTriggerInputGlobalDataHPt[reg][bit]=0;
     //}
     //}
-
-    AliMUONDigitStoreV2R digitStore;
-    
-    AliMUONTriggerStoreV1 recoTriggerStore;
-
-    AliMUONTriggerStoreV1 inputTriggerStore;
+  
+  if ( fDigitStoreFromRaw ) fDigitStoreFromRaw->Clear();
+  else fDigitStoreFromRaw = new AliMUONDigitStoreV2R();
+  if ( fTriggerStoreFromRaw ) fTriggerStoreFromRaw->Clear();
+  else fTriggerStoreFromRaw =  new AliMUONTriggerStoreV1();
+  if ( fTriggerStoreReprocessRaw ) fTriggerStoreReprocessRaw->Clear();
+  else fTriggerStoreReprocessRaw = new AliMUONTriggerStoreV1();
 
     AliMUONGlobalTrigger inputGlobalTrigger;
 
@@ -693,14 +698,14 @@ void AliMUONTriggerQADataMakerRec::MakeRaws(AliRawReader* rawReader)
 
          AliMUONLocalTrigger inputLocalTrigger;
          inputLocalTrigger.SetLocalStruct(loCircuit, *localStruct);
-         inputTriggerStore.Add(inputLocalTrigger);
+         fTriggerStoreFromRaw->Add(inputLocalTrigger);
 
          countNotifiedBoards++;  
 
          TArrayS xyPattern[2];   
          localStruct->GetXPattern(xyPattern[0]);
          localStruct->GetYPattern(xyPattern[1]);
-         fDigitMaker->TriggerDigits(loCircuit, xyPattern, digitStore);
+         fDigitMaker->TriggerDigits(loCircuit, xyPattern, *fDigitStoreFromRaw);
 
          //Get electronic Decisions from data
 
@@ -770,7 +775,7 @@ void AliMUONTriggerQADataMakerRec::MakeRaws(AliRawReader* rawReader)
       } // iReg
 
       Float_t readoutErrors[AliMUONQAIndices::kNtrigStructErrorBins] = {
-       ((Float_t)rawStreamTrig.GetLocalEoWErrors())/((Float_t)countAllBoards),
+       countAllBoards>0?((Float_t)rawStreamTrig.GetLocalEoWErrors())/((Float_t)countAllBoards):0,
        ((Float_t)rawStreamTrig.GetRegEoWErrors())/16.,
        ((Float_t)rawStreamTrig.GetGlobalEoWErrors())/6.,
        ((Float_t)rawStreamTrig.GetDarcEoWErrors())/2.
@@ -804,10 +809,10 @@ void AliMUONTriggerQADataMakerRec::MakeRaws(AliRawReader* rawReader)
       }
     }
 
-  TriggerElectronics()->Digits2Trigger(digitStore,recoTriggerStore);
+  TriggerElectronics()->Digits2Trigger(*fDigitStoreFromRaw,*fTriggerStoreReprocessRaw);
 
   AliMUONGlobalTrigger* recoGlobalTriggerFromLocal;
-  recoGlobalTriggerFromLocal = recoTriggerStore.Global();
+  recoGlobalTriggerFromLocal = fTriggerStoreReprocessRaw->Global();
 
   //Reconstruct Global decision from Global inputs
   UChar_t recoResp = RawTriggerInGlobal2OutGlobal(globalInput);
@@ -815,7 +820,7 @@ void AliMUONTriggerQADataMakerRec::MakeRaws(AliRawReader* rawReader)
   recoGlobalTriggerFromGlobal.SetFromGlobalResponse(recoResp);
 
   // Compare data and reconstructed decisions and fill histos
-  RawTriggerMatchOutLocal(inputTriggerStore, recoTriggerStore);
+  RawTriggerMatchOutLocal();
   //Fill ratio 44/34 histos
   for ( Int_t itc=-1; itc<AliQADataMakerRec::GetNEventTrigClasses(); ++itc ) FillRatio4434Histos(fgkUpdateRatio4434, itc, kFALSE);
   //RawTriggerMatchOutLocalInRegional(); // Not tested, hardware read-out doesn't work
@@ -1195,8 +1200,7 @@ UChar_t AliMUONTriggerQADataMakerRec::RawTriggerInGlobal2OutGlobal(UInt_t global
 }
 
 //____________________________________________________________________________ 
-void AliMUONTriggerQADataMakerRec::RawTriggerMatchOutLocal(const AliMUONVTriggerStore& inputTriggerStore,
-                                                          const AliMUONVTriggerStore& recoTriggerStore)
+void AliMUONTriggerQADataMakerRec::RawTriggerMatchOutLocal()
 {
   //
   /// Match data and reconstructed Local Trigger decision
@@ -1210,7 +1214,7 @@ void AliMUONTriggerQADataMakerRec::RawTriggerMatchOutLocal(const AliMUONVTrigger
 
   // First search for YCopy errors.
   Int_t loCircuit = -1;
-  TIter next(recoTriggerStore.CreateLocalIterator());
+  TIter next(fTriggerStoreReprocessRaw->CreateLocalIterator());
   AliMUONLocalTrigger* recoLocalTrigger, *inputLocalTrigger;
   while ( ( recoLocalTrigger = static_cast<AliMUONLocalTrigger*>(next()) ) )
   {  
@@ -1219,7 +1223,7 @@ void AliMUONTriggerQADataMakerRec::RawTriggerMatchOutLocal(const AliMUONVTrigger
 
     FillRawsData(AliMUONQAIndices::kTriggerErrorLocalYCopyTest,loCircuit);
   
-    inputLocalTrigger = inputTriggerStore.FindLocal(loCircuit);
+    inputLocalTrigger = fTriggerStoreFromRaw->FindLocal(loCircuit);
 
     Int_t recoTrigPattern[4]  = {recoLocalTrigger->GetY1Pattern(), recoLocalTrigger->GetY2Pattern(), recoLocalTrigger->GetY3Pattern(), recoLocalTrigger->GetY4Pattern()};
     Int_t inputTrigPattern[4] = {inputLocalTrigger->GetY1Pattern(), inputLocalTrigger->GetY2Pattern(), inputLocalTrigger->GetY3Pattern(), inputLocalTrigger->GetY4Pattern()};
@@ -1266,10 +1270,10 @@ void AliMUONTriggerQADataMakerRec::RawTriggerMatchOutLocal(const AliMUONVTrigger
       if ( is44 ) FillRawsData(AliMUONQAIndices::kTriggerNumberOf44Dec,loCircuit);
 
       if ( is44 && ! is34 )
-       AliWarning("Event satisfies the 4/4 conditions but not the 3/4");
+       AliWarning(Form("Local board %i satisfies the 4/4 conditions but not the 3/4", loCircuit));
     }
     
-    inputLocalTrigger = inputTriggerStore.FindLocal(loCircuit);
+    inputLocalTrigger = fTriggerStoreFromRaw->FindLocal(loCircuit);
 
     if ( recoLocalTrigger->LoStripX() != inputLocalTrigger->LoStripX() ) {
       FillRawsData(AliMUONQAIndices::kTriggerErrorLocalXPos,loCircuit);
@@ -1516,9 +1520,10 @@ AliMUONCalibrationData* AliMUONTriggerQADataMakerRec::CalibrationData()
 }
 
 //____________________________________________________________________________ 
-void AliMUONTriggerQADataMakerRec::ResetDetectorRaws(TObjArray*/* list*/)
+void AliMUONTriggerQADataMakerRec::ResetDetectorRaws(TObjArray* list)
 {
   /// Reset the calibration data
+  ResetDetector(list);
   delete fTriggerProcessor;
   fTriggerProcessor = 0x0;
   delete fCalibrationData;