AliPhysics  2797316 (2797316)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnaCaloChannelAnalysis Class Reference

Analyses cell properties and identifies bad cells. More...

#include <AliAnaCaloChannelAnalysis.h>

Inheritance diagram for AliAnaCaloChannelAnalysis:

Public Member Functions

 AliAnaCaloChannelAnalysis ()
 
virtual ~AliAnaCaloChannelAnalysis ()
 
 AliAnaCaloChannelAnalysis (TString period, TString pass, TString trigger, Int_t runNumber, TString workDir, TString listName)
 
void Run ()
 
void SetExternalMergedFile (TString inputName)
 
void SetNTrial (Int_t inputNr)
 
void SetQAChecks (Bool_t inputBool)
 
void AddPeriodAnalysis (Int_t criteria, Double_t nsigma, Double_t emin, Double_t emax)
 

Protected Member Functions

void Init ()
 
TString MergeRuns ()
 
void BCAnalysis ()
 
void PeriodAnalysis (Int_t criterum=7, Double_t nsigma=4.0, Double_t emin=0.1, Double_t emax=2.0)
 
TH1F * BuildHitAndEnergyMean (Int_t crit, Double_t emin=0.1, Double_t emax=2., Double_t nsigma=4.)
 
TH1F * BuildTimeMean (Int_t crit, Double_t emin, Double_t emax, Double_t nsigma)
 
void TestCellShapes (Int_t crit, Double_t fitemin, Double_t fitemax, Double_t nsigma=4.)
 
void FlagAsDead ()
 
void FlagAsBad (Int_t crit, TH1 *inhisto, Double_t nsigma=4., Int_t dnbins=200, Double_t dmaxval=-1.)
 
void SummarizeResults ()
 
TH1 * BuildMeanFromGood ()
 
Bool_t CheckDistribution (TH1 *ratio, TH1 *reference)
 
void SaveBadCellsToPDF (Int_t version, TString pdfName)
 
void PlotFlaggedCells2D (Int_t flag1, Int_t flag2=-1, Int_t flag3=-1)
 

Protected Attributes

Int_t fCurrentRunNumber
 A run number of an analyzed period. This is important for the AliCalorimeterUtils initialization. More...
 
TString fPeriod
 The name of the analyzed period. More...
 
TString fPass
 Pass of the analyzed data. More...
 
TString fTrigger
 Selected trigger for the analysis. More...
 
Int_t fNoOfCells
 Number of cells in EMCal and DCal. More...
 
Int_t fCellStartDCal
 ID of the first cell in the DCal. More...
 
TString fMergeOutput
 Here the merged files of a period are saved for a later analysis. More...
 
TString fAnalysisOutput
 The list with bad channels and histograms are saved in this folder. More...
 
TString fAnalysisInput
 Here the .root files of each run of the period are saved. More...
 
TString fRunList
 Thats the full path and name of the file which contains a list of all runs to be merged together. More...
 
TString fRunListFileName
 This is the name of the file with the run numbers to be merged, by default it's 'runList.txt'. More...
 
TString fWorkdir
 Directory which contains the folders fMergeOutput, fAnalysisInput and fAnalysisOutput. By default it is './'. More...
 
TString fQADirect
 Dierctory in the QA.root files where the input histograms are stored. More...
 
TString fMergedFileName
 Filename of the .root file containing the merged runs. More...
 
std::vector< TArrayD > fAnalysisVector
 Vector of analysis information. Each place is filled with 4 doubles: version, sigma, lower, and upper energy range. More...
 
Int_t fTrial
 Number of trial that this specific analyis is. By default '0' so one can try different settings without overwriting the outputs. More...
 
TString fExternalFileName
 If you have already a file that contains many runs merged together you can place it in fMergeOutput and set it with SetExternalMergedFile(FileName) More...
 
Bool_t fTestRoutine
 This is a flag, if set true will produce some extra quality check histograms. More...
 
Int_t fNMaxCols
 Maximum No of colums in module (eta direction) More...
 
Int_t fNMaxRows
 Maximum No of rows in module (phi direction) More...
 
Int_t fNMaxColsAbs
 Maximum No of colums in Calorimeter. More...
 
Int_t fNMaxRowsAbs
 Maximum No of rows in Calorimeter. More...
 
Int_t * fFlag
 ! fFlag[CellID] = 0 (ok),1 (dead),2 (bad by lower),3 (bad by upper) start at 0 (cellID 0 = histobin 1) More...
 
AliCalorimeterUtilsfCaloUtils
 ! Calorimeter information for the investigated runs More...
 
TH2F * fCellAmplitude
 ! main histogram for the analysis. Cell ID vs. amplitude, read from the input merged file More...
 
TH2F * fCellTime
 ! possible histogram for the analysis. Cell ID vs. time, read from the input merged file More...
 
TH1F * fProcessedEvents
 ! Stores the number of events in the run More...
 
TH2F * fBadChannelMap
 ! output visual summary of bad cell map More...
 
TH2F * fDeadChannelMap
 ! output visual summary of dead cell map More...
 
TH1F * fAvgNHitPerEvVsCellId
 ! being discussed More...
 
TH1F * fAvgEngPerHitVsCellId
 ! being discussed More...
 

Private Member Functions

 AliAnaCaloChannelAnalysis (const AliAnaCaloChannelAnalysis &)
 
AliAnaCaloChannelAnalysisoperator= (const AliAnaCaloChannelAnalysis &)
 

Detailed Description

Analyses cell properties and identifies bad cells.

This is used for bad channel identification in EMCal and DCal. The class builds a mean distribution of certain cell observables and compares single cell properties to this mean. That way bad channels (far off the mean) are identified and flagged. A .pdf file with their spectra is created. This should be cross checked by hand.

Author
Eliane Epple elian.nosp@m.e.ep.nosp@m.ple@y.nosp@m.ale..nosp@m.edu, Yale University
Chiara Bianchin chiar.nosp@m.a.bi.nosp@m.anchi.nosp@m.n@ce.nosp@m.rn.ch, Wayne State University based on the work from
Alexis Mas alexi.nosp@m.mas@.nosp@m.if.us.nosp@m.p.br and
Marie Germain Marie.nosp@m..Ger.nosp@m.main@.nosp@m.suba.nosp@m.tech..nosp@m.in2p.nosp@m.3.fr, SUBATECH which is in turn based on getCellsRunQA.C from
Olga Driga, SUBATECH
Date
Jun 24, 2016

Definition at line 42 of file AliAnaCaloChannelAnalysis.h.

Constructor & Destructor Documentation

AliAnaCaloChannelAnalysis::AliAnaCaloChannelAnalysis ( )

Default constructor

Definition at line 55 of file AliAnaCaloChannelAnalysis.cxx.

virtual AliAnaCaloChannelAnalysis::~AliAnaCaloChannelAnalysis ( )
inlinevirtual

Definition at line 47 of file AliAnaCaloChannelAnalysis.h.

AliAnaCaloChannelAnalysis::AliAnaCaloChannelAnalysis ( TString  period,
TString  pass,
TString  trigger,
Int_t  runNumber,
TString  workDir,
TString  listName 
)

Constructor

Definition at line 78 of file AliAnaCaloChannelAnalysis.cxx.

AliAnaCaloChannelAnalysis::AliAnaCaloChannelAnalysis ( const AliAnaCaloChannelAnalysis )
private

Member Function Documentation

void AliAnaCaloChannelAnalysis::AddPeriodAnalysis ( Int_t  criteria,
Double_t  nsigma,
Double_t  emin,
Double_t  emax 
)

This function adds period analyses to the Bad Channel analysis. Each period analysis needs to be specified with four parameters.

Parameters
criteria– selection criteria. Determines whether to check hits/event, energy/hit, time-, energy distr. etc
nsigma– n sigma cut. Select cells as bad outside this sigma range away from the mean of the distribution of cell values
emin– minimum energy. Perform this test only for a given energy range. This sets the minimum E
emax– maximum energy. Perform this test only for a given energy range. This sets the maximum E

Definition at line 407 of file AliAnaCaloChannelAnalysis.cxx.

void AliAnaCaloChannelAnalysis::BCAnalysis ( )
protected

This function checks how many different criteria should be analysed. It checks how many period analyses criteria are stored in the fAnalysisVector and passes it to the period analyis for execution.

Definition at line 380 of file AliAnaCaloChannelAnalysis.cxx.

Referenced by Run().

TH1F * AliAnaCaloChannelAnalysis::BuildHitAndEnergyMean ( Int_t  crit,
Double_t  emin = 0.1,
Double_t  emax = 2.,
Double_t  nsigma = 4. 
)
protected

Builds average hit per event and the average energy per hit is caluclated for each cell. The output is a histogram with either of these two values as a function of cell ID.

Definition at line 521 of file AliAnaCaloChannelAnalysis.cxx.

Referenced by PeriodAnalysis().

TH1 * AliAnaCaloChannelAnalysis::BuildMeanFromGood ( )
protected

Definition at line 1221 of file AliAnaCaloChannelAnalysis.cxx.

Referenced by SaveBadCellsToPDF().

TH1F * AliAnaCaloChannelAnalysis::BuildTimeMean ( Int_t  crit,
Double_t  emin,
Double_t  emax,
Double_t  nsigma 
)
protected

Empty function Possibility to add there a check on the cell time too, if the time is calibrated for the period

Definition at line 563 of file AliAnaCaloChannelAnalysis.cxx.

Bool_t AliAnaCaloChannelAnalysis::CheckDistribution ( TH1 *  ratio,
TH1 *  reference 
)
protected

This is an automatic check of the amplitude ratio of cell/(mean of good cells) It should help identifying cells that are candidates for recalibration By default all cells are candidates. These checks identify obviously odd looking cells and remove the candidate status (candidate=0). These cells might have spikes, cliffs very steep slopes etc.

Definition at line 1248 of file AliAnaCaloChannelAnalysis.cxx.

Referenced by SaveBadCellsToPDF().

void AliAnaCaloChannelAnalysis::FlagAsBad ( Int_t  crit,
TH1 *  inhisto,
Double_t  nsigma = 4.,
Int_t  dnbins = 200,
Double_t  dmaxval = -1. 
)
protected

This function flags bad cells It uses an histogram set in BuildHitAndEnergyMean() The value for each cell is collected and the abundancy of this values is plotted in a summery histogram (distrib)

The summary histogram (distribution of cell values) is fitted with a gaussion histogram. The good area is -+ nsigma. Cells with values beyond that are flagged as bad

Parameters
crit– flag with channel criteria to be filled
inhisto– input histogram;
dnbins– number of bins in distribution;
dmaxval– maximum value on distribution histogram.

Definition at line 747 of file AliAnaCaloChannelAnalysis.cxx.

Referenced by PeriodAnalysis().

void AliAnaCaloChannelAnalysis::FlagAsDead ( )
protected

This function finds cells with zero entries It flags them by setting the fFlag[CellID] to 1.

Definition at line 704 of file AliAnaCaloChannelAnalysis.cxx.

Referenced by Run().

void AliAnaCaloChannelAnalysis::Init ( )
protected

Initialize default parameters

Definition at line 101 of file AliAnaCaloChannelAnalysis.cxx.

Referenced by AliAnaCaloChannelAnalysis().

TString AliAnaCaloChannelAnalysis::MergeRuns ( )
protected

This function takes the QA outputs from several runs and merges the histograms together, in case there were more than 100 events in this run. The list of runs to be merged is given by fRunList The output file contains three histograms hCellAmplitude, hCellTime and hNEventsProcessedPerRun

Definition at line 238 of file AliAnaCaloChannelAnalysis.cxx.

Referenced by Run().

AliAnaCaloChannelAnalysis& AliAnaCaloChannelAnalysis::operator= ( const AliAnaCaloChannelAnalysis )
private
void AliAnaCaloChannelAnalysis::PeriodAnalysis ( Int_t  criterion = 7,
Double_t  nsigma = 4.0,
Double_t  emin = 0.1,
Double_t  emax = 2.0 
)
protected

This function builds the distribution of cell properties like eg. hit/event in a cell by calling BuildHitAndEnergyMean() Then the cells are flagged as bad if the given cell property is far off (nsigma) of the mean distribution of all cell values.

There are different checks done depending on the given criteria: 1 : deposited E/hit for E>Emin and E<Emax 2 : recorded hits/event for E>Emin and E<Emax 3 and 4 are currently not used - needs carefull checking for the future checks on the time distribution can be implemented

Definition at line 427 of file AliAnaCaloChannelAnalysis.cxx.

Referenced by BCAnalysis().

void AliAnaCaloChannelAnalysis::PlotFlaggedCells2D ( Int_t  flag1,
Int_t  flag2 = -1,
Int_t  flag3 = -1 
)
protected

Plots a 2D map of flagged cells, dead, bad, good depending on the selected value of fFlag[]

Definition at line 1348 of file AliAnaCaloChannelAnalysis.cxx.

Referenced by SummarizeResults().

void AliAnaCaloChannelAnalysis::Run ( )

Main execution method.

1) If no eternal file is provided use MergeRuns() to merge historgrams from a runlist .txt file. The merged outputfile contains 3 different histograms (hCellAmplitude, hCellTime and hNEventsProcessedPerRun). 2) Flags dead cells 3) Analyses merged histograms by calling BCAnalysis() and flags bad cells. 4) It calls SummarizeResults() to store all information in output files (.gif .txt .pdf)

Definition at line 171 of file AliAnaCaloChannelAnalysis.cxx.

void AliAnaCaloChannelAnalysis::SaveBadCellsToPDF ( Int_t  version,
TString  pdfName 
)
protected

Allow to produce a .pdf file with 9 histograms per page They contain the energy distribution of bad cells (blue) and compare them to the mean of all good cells (gray). Different options are possible. To be selected with

Parameters
versionversion=0 ->Print dead cells version=1 ->Print bad cells version=2 ->Print ratio of good cells to mean of all good cells version=10->Print the ratio of badcell distr. and mean good cell distr.
version– flag that selects how and which cells are plotted into the pdf
pdfName– name of the .pdf file

Definition at line 1099 of file AliAnaCaloChannelAnalysis.cxx.

Referenced by SummarizeResults().

void AliAnaCaloChannelAnalysis::SetExternalMergedFile ( TString  inputName)
inline

Definition at line 53 of file AliAnaCaloChannelAnalysis.h.

void AliAnaCaloChannelAnalysis::SetNTrial ( Int_t  inputNr)
inline

Definition at line 54 of file AliAnaCaloChannelAnalysis.h.

void AliAnaCaloChannelAnalysis::SetQAChecks ( Bool_t  inputBool)
inline

Definition at line 55 of file AliAnaCaloChannelAnalysis.h.

void AliAnaCaloChannelAnalysis::SummarizeResults ( )
protected

In this function the final status of the analysis is summarized. .txt file with dead and bad channel IDs. .pdf file with ampltidues and amplitude ratios of bad cells .gif files with a 2D map of bad, dead and good channels

Definition at line 975 of file AliAnaCaloChannelAnalysis.cxx.

Referenced by Run().

void AliAnaCaloChannelAnalysis::TestCellShapes ( Int_t  crit,
Double_t  fitemin,
Double_t  fitemax,
Double_t  nsigma = 4. 
)
protected

This method is currently not used 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 575 of file AliAnaCaloChannelAnalysis.cxx.

Referenced by PeriodAnalysis().

Member Data Documentation

TString AliAnaCaloChannelAnalysis::fAnalysisInput
protected

Here the .root files of each run of the period are saved.

Definition at line 92 of file AliAnaCaloChannelAnalysis.h.

Referenced by Init(), and MergeRuns().

TString AliAnaCaloChannelAnalysis::fAnalysisOutput
protected

The list with bad channels and histograms are saved in this folder.

Definition at line 91 of file AliAnaCaloChannelAnalysis.h.

Referenced by FlagAsBad(), Init(), PeriodAnalysis(), PlotFlaggedCells2D(), and SummarizeResults().

std::vector<TArrayD> AliAnaCaloChannelAnalysis::fAnalysisVector
protected

Vector of analysis information. Each place is filled with 4 doubles: version, sigma, lower, and upper energy range.

Definition at line 100 of file AliAnaCaloChannelAnalysis.h.

Referenced by AddPeriodAnalysis(), BCAnalysis(), and Init().

TH1F* AliAnaCaloChannelAnalysis::fAvgEngPerHitVsCellId
protected

! being discussed

Definition at line 127 of file AliAnaCaloChannelAnalysis.h.

TH1F* AliAnaCaloChannelAnalysis::fAvgNHitPerEvVsCellId
protected

! being discussed

Definition at line 126 of file AliAnaCaloChannelAnalysis.h.

TH2F* AliAnaCaloChannelAnalysis::fBadChannelMap
protected

! output visual summary of bad cell map

Definition at line 123 of file AliAnaCaloChannelAnalysis.h.

AliCalorimeterUtils* AliAnaCaloChannelAnalysis::fCaloUtils
protected

! Calorimeter information for the investigated runs

Definition at line 117 of file AliAnaCaloChannelAnalysis.h.

Referenced by FlagAsBad(), Init(), and PlotFlaggedCells2D().

TH2F* AliAnaCaloChannelAnalysis::fCellAmplitude
protected

! main histogram for the analysis. Cell ID vs. amplitude, read from the input merged file

Definition at line 119 of file AliAnaCaloChannelAnalysis.h.

Referenced by BuildHitAndEnergyMean(), BuildMeanFromGood(), FlagAsDead(), Run(), SaveBadCellsToPDF(), SummarizeResults(), and TestCellShapes().

Int_t AliAnaCaloChannelAnalysis::fCellStartDCal
protected

ID of the first cell in the DCal.

Definition at line 87 of file AliAnaCaloChannelAnalysis.h.

Referenced by Init(), and SummarizeResults().

TH2F* AliAnaCaloChannelAnalysis::fCellTime
protected

! possible histogram for the analysis. Cell ID vs. time, read from the input merged file

Definition at line 120 of file AliAnaCaloChannelAnalysis.h.

Referenced by Run(), and SummarizeResults().

Int_t AliAnaCaloChannelAnalysis::fCurrentRunNumber
protected

A run number of an analyzed period. This is important for the AliCalorimeterUtils initialization.

Definition at line 82 of file AliAnaCaloChannelAnalysis.h.

Referenced by AliAnaCaloChannelAnalysis(), and Init().

TH2F* AliAnaCaloChannelAnalysis::fDeadChannelMap
protected

! output visual summary of dead cell map

Definition at line 124 of file AliAnaCaloChannelAnalysis.h.

TString AliAnaCaloChannelAnalysis::fExternalFileName
protected

If you have already a file that contains many runs merged together you can place it in fMergeOutput and set it with SetExternalMergedFile(FileName)

Definition at line 104 of file AliAnaCaloChannelAnalysis.h.

Referenced by Init(), and Run().

Int_t* AliAnaCaloChannelAnalysis::fFlag
protected

! fFlag[CellID] = 0 (ok),1 (dead),2 (bad by lower),3 (bad by upper) start at 0 (cellID 0 = histobin 1)

Definition at line 114 of file AliAnaCaloChannelAnalysis.h.

Referenced by BuildHitAndEnergyMean(), BuildMeanFromGood(), FlagAsBad(), FlagAsDead(), Init(), PeriodAnalysis(), PlotFlaggedCells2D(), SaveBadCellsToPDF(), and SummarizeResults().

TString AliAnaCaloChannelAnalysis::fMergedFileName
protected

Filename of the .root file containing the merged runs.

Definition at line 99 of file AliAnaCaloChannelAnalysis.h.

Referenced by Init(), MergeRuns(), and Run().

TString AliAnaCaloChannelAnalysis::fMergeOutput
protected

Here the merged files of a period are saved for a later analysis.

Definition at line 90 of file AliAnaCaloChannelAnalysis.h.

Referenced by Init(), and Run().

Int_t AliAnaCaloChannelAnalysis::fNMaxCols
protected

Maximum No of colums in module (eta direction)

Definition at line 108 of file AliAnaCaloChannelAnalysis.h.

Referenced by Init().

Int_t AliAnaCaloChannelAnalysis::fNMaxColsAbs
protected

Maximum No of colums in Calorimeter.

Definition at line 110 of file AliAnaCaloChannelAnalysis.h.

Referenced by FlagAsBad(), Init(), and PlotFlaggedCells2D().

Int_t AliAnaCaloChannelAnalysis::fNMaxRows
protected

Maximum No of rows in module (phi direction)

Definition at line 109 of file AliAnaCaloChannelAnalysis.h.

Referenced by Init().

Int_t AliAnaCaloChannelAnalysis::fNMaxRowsAbs
protected

Maximum No of rows in Calorimeter.

Definition at line 111 of file AliAnaCaloChannelAnalysis.h.

Referenced by FlagAsBad(), Init(), and PlotFlaggedCells2D().

Int_t AliAnaCaloChannelAnalysis::fNoOfCells
protected
TString AliAnaCaloChannelAnalysis::fPass
protected

Pass of the analyzed data.

Definition at line 84 of file AliAnaCaloChannelAnalysis.h.

Referenced by AliAnaCaloChannelAnalysis(), Init(), MergeRuns(), and SummarizeResults().

TString AliAnaCaloChannelAnalysis::fPeriod
protected

The name of the analyzed period.

Definition at line 83 of file AliAnaCaloChannelAnalysis.h.

Referenced by AliAnaCaloChannelAnalysis(), Init(), MergeRuns(), and SummarizeResults().

TH1F* AliAnaCaloChannelAnalysis::fProcessedEvents
protected

! Stores the number of events in the run

Definition at line 121 of file AliAnaCaloChannelAnalysis.h.

Referenced by BuildHitAndEnergyMean(), and Run().

TString AliAnaCaloChannelAnalysis::fQADirect
protected

Dierctory in the QA.root files where the input histograms are stored.

Definition at line 98 of file AliAnaCaloChannelAnalysis.h.

Referenced by Init(), and MergeRuns().

TString AliAnaCaloChannelAnalysis::fRunList
protected

Thats the full path and name of the file which contains a list of all runs to be merged together.

Definition at line 93 of file AliAnaCaloChannelAnalysis.h.

Referenced by Init(), and MergeRuns().

TString AliAnaCaloChannelAnalysis::fRunListFileName
protected

This is the name of the file with the run numbers to be merged, by default it's 'runList.txt'.

Definition at line 94 of file AliAnaCaloChannelAnalysis.h.

Referenced by AliAnaCaloChannelAnalysis(), and Init().

Bool_t AliAnaCaloChannelAnalysis::fTestRoutine
protected

This is a flag, if set true will produce some extra quality check histograms.

Definition at line 105 of file AliAnaCaloChannelAnalysis.h.

Referenced by Init(), SaveBadCellsToPDF(), and SummarizeResults().

Int_t AliAnaCaloChannelAnalysis::fTrial
protected

Number of trial that this specific analyis is. By default '0' so one can try different settings without overwriting the outputs.

Definition at line 103 of file AliAnaCaloChannelAnalysis.h.

Referenced by Init(), and SummarizeResults().

TString AliAnaCaloChannelAnalysis::fTrigger
protected

Selected trigger for the analysis.

Definition at line 85 of file AliAnaCaloChannelAnalysis.h.

Referenced by AliAnaCaloChannelAnalysis(), Init(), and MergeRuns().

TString AliAnaCaloChannelAnalysis::fWorkdir
protected

Directory which contains the folders fMergeOutput, fAnalysisInput and fAnalysisOutput. By default it is './'.

Definition at line 95 of file AliAnaCaloChannelAnalysis.h.

Referenced by AliAnaCaloChannelAnalysis().


The documentation for this class was generated from the following files: