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.9 2000/10/02 21:28:20 fca
19 Removal of useless dependecies via forward declarations
21 Revision 1.8 2000/07/10 13:58:01 fca
22 New version of ZDC from E.Scomparin & C.Oppedisano
24 Revision 1.7 2000/01/19 17:17:40 fca
26 Revision 1.6 1999/09/29 09:24:35 fca
27 Introduction of the Copyright and cvs Log
31 ///////////////////////////////////////////////////////////////////////////////
33 // Zero Degree Calorimeter //
34 // This class contains the basic functions for the Time Of Flight //
35 // detector. Functions specific to one particular geometry are //
36 // contained in the derived classes //
38 ///////////////////////////////////////////////////////////////////////////////
42 #include "TGeometry.h"
46 #include "AliCallf77.h"
53 //_____________________________________________________________________________
57 // Default constructor for the Zero Degree Calorimeter base class
63 //_____________________________________________________________________________
64 AliZDC::AliZDC(const char *name, const char *title)
65 : AliDetector(name,title)
68 // Standard constructor for the Zero Degree Calorimeter base class
72 // Allocate the array of hits
73 fHits = new TClonesArray("AliZDChit", 405);
74 gAlice->AddHitList(fHits);
114 fDimZEMPb = 0.15*(TMath::Sqrt(2.));
120 fDimZEM[0] = 2*fDivZEM[2]*(fDimZEMPb+fDimZEMAir+fFibRadZEM*(TMath::Sqrt(2.)));
128 fFibZEM[2] = fDimZEM[2]/TMath::Sin(fDimZEM[3]*kDegrad)-fFibRadZEM;
134 //____________________________________________________________________________
144 //_____________________________________________________________________________
145 void AliZDC::AddHit(Int_t track, Int_t *vol, Float_t *hits)
150 static Float_t primKinEn, xImpact, yImpact, sFlag;
152 TClonesArray &lhits = *fHits;
154 AliZDChit *newquad, *curquad;
155 newquad = new AliZDChit(fIshunt, track, vol, hits);
157 for(i=0; i<fNhits; i++){
158 // If the hits are equal (same track, same volume), sum them.
159 curquad=(AliZDChit*) lhits[i];
160 if(*curquad==*newquad){
161 *curquad = *curquad+*newquad;
168 //Otherwise create a new hit.
170 // First hit -> setting flag for primary or secondary particle
171 Int_t primary = gAlice->GetPrimary(track);
172 if(track != primary){
173 newquad->fSFlag = 1; // Hit created by secondary particle entering the ZDC
175 else if(track == primary){
176 newquad->fSFlag = 0; // Hit created by PRIMARY particle entering the ZDC
178 sFlag = newquad->fSFlag;
179 primKinEn = newquad->fPrimKinEn;
180 xImpact = newquad->fXImpact;
181 yImpact = newquad->fYImpact;
184 newquad->fPrimKinEn = primKinEn;
185 newquad->fXImpact = xImpact;
186 newquad->fYImpact = yImpact;
187 newquad->fSFlag = sFlag;
191 new(lhits[fNhits++]) AliZDChit(newquad);
195 //_____________________________________________________________________________
196 void AliZDC::ResetHits()
199 // Reset number of hits and the hits array
201 AliDetector::ResetHits();
203 //_____________________________________________________________________________
204 void AliZDC::BuildGeometry()
207 // Build the ROOT TNode geometry for event display
208 // in the Zero Degree Calorimeter
209 // This routine is dummy for the moment
214 const int kColorZDC = kRed;
217 top=gAlice->GetGeometry()->GetNode("alice");
220 brik = new TBRIK("S_ZDC","ZDC box","void",300,300,5);
222 node = new TNode("ZDC","ZDC","S_ZDC",0,0,600,"");
223 node->SetLineColor(kColorZDC);
227 //_____________________________________________________________________________
228 Int_t AliZDC::DistancetoPrimitive(Int_t , Int_t )
231 // Distance from the mouse to the Zero Degree Calorimeter
237 //_____________________________________________________________________________
238 void AliZDC::StepManager()
241 // Routine called at every step in the Zero Degree Calorimeter
247 //_____________________________________________________________________________
248 AliZDChit::AliZDChit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
255 for(i=0; i<2; i++) fVolume[i] = vol[i];
259 fPrimKinEn = hits[3];