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 **************************************************************************/
20 /////////////////////////////////////////////////////////
21 // Manager and hits classes for set:CPV version 0 //
24 // Author: Yuri Kharlov, IHEP, Protvino //
25 // e-mail: Yuri.Kharlov@cern.ch //
26 // Last modified: 17 September 1999 //
27 /////////////////////////////////////////////////////////
29 // --- ROOT system ---
37 // --- galice header files ---
44 //==============================================================================
46 //==============================================================================
52 //______________________________________________________________________________
54 AliCPVv0::AliCPVv0(const char *name, const char *title)
59 //______________________________________________________________________________
61 void AliCPVv0::CreateGeometry()
64 AliCPV *CPV_tmp = (AliCPV*)gAlice->GetModule("CPV");
67 printf("There isn't CPV detector!\n");
71 Int_t rotation_matrix_number=0;
77 par[0] = GetPadZSize() / 2 * GetNz();
78 par[1] = GetPadPhiSize() / 2 * GetNphi();
79 par[2] = GetThickness() / 2;
80 gMC->Gsvolu("CPV","BOX ",GetCPVIdtmed(),par,3);
82 for( Int_t i=0; i<GetNofCradles(); i++ )
84 Float_t cradle_angle_pos = -90+(i-(GetNofCradles()-1)/2.) * GetAngle();
86 // Cradles are numerated in clock reversed order. (general way of angle increment)
88 Float_t r = GetRadius() + GetThickness()/2;
89 x = r*cos(cradle_angle_pos*kPI/180);
90 y = r*sin(cradle_angle_pos*kPI/180);
92 AliMatrix(rotation_matrix_number, 0,0 , 90,90+cradle_angle_pos , 90,180+cradle_angle_pos);
93 gMC->Gspos("CPV",i+1,"ALIC",x,y,z,rotation_matrix_number,"ONLY");
99 //______________________________________________________________________________
101 void AliCPVv0::StepManager()
104 // if( gMC->IsTrackEntering() ) {
105 // const char *VolumeName = gMC->CurrentVolName();
106 // cout << "AliCPVv0::StepManager() entered to CPV to the volume "
107 // << VolumeName << "!\n";
110 if( strcmp(gMC->CurrentVolName(),"CPV ")==0 && gMC->IsTrackEntering() )
112 // GEANT particle just have entered into CPV detector.
114 AliCPV &CPV = *(AliCPV*)gAlice->GetModule("CPV");
117 gMC->CurrentVolOffID(0,CradleNumber);
119 AliCPVCradle &cradle = CPV.GetCradle(CradleNumber);
121 // Current position of the hit in the cradle ref. system
124 gMC -> TrackPosition(xyzt);
125 Float_t xyzm[3], xyzd[3], xyd[2];
126 for (Int_t i=0; i<3; i++) xyzm[i] = xyzt[i];
127 gMC -> Gmtod (xyzm, xyzd, 1);
128 for (Int_t i=0; i<2; i++) xyd[i] = xyzd[i];
130 // Current momentum of the hit's track in the MARS ref. system
133 gMC -> TrackMomentum(pmom);
134 Int_t ipart = gMC->TrackPid();
136 // Store current particle in the list of Cradle particles.
137 cradle.AddHit(pmom,xyd,ipart);
139 // if (gMC->TrackCharge()!=0.) CPV.Reconstruction(0,0);