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():
42 // default constructor
44 for(Int_t i=0; i<kMaxLab ; i++) {
49 //_______________________________________________________________________
50 AliITSDigitUpgrade::AliITSDigitUpgrade(Int_t *digits):
62 for(Int_t i=0; i<kMaxLab ; i++) {
67 //____________________________________________________________________________________________________
68 AliITSDigitUpgrade::AliITSDigitUpgrade(ULong_t pixid, Float_t eloss):
78 // Used constructor in simulation
80 for(Int_t i=0; i<kMaxLab ; i++) {
85 //____________________________________________________________________________________________________
86 AliITSDigitUpgrade::AliITSDigitUpgrade(const AliITSDigitUpgrade &d):
92 fNelectrons(d.fNelectrons),
93 fNTracksIdMC(d.fNTracksIdMC)
98 for(Int_t i=0; i<kMaxLab ; i++) {
99 fTrackIdMC[i]=d.fTrackIdMC[i];
100 fSignalID[i]=d.fSignalID[i];
102 for(Int_t i=0; i<3 ; i++) fSignalID[i]=d.fSignalID[i];
105 //____________________________________________________________________________________________________
106 void AliITSDigitUpgrade::AddTrackID(Int_t tid) {
108 // Add an MC label (track ID) to the "expanded list"
110 if (fNTracksIdMC==kMaxLab) {
111 AliWarning("Max. numbers of labels reached!");
113 fTrackIdMC[fNTracksIdMC]=tid;
118 //____________________________________________________________________________________________________
119 void AliITSDigitUpgrade::GetPosition(Int_t ilayer, Int_t nx, Int_t nz, Double_t &xloc, Double_t &zloc){
121 // Determines the local coordinates of the center of the pixel (a digit is a pixel)
124 AliITSsegmentationUpgrade *s =new AliITSsegmentationUpgrade();
125 if(s->GetCellSizeX(ilayer)!=0) xloc= (nx)*(s->GetCellSizeX(ilayer))+0.5*(s->GetCellSizeX(ilayer));
126 else AliError("Upgrade segmentation not initalized");
128 if(s->GetCellSizeZ(ilayer)!=0)
129 zloc=(nz)*(s->GetCellSizeZ(ilayer))+0.5*(s->GetCellSizeZ(ilayer))-(s->GetHalfLength(ilayer));
130 else AliError("Upgrade segmentation not initalized");
133 //____________________________________________________________________________________________________
134 void AliITSDigitUpgrade::PrintInfo(){
136 //Standard output format for this class
139 Double_t xz[2]={-1,-1};
140 GetPosition(fNLayer,GetxPixelNumber(),GetzPixelNumber(),xz[0],xz[1]);
142 printf("pixid %10.0i (%6.3f,%6.3f) in layer %i \n",(Int_t)fPixId,xz[0],xz[1],fNLayer);
143 printf("pixid %u ",(UInt_t)fPixId);
144 printf(" (xloc, zloc)= (%6.3f, %6.3f) in layer %i and module %i \n",xz[0],xz[1],fNLayer, fModule);
145 printf(" Eloss %f Nel %f \n ",fSignal, fNelectrons);
146 printf(" MC Track Ids =(");
147 if (kMaxLab<=fNTracksIdMC) {
148 for (Int_t i=0; i<kMaxLab; i++) { printf("%d,",fTrackIdMC[i]); }
149 printf(")\n ElossID = (");
150 for (Int_t i=0; i<kMaxLab; i++) { printf("%lf,",fSignalID[i]); }
152 for (Int_t i=0; i<fNTracksIdMC; i++) { printf("%d,",fTrackIdMC[i]); }
153 printf(")\n ElossID = (");
154 for (Int_t i=0; i<fNTracksIdMC; i++) { printf("%lf,",fSignalID[i]); }