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 **************************************************************************/
18 Revision 1.24 2001/01/26 19:56:49 hristov
19 Major upgrade of AliRoot code
21 Revision 1.23 2000/11/01 14:53:20 cblume
22 Merge with TRD-develop
25 Revision 1.17.2.6 2000/10/15 23:29:08 cblume
26 Introduced more detailed geometry for the display
28 Revision 1.17.2.5 2000/10/06 16:49:46 cblume
31 Revision 1.17.2.4 2000/10/04 16:34:57 cblume
32 Replace include files by forward declarations
34 Revision 1.17.2.3 2000/09/22 14:45:17 cblume
35 Included changes for the tracking
37 Revision 1.17.2.2 2000/09/18 13:25:13 cblume
38 Included LoadPoints() method to display the TR photons
40 Revision 1.22 2000/10/02 21:28:19 fca
41 Removal of useless dependecies via forward declarations
43 Revision 1.21 2000/06/09 11:10:07 cblume
44 Compiler warnings and coding conventions, next round
46 Revision 1.20 2000/06/08 18:32:57 cblume
47 Make code compliant to coding conventions
49 Revision 1.19 2000/06/07 16:25:37 cblume
50 Try to remove compiler warnings on Sun and HP
52 Revision 1.18 2000/05/08 16:17:27 cblume
55 Revision 1.21 2000/06/09 11:10:07 cblume
56 Compiler warnings and coding conventions, next round
58 Revision 1.20 2000/06/08 18:32:57 cblume
59 Make code compliant to coding conventions
61 Revision 1.19 2000/06/07 16:25:37 cblume
62 Try to remove compiler warnings on Sun and HP
64 Revision 1.18 2000/05/08 16:17:27 cblume
67 Revision 1.17.2.1 2000/05/08 14:28:59 cblume
68 Introduced SetPHOShole() and SetRICHhole(). AliTRDrecPoint container is now a TObjArray
70 Revision 1.17 2000/02/28 19:10:26 cblume
71 Include the new TRD classes
73 Revision 1.16.2.2 2000/02/28 17:53:24 cblume
74 Introduce TRD geometry classes
76 Revision 1.16.2.1 2000/02/28 17:04:19 cblume
77 Include functions and data members for AliTRDrecPoint
79 Revision 1.16 2000/01/19 17:17:35 fca
80 Introducing a list of lists of hits -- more hits allowed for detector now
82 Revision 1.15 1999/11/02 17:04:25 fca
83 Small syntax change for HP compiler
85 Revision 1.14 1999/11/02 16:57:02 fca
86 Avoid non ansi warnings on HP compilers
88 Revision 1.13 1999/11/02 16:35:56 fca
89 New version of TRD introduced
91 Revision 1.12 1999/11/01 20:41:51 fca
92 Added protections against using the wrong version of FRAME
94 Revision 1.11 1999/09/29 09:24:34 fca
95 Introduction of the Copyright and cvs Log
99 ///////////////////////////////////////////////////////////////////////////////
101 // Transition Radiation Detector //
102 // This class contains the basic functions for the Transition Radiation //
105 ///////////////////////////////////////////////////////////////////////////////
108 #include <iostream.h>
112 #include <TGeometry.h>
117 #include "AliConst.h"
118 #include "AliDigit.h"
123 #include "AliTRDhit.h"
124 #include "AliTRDpoints.h"
125 #include "AliTRDdigit.h"
126 #include "AliTRDdigitizer.h"
127 #include "AliTRDclusterizer.h"
128 #include "AliTRDgeometryHole.h"
129 #include "AliTRDgeometryFull.h"
130 #include "AliTRDrecPoint.h"
131 #include "AliTRDdigitsManager.h"
132 #include "AliTRDdataArrayI.h"
133 #include "AliTRDsegmentArray.h"
137 //_____________________________________________________________________________
141 // Default constructor
161 for (Int_t iDict = 0; iDict < AliTRDdigitsManager::NDict(); iDict++) {
162 fDictionaryArray[iDict] = 0;
167 //_____________________________________________________________________________
168 AliTRD::AliTRD(const char *name, const char *title)
169 : AliDetector(name,title)
172 // Standard constructor for the TRD
175 // Check that FRAME is there otherwise we have no place where to
177 AliModule* frame = gAlice->GetModule("FRAME");
179 Error("Ctor","TRD needs FRAME to be present\n");
183 // Define the TRD geometry according to the FRAME geometry
184 if (frame->IsVersion() == 0) {
185 // Geometry with hole
186 fGeometry = new AliTRDgeometryHole();
188 else if (frame->IsVersion() == 1) {
189 // Geometry without hole
190 fGeometry = new AliTRDgeometryFull();
193 Error("Ctor","Could not find valid FRAME version\n");
197 // Allocate the hit array
198 fHits = new TClonesArray("AliTRDhit" ,405);
199 gAlice->AddHitList(fHits);
201 // Allocate the digits array
204 // Allocate the rec point array
205 fRecPoints = new TObjArray(400);
218 for (Int_t iDict = 0; iDict < AliTRDdigitsManager::NDict(); iDict++) {
219 fDictionaryArray[iDict] = 0;
222 SetMarkerColor(kWhite);
226 //_____________________________________________________________________________
227 AliTRD::AliTRD(const AliTRD &trd)
233 ((AliTRD &) trd).Copy(*this);
237 //_____________________________________________________________________________
249 if (fDigitsArray) delete fDigitsArray;
250 for (Int_t iDict = 0; iDict < AliTRDdigitsManager::NDict(); iDict++) {
251 if (fDictionaryArray[iDict]) delete fDictionaryArray[iDict];
256 //_____________________________________________________________________________
257 void AliTRD::AddRecPoint(Float_t *pos, Int_t *digits, Int_t det, Float_t amp
261 // Add a reconstructed point for the TRD
264 AliTRDrecPoint *recPoint = new AliTRDrecPoint();
265 TVector3 posVec(pos[0],pos[1],pos[2]);
266 recPoint->SetLocalPosition(posVec);
267 recPoint->SetDetector(det);
268 recPoint->SetEnergy(amp);
269 for (Int_t iDigit = 0; iDigit < 3; iDigit++) {
270 recPoint->AddDigit(digits[iDigit]);
273 recPoint->AddTrackIndex(tracks);
275 recPoint->SetTrackingYZ(0.,0.); // variance values set inside
276 fRecPoints->Add(recPoint);
280 //_____________________________________________________________________________
281 void AliTRD::Hits2Digits()
287 AliTRDdigitizer *digitizer = new AliTRDdigitizer("TRDdigitizer"
288 ,"TRD digitizer class");
291 digitizer->SetDiffusion();
295 //digitizer->InitDetector();
298 digitizer->MakeDigits();
300 // Write the digits into the input file
301 if (digitizer->Digits()->MakeBranch(fDigitsFile)) {
303 digitizer->WriteDigits();
305 // Save the digitizer class in the AliROOT
312 //_____________________________________________________________________________
313 void AliTRD::Hits2SDigits()
316 // Create summable digits
319 AliTRDdigitizer *digitizer = new AliTRDdigitizer("TRDdigitizer"
320 ,"TRD digitizer class");
322 // For the summable digits
323 digitizer->SetSDigits(kTRUE);
326 digitizer->SetDiffusion();
330 //digitizer->InitDetector();
333 digitizer->MakeDigits();
335 // Write the digits into the input file
336 if (digitizer->Digits()->MakeBranch(fDigitsFile)) {
338 digitizer->WriteDigits();
340 // Save the digitizer class in the AliROOT
347 //_____________________________________________________________________________
348 void AliTRD::SDigits2Digits()
351 // Create final digits from summable digits
356 //_____________________________________________________________________________
357 void AliTRD::AddDigit(Int_t *digits, Int_t *amp)
360 // Add a digit for the TRD
363 TClonesArray &ldigits = *fDigits;
364 new(ldigits[fNdigits++]) AliTRDdigit(kFALSE,digits,amp);
368 //_____________________________________________________________________________
369 void AliTRD::AddHit(Int_t track, Int_t det, Float_t *hits, Int_t q)
372 // Add a hit for the TRD
375 TClonesArray &lhits = *fHits;
376 new(lhits[fNhits++]) AliTRDhit(fIshunt,track,det,hits,q);
380 //_____________________________________________________________________________
381 void AliTRD::BuildGeometry()
384 // Create the ROOT TNode geometry for the TRD
391 Float_t zmax1, zmax2;
393 const Int_t kColorTRD = 46;
395 // Find the top node alice
396 top = gAlice->GetGeometry()->GetNode("alice");
398 switch (fDisplayType) {
402 pgon = new TPGON("S_TRD","TRD","void",0,360,AliTRDgeometry::Nsect(),4);
403 rmin = AliTRDgeometry::Rmin();
404 rmax = AliTRDgeometry::Rmax();
405 pgon->DefineSection(0,-AliTRDgeometry::Zmax1(),rmax,rmax);
406 pgon->DefineSection(1,-AliTRDgeometry::Zmax2(),rmin,rmax);
407 pgon->DefineSection(2, AliTRDgeometry::Zmax2(),rmin,rmax);
408 pgon->DefineSection(3, AliTRDgeometry::Zmax1(),rmax,rmax);
410 node = new TNode("TRD","TRD","S_TRD",0,0,0,"");
411 node->SetLineColor(kColorTRD);
418 Float_t slope = (AliTRDgeometry::Zmax1() - AliTRDgeometry::Zmax2())
419 / (AliTRDgeometry::Rmax() - AliTRDgeometry::Rmin());
421 rmin = AliTRDgeometry::Rmin() + AliTRDgeometry::RaThick();
422 rmax = rmin + AliTRDgeometry::DrThick();
423 zmax2 = AliTRDgeometry::Zmax2() + slope * AliTRDgeometry::RaThick();
424 zmax1 = zmax2 + slope * AliTRDgeometry::DrThick();
427 for (Int_t iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) {
429 sprintf(name,"S_TRD%d",iPlan);
430 pgon = new TPGON(name,"TRD","void",0,360,AliTRDgeometry::Nsect(),4);
431 pgon->DefineSection(0,-zmax1,rmax,rmax);
432 pgon->DefineSection(1,-zmax2,rmin,rmax);
433 pgon->DefineSection(2, zmax2,rmin,rmax);
434 pgon->DefineSection(3, zmax1,rmax,rmax);
436 node = new TNode("TRD","TRD",name,0,0,0,"");
437 node->SetLineColor(kColorTRD);
440 Float_t height = AliTRDgeometry::Cheight() + AliTRDgeometry::Cspace();
441 rmin = rmin + height;
442 rmax = rmax + height;
443 zmax1 = zmax1 + slope * height;
444 zmax2 = zmax2 + slope * height;
454 //_____________________________________________________________________________
455 void AliTRD::Copy(TObject &trd)
461 ((AliTRD &) trd).fGasMix = fGasMix;
462 ((AliTRD &) trd).fGeometry = fGeometry;
463 ((AliTRD &) trd).fRecPoints = fRecPoints;
464 ((AliTRD &) trd).fNRecPoints = fNRecPoints;
465 ((AliTRD &) trd).fGasDensity = fGasDensity;
466 ((AliTRD &) trd).fFoilDensity = fFoilDensity;
467 ((AliTRD &) trd).fDrawTR = fDrawTR;
468 ((AliTRD &) trd).fDisplayType = fDisplayType;
470 //AliDetector::Copy(trd);
474 //_____________________________________________________________________________
475 void AliTRD::CreateGeometry()
478 // Creates the volumes for the TRD chambers
481 // Check that FRAME is there otherwise we have no place where to put the TRD
482 AliModule* frame = gAlice->GetModule("FRAME");
484 printf(" The TRD needs the FRAME to be defined first\n");
488 fGeometry->CreateGeometry(fIdtmed->GetArray() - 1299);
492 //_____________________________________________________________________________
493 void AliTRD::CreateMaterials()
496 // Create the materials for the TRD
500 Int_t isxfld = gAlice->Field()->Integ();
501 Float_t sxmgmx = gAlice->Field()->Max();
503 // For polyethilene (CH2)
504 Float_t ape[2] = { 12., 1. };
505 Float_t zpe[2] = { 6., 1. };
506 Float_t wpe[2] = { 1., 2. };
509 // For mylar (C5H4O2)
510 Float_t amy[3] = { 12., 1., 16. };
511 Float_t zmy[3] = { 6., 1., 8. };
512 Float_t wmy[3] = { 5., 4., 2. };
516 Float_t aco[2] = { 12., 16. };
517 Float_t zco[2] = { 6., 8. };
518 Float_t wco[2] = { 1., 2. };
519 Float_t dco = 0.001977;
522 Float_t awa[2] = { 1., 16. };
523 Float_t zwa[2] = { 1., 8. };
524 Float_t wwa[2] = { 2., 1. };
527 // For isobutane (C4H10)
528 Float_t ais[2] = { 12., 1. };
529 Float_t zis[2] = { 6., 1. };
530 Float_t wis[2] = { 4., 10. };
531 Float_t dis = 0.00267;
533 // For Xe/CO2-gas-mixture
534 // Xe-content of the Xe/CO2-mixture (90% / 10%)
536 // Xe-content of the Xe/Isobutane-mixture (97% / 3%)
538 Float_t dxe = .005858;
540 // General tracking parameter
541 Float_t tmaxfd = -10.;
542 Float_t stemax = -1e10;
543 Float_t deemax = -0.1;
544 Float_t epsil = 1e-4;
545 Float_t stmin = -0.001;
547 Float_t absl, radl, d, buf[1];
548 Float_t agm[2], zgm[2], wgm[2];
552 //////////////////////////////////////////////////////////////////////////
554 //////////////////////////////////////////////////////////////////////////
556 AliMaterial( 1, "Al $", 26.98, 13.0, 2.7 , 8.9 , 37.2);
557 AliMaterial( 2, "Air$", 14.61, 7.3, 0.001205, 30420.0 , 67500.0);
558 AliMaterial( 4, "Xe $", 131.29, 54.0, dxe , 1447.59, 0.0);
559 AliMaterial( 5, "Cu $", 63.54, 29.0, 8.96 , 1.43, 14.8);
560 AliMaterial( 6, "C $", 12.01, 6.0, 2.265 , 18.8 , 74.4);
561 AliMaterial(12, "G10$", 20.00, 10.0, 1.7 , 19.4 , 999.0);
564 AliMixture(3, "Polyethilene$", ape, zpe, dpe, -2, wpe);
565 AliMixture(7, "Mylar$", amy, zmy, dmy, -3, wmy);
566 AliMixture(8, "CO2$", aco, zco, dco, -2, wco);
567 AliMixture(9, "Isobutane$", ais, zis, dis, -2, wis);
568 AliMixture(13,"Water$", awa, zwa, dwa, -2, wwa);
573 // Get properties of Xe
574 gMC->Gfmate((*fIdmate)[4], namate, agm[0], zgm[0], d, radl, absl, buf, nbuf);
575 // Get properties of CO2
576 gMC->Gfmate((*fIdmate)[8], namate, agm[1], zgm[1], d, radl, absl, buf, nbuf);
577 // Create gas mixture
580 dgm1 = wgm[0] * dxe + wgm[1] * dco;
581 AliMixture(10, "Gas mixture 1$", agm, zgm, dgm1, 2, wgm);
582 // Xe/Isobutane-mixture
583 // Get properties of Xe
584 gMC->Gfmate((*fIdmate)[4], namate, agm[0], zgm[0], d, radl, absl, buf, nbuf);
585 // Get properties of Isobutane
586 gMC->Gfmate((*fIdmate)[9], namate, agm[1], zgm[1], d, radl, absl, buf, nbuf);
587 // Create gas mixture
590 dgm2 = wgm[0] * dxe + wgm[1] * dis;
591 AliMixture(11, "Gas mixture 2$", agm, zgm, dgm2, 2, wgm);
593 //////////////////////////////////////////////////////////////////////////
594 // Tracking Media Parameters
595 //////////////////////////////////////////////////////////////////////////
598 AliMedium(1, "Al Frame$", 1, 0, isxfld, sxmgmx
599 , tmaxfd, stemax, deemax, epsil, stmin);
601 AliMedium(2, "Air$", 2, 0, isxfld, sxmgmx
602 , tmaxfd, stemax, deemax, epsil, stmin);
604 AliMedium(3, "Radiator$", 3, 0, isxfld, sxmgmx
605 , tmaxfd, stemax, deemax, epsil, stmin);
607 AliMedium(4, "Xe$", 4, 1, isxfld, sxmgmx
608 , tmaxfd, stemax, deemax, epsil, stmin);
610 AliMedium(5, "Padplane$", 5, 1, isxfld, sxmgmx
611 , tmaxfd, stemax, deemax, epsil, stmin);
613 AliMedium(6, "Readout$", 1, 0, isxfld, sxmgmx
614 , tmaxfd, stemax, deemax, epsil, stmin);
616 AliMedium(7, "C Frame$", 6, 0, isxfld, sxmgmx
617 , tmaxfd, stemax, deemax, epsil, stmin);
619 AliMedium(8, "Mylar$", 7, 0, isxfld, sxmgmx
620 , tmaxfd, stemax, deemax, epsil, stmin);
622 // Gas-mixture (Xe/CO2)
623 AliMedium(9, "Gas-mix$", 10, 1, isxfld, sxmgmx
624 , tmaxfd, stemax, deemax, epsil, stmin);
627 // Gas-mixture (Xe/Isobutane)
628 AliMedium(9, "Gas-mix$", 11, 1, isxfld, sxmgmx
629 , tmaxfd, stemax, deemax, epsil, stmin);
631 // Nomex-honeycomb (use carbon for the time being)
632 AliMedium(10, "Nomex$", 6, 0, isxfld, sxmgmx
633 , tmaxfd, stemax, deemax, epsil, stmin);
634 // Kapton foils (use Mylar for the time being)
635 AliMedium(11, "Kapton$", 7, 0, isxfld, sxmgmx
636 , tmaxfd, stemax, deemax, epsil, stmin);
637 // Gas-filling of the radiator
638 AliMedium(12, "CO2$", 8, 0, isxfld, sxmgmx
639 , tmaxfd, stemax, deemax, epsil, stmin);
641 AliMedium(13, "G10-plates$",12, 0, isxfld, sxmgmx
642 , tmaxfd, stemax, deemax, epsil, stmin);
644 AliMedium(14, "Water$", 13, 0, isxfld, sxmgmx
645 , tmaxfd, stemax, deemax, epsil, stmin);
647 // Save the density values for the TRD absorbtion
656 //_____________________________________________________________________________
657 void AliTRD::DrawModule()
660 // Draw a shaded view of the Transition Radiation Detector version 0
663 // Set everything unseen
664 gMC->Gsatt("*" ,"SEEN",-1);
666 // Set ALIC mother transparent
667 gMC->Gsatt("ALIC","SEEN", 0);
669 // Set the volumes visible
670 if (fGeometry->IsVersion() == 0) {
671 gMC->Gsatt("B071","SEEN", 0);
672 gMC->Gsatt("B074","SEEN", 0);
673 gMC->Gsatt("B075","SEEN", 0);
674 gMC->Gsatt("B077","SEEN", 0);
675 gMC->Gsatt("BTR1","SEEN", 0);
676 gMC->Gsatt("BTR2","SEEN", 0);
677 gMC->Gsatt("BTR3","SEEN", 0);
678 gMC->Gsatt("TRD1","SEEN", 0);
679 gMC->Gsatt("TRD2","SEEN", 0);
680 gMC->Gsatt("TRD3","SEEN", 0);
683 gMC->Gsatt("B071","SEEN", 0);
684 gMC->Gsatt("B074","SEEN", 0);
685 gMC->Gsatt("B075","SEEN", 0);
686 gMC->Gsatt("B077","SEEN", 0);
687 gMC->Gsatt("BTR1","SEEN", 0);
688 gMC->Gsatt("BTR2","SEEN", 0);
689 gMC->Gsatt("BTR3","SEEN", 0);
690 gMC->Gsatt("TRD1","SEEN", 0);
691 if (fGeometry->GetPHOShole())
692 gMC->Gsatt("TRD2","SEEN", 0);
693 if (fGeometry->GetRICHhole())
694 gMC->Gsatt("TRD3","SEEN", 0);
696 gMC->Gsatt("UCII","SEEN", 0);
697 gMC->Gsatt("UCIM","SEEN", 0);
698 gMC->Gsatt("UCIO","SEEN", 0);
699 gMC->Gsatt("UL02","SEEN", 1);
700 gMC->Gsatt("UL05","SEEN", 1);
701 gMC->Gsatt("UL06","SEEN", 1);
703 gMC->Gdopt("hide", "on");
704 gMC->Gdopt("shad", "on");
705 gMC->Gsatt("*", "fill", 7);
706 gMC->SetClipBox(".");
707 gMC->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 2000);
709 gMC->Gdraw("alic", 40, 30, 0, 12, 9.4, .021, .021);
710 gMC->Gdhead(1111, "Transition Radiation Detector");
711 gMC->Gdman(18, 4, "MAN");
715 //_____________________________________________________________________________
716 Int_t AliTRD::DistancetoPrimitive(Int_t , Int_t )
719 // Distance between the mouse and the TRD detector on the screen
726 //_____________________________________________________________________________
730 // Initialize the TRD detector after the geometry has been created
736 for (i = 0; i < 35; i++) printf("*");
737 printf(" TRD_INIT ");
738 for (i = 0; i < 35; i++) printf("*");
742 if (fGeometry->IsVersion() == 0) {
743 printf(" Geometry for spaceframe with holes initialized.\n\n");
745 else if (fGeometry->IsVersion() == 1) {
746 printf(" Geometry for spaceframe without holes initialized.\n");
747 if (fGeometry->GetPHOShole())
748 printf(" Leave space in front of PHOS free.\n");
749 if (fGeometry->GetRICHhole())
750 printf(" Leave space in front of RICH free.\n");
755 printf(" Gas Mixture: 90%% Xe + 10%% CO2\n\n");
757 printf(" Gas Mixture: 97%% Xe + 3%% Isobutane\n\n");
761 //_____________________________________________________________________________
762 void AliTRD::LoadPoints(Int_t track)
765 // Store x, y, z of all hits in memory.
766 // Hit originating from TR photons are given a different color
770 AliDetector::LoadPoints(track);
774 if (fHits == 0) return;
776 Int_t nhits = fHits->GetEntriesFast();
777 if (nhits == 0) return;
779 Int_t tracks = gAlice->GetNtrack();
780 if (fPoints == 0) fPoints = new TObjArray(tracks);
784 Int_t *ntrkE = new Int_t[tracks];
785 Int_t *ntrkT = new Int_t[tracks];
786 Int_t *limiE = new Int_t[tracks];
787 Int_t *limiT = new Int_t[tracks];
788 Float_t **coorE = new Float_t*[tracks];
789 Float_t **coorT = new Float_t*[tracks];
790 for(Int_t i = 0; i < tracks; i++) {
799 AliTRDpoints *points = 0;
802 Int_t chunk = nhits / 4 + 1;
804 // Loop over all the hits and store their position
805 for (Int_t hit = 0; hit < nhits; hit++) {
807 ahit = (AliTRDhit *) fHits->UncheckedAt(hit);
810 if (ahit->GetCharge() >= 0) {
812 trk = ahit->GetTrack();
813 if (ntrkE[trk] == limiE[trk]) {
814 // Initialise a new track
815 fp = new Float_t[3*(limiE[trk]+chunk)];
817 memcpy(fp,coorE[trk],sizeof(Float_t)*3*limiE[trk]);
818 delete [] coorE[trk];
826 fp[3*ntrkE[trk] ] = ahit->X();
827 fp[3*ntrkE[trk]+1] = ahit->Y();
828 fp[3*ntrkE[trk]+2] = ahit->Z();
835 trk = ahit->GetTrack();
836 if (ntrkT[trk] == limiT[trk]) {
837 // Initialise a new track
838 fp = new Float_t[3*(limiT[trk]+chunk)];
840 memcpy(fp,coorT[trk],sizeof(Float_t)*3*limiT[trk]);
841 delete [] coorT[trk];
849 fp[3*ntrkT[trk] ] = ahit->X();
850 fp[3*ntrkT[trk]+1] = ahit->Y();
851 fp[3*ntrkT[trk]+2] = ahit->Z();
858 for (trk = 0; trk < tracks; ++trk) {
860 if (ntrkE[trk] || ntrkT[trk]) {
862 points = new AliTRDpoints();
863 points->SetDetector(this);
864 points->SetParticle(trk);
866 // Set the dEdx points
868 points->SetMarkerColor(GetMarkerColor());
869 points->SetMarkerSize(GetMarkerSize());
870 points->SetPolyMarker(ntrkE[trk],coorE[trk],GetMarkerStyle());
871 delete [] coorE[trk];
875 // Set the TR photon points
877 points->SetTRpoints(ntrkT[trk],coorT[trk]);
878 delete [] coorT[trk];
882 fPoints->AddAt(points,trk);
897 //_____________________________________________________________________________
898 void AliTRD::MakeBranch(Option_t* option, char *file)
901 // Create Tree branches for the TRD digits and cluster.
904 //Int_t buffersize = 4000;
905 //Char_t branchname[15];
907 AliDetector::MakeBranch(option,file);
909 Int_t buffersize = 64000;
911 fDigitsArray = new AliTRDdataArrayI();
912 gAlice->MakeBranchInTree(gAlice->TreeD()
913 ,"TRDdigits", fDigitsArray->IsA()->GetName()
914 ,&fDigitsArray,buffersize,1,file);
916 for (Int_t iDict = 0; iDict < AliTRDdigitsManager::NDict(); iDict++) {
917 Char_t branchname[15];
918 sprintf(branchname,"TRDdictionary%d",iDict);
919 fDictionaryArray[iDict] = new AliTRDdataArrayI();
920 gAlice->MakeBranchInTree(gAlice->TreeD()
921 ,branchname,fDictionaryArray[iDict]->IsA()->GetName()
922 ,&fDictionaryArray[iDict],buffersize,1,file) ;
925 //Char_t *r = strstr(option,"R");
926 //sprintf(branchname,"%srecPoints",GetName());
927 //if (fRecPoints && gAlice->TreeR() && r) {
928 // MakeBranchInTree(gAlice->TreeR(),
929 // branchname, &fRecPoints,buffersize, file) ;
934 //_____________________________________________________________________________
935 void AliTRD::ResetDigits()
941 if (gAlice->TreeD()) {
943 branch = gAlice->TreeD()->GetBranch("TRDdigits");
946 for (Int_t iDict = 0; iDict < AliTRDdigitsManager::NDict(); iDict++) {
947 Char_t branchname[15];
948 sprintf(branchname,"TRDdictionary%d",iDict);
949 branch = gAlice->TreeD()->GetBranch(branchname);
957 //_____________________________________________________________________________
958 void AliTRD::ResetRecPoints()
961 // Reset number of reconstructed points and the point array
966 Int_t nentr = fRecPoints->GetEntriesFast();
967 for(Int_t i = 0; i < nentr; i++) delete fRecPoints->RemoveAt(i);
972 //_____________________________________________________________________________
973 void AliTRD::SetTreeAddress()
976 // Set the branch addresses for the trees.
979 Char_t branchname[15];
981 AliDetector::SetTreeAddress();
984 TTree *treeR = gAlice->TreeR();
987 sprintf(branchname,"%srecPoints",GetName());
989 branch = treeR->GetBranch(branchname);
991 branch->SetAddress(&fRecPoints);
998 //_____________________________________________________________________________
999 void AliTRD::SetGasMix(Int_t imix)
1002 // Defines the gas mixture (imix=0: Xe/Isobutane imix=1: Xe/CO2)
1005 if ((imix < 0) || (imix > 1)) {
1006 printf("Wrong input value: %d\n",imix);
1007 printf("Use standard setting\n");
1016 //_____________________________________________________________________________
1017 void AliTRD::SetPHOShole()
1020 // Selects a geometry with a hole in front of the PHOS
1023 fGeometry->SetPHOShole();
1027 //_____________________________________________________________________________
1028 void AliTRD::SetRICHhole()
1031 // Selects a geometry with a hole in front of the RICH
1034 fGeometry->SetRICHhole();
1038 //_____________________________________________________________________________
1039 AliTRD &AliTRD::operator=(const AliTRD &trd)
1042 // Assignment operator
1045 if (this != &trd) ((AliTRD &) trd).Copy(*this);