ALIROOT-5420 Changes for CDH v3
[u/mrichter/AliRoot.git] / MUON / READMEcalib.txt
518eb852 1// $Id$
2ce5e44e 2
518eb852 3/*!
91509ec6 5\page README_calib Calibration
518eb852 6
a5cad1a4 7
2ce5e44e 8The Offline Condition DataBase is described extensively on ALICE Offline pages.
a5cad1a4 10Here you'll find mainly information relevant to the MUON objects in the OCDB,
11and to the AliMUONCDB class (formerly MUONCDB.C macro), which defines a set of functions to read/write
2ce5e44e 12 MUON information to this CDB. Those functions are not meant to be used
13 as black boxes.
518eb852 14
2ce5e44e 15Please have a closer look before using (especially the ones writing to the CDB...)
518eb852 16
a5cad1a4 17\section calib_s0 MUON objects in OCDB
20<tr><td>OCDB path</td><td>Subsystem</td><td>Run Type</td><td>FileID</td><td>DAQsource</td><td>Update frequency</td><td>Appox. Size</td></tr>
21<tr><td>MUON/Calib/RecoParam</td><td>both</td><td>N/A</td><td>N/A</td><td>N/A</td><td>Few per year ?</td><td>5 KB</td></tr>
22<tr><td>MUON/Calib/MappingData</td><td>both</td><td>N/A</td><td>N/A</td><td>N/A</td><td>Once for all once debugged</td><td>1 MB</td></tr>
23<tr><td>MUON/Calib/MappingRunData</td><td>both</td><td>N/A</td><td>N/A</td><td>N/A</td><td>Between zero and few per year</td><td>100 KB</td></tr>
25<tr><td>MUON/Calib/Capacitances</td><td>MCH</td><td>N/A</td><td>N/A</td><td>N/A</td><td>Once for all once debugged</td><td>7 MB</td></tr>
26<tr><td>MUON/Calib/Gains</td><td>MCH</td><td>CALIBRATION</td><td>GAINS</td><td>LDC</td><td>Once per calibration run</td><td>10 MB</td></tr>
27<tr><td>MUON/Calib/HV</td><td>MCH</td><td>PHYSICS</td><td>N/A</td><td>N/A</td><td>Once per physics run</td><td>Depends on the number of trips, 10-20 KB normally</td></tr>
28<tr><td>MUON/Calib/Neighbours</td><td>MCH</td><td>N/A</td><td>N/A</td><td>N/A</td><td>As MappingData</td><td>10 MB</td></tr>
29<tr><td>MUON/Calib/OccupancyMap</td><td>MCH</td><td>PHYSICS</td><td>OCCUPANCY</td><td>MON</td><td>Once per physics run</td><td>Depends on the number of bad manus, normally 100-200 KB</td></tr>
30<tr><td>MUON/Calib/Pedestals</td><td>MCH</td><td>PEDESTAL</td><td>PEDESTALS</td><td>LDC</td><td>Once per pedestal run</td><td>7 MB</td></tr>
31<tr><td>MUON/Calib/RejectList</td><td>MCH</td><td>N/A</td><td>N/A</td><td>N/A</td><td>Few per year</td><td>Depends on the number of bad elements</td></tr>
41In addition, the following ones were used in the past, but have been discontinued (but are still present in the OCDB, as object removal is not allowed).
44<tr><td>OCDB path</td></tr>
52\section calib_s1 Calibration data object classes
2ce5e44e 53
54We've designed generic data containers to store calibration information,
55tailored to the way we usually access MUON tracker data, that is,
56indexed by the pair (detElemId,manuId).
a5cad1a4 57This container is called AliMUONVStore. You can attach a TObject to every and
2ce5e44e 58each pair (detElemId,manuId).
518eb852 59
2ce5e44e 60For the moment, that TObject is generally of AliMUONVCalibParam type,
61 which handles a given number of channels (64 typically) as a group.
a5cad1a4 62There's also 1D versions of AliMUONVStore for data types which only requires indexing
2ce5e44e 63by 1 value (like trigger masks for instance).
518eb852 64
2ce5e44e 65As the class names suggest (V...), those classes are only interfaces.
66Concrete ones are AliMUON2DMap (used instead of a vector as detElemId are
a5cad1a4 67not contiguous), AliMUON1DArray (for things where indices are
68contiguous) and AliMUON1DMap, and CalibParamNI (VCalibParam
69storing n integer per channel), CalibParamNF
70(VCalibParam storing n floats per channel), and CalibParamND (VCalibParam storing n doubles per channel).
2ce5e44e 71
72One exception are the HV values from DCS, which are stored "as they come" from
73the shuttle-dcs interface, as a TMap, where the key is the aliasname (TString),
74and the value a TObjArray of AliDCSValue.
518eb852 76\section calib_s2 CDB location
2ce5e44e 77
78One very important notion is that of the DefaultStorage (which you might set with
79 AliCDBManager::Instance()->SetDefaultStorage(path)), which tells the CDB library where
80 the CDB is sitting (either locally on disk, or on the grid).
162637e4 82For local tests, path will be most likely = <code> "local://$ALICE_ROOT/OCDB"</code>
a5cad1a4 83(i.e. there is, in svn a slim version of the calibration objects needed
162637e4 84for running the MUON code), or <code> "local://$ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestCDB </code>
39012d35 85for Shuttle testing.
518eb852 86
39012d35 87When using alien, the path definition can be eg.
a5cad1a4 88<code> "alien://folder=/alice/data/2009/OCDB" </code>.
39012d35 89
518eb852 90\section calib_s3 Writing to CDB
2ce5e44e 91
92AliMUONCDB class is used to populate the CDB with fake calibration objects for testing purposes.
93Real calibration data will normally be handled by the Shuttle (see READMEshuttle).
a99c3449 95The various WriteXXX() static methods may be used to populate MUON tracker and trigger
2ce5e44e 96information.
97A full set of calibration data types can be created from scratch using, from
98the Root prompt (from within the $ALICE_ROOT/MUON directory to get the correct
99list of libraries loaded by the loadlibs.C macro)
518eb852 101<pre>
a5cad1a4 102root[0] AliMpCDB::LoadAll2();
a99c3449 103root[1] Int_t startRun = 0;
104root[2] Bool_t defaultValues = kTRUE;
105root[3] AliMUONCDB::WriteTrigger(startRun);
106root[4] AliMUONCDB::WriteTracker(defaultValues,startRun);
518eb852 107</pre>
2ce5e44e 109
518eb852 110\section calib_s4 Reading the CDB
2ce5e44e 111
112The actual reading is encapsulated into AliMUONCalibrationData class.
a5cad1a4 113e.g. to read pedestals for run 67138, one would do :
2ce5e44e 114
518eb852 115<pre>
2ce5e44e 116AliCDBManager::Instance()->SetDefaultStorage(cdbPath);
a5cad1a4 117AliMUONVStore* ped = AliMUONCalibrationData::CreatePedestals(67138);
518eb852 118</pre>
2ce5e44e 119
120If you want to plot calibration data (not terribly usefull as it's a really global view),
a99c3449 121 use the Plot() function of AliMUONCDB (this require to load the segmentation), e.g.
2ce5e44e 122
518eb852 123<pre>
a99c3449 124AliCDBManager::Instance()->SetRun(0);
518eb852 127</pre>
2ce5e44e 128
129which will create 2 histograms : pedestal_0 (mean) and pedestal_1 (sigma).
a5cad1a4 131A more usefull way to look at calibration data might be the \link README_mchview mchview \endlink program.
2ce5e44e 132
095ae052 133\section calib_s5 A note on status and status map
135A special kind of object is the status map. It would deserve a full documentation
136 (and that will need to be done some day), but for the moment, please have a look
137 at the MUONStatusMap.C macro which can let you play with it. For more information,
138 have a look at the AliMUONPadStatusMaker and AliMUONPadStatusMapMaker.
a5cad1a4 140 $Id$
518eb852 142*/
2ce5e44e 143