AliPhysics  095eea3 (095eea3)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages

Do EMCal bad channel analysis. 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 <alloca.h>
#include <string>
#include <cstring>
Include dependency graph for BadChannelAnalysis.C:

Go to the source code of this file.

Functions

void Draw2 (Int_t cell, Int_t cellref=400)
 
void Draw (Int_t cell[], Int_t iBC, Int_t nBC, TString datapath="/scratch/alicehp2/germain/QANew2/", TString period="LHC15f", TString pass="pass2", Int_t trial=0, const Int_t cellref=2377)
 
void Convert (TString datapath="/scratch/alicehp2/germain/QANew2", TString fCalorimeter="EMCAL", TString period="LHC11h", TString pass="pass1_HLT", TString trigger="default")
 
void Process (Int_t *pflag[23040][7], TH1 *inhisto, Double_t Nsigma=4., Int_t dnbins=200, Double_t dmaxval=-1., Int_t compteur=1)
 
void TestCellEandN (Int_t *pflag[23040][7], Double_t Emin=0.1, Double_t Emax=2., Double_t Nsigma=4., Int_t compteur=1, char const *hname="hCellAmplitude", Int_t dnbins=200)
 
void TestCellShapes (Int_t *pflag[23040][7], Double_t fitEmin, Double_t fitEmax, Double_t Nsigma=4., Int_t compteur=1, char const *hname="hCellAmplitude", Int_t dnbins=1000)
 
void ExcludeCells (Int_t *pexclu[23040])
 
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=2.0, Int_t compteur=1, TString datapath="/scratch/alicehp2/germain/QANew2", TString period="LHC15f", TString pass="pass2", Int_t trial=0, TString file="none")
 
void BCAnalysis (TString file, TString datapath="scratch/alicehp2/germain/QANew2", TString trigger="default", TString period="LHC15f", TString pass="pass2", Int_t trial=0)
 
void BadChannelAnalysis (TString datapath="/scratch/alicehp2,germain/QANew2", TString fCalorimeter="EMCAL", TString period="LHC15f", TString pass="pass2", TString trigger="default", Int_t trial=0)
 

Detailed Description

Do EMCal bad channel analysis.

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)


Main method:

BadChannelAnalysis:

step 1 : Convert() read list of mergeable runs in your working directory (in example below the $workdir is "/scratch/alicehp2/germain/QANew2/" The QAresults.root files should be aleady copied from alien and be in $workdir/period/pass/runnb.root read/merge the histos"EMCAL_hAmpId" and "EMCAL_hTimeId" from QAresults.root file and write them in $workdir/period/pass/period_pass_Runlist0New.root" !!! this is hardcoded !!!!! step 1 has to be called only the first time runing on a new list

step 2 BCanalysis() main method to analyse previously created file (hardcoded)

call of different Periodanalysis(criterium,..) functions according to the wanted tests (critreria) 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

Mainly used: 1 and 2 (with different settings (chi2, intervals of energy : this is quite dependent of the stat you may have ) Further improvement: implement tests 1 and 2 on time distribustion histogram


Running the macro

root [2] .L BadChannelAnalysis.C++ root [2] BadChannelAnalysis("EMCAL","LHC15o","muon_caloLego","AnyINTnoBC",trial=0)

!!! pay attention the trigger name depends on the caloQA_triggername you want to analyse check first in QAresults.root what is abvailable !!! it is generally not good to run it on triggered data for the following reasons:


outputs

the output of this analysis povides you: intermediate steps files: (those will be recreated each time you rerun so pa attention to save the different files when changing period/listof runs....

  • Criterum-xx_Emin-xx_Emax-xx.txt : list of identified bad for the different test/Emin/Emax

period_pass.txt file with list of dead/bad cells identified

  • a pdf file with all energy distributions plots of all bad cells candidates (compared to a reference one (hard coded see Draw function to change)

    Further improvement: implement tests 1 and 2 on time distribution histogram

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

Definition in file BadChannelAnalysis.C.

Function Documentation

void BadChannelAnalysis ( TString  datapath = "/scratch/alicehp2,germain/QANew2",
TString  fCalorimeter = "EMCAL",
TString  period = "LHC15f",
TString  pass = "pass2",
TString  trigger = "default",
Int_t  trial = 0 
)

Definition at line 965 of file BadChannelAnalysis.C.

void BCAnalysis ( TString  file,
TString  datapath = "scratch/alicehp2/germain/QANew2",
TString  trigger = "default",
TString  period = "LHC15f",
TString  pass = "pass2",
Int_t  trial = 0 
)

Definition at line 884 of file BadChannelAnalysis.C.

Referenced by BadChannelAnalysis().

void Convert ( TString  datapath = "/scratch/alicehp2/germain/QANew2",
TString  fCalorimeter = "EMCAL",
TString  period = "LHC11h",
TString  pass = "pass1_HLT",
TString  trigger = "default" 
)

Definition at line 216 of file BadChannelAnalysis.C.

void Draw ( Int_t  cell[],
Int_t  iBC,
Int_t  nBC,
TString  datapath = "/scratch/alicehp2/germain/QANew2/",
TString  period = "LHC15f",
TString  pass = "pass2",
Int_t  trial = 0,
const Int_t  cellref = 2377 
)

Definition at line 138 of file BadChannelAnalysis.C.

Referenced by PeriodAnalysis().

void Draw2 ( Int_t  cell,
Int_t  cellref = 400 
)

Definition at line 93 of file BadChannelAnalysis.C.

void ExcludeCells ( Int_t pexclu[23040])

Definition at line 696 of file BadChannelAnalysis.C.

Referenced by PeriodAnalysis().

void KillCells ( Int_t  filter[],
Int_t  nbc 
)

Definition at line 720 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 = 2.0,
Int_t  compteur = 1,
TString  datapath = "/scratch/alicehp2/germain/QANew2",
TString  period = "LHC15f",
TString  pass = "pass2",
Int_t  trial = 0,
TString  file = "none" 
)

Definition at line 741 of file BadChannelAnalysis.C.

Referenced by BCAnalysis().

void Process ( Int_t pflag[23040][7],
TH1 inhisto,
Double_t  Nsigma = 4.,
Int_t  dnbins = 200,
Double_t  dmaxval = -1.,
Int_t  compteur = 1 
)

Definition at line 344 of file BadChannelAnalysis.C.

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

void TestCellEandN ( Int_t pflag[23040][7],
Double_t  Emin = 0.1,
Double_t  Emax = 2.,
Double_t  Nsigma = 4.,
Int_t  compteur = 1,
char const *  hname = "hCellAmplitude",
Int_t  dnbins = 200 
)

Definition at line 477 of file BadChannelAnalysis.C.

Referenced by PeriodAnalysis().

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

Definition at line 558 of file BadChannelAnalysis.C.

Referenced by PeriodAnalysis().