- Disentangle masks effect from trigger chamber efficiency estimation.
[u/mrichter/AliRoot.git] / MUON / READMEshuttle.txt
CommitLineData
518eb852 1// $Id$
2
3/*!
4
91509ec6 5\page README_shuttle Shuttle
aa9dd72b 6
e661d480 7How to test the Shuttle preprocessor(s) for MUON.
8
9We will get two "logical" MUON preprocessors : one for the tracker and one for the trigger.
10Both will manage several subtasks (e.g. the tracker one will handle pedestals,
11 gains and deadchannels, while the trigger one will handle masks and trigger lut)
12"Physically", only one class will manage both the tracker and the trigger : AliMUONPreprocessor.
13Depending on the subsystem and on the task to be performed (based on the run type), this class
14 will instanciate the correct set of AliMUONVSubProcessor(s) which does the actual job.
15Output of most processors will end up in OCDB (Offine Condition DataBase). A set of helper functions
e66e85b0 16 to peek at this OCDB are gathered in AiMUONCDB class.
e661d480 17
518eb852 18
19\section shuttle_s1 TestMUONPreprocessor.C
e661d480 20
21This is the master macro used to check the MUON part of the Shuttle.
22Depending on what you want to test, you'll have to modify the input files
23(using shuttle->AddInputFile) and/or the run type (using shuttle->AddInputRunParameter())
24
518eb852 25
26\section shuttle_s2 AliMUONPreprocessor(const TString& detName)
e661d480 27
28Depending on how this one is constructed, and depending on the runtype, it will
29 perform differents tasks. Note that for the moment the runtypes are "fake", i.e.
30 put by hand in the TestMUONPreprocessor.C macro, and might not correspond to
31 the final values to be used by the DAQ.
518eb852 32
33<pre>
e661d480 34detName runType task to be done worker class (AliMUONVSubprocessor child)
35--------------------------------------------------------------------------------------------------------
24dbd5dd 36MCH PEDESTAL read ASCII ped files AliMUONPedestalSubprocessor
e661d480 37 and put them into OCDB
38
39MCH GMS read GMS alignment files AliMUONGMSSubprocessor
40 and put them into OCDB
41
42MCH PHYSICS read DCS HV values and AliMUONHVSubprocessor
43 put them into OCDB
44
24dbd5dd 45MCH CALIBRATION read ASCII gain files AliMUONGainSubprocessor
e661d480 46 and put them into OCDB
49e110ec 47
48MTR CALIBRATION read date files (masks, AliMUONTriggerSubprocessor
49 crates, and LUT)
50 and put them in OCDB
e661d480 51
49e110ec 52MTR PHYSICS read date files as in AliMUONTriggerDCSSubprocessor
53 CALIBRATION,
54 read DCS HV and currents
55 and put them in OCDB
56
518eb852 57</pre>
e661d480 58
518eb852 59
60\section shuttle_s3 Pedestals
e661d480 61
62Two options here. You can either use a pre-done set of ASCII pedestals files (generated as
63 explained below for the 2nd option), located at /afs/cern.ch/user/l/laphecet/public/LDC*.ped,
64 or build you own set.
65
66We've written an AliMUONPedestalEventGenerator which creates fake pedestal events. The pedestal values
67are taken from the Offline Condition DataBase (OCDB) (which is itself fakely filled
a99c3449 68using the static WritePedestals() method of AliMUONCDB class
e661d480 69
10eb3d17 70So first generate a valid pedestal CDB entry by using the AliMUONCDB class. There's one
162637e4 71 little trick : you should first point to the "default" OCDB (local://$ALICE_ROOT/OCDB) in
24dbd5dd 72 order to get the mapping loaded, then only you can play with another OCDB.
73 Or, alternatively, you can put the mapping stuff in the test OCDB, like this :
74
75<pre>
76root[] AliMpDDLStore::ReadData(); // read mapping from ASCII files
162637e4 77root[] const char* cdbpath="local://$ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestCDB"; // where to put the CDB
24dbd5dd 78root[] AliCDBManager::Instance()->SetDefaultStorage(cdbpath);
79root[] AliMpCDB::WriteMpSegmentation();
80root[] AliMpCDB::WriteDDLStore();
81</pre>
e661d480 82
24dbd5dd 83If you've not put the mapping in the test database, then you must start with the default OCDB, load the mapping, and then only switch to the
84 test database :
85
518eb852 86<pre>
162637e4 87root[] AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); // only if you've not put the mapping in test OCDB
24dbd5dd 88root[] AliCDBManager::Instance()->SetRun(0); // only if you've not put the mapping in test OCDB
89root[] AliMpCDB::LoadDDLStore(); // only if you've not put the mapping in test OCDB
90// below are lines to be executed whatever you did with the mapping...
162637e4 91root[] const char* cdbpath="local://$ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestCDB"; // where to put the CDB
a99c3449 92root[] AliCDBManager::Instance()->SetDefaultStorage(cdbpath);
e661d480 93root[] Bool_t defaultValues = kFALSE; // to generate random values instead of plain zeros...
94root[] Int_t startRun = 80;
95root[] Int_t endRun = 80;
a99c3449 96root[] AliMUONCDB::WritePedestals(defaultValues, startRun, endRun);
518eb852 97</pre>
e661d480 98
99Expected output is (don't worry about the warnings, they are harmless) :
100
518eb852 101<pre>
e66e85b0 102I-AliMUONCDB::ManuList: Generating ManuList...
103I-AliMUONCDB::ManuList: Manu List generated.
104I-AliMUONCDB::MakePedestalStore: 16828 Manus and 1064008 channels.
105I-AliMUONCDB::WritePedestals: Ngenerated = 1064008
106I-AliCDBManager::Init: AliEn classes enabled in Root. AliCDBGrid factory registered.
162637e4 107I-AliCDBManager::SetDefaultStorage: Setting Default storage to: local://$ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestCDB
e66e85b0 108I-AliCDBLocal::PutEntry: CDB object stored into file ($ALICE_ROOT)/SHUTTLE/TestShuttle/TestCDB/MUON/Calib/Pedestals/Run80_80_v0_s0.root
518eb852 109</pre>
e661d480 110
111Then use the AliMUONPedestalEventGenerator to produce simulated pedestal events.
112
f7493b7e 113Usage (from the Root prompt) :
518eb852 114<pre>
162637e4 115AliMpCDB::LoadDDLStore2(); // load mapping from "default" OCDB=local://$ALICE_ROOT/OCDB
f7493b7e 116AliCDBManager::Instance()->SetDefaultStorage(cdbpath); // so you will read
e661d480 117// back pedestals values generated in the previous step
f7493b7e 118const char* dateFileName = "raw.date"; // base filename for the output
119Int_t runNumber = 80; // run number used to fetch the pedestals from the OCDB
120Int_t nevents = 100; // # of events to generate. 100 should be enough
121gSystem->Load("libMUONshuttle"); // needed or not depending on whether it's already loaded or not
122AliMUONPedestalEventGenerator ped(runNumber,nevents,dateFileName);
123ped.Exec("");
518eb852 124</pre>
f7493b7e 125
126It *will* take a lot of time (mainly due to the fact that we're writing a
e661d480 127bunch of ASCII files = DDL files), so please be patient.
128
129The output should be the normal simulated sequence of MUON.Hits.root, MUON.SDigits.root,
130 MUON.Digits.root, raw/*.ddl files and raw.date.LDCi where i=0-3 (i.e. one DATE file
131per LDC, as will be used in real life), the latter ones being roughly 100 MB each.
132
f7493b7e 133// FIXME : instructions below should be replaced with usage of MUONTRKda
134//
135
24dbd5dd 136The raw.date.LDC* files are then processed using the DA online program (which is not built by default, but must be made
cddcc1f3 137 explicitely using make daqDA-MCH from $ALICE_ROOT, and requires some DATE setup..., see \ref README_mchda )
e661d480 138
518eb852 139<pre>
24dbd5dd 140 MUONTRKda.exe -f raw.date.LCDi -a LDCi.ped (i=0,1,2,3)
e661d480 141
142 (repeat for each LDC)
518eb852 143</pre>
e661d480 144
145The LDCi.ped files are the input for the pedestal subprocessor,
146which is tested using the TestMUONPreprocessor.C macro.
147The output of the pedestal subprocessor (upon success only) is written into the OCDB.
148Difference between the input and the output can be inferred using the diff() function
149of MUONCDB.C macro.
150
518eb852 151
152\section shuttle_s4 Gains
f7493b7e 153
154Like pedestals, you have two options here. You can either use a pre-done set of
155ASCII gain files (generated as explained below for the 2nd option),
156located at /afs/cern.ch/user/l/laphecet/public/LDC*.gains, or build you own set.
157
158We've written an AliMUONGainEventGenerator which creates fake gain events.
159The pedestal and gain values are taken from the Offline Condition DataBase (OCDB)
160 (which is itself fakely filled using the WritePedestals() and WriteGains()
161 methods of AliMUONCDB class).
162
163So first you need to generate a valid pedestal CDB entry and a valid gain CDB
164entry by using the AliMUONCDB class, from the Root prompt:
165
518eb852 166<pre>
162637e4 167const char* cdbpath="local://$ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestCDB"; // where to put the CDB
a99c3449 168root[] AliCDBManager::Instance()->SetDefaultStorage(cdbpath);
f7493b7e 169Bool_t defaultValues = kFALSE; // to generate random values instead of plain zeros...
170Int_t gainRun = 80;
171Int_t pedRun = 81;
a99c3449 172AliMUONCDB::WritePedestals(defaultValues, pedRun, pedRun);
173AliMUONCDB::WriteGains(defaultValues, gainRun, gainRun);
518eb852 174</pre>
f7493b7e 175
176Expected output is (don't worry about the warnings, they are harmless) :
177
178Then use the AliMUONGainEventGenerator to produce simulated gain events : the output
179will be n x 4 date files (n is the number of fake injections, currently 9, and 4
180 is the number of LDCs)
181
182Usage (again, from the Root prompt) :
183
518eb852 184<pre>
162637e4 185const char* cdbpath="local://$ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestCDB"; // where to get the CDB
f7493b7e 186AliCDBManager::Instance()->SetDefaultStorage(cdbpath); // so you will read
187// back pedestals and gain values generated in the previous step
188const char* dateFileName = "raw.date"; // base filename for the output
189Int_t gainRunNumber = 80; // run number used to fetch gains from OCDB
190Int_t pedRunNumber = 81; // run number used to fetch the pedestals from the OCDB
191// generated ped files will be for r = 81, 83, etc...
192Int_t nevents = 100; // # of events to generate. 100 should be enough for testing, but 1000 would be better for prod
193gSystem->Load("libMUONshuttle"); // needed or not depending on whether it's already loaded or not
194AliMUONGainEventGenerator g(gainRunNumber,pedRunNumber,nevents,dateFileName);
195g.Exec("");
518eb852 196</pre>
f7493b7e 197
198It *will* take a lot of time (mainly due to the fact that we're writing a
199bunch of ASCII files = DDL files), so please be patient.
200
201The output should be a sequence of directories, RUN81, RUN82, etc..., each
202containing the normal simulated sequence of MUON.Hits.root, MUON.SDigits.root,
203 MUON.Digits.root, raw/*.ddl files and raw.date.LDCi where i=0-3 (i.e. one DATE file
204per LDC, as will be used in real life), the latter ones being roughly 100 MB each.
205
518eb852 206<pre>
f7493b7e 207// FIXME
208// Below should follow instructions on how to feed the MUONTRKda with the
209// generated files.
518eb852 210</pre>
211
e661d480 212
518eb852 213\section shuttle_s5 HV
e661d480 214
215HV DCS values are created in CreateDCSAliasMap() of TestMUONPreprocessor.C
216You might want to modify this function to create a given set of error conditions
217 in order to test whether the HVSubprocessor is reacting properly to those errors.
ee9324d3 218
518eb852 219
220\section shuttle_s6 GMS
ee9324d3 221
222The GMS alignment data for testing can be generated with
223the macro MUONGenerateTestGMS.C:
224The matrices of TGeoHMatrix type, with TObject::fUniqueID equal to the geometry
225module Id, are put in a TClonesArray and saved in the Root file with a
226key "GMSarray".
518eb852 227
49e110ec 228
229\section shuttle_s7 Trigger DCS
230
231HV and currents DCS values are created in CreateDCSAliasMap() of TestMUONPreprocessor.C
232As done in Tracker HV, you might want to modify this function to create a given set of
233error conditions in order to test whether the TriggerDCSSubprocessor is reacting
234properly to those errors.
235
236COMMENT: the trigger subprocessor requires trigger .dat files to be present.
237In order to test only the DCS values when the remaining trigger files are not present,
238a workaround is put in the TestMUONPreprocessor.C which creates fake date files.
239This results in some "ERROR" flags appearing in the LOG file (for masks and LUT),
240which are absolutely expected.
241The fake date files are automatically removed at the end of the macro.
242
243
91509ec6 244This chapter is defined in the READMEshuttle.txt file.
245
518eb852 246*/
e661d480 247