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():AliDigit(),
37 {for(Int_t i=0; i<3 ; i++) fSignalID[i]=-1;} //default creator
38 //_______________________________________________________________________
39 AliITSDigitUpgrade::AliITSDigitUpgrade(Int_t *digits): AliDigit(digits),
44 {for(Int_t i=0; i<3 ; i++) fSignalID[i]=-1;} //standard creator digits only
45 //____________________________________________________________________________________________________
46 AliITSDigitUpgrade::AliITSDigitUpgrade(ULong_t pixid, Float_t eloss): AliDigit(),
51 {for(Int_t i=0; i<3 ; i++) fSignalID[i]=-1;} //standard creator digits only
52 //____________________________________________________________________________________________________
53 AliITSDigitUpgrade::AliITSDigitUpgrade(const AliITSDigitUpgrade &d):AliDigit(d),
57 fNelectrons(d.fNelectrons)
58 {for(Int_t i=0; i<3 ; i++) fSignalID[i]=d.fSignalID[i];} //copy constructor
59 //____________________________________________________________________________________________________
60 void AliITSDigitUpgrade::GetPosition(Int_t ilayer, Int_t nx, Int_t nz, Double_t &xloc, Double_t &zloc){
61 AliITSsegmentationUpgrade *s =new AliITSsegmentationUpgrade();
62 if(s->GetCellSizeX(ilayer)!=0) xloc= (nx)*(s->GetCellSizeX(ilayer))+0.5*(s->GetCellSizeX(ilayer));
63 else AliError("Upgrade segmentation not initalized");
65 if(s->GetCellSizeZ(ilayer)!=0)
66 zloc=(nz)*(s->GetCellSizeZ(ilayer))+0.5*(s->GetCellSizeZ(ilayer))-(s->GetHalfLength(ilayer));
67 else AliError("Upgrade segmentation not initalized");
70 //____________________________________________________________________________________________________
71 void AliITSDigitUpgrade::PrintInfo(){
72 //Standard output format for this class
73 Double_t xz[2]={-1,-1};
74 GetPosition(fNLayer,GetxPixelNumber(),GetzPixelNumber(),xz[0],xz[1]);
76 printf("pixid %10.0i (%6.3f,%6.3f) in layer %i \n",(Int_t)fPixId,xz[0],xz[1],fNLayer);
77 printf(" Eloss %f Nel %f track ID %i %i %i ", fSignal, fNelectrons,fTracks[0],fTracks[1],fTracks[2]);
78 printf(" ElossID %f %f %f \n", fSignalID[0],fSignalID[1],fSignalID[2]);