]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALQADataMakerRec.cxx
put back previous default value, although decission needs to be made to which one...
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALQADataMakerRec.cxx
index b1792f69cfb571dae3a19e0828a016954b67f2be..de7598e55e15c22f1bff0c8ad15749167d6c806c 100644 (file)
@@ -66,7 +66,6 @@ Also calculate the ratio of amplitude from LED Monitor system (current/Reference
 #include "AliCaloFitResults.h"
 #include "AliCaloRawAnalyzerFastFit.h"
 #include "AliCaloRawAnalyzerNN.h"
-//#include "AliCaloRawAnalyzerLMS.h"
 #include "AliCaloRawAnalyzerKStandard.h"
 #include "AliCaloRawAnalyzerPeakFinder.h"
 #include "AliCaloRawAnalyzerCrude.h"
@@ -80,13 +79,13 @@ using namespace std;
 ClassImp(AliEMCALQADataMakerRec)
            
 //____________________________________________________________________________ 
-AliEMCALQADataMakerRec::AliEMCALQADataMakerRec(fitAlgorithm fitAlgo) : 
+AliEMCALQADataMakerRec::AliEMCALQADataMakerRec(Int_t fitAlgo) :
   AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kEMCAL), "EMCAL Quality Assurance Data Maker"),
   fFittingAlgorithm(0),
   fRawAnalyzer(0),
   fRawAnalyzerTRU(0),
-       fGeom(0),
-  fSuperModules(12), // FIXME!!! number of SuperModules; 12 for 2012; update default for later runs 
+  fGeom(0),
+  fSuperModules(20), // number of SuperModules; updated to 20 for EMCal + DCal 
   fFirstPedestalSample(0),
   fLastPedestalSample(3),
   fFirstPedestalSampleTRU(0),
@@ -112,15 +111,8 @@ AliEMCALQADataMakerRec::AliEMCALQADataMakerRec(fitAlgorithm fitAlgo) :
 {
   // ctor
   SetFittingAlgorithm(fitAlgo);
-  
-  //fRawAnalyzerTRU = new AliCaloRawAnalyzerLMS();
-  
-  fRawAnalyzerTRU =  ( AliCaloRawAnalyzerKStandard*)AliCaloRawAnalyzerFactory::CreateAnalyzer(kLMS);
-  
-  fRawAnalyzerTRU->SetFixTau(kTRUE); 
-  fRawAnalyzerTRU->SetTau(2.5); // default for TRU shaper
 
-       fGeom = new AliEMCALGeometry("EMCAL_COMPLETE12SMV1", "EMCAL");
+  fGeom = new AliEMCALGeometry("EMCAL_COMPLETE12SMV1_DCAL_8SM", "EMCAL");
 //  for (Int_t sm = 0 ; sm < fSuperModules ; sm++){
 //    fTextSM[sm] = NULL ;
 //  }
@@ -161,10 +153,6 @@ AliEMCALQADataMakerRec::AliEMCALQADataMakerRec(const AliEMCALQADataMakerRec& qad
   SetTitle((const char*)qadm.GetTitle()); 
   SetFittingAlgorithm(qadm.GetFittingAlgorithm());
   
-  //fRawAnalyzerTRU = new AliCaloRawAnalyzerLMS();
-  fRawAnalyzerTRU = (AliCaloRawAnalyzerKStandard*)AliCaloRawAnalyzerFactory::CreateAnalyzer(kLMS);
-  fRawAnalyzerTRU->SetFixTau(kTRUE); 
-  fRawAnalyzerTRU->SetTau(2.5); // default for TRU shaper
 //  for (Int_t sm = 0 ; sm < fSuperModules ; sm++){
 //    fTextSM[sm] = qadm.fTextSM[sm] ;
 //  }  
@@ -397,12 +385,12 @@ void AliEMCALQADataMakerRec::InitRaws()
   TH2I * hT3 = new TH2I("hTRUEmcalL0hits", "L0 trigger hits: Total number of 2x2 L0 generated",  nTRUCols, -0.5, nTRUCols - 0.5, nTRURows, -0.5, nTRURows-0.5);
   hT3->SetOption("COLZ");
   //hT3->Sumw2();
-  Add2RawsList(hT3, kNL0TRU, !expert, image, !saveCorr);
+  Add2RawsList(hT3, kNL0TRU, expert, image, !saveCorr);
 
   // L0 trigger hits: average time (bins are TRU channels)
   TProfile2D * hT4 = new TProfile2D("hTRUEmcalL0hitsAvgTime", "L0 trigger hits: average time bin", nTRUCols, -0.5, nTRUCols - 0.5, nTRURows, -0.5, nTRURows-0.5, profileOption);
   hT4->SetOption("COLZ");
-  Add2RawsList(hT4, kTimeL0TRU, !expert, image, !saveCorr);
+  Add2RawsList(hT4, kTimeL0TRU, expert, image, !saveCorr);
 
   // L0 trigger hits: first in the event (bins are TRU channels)
   TH1I * hT5 = new TH1I("hTRUEmcalL0hitsFirst", "L0 trigger hits: First hit in the event", nTot2x2, -0.5, nTot2x2);
@@ -474,11 +462,11 @@ void AliEMCALQADataMakerRec::InitRaws()
   h15->GetZaxis()->SetNdivisions(3);
   h15->UseCurrentStyle();
   h15->SetDirectory(0);
-  Add2RawsList(h15, k2DRatioAmp, !expert, image, !saveCorr) ;
+  Add2RawsList(h15, k2DRatioAmp, expert, image, !saveCorr) ;
 
   TH1F * h16 = new TH1F("hRatioDist", "Amplitude_{current run}/Amplitude_{reference run} ratio distribution", nTot, 0., 2.);
-  h16->SetMinimum(0.1); 
-  h16->SetMaximum(100.);
+  // h16->SetMinimum(0.1); 
+  // h16->SetMaximum(100.);
   gStyle->SetOptStat(0);
   h16->UseCurrentStyle();
   h16->SetDirectory(0);
@@ -495,14 +483,14 @@ void AliEMCALQADataMakerRec::InitRaws()
   hL10->UseCurrentStyle();
   hL10->SetDirectory(0);
 //  hL10->SetOption("E");
-  Add2RawsList(hL10, kLEDMonRatio, !expert, image, !saveCorr) ;
+  Add2RawsList(hL10, kLEDMonRatio, expert, image, !saveCorr) ;
 
   TH1F * hL11 = new TH1F("hMaxMinusMinLEDMonRatioDist", "LEDMon amplitude, Ratio distribution", nTotLEDMon, 0, 2);
-  hL11->SetMinimum(0.1) ;
+  // hL11->SetMinimum(0.1) ;
   gStyle->SetOptStat(0);
   hL11->UseCurrentStyle();
   hL11->SetDirectory(0);
-  Add2RawsList(hL11, kLEDMonRatioDist, !expert, image, !saveCorr) ;
+  Add2RawsList(hL11, kLEDMonRatioDist, expert, image, !saveCorr) ;
   
   GetCalibRefFromOCDB();   
 
@@ -518,11 +506,11 @@ void AliEMCALQADataMakerRec::InitRaws()
  TProfile2D *hS0 = new TProfile2D("hL1Amp", "Mean STU signal per Row and Column", nSTUCols, -0.5, nSTUCols-0.5, nSTURows, -0.5, nSTURows-0.5);
  Add2RawsList(hS0, kAmpL1, expert, !image, !saveCorr) ;
        
- TH2F *hS1 = new TH2F("hL1Gamma", "L1 Gamma patch position (FastOR top-left)", nSTUCols, -0.50, nSTUCols-0.5, nSTURows, -0.5, nSTURows-0.5);
- Add2RawsList(hS1, kGL1, expert, image, !saveCorr) ;
+ TH2F *hS1 = new TH2F("hL1Gamma", "L1 Gamma patch position (FastOR top-left)", nSTUCols, -0.50, nSTUCols-0.5, nSTURows + 5, -0.5, nSTURows-0.5 + 5); //+5 for better visible error box
+ Add2RawsList(hS1, kGL1, !expert, image, !saveCorr) ;
        
  TH2F *hS2 = new TH2F("hL1Jet", "L1 Jet patch position (FastOR top-left)", 12, -0.5, nSTUCols-0.5, 16, 0, nSTURows-0.5);
- Add2RawsList(hS2, kJL1, expert, image, !saveCorr) ;
+ Add2RawsList(hS2, kJL1, !expert, image, !saveCorr) ;
        
  TH2I *hS3 = new TH2I("hL1GV0", "L1 Gamma patch amplitude versus V0 signal", 500, 0, 50000, 1500, 0, 1500);
  Add2RawsList(hS3, kGL1V0, expert, image, !saveCorr) ;
@@ -531,7 +519,7 @@ void AliEMCALQADataMakerRec::InitRaws()
  Add2RawsList(hS4, kJL1V0, expert, !image, !saveCorr) ;
 
  TH1I *hS5 = new TH1I("hFrameR","Link between TRU and STU", 32, 0, 32);
- Add2RawsList(hS5, kSTUTRU, expert, !image, !saveCorr) ;
+ Add2RawsList(hS5, kSTUTRU, !expert, image, !saveCorr) ;
 
  hS0->SetOption("COLZ");
  hS1->SetOption("COLZ");
@@ -986,47 +974,14 @@ void AliEMCALQADataMakerRec::StartOfDetectorCycle()
 void AliEMCALQADataMakerRec::SetFittingAlgorithm(Int_t fitAlgo)              
 {
   //Set fitting algorithm and initialize it if this same algorithm was not set before.
-  //printf("**** Set Algorithm , number %d ****\n",fitAlgo);
 
-  
   fRawAnalyzer =  AliCaloRawAnalyzerFactory::CreateAnalyzer(fitAlgo);
-  fFittingAlgorithm = fitAlgo; 
-
-  /*
-  if(fitAlgo == fFittingAlgorithm && fRawAnalyzer) {
-    //Do nothing, this same algorithm already set before.
-    //printf("**** Algorithm already set before, number %d, %s ****\n",fitAlgo, fRawAnalyzer->GetName());
-    return;
-  }
-  //Initialize the requested algorithm
-  if(fitAlgo != fFittingAlgorithm || !fRawAnalyzer) {
-    //printf("**** Init Algorithm , number %d ****\n",fitAlgo);
-               
-    fFittingAlgorithm = fitAlgo; 
-    if (fRawAnalyzer) delete fRawAnalyzer;  // delete prev. analyzer if existed.
-               
-    if (fitAlgo == kFastFit) {
-      fRawAnalyzer = new AliCaloRawAnalyzerFastFit();
-    }
-    else if (fitAlgo == kNeuralNet) {
-      fRawAnalyzer = new AliCaloRawAnalyzerNN();
-    }
-    else if (fitAlgo == kLMS) {
-      fRawAnalyzer = new AliCaloRawAnalyzerLMS();
-    }
-    else if (fitAlgo == kPeakFinder) {
-      fRawAnalyzer = new AliCaloRawAnalyzerPeakFinder();
-    }
-    else if (fitAlgo == kCrude) {
-      fRawAnalyzer = new AliCaloRawAnalyzerCrude();
-    }
-    else {
-      AliWarning("EMCAL QA invalid fit algorithm choice") ; 
-    }
-
-  }
-  return;
-  */
+  fFittingAlgorithm = fitAlgo;
+  
+  // Init also here the TRU algo, even if it is fixed type.
+  fRawAnalyzerTRU = (AliCaloRawAnalyzerKStandard*)AliCaloRawAnalyzerFactory::CreateAnalyzer(Algo::kFakeAltro);
+  fRawAnalyzerTRU->SetFixTau(kTRUE);
+  fRawAnalyzerTRU->SetTau(2.5); // default for TRU shaper
 }
 
 //_____________________________________________________________________________________
@@ -1146,11 +1101,11 @@ void AliEMCALQADataMakerRec::MakeRawsSTU(AliRawReader* rawReader)
       Int_t sizeL1jpatch = 2+(fw >> 16);
 
       //To check link
-      Int_t mask = inSTU->GetFrameReceived();
+      Int_t mask = inSTU->GetFrameReceived() ^ inSTU->GetRegionEnable();
 
       for (int i = 0; i < 32; i++)
        {
-         if ((mask >> i) & 0x1) FillRawsData(kSTUTRU, i);
+               if (!((mask >> i) &  0x1)) FillRawsData(kSTUTRU, i);
        }
 
       //V0 signal in STU
@@ -1180,9 +1135,9 @@ void AliEMCALQADataMakerRec::MakeRawsSTU(AliRawReader* rawReader)
                        
       //L1 Gamma patches
       Int_t iTRUSTU, x, y;
-      for (Int_t i = 0; i < inSTU->GetNL1GammaPatch(); i++)
+      for (Int_t i = 0; i < inSTU->GetNL1GammaPatch(0); i++)
        {
-         if (inSTU->GetL1GammaPatch(i, iTRUSTU, x, y)) // col (0..23), row (0..3)
+         if (inSTU->GetL1GammaPatch(i, 0, iTRUSTU, x, y)) // col (0..23), row (0..3)
            {
              Int_t iTRU;
              iTRU = fGeom->GetTRUIndexFromSTUIndex(iTRUSTU);
@@ -1213,9 +1168,9 @@ void AliEMCALQADataMakerRec::MakeRawsSTU(AliRawReader* rawReader)
        }
                
       //L1 Jet patches
-      for (Int_t i = 0; i < inSTU->GetNL1JetPatch(); i++)
+      for (Int_t i = 0; i < inSTU->GetNL1JetPatch(0); i++)
        {
-         if (inSTU->GetL1JetPatch(i, x, y)) // col (0,15), row (0,11)
+         if (inSTU->GetL1JetPatch(i, 0, x, y)) // col (0,15), row (0,11)
            {
              
              Int_t etaJ = sizeL1jsubr * (11-y-sizeL1jpatch + 1);