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.2 1999/09/29 09:24:08 fca
19 Introduction of the Copyright and cvs Log
23 /////////////////////////////////////////////////////////
24 // Manager and hits classes for set:CPV version 0 //
27 // Author: Yuri Kharlov, IHEP, Protvino //
28 // e-mail: Yuri.Kharlov@cern.ch //
29 // Last modified: 17 September 1999 //
30 /////////////////////////////////////////////////////////
32 // --- ROOT system ---
40 // --- galice header files ---
47 //==============================================================================
49 //==============================================================================
55 //______________________________________________________________________________
57 AliCPVv0::AliCPVv0(const char *name, const char *title)
62 //______________________________________________________________________________
64 void AliCPVv0::CreateGeometry()
67 AliCPV *CPV_tmp = (AliCPV*)gAlice->GetModule("CPV");
70 printf("There isn't CPV detector!\n");
74 Int_t rotation_matrix_number=0;
80 par[0] = GetPadZSize() / 2 * GetNz();
81 par[1] = GetPadPhiSize() / 2 * GetNphi();
82 par[2] = GetThickness() / 2;
83 gMC->Gsvolu("CPV","BOX ",GetCPVIdtmed(),par,3);
85 for( Int_t i=0; i<GetNofCradles(); i++ )
87 Float_t cradle_angle_pos = -90+(i-(GetNofCradles()-1)/2.) * GetAngle();
89 // Cradles are numerated in clock reversed order. (general way of angle increment)
91 Float_t r = GetRadius() + GetThickness()/2;
92 x = r*cos(cradle_angle_pos*kPI/180);
93 y = r*sin(cradle_angle_pos*kPI/180);
95 AliMatrix(rotation_matrix_number, 0,0 , 90,90+cradle_angle_pos , 90,180+cradle_angle_pos);
96 gMC->Gspos("CPV",i+1,"ALIC",x,y,z,rotation_matrix_number,"ONLY");
102 //______________________________________________________________________________
104 void AliCPVv0::StepManager()
107 // if( gMC->IsTrackEntering() ) {
108 // const char *VolumeName = gMC->CurrentVolName();
109 // cout << "AliCPVv0::StepManager() entered to CPV to the volume "
110 // << VolumeName << "!\n";
115 if( strcmp(gMC->CurrentVolName(),"CPV ")==0 && gMC->IsTrackEntering() )
117 // GEANT particle just have entered into CPV detector.
119 AliCPV &CPV = *(AliCPV*)gAlice->GetModule("CPV");
122 gMC->CurrentVolOffID(0,CradleNumber);
124 AliCPVCradle &cradle = CPV.GetCradle(CradleNumber);
126 // Current position of the hit in the cradle ref. system
129 gMC -> TrackPosition(xyzt);
130 Float_t xyzm[3], xyzd[3], xyd[2];
131 for (i=0; i<3; i++) xyzm[i] = xyzt[i];
132 gMC -> Gmtod (xyzm, xyzd, 1);
133 for (i=0; i<2; i++) xyd[i] = xyzd[i];
135 // Current momentum of the hit's track in the MARS ref. system
138 gMC -> TrackMomentum(pmom);
139 Int_t ipart = gMC->TrackPid();
141 // Store current particle in the list of Cradle particles.
142 cradle.AddHit(pmom,xyd,ipart);
144 // if (gMC->TrackCharge()!=0.) CPV.Reconstruction(0,0);