Switch for cooling fluid implemented. Mother volumes modified according with the...
[u/mrichter/AliRoot.git] / FMD / AliFMD.cxx
CommitLineData
4c039060 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
d28dcc0d 15 //////////////////////////////////////////////////////////////////////////////
fe4da5cc 16// //
d28dcc0d 17// Forward Multiplicity Detector based on Silicon plates //
fe4da5cc 18// This class contains the base procedures for the Forward Multiplicity //
19// detector //
d28dcc0d 20// Detector consists of 6 Si volumes covered pseudorapidity interval //
21// from 1.6 to 6.0. //
fe4da5cc 22// //
23//Begin_Html
24/*
d28dcc0d 25<img src="gif/AliFMDClass.gif">
fe4da5cc 26</pre>
27<br clear=left>
28<font size=+2 color=red>
29<p>The responsible person for this module is
d28dcc0d 30<a href="mailto:Alla.Maevskaia@cern.ch">Alla Maevskaia</a>.
fe4da5cc 31</font>
32<pre>
33*/
34//End_Html
35// //
36// //
37///////////////////////////////////////////////////////////////////////////////
38
39#include <TTUBE.h>
40#include <TNode.h>
94de3818 41#include <TGeometry.h>
d28dcc0d 42#include <TTree.h>
fe4da5cc 43#include "AliRun.h"
d28dcc0d 44#include "AliMC.h"
fe4da5cc 45#include "AliFMD.h"
d28dcc0d 46#include "AliFMDhit.h"
47
fe4da5cc 48ClassImp(AliFMD)
49
50//_____________________________________________________________________________
51AliFMD::AliFMD(): AliDetector()
52{
53 //
54 // Default constructor for class AliFMD
55 //
56 fIshunt = 0;
57}
58
59//_____________________________________________________________________________
60AliFMD::AliFMD(const char *name, const char *title)
61 : AliDetector(name,title)
62{
63 //
64 // Standard constructor for Forward Multiplicity Detector
65 //
66
67 //
68 // Initialise Hit array
d28dcc0d 69 fHits = new TClonesArray("AliFMDhit", 1000);
d1280e40 70 gAlice->AddHitList(fHits);
71
fe4da5cc 72 fIshunt = 0;
d28dcc0d 73 fIdSens1 = 0;
74
75 SetMarkerColor(kRed);
fe4da5cc 76}
77
d28dcc0d 78
79AliFMD::~AliFMD()
80{
81 delete fHits;
82}
fe4da5cc 83//_____________________________________________________________________________
84void AliFMD::AddHit(Int_t track, Int_t *vol, Float_t *hits)
85{
86 //
d28dcc0d 87 // Add a hit to the list
fe4da5cc 88 //
89 TClonesArray &lhits = *fHits;
90 new(lhits[fNhits++]) AliFMDhit(fIshunt,track,vol,hits);
91}
fe4da5cc 92//_____________________________________________________________________________
93void AliFMD::BuildGeometry()
94{
95 //
96 // Build simple ROOT TNode geometry for event display
97 //
d28dcc0d 98 TNode *node, *top;
fe4da5cc 99 const int kColorFMD = 7;
100 //
d28dcc0d 101 top=gAlice->GetGeometry()->GetNode("alice");
fe4da5cc 102
103 // FMD define the different volumes
d28dcc0d 104 new TRotMatrix("rot901","rot901", 90, 0, 90, 90, 180, 0);
105
106 new TTUBE("S_FMD0","FMD volume 0","void",4.73,17.7,1.5);
107 top->cd();
108 node = new TNode("FMD0","FMD0","S_FMD0",0,0,64,"");
109 node->SetLineColor(kColorFMD);
110 fNodes->Add(node);
111
112 new TTUBE("S_FMD1","FMD volume 1","void",23.4,36.,1.5);
113 top->cd();
114 node = new TNode("FMD1","FMD1","S_FMD1",0,0,85,"");
115 node->SetLineColor(kColorFMD);
116 fNodes->Add(node);
fe4da5cc 117
d28dcc0d 118 new TTUBE("S_FMD2","FMD volume 2","void",4.73,17.7,1.5);
119 top->cd();
120 node = new TNode("FMD2","FMD2","S_FMD2",0,0,-64,"");
121 node->SetLineColor(kColorFMD);
122 fNodes->Add(node);
123
124 new TTUBE("S_FMD3","FMD volume 3","void",23.4,36.,1.5);
125 top->cd();
126 node = new TNode("FMD3","FMD3","S_FMD3",0,0,-85,"");
127 node->SetLineColor(kColorFMD);
128 fNodes->Add(node);
129
130 new TTUBE("S_FMD4","FMD volume 4","void",5,15,0.015);
131 top->cd();
132 node = new TNode("FMD4","FMD4","S_FMD4",0,0,-270,"");
133 node->SetLineColor(kColorFMD);
134 fNodes->Add(node);
fe4da5cc 135
fe4da5cc 136
d28dcc0d 137 new TTUBE("S_FMD5","FMD volume 5","void",5,14,0.015);
138 top->cd();
139 node = new TNode("FMD5","FMD5","S_FMD5",0,0,-630,"");
140 node->SetLineColor(kColorFMD);
141 fNodes->Add(node);
142
fe4da5cc 143}
144
145//_____________________________________________________________________________
d28dcc0d 146Int_t AliFMD::DistanceToPrimitive(Int_t px, Int_t py)
fe4da5cc 147{
148 //
149 // Calculate the distance from the mouse to the FMD on the screen
150 // Dummy routine
151 //
152 return 9999;
153}
154
155//_____________________________________________________________________________
fe4da5cc 156
d28dcc0d 157//-------------------------------------------------------------------------
fe4da5cc 158void AliFMD::Init()
159{
160 //
161 // Initialis the FMD after it has been built
162 Int_t i;
d28dcc0d 163 AliMC* pMC = AliMC::GetMC();
fe4da5cc 164 //
165 printf("\n");
166 for(i=0;i<35;i++) printf("*");
167 printf(" FMD_INIT ");
168 for(i=0;i<35;i++) printf("*");
169 printf("\n");
170 //
171 // Here the FMD initialisation code (if any!)
172 for(i=0;i<80;i++) printf("*");
173 printf("\n");
d28dcc0d 174 //
175 //
176 fIdSens1=pMC->VolId("GFSI"); //Si sensetive volume
177
fe4da5cc 178}
d28dcc0d 179//---------------------------------------------------------------------
180void AliFMD::MakeBranch(Option_t* option)
181{
182 // Create Tree branches for the FMD.
183 Int_t buffersize = 4000;
184 char branchname[10];
185 sprintf(branchname,"%s",GetName());
fe4da5cc 186
d28dcc0d 187 AliDetector::MakeBranch(option);
188
189 if (fDigits && gAlice->TreeD()) {
190 gAlice->TreeD()->Branch(branchname,&fDigits, buffersize);
191 printf("Making Branch %s for digits\n",branchname);
192 }
193}
fe4da5cc 194
d28dcc0d 195//---------------------------------------------------------------------
196
197void AliFMD::Eta2Radius(Float_t eta, Float_t zDisk, Float_t *radius)
fe4da5cc 198{
d28dcc0d 199 Float_t expEta=TMath::Exp(-eta);
200 Float_t theta=TMath::ATan(expEta);
201 theta=2.*theta;
202 Float_t rad=zDisk*(TMath::Tan(theta));
203 *radius=rad;
204
205 printf(" eta %f radius %f\n", eta, rad);
fe4da5cc 206}
207
d28dcc0d 208
209
210
211