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.7 2000/01/19 17:17:40 fca
20 Revision 1.6 1999/09/29 09:24:35 fca
21 Introduction of the Copyright and cvs Log
25 ///////////////////////////////////////////////////////////////////////////////
27 // Zero Degree Calorimeter //
28 // This class contains the basic functions for the Time Of Flight //
29 // detector. Functions specific to one particular geometry are //
30 // contained in the derived classes //
32 ///////////////////////////////////////////////////////////////////////////////
39 #include "AliCallf77.h"
46 //_____________________________________________________________________________
50 // Default constructor for the Zero Degree Calorimeter base class
56 //_____________________________________________________________________________
57 AliZDC::AliZDC(const char *name, const char *title)
58 : AliDetector(name,title)
61 // Standard constructor for the Zero Degree Calorimeter base class
65 // Allocate the array of hits
66 fHits = new TClonesArray("AliZDChit", 405);
67 gAlice->AddHitList(fHits);
107 //_____________________________________________________________________________
108 void AliZDC::AddHit(Int_t track, Int_t *vol, Float_t *hits)
113 static Float_t primKinEn, xImpact, yImpact, sFlag;
115 TClonesArray &lhits = *fHits;
117 AliZDChit *newquad, *curquad;
118 newquad = new AliZDChit(fIshunt, track, vol, hits);
120 for(i=0; i<fNhits; i++){
121 // If the hits are equal (same track, same volume), sum them.
122 curquad=(AliZDChit*) lhits[i];
123 if(*curquad==*newquad){
124 *curquad = *curquad+*newquad;
131 //Otherwise create a new hit.
133 // First hit -> setting flag for primary or secondary particle
134 Int_t primary = gAlice->GetPrimary(track);
135 if(track != primary){
136 newquad->fSFlag = 1; // Hit created by secondary particle entering the ZDC
138 else if(track == primary){
139 newquad->fSFlag = 0; // Hit created by PRIMARY particle entering the ZDC
141 sFlag = newquad->fSFlag;
142 primKinEn = newquad->fPrimKinEn;
143 xImpact = newquad->fXImpact;
144 yImpact = newquad->fYImpact;
147 newquad->fPrimKinEn = primKinEn;
148 newquad->fXImpact = xImpact;
149 newquad->fYImpact = yImpact;
150 newquad->fSFlag = sFlag;
152 new(lhits[fNhits++]) AliZDChit(newquad);
154 // Int_t Curtrack = gAlice->CurrentTrack();
155 // Int_t Prim = gAlice->GetPrimary(Curtrack);
156 // printf (" Primary track: %d, Current track: %d \n",
165 //_____________________________________________________________________________
166 void AliZDC::BuildGeometry()
169 // Build the ROOT TNode geometry for event display
170 // in the Zero Degree Calorimeter
171 // This routine is dummy for the moment
176 const int kColorZDC = kRed;
179 top=gAlice->GetGeometry()->GetNode("alice");
182 brik = new TBRIK("S_ZDC","ZDC box","void",300,300,5);
184 node = new TNode("ZDC","ZDC","S_ZDC",0,0,600,"");
185 node->SetLineColor(kColorZDC);
189 //_____________________________________________________________________________
190 Int_t AliZDC::DistancetoPrimitive(Int_t , Int_t )
193 // Distance from the mouse to the Zero Degree Calorimeter
199 //_____________________________________________________________________________
200 void AliZDC::StepManager()
203 // Routine called at every step in the Zero Degree Calorimeter
209 //_____________________________________________________________________________
210 AliZDChit::AliZDChit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
217 for(i=0; i<2; i++) fVolume[i] = vol[i];
221 fPrimKinEn = hits[3];