3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
6 * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
8 * See cxx source for full Copyright notice
11 @author Christian Holm Christensen <cholm@nbi.dk>
12 @date Sun Mar 26 17:59:37 2006
13 @brief Declaration of AliFMD detector driver
15 /** @mainpage ALICE FMD Off-line code
20 - @ref base (see also @ref FMD_base)
21 - @ref sim (see also @ref FMD_sim)
22 - @ref rec (see also @ref FMD_rec)
23 - @ref util (see also @ref FMD_util)
24 - @ref script (see also @ref FMD_script)
28 @section intro Introduction:
30 This file contains a short overview of the FMD code. It is by no
31 means authoritative - only the code is good for that. However,
32 I'll try to explain things a bit here.
34 @section structure Structure:
36 There are 4 libraries build for the FMD. These are
38 - libFMDbase: This contains the basic stuff, like data classes and
40 - libFMDsim: This contains code used by the simulation only. That
41 includes the detector class AliFMD and it's derivatives. It
42 also contains the code for building the geometry, as well as the
43 digitisers and raw data writer.
44 - libFMDrec: Code needed for the reconstruction. This include the
45 reconstruction code itself, as well as a raw data reader.
46 - libFMDutil: This is a special library that contains various
47 utility classes for the FMD expert/developer/tester. It
48 includes code to read all data produced by the FMD, a simple
49 event display, and code to make fake calibration and alignment
50 data. This library is @e not loaded by aliroot
51 automatically. The user has to load it herself:
53 gSystem->Load("libFMDutil.so");
55 The content of these libraries is detailed more below.
57 @subsection base libFMDbase:
59 This currently (18th or March 2006) contains the classes
61 - AliFMDBaseDigit, AliFMDDigit, AliFMDSDigit: Base class for
62 digits, real digits, and summable digits. The are all data
63 classes that holds the ADC value(s) for a single strip.
64 - AliFMDBoolMap: A map of booleans, one for each strip.
65 - AliFMDUShortMap: A map of unsigned short integers, one for each
67 - AliFMDDetector, AliFMD1, AliFMD2, AliFMD3: 3 classes that holds
68 the parameters for each of the 3 FMD sub-detectors. These
69 derive from AliFMDDetector, and are managed by AliFMDGeometry.
70 Each of these also contains the translation from sensor
71 reference frame to global reference frame.
72 - AliFMDRing: Parameters for the FMD rings (inner and outer type).
73 These are managed by AliFMDGeometry.
74 - AliFMDGeometry: Manager of FMD geometry data. All code queries
75 this manager for geometry parameters, so that the data is always
77 - AliFMDParameters: Manager of FMD parameters, like calibration
78 parameters. This class fetches data from CDB if necessary.
79 All code queries this manager for parameters, so that the data
81 - AliFMDCalibPedestal, AliFMDCalibGain, AliFMDCalibSampleRate,
82 AliFMDAltroMapping: Containers of calibration parameters. These
83 correspond to the pedestal and its width, the gain of each
84 strip, the oversampling rate used in read-out, and the map from
85 hardware address to detector.
86 - AliFMDAltroIO, AliFMDAltroReader, AliFMDAltroWriter: Low-level
87 classes to do input/output on ALTRO formated buffers.
91 @subsection sim libFMDsim:
93 This currently (18th or March 2006) contains the classes
95 - AliFMDEdepMap: Cache of energy deposited and total number of
96 hits for each strip. The digitiser AliFMDDigitizer uses this to
97 store simulation data before making digits.
98 - AliFMDHit: A hit in the FMD active elements, as described by the
99 simulation back-end during transport.
100 - AliFMD, AliFMDv0, AliFMDv1: Simulation drivers for the FMD.
101 AliFMD is the base class. AliFMDv0 corresponds to a simulation
102 where no hits are created, but the material distribution is
103 right. AliFMDv1 is like AliFMDv0, except that hits are
105 - AliFMDGeometryBuilder: Build the FMD geometry in terms of TGeo
106 objects. The information for building the geometry is retrieved
108 - AliFMDBaseDigitizer, AliFMDDigitizer, AliFMDSDigitizer: Base
109 class for the digitisers. AliFMDDigitizer makes `real' digits
110 (AliFMDDigit) from hits, and AliFMDSDigitizer makes summable
112 - AliFMDRawWriter: Writes a pseudo raw data file from the digits
113 created by the digitisers. It uses the AliFMDAltroMapping from
114 AliFMDParameters to make the mapping from detector coordinates
115 to hardware addresses.
117 @subsection rec libFMDrec:
119 This currently (18th or March 2006) contains the classes
121 - AliFMDReconstructor: Reconstruct (in a naiive way) the charged
122 particle multiplicity in the FMD strips. This also writes an
123 AliESDFMD object to the ESD files (that class is in libESD).
125 - AliFMDRecPoint: Reconstructed point in the FMD. These objects
126 are made AliFMDReconstructor.
128 - AliFMDRawReader: Classes to read raw data files.
130 @subsection util libFMDutil:
132 This currently (18th or March 2006) contains the classes
134 - AliFMDInput, AliFMDInputHits, AliFMDInputDigits,
135 AliFMDInputSDigits, AliFMDInputRecPoints: Base class, and
136 concrete classes to read in FMD generated data. These provide a
137 simple and unified way of getting the data. Hooks are defined
138 to process hits, tracks, digits, and reconstructed points, as
139 well as geometry and ESD data. See for example the scripts
140 @c DrawHits.C, @c DrawHitsDigits.C, @c DrawHitsRecs.C, @c
141 DrawDigitsRecs.C in the @c FMD/scripts sub-directory.
143 - AliFMDDisplay: Simple event display for FMD data, including
144 hits, digits, reconstructed points and ESD data.
146 - AliFMDCalibFaker, AliFMDAlignFaker: Classes to write fake (or
147 dummy) calibration and alignment data. These derive from
150 @section script Scripts
152 Most scripts live in @c FMD/scripts. The notiable exceptions are
153 @ref Simulate.C, @ref Reconstruct.C, and @ref Config.C
155 @section quick Quick start
157 First, install ROOT. Then Install TGeant3:
162 > cvs -d :pserver:cvs@root.cern.ch:/user/cvs login
164 > cvs -d :pserver:cvs@root.cern.ch:/user/cvs co geant3
169 Now you can install AliRoot
172 > cvs -d :pserver:cvs@alisoft.cern.ch:/soft/cvsroot login
174 > cvs -d :pserver:cvs@alisoft.cern.ch:/soft/cvsroot co AliRoot
176 > export ALICE_TARGET=`root-config --arch`
177 > export ALICE=${HOME}/alice
178 > export ALICE_ROOT=${ALICE}/AliRoot
179 > export ALICE_LEVEL=new
180 > export LD_LIBRARY_PATH=${ALICE_ROOT}/lib/tgt_${ALICE_TERGET}:${LD_LIBRARY_PATH}
181 > export PATH=${ALICE_ROOT}/bin/tgt_${ALICE_TERGET}:${PATH}
182 > export G3SYS=${ALICE}/geant3
186 To simulate one event, do something like
189 > aliroot ${ALICE_ROOT}/FMD/Simulate.C
192 To reconstruct the generated event, do
194 > aliroot ${ALICE_ROOT}/FMD/Reconstruct.C
197 Now, open the file `AliESDs.root' in AliRoot, and browse through that.
199 @section authors Authors:
201 - Alla Maevskaya <Alla.Maevskaia@cern.ch>
202 - Christian Holm Christensen <cholm@nbi.dk>
204 /** @defgroup FMD_sim Simulation */
206 //____________________________________________________________________
208 // Manager class for the FMD - Base class.
209 // AliFMDv1, AliFMDv0, and AliFMDAlla
210 // provides concrete implementations.
211 // This class is sooooo crowded
213 #ifndef ALIDETECTOR_H
214 # include <AliDetector.h>
217 # include <TArrayI.h>
227 //____________________________________________________________________
228 /** @class AliFMD AliFMD.h <FMD/AliFMD.h>
229 @brief Forward Multiplicity Detector based on Silicon wafers.
230 This class is the driver for especially simulation.
232 The Forward Multiplicity Detector consists of 3 sub-detectors FMD1,
233 FMD2, and FMD3, each of which has 1 or 2 rings of silicon sensors.
235 This is the base class for all FMD manager classes.
237 The actual code is done by various separate classes. Below is
238 diagram showing the relationship between the various FMD classes
239 that handles the simulation
242 +----------+ +----------+
243 | AliFMDv1 | | AliFMDv0 |
244 +----------+ +----------+
245 | | +-----------------+
246 +----+--------------+ +--| AliFMDDigitizer |
247 | | +-----------------+
248 | +---------------------+ |
249 | +--| AliFMDBaseDigitizer |<--+
250 V 1 | +---------------------+ |
251 +--------+<>--+ | +------------------+
252 | AliFMD | +--| AliFMDSDigitizer |
253 +--------+<>--+ +------------------+
254 1 | +---------------------+
255 +--| AliFMDReconstructor |
256 +---------------------+
260 This defines the interface for the various parts of AliROOT that
261 uses the FMD, like AliFMDSimulator, AliFMDDigitizer,
262 AliFMDReconstructor, and so on.
264 This is a concrete implementation of the AliFMD interface.
265 It is the responsibility of this class to create the FMD
268 This is a concrete implementation of the AliFMD interface.
269 It is the responsibility of this class to create the FMD
270 geometry, process hits in the FMD, and serve hits and digits to
273 This is the base class for the FMD simulation tasks. The
274 simulator tasks are responsible to implment the geoemtry, and
276 - AliFMDReconstructor
277 This is a concrete implementation of the AliReconstructor that
278 reconstructs pseudo-inclusive-multiplicities from digits (raw or
281 Calibration and geometry parameters are managed by separate
282 singleton managers. These are AliFMDGeometry and
283 AliFMDParameters. Please refer to these classes for more
284 information on these.
286 class AliFMD : public AliDetector
289 /** Default constructor. Do not use. */
291 /** Normal constructor
292 @param name Name of object.
293 @param title Title of object. */
294 AliFMD(const char *name, const char *title);
297 /** Wheter to make a detailed geometry
298 @param use If true, make detailed geometry */
299 void UseDetailed(Bool_t use=kTRUE) { fDetailed = use; }
302 /** @name GEometry ANd Tracking (GEANT :-) */
303 /** Define the geometry. This is done by asking the manager
304 AliFMDGeometry to construct the geometry. This in turn calls
305 AliFMDGeometryBuilder. */
306 virtual void CreateGeometry();
307 /** Create entries for alignable volumes associating the symbolic volume
308 name with the corresponding volume path. Needs to be syncronized with
309 eventual changes in the geometry. */
310 virtual void AddAlignableVolumes() const;
311 /** Create the tracking mediums used by the FMD. This associates
312 the tracking mediums defined with the FMD in the
313 TVirtualMCApplication (AliMC).
315 The defined mediums are
316 - @c FMD @c Si$ Silicon (active medium in sensors)
317 - @c FMD @c C$ Carbon fibre (support cone for FMD3 and vacuum pipe)
318 - @c FMD @c Al$ Aluminium (honeycomb support plates)
319 - @c FMD @c PCB$ Printed Circuit Board (FEE board with VA1_3)
320 - @c FMD @c Chip$ Electronics chips (currently not used)
321 - @c FMD @c Air$ Air (Air in the FMD)
322 - @c FMD @c Plastic$ Plastic (Support legs for the hybrid cards)
324 virtual void CreateMaterials();
325 /** Initialize this detector */
327 /** This member function is called when ever a track deposites
328 energy (or similar) in an FMD tracking medium. In this base
329 class this member function is pure abstract. In concrete
330 sub-classes, the member function may make hits or other
332 virtual void StepManager() = 0;
333 /** Called at the end of each simulation event. If the debug level
334 is high enough a list of @e bad hits is printed. */
335 virtual void FinishEvent();
339 /** @name Graphics and event display */
340 /** Draw a shaded view of the Forward multiplicity detector. This
341 isn't really useful anymore. */
342 virtual void DrawDetector() {}
346 /** @name Hit and digit management */
347 /* Create Tree branches for the FMD.
349 - @c H Make a branch of TClonesArray of AliFMDHit's
350 - @c D Make a branch of TClonesArray of AliFMDDigit's
351 - @c S Make a branch of TClonesArray of AliFMDSDigit's */
352 virtual void MakeBranch(Option_t *opt=" ");
353 /** Set the TClonesArray to read hits into.
354 @param b The branch to containn the hits */
355 virtual void SetHitsAddressBranch(TBranch *b);
356 /** Set the TClonesArray to read sdigits into.
357 @param b The branch to containn the sdigits */
358 virtual void SetSDigitsAddressBranch(TBranch *b);
359 /** Set branch address for the Hits, Digits, and SDigits Tree. */
360 virtual void SetTreeAddress();
361 /** Get the array of summable digits
362 @return summable digits */
363 virtual TClonesArray* SDigits() { return fSDigits; }
364 /** Reset the array of summable digits */
365 virtual void ResetSDigits();
366 /** Add a hit to the hits tree
368 @param vol Volume parameters, interpreted as
369 - ivol[0] [UShort_t ] Detector #
370 - ivol[1] [Char_t ] Ring ID
371 - ivol[2] [UShort_t ] Sector #
372 - ivol[3] [UShort_t ] Strip #
373 @param hits Hit information
374 - hits[0] [Float_t ] Track's X-coordinate at hit
375 - hits[1] [Float_t ] Track's Y-coordinate at hit
376 - hits[3] [Float_t ] Track's Z-coordinate at hit
377 - hits[4] [Float_t ] X-component of track's momentum
378 - hits[5] [Float_t ] Y-component of track's momentum
379 - hits[6] [Float_t ] Z-component of track's momentum
380 - hits[7] [Float_t ] Energy deposited by track
381 - hits[8] [Int_t ] Track's particle Id #
382 - hits[9] [Float_t ] Time when the track hit */
383 virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
384 /** Add a hit to the list
386 @param detector Detector # (1, 2, or 3)
387 @param ring Ring ID ('I' or 'O')
388 @param sector Sector # (For inner/outer rings: 0-19/0-39)
389 @param strip Strip # (For inner/outer rings: 0-511/0-255)
390 @param x Track's X-coordinate at hit
391 @param y Track's Y-coordinate at hit
392 @param z Track's Z-coordinate at hit
393 @param px X-component of track's momentum
394 @param py Y-component of track's momentum
395 @param pz Z-component of track's momentum
396 @param edep Energy deposited by track
397 @param pdg Track's particle Id #
398 @param t Time when the track hit
399 @param len Track length through the material.
400 @param stopped Whether track was stopped or disappeared */
401 virtual AliFMDHit* AddHitByFields(Int_t track,
416 Bool_t stopped=kFALSE);
417 /** Add a digit to the Digit tree
419 - digits[0] [UShort_t] Detector #
420 - digits[1] [Char_t] Ring ID
421 - digits[2] [UShort_t] Sector #
422 - digits[3] [UShort_t] Strip #
423 - digits[4] [UShort_t] ADC Count
424 - digits[5] [Short_t] ADC Count, -1 if not used
425 - digits[6] [Short_t] ADC Count, -1 if not used
426 @param notused Not used */
427 virtual void AddDigit(Int_t *digits, Int_t* notused=0);
429 @param detector Detector # (1, 2, or 3)
430 @param ring Ring ID ('I' or 'O')
431 @param sector Sector # (For inner/outer rings: 0-19/0-39)
432 @param strip Strip # (For inner/outer rings: 0-511/0-255)
433 @param count1 ADC count (a 10-bit word)
434 @param count2 ADC count (a 10-bit word), or -1 if not used
435 @param count3 ADC count (a 10-bit word), or -1 if not used */
436 virtual void AddDigitByFields(UShort_t detector=0,
444 /** Add a digit to the Digit tree
446 - digits[0] [UShort_t] Detector #
447 - digits[1] [Char_t] Ring ID
448 - digits[2] [UShort_t] Sector #
449 - digits[3] [UShort_t] Strip #
450 - digits[4] [Float_t] Edep
451 - digits[5] [UShort_t] ADC Count
452 - digits[6] [Short_t] ADC Count, -1 if not used
453 - digits[7] [Short_t] ADC Count, -1 if not used
454 - digits[8] [Short_t] ADC Count, -1 if not used
455 - digits[9] [UShort_t] N total particles
456 - digits[10] [UShort_t] N total primary particles
458 virtual void AddSDigit(Int_t *digits);
459 /** add a summable digit - as coming from data
460 @param detector Detector # (1, 2, or 3)
461 @param ring Ring ID ('I' or 'O')
462 @param sector Sector # (For inner/outer rings: 0-19/0-39)
463 @param strip Strip # (For inner/outer rings: 0-511/0-255)
464 @param edep Energy deposited
465 @param count1 ADC count (a 10-bit word)
466 @param count2 ADC count (a 10-bit word), or -1 if not used
467 @param count3 ADC count (a 10-bit word), or -1 if not used */
468 virtual void AddSDigitByFields(UShort_t detector=0,
479 const TArrayI& refs=TArrayI());
483 /** @name Digitisation */
484 /** Create a digitizer object
485 @param manager Digitization manager
486 @return a newly allocated AliFMDDigitizer */
487 virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
488 /** Create AliFMDDigit's from AliFMDHit's. This is done by creating
489 an AliFMDDigitizer object, and executing it. */
490 virtual void Hits2Digits();
491 /** Create AliFMDSDigit's from AliFMDHit's. This is done by creating
492 an AliFMDSDigitizer object, and executing it. */
493 virtual void Hits2SDigits();
497 /** @name Raw data */
498 /** Turn digits into raw data. This uses the class AliFMDRawWriter
499 to do the job. Please refer to that class for more
501 virtual void Digits2Raw();
506 /** Browse this object
507 @param b Browser to show this object in */
508 void Browse(TBrowser* b);
511 /** Initialize hit array if not already done, and return pointert.
513 TClonesArray* HitsArray();
514 /** Initialize digit array if not already done, and return pointert.
515 @return Digit array */
516 TClonesArray* DigitsArray();
517 /** Initialize summable digit array if not already done, and return
519 @return Summable digit array */
520 TClonesArray* SDigitsArray();
522 TClonesArray* fSDigits; // Summable digits
523 Int_t fNsdigits; // Number of digits
524 Bool_t fDetailed; // Use detailed geometry
525 Bool_t fUseOld; // Use old approx geometry
526 Bool_t fUseAssembly; // Use divided volumes
529 kSiId, // ID index of Si medium
530 kAirId, // ID index of Air medium
531 kPlasticId, // ID index of Plastic medium
532 kPcbId, // ID index of PCB medium
533 kSiChipId, // ID index of Si Chip medium
534 kAlId, // ID index of Al medium
535 kCarbonId, // ID index of Carbon medium
536 kCopperId, // ID index of Copper Medium
537 kKaptonId, // ID index of Kapton Medium
538 kSteelId // ID index of Steel medium
541 TObjArray* fBad; //! debugging - bad hits
545 @param other Object to copy from */
546 AliFMD(const AliFMD& other);
547 /** Assignment operator
548 @param other Object to assign from
549 @return Reference to this object */
550 AliFMD& operator=(const AliFMD& other);
552 ClassDef(AliFMD,11) // Base class FMD entry point
556 //____________________________________________________________________