]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/doc/QA.tex
online QA documentation - Michael
[u/mrichter/AliRoot.git] / EMCAL / doc / QA.tex
CommitLineData
01081d10 1\section{Run by run QA, how to and code}\r
2\subsection{Online - Francesco, Michael}\r
3\r
4\subsubsection{Creation and checking of online QA histograms (AMORE)}\r
5The QA histograms for the EMCal are created and filled by the class:\\ \r
6\texttt{\$ALICE\_ROOT/EMCAL/AliEMCALQADataMakerRec}\\\r
7It is run both during the offline reconstruction and by the online data quality monitoring framework. Its main methods are:\\\r
8\r
9\texttt{InitRaws()}:\r
10All the QA histograms are created here. Their titles should be self-explaining. Each of them has 2 important flags:\\\r
11\texttt{expert} - if true, the histogram is shipped only to the AMORE expert agent (run in the EMCal station), otherwise it is also shipped to the AMORE shifter agent (at the moment we have 4 histograms monitored by the DQM shifter).\\\r
12\texttt{image} - if true, the plots is saved to the loogbok (there should be 9 plots in the logbook).\\\r
13Each of those histograms is replicated 4 times by the amore framework and filled according to the event species (Calib, Cosmic, LowMultiplicity, HighMultiplicity).\\\r
14\r
15\texttt{MakeRaws(AliRawReader* rawReader)}:\r
16Here we loop over the input raw data stream and we fill the histograms.\\\r
17\r
18\texttt{MakeRawsSTU(AliRawReader* rawReader)}:\r
19STU raw data decoding, provided EMCal trigger experts.\\\r
20\r
21\texttt{GetCalibRefFromOCDB()}:\r
22Get the reference histograms from the OCDB. The ratio between histograms from current run and the reference run is calculated in the \texttt{MakeRaws} method.\\\r
23\r
24\r
25The QA histograms are then analyzed by the class:\\\r
26\texttt{\$ALICE\_ROOT/EMCAL/AliEMCALQAChecker}\\\r
27It checks the data contained in the 4 non-expert histograms. They are at the moment: \r
28\begin{enumerate}\r
29\item Ratio distribution of towers' amplitude in the current run w.r.t. the reference run.\r
30\item Number of hits of L1 Gamma patch.\r
31\item Number of hits of L1 Jet patch.\r
32\item Number of links between TRU and STU. \r
33\end{enumerate}\r
34The main method is:\r
35\texttt{CheckRaws()}: For the first histogram, we check how many\r
36channels have the ratio in the region $0.8-1.2$. If there are more than\r
37the threshold (default = 90\%), everything is ok, otherwise a red box with a ``call\r
38expert'' message is displayed. For L1 Jet/Gamma patch, we check if the\r
39rate of a single patch is higher than the average rate of all other\r
40patches times a certain threshold value (default = 0.5):\r
41\begin{equation}\r
42Rate_{patch}/Rate_{Total} > Threshold /(1 + Threshold)\r
43\end{equation}\r
44\r
45 If so red box with a ``hot spot - call expert'' message is\r
46 displayed. Finally, if there is a number (default = 1) of missing\r
47 STU-TRU links, another red box with a warning message is shown.\r
48If one wants to change the thresholds, this can be done by updating\r
49them in the database (type \texttt{amoreConfigFileBrowser d emc} at\r
50any machine at P2 and edit the file \texttt{QAThresholds.configfile} accordingly).\r
51\r
52\subsubsection{How to's for EMCal AMORE experts}\r
53\r
54\paragraph{How to run AMORE at point 2 (P2):}\r
55\r
56Some useful scripts for running AMORE at P2 are located in the \texttt{\textasciitilde/amore} directory in the aldaqacr51 machine. \texttt{StartAmore.sh} is used to run the agent and the GUI (in the expert mode). It simply launches the \texttt{configMonitor.sh} and the \texttt{checkLogs.sh} (used to check the logs of the agents). \texttt{configMonitor.sh} setup the agent and the GUI using some kdialog commands and runs them.\r
57Basically the agent is run by the following line in the script:\\\r
58\texttt{sshdqm \$agentName nohup \$scriptsPATH/startAmoreAgent.sh \$onlineMode \&}\\\r
59The agent is actually run on the EMCal DQM node via the sshdqm command, so this line basically is used to connect to our dqm node and run the agent there.\\\r
60The GUI is launched in our machine by the command:\\\r
61\texttt{amore -c EMC -m EMCUIQA(TRU) -g configFile.txt}\\\r
62The \texttt{configFile.txt} file contains just one line, i.e. \texttt{runType i}, where \texttt {i} runs from 1 to 4 (1=LowMultiplicity, 2=HighMultiplicity, 3=Cosmic, 4=Calib) and it is used to select the event specie you want to display in the GUI (this file is automatically created each time you run \texttt{configMonitor.sh}).\\\r
63Some other useful scripts (which are launched by \texttt{configMonitor.sh} using the sshdqm) are located in our DQM node. One can login to it by using:\\\r
64\texttt{ssdqm EMCQA}\\\r
65They are located in the \texttt{scripts} directory.\\\r
66\texttt{startAmoreAgent.sh} basically runs the agent, it simply issues the command:\\\r
67\texttt{amoreAgent -a EMCQA -s @\$1: -u}\\\r
68The only parameter here is \$1, which is the gdc to monitor, defined in \texttt{configMonitor.sh}. \r
69\texttt{killAgent.sh} kills any running agent. Be aware that there cannot be 2 running agents of the same kind at the same time (i.e. just one EMCQA and one EMCQAshifter at a time). It can happen that some time the agent does not start when you try to run it. Most of the time this is because the dqm shifter is already running the EMCQA agent instead of just the EMCQAshifter one (they can run it from the dqm station even if they shouldn't). To check if the dqm shifter is running it, simply do \texttt{ps aux | grep EMCQA} in the dmq node, and see if there is an EMCQA process belonging to the user daq. If so, kindly ask the dqm shifter to please kill it.\\\r
70The agent is always running using the same parameters, which are\r
71stored in a database. In order to change them, you should run the\r
72\texttt{amoreConfigFileBrowser} command in the aldaqacr51 machine. A\r
73window will appear, there you can browse a lot of configuration\r
74files. Our files are \texttt{EMCAL\_config.txt} (it contains just the\r
75librares to be loaded by the agent, and the event species to monitor),\r
76\texttt{QAdescriptions\-EMC.configfile} (it contains the descriptions\r
77of the histograms shipped to the dqm shifter), and\r
78\texttt{QAThresholds.configfile} (it contains the thresholds for the\r
79QA checker - see above). You can edit them by pressing the edit button.\r
80\r
81\paragraph{How to run AMORE in the test machine:}\r
82\r
83The EMCal AMORE test machine can be reached via \texttt{ssh\r
84 emcal@pcaldbl601}. The standard setup there is identical to the\r
85setup at P2. In the home directory there are some symbolic links which\r
86need to be changed in order to change the setup and test new\r
87features. \texttt{alirootLink} usually links to\r
88\texttt{/opt/aliroot-<some-ver>}, which is the version currently at P2\r
89(daq team updates the software in the \texttt{/opt} directory when\r
90needed). The same holds for \texttt{rootLink}, \texttt{amoreLink} and\r
91\texttt{amoreSiteLink} (you should not need to change\r
92\texttt{rootLink} and \texttt{amoreLink}). For testing some changes to\r
93the EMCAL QA classes, one has to compile an own version of aliroot\r
94with the new version of those classes, and then make a symbolic link\r
95to the path of this aliroot version. There is an aliroot trunk version\r
96which was used to be updated from time to time for tests in \texttt{fblanco/alisoft}. In the directory \texttt{myamoreStuff} there are 2 version of the AMORE modules: \texttt{current\_deploy} and \texttt{trunk} (of course you should do svn up from time to time). Let's suppose you want to make some modification to our AMORE GUI (the expert one) and test them. Remove the \texttt{amoreSiteLink} (it usually points to \texttt{/amoreSite}). Then do:\\\r
97\texttt{ln -s myamoreStuff/amoreSite amoreSiteLink}\\\r
98(or any other directory you would like to use). Then:\\\r
99\texttt{cd trunk[current\_deploy]/amoreEMC}\\\r
100At this point you can modify either the \texttt{src/ui/EMCUIQA} or \texttt{src/ui/EMCUIQATRU} class. This class contains just some manipulations of canvas/histograms to be shown in the expert panel and should be easy to understand. If there are some doubts, just ask. The first one also contains the hack we use in order to use our own reference file at P2 in used to calculate the ratio to reference (next section will explain how to create a new reference file). \texttt{make install} will install the modified libraries into \texttt{amoreSiteLink}. You can use some of the scripts in the \texttt{fblanco} directory to run the agent and the GUI.\r
101In order to run the expert agent with the expert GUI you should do:\\\r
102\texttt{amoreAgent -a EMCQA -s <some-raw-data>\footnote{If you want to create a raw data file, you should first download a chunk of raw data from alien. Then do:\\ \texttt{deroot file.root file.raw}.\\ Keep in mind that the test machine is shared with other detectors, so avoid to store a lot of raw data there and clean up the space from time to time.} -g emcal\_amore.cfg}\\\r
103After doing ssh to the test machine in another terminal, you do \\\r
104\texttt{amore -d EMC -m EMCUIQA(TRU) -g configGUI.txt}\\\r
105If you want to test the shifter agent, you simply do:\\\r
106\texttt{amoreAgent -a EMCQAshifter -s <some-raw-data> -g emcal\_amore.cfg}\\\r
107and type \texttt{amoreGui} in another terminal window.\\\r
108You can commit changes to the trunk (and not to the current\_deploy) with the usual \texttt{svn commit}. Once you feel that your changes are ready to be deployed at P2, send an email with a request to date-support.\r
109\r
110\r
111\r
112\paragraph{How to create a new reference file:}\r
113\r
114In order to create a new reference file, you have to use the \texttt{doReco.sh} script. The only thing you should do there is the path to the raw data in alien and the number of chunks to analyze (check it in the alien path).\r
115Remember to do \texttt{alien-token-init} and \texttt{source /tmp/gclient\_env\_\$UID} before running the script.\r
116After the script is executed you will have some directories (chunck10, chunk11...). Each of them contains an \texttt{EMCAL.QA.<RunNumber>.root} file. You can do :\\\r
117\texttt{hadd EMCAL.QA.0.root chunck10/EMCAL.QA.<RunNumber>.root \newline chunck11/EMCAL.QA.<RunNumber>.root}\\\r
118to merge them (the output files should always be called \texttt{EMCAL.QA.0.root}).\r
119At this point the output file can be already copied to the aldaqacr51 machine in the emcal station, in which we can change the QARef file whenever we want.\r
120In order to do that, you should copy it to your lxplus area, then from the \texttt{\textasciitilde/amore/QARef} directory in the aldaqacr51 you can do:\\\r
121\texttt{scp your-afs-account@aldaqgw01:/afs/cern.ch/<path-to-file>/<file> .}\\\r
122Do:\\\r
123\texttt{ln -s new-file QA.Ref.root}\\\r
124and add a note to the notes file in the directory.\r
125Then you have to create an OCDB file. In order to do that, you must do\\ \r
126\texttt{aliroot Save2OCDB.C}\\\r
127Standard parameters of the macro are ``EMCAL'' (detector name), 0 (run number) and ``12'' (year). You may need to change only the last one. The macro will create a directory named \texttt{QARef/EMCAL/QA/Calib/}, and the file \texttt{Run0\_999999999\_v0\_s0.root} in it. This file has to be committed to the \texttt{QARef/EMCAL/QA/Calib/} directory of aliroot. You can check it with the \texttt{checkCDB.C} macro (it just displays a couple of histograms).\r
128%\subsection{}\r
129\r
130\subsubsection{Some more informations}\r
131Further details about AMORE can be found here:\\\r
132\href{https://ph-dep-aid.web.cern.ch/ph-dep-aid/amore/}{https://ph-dep-aid.web.cern.ch/ph-dep-aid/amore/}\\\r
133The Twiki page with the general EMCal informations for the DQM shifter is:\\\r
134\href{https://twiki.cern.ch/twiki/bin/viewauth/ALICE/EVEEMC}{https://twiki.cern.ch/twiki/bin/viewauth/ALICE/EVEEMC}\r
135The Twiki page (DQM blackboard) with temporary informations for the DQM shifter is:\\\r
136\href{https://twiki.cern.ch/twiki/bin/viewauth/ALICE/DQMBlackboard}{https://twiki.cern.ch/twiki/bin/viewauth/ALICE/DQMBlackboard}\r
137\r
138\subsection{Offline - Marie}\r
139Analysis code, what we control, how\r
140\r
141\subsection{Event display}\r
142\r
02582a78 143\subsection{Logbook tips}