1 /**************************************************************************
2 * Copyright(c) 2004-2006, 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 #include "AliITSDigitUpgrade.h"
19 #include "AliITSsegmentationUpgrade.h"
22 ///////////////////////////////////////////////////////////////////
24 // Class defining the digit object //
26 // Inherits from AliDigit //
28 ///////////////////////////////////////////////////////////////////
30 ClassImp(AliITSDigitUpgrade)
31 //______________________________________________________________________
32 AliITSDigitUpgrade::AliITSDigitUpgrade():
41 for(Int_t i=0; i<kMaxLab ; i++) {
46 //_______________________________________________________________________
47 AliITSDigitUpgrade::AliITSDigitUpgrade(Int_t *digits):
56 for(Int_t i=0; i<kMaxLab ; i++) {
61 //____________________________________________________________________________________________________
62 AliITSDigitUpgrade::AliITSDigitUpgrade(ULong_t pixid, Float_t eloss):
71 for(Int_t i=0; i<kMaxLab ; i++) {
75 } //standard creator digits only
76 //____________________________________________________________________________________________________
77 AliITSDigitUpgrade::AliITSDigitUpgrade(const AliITSDigitUpgrade &d):
83 fNelectrons(d.fNelectrons),
84 fNTracksIdMC(d.fNTracksIdMC)
86 for(Int_t i=0; i<kMaxLab ; i++) {
87 fTrackIdMC[i]=d.fTrackIdMC[i];
88 fSignalID[i]=d.fSignalID[i];
90 for(Int_t i=0; i<3 ; i++) fSignalID[i]=d.fSignalID[i];
93 //____________________________________________________________________________________________________
94 void AliITSDigitUpgrade::AddTrackID(Int_t tid) {
96 // Add an MC label (track ID) to the "expanded list"
98 if (fNTracksIdMC==kMaxLab) {
99 AliWarning("Max. numbers of labels reached!");
101 fTrackIdMC[fNTracksIdMC]=tid;
106 //____________________________________________________________________________________________________
107 void AliITSDigitUpgrade::GetPosition(Int_t ilayer, Int_t nx, Int_t nz, Double_t &xloc, Double_t &zloc){
109 // Determines the local coordinates of the center of the pixel (a digit is a pixel)
112 AliITSsegmentationUpgrade *s =new AliITSsegmentationUpgrade();
113 if(s->GetCellSizeX(ilayer)!=0) xloc= (nx)*(s->GetCellSizeX(ilayer))+0.5*(s->GetCellSizeX(ilayer));
114 else AliError("Upgrade segmentation not initalized");
116 if(s->GetCellSizeZ(ilayer)!=0)
117 zloc=(nz)*(s->GetCellSizeZ(ilayer))+0.5*(s->GetCellSizeZ(ilayer))-(s->GetHalfLength(ilayer));
118 else AliError("Upgrade segmentation not initalized");
121 //____________________________________________________________________________________________________
122 void AliITSDigitUpgrade::PrintInfo(){
124 //Standard output format for this class
127 Double_t xz[2]={-1,-1};
128 GetPosition(fNLayer,GetxPixelNumber(),GetzPixelNumber(),xz[0],xz[1]);
130 printf("pixid %10.0i (%6.3f,%6.3f) in layer %i \n",(Int_t)fPixId,xz[0],xz[1],fNLayer);
131 printf("pixid %u ",(UInt_t)fPixId);
132 printf(" (xloc, zloc)= (%6.3f, %6.3f) in layer %i and module %i \n",xz[0],xz[1],fNLayer, fModule);
133 printf(" Eloss %f Nel %f \n ",fSignal, fNelectrons);
134 printf(" MC Track Ids =(");
135 if (kMaxLab<=fNTracksIdMC) {
136 for (Int_t i=0; i<kMaxLab; i++) { printf("%d,",fTrackIdMC[i]); }
137 printf(")\n ElossID = (");
138 for (Int_t i=0; i<kMaxLab; i++) { printf("%lf,",fSignalID[i]); }
140 for (Int_t i=0; i<fNTracksIdMC; i++) { printf("%d,",fTrackIdMC[i]); }
141 printf(")\n ElossID = (");
142 for (Int_t i=0; i<fNTracksIdMC; i++) { printf("%lf,",fSignalID[i]); }