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.8 2000/07/10 13:58:01 fca
19 New version of ZDC from E.Scomparin & C.Oppedisano
21 Revision 1.7 2000/01/19 17:17:40 fca
23 Revision 1.6 1999/09/29 09:24:35 fca
24 Introduction of the Copyright and cvs Log
28 ///////////////////////////////////////////////////////////////////////////////
30 // Zero Degree Calorimeter //
31 // This class contains the basic functions for the Time Of Flight //
32 // detector. Functions specific to one particular geometry are //
33 // contained in the derived classes //
35 ///////////////////////////////////////////////////////////////////////////////
39 #include "TGeometry.h"
43 #include "AliCallf77.h"
50 //_____________________________________________________________________________
54 // Default constructor for the Zero Degree Calorimeter base class
60 //_____________________________________________________________________________
61 AliZDC::AliZDC(const char *name, const char *title)
62 : AliDetector(name,title)
65 // Standard constructor for the Zero Degree Calorimeter base class
69 // Allocate the array of hits
70 fHits = new TClonesArray("AliZDChit", 405);
71 gAlice->AddHitList(fHits);
111 //_____________________________________________________________________________
112 void AliZDC::AddHit(Int_t track, Int_t *vol, Float_t *hits)
117 static Float_t primKinEn, xImpact, yImpact, sFlag;
119 TClonesArray &lhits = *fHits;
121 AliZDChit *newquad, *curquad;
122 newquad = new AliZDChit(fIshunt, track, vol, hits);
124 for(i=0; i<fNhits; i++){
125 // If the hits are equal (same track, same volume), sum them.
126 curquad=(AliZDChit*) lhits[i];
127 if(*curquad==*newquad){
128 *curquad = *curquad+*newquad;
135 //Otherwise create a new hit.
137 // First hit -> setting flag for primary or secondary particle
138 Int_t primary = gAlice->GetPrimary(track);
139 if(track != primary){
140 newquad->fSFlag = 1; // Hit created by secondary particle entering the ZDC
142 else if(track == primary){
143 newquad->fSFlag = 0; // Hit created by PRIMARY particle entering the ZDC
145 sFlag = newquad->fSFlag;
146 primKinEn = newquad->fPrimKinEn;
147 xImpact = newquad->fXImpact;
148 yImpact = newquad->fYImpact;
151 newquad->fPrimKinEn = primKinEn;
152 newquad->fXImpact = xImpact;
153 newquad->fYImpact = yImpact;
154 newquad->fSFlag = sFlag;
156 new(lhits[fNhits++]) AliZDChit(newquad);
158 // Int_t Curtrack = gAlice->CurrentTrack();
159 // Int_t Prim = gAlice->GetPrimary(Curtrack);
160 // printf (" Primary track: %d, Current track: %d \n",
169 //_____________________________________________________________________________
170 void AliZDC::BuildGeometry()
173 // Build the ROOT TNode geometry for event display
174 // in the Zero Degree Calorimeter
175 // This routine is dummy for the moment
180 const int kColorZDC = kRed;
183 top=gAlice->GetGeometry()->GetNode("alice");
186 brik = new TBRIK("S_ZDC","ZDC box","void",300,300,5);
188 node = new TNode("ZDC","ZDC","S_ZDC",0,0,600,"");
189 node->SetLineColor(kColorZDC);
193 //_____________________________________________________________________________
194 Int_t AliZDC::DistancetoPrimitive(Int_t , Int_t )
197 // Distance from the mouse to the Zero Degree Calorimeter
203 //_____________________________________________________________________________
204 void AliZDC::StepManager()
207 // Routine called at every step in the Zero Degree Calorimeter
213 //_____________________________________________________________________________
214 AliZDChit::AliZDChit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
221 for(i=0; i<2; i++) fVolume[i] = vol[i];
225 fPrimKinEn = hits[3];