]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/UPGRADE/AliITSDigitUpgrade.cxx
In AliMUONGeometryModuleTransformer:
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSDigitUpgrade.cxx
CommitLineData
1d9af2d5 1/**************************************************************************
2 * Copyright(c) 2004-2006, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* $Id$ */
17
18#include "AliITSDigitUpgrade.h"
19#include "AliITSsegmentationUpgrade.h"
20#include "AliLog.h"
21
22///////////////////////////////////////////////////////////////////
23// //
24// Class defining the digit object
25// for ITS upgrade
26// Inherits from AliDigit
27// //
28///////////////////////////////////////////////////////////////////
29
30ClassImp(AliITSDigitUpgrade)
31//______________________________________________________________________
32 AliITSDigitUpgrade::AliITSDigitUpgrade():AliDigit(),
33 fPixId(9999),
34 fSignal(0),
35 fNLayer(0),
0ac80088 36 fModule(0),
1d9af2d5 37 fNelectrons(0)
38{for(Int_t i=0; i<3 ; i++) fSignalID[i]=-1;} //default creator
39//_______________________________________________________________________
40AliITSDigitUpgrade::AliITSDigitUpgrade(Int_t *digits): AliDigit(digits),
41 fPixId(9999),
42 fSignal(0),
0ac80088 43 fNLayer(0),
44 fModule(0),
1d9af2d5 45 fNelectrons(0)
46{for(Int_t i=0; i<3 ; i++) fSignalID[i]=-1;} //standard creator digits only
47//____________________________________________________________________________________________________
48AliITSDigitUpgrade::AliITSDigitUpgrade(ULong_t pixid, Float_t eloss): AliDigit(),
49 fPixId(pixid),
50 fSignal(eloss),
51 fNLayer(0),
0ac80088 52 fModule(0),
1d9af2d5 53 fNelectrons(0)
54{for(Int_t i=0; i<3 ; i++) fSignalID[i]=-1;} //standard creator digits only
55//____________________________________________________________________________________________________
56AliITSDigitUpgrade::AliITSDigitUpgrade(const AliITSDigitUpgrade &d):AliDigit(d),
57 fPixId(d.fPixId),
58 fSignal(d.fSignal),
59 fNLayer(d.fNLayer),
0ac80088 60 fModule(d.fModule),
1d9af2d5 61 fNelectrons(d.fNelectrons)
62{for(Int_t i=0; i<3 ; i++) fSignalID[i]=d.fSignalID[i];} //copy constructor
63//____________________________________________________________________________________________________
64void AliITSDigitUpgrade::GetPosition(Int_t ilayer, Int_t nx, Int_t nz, Double_t &xloc, Double_t &zloc){
65 AliITSsegmentationUpgrade *s =new AliITSsegmentationUpgrade();
66 if(s->GetCellSizeX(ilayer)!=0) xloc= (nx)*(s->GetCellSizeX(ilayer))+0.5*(s->GetCellSizeX(ilayer));
67 else AliError("Upgrade segmentation not initalized");
68
69 if(s->GetCellSizeZ(ilayer)!=0)
70 zloc=(nz)*(s->GetCellSizeZ(ilayer))+0.5*(s->GetCellSizeZ(ilayer))-(s->GetHalfLength(ilayer));
71 else AliError("Upgrade segmentation not initalized");
72 delete s;
73}
74//____________________________________________________________________________________________________
75void AliITSDigitUpgrade::PrintInfo(){
76 //Standard output format for this class
77 Double_t xz[2]={-1,-1};
78 GetPosition(fNLayer,GetxPixelNumber(),GetzPixelNumber(),xz[0],xz[1]);
79
29b562a5 80 printf("pixid %10.0i (%6.3f,%6.3f) in layer %i \n",(Int_t)fPixId,xz[0],xz[1],fNLayer);
0ac80088 81 printf("pixid %u ",(UInt_t)fPixId);
82 printf(" (xloc, zloc)= (%6.3f, %6.3f) in layer %i and module %i \n",xz[0],xz[1],fNLayer, fModule);
29b562a5 83 printf(" Eloss %f Nel %f track ID %i %i %i ", fSignal, fNelectrons,fTracks[0],fTracks[1],fTracks[2]);
84 printf(" ElossID %f %f %f \n", fSignalID[0],fSignalID[1],fSignalID[2]);
1d9af2d5 85}
86