AliPhysics  vAN-20150924 (e816f45)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
BadChannelAnalysis.C File Reference

Find calorimeter bad cells. More...

#include <TFile.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TH3D.h>
#include <TLine.h>
#include <Riostream.h>
#include <TCanvas.h>
#include <TGraphErrors.h>
#include <TGrid.h>
#include <TStyle.h>
#include <TFileMerger.h>
#include <TMultiGraph.h>
#include <TROOT.h>
#include <TLegend.h>
#include <TString.h>
#include <TGridCollection.h>
#include <TGridResult.h>
#include <TClonesArray.h>
#include <TObjString.h>
#include <stdio.h>
#include <fstream>
#include <iostream>
Include dependency graph for BadChannelAnalysis.C:

Go to the source code of this file.

Functions

void Draw (Int_t cell[], Int_t iBC, Int_t nBC, const Int_t cellref=151)
 
void Convert (TString fCalorimeter="EMCAL", TString period="LHC11h", TString pass="pass1_HLT", TString trigger="default")
 
void Process (Int_t *pflag[11520][7], TH1 *inhisto, Double_t Nsigma=4., Int_t dnbins=200, Double_t dmaxval=-1.)
 
void TestCellEandN (Int_t *pflag[11520][7], Double_t Emin=0.1, Double_t Nsigma=4., char *hname="hCellAmplitude", Int_t dnbins=200)
 
void TestCellShapes (Int_t *pflag[11520][7], Double_t fitEmin, Double_t fitEmax, Double_t Nsigma=4., char *hname="hCellAmplitude", Int_t dnbins=1000)
 
void ExcludeCells (Int_t *pexclu[11520])
 
void KillCells (Int_t filter[], Int_t nbc)
 
void PeriodAnalysis (Int_t criterum=7, Double_t Nsigma=4.0, Double_t Emin=0.1, Double_t Emax=1.0, TString file="none")
 
void BCAnalysis (TString file, TString trigger="default")
 
void BadChannelAnalysis (TString fCalorimeter="EMCAL", TString period="LHC11h", TString pass="pass1_HLT", TString trigger="default")
 

Detailed Description

Find calorimeter bad cells.

This macro has been developed to find badcells candidates in EMCal based on cells amplitude distributions

Input needed : can be either outputs QA from AliAnaCalorimeterQA task (BadChannelAnalysis() function) Or from merged output of AliAnalysisTaskCaloCellsQA (use BCAnalysis() function)

Ouput: in Results.txt file and cell control plots for bad channel candidates will be created in BadCandidate.pdf

To classify between bad/warm/good (this last case can also occur in bad candidates) the user will have to check manually (by eye)control plots. In those in red the bad cell candidate energy distrib in black a reference choosen just to guide the eye

Author
: Alexis Mas (SUBATECH), based on getCellsRunQA.C from Olga Driga (SUBATECH)

Definition in file BadChannelAnalysis.C.

Function Documentation

void BadChannelAnalysis ( TString  fCalorimeter = "EMCAL",
TString  period = "LHC11h",
TString  pass = "pass1_HLT",
TString  trigger = "default" 
)

Execute bad channel analysis.

Definition at line 778 of file BadChannelAnalysis.C.

void BCAnalysis ( TString  file,
TString  trigger = "default" 
)

Configure a complete analysis with different criteria, it provides bad+dead cells lists You can manage criteria used and their order, the first criteria will use the original output file from AliAnalysisTaskCaloCellsQA task, then after each criteria it will use a filtered file without the badchannel previously identified

Definition at line 737 of file BadChannelAnalysis.C.

Referenced by BadChannelAnalysis().

void Convert ( TString  fCalorimeter = "EMCAL",
TString  period = "LHC11h",
TString  pass = "pass1_HLT",
TString  trigger = "default" 
)

Create one file for the analysis from several outputs QA files listed in runlist.txt You need : runlist.txt with runs listed outputsQA e.g period/pass/123456.root

Definition at line 132 of file BadChannelAnalysis.C.

Referenced by BadChannelAnalysis().

void Draw ( Int_t  cell[],
Int_t  iBC,
Int_t  nBC,
const Int_t  cellref = 151 
)

Allow to produce a pdf file with badcells candidates (red) compared to a refence cell (black)

Definition at line 53 of file BadChannelAnalysis.C.

Referenced by ComputeEfficiencyFromCombinHF(), PeriodAnalysis(), AliAnalysisTaskSED0MassCutVarFDSub::Terminate(), and AliAnalysisTaskSED0Mass::Terminate().

void ExcludeCells ( Int_t *  pexclu[11520])

Find the cell with 0 entries for excluding

Definition at line 550 of file BadChannelAnalysis.C.

Referenced by PeriodAnalysis().

void KillCells ( Int_t  filter[],
Int_t  nbc 
)

Kill a cell : put it to 0 entrie

Definition at line 576 of file BadChannelAnalysis.C.

Referenced by PeriodAnalysis().

void PeriodAnalysis ( Int_t  criterum = 7,
Double_t  Nsigma = 4.0,
Double_t  Emin = 0.1,
Double_t  Emax = 1.0,
TString  file = "none" 
)

What it does in function of criterum value

  • 1 : average E for E>Emin
  • 2 : entries for E>Emin
  • 3 : kiĀ²/ndf (from fit of each cell Amplitude between Emin and Emax)
  • 4 : A parameter (from fit of each cell Amplitude between Emin and Emax)
  • 5 : B parameter (from fit of each cell Amplitude between Emin and Emax)
  • 6 :
  • 7 : give bad + dead list

Definition at line 608 of file BadChannelAnalysis.C.

Referenced by BCAnalysis().

void Process ( Int_t *  pflag[11520][7],
TH1 *  inhisto,
Double_t  Nsigma = 4.,
Int_t  dnbins = 200,
Double_t  dmaxval = -1. 
)
  • 1) create a distribution for the input histogram;
  • 2) fit the distribution with a gaussian
  • 3) define good area within +-Nsigma to identfy badcells

inhisto – input histogram; dnbins – number of bins in distribution; dmaxval – maximum value on distribution histogram.

Definition at line 237 of file BadChannelAnalysis.C.

Referenced by ClassImp(), TestCellEandN(), and TestCellShapes().

void TestCellEandN ( Int_t *  pflag[11520][7],
Double_t  Emin = 0.1,
Double_t  Nsigma = 4.,
char *  hname = "hCellAmplitude",
Int_t  dnbins = 200 
)

Three more tests for bad cells:

  • 1) total deposited energy;
  • 2) total number of entries;
  • 3) average energy = [total deposited energy]/[total number of entries].

input; X axis – absId numbers

Definition at line 350 of file BadChannelAnalysis.C.

Referenced by PeriodAnalysis().

void TestCellShapes ( Int_t *  pflag[11520][7],
Double_t  fitEmin,
Double_t  fitEmax,
Double_t  Nsigma = 4.,
char *  hname = "hCellAmplitude",
Int_t  dnbins = 1000 
)

Test cells shape using fit function f(x)=A*exp(-B*x)/x^2. Produce values per cell + distributions for A,B and chi2/ndf parameters.

Definition at line 415 of file BadChannelAnalysis.C.

Referenced by PeriodAnalysis().