]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALTriggerRawDigitMaker.cxx
Refactoring: removal of dead code, and some cosmetics
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTriggerRawDigitMaker.cxx
index cc6a9c15d3360dba60092034e9d5224f8a484bb5..881fd3d2348c3198afe06ec0feb80bebe6887273 100644 (file)
@@ -43,6 +43,10 @@ Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3
 #include "AliRawVEquipment.h"
 #include "AliRawEquipmentHeader.h"
 
+#include "Riostream.h"
+
+#include "AliCaloRawAnalyzerFactory.h"
+
 namespace
 {
        const Int_t kSTUEqId = 4652;
@@ -75,8 +79,10 @@ fTriggerData(0x0)
       fGeometry =  AliEMCALGeometry::GetInstance(AliEMCALGeometry::GetDefaultGeometryName());
     }
   
-  fRawAnalyzer = new AliCaloRawAnalyzerFakeALTRO();
+  //  fRawAnalyzer = new AliCaloRawAnalyzerFakeALTRO ();
   
+  fRawAnalyzer =  (AliCaloRawAnalyzerFakeALTRO*)AliCaloRawAnalyzerFactory::CreateAnalyzer(kFakeAltro);
+
   fDCSConfig = AliEMCALTriggerDCSConfigDB::Instance();
   
   for (Int_t i=0; i<3072; i++) fRawDigitIndex[i] = -1;
@@ -272,6 +278,7 @@ void AliEMCALTriggerRawDigitMaker::Add(const std::vector<AliCaloBunchInfo> &bunc
 void AliEMCALTriggerRawDigitMaker::PostProcess()
 {      
        //
+        AliDebug(2,"Start post processing the raw digit maker");
        Int_t idx;
        
        AliEMCALTriggerRawDigit* dig = 0x0;
@@ -320,7 +327,16 @@ void AliEMCALTriggerRawDigitMaker::PostProcess()
                                UInt_t adc[96]; for (Int_t j = 0; j < 96; j++) adc[j] = 0;
                                
                                fSTURawStream->GetADC(i, adc);
+                               /*
+                               ofstream outfile(Form("data_TRU%d.txt",i),ios_base::trunc);
+                               
+                               for (Int_t j = 0; j < 96; j++) 
+                               {
+                                       outfile << adc[j] << endl;
+                               }
                                
+                               outfile.close();
+                               */
                                for (Int_t j = 0; j < 96; j++)
                                {
                                        //if (adc[j] < 5) continue;
@@ -362,9 +378,8 @@ void AliEMCALTriggerRawDigitMaker::PostProcess()
                        
                        const Int_t sizePatchL0 = fDCSConfig->GetTRUSegmentation(iTRU) * fDCSConfig->GetTRUSegmentation(iTRU);
                        
-                       Int_t* idFastOR = new Int_t[sizePatchL0]; 
-                       
-                       for (Int_t j = 0; j < sizePatchL0; j++) idFastOR[j] = -1;
+                       Int_t idFastOR[4];
+                       for (Int_t j = 0; j < 4; j++) idFastOR[j] = -1;
                        
                        if (fGeometry->GetFastORIndexFromL0Index(iTRU, x, idFastOR, sizePatchL0))
                        {
@@ -378,20 +393,18 @@ void AliEMCALTriggerRawDigitMaker::PostProcess()
                                        if (fRawDigitIndex[idx] >= 0)
                                        {
                                                dig = (AliEMCALTriggerRawDigit*)fRawDigits->At(fRawDigitIndex[idx]);
-                               }
+                                       }
                                        else
                                        {
                                                fRawDigitIndex[idx] = fRawDigits->GetEntriesFast();
                                                new((*fRawDigits)[fRawDigits->GetEntriesFast()]) AliEMCALTriggerRawDigit(idx, 0x0, 0);
                        
                                                dig = (AliEMCALTriggerRawDigit*)fRawDigits->At(fRawDigitIndex[idx]);
-               }
+                                       }
                
                                        dig->SetTriggerBit(kL0,1);
                                }
                        }
-               
-                       delete [] idFastOR;
                }
                
                for (Int_t i = 0; i < fSTURawStream->GetNL1GammaPatch(); i++)