1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 @author Christian Holm Christensen <cholm@nbi.dk>
18 @date Sun Mar 26 17:59:18 2006
19 @brief Implementation of AliFMD base class
21 //____________________________________________________________________
23 // Forward Multiplicity Detector based on Silicon wafers. This class
24 // is the driver for especially simulation.
26 // The Forward Multiplicity Detector consists of 3 sub-detectors FMD1,
27 // FMD2, and FMD3, each of which has 1 or 2 rings of silicon sensors.
29 // This is the base class for all FMD manager classes.
31 // The actual code is done by various separate classes. Below is
32 // diagram showing the relationship between the various FMD classes
33 // that handles the simulation
36 // +----------+ +----------+
37 // | AliFMDv1 | | AliFMDv0 |
38 // +----------+ +----------+
39 // | | +-----------------+
40 // +----+--------------+ +--| AliFMDDigitizer |
41 // | | +-----------------+
42 // | +---------------------+ |
43 // | +--| AliFMDBaseDigitizer |<--+
44 // V 1 | +---------------------+ |
45 // +--------+<>--+ | +------------------+
46 // | AliFMD | +--| AliFMDSDigitizer |
47 // +--------+<>--+ +------------------+
48 // 1 | +---------------------+
49 // +--| AliFMDReconstructor |
50 // +---------------------+
53 // This defines the interface for the various parts of AliROOT that
54 // uses the FMD, like AliFMDSimulator, AliFMDDigitizer,
55 // AliFMDReconstructor, and so on.
58 // This is a concrete implementation of the AliFMD interface.
59 // It is the responsibility of this class to create the FMD
63 // This is a concrete implementation of the AliFMD interface.
64 // It is the responsibility of this class to create the FMD
65 // geometry, process hits in the FMD, and serve hits and digits to
66 // the various clients.
69 // This is the base class for the FMD simulation tasks. The
70 // simulator tasks are responsible to implment the geoemtry, and
73 // * AliFMDReconstructor
74 // This is a concrete implementation of the AliReconstructor that
75 // reconstructs pseudo-inclusive-multiplicities from digits (raw or
78 // Calibration and geometry parameters are managed by separate
79 // singleton managers. These are AliFMDGeometry and
80 // AliFMDParameters. Please refer to these classes for more
81 // information on these.
84 // These files are not in the same directory, so there's no reason to
85 // ask the preprocessor to search in the current directory for these
86 // files by including them with `#include "..."'
87 #include <cmath> // __CMATH__
88 #include <TClonesArray.h> // ROOT_TClonesArray
89 #include <TGeometry.h> // ROOT_TGeomtry
90 #include <TNode.h> // ROOT_TNode
91 #include <TXTRU.h> // ROOT_TXTRU
92 #include <TRotMatrix.h> // ROOT_TRotMatrix
93 #include <TTUBE.h> // ROOT_TTUBE
94 #include <TTree.h> // ROOT_TTree
95 #include <TBrowser.h> // ROOT_TBrowser
96 #include <TVirtualMC.h> // ROOT_TVirtualMC
97 #include <TVector2.h> // ROOT_TVector2
98 #include <TGeoManager.h> // ROOT_TGeoManager
100 #include <AliRunDigitizer.h> // ALIRUNDIGITIZER_H
101 #include <AliLoader.h> // ALILOADER_H
102 #include <AliRun.h> // ALIRUN_H
103 #include <AliMC.h> // ALIMC_H
104 #include <AliMagF.h> // ALIMAGF_H
105 // #include <AliLog.h> // ALILOG_H
106 #include "AliFMDDebug.h" // Better debug macros
107 #include "AliFMD.h" // ALIFMD_H
108 #include "AliFMDDigit.h" // ALIFMDDIGIT_H
109 #include "AliFMDSDigit.h" // ALIFMDSDIGIT_H
110 #include "AliFMDHit.h" // ALIFMDHIT_H
111 #include "AliFMDGeometry.h" // ALIFMDGEOMETRY_H
112 #include "AliFMDDetector.h" // ALIFMDDETECTOR_H
113 #include "AliFMDRing.h" // ALIFMDRING_H
114 #include "AliFMDDigitizer.h" // ALIFMDDIGITIZER_H
115 #include "AliFMDHitDigitizer.h" // ALIFMDSDIGITIZER_H
116 // #define USE_SSDIGITIZER
117 //#ifdef USE_SSDIGITIZER
118 //# include "AliFMDSSDigitizer.h" // ALIFMDSDIGITIZER_H
120 // #include "AliFMDGeometryBuilder.h"
121 #include "AliFMDRawWriter.h" // ALIFMDRAWWRITER_H
123 //____________________________________________________________________
126 ; // This is to keep Emacs from indenting the next line
129 //____________________________________________________________________
140 // Default constructor for class AliFMD
142 AliFMDDebug(10, ("\tDefault CTOR"));
146 fBad = new TClonesArray("AliFMDHit");
149 //____________________________________________________________________
150 AliFMD::AliFMD(const char *name, const char *title)
151 : AliDetector (name, title),
156 fUseAssembly(kFALSE),
160 // Standard constructor for Forward Multiplicity Detector
162 AliFMDDebug(10, ("\tStandard CTOR"));
163 fBad = new TClonesArray("AliFMDHit");
165 // Initialise Hit array
167 gAlice->GetMCApp()->AddHitList(fHits);
169 // (S)Digits for the detectors disk
173 // CHC: What is this?
175 //PH SetMarkerColor(kRed);
176 //PH SetLineColor(kYellow);
179 //____________________________________________________________________
182 // Destructor for base class AliFMD
206 //====================================================================
208 // GEometry ANd Traking
210 //____________________________________________________________________
212 AliFMD::CreateGeometry()
215 // Create the geometry of Forward Multiplicity Detector. The actual
216 // construction of the geometry is delegated to the class
217 // AliFMDGeometryBuilder, invoked by the singleton manager
220 AliFMDGeometry* fmd = AliFMDGeometry::Instance();
221 fmd->SetDetailed(fDetailed);
222 fmd->UseAssembly(fUseAssembly);
226 //____________________________________________________________________
227 void AliFMD::CreateMaterials()
229 // Define the materials and tracking mediums needed by the FMD
230 // simulation. These mediums are made by sending the messages
231 // AliMaterial, AliMixture, and AliMedium to the passed AliModule
232 // object module. The defined mediums are
234 // FMD Si$ Silicon (active medium in sensors)
235 // FMD C$ Carbon fibre (support cone for FMD3 and vacuum pipe)
236 // FMD Al$ Aluminium (honeycomb support plates)
237 // FMD PCB$ Printed Circuit Board (FEE board with VA1_3)
238 // FMD Chip$ Electronics chips (currently not used)
239 // FMD Air$ Air (Air in the FMD)
240 // FMD Plastic$ Plastic (Support legs for the hybrid cards)
242 // The geometry builder should really be the one that creates the
243 // materials, but the architecture of AliROOT makes that design
244 // akward. What should happen, was that the AliFMDGeometryBuilder
245 // made the mediums, and that this class retrives pointers from the
246 // TGeoManager, and registers the mediums here. Alas, it's not
249 AliFMDDebug(10, ("\tCreating materials"));
250 // Get pointer to geometry singleton object.
251 AliFMDGeometry* geometry = AliFMDGeometry::Instance();
254 if (gGeoManager && gGeoManager->GetMedium("FMD Si$")) {
255 // We need to figure out the some stuff about the geometry
256 fmd->ExtractGeomInfo();
263 Double_t density = 0;
264 Double_t radiationLength = 0;
265 Double_t absorbtionLength = 999;
266 Int_t fieldType = gAlice->Field()->Integ(); // Field type
267 Double_t maxField = gAlice->Field()->Max(); // Field max.
268 Double_t maxBending = 0; // Max Angle
269 Double_t maxStepSize = 0.001; // Max step size
270 Double_t maxEnergyLoss = 1; // Max Delta E
271 Double_t precision = 0.001; // Precision
272 Double_t minStepSize = 0.001; // Minimum step size
277 density = geometry->GetSiDensity();
278 radiationLength = 9.36;
284 AliMaterial(id, "Si$", a, z, density, radiationLength, absorbtionLength);
285 AliMedium(kSiId, "Si$", id,1,fieldType,maxField,maxBending,
286 maxStepSize,maxEnergyLoss,precision,minStepSize);
293 radiationLength = 18.8;
299 AliMaterial(id, "Carbon$", a, z, density, radiationLength, absorbtionLength);
300 AliMedium(kCarbonId, "Carbon$", id,0,fieldType,maxField,maxBending,
301 maxStepSize,maxEnergyLoss,precision,minStepSize);
307 radiationLength = 8.9;
309 AliMaterial(id, "Aluminum$",a,z, density, radiationLength, absorbtionLength);
310 AliMedium(kAlId, "Aluminum$", id, 0, fieldType, maxField, maxBending,
311 maxStepSize, maxEnergyLoss, precision, minStepSize);
318 radiationLength = 1.43;
320 AliMaterial(id, "Copper$",
321 a, z, density, radiationLength, absorbtionLength);
322 AliMedium(kCopperId, "Copper$", id, 0, fieldType, maxField, maxBending,
323 maxStepSize, maxEnergyLoss, precision, minStepSize);
328 Float_t as[] = { 12.0107, 14.0067, 15.9994,
329 1.00794, 28.0855, 107.8682 };
330 Float_t zs[] = { 6., 7., 8.,
332 Float_t ws[] = { 0.039730642, 0.001396798, 0.01169634,
333 0.004367771, 0.844665, 0.09814344903 };
340 AliMixture(id, "Si Chip$", as, zs, density, 6, ws);
341 AliMedium(kSiChipId, "Si Chip$", id, 0, fieldType, maxField, maxBending,
342 maxStepSize, maxEnergyLoss, precision, minStepSize);
347 Float_t as[] = { 1.00794, 12.0107, 14.010, 15.9994};
348 Float_t zs[] = { 1., 6., 7., 8.};
349 Float_t ws[] = { 0.026362, 0.69113, 0.07327, 0.209235};
356 AliMixture(id, "Kaption$", as, zs, density, 4, ws);
357 AliMedium(kKaptonId, "Kaption$", id,0,fieldType,maxField,maxBending,
358 maxStepSize,maxEnergyLoss,precision,minStepSize);
363 Float_t as[] = { 12.0107, 14.0067, 15.9994, 39.948 };
364 Float_t zs[] = { 6., 7., 8., 18. };
365 Float_t ws[] = { 0.000124, 0.755267, 0.231781, 0.012827 };
372 AliMixture(id, "Air$", as, zs, density, 4, ws);
373 AliMedium(kAirId, "Air$", id,0,fieldType,maxField,maxBending,
374 maxStepSize,maxEnergyLoss,precision,minStepSize);
379 Float_t zs[] = { 14., 20., 13., 12.,
383 Float_t as[] = { 28.0855, 40.078, 26.981538, 24.305,
384 10.811, 47.867, 22.98977, 39.0983,
385 55.845, 18.9984, 15.9994, 12.0107,
387 Float_t ws[] = { 0.15144894, 0.08147477, 0.04128158, 0.00904554,
388 0.01397570, 0.00287685, 0.00445114, 0.00498089,
389 0.00209828, 0.00420000, 0.36043788, 0.27529426,
390 0.01415852, 0.03427566};
397 AliMixture(id, "PCB$", as, zs, density, 14, ws);
398 AliMedium(kPcbId, "PCB$", id,0,fieldType,maxField,maxBending,
399 maxStepSize,maxEnergyLoss,precision,minStepSize);
404 Float_t as[] = { 55.847, 51.9961, 58.6934, 28.0855 };
405 Float_t zs[] = { 26., 24., 28., 14. };
406 Float_t ws[] = { .715, .18, .1, .005 };
409 AliMixture(id, "Steel$", as, zs, density, 4, ws);
410 AliMedium(kSteelId, "Steel$", id, 0, fieldType, maxField, maxBending,
411 maxStepSize, maxEnergyLoss, precision, minStepSize);
415 Float_t as[] = { 1.01, 12.01 };
416 Float_t zs[] = { 1., 6. };
417 Float_t ws[] = { 1., 1. };
424 AliMixture(id, "Plastic$", as, zs, density, -2, ws);
425 AliMedium(kPlasticId, "Plastic$", id,0,fieldType,maxField,maxBending,
426 maxStepSize,maxEnergyLoss,precision,minStepSize);
431 //____________________________________________________________________
435 // Initialize the detector
437 AliFMDDebug(1, ("Initialising FMD detector object"));
438 TVirtualMC* mc = TVirtualMC::GetMC();
439 AliFMDGeometry* fmd = AliFMDGeometry::Instance();
440 const TArrayI& actGeo = fmd->ActiveIds();
441 TArrayI actVmc(actGeo.fN);
442 for (Int_t i = 0; i < actGeo.fN; i++) {
443 TGeoVolume *sens = gGeoManager->GetVolume(actGeo[i]);
445 AliError(Form("No TGeo volume for sensitive volume ID=%d",actGeo[i]));
448 actVmc[i] = mc->VolId(sens->GetName());
449 AliFMDDebug(1, ("Active vol id # %d: %d changed to %d",
450 i, actGeo[i], actVmc[i]));
452 fmd->SetActive(actVmc.fArray, actVmc.fN);
453 // fmd->InitTransformations();
456 //____________________________________________________________________
458 AliFMD::FinishEvent()
460 // Called at the end of the an event in simulations. If the debug
461 // level is high enough, then the `bad' hits are printed.
463 if (AliLog::GetDebugLevel("FMD", "AliFMD") < 10) return;
464 if (fBad && fBad->GetEntries() > 0) {
465 AliWarning((Form("EndEvent", "got %d 'bad' hits", fBad->GetEntries())));
468 while ((hit = static_cast<AliFMDHit*>(next()))) hit->Print("D");
475 //====================================================================
477 // Hit and Digit managment
479 //____________________________________________________________________
481 AliFMD::MakeBranch(Option_t * option)
483 // Create Tree branches for the FMD.
487 // H Make a branch of TClonesArray of AliFMDHit's
488 // D Make a branch of TClonesArray of AliFMDDigit's
489 // S Make a branch of TClonesArray of AliFMDSDigit's
491 const Int_t kBufferSize = 16000;
492 TString branchname(GetName());
495 if (opt.Contains("H", TString::kIgnoreCase)) {
497 AliDetector::MakeBranch(option);
499 if (opt.Contains("D", TString::kIgnoreCase)) {
501 MakeBranchInTree(fLoader->TreeD(), branchname.Data(),
502 &fDigits, kBufferSize, 0);
504 if (opt.Contains("S", TString::kIgnoreCase)) {
506 MakeBranchInTree(fLoader->TreeS(), branchname.Data(),
507 &fSDigits, kBufferSize, 0);
511 //____________________________________________________________________
513 AliFMD::SetTreeAddress()
515 // Set branch address for the Hits, Digits, and SDigits Tree.
516 if (fLoader->TreeH()) HitsArray();
517 AliDetector::SetTreeAddress();
519 TTree *treeD = fLoader->TreeD();
522 TBranch* branch = treeD->GetBranch ("FMD");
523 if (branch) branch->SetAddress(&fDigits);
526 TTree *treeS = fLoader->TreeS();
529 TBranch* branch = treeS->GetBranch ("FMD");
530 if (branch) branch->SetAddress(&fSDigits);
534 //____________________________________________________________________
536 AliFMD::SetHitsAddressBranch(TBranch *b)
538 // Set the TClonesArray to read hits into.
539 b->SetAddress(&fHits);
541 //____________________________________________________________________
543 AliFMD::SetSDigitsAddressBranch(TBranch *b)
545 // Set the TClonesArray to read hits into.
546 b->SetAddress(&fSDigits);
549 //____________________________________________________________________
551 AliFMD::AddHit(Int_t track, Int_t *vol, Float_t *hits)
553 // Add a hit to the hits tree
555 // The information of the two arrays are decoded as
559 // ivol[0] [UShort_t ] Detector #
560 // ivol[1] [Char_t ] Ring ID
561 // ivol[2] [UShort_t ] Sector #
562 // ivol[3] [UShort_t ] Strip #
563 // hits[0] [Float_t ] Track's X-coordinate at hit
564 // hits[1] [Float_t ] Track's Y-coordinate at hit
565 // hits[3] [Float_t ] Track's Z-coordinate at hit
566 // hits[4] [Float_t ] X-component of track's momentum
567 // hits[5] [Float_t ] Y-component of track's momentum
568 // hits[6] [Float_t ] Z-component of track's momentum
569 // hits[7] [Float_t ] Energy deposited by track
570 // hits[8] [Int_t ] Track's particle Id #
571 // hits[9] [Float_t ] Time when the track hit
574 AddHitByFields(track,
575 UShort_t(vol[0]), // Detector #
576 Char_t(vol[1]), // Ring ID
577 UShort_t(vol[2]), // Sector #
578 UShort_t(vol[3]), // Strip #
585 hits[6], // Energy loss
586 Int_t(hits[7]), // PDG
590 //____________________________________________________________________
592 AliFMD::AddHitByFields(Int_t track,
609 // Add a hit to the list
614 // detector Detector # (1, 2, or 3)
615 // ring Ring ID ('I' or 'O')
616 // sector Sector # (For inner/outer rings: 0-19/0-39)
617 // strip Strip # (For inner/outer rings: 0-511/0-255)
618 // x Track's X-coordinate at hit
619 // y Track's Y-coordinate at hit
620 // z Track's Z-coordinate at hit
621 // px X-component of track's momentum
622 // py Y-component of track's momentum
623 // pz Z-component of track's momentum
624 // edep Energy deposited by track
625 // pdg Track's particle Id #
626 // t Time when the track hit
627 // l Track length through the material.
628 // stop Whether track was stopped or disappeared
630 TClonesArray& a = *(HitsArray());
631 // Search through the list of already registered hits, and see if we
632 // find a hit with the same parameters. If we do, then don't create
633 // a new hit, but rather update the energy deposited in the hit.
634 // This is done, so that a FLUKA based simulation will get the
635 // number of hits right, not just the enerrgy deposition.
637 for (Int_t i = 0; i < fNhits; i++) {
638 if (!a.At(i)) continue;
639 hit = static_cast<AliFMDHit*>(a.At(i));
640 if (hit->Detector() == detector
641 && hit->Ring() == ring
642 && hit->Sector() == sector
643 && hit->Strip() == strip
644 && hit->Track() == track) {
645 AliFMDDebug(1, ("already had a hit in FMD%d%c[%2d,%3d] for track # %d,"
646 " adding energy (%f) to that hit (%f) -> %f",
647 detector, ring, sector, strip, track, edep, hit->Edep(),
648 hit->Edep() + edep));
649 hit->SetEdep(hit->Edep() + edep);
653 // If hit wasn't already registered, do so know.
654 hit = new (a[fNhits]) AliFMDHit(fIshunt, track, detector, ring, sector,
655 strip, x, y, z, px, py, pz, edep, pdg, t,
661 //____________________________________________________________________
663 AliFMD::AddDigit(Int_t* digits, Int_t*)
665 // Add a digit to the Digit tree
669 // digits[0] [UShort_t] Detector #
670 // digits[1] [Char_t] Ring ID
671 // digits[2] [UShort_t] Sector #
672 // digits[3] [UShort_t] Strip #
673 // digits[4] [UShort_t] ADC Count
674 // digits[5] [Short_t] ADC Count, -1 if not used
675 // digits[6] [Short_t] ADC Count, -1 if not used
677 AddDigitByFields(UShort_t(digits[0]), // Detector #
678 Char_t(digits[1]), // Ring ID
679 UShort_t(digits[2]), // Sector #
680 UShort_t(digits[3]), // Strip #
681 UShort_t(digits[4]), // ADC Count1
682 Short_t(digits[5]), // ADC Count2
683 Short_t(digits[6]), // ADC Count3
687 //____________________________________________________________________
689 AliFMD::AddDigitByFields(UShort_t detector,
698 // add a real digit - as coming from data
702 // detector Detector # (1, 2, or 3)
703 // ring Ring ID ('I' or 'O')
704 // sector Sector # (For inner/outer rings: 0-19/0-39)
705 // strip Strip # (For inner/outer rings: 0-511/0-255)
706 // count1 ADC count (a 10-bit word)
707 // count2 ADC count (a 10-bit word), or -1 if not used
708 // count3 ADC count (a 10-bit word), or -1 if not used
709 TClonesArray& a = *(DigitsArray());
712 AliFMDDigit(detector, ring, sector, strip, count1, count2, count3, count4);
713 AliFMDDebug(15, ("Adding digit # %5d/%5d for FMD%d%c[%2d,%3d]=(%d,%d,%d,%d)",
714 fNdigits-1, a.GetEntriesFast(),
715 detector, ring, sector, strip,
716 count1, count2, count3, count4));
720 //____________________________________________________________________
722 AliFMD::AddSDigit(Int_t* digits)
724 // Add a digit to the SDigit tree
728 // digits[0] [UShort_t] Detector #
729 // digits[1] [Char_t] Ring ID
730 // digits[2] [UShort_t] Sector #
731 // digits[3] [UShort_t] Strip #
732 // digits[4] [Float_t] Total energy deposited
733 // digits[5] [UShort_t] ADC Count
734 // digits[6] [Short_t] ADC Count, -1 if not used
735 // digits[7] [Short_t] ADC Count, -1 if not used
737 AddSDigitByFields(UShort_t(digits[0]), // Detector #
738 Char_t(digits[1]), // Ring ID
739 UShort_t(digits[2]), // Sector #
740 UShort_t(digits[3]), // Strip #
741 Float_t(digits[4]), // Edep
742 UShort_t(digits[5]), // ADC Count1
743 Short_t(digits[6]), // ADC Count2
744 Short_t(digits[7]), // ADC Count3
745 Short_t(digits[8]), // ADC Count4
746 UShort_t(digits[9]), // N particles
747 UShort_t(digits[10])); // N primaries
751 //____________________________________________________________________
753 AliFMD::AddSDigitByFields(UShort_t detector,
765 // add a summable digit
769 // detector Detector # (1, 2, or 3)
770 // ring Ring ID ('I' or 'O')
771 // sector Sector # (For inner/outer rings: 0-19/0-39)
772 // strip Strip # (For inner/outer rings: 0-511/0-255)
773 // edep Total energy deposited
774 // count1 ADC count (a 10-bit word)
775 // count2 ADC count (a 10-bit word), or -1 if not used
776 // count3 ADC count (a 10-bit word), or -1 if not used
778 TClonesArray& a = *(SDigitsArray());
779 // AliFMDDebug(0, ("Adding sdigit # %d", fNsdigits));
782 AliFMDSDigit(detector, ring, sector, strip, edep,
783 count1, count2, count3, count4, ntot, nprim);
786 //____________________________________________________________________
788 AliFMD::ResetSDigits()
790 // Reset number of digits and the digits array for this detector.
793 if (fSDigits) fSDigits->Clear();
797 //____________________________________________________________________
801 // Initialize hit array if not already, and return pointer to it.
803 fHits = new TClonesArray("AliFMDHit", 1000);
809 //____________________________________________________________________
811 AliFMD::DigitsArray()
813 // Initialize digit array if not already, and return pointer to it.
815 fDigits = new TClonesArray("AliFMDDigit", 1000);
821 //____________________________________________________________________
823 AliFMD::SDigitsArray()
825 // Initialize digit array if not already, and return pointer to it.
827 fSDigits = new TClonesArray("AliFMDSDigit", 1000);
833 //====================================================================
837 //____________________________________________________________________
839 AliFMD::Hits2Digits()
841 // Create AliFMDDigit's from AliFMDHit's. This is done by making a
842 // AliFMDDigitizer, and executing that code.
844 AliFMDHitDigitizer digitizer(this, AliFMDHitDigitizer::kDigits);
849 //____________________________________________________________________
851 AliFMD::Hits2SDigits()
853 // Create AliFMDSDigit's from AliFMDHit's. This is done by creating
854 // an AliFMDSDigitizer object, and executing it.
856 AliFMDHitDigitizer digitizer(this, AliFMDHitDigitizer::kSDigits);
862 //____________________________________________________________________
864 AliFMD::CreateDigitizer(AliRunDigitizer* manager) const
866 // Create a digitizer object
868 /* This is what we probably _should_ do */
869 AliFMDBaseDigitizer* digitizer = 0;
871 #ifdef USE_SSDIGITIZER
872 digitizer = new AliFMDSSDigitizer(manager);
874 /* This is what we actually do, and will work */
876 AliInfo("SDigit->Digit conversion not really supported, "
877 "doing Hit->Digit conversion instead");
879 digitizer = new AliFMDDigitizer(manager);
884 //====================================================================
886 // Raw data simulation
888 //__________________________________________________________________
892 // Turn digits into raw data.
894 // This uses the class AliFMDRawWriter to do the job. Please refer
895 // to that class for more information.
896 AliFMDRawWriter writer(this);
901 //====================================================================
905 //__________________________________________________________________
907 AliFMD::Browse(TBrowser* b)
909 // Browse this object.
911 AliFMDDebug(30, ("\tBrowsing the FMD"));
912 AliDetector::Browse(b);
913 b->Add(AliFMDGeometry::Instance());
916 //____________________________________________________________________
918 AliFMD::AddAlignableVolumes() const
921 // Create entries for alignable volumes associating the symbolic volume
922 // name with the corresponding volume path. Needs to be syncronized with
923 // eventual changes in the geometry.
925 // This code was made by Raffaele Grosso <rgrosso@mail.cern.ch>. I
926 // (cholm) will probably want to change it. For one, I think it
927 // should be the job of the geometry manager to deal with this.
928 AliInfo("Add FMD alignable volumes");
929 AliFMDGeometry::Instance()->SetAlignableVolumes();
931 for(size_t f = 1; f <= 3; f++){ // Detector 1,2,3
932 for(size_t tb = 0; tb <2 ; tb++){ // Top/Bottom
933 char stb = tb == 0 ? 'T' : 'B';
934 unsigned min = tb == 0 ? 0 : 5;
936 TString halfVol(Form("/ALIC_1/F%dM%c_%d", f, stb, f));
937 TString halfSym(halfVol);
938 if(!gGeoManager->SetAlignableEntry(halfSym.Data(),halfVol.Data()))
939 AliFatal(Form("Alignable entry %s not created. "
940 "Volume path %s not valid",
941 halfSym.Data(),halfVol.Data()));
942 for(size_t io = 0; io < 2; io++){ // inner, outer
943 if (f==1 && io==1) continue; // Only one ring in FMD1
944 if(tb == 1 && io==1) min=10;
945 char sio = (io == 0 ? 'I' : 'O');
946 unsigned nio = (io == 0 ? 3 : 9);
947 unsigned max = (io == 0 ? 5 : 10) + min;
949 for(size_t i = min; i < max; i++) { // Modules
950 TString modVol(Form("%s/F%c%cV_7%d/F%cSE_%d", halfVol.Data(),
951 sio, stb, nio, sio, i));
952 TString modSym(modVol);
953 if(!gGeoManager->SetAlignableEntry(modSym.Data(),modVol.Data()))
954 AliFatal(Form("Alignable entry %s not created. "
955 "Volume path %s not valid",
956 modSym.Data(), modVol.Data()));
963 //___________________________________________________________________