Removing useless flag.
[u/mrichter/AliRoot.git] / PMD / pmd_da_info.txt
CommitLineData
2d2b959e 1DETECTOR ALGORITHM for PMD
2++++++++++++++++++++++++++
5b12fe37 3This is a brief note on pmd da:
4 - how to get info at P@2
5 - how it works
6 - the codes
7 - Producing DA codes
8 - Deployment procedures.
9
2d2b959e 10Author: Satyajit Jena
11Date: 14 Nov 2009
12Updated: Wed Aug 4 11:03:37 CEST 2010
13++++++++++++++++++++++++++
5b12fe37 14
15Information is added at:
2d2b959e 16https://twiki.cern.ch/twiki/bin/view/ALICE/DA
17
18Detail of Central DA Framework can be found here:
19https://aliceinfo.cern.ch/DAQ/index.php?q=products/detector-algorithms
20
5b12fe37 21++++++++++++++++++++++++++
22Important Note:
23++++++++++++++++++++++++++
2d2b959e 24Please note that: The informatoins are also kept in the DA code
25header, it is the requirements for DA framework. Please nver change
26the values. it should look like:
27
28PMD DA for online calibration
29
30contact: basanta@iitb.ac.in, Satyajit.Jena@cern.ch
31Link: https://twiki.cern.ch/twiki/bin/view/ALICE/DA
32Reference run:/afs/cern.ch/user/s/sjena/public/run83496.raw
33Run Type: PHYSICS
34DA Type: MON
35Number of events needed: 1 million for PB+PB, 200 milion for p+p
5b12fe37 36Input Files: PMD/Calib/Mapping/Run0_999999999_v0_s0.root, PMD_PED.root,
37 PMD_GAIN_CONFIGFILE, pmd_gain_tempfile.dat
2d2b959e 38Output Files: PMDGAINS.root, to be exported to the DAQ FES
39Trigger types used: PHYSICS_EVENT
40
41
42and
43
44/*
45PMD DA for online calibration
46
47contact: basanta@iitb.ac.in, Satyajit.Jena@cern.ch
48Link: https://twiki.cern.ch/twiki/bin/view/ALICE/DA
49Reference Run:/afs/cern.ch/user/s/sjena/public/run83496.raw
50Run Type: PEDESTAL
51DA Type: LDC
52Number of events needed: 1000
53Input Files: PMD/Calib/Mapping/Run0_999999999_v0_s0.root
54Output Files: pmd_ped.root, to be exported to the DAQ FXS, pedestal230*.ped
55Trigger types used: PHYSICS_EVENT
56
57*/
58
2d2b959e 59This infomration can be accessed in P@2 machince via rpm -qip command
60
61e.g.
62rpm -qip daqDA-PMD-GAIN-36451-trunk.36552.i386.rpm
63
64it will show all the following information it has:
65
66[pmdldc01] /home/pmd/AliSoft/AliRoot > rpm -qip daqDA-PMD-PEDESTAL-36451-trunk.36552.i386.rpm
67Name : daqDA-PMD-PEDESTAL Relocations: /opt/daqDA-PMD-PEDESTAL
68Version : 36451 Vendor: (none)
69Release : trunk.36552 Build Date: Mon 09 Nov 2009 01:51:47 PM CET
70Install Date: (not installed) Build Host: pmdldc01.cern.ch
71Group : Applications/Alice Source RPM: daqDA-PMD-PEDESTAL-36451-trunk.36552.src.rpm
72Size : 65331468 License: CERN Alice DAQ/Offine
73Signature : (none)
74Summary : PMD Detector Algorithm
75Description :
76This is the PMD PEDESTAL DA for online calibration.
77It uses data from PMD and detectors at run time.
78Build requires: daqDAlib, date, AliRoot trunk.36552, ROOT 5.24.00.
79Runtime requires: date.
80Contact: basanta@phy.iitb.ac.in, Satyajit.Jena@cern.ch
81Link:
82Reference Run: /afs/cern.ch/user/s/sjena/public/run83496.raw
83Run type: PEDESTAL
84DA type: LDC
85Number of events needed: 1000
86Input files: PMD/Calib/Mapping
87Output files: pmd_ped.root, to be exported to the DAQ FXS, pedestal230*.ped
88Trigger types used: PHYSICS_EVENT
89
5b12fe37 90================================
2d2b959e 91A Brief Infromation about PMD DA
92================================
93
94PMD has two types of detector algorithm. One algorithm is for the
95pedestal data and the other one is for the online gain calibration.
96
97Pedestal DA
98============
99Pedestal DA is to calculate the mean pedestal value and the root
100mean square value for each channel. The output is written in a
101root file and finally goes to the OCDB
102
103for offline reconstruction.
104--------------
105At the same time this pedestal da also writes the pedestal values
106in ASCII file corresponding to each DDL. This file is appropriately
107converted to the right format and is loaded
108
109to the MARC for pedestal suppression while taking data. The ASCII files are:
110
111 pedestal2304.ped
112 pedestal2305.ped
113 pedestal2306.ped
114 pedestal2307.ped
115 pedestal2308.ped
116 pedestal2309.ped
117
118Six files corresponding to 6 DDL. This is our original configuration.
119
120However, in the year 2009, we have 4 DDL. The corresponding files are:
121
122 pedestal2304.ped
123 pedestal2305.ped
124 pedestal2308.ped
125 pedestal2309.ped
126
127 --Two DDLs are for PREshower plane (2304, 2305) and two DDLs (2308, 2309)
128 are for CPV plane.
129
130 --The input to this da code is the mapping file which can be found here
131 (Run0_999999999_v0_s0.root).
132
133This file can be taken from here or from
134$ALICE_ROOT/OCDB/PMD/Calib/Mapping/Run0_999999999_v0_s0.root.
135
136* Run0_999999999_v0_s0.root: Run0_999999999_v0_s0.root
137
138This file has to be stored in the DAQ database and will be fetched from the
139DAQ database and kept in a local directory as
140
141localOCDB/PMD/Calib/Mapping/Run0_999999999_v0_s0.root.
142
143The output of pedestal da is "PMD_PED.root" which contains mean and rms of
144each channel in a tree. One copy goes to the DAQ database for pedestal
145subtraction while running the gain DA and another copy goes to FES and
146ultimately to the OCDB for offline reconstruction.
147
148The pedestal run for validation can be found here
149
150/afs/cern.ch/user/s/sjena/public/run83496.raw
151
152PMDGAINda:
153=========
154PMDGAIN da calculates the relative gain of individual channel.
155
156The input to this program are the following files.
157
158 Mapping file which is mentioned above and can also be taken from here
159 * Run0_999999999_v0_s0.root: Run0_999999999_v0_s0.root. During the
160 run this file is fetched from the DAQ database and The other input
161 is "PMD_GAIN_CONFIGFILE" which can be either taken from here
162 PMD_GAIN_CONFIGFILE: PMD_GAIN_CONFIGFILE or from
163 $ALICE_ROOT/PMD/PMD_GAIN_CONFIGFILE. This file has 5 words.
164
165 filestatus : 0 or 1 (to start a new run or not)
166 xvar : variance define (say 5 sigma) to define the hot cell
167 totevt : incremented event number
168 maxevt : Total number of Physics event required to find gain
169 hotevtsize : after these many events, the hot cell file will be generated
170
171 PMD_PED.root : A copy of this file is already in the DAQ database.
172 Before every run this is copied from the DAQ database and kept in the
173 local directory for further use.
174
175Output files:
176------------
177PMDGAINS.root
178PMD_MEAN_SM.root
179
180Input/Output files:
181
1821. PMD_HOT.root : This is the output of gain DA and it is again reused by the DA.
183
1842. pmd_gain_tempfile.dat : This is an ASCII file and generated by gain DA
185 and again taken as the input in the next run.
186
187 If filestatus = 0, the temporary file "pmd_gain_tempfile.dat"
188 is generated.
189
190 If filestatus = 1, the temporary file "pmd_gain_tempfile.dat"
191 is fetched from the DAQ database.
192
193
194The file for gain da validation can be found here
195/afs/cern.ch/user/s/sjena/public/run83496.raw
196
5b12fe37 197Detail logics and implimentation can be understood by looking at the
198code with a minimal knowledge of PMD data structures.
199The Link to Codes:
2d2b959e 200
201PEDESTALda http://alisoft.cern.ch/viewvc/trunk/PMD/PMDPEDESTALda.cxx?root=AliRoot&view=log
202GAINda http://alisoft.cern.ch/viewvc/trunk/PMD/PMDGAINda.cxx?root=AliRoot&view=log
203
5b12fe37 204=======================
205How to build PMD DA
2d2b959e 206=======================
207Building of the DAs is handled in Aliroot. You can find below some hints on
208how to build DAs, but this is no official documentation (such documentation
209has been requested). In case of problems please report directly to the
210Offline team. Build targets for DAs are created by cmake. Before invoking cmake,
211in addition to the standard Aliroot settings (see README_CMake in Aliroot),
212one should make sure it will detect the DA dependencies, or DA compile errors may follow:
213
214 DATE: launch DATE setup with . /date/setup.sh
215 AMORE: make sure amore-config is in the path, e.g. export PATH=${PATH}:/opt/amore
216 daqDA-lib: export DAQDALIB_PATH=/opt/daqDA-lib
217
218Sourcing the following example environment should allow to build DAs using
219default dependencies installation path:
220. DAbuildenv.sh
221
222Afte cmake is invoked, one can build DAs with one of the following targets:
223
5b12fe37 224 make daqDA-PMD-all : build all DAs for detector
225 make daqDA-PMD-rpm : build DA RPM packages
2d2b959e 226
227 make daqDA-PMD-PEDESTAL : build a given DA
228 make daqDA-PMD-PEDESTAL-rpm : build a given DA RPM
229
230 make daqDA-PMD-GAIN : build a given DA
231 make daqDA-PMD-GAIN-rpm : build a given DA RPM
232
233RPMs are created in the build directory. Binaries are stored under ./lib/tgt_linuxx8664gcc
234
5b12fe37 235======================
2d2b959e 236DA testing information
237======================
238It is possible to fully test the DAs outside of the production framework.
239It can be done by setting a number of environment variable, as described
240in the example DAtestenv.sh
241
242
243 # This is an example DA test environment
244 # Put DB files needed by DA in $DAQDA_TEST_DIR
245 # and then launch the DA with DAexe DAtestfile.
246 # DA local output files will be in $TESTDIR directory
247 # and exported files (FXS, AMORE, DaqDetDB) will go to $DAQDA_TEST_DIR.
248
249 # to change according to local settings
250 TESTDIR=/tmp/DAtest
251 export DAQDALIB_PATH=.../daqDAlib
252
253 # to be left unchanged
254 export PATH=/bin:/usr/bin
255 export ROOTSYS=NULL
256 unset ALICE_ROOT
257 export DAQDA_TEST_DIR=${TESTDIR}/db
258 export AMORE_NO_DB_DIR=${TESTDIR}/db
259 export DATE_RUN_NUMBER=12345
260 export DATE_DETECTOR_CODE=TST
261 export AMORE_NO_DB=true
262 export DATE_ROLE_NAME=myrole
263 export DIM_DNS_NODE=noname
264
265 mkdir -p $TESTDIR
266 mkdir -p $DAQDA_TEST_DIR
267 cd $TESTDIR
268
5b12fe37 269=================================
2d2b959e 270Detector DA deployment procedure (cc from DA page)
271=================================
272The detector team should contact the DAQ team (alice-datesupport@cern.ch)
273and the following steps should be done (in parenthesis, the responsible
274of each action is indicated):
275
276 1. define the calibrations tasks, DAs and corresponding run types in
277 the ECS (detector team)
278 2. commit code in Aliroot and test it (detector team)
279 3. contact DAQ team to ask for DA release and provide raw data
280 test files (detector team)
281 4. build RPM (DAQ team)
282 5. compliance checks with DA framework packaging and documentation
283 guidelines. (DAQ team)
284 6. in case of fulfillment of the requirements, the DA is considered
285 validated for deployment and the detector team is informed (DAQ team)
286 7. deploy and exercise the DA on a real setup with the full DAQ chain
287 and the detector hardware (detector team)
288 8. all the above steps are mandatory before allowing the usage of the
289 detector DA in production, ie during cosmic runs
290 9. changes in detector DA code (detector team) imply the repetition of
291 steps 2 to 7
292
5b12fe37 293Please feel free to contact me (sjena@cern.ch, satya.ino@gmail.com) to know
294more or in case of any trouble.