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 <TRotMatrix.h> // ROOT_TRotMatrix
90 #include <TTree.h> // ROOT_TTree
91 #include <TBrowser.h> // ROOT_TBrowser
92 #include <TVirtualMC.h> // ROOT_TVirtualMC
93 #include <TVector2.h> // ROOT_TVector2
94 #include <TGeoManager.h> // ROOT_TGeoManager
96 #include <AliRunDigitizer.h> // ALIRUNDIGITIZER_H
97 #include <AliLoader.h> // ALILOADER_H
98 #include <AliRun.h> // ALIRUN_H
99 #include <AliMC.h> // ALIMC_H
100 #include <AliMagF.h> // ALIMAGF_H
101 // #include <AliLog.h> // ALILOG_H
102 #include "AliFMDDebug.h" // Better debug macros
103 #include "AliFMD.h" // ALIFMD_H
104 #include "AliFMDDigit.h" // ALIFMDDIGIT_H
105 #include "AliFMDSDigit.h" // ALIFMDSDIGIT_H
106 #include "AliFMDHit.h" // ALIFMDHIT_H
107 #include "AliFMDGeometry.h" // ALIFMDGEOMETRY_H
108 #include "AliFMDDetector.h" // ALIFMDDETECTOR_H
109 #include "AliFMDRing.h" // ALIFMDRING_H
110 #include "AliFMDDigitizer.h" // ALIFMDDIGITIZER_H
111 #include "AliFMDHitDigitizer.h" // ALIFMDSDIGITIZER_H
112 // #define USE_SSDIGITIZER
113 //#ifdef USE_SSDIGITIZER
114 //# include "AliFMDSSDigitizer.h" // ALIFMDSDIGITIZER_H
116 // #include "AliFMDGeometryBuilder.h"
117 #include "AliFMDRawWriter.h" // ALIFMDRAWWRITER_H
118 #include "AliTrackReference.h"
119 #include "AliFMDStripIndex.h"
121 //____________________________________________________________________
124 ; // This is to keep Emacs from indenting the next line
127 //____________________________________________________________________
138 // Default constructor for class AliFMD
140 AliFMDDebug(10, ("\tDefault CTOR"));
144 fBad = new TClonesArray("AliFMDHit");
147 //____________________________________________________________________
148 AliFMD::AliFMD(const char *name, const char *title)
149 : AliDetector (name, title),
154 fUseAssembly(kFALSE),
158 // Standard constructor for Forward Multiplicity Detector
160 AliFMDDebug(10, ("\tStandard CTOR"));
161 fBad = new TClonesArray("AliFMDHit");
163 // Initialise Hit array
165 gAlice->GetMCApp()->AddHitList(fHits);
167 // (S)Digits for the detectors disk
171 // CHC: What is this?
173 //PH SetMarkerColor(kRed);
174 //PH SetLineColor(kYellow);
177 //____________________________________________________________________
180 // Destructor for base class AliFMD
204 //====================================================================
206 // GEometry ANd Traking
208 //____________________________________________________________________
210 AliFMD::CreateGeometry()
213 // Create the geometry of Forward Multiplicity Detector. The actual
214 // construction of the geometry is delegated to the class
215 // AliFMDGeometryBuilder, invoked by the singleton manager
218 AliFMDGeometry* fmd = AliFMDGeometry::Instance();
219 fmd->SetDetailed(fDetailed);
220 fmd->UseAssembly(fUseAssembly);
224 //____________________________________________________________________
225 void AliFMD::CreateMaterials()
227 // Define the materials and tracking mediums needed by the FMD
228 // simulation. These mediums are made by sending the messages
229 // AliMaterial, AliMixture, and AliMedium to the passed AliModule
230 // object module. The defined mediums are
232 // FMD Si$ Silicon (active medium in sensors)
233 // FMD C$ Carbon fibre (support cone for FMD3 and vacuum pipe)
234 // FMD Al$ Aluminium (honeycomb support plates)
235 // FMD PCB$ Printed Circuit Board (FEE board with VA1_3)
236 // FMD Chip$ Electronics chips (currently not used)
237 // FMD Air$ Air (Air in the FMD)
238 // FMD Plastic$ Plastic (Support legs for the hybrid cards)
240 // The geometry builder should really be the one that creates the
241 // materials, but the architecture of AliROOT makes that design
242 // akward. What should happen, was that the AliFMDGeometryBuilder
243 // made the mediums, and that this class retrives pointers from the
244 // TGeoManager, and registers the mediums here. Alas, it's not
247 AliFMDDebug(10, ("\tCreating materials"));
248 // Get pointer to geometry singleton object.
249 AliFMDGeometry* geometry = AliFMDGeometry::Instance();
252 if (gGeoManager && gGeoManager->GetMedium("FMD Si$")) {
253 // We need to figure out the some stuff about the geometry
254 fmd->ExtractGeomInfo();
261 Double_t density = 0;
262 Double_t radiationLength = 0;
263 Double_t absorbtionLength = 999;
264 Int_t fieldType = gAlice->Field()->Integ(); // Field type
265 Double_t maxField = gAlice->Field()->Max(); // Field max.
266 Double_t maxBending = 0; // Max Angle
267 Double_t maxStepSize = 0.001; // Max step size
268 Double_t maxEnergyLoss = 1; // Max Delta E
269 Double_t precision = 0.001; // Precision
270 Double_t minStepSize = 0.001; // Minimum step size
275 density = geometry->GetSiDensity();
276 radiationLength = 9.36;
282 AliMaterial(id, "Si$", a, z, density, radiationLength, absorbtionLength);
283 AliMedium(kSiId, "Si$", id,1,fieldType,maxField,maxBending,
284 maxStepSize,maxEnergyLoss,precision,minStepSize);
291 radiationLength = 18.8;
297 AliMaterial(id, "Carbon$", a, z, density, radiationLength, absorbtionLength);
298 AliMedium(kCarbonId, "Carbon$", id,0,fieldType,maxField,maxBending,
299 maxStepSize,maxEnergyLoss,precision,minStepSize);
305 radiationLength = 8.9;
307 AliMaterial(id, "Aluminum$",a,z, density, radiationLength, absorbtionLength);
308 AliMedium(kAlId, "Aluminum$", id, 0, fieldType, maxField, maxBending,
309 maxStepSize, maxEnergyLoss, precision, minStepSize);
316 radiationLength = 1.43;
318 AliMaterial(id, "Copper$",
319 a, z, density, radiationLength, absorbtionLength);
320 AliMedium(kCopperId, "Copper$", id, 0, fieldType, maxField, maxBending,
321 maxStepSize, maxEnergyLoss, precision, minStepSize);
326 Float_t as[] = { 12.0107, 14.0067, 15.9994,
327 1.00794, 28.0855, 107.8682 };
328 Float_t zs[] = { 6., 7., 8.,
330 Float_t ws[] = { 0.039730642, 0.001396798, 0.01169634,
331 0.004367771, 0.844665, 0.09814344903 };
338 AliMixture(id, "Si Chip$", as, zs, density, 6, ws);
339 AliMedium(kSiChipId, "Si Chip$", id, 0, fieldType, maxField, maxBending,
340 maxStepSize, maxEnergyLoss, precision, minStepSize);
345 Float_t as[] = { 1.00794, 12.0107, 14.010, 15.9994};
346 Float_t zs[] = { 1., 6., 7., 8.};
347 Float_t ws[] = { 0.026362, 0.69113, 0.07327, 0.209235};
354 AliMixture(id, "Kaption$", as, zs, density, 4, ws);
355 AliMedium(kKaptonId, "Kaption$", id,0,fieldType,maxField,maxBending,
356 maxStepSize,maxEnergyLoss,precision,minStepSize);
361 Float_t as[] = { 12.0107, 14.0067, 15.9994, 39.948 };
362 Float_t zs[] = { 6., 7., 8., 18. };
363 Float_t ws[] = { 0.000124, 0.755267, 0.231781, 0.012827 };
370 AliMixture(id, "Air$", as, zs, density, 4, ws);
371 AliMedium(kAirId, "Air$", id,0,fieldType,maxField,maxBending,
372 maxStepSize,maxEnergyLoss,precision,minStepSize);
377 Float_t zs[] = { 14., 20., 13., 12.,
381 Float_t as[] = { 28.0855, 40.078, 26.981538, 24.305,
382 10.811, 47.867, 22.98977, 39.0983,
383 55.845, 18.9984, 15.9994, 12.0107,
385 Float_t ws[] = { 0.15144894, 0.08147477, 0.04128158, 0.00904554,
386 0.01397570, 0.00287685, 0.00445114, 0.00498089,
387 0.00209828, 0.00420000, 0.36043788, 0.27529426,
388 0.01415852, 0.03427566};
395 AliMixture(id, "PCB$", as, zs, density, 14, ws);
396 AliMedium(kPcbId, "PCB$", id,0,fieldType,maxField,maxBending,
397 maxStepSize,maxEnergyLoss,precision,minStepSize);
402 Float_t as[] = { 55.847, 51.9961, 58.6934, 28.0855 };
403 Float_t zs[] = { 26., 24., 28., 14. };
404 Float_t ws[] = { .715, .18, .1, .005 };
407 AliMixture(id, "Steel$", as, zs, density, 4, ws);
408 AliMedium(kSteelId, "Steel$", id, 0, fieldType, maxField, maxBending,
409 maxStepSize, maxEnergyLoss, precision, minStepSize);
413 Float_t as[] = { 1.01, 12.01 };
414 Float_t zs[] = { 1., 6. };
415 Float_t ws[] = { 1., 1. };
422 AliMixture(id, "Plastic$", as, zs, density, -2, ws);
423 AliMedium(kPlasticId, "Plastic$", id,0,fieldType,maxField,maxBending,
424 maxStepSize,maxEnergyLoss,precision,minStepSize);
429 //____________________________________________________________________
433 // Initialize the detector
435 AliFMDDebug(1, ("Initialising FMD detector object"));
436 TVirtualMC* mc = TVirtualMC::GetMC();
437 AliFMDGeometry* fmd = AliFMDGeometry::Instance();
438 const TArrayI& actGeo = fmd->ActiveIds();
439 TArrayI actVmc(actGeo.fN);
440 for (Int_t i = 0; i < actGeo.fN; i++) {
441 TGeoVolume *sens = gGeoManager->GetVolume(actGeo[i]);
443 AliError(Form("No TGeo volume for sensitive volume ID=%d",actGeo[i]));
446 actVmc[i] = mc->VolId(sens->GetName());
447 AliFMDDebug(1, ("Active vol id # %d: %d changed to %d",
448 i, actGeo[i], actVmc[i]));
450 fmd->SetActive(actVmc.fArray, actVmc.fN);
451 // fmd->InitTransformations();
454 //____________________________________________________________________
456 AliFMD::FinishEvent()
458 // Called at the end of the an event in simulations. If the debug
459 // level is high enough, then the `bad' hits are printed.
461 if (AliLog::GetDebugLevel("FMD", "AliFMD") < 10) return;
462 if (fBad && fBad->GetEntries() > 0) {
463 AliWarning((Form("EndEvent", "got %d 'bad' hits", fBad->GetEntries())));
466 while ((hit = static_cast<AliFMDHit*>(next()))) hit->Print("D");
473 //====================================================================
475 // Hit and Digit managment
477 //____________________________________________________________________
479 AliFMD::MakeBranch(Option_t * option)
481 // Create Tree branches for the FMD.
485 // H Make a branch of TClonesArray of AliFMDHit's
486 // D Make a branch of TClonesArray of AliFMDDigit's
487 // S Make a branch of TClonesArray of AliFMDSDigit's
489 const Int_t kBufferSize = 16000;
490 TString branchname(GetName());
493 if (opt.Contains("H", TString::kIgnoreCase)) {
495 AliDetector::MakeBranch(option);
497 if (opt.Contains("D", TString::kIgnoreCase)) {
499 MakeBranchInTree(fLoader->TreeD(), branchname.Data(),
500 &fDigits, kBufferSize, 0);
502 if (opt.Contains("S", TString::kIgnoreCase)) {
504 MakeBranchInTree(fLoader->TreeS(), branchname.Data(),
505 &fSDigits, kBufferSize, 0);
509 //____________________________________________________________________
511 AliFMD::SetTreeAddress()
513 // Set branch address for the Hits, Digits, and SDigits Tree.
514 if (fLoader->TreeH()) HitsArray();
515 AliDetector::SetTreeAddress();
517 TTree *treeD = fLoader->TreeD();
520 TBranch* branch = treeD->GetBranch ("FMD");
521 if (branch) branch->SetAddress(&fDigits);
524 TTree *treeS = fLoader->TreeS();
527 TBranch* branch = treeS->GetBranch ("FMD");
528 if (branch) branch->SetAddress(&fSDigits);
532 //____________________________________________________________________
534 AliFMD::SetHitsAddressBranch(TBranch *b)
536 // Set the TClonesArray to read hits into.
537 b->SetAddress(&fHits);
539 //____________________________________________________________________
541 AliFMD::SetSDigitsAddressBranch(TBranch *b)
543 // Set the TClonesArray to read hits into.
544 b->SetAddress(&fSDigits);
547 //____________________________________________________________________
549 AliFMD::AddHit(Int_t track, Int_t *vol, Float_t *hits)
551 // Add a hit to the hits tree
553 // The information of the two arrays are decoded as
557 // ivol[0] [UShort_t ] Detector #
558 // ivol[1] [Char_t ] Ring ID
559 // ivol[2] [UShort_t ] Sector #
560 // ivol[3] [UShort_t ] Strip #
561 // hits[0] [Float_t ] Track's X-coordinate at hit
562 // hits[1] [Float_t ] Track's Y-coordinate at hit
563 // hits[3] [Float_t ] Track's Z-coordinate at hit
564 // hits[4] [Float_t ] X-component of track's momentum
565 // hits[5] [Float_t ] Y-component of track's momentum
566 // hits[6] [Float_t ] Z-component of track's momentum
567 // hits[7] [Float_t ] Energy deposited by track
568 // hits[8] [Int_t ] Track's particle Id #
569 // hits[9] [Float_t ] Time when the track hit
572 AddHitByFields(track,
573 UShort_t(vol[0]), // Detector #
574 Char_t(vol[1]), // Ring ID
575 UShort_t(vol[2]), // Sector #
576 UShort_t(vol[3]), // Strip #
583 hits[6], // Energy loss
584 Int_t(hits[7]), // PDG
588 //____________________________________________________________________
590 AliFMD::AddHitByFields(Int_t track,
607 // Add a hit to the list
612 // detector Detector # (1, 2, or 3)
613 // ring Ring ID ('I' or 'O')
614 // sector Sector # (For inner/outer rings: 0-19/0-39)
615 // strip Strip # (For inner/outer rings: 0-511/0-255)
616 // x Track's X-coordinate at hit
617 // y Track's Y-coordinate at hit
618 // z Track's Z-coordinate at hit
619 // px X-component of track's momentum
620 // py Y-component of track's momentum
621 // pz Z-component of track's momentum
622 // edep Energy deposited by track
623 // pdg Track's particle Id #
624 // t Time when the track hit
625 // l Track length through the material.
626 // stop Whether track was stopped or disappeared
628 TClonesArray& a = *(HitsArray());
629 // Search through the list of already registered hits, and see if we
630 // find a hit with the same parameters. If we do, then don't create
631 // a new hit, but rather update the energy deposited in the hit.
632 // This is done, so that a FLUKA based simulation will get the
633 // number of hits right, not just the enerrgy deposition.
635 for (Int_t i = 0; i < fNhits; i++) {
636 if (!a.At(i)) continue;
637 hit = static_cast<AliFMDHit*>(a.At(i));
638 if (hit->Detector() == detector
639 && hit->Ring() == ring
640 && hit->Sector() == sector
641 && hit->Strip() == strip
642 && hit->Track() == track) {
643 AliFMDDebug(1, ("already had a hit in FMD%d%c[%2d,%3d] for track # %d,"
644 " adding energy (%f) to that hit (%f) -> %f",
645 detector, ring, sector, strip, track, edep, hit->Edep(),
646 hit->Edep() + edep));
647 hit->SetEdep(hit->Edep() + edep);
651 // If hit wasn't already registered, do so know.
652 hit = new (a[fNhits]) AliFMDHit(fIshunt, track, detector, ring, sector,
653 strip, x, y, z, px, py, pz, edep, pdg, t,
655 // gMC->AddTrackReference(track, 12);
660 AliMC *mcApplication = (AliMC*)gAlice->GetMCApp();
662 AliTrackReference* trackRef = AddTrackReference(mcApplication->GetCurrentTrackNumber(), AliTrackReference::kFMD);
663 UInt_t stripId = AliFMDStripIndex::Pack(detector,ring,sector,strip);
664 trackRef->SetUserId(stripId);
671 //____________________________________________________________________
673 AliFMD::AddDigit(Int_t* digits, Int_t*)
675 // Add a digit to the Digit tree
679 // digits[0] [UShort_t] Detector #
680 // digits[1] [Char_t] Ring ID
681 // digits[2] [UShort_t] Sector #
682 // digits[3] [UShort_t] Strip #
683 // digits[4] [UShort_t] ADC Count
684 // digits[5] [Short_t] ADC Count, -1 if not used
685 // digits[6] [Short_t] ADC Count, -1 if not used
687 AddDigitByFields(UShort_t(digits[0]), // Detector #
688 Char_t(digits[1]), // Ring ID
689 UShort_t(digits[2]), // Sector #
690 UShort_t(digits[3]), // Strip #
691 UShort_t(digits[4]), // ADC Count1
692 Short_t(digits[5]), // ADC Count2
693 Short_t(digits[6]), // ADC Count3
697 //____________________________________________________________________
699 AliFMD::AddDigitByFields(UShort_t detector,
708 // add a real digit - as coming from data
712 // detector Detector # (1, 2, or 3)
713 // ring Ring ID ('I' or 'O')
714 // sector Sector # (For inner/outer rings: 0-19/0-39)
715 // strip Strip # (For inner/outer rings: 0-511/0-255)
716 // count1 ADC count (a 10-bit word)
717 // count2 ADC count (a 10-bit word), or -1 if not used
718 // count3 ADC count (a 10-bit word), or -1 if not used
719 TClonesArray& a = *(DigitsArray());
722 AliFMDDigit(detector, ring, sector, strip, count1, count2, count3, count4);
723 AliFMDDebug(15, ("Adding digit # %5d/%5d for FMD%d%c[%2d,%3d]=(%d,%d,%d,%d)",
724 fNdigits-1, a.GetEntriesFast(),
725 detector, ring, sector, strip,
726 count1, count2, count3, count4));
730 //____________________________________________________________________
732 AliFMD::AddSDigit(Int_t* digits)
734 // Add a digit to the SDigit tree
738 // digits[0] [UShort_t] Detector #
739 // digits[1] [Char_t] Ring ID
740 // digits[2] [UShort_t] Sector #
741 // digits[3] [UShort_t] Strip #
742 // digits[4] [Float_t] Total energy deposited
743 // digits[5] [UShort_t] ADC Count
744 // digits[6] [Short_t] ADC Count, -1 if not used
745 // digits[7] [Short_t] ADC Count, -1 if not used
747 AddSDigitByFields(UShort_t(digits[0]), // Detector #
748 Char_t(digits[1]), // Ring ID
749 UShort_t(digits[2]), // Sector #
750 UShort_t(digits[3]), // Strip #
751 Float_t(digits[4]), // Edep
752 UShort_t(digits[5]), // ADC Count1
753 Short_t(digits[6]), // ADC Count2
754 Short_t(digits[7]), // ADC Count3
755 Short_t(digits[8]), // ADC Count4
756 UShort_t(digits[9]), // N particles
757 UShort_t(digits[10])); // N primaries
760 //____________________________________________________________________
762 AliFMD::AddSDigitByFields(UShort_t detector,
775 // add a summable digit
779 // detector Detector # (1, 2, or 3)
780 // ring Ring ID ('I' or 'O')
781 // sector Sector # (For inner/outer rings: 0-19/0-39)
782 // strip Strip # (For inner/outer rings: 0-511/0-255)
783 // edep Total energy deposited
784 // count1 ADC count (a 10-bit word)
785 // count2 ADC count (a 10-bit word), or -1 if not used
786 // count3 ADC count (a 10-bit word), or -1 if not used
788 TClonesArray& a = *(SDigitsArray());
789 // AliFMDDebug(0, ("Adding sdigit # %d", fNsdigits));
792 AliFMDSDigit(detector, ring, sector, strip, edep,
793 count1, count2, count3, count4, ntot, nprim, refs);
796 //____________________________________________________________________
798 AliFMD::ResetSDigits()
800 // Reset number of digits and the digits array for this detector.
803 if (fSDigits) fSDigits->Clear();
807 //____________________________________________________________________
811 // Initialize hit array if not already, and return pointer to it.
813 fHits = new TClonesArray("AliFMDHit", 1000);
819 //____________________________________________________________________
821 AliFMD::DigitsArray()
823 // Initialize digit array if not already, and return pointer to it.
825 fDigits = new TClonesArray("AliFMDDigit", 1000);
831 //____________________________________________________________________
833 AliFMD::SDigitsArray()
835 // Initialize digit array if not already, and return pointer to it.
837 fSDigits = new TClonesArray("AliFMDSDigit", 1000);
843 //====================================================================
847 //____________________________________________________________________
849 AliFMD::Hits2Digits()
851 // Create AliFMDDigit's from AliFMDHit's. This is done by making a
852 // AliFMDDigitizer, and executing that code.
854 AliFMDHitDigitizer digitizer(this, AliFMDHitDigitizer::kDigits);
859 //____________________________________________________________________
861 AliFMD::Hits2SDigits()
863 // Create AliFMDSDigit's from AliFMDHit's. This is done by creating
864 // an AliFMDSDigitizer object, and executing it.
866 AliFMDHitDigitizer digitizer(this, AliFMDHitDigitizer::kSDigits);
872 //____________________________________________________________________
874 AliFMD::CreateDigitizer(AliRunDigitizer* manager) const
876 // Create a digitizer object
878 /* This is what we probably _should_ do */
879 AliFMDBaseDigitizer* digitizer = 0;
881 #ifdef USE_SSDIGITIZER
882 digitizer = new AliFMDSSDigitizer(manager);
884 /* This is what we actually do, and will work */
886 AliInfo("SDigit->Digit conversion not really supported, "
887 "doing Hit->Digit conversion instead");
889 digitizer = new AliFMDDigitizer(manager);
894 //====================================================================
896 // Raw data simulation
898 //__________________________________________________________________
902 // Turn digits into raw data.
904 // This uses the class AliFMDRawWriter to do the job. Please refer
905 // to that class for more information.
906 AliFMDRawWriter writer(this);
911 //====================================================================
915 //__________________________________________________________________
917 AliFMD::Browse(TBrowser* b)
919 // Browse this object.
921 AliFMDDebug(30, ("\tBrowsing the FMD"));
922 AliDetector::Browse(b);
923 b->Add(AliFMDGeometry::Instance());
926 //____________________________________________________________________
928 AliFMD::AddAlignableVolumes() const
931 // Create entries for alignable volumes associating the symbolic volume
932 // name with the corresponding volume path. Needs to be syncronized with
933 // eventual changes in the geometry.
935 // This code was made by Raffaele Grosso <rgrosso@mail.cern.ch>. I
936 // (cholm) will probably want to change it. For one, I think it
937 // should be the job of the geometry manager to deal with this.
938 AliInfo("Add FMD alignable volumes");
939 AliFMDGeometry::Instance()->SetAlignableVolumes();
941 for(size_t f = 1; f <= 3; f++){ // Detector 1,2,3
942 for(size_t tb = 0; tb <2 ; tb++){ // Top/Bottom
943 char stb = tb == 0 ? 'T' : 'B';
944 unsigned min = tb == 0 ? 0 : 5;
946 TString halfVol(Form("/ALIC_1/F%dM%c_%d", f, stb, f));
947 TString halfSym(halfVol);
948 if(!gGeoManager->SetAlignableEntry(halfSym.Data(),halfVol.Data()))
949 AliFatal(Form("Alignable entry %s not created. "
950 "Volume path %s not valid",
951 halfSym.Data(),halfVol.Data()));
952 for(size_t io = 0; io < 2; io++){ // inner, outer
953 if (f==1 && io==1) continue; // Only one ring in FMD1
954 if(tb == 1 && io==1) min=10;
955 char sio = (io == 0 ? 'I' : 'O');
956 unsigned nio = (io == 0 ? 3 : 9);
957 unsigned max = (io == 0 ? 5 : 10) + min;
959 for(size_t i = min; i < max; i++) { // Modules
960 TString modVol(Form("%s/F%c%cV_7%d/F%cSE_%d", halfVol.Data(),
961 sio, stb, nio, sio, i));
962 TString modSym(modVol);
963 if(!gGeoManager->SetAlignableEntry(modSym.Data(),modVol.Data()))
964 AliFatal(Form("Alignable entry %s not created. "
965 "Volume path %s not valid",
966 modSym.Data(), modVol.Data()));
973 //___________________________________________________________________