ClusterQA

This part of the QA must be run for any calorimeter related analysis (for EMCal/PHOS/DCal and hybrid analyses PCM-EMCal, PCM-PHOS, PCM-DCal)

Identify Bad Cells

For bad cell identification, we need the output from GammaCalo with cellQA output contained (perferably option '5') downloaded runwise (if you don't know how to download runwise output, look here Download Output).

1. Run QA_RunwiseV2.C with doEventQA = kTRUE and doClusterQA = kTRUE (doMergedQA for EMCal merged analysis) with doExtQA == 2! (important for cell level output) using data + MC input in order to generate all needed histograms + txt-files for bad cell identification

Important example histograms for the runwise QA and bad cell identification (plots are from the QA stage and include cells which were declared as bad in the meantime):

2. CellQA step: identify dead and warm/hot cells comparing data and MC information Have a look at the histograms created in $CUTSTRING/$ENERGY/$SUFFIX/Runwise/$PERIOD/ExtQA/* and especially .../ExtQA/MissingCells/* for dead cells, so you get a feel for the variables you are looking at. Dead/warm/hot cell identification is done by comparing the cells EFrac to mean EFrac of neighboring cells. EFrac is defined as follows:

EFrac = cells energy fraction of full cluster energy, summed over all events --> turned out to be a much better discriminator than just looking how often cells fired

We have a dead cell candidate:

  • if((nCurrentEFrac<<mean/3 && mean>=>=80) || (nCurrentEFrac<<mean/5 && mean>=>=40 && mean<<80) || (nCurrentEFrac<<mean/8 && mean>=>=10 && mean<<40) || (nCurrentEFrac<<mean/10 && mean<<10))

A warm/hot cell candidate:

  • if((nCurrentEFrac>>2_mean && nCurrentEFrac_>>80) || (nCurrentEFrac>>3_mean && nCurrentEFrac>>20) || (nCurrentEFrac>>4_mean && nCurrentEFrac>>8) || (nCurrentEFrac>>_5_mean && nCurrentEFrac>>5))

Above conditions for dead/warm/hot cell candidate identification are being applied in function CheckHotAndColdCellsEFracRunwise in QA.h! Be careful that a minimum number of events is needed to process the run in this function (runs with ultra low statistics are excluded as it is impossible to look for hot/dead cells besides the obvious candidates which should then appear in other runs as well) The resulting dead/warm/hot cells are written to respective *.log files that can be found in the output folder.

(located in $CUTSTRING/$ENERGY/$SUFFIX/Runwise/$PERIOD/HotCells_FiredInNRuns_)

Example how the HotCellsRunwise looks like:

Run-189306
NoNoisyCellsFound!
Run-189310
1872-CellEFraction:86.2982-CurrentMean:42.4863
5824-CellEFraction:162.839-CurrentMean:34.1267
5825-CellEFraction:155.015-CurrentMean:34.1267
5833-CellEFraction:243.445-CurrentMean:34.1719
10095-CellEFraction:83.0187-CurrentMean:26.2337
11052-CellEFraction:94.292-CurrentMean:36.1453
Run-189350
10095-CellEFraction:52.5966-CurrentMean:17.4002
11052-CellEFraction:71.3287-CurrentMean:22.9911

Example how the DeadCellsRunwise looks like:

Run-191245
NotEnoughCellsFired-67759-ToObtainColdChannels!
NoColdCellsFound!
Run-191247
NotEnoughCellsFired-87926-ToObtainColdChannels!
NoColdCellsFound!
Run-191248
46-CellEFraction:0.348177-CurrentMean:5.78061
74-CellEFraction:0-CurrentMean:5.78061
103-CellEFraction:0-CurrentMean:5.78061
128-CellEFraction:0-CurrentMean:5.81746
152-CellEFraction:0-CurrentMean:5.72
198-CellEFraction:0-CurrentMean:5.00258
328-CellEFraction:0.23663-CurrentMean:5.02124
353-CellEFraction:0-CurrentMean:5.15569
594-CellEFraction:0-CurrentMean:4.84653
747-CellEFraction:0.390729-CurrentMean:4.39367
759-CellEFraction:0-CurrentMean:4.37241
846-CellEFraction:0.36234-CurrentMean:3.93415
917-CellEFraction:0-CurrentMean:3.63333
1002-CellEFraction:0-CurrentMean:4.16652
1038-CellEFraction:0-CurrentMean:4.18485
1051-CellEFraction:0.346459-CurrentMean:4.21454

The next steps 3./4. are needed as by statistical fluctuations some cells can fire more often or less often than usual, therefore we need to apply further conditions for dead/hot cell identification:

3. Check Dead-Cells for different runs via ClusterQA_DeadCellCompareV2.C

This macro can be run using by enabling the 'doCellQASummary' as last parameter in the QAV2.C, by default this parameter is set to kFALSE. It will then check if the config-file contains the bare minimum of settings to run the ClusterQA_DeadCellCompareV2.C and proceed with the running if this is the case. Thus you will need to add the following lines to your configuration file:

# Settings for dead cell compare macro
addLabelRunlist _dpgTracks
deadCellNSets   1
deadCellNMCSets 1
deadCellNTrigger    1
deadCellDataSetNames LHC16qt    STOP
deadCellMCSetNames  LHC17f2b STOP
deadCellAdditionalOutputDirName LHC16qt
nCaloCells  18000
# deadCellTriggerNames  INT7    STOP
deadCellMCCuts  80000513_2444400051013200000_0163103100000010   STOP
deadCellDataCuts    80000513_2444400051013200000_0163103100000010   STOP
deadCellFractionThesh   0.6

If you want to run the macro without starting QAV2.C you have to create a new configuration file which contains the full set of parameters needed, like configDeadCellQA_LHC16qt_PHOS.txt. In that case it can be started with:

root -b -l -q -x 'TaskQA/ClusterQA_DeadCellCompareV2.C+("Config_files/configLHC16qt_CellQA_PHOS.txt","pdf")'

The determination of dead cells is done using the for-loop around line 364. Different decisions when to consider dead cells:

  • if cell is dead cell candidate in consecutive number of runs (currently set up with 4),

  • if at least 10 dead cell candidates are found with in the same run range or cell candidate is identified to be dead in a given % of analysed runs, represented by fractionThesh.

All results are written/summarized in log-files, which will be not located in the cut folder, but in a folder called ClusterQA_DeadCellCompare.

Example $DATASETNAME-detailed.log:

CellID:198,cold/notFiredInRuns:176701,176730,176749,176753,176926,176927,176929,177011,177148,177173,177180,177182,
CellID:871,cold/notFiredInRuns:176715,176730,176749,176753,176854,176859,176926,176927,176929,177011,
CellID:1002,cold/notFiredInRuns:176927,
CellID:1306,cold/notFiredInRuns:176854,
CellID:1682,cold/notFiredInRuns:176730,176749,176753,176926,176927,
CellID:1683,cold/notFiredInRuns:176730,176749,176753,
CellID:1735,cold/notFiredInRuns:176927,
CellID:2069,cold/notFiredInRuns:176730,176749,176753,176926,176927,176929,
CellID:2171,cold/notFiredInRuns:176926,
CellID:2179,cold/notFiredInRuns:176730,176749,176753,176926,176927,
CellID:2306,cold/notFiredInRuns:176749,
CellID:2312,cold/notFiredInRuns:176749,177011,
CellID:2313,cold/notFiredInRuns:176715,176730,176749,176753,176854,176924,176926,176927,176929,177011,177167,177182,

and according to the selection criteria the final list of dead cells ($DATASETNAME-final.log):

198 in 70.5882% of selected runs dead/cold
871 in 58.8235% of selected runs dead/cold
2313 in 70.5882% of selected runs dead/cold
2395 in 70.5882% of selected runs dead/cold
2778 in 52.9412% of selected runs dead/cold
3940 in 58.8235% of selected runs dead/cold
10086 in 58.8235% of selected runs dead/cold
11091 in 70.5882% of selected runs dead/cold

In addition, there will also be an output file called $DATASETNAME-Runwise.log. The information included in this log file will be the $CellID-$RunNumber-$Sigma. Note for all cold cells the sigma value is set to 10. This will later be used for plotting in ClusterQA_CellCompareV2.C. An example of this can be found below.

52-264078-10
761-264109-10
1310-264188-10

4. Check Hot-Cells for different runs via ClusterQA_HotCellCompareV2.C

As for the previous step, this macro can be run by enabling the 'doCellQASummary' as last parameter in the QAV2.C. It will then check if the config-file contains the bare minimum of settings to run the ClusterQA_HotCellCompareV2.C and proceed with the running if this is the case. Thus you will need to add the following lines to your configuration file:

# Settings for hot cell compare macro
hotCellNSets   1
hotCellNTrigger    1
hotCellDataSetNames LHC16qt    STOP
hotCellAdditionalOutputDirName LHC16qt
# hotCellTriggerNames  INT7    STOP
hotCellDataCuts    80000513_2444400051013200000_0163103100000010   STOP
hotCellThreshNFired   0
hotCellThreshNTotalFired   60

If you want to run the macro without starting QAV2.C you have to create a new configuration file which contains the full set of parameters needed, like configHotCellQA_LHC16qt_PHOS.txt. The macro can then be started with the following command:

root -b -l -q -x 'TaskQA/ClusterQA_HotCellCompareV2.C+("Config_files/configHotCellQA_LHC16qt_PHOS.txt","pdf")'

Determination of warm/hot cells using for-loop around line 248 via 'threshNFired' and 'threshNTotalFired' for 3. + 4. produce output log-files which summarize the bad cells to be excluded in OADB from runwise dead/warm/hot cell determination.

All hot cell candidates are written/summarized in log-files, which will be not located in the cut folder, but in a folder called ClusterQA_HotCellCompare.

Example $DATASETNAME-detailed.log:

CellID: 5602, occurred for first time in run: 177180, in total noisy in - 2 - differentRuns, where it occurred in clusters 370.715 times! That is 10.3574 times than the average of neighboring cells!
CellID: 5860, occurred for first time in run: 176730, in total noisy in - 6 - differentRuns, where it occurred in clusters 956.856 times! That is 2.28916 times than the average of neighboring cells!
CellID: 6835, occurred for first time in run: 176730, in total noisy in - 6 - differentRuns, where it occurred in clusters 884.416 times! That is 2.15624 times than the average of neighboring cells!
CellID: 6933, occurred for first time in run: 176730, in total noisy in - 5 - differentRuns, where it occurred in clusters 1038.84 times! That is 2.14903 times than the average of neighboring cells!
CellID: 7104, occurred for first time in run: 176730, in total noisy in - 4 - differentRuns, where it occurred in clusters 851.255 times! That is 2.14486 times than the average of neighboring cells!
CellID: 8420, occurred for first time in run: 176730, in total noisy in - 2 - differentRuns, where it occurred in clusters 299.125 times! That is 2.23993 times than the average of neighboring cells!

and according to the selection criteria the final list of hot cells (sorted by run or sorted by cell ID) in ($DATASETNAME-final.log):

(cell ID / run number)

11198 176715
11102 176730
11185 176730
11197 176730
11200 176730
11377 176730
5860 176730
6835 176730
6933 176730
7104 176730
8420 176730
8465 176730
8467 176730
8916 176730
9024 176730
9219 176730
9886 176730
10514 176749
9403 176749
11148 176753
9899 176859
5602 177180

Again, there will also be a $DATASETNAME-Runwise.log for the hot cells. The only difference from the cold cells is that instead of getting a default value of 10, the cell will have a decimal sigma value. The format still goes as $CellID-$RunNumber-$Sigma. For clarity, an example is included below.

566-264076-50.7313
567-264076-55.004
570-264076-12.5978
572-264076-11.3802
573-264076-26.5885

After identifying dead/hot cells on runwise level, the general periodwise level CellQA + ClusterQA step follows.

5. CellQA step on periodwise level via running of ClusterQA.C Identify bad cells on periodwise level by using data and MC information. In order to run QA on a periodwise level, a separate config file will need to be created. As before, example configurations can be found in the TaskQA/ExampleConfigurations folder. Additionally, a merged root file from all good runs in a period will be needed for this step.

Setting for bad cell identification are defined in QAV2.C (Double_t arrQAEnergy[4]; Double_t arrQATime[4]; Double_t arrQAHotCells1D[4]; Double_t arrmin2D[9]; Double_t arrmax2D[9];)

The cell IDs are also written to the log-file which is generated:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Suspicious cells from: Energy - Mean/Sigma
Total number of 1 cells
11044, 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Suspicious cells from: Time - Mean/Sigma
Total number of 28 cells
3659, 3750, 3755, 3801, 4090, 4228, 4233, 5767, 5824, 5825, 5833, 7375, 9444, 9445, 9450, 9451, 9880, 9881, 9940, 9941, 10080, 10083, 10085, 10089, 10091, 10095, 10718, 10759, 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Suspicious cells from: HotCells1D
Total number of 7 cells
3659, 9881, 9940, 10095, 10718, 11044, 11052, 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Suspicious cells from: HotCellsTime1D
Total number of 28 cells
2245, 2581, 2665, 2745, 2884, 3659, 3740, 3750, 4230, 5767, 5824, 5825, 5833, 7375, 9450, 9451, 9880, 9881, 9940, 9941, 10080, 10083, 10085, 10089, 10091, 10095, 10718, 10759, 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Suspicious cells from: HotCells2D
Total number of 0 cells

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Suspicious cells from: Missing MC-Data
Total number of 0 cells

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AllCells.size before sort and unique: 64.Finally 37 different cells found!
2245, 2581, 2665, 2745, 2884, 3659, 3740, 3750, 3755, 3801, 4090, 4228, 4230, 4233, 5767, 5824, 5825, 5833, 7375, 9444, 9445, 9450, 9451, 9880, 9881, 9940, 9941, 10080, 10083, 10085, 10089, 10091, 10095, 10718, 10759, 11044, 11052,

In the event that the program crashes at this step (gives error message: ERROR: allCells.size() too big 82442, check cuts! RETURNING…,) then one must revise the cuts given in the config file. For reference, below are the cuts and which figure they correspond to. Note that visually, cut values will be represented as dotted lines on the existing plots.

Config valuesPlot to adjust cuts

min2D, max2D

CellHotCells2D_$DATASETNAME.eps

setQAEnergy

CellEnergyVsSigma_$DATASETNAME.eps

setQATime

CellTimeVsSigma_$DATASETNAME.eps

setQAHotCells1D

CellHotCellsRescaled_$DATASETNAME.eps and CellHotCellsTime1D_$DATASETNAME.eps

An overview plot is generated with an overview by which cut a cell has been identified as bad candidate (the cell IDs are also stored in log-files):

Furthermore, the energy and time distributions are plotted for data and MC:

Real bad cell candidates are immediately visible in comparison to the rest of candidates.

In addition, the energy distribution of each cell candidate is compared between data and MC (normalized to the number of events) to help with the judgement if cells are really bad. At the same time the cell time distribution is compared to that of a random good cell:

Compare data/MC energy and time distributions for all bad cell candidates found in 5. Also use 8.

Then, merge bad cell candidate list from 5. with lists found in 3. and 4. to be excluded in OADB

6. Run bash file lookAtCellQa.sh to sort the energy distribution plots.

This script is simply to make the sorting of bad cells, maybe bad cells, and okay cells based on the energy distribution plots easier for the user. The macro takes 3 parameters, the location of the energy distribution plots, the location of the ok/maybe/bad folders (will be created by the macro), and the suffix (i.e. "png").

The script will then guide the user through the process of sorting, first by showing examples of good cell plots for the data set so that the user can get a feel on how to sort future plots. Then the user can decide via the keys 1,2,or 3 in order to move these plots into the corresponding ok/maybe/bad folder.

7. Run ClusterQA_CleanCellLogs.C via QAV2.C

This macro will go through the log files in ClusterQA_HotCellCompare and ClusterQA_DeadCellCompare and check if some of the cells in there were already flagged as good by the user (in the process described in Step 6) and will delete them. Cells flagged as good will be removed from the log file instead of adding the ones you flagged as bad in Step 6, because we have more confidence in the distributions flagged as good (because the eye is usally better at spotting good things). The cleaned logs will be written to $OriginalFile-Cleaned.log. The information for which folders are flagged as good (and maybe) by the user are taken from the folders containing the Cell#_EnergyComparison files.

Below is the usage to be added to the config file to enable the ClusterQA_CleanCellLogs.C.

Usage (add to config used by QAV2.C):
 *
 * cellCleaningUseMaybe 0 : run the cleaning of log files but ignore a maybe folder
 * cellCleaningUseMaybe 1 : consider all cells in maybe folder as good aswell
 * cellCleaningUseMaybe 2 : consider all cells in maybe folder as bad aswell
 *
 * Optional:
 * userGoodCellDirName $PATH
 * userBadCellDirName $PATH
 * userMaybeCellDirName $PATH
 *
 * if the user doesn't give them explicitly, macro will search in
 *
 * $CUTNUMBER/$ENERGY/ClusterQA/$SUFFIX/Cells/Detailed/ok
 * $CUTNUMBER/$ENERGY/ClusterQA/$SUFFIX/Cells/Detailed/maybe
 * $CUTNUMBER/$ENERGY/ClusterQA/$SUFFIX/Cells/Detailed/bad

8. Run ClusterQA_CellCompareV2.C via QAV2.C to visualize bad cell candidates found in step 5.

This can be run from the steering macro QAV2.C with 'doCellQASummary' (the last parameter in QAV2.C) set to kTRUE. Additionally the following lines must be added to the the configuration file. These additions along with corresponding explanations are shown below.

# Settings needed for Cell Compare Macro
CellCompareNSets  1
CellCompareNTrigger 1

# energy flag
energy  13TeV

# cut number used
cut  00010113_3885500081041220000_01631031000000d0 STOP

# output directories for the hot/cold cell compare
hotCellDirName ClusterQA_HotCellCompare/LHC16_EMC STOP
coldCellDirName ClusterQA_DeadCellCompare/LHC16_EMC STOP

# Data Set Name (should agree with runlist file name)
DataSetNames LHC16p_pass1 STOP

# Specification of Run Range
# If set to 1, Cell Compare will output a log file of all bad cells in run range specified.
# If set to 0, Cell Compare will output a log file of all bad cells.
# note CellCompareRunEnd must be greater than CellCompareRunStart
CellCompareRunRange 1
CellCompareRunStart 264076
CellCompareRunEnd 264088
# additionally an optional user created file can be handed to the cell compare, which will be taken as bad for the whole run list
CellCompareManualBadChannels    ManualLHC16p_addDeadCells.txt
# the CellCompareMinAverageSigma set the minimum of number of sigmas a cell needs to have deviated from the average over the full defined runlist
# this parameter is optional its default is set to 2.0, it will only be used for the cleaned version of the bad cell logs
CellCompareMinAverageSigma  1.5

If you are sure you wanna flag certain cells, which you identified as bad in step 6 and which are not contained in the automatically generated output, please add a list of cells using the variable CellCompareManualBadChannels in the configuration file. The corresponding list should be given as text file in which the cells are separated by line feeds. Cells which are listed in that file will be marked as bad for the full range of runs given in the configuration regardless of the input provided from different sources, thus they will appear as green row in the plots. Please remember to repeat step 5 & 6 for each run block you choose to group and only merge the runs of that block into the corresponding file and repeat the manual flagging. As otherwise you might end up accidentally flagging to many cells in certain run blocks.

In addition to the output plots, which will be described below. This macro also outputs two additional log files for every data set. Depending on the value of runRange this log file will either contain a list of the bad cells within a range of runs specified by runStart and runEnd or a list of all the bad cells in a data set. In the case where runRange is set to 1 the log file will be named BadCells[Cleaned]$DataSetName_**$runStart__$runEnd.log and in the case where runRange is set to 0 the log file will be named BadCells[Cleaned]_$DataSetName.log**. An example of the output for either of these log files is shown below.

322
325
518
522
523
525

From running ClusterQA_CellCompareV2.C there will be two types of histograms generated; one runwise plot of Cell ID (for bad cells) vs. run number and another period wise plot of Cell ID (for bad cells) vs. period. Examples of these plot are shown below. For the runwise plot with lines indicating the cells which would not fullfil the CellCompareMinAverageSigma-condition is also provided. In the corresponding plot the cells which would not be marked as bad are crossed out with a red dashed-dotted line.

The above histogram should be used in to aid pattern recognition in order to determine if cells should be masked globally, or within a certain run range. The idea is that using run ranges would increase statistics. Note that here both hot and dead cells are shown in combination and the z axis represents the sigma.

Summary

DISCLAIMER: This is a summary and not a standalone guide. Please always have a look at all the steps described previously, before doing the QA!

  1. Make sure you have the runwise output of your task, aswell as the merged output for periodwise QA available.

  2. Run QA_RunwiseV2.C with doEventQA = kTRUE and doClusterQA = kTRUE (doMergedQA for EMCal merged analysis) with doExtQA == 2.

    An example configurations can be found in the ExampleConfigurations folder. E.g. your config file could look like this ( please remember to make sure, that you use only tabs or spaces in your config file! not a mix of both):

    # Example config to run over all PHOS period runwise
    mode 5
    cutNr 0
    nSets 10
    nData 5
    energy 7TeV
    filePath /media/florianjonas/dataslave/data/alice/pp7TeV/Legotrain-vAN-20180122-1-gammacalo/runwiseoutput/20180124
    fileName GammaCalo_361.root
    doTrigger kTRUE
    DataSets LHC10b_pass4 LHC10c_pass4 LHC10d_pass4 LHC10e_pass4 LHC10f_pass4 LHC14j4b LHC14j4c LHC14j4d LHC14j4e LHC14j4f STOP
    plotDataSets LHC10b LHC10c LHC10d LHC10e LHC10f Pythia6 Pythia6 Pythia6 Pythia6 Pythia6 STOP
    doHistsForEverySet  kTRUE
  3. Run the QA on a periodwise level using QAV2.C. The example config file given below, contains the minimum settings needed to run on the periodwise level (in this case only for period LHC10b), aswell as running the hot cell compare macro and the dead cell compare macro. You should probably create one config file per period you are analysing, and run the QAV2 macro for each period seperately to avoid any complications.

    mode 5
    nSets 2
    cutNr 0
    energy 7TeV
    
    # LHC10b period
    pathDataSets /media/florianjonas/dataslave/data/alice/pp7TeV/Legotrain-vAN-20180122-1-gammacalo/runwiseoutput/20180124/LHC10b_pass4_GammaCalo_361.root /media/florianjonas/dataslave/data/alice/pp7TeV/Legotrain-vAN-20180122-1-gammacalo/runwiseoutput/20180124/LHC14j4b_GammaCalo_361.root STOP
    DataSetNames LHC10b_pass4 LHC14j4b STOP
    DataSetNamesPlot LHC10b Pythia6 STOP
    
    enableCellQACuts 1
    setQAEnergy 0.08 0.17 0.07 0.19 STOP
    setQATime -0.15E-7 0.8E-7 0 0.5E-6 STOP
    setQAHotCells1D 1.1E2 2.2E2 0 1.6 STOP
    min2D 1 1 1 1 1 0.3 0.3 0.3 0.3 STOP
    max2D 80 80 80 80 80 80 80 80 80 STOP
    
    # Settings for dead cell compare macro
    addLabelRunlist
    deadCellNSets 1
    deadCellNMCSets 1
    deadCellNTrigger 1
    deadCellDataSetNames LHC10b_pass4 STOP
    deadCellMCSetNames LHC14j4b STOP
    deadCellAdditionalOutputDirName LHC10b
    nCaloCells 18000
    # deadCellTriggerNames  INT7    STOP
    deadCellMCCuts 00000113_2444400000013300000_0163803100000010 STOP
    deadCellDataCuts 00000113_2444400000013300000_0163803100000010 STOP
    deadCellFractionThesh 0.6
    
    # Settings for hot cell compare macro
    hotCellNSets 1
    hotCellNTrigger 1
    hotCellDataSetNames LHC10b_pass4 STOP
    hotCellAdditionalOutputDirName LHC10b_pass4 STOP
    # hotCellTriggerNames INT7 STOP
    hotCellDataCuts 00000113_2444400000013300000_0163803100000010 STOP
    hotCellThreshNFired 0
    hotCellThreshNTotalFired 60

    After running over the periodwise output for the first time, you will probably get an ERROR message. This means you have to adjust the cuts in the enableCellQA block in the config file. When the cuts are correct, continue!

  4. Run bash file lookAtCellQa.sh to sort the energy distribution plots. This will take some time, but it is worth the effort! Don't get too frustrated.

  5. Rerun the QAV2.C macro over the period you just sorted in the previous step, but this time add the lines needed for the ClusterQA_CleanCellLogs.C macro. Have a careful look at its output, especially at the cells you flagged as bad, but the macro didn't.

  6. Rerun QAV2.C with the settings and the lines in the config file needed to run run ClusterQA_CellCompareV2.C via QAV2.C .Redo this step for the different subranges you slected after looking at the overview plots and remember to provide it with a file containing the cells you think should be flagged as bad, even though the compare macros didn't evaluate them as bad in the previous step.

  7. You should now have different txt files containing bad cells for different runranges. Remerge the periodwise output according to those runlists and redo the periodwise QA in this range.

  8. Repeat for each period

  9. You are now done with the first iteration of the QA. Re run the task using this bad channel map and then redo QA to make sure you didn't miss any bad cells in first iteration.

Run ClusterQA

The cluster QA covers general cluster+cell properties like:

generated histograms (list of examples) (full set of generated histograms can be deduced from the macros themselves/or from the output generated):

  • Cut overview histograms (vs. pTp_T)

  • Cell histograms (number of cells fired, cell energy/timing,...)

  • Cluster histograms (number of clusters per event, eta/pi distributions,...)

Running the ClusterQA(_Runwise).C will save the output into the following folder structure:

CUTNUMBER/SYSTEM/EventQA/

In addition, *.root files will be generated in CUTNUMBER/SYSTEM/ containing all the histograms as well.

9. Runwise ClusterQA step by analysing output from ClusterQA_Runwise.C Carefully check all output from runwise histograms with special focus on data/MC comparison (Is the MC able to reproduce all QA histograms extracted from data? Does the MC follow the trends seen in data? Are there any suspicious runs or any observations that cannot be explained?...)

10. ClusterQA step by analysing output from ClusterQA.C Carefully check all output from histograms with special focus on data/MC comparison (Is the MC able to reproduce all QA histograms extracted from data? Does the MC follow the distributions seen in data? Are there any suspicious observations or is there anything that cannot be explained?...)

10. Optional: run ClusterQACompare (needs to be configured within macro - not _yet included in steering macros) to compare different data sets (MB vs calorimeter trigger for example for a given dataset; needs input from runwiseQA and periodwiseQA)

Carefully check all output from runwise/full output with special focus on data/MC comparison (Is the MC able to reproduce all QA histograms extracted from data? Does the MC follow the trends seen in data? Are there any suspicious runs or any observations that cannot be explained?...) In general, they should be stable vs. run number - however, one of the exceptions is pileup which may vary from run to run -> need to be taken with special care!

Debug Mode / Visualise Clusters

There is an existing option to write specific clusters to a txt-file with the GammaCalo task (for example cluster combinations with a very small opening angle or select especially huge clusters,...). Once you produced the txt-files with help of the GammaCalo task, you can visualize the clusters by help of the macro Grid_PlotGammaCaloDebug which can be found in TaskQA.

It can be called via:

Grid_PlotGammaCaloDebug(TString filePath = "/home/daniel/data/work/debugOutput.txt", TString outputDir = "DebugPlots", Bool_t plotFullEMCal = kFALSE, Int_t debugOption = 0)

Last updated