]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Remove events with wrong LED firing when clusterizing, valid at least for LHC11a
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 17 Sep 2011 14:09:23 +0000 (14:09 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 17 Sep 2011 14:09:23 +0000 (14:09 +0000)
Count such events in AliAnalysisTaskCounter
Put a protection in case such kind of events are not rejected in the QA since the energy weight is null and causes floating point when normalizing weighted sum.

PWG4/CaloCalib/AliAnalysisTaskEMCALClusterize.cxx
PWG4/CaloCalib/AliAnalysisTaskEMCALClusterize.h
PWG4/PartCorrBase/AliAnalysisTaskCounter.cxx
PWG4/PartCorrDep/AliAnaCalorimeterQA.cxx

index 71b1140601960c5d12154b03ec513a1a95b604c7..ed234ae258ff86666f93664ce1b40d1aec3e8084 100644 (file)
@@ -68,16 +68,21 @@ ClassImp(AliAnalysisTaskEMCALClusterize)
 //________________________________________________________________________
 AliAnalysisTaskEMCALClusterize::AliAnalysisTaskEMCALClusterize(const char *name) 
   : AliAnalysisTaskSE(name)
-  , fGeom(0), fGeomName("EMCAL_COMPLETEV1"),   fGeomMatrixSet(kFALSE), fLoadGeomMatrices(kFALSE)
-  , fCalibData(0),       fPedestalData(0),     fOCDBpath("raw://"),    fAccessOCDB(kFALSE)
-  , fDigitsArr(0),       fClusterArr(0),       fCaloClusterArr(0)
-  , fRecParam(0),        fClusterizer(0),      fUnfolder(0),           fJustUnfold(kFALSE) 
-  , fOutputAODBranch(0), fOutputAODBranchName("newEMCALClusters")
-  , fFillAODFile(kTRUE), fFillAODHeader(0),    fFillAODCaloCells(0)
-  , fRun(-1),            fRecoUtils(0),        fConfigName("")
-  , fCellLabels(),       fCellSecondLabels(),  fCellTime()
+  , fGeom(0),               fGeomName("EMCAL_COMPLETEV1") 
+  , fGeomMatrixSet(kFALSE), fLoadGeomMatrices(kFALSE)
+  , fCalibData(0),          fPedestalData(0)
+  , fOCDBpath("raw://"),    fAccessOCDB(kFALSE)
+  , fDigitsArr(0),          fClusterArr(0),             fCaloClusterArr(0)
+  , fRecParam(0),           fClusterizer(0)
+  , fUnfolder(0),           fJustUnfold(kFALSE) 
+  , fOutputAODBranch(0),    fOutputAODBranchName("newEMCALClusters")
+  , fFillAODFile(kTRUE),    fFillAODHeader(0)
+  , fFillAODCaloCells(0),   fRun(-1)
+  , fRecoUtils(0),          fConfigName("")
+  , fCellLabels(),          fCellSecondLabels(),        fCellTime()
   , fMaxEvent(1000000000),  fDoTrackMatching(kFALSE)
-  , fSelectCell(kFALSE), fSelectCellMinE(0.005), fSelectCellMinFrac(0.001)
+  , fSelectCell(kFALSE),    fSelectCellMinE(0.005),     fSelectCellMinFrac(0.001)
+  , fRemoveLEDEvents(kFALSE)
 {
   //ctor
   for(Int_t i = 0; i < 10;    i++)  fGeomMatrix[i] =  0;
@@ -99,15 +104,22 @@ AliAnalysisTaskEMCALClusterize::AliAnalysisTaskEMCALClusterize(const char *name)
 //________________________________________________________________________
 AliAnalysisTaskEMCALClusterize::AliAnalysisTaskEMCALClusterize() 
   : AliAnalysisTaskSE("DefaultAnalysis_AliAnalysisTaskEMCALClusterize")
-  , fGeom(0), fGeomName("EMCAL_COMPLETEV1"),    fGeomMatrixSet(kFALSE), fLoadGeomMatrices(kFALSE)
-  , fCalibData(0),        fPedestalData(0),     fOCDBpath("raw://"),    fAccessOCDB(kFALSE)  
-  , fDigitsArr(0),        fClusterArr(0),       fCaloClusterArr(0)
-  , fRecParam(0),         fClusterizer(0),      fUnfolder(0),           fJustUnfold(kFALSE)
-  , fOutputAODBranch(0),  fOutputAODBranchName("newEMCALClusters")
-  , fFillAODFile(kFALSE), fFillAODHeader(0),    fFillAODCaloCells(0)
-  , fRun(-1),             fRecoUtils(0),        fConfigName("") 
-  , fCellLabels(),        fCellSecondLabels(),  fMaxEvent(1000000000),  fDoTrackMatching(kFALSE)
-  , fSelectCell(kFALSE),  fSelectCellMinE(0.005), fSelectCellMinFrac(0.001)
+, fGeom(0),               fGeomName("EMCAL_COMPLETEV1") 
+, fGeomMatrixSet(kFALSE), fLoadGeomMatrices(kFALSE)
+, fCalibData(0),          fPedestalData(0)
+, fOCDBpath("raw://"),    fAccessOCDB(kFALSE)
+, fDigitsArr(0),          fClusterArr(0),             fCaloClusterArr(0)
+, fRecParam(0),           fClusterizer(0)
+, fUnfolder(0),           fJustUnfold(kFALSE) 
+, fOutputAODBranch(0),    fOutputAODBranchName("newEMCALClusters")
+, fFillAODFile(kTRUE),    fFillAODHeader(0)
+, fFillAODCaloCells(0),   fRun(-1)
+, fRecoUtils(0),          fConfigName("")
+, fCellLabels(),          fCellSecondLabels(),        fCellTime()
+, fMaxEvent(1000000000),  fDoTrackMatching(kFALSE)
+, fSelectCell(kFALSE),    fSelectCellMinE(0.005),     fSelectCellMinFrac(0.001)
+, fRemoveLEDEvents(kFALSE)
+
 {
   // Constructor
   for(Int_t i = 0; i < 10;    i++)  fGeomMatrix[i] =  0;
@@ -341,6 +353,26 @@ void AliAnalysisTaskEMCALClusterize::UserExec(Option_t *)
   //Remove the contents of output list set in the previous event 
   fOutputAODBranch->Clear("C");
   
+  // Reject event if large clusters with large energy
+  // Use only for LHC11a data for the moment, and if input is clusterizer V1 or V1+unfolding
+  // If clusterzer NxN or V2 it does not help
+  if(fRemoveLEDEvents){
+    for (Int_t i = 0; i < InputEvent()->GetNumberOfCaloClusters(); i++)
+    {
+      AliVCluster *clus = InputEvent()->GetCaloCluster(i);
+      if(clus->IsEMCAL()){    
+        
+        if ((clus->E() > 500 && clus->GetNCells() > 200 ) || clus->GetNCells() > 300) {
+          Int_t absID = clus->GetCellsAbsId()[0];
+          Int_t sm = fGeom->GetSuperModuleNumber(absID);
+          printf("AliAnalysisTaskEMCALClusterize - reject event with cluster : E %f, ncells %d, absId(0) %d, SM %d\n",clus->E(),  clus->GetNCells(),absID, sm);
+          
+          return;
+        }
+      }
+    }
+  }// Remove LED events
+  
   //Magic line to write events to AOD file
   AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(fFillAODFile);
   LoadBranches();
index 51366eaea02a08385e928a27f5a3b8c862cb86c7..b76c233e0b4821a16004a50c96f4b857c6281ec9 100644 (file)
@@ -79,6 +79,9 @@ class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
   void           SwitchOffCellEnergySelection()                 { fSelectCell        = kFALSE  ; } 
   void           SetCellCuts(Float_t e, Float_t frac)           { fSelectCellMinE    = e       ; 
                                                                   fSelectCellMinFrac = frac    ; }
+  void           SwitchOnLEDEventsRemoval()                     { fRemoveLEDEvents   = kTRUE   ; }
+  void           SwitchOffLEDEventsRemoval()                    { fRemoveLEDEvents   = kFALSE  ; } 
+  
   
  private:
     
@@ -131,8 +134,9 @@ class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
   Bool_t                 fSelectCell;          // Reject cells from cluster if energy is too low and recalculate position/energy and other
   Float_t                fSelectCellMinE;      // Min energy cell threshold, after unfolding
   Float_t                fSelectCellMinFrac;   // Min fraction of cell energy after unfolding cut
+  Bool_t                 fRemoveLEDEvents;     // Remove LED events, use only for LHC11a and if input is V1 or V1+unfolding
   
-  ClassDef(AliAnalysisTaskEMCALClusterize, 11);
+  ClassDef(AliAnalysisTaskEMCALClusterize, 12);
 
 };
 
index 801b459ac33fcca81f7dde0892ce23a86de819e3..7c5d4bb79b1358163287a8b8f6fde546c7d3dca3 100644 (file)
@@ -1,6 +1,6 @@
-/**************************************************************************\r
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- *                                                                        *\r
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
  * Author: The ALICE Off-line Project.                                    *
  * Contributors are mentioned in the code where appropriate.              *
  *                                                                        *
@@ -132,7 +132,7 @@ void AliAnalysisTaskCounter::UserCreateOutputObjects()
   fOutputContainer->Add(fhYGoodVertex);
   
   
-  fhNEvents = new TH1I("hNEvents", "Number of analyzed events", 17, 0, 17) ;
+  fhNEvents = new TH1I("hNEvents", "Number of analyzed events", 20, 0, 20) ;
   fhNEvents->SetXTitle("Selection");
   fhNEvents->SetYTitle("# events");
   fhNEvents->GetXaxis()->SetBinLabel(1 ,"1  = PS");
@@ -152,6 +152,10 @@ void AliAnalysisTaskCounter::UserCreateOutputObjects()
   fhNEvents->GetXaxis()->SetBinLabel(15,"15 = 9  & 11");
   fhNEvents->GetXaxis()->SetBinLabel(16,"16 = 10 & 11");
   fhNEvents->GetXaxis()->SetBinLabel(17,"17 = 6  & 10");
+  fhNEvents->GetXaxis()->SetBinLabel(17,"17 = 1  & |Z|<50");  
+  fhNEvents->GetXaxis()->SetBinLabel(18,"18 = Reject EMCAL");
+  fhNEvents->GetXaxis()->SetBinLabel(19,"19 = 18 & 2");
+  fhNEvents->GetXaxis()->SetBinLabel(20,"20 = 18 & |Z|<50");
 
   fOutputContainer->Add(fhNEvents);
 
@@ -306,6 +310,23 @@ void AliAnalysisTaskCounter::UserExec(Option_t *)
 
   //printf("AliAnalysisTaskCounter::UserExec() : z vertex %d, good vertex %d, v0and %d, pile up %d, track mult %d\n ", bSelectVZ, bGoodV, bV0AND, bPileup, trackMult);
   
+  // Events that could be rejected in EMCAL
+  for (Int_t i = 0; i < InputEvent()->GetNumberOfCaloClusters(); i++)
+  {
+    AliVCluster *clus = InputEvent()->GetCaloCluster(i);
+    if(clus->IsEMCAL()){    
+      
+      if ((clus->E() > 500 && clus->GetNCells() > 200 ) || clus->GetNCells() > 300)  {
+        //printf("Counter: Reject event with cluster: E %f, ncells %d\n",clus->E(),clus->GetNCells());
+                         fhNEvents->Fill(17.5); 
+        if(bSelectVZ)    fhNEvents->Fill(18.5);
+        if(TMath::Abs(v[2]) < 50.)  fhNEvents->Fill(19.5); 
+        break;
+      }
+        
+    }
+  }
+  
   PostData(1,fOutputContainer);
 
 }
index f14986f0d587d478288d4609ec78f35fc2be9087..5e9faa48364c22f3f6ae31c367d40c07099e4dcb 100755 (executable)
@@ -1727,7 +1727,11 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
         }        
         
         averTime     /= nCaloCellsPerCluster;
-        weightedTime /= weight;
+       if(weight > 0 ) weightedTime /= weight;
+       else {         
+         printf("AliAnaCalorimeterQA:: Null weight! Investigate: E %f GeV, ncells %d, time max cell %f ns, average time %f ns, absIdMax %d, SM %d\n",
+                   rawEnergy,nCaloCellsPerCluster, tmax, averTime,absIdMax,GetModuleNumber(clus));
+       }
         //printf(" emax %f, clE %f, clEraw %f; tmax %f, averTime %f, weightTime %f\n",emax, clus->E(), rawEnergy, tmax,averTime,weightedTime);
 
       } // only possible in ESDs