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 **************************************************************************/
18 Revision 1.43 2001/07/28 12:02:54 hristov
19 Branch split level set to 99
21 Revision 1.42 2001/07/28 11:38:52 hristov
22 Loop variable declared once
24 Revision 1.41 2001/07/28 10:53:50 hristov
25 Digitisation done according to the general scheme (M.Ivanov)
27 Revision 1.40 2001/07/27 13:03:14 hristov
28 Default Branch split level set to 99
30 Revision 1.39 2001/07/26 09:09:34 kowal2
31 Hits2Reco method added
33 Revision 1.38 2001/07/20 14:32:43 kowal2
34 Processing of many events possible now
36 Revision 1.37 2001/06/12 07:17:18 kowal2
37 Hits2SDigits method implemented (summable digits)
39 Revision 1.36 2001/05/16 14:57:25 alibrary
40 New files for folders and Stack
42 Revision 1.35 2001/05/08 16:02:22 kowal2
43 Updated material specifications
45 Revision 1.34 2001/05/08 15:00:15 hristov
46 Corrections for tracking in arbitrary magnenetic field. Changes towards a concept of global Alice track. Back propagation of reconstructed tracks (Yu.Belikov)
48 Revision 1.33 2001/04/03 12:40:43 kowal2
51 Revision 1.32 2001/03/12 17:47:36 hristov
52 Changes needed on Sun with CC 5.0
54 Revision 1.31 2001/03/12 08:21:50 kowal2
55 Corrected C++ bug in the material definitions
57 Revision 1.30 2001/03/01 17:34:47 kowal2
58 Correction due to the accuracy problem
60 Revision 1.29 2001/02/28 16:34:40 kowal2
61 Protection against nonphysical values of the avalanche size,
64 Revision 1.28 2001/01/26 19:57:19 hristov
65 Major upgrade of AliRoot code
67 Revision 1.27 2001/01/13 17:29:33 kowal2
68 Sun compiler correction
70 Revision 1.26 2001/01/10 07:59:43 kowal2
71 Corrections to load points from the noncompressed hits.
73 Revision 1.25 2000/11/02 07:25:31 kowal2
74 Changes due to the new hit structure.
77 Revision 1.24 2000/10/05 16:06:09 kowal2
78 Forward declarations. Changes due to a new class AliComplexCluster.
80 Revision 1.23 2000/10/02 21:28:18 fca
81 Removal of useless dependecies via forward declarations
83 Revision 1.22 2000/07/10 20:57:39 hristov
84 Update of TPC code and macros by M.Kowalski
86 Revision 1.19.2.4 2000/06/26 07:39:42 kowal2
87 Changes to obey the coding rules
89 Revision 1.19.2.3 2000/06/25 08:38:41 kowal2
90 Splitted from AliTPCtracking
92 Revision 1.19.2.2 2000/06/16 12:59:28 kowal2
93 Changed parameter settings
95 Revision 1.19.2.1 2000/06/09 07:15:07 kowal2
97 Defaults loaded automatically (hard-wired)
98 Optional parameters can be set via macro called in the constructor
100 Revision 1.19 2000/04/18 19:00:59 fca
101 Small bug fixes to TPC files
103 Revision 1.18 2000/04/17 09:37:33 kowal2
104 removed obsolete AliTPCDigitsDisplay.C
106 Revision 1.17.2.2 2000/04/10 08:15:12 kowal2
108 New, experimental data structure from M. Ivanov
109 New tracking algorithm
110 Different pad geometry for different sectors
111 Digitization rewritten
113 Revision 1.17.2.1 2000/04/10 07:56:53 kowal2
114 Not used anymore - removed
116 Revision 1.17 2000/01/19 17:17:30 fca
117 Introducing a list of lists of hits -- more hits allowed for detector now
119 Revision 1.16 1999/11/05 09:29:23 fca
120 Accept only signals > 0
122 Revision 1.15 1999/10/08 06:26:53 fca
123 Removed ClustersIndex - not used anymore
125 Revision 1.14 1999/09/29 09:24:33 fca
126 Introduction of the Copyright and cvs Log
130 ///////////////////////////////////////////////////////////////////////////////
132 // Time Projection Chamber //
133 // This class contains the basic functions for the Time Projection Chamber //
134 // detector. Functions specific to one particular geometry are //
135 // contained in the derived classes //
139 <img src="picts/AliTPCClass.gif">
144 ///////////////////////////////////////////////////////////////////////////////
152 #include <TGeometry.h>
155 #include <TObjectTable.h>
156 #include "TParticle.h"
162 #include <iostream.h>
169 #include "AliTPCParamSR.h"
170 #include "AliTPCPRF2D.h"
171 #include "AliTPCRF1D.h"
172 #include "AliDigits.h"
173 #include "AliSimDigits.h"
174 #include "AliTPCTrackHits.h"
175 #include "AliPoints.h"
176 #include "AliArrayBranch.h"
179 #include "AliTPCDigitsArray.h"
180 #include "AliComplexCluster.h"
181 #include "AliClusters.h"
182 #include "AliTPCClustersRow.h"
183 #include "AliTPCClustersArray.h"
185 #include "AliTPCcluster.h"
186 #include "AliTPCclusterer.h"
187 #include "AliTPCtracker.h"
189 #include <TInterpreter.h>
196 //_____________________________________________________________________________
200 // Default constructor
215 //_____________________________________________________________________________
216 AliTPC::AliTPC(const char *name, const char *title)
217 : AliDetector(name,title)
220 // Standard constructor
224 // Initialise arrays of hits and digits
225 fHits = new TClonesArray("AliTPChit", 176);
226 gAlice->AddHitList(fHits);
232 fTrackHits = new AliTPCTrackHits; //MI - 13.09.2000
233 fTrackHits->SetHitPrecision(0.002);
234 fTrackHits->SetStepPrecision(0.003);
235 fTrackHits->SetMaxDistance(100);
239 // Initialise counters
245 // Initialise color attributes
246 SetMarkerColor(kYellow);
249 // Set TPC parameters
253 if (!strcmp(title,"Default")) {
254 fTPCParam = new AliTPCParamSR;
256 cerr<<"AliTPC warning: in Config.C you must set non-default parameters\n";
262 //_____________________________________________________________________________
273 delete fTrackHits; //MI 15.09.2000
276 //_____________________________________________________________________________
277 void AliTPC::AddHit(Int_t track, Int_t *vol, Float_t *hits)
280 // Add a hit to the list
282 // TClonesArray &lhits = *fHits;
283 // new(lhits[fNhits++]) AliTPChit(fIshunt,track,vol,hits);
285 TClonesArray &lhits = *fHits;
286 new(lhits[fNhits++]) AliTPChit(fIshunt,track,vol,hits);
289 AddHit2(track,vol,hits);
292 //_____________________________________________________________________________
293 void AliTPC::BuildGeometry()
297 // Build TPC ROOT TNode geometry for the event display
302 const int kColorTPC=19;
303 char name[5], title[25];
304 const Double_t kDegrad=TMath::Pi()/180;
305 const Double_t kRaddeg=180./TMath::Pi();
308 Float_t innerOpenAngle = fTPCParam->GetInnerAngle();
309 Float_t outerOpenAngle = fTPCParam->GetOuterAngle();
311 Float_t innerAngleShift = fTPCParam->GetInnerAngleShift();
312 Float_t outerAngleShift = fTPCParam->GetOuterAngleShift();
314 Int_t nLo = fTPCParam->GetNInnerSector()/2;
315 Int_t nHi = fTPCParam->GetNOuterSector()/2;
317 const Double_t kloAng = (Double_t)TMath::Nint(innerOpenAngle*kRaddeg);
318 const Double_t khiAng = (Double_t)TMath::Nint(outerOpenAngle*kRaddeg);
319 const Double_t kloAngSh = (Double_t)TMath::Nint(innerAngleShift*kRaddeg);
320 const Double_t khiAngSh = (Double_t)TMath::Nint(outerAngleShift*kRaddeg);
323 const Double_t kloCorr = 1/TMath::Cos(0.5*kloAng*kDegrad);
324 const Double_t khiCorr = 1/TMath::Cos(0.5*khiAng*kDegrad);
330 // Get ALICE top node
333 nTop=gAlice->GetGeometry()->GetNode("alice");
337 rl = fTPCParam->GetInnerRadiusLow();
338 ru = fTPCParam->GetInnerRadiusUp();
342 sprintf(name,"LS%2.2d",i);
344 sprintf(title,"TPC low sector %3d",i);
347 tubs = new TTUBS(name,title,"void",rl*kloCorr,ru*kloCorr,250.,
348 kloAng*(i-0.5)+kloAngSh,kloAng*(i+0.5)+kloAngSh);
349 tubs->SetNumberOfDivisions(1);
351 nNode = new TNode(name,title,name,0,0,0,"");
352 nNode->SetLineColor(kColorTPC);
358 rl = fTPCParam->GetOuterRadiusLow();
359 ru = fTPCParam->GetOuterRadiusUp();
362 sprintf(name,"US%2.2d",i);
364 sprintf(title,"TPC upper sector %d",i);
366 tubs = new TTUBS(name,title,"void",rl*khiCorr,ru*khiCorr,250,
367 khiAng*(i-0.5)+khiAngSh,khiAng*(i+0.5)+khiAngSh);
368 tubs->SetNumberOfDivisions(1);
370 nNode = new TNode(name,title,name,0,0,0,"");
371 nNode->SetLineColor(kColorTPC);
377 //_____________________________________________________________________________
378 Int_t AliTPC::DistancetoPrimitive(Int_t , Int_t )
381 // Calculate distance from TPC to mouse on the display
387 void AliTPC::Clusters2Tracks(TFile *of) {
388 //-----------------------------------------------------------------
389 // This is a track finder.
390 //-----------------------------------------------------------------
391 AliTPCtracker tracker(fTPCParam);
392 tracker.Clusters2Tracks(gFile,of);
395 //_____________________________________________________________________________
396 void AliTPC::CreateMaterials()
398 //-----------------------------------------------
399 // Create Materials for for TPC simulations
400 //-----------------------------------------------
402 //-----------------------------------------------------------------
403 // Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
404 //-----------------------------------------------------------------
406 Int_t iSXFLD=gAlice->Field()->Integ();
407 Float_t sXMGMX=gAlice->Field()->Max();
409 Float_t amat[5]; // atomic numbers
410 Float_t zmat[5]; // z
411 Float_t wmat[5]; // proportions
417 //***************** Gases *************************
419 //-------------------------------------------------
421 //-------------------------------------------------
432 AliMaterial(20,"Ne",amat[0],zmat[0],density,999.,999.);
442 AliMaterial(21,"Ar",amat[0],zmat[0],density,999.,999.);
445 //--------------------------------------------------------------
447 //--------------------------------------------------------------
464 amol[0] = amat[0]*wmat[0]+amat[1]*wmat[1];
466 AliMixture(10,"CO2",amat,zmat,density,-2,wmat);
481 amol[1] = amat[0]*wmat[0]+amat[1]*wmat[1];
483 AliMixture(11,"CF4",amat,zmat,density,-2,wmat);
499 amol[2] = amat[0]*wmat[0]+amat[1]*wmat[1];
501 AliMixture(12,"CH4",amat,zmat,density,-2,wmat);
503 //----------------------------------------------------------------
504 // gases - mixtures, ID >= 20 pure gases, <= 10 ID < 20 -compounds
505 //----------------------------------------------------------------
511 Float_t rho,absl,X0,buf[1];
515 for(nc = 0;nc<fNoComp;nc++)
518 // retrive material constants
520 gMC->Gfmate((*fIdmate)[fMixtComp[nc]],namate,a,z,rho,X0,absl,buf,nbuf);
525 Int_t nnc = (fMixtComp[nc]>=20) ? fMixtComp[nc]%20 : fMixtComp[nc]%10;
527 am += fMixtProp[nc]*((fMixtComp[nc]>=20) ? apure[nnc] : amol[nnc]);
528 density += fMixtProp[nc]*rho; // density of the mixture
532 // mixture proportions by weight!
534 for(nc = 0;nc<fNoComp;nc++)
537 Int_t nnc = (fMixtComp[nc]>=20) ? fMixtComp[nc]%20 : fMixtComp[nc]%10;
539 wmat[nc] = fMixtProp[nc]*((fMixtComp[nc]>=20) ?
540 apure[nnc] : amol[nnc])/am;
544 // Drift gases 1 - nonsensitive, 2 - sensitive
546 AliMixture(31,"Drift gas 1",amat,zmat,density,fNoComp,wmat);
547 AliMixture(32,"Drift gas 2",amat,zmat,density,fNoComp,wmat);
556 AliMaterial(24,"Air",amat[0],zmat[0],density,999.,999.);
559 //----------------------------------------------------------------------
561 //----------------------------------------------------------------------
583 AliMixture(34,"Kevlar",amat,zmat,density,-4,wmat);
605 AliMixture(35,"NOMEX",amat,zmat,density,-4,wmat);
623 AliMixture(36,"Makrolon",amat,zmat,density,-3,wmat);
641 AliMixture(37, "Mylar",amat,zmat,density,-3,wmat);
643 // SiO2 - used later for the glass fiber
655 AliMixture(38,"SiO2",amat,zmat,2.2,-2,wmat); //SiO2 - quartz (rho=2.2)
664 AliMaterial(40,"Al",amat[0],zmat[0],density,999.,999.);
673 AliMaterial(41,"Si",amat[0],zmat[0],density,999.,999.);
682 AliMaterial(42,"Cu",amat[0],zmat[0],density,999.,999.);
700 AliMixture(43, "Tedlar",amat,zmat,density,-3,wmat);
719 AliMixture(44,"Plexiglas",amat,zmat,density,-3,wmat);
721 // Epoxy - C14 H20 O3
738 AliMixture(45,"Epoxy",amat,zmat,density,-3,wmat);
746 AliMaterial(46,"C",amat[0],zmat[0],density,999.,999.);
750 gMC->Gfmate((*fIdmate)[45],namate,amat[1],zmat[1],rho,X0,absl,buf,nbuf);
754 wmat[0]=0.644; // by weight!
757 density=0.5*(1.25+2.265);
759 AliMixture(47,"Cfiber",amat,zmat,density,2,wmat);
763 gMC->Gfmate((*fIdmate)[38],namate,amat[0],zmat[0],rho,X0,absl,buf,nbuf);
765 wmat[0]=0.725; // by weight!
770 AliMixture(39,"G10",amat,zmat,density,2,wmat);
775 //----------------------------------------------------------
776 // tracking media for gases
777 //----------------------------------------------------------
779 AliMedium(0, "Air", 24, 0, iSXFLD, sXMGMX, 10., 999., .1, .01, .1);
780 AliMedium(1, "Drift gas 1", 31, 0, iSXFLD, sXMGMX, 10., 999.,.1,.001, .001);
781 AliMedium(2, "Drift gas 2", 32, 1, iSXFLD, sXMGMX, 10., 999.,.1,.001, .001);
782 AliMedium(3,"CO2",10,0, iSXFLD, sXMGMX, 10., 999.,.1, .001, .001);
784 //-----------------------------------------------------------
785 // tracking media for solids
786 //-----------------------------------------------------------
788 AliMedium(4,"Al",40,0, iSXFLD, sXMGMX, 10., 999., .1, .0005, .001);
789 AliMedium(5,"Kevlar",34,0, iSXFLD, sXMGMX, 10., 999., .1, .0005, .001);
790 AliMedium(6,"Nomex",35,0, iSXFLD, sXMGMX, 10., 999., .1, .001, .001);
791 AliMedium(7,"Makrolon",36,0, iSXFLD, sXMGMX, 10., 999., .1, .001, .001);
792 AliMedium(8,"Mylar",37,0, iSXFLD, sXMGMX, 10., 999., .1, .0005, .001);
793 AliMedium(9,"Tedlar",43,0, iSXFLD, sXMGMX, 10., 999., .1, .0005, .001);
794 AliMedium(10,"Cu",42,0, iSXFLD, sXMGMX, 10., 999., .1, .001, .001);
795 AliMedium(11,"Si",41,0, iSXFLD, sXMGMX, 10., 999., .1, .001, .001);
796 AliMedium(12,"G10",39,0, iSXFLD, sXMGMX, 10., 999., .1, .001, .001);
797 AliMedium(13,"Plexiglas",44,0, iSXFLD, sXMGMX, 10., 999., .1, .001, .001);
798 AliMedium(14,"Epoxy",45,0, iSXFLD, sXMGMX, 10., 999., .1, .0005, .001);
799 AliMedium(15,"Cfiber",47,0, iSXFLD, sXMGMX, 10., 999., .1, .001, .001);
804 void AliTPC::Digits2Clusters(TFile *of, Int_t eventnumber)
806 //-----------------------------------------------------------------
807 // This is a simple cluster finder.
808 //-----------------------------------------------------------------
809 AliTPCclusterer::Digits2Clusters(fTPCParam,of,eventnumber);
812 extern Double_t SigmaY2(Double_t, Double_t, Double_t);
813 extern Double_t SigmaZ2(Double_t, Double_t);
814 //_____________________________________________________________________________
815 void AliTPC::Hits2Clusters(TFile *of, Int_t eventn)
817 //--------------------------------------------------------
818 // TPC simple cluster generator from hits
819 // obtained from the TPC Fast Simulator
820 // The point errors are taken from the parametrization
821 //--------------------------------------------------------
823 //-----------------------------------------------------------------
824 // Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
825 //-----------------------------------------------------------------
826 // Adopted to Marian's cluster data structure by I.Belikov, CERN,
827 // Jouri.Belikov@cern.ch
828 //----------------------------------------------------------------
830 /////////////////////////////////////////////////////////////////////////////
832 //---------------------------------------------------------------------
833 // ALICE TPC Cluster Parameters
834 //--------------------------------------------------------------------
838 // Cluster width in rphi
839 const Float_t kACrphi=0.18322;
840 const Float_t kBCrphi=0.59551e-3;
841 const Float_t kCCrphi=0.60952e-1;
842 // Cluster width in z
843 const Float_t kACz=0.19081;
844 const Float_t kBCz=0.55938e-3;
845 const Float_t kCCz=0.30428;
847 TDirectory *savedir=gDirectory;
850 cerr<<"AliTPC::Hits2Clusters(): output file not open !\n";
854 //if(fDefaults == 0) SetDefaults();
856 Float_t sigmaRphi,sigmaZ,clRphi,clZ;
858 TParticle *particle; // pointer to a given particle
859 AliTPChit *tpcHit; // pointer to a sigle TPC hit
863 Float_t pl,pt,tanth,rpad,ratio;
866 //---------------------------------------------------------------
867 // Get the access to the tracks
868 //---------------------------------------------------------------
870 TTree *tH = gAlice->TreeH();
871 Stat_t ntracks = tH->GetEntries();
873 //Switch to the output file
878 sprintf(cname,"TreeC_TPC_%d",eventn);
880 fTPCParam->Write(fTPCParam->GetTitle());
881 AliTPCClustersArray carray;
882 carray.Setup(fTPCParam);
883 carray.SetClusterType("AliTPCcluster");
886 Int_t nclusters=0; //cluster counter
888 //------------------------------------------------------------
889 // Loop over all sectors (72 sectors for 20 deg
890 // segmentation for both lower and upper sectors)
891 // Sectors 0-35 are lower sectors, 0-17 z>0, 17-35 z<0
892 // Sectors 36-71 are upper sectors, 36-53 z>0, 54-71 z<0
894 // First cluster for sector 0 starts at "0"
895 //------------------------------------------------------------
897 for(Int_t isec=0;isec<fTPCParam->GetNSector();isec++){
899 fTPCParam->AdjustCosSin(isec,cph,sph);
901 //------------------------------------------------------------
903 //------------------------------------------------------------
905 for(Int_t track=0;track<ntracks;track++){
909 // Get number of the TPC hits
911 // nhits=fHits->GetEntriesFast();
914 tpcHit = (AliTPChit*)FirstHit(-1);
918 // for(Int_t hit=0;hit<nhits;hit++){
919 //tpcHit=(AliTPChit*)fHits->UncheckedAt(hit);
923 if (tpcHit->fQ == 0.) {
924 tpcHit = (AliTPChit*) NextHit();
925 continue; //information about track (I.Belikov)
927 sector=tpcHit->fSector; // sector number
930 // if(sector != isec) continue; //terminate iteration
933 tpcHit = (AliTPChit*) NextHit();
936 ipart=tpcHit->Track();
937 particle=gAlice->Particle(ipart);
940 if(pt < 1.e-9) pt=1.e-9;
942 tanth = TMath::Abs(tanth);
943 rpad=TMath::Sqrt(tpcHit->X()*tpcHit->X() + tpcHit->Y()*tpcHit->Y());
944 ratio=0.001*rpad/pt; // pt must be in MeV/c - historical reason
946 // space-point resolutions
948 sigmaRphi=SigmaY2(rpad,tanth,pt);
949 sigmaZ =SigmaZ2(rpad,tanth );
953 clRphi=kACrphi-kBCrphi*rpad*tanth+kCCrphi*ratio*ratio;
954 clZ=kACz-kBCz*rpad*tanth+kCCz*tanth*tanth;
956 // temporary protection
958 if(sigmaRphi < 0.) sigmaRphi=0.4e-3;
959 if(sigmaZ < 0.) sigmaZ=0.4e-3;
960 if(clRphi < 0.) clRphi=2.5e-3;
961 if(clZ < 0.) clZ=2.5e-5;
966 // smearing --> rotate to the 1 (13) or to the 25 (49) sector,
967 // then the inaccuracy in a X-Y plane is only along Y (pad row)!
969 Float_t xprim= tpcHit->X()*cph + tpcHit->Y()*sph;
970 Float_t yprim=-tpcHit->X()*sph + tpcHit->Y()*cph;
971 xyz[0]=gRandom->Gaus(yprim,TMath::Sqrt(sigmaRphi)); // y
972 Float_t alpha=(isec < fTPCParam->GetNInnerSector()) ?
973 fTPCParam->GetInnerAngle() : fTPCParam->GetOuterAngle();
974 Float_t ymax=xprim*TMath::Tan(0.5*alpha);
975 if (TMath::Abs(xyz[0])>ymax) xyz[0]=yprim;
976 xyz[1]=gRandom->Gaus(tpcHit->Z(),TMath::Sqrt(sigmaZ)); // z
977 if (TMath::Abs(xyz[1])>fTPCParam->GetZLength()) xyz[1]=tpcHit->Z();
978 xyz[2]=sigmaRphi; // fSigmaY2
979 xyz[3]=sigmaZ; // fSigmaZ2
980 xyz[4]=tpcHit->fQ; // q
982 AliTPCClustersRow *clrow=carray.GetRow(sector,tpcHit->fPadRow);
983 if (!clrow) clrow=carray.CreateRow(sector,tpcHit->fPadRow);
985 Int_t tracks[3]={tpcHit->Track(), -1, -1};
986 AliTPCcluster cluster(tracks,xyz);
988 clrow->InsertCluster(&cluster); nclusters++;
990 tpcHit = (AliTPChit*)NextHit();
993 } // end of loop over hits
995 } // end of loop over tracks
997 Int_t nrows=fTPCParam->GetNRow(isec);
998 for (Int_t irow=0; irow<nrows; irow++) {
999 AliTPCClustersRow *clrow=carray.GetRow(isec,irow);
1000 if (!clrow) continue;
1001 carray.StoreRow(isec,irow);
1002 carray.ClearRow(isec,irow);
1005 } // end of loop over sectors
1007 cerr<<"Number of made clusters : "<<nclusters<<" \n";
1009 carray.GetTree()->SetName(cname);
1010 carray.GetTree()->Write();
1012 savedir->cd(); //switch back to the input file
1014 } // end of function
1016 //_________________________________________________________________
1017 void AliTPC::Hits2ExactClustersSector(Int_t isec)
1019 //--------------------------------------------------------
1020 //calculate exact cross point of track and given pad row
1021 //resulting values are expressed in "digit" coordinata
1022 //--------------------------------------------------------
1024 //-----------------------------------------------------------------
1025 // Origin: Marian Ivanov GSI Darmstadt, m.ivanov@gsi.de
1026 //-----------------------------------------------------------------
1028 if (fClustersArray==0){
1032 TParticle *particle; // pointer to a given particle
1033 AliTPChit *tpcHit; // pointer to a sigle TPC hit
1036 const Int_t kcmaxhits=30000;
1037 TVector * xxxx = new TVector(kcmaxhits*4);
1038 TVector & xxx = *xxxx;
1039 Int_t maxhits = kcmaxhits;
1040 //construct array for each padrow
1041 for (Int_t i=0; i<fTPCParam->GetNRow(isec);i++)
1042 fClustersArray->CreateRow(isec,i);
1044 //---------------------------------------------------------------
1045 // Get the access to the tracks
1046 //---------------------------------------------------------------
1048 TTree *tH = gAlice->TreeH();
1049 Stat_t ntracks = tH->GetEntries();
1050 Int_t npart = gAlice->GetNtrack();
1052 //------------------------------------------------------------
1054 //------------------------------------------------------------
1056 for(Int_t track=0;track<ntracks;track++){
1058 tH->GetEvent(track);
1060 // Get number of the TPC hits and a pointer
1063 nhits=fHits->GetEntriesFast();
1067 Int_t currentIndex=0;
1068 Int_t lastrow=-1; //last writen row
1069 for(Int_t hit=0;hit<nhits;hit++){
1070 tpcHit=(AliTPChit*)fHits->UncheckedAt(hit);
1071 if (tpcHit==0) continue;
1072 sector=tpcHit->fSector; // sector number
1073 if(sector != isec) continue;
1074 ipart=tpcHit->Track();
1075 if (ipart<npart) particle=gAlice->Particle(ipart);
1079 Float_t x[3]={tpcHit->X(),tpcHit->Y(),tpcHit->Z()};
1080 Int_t index[3]={1,isec,0};
1081 Int_t currentrow = fTPCParam->GetPadRow(x,index) ;
1082 if (currentrow<0) continue;
1083 if (lastrow<0) lastrow=currentrow;
1084 if (currentrow==lastrow){
1085 if ( currentIndex>=maxhits){
1087 xxx.ResizeTo(4*maxhits);
1089 xxx(currentIndex*4)=x[0];
1090 xxx(currentIndex*4+1)=x[1];
1091 xxx(currentIndex*4+2)=x[2];
1092 xxx(currentIndex*4+3)=tpcHit->fQ;
1096 if (currentIndex>2){
1108 for (Int_t index=0;index<currentIndex;index++){
1110 x=x2=x3=x4=xxx(index*4);
1118 sumy+=xxx(index*4+1);
1119 sumxy+=xxx(index*4+1)*x;
1120 sumx2y+=xxx(index*4+1)*x2;
1121 sumz+=xxx(index*4+2);
1122 sumxz+=xxx(index*4+2)*x;
1123 sumx2z+=xxx(index*4+2)*x2;
1124 sumq+=xxx(index*4+3);
1126 Float_t centralPad = (fTPCParam->GetNPads(isec,lastrow)-1)/2;
1127 Float_t det=currentIndex*(sumx2*sumx4-sumx3*sumx3)-sumx*(sumx*sumx4-sumx2*sumx3)+
1128 sumx2*(sumx*sumx3-sumx2*sumx2);
1130 Float_t detay=sumy*(sumx2*sumx4-sumx3*sumx3)-sumx*(sumxy*sumx4-sumx2y*sumx3)+
1131 sumx2*(sumxy*sumx3-sumx2y*sumx2);
1132 Float_t detaz=sumz*(sumx2*sumx4-sumx3*sumx3)-sumx*(sumxz*sumx4-sumx2z*sumx3)+
1133 sumx2*(sumxz*sumx3-sumx2z*sumx2);
1135 Float_t detby=currentIndex*(sumxy*sumx4-sumx2y*sumx3)-sumy*(sumx*sumx4-sumx2*sumx3)+
1136 sumx2*(sumx*sumx2y-sumx2*sumxy);
1137 Float_t detbz=currentIndex*(sumxz*sumx4-sumx2z*sumx3)-sumz*(sumx*sumx4-sumx2*sumx3)+
1138 sumx2*(sumx*sumx2z-sumx2*sumxz);
1140 Float_t y=detay/det+centralPad;
1141 Float_t z=detaz/det;
1142 Float_t by=detby/det; //y angle
1143 Float_t bz=detbz/det; //z angle
1144 sumy/=Float_t(currentIndex);
1145 sumz/=Float_t(currentIndex);
1146 AliComplexCluster cl;
1152 cl.fTracks[0]=ipart;
1154 AliTPCClustersRow * row = (fClustersArray->GetRow(isec,lastrow));
1155 if (row!=0) row->InsertCluster(&cl);
1158 } //end of calculating cluster for given row
1162 } // end of loop over hits
1163 } // end of loop over tracks
1164 //write padrows to tree
1165 for (Int_t ii=0; ii<fTPCParam->GetNRow(isec);ii++) {
1166 fClustersArray->StoreRow(isec,ii);
1167 fClustersArray->ClearRow(isec,ii);
1176 void AliTPC::SDigits2Digits2(Int_t eventnumber)
1178 //create digits from summable digits
1182 sprintf(sname,"TreeS_%s_%d",fTPCParam->GetTitle(),eventnumber);
1183 sprintf(dname,"TreeD_%s_%d",fTPCParam->GetTitle(),eventnumber);
1185 //conect tree with sSDigits
1186 TTree *t = (TTree *)gDirectory->Get(sname);
1187 AliSimDigits digarr, *dummy=&digarr;
1188 t->GetBranch("Segment")->SetAddress(&dummy);
1189 Stat_t nentries = t->GetEntries();
1191 //make tree with digits
1192 AliTPCDigitsArray *arr = new AliTPCDigitsArray;
1193 arr->SetClass("AliSimDigits");
1194 arr->Setup(fTPCParam);
1195 arr->MakeTree(fDigitsFile);
1197 AliTPCParam * par =fTPCParam;
1198 //Loop over segments of the TPC
1199 for (Int_t n=0; n<nentries; n++) {
1202 if (!par->AdjustSectorRow(digarr.GetID(),sec,row)) {
1203 cerr<<"AliTPC warning: invalid segment ID ! "<<digarr.GetID()<<endl;
1206 AliSimDigits * digrow =(AliSimDigits*) arr->CreateRow(sec,row);
1207 Int_t nrows = digrow->GetNRows();
1208 Int_t ncols = digrow->GetNCols();
1210 digrow->ExpandBuffer();
1211 digarr.ExpandBuffer();
1212 digrow->ExpandTrackBuffer();
1213 digarr.ExpandTrackBuffer();
1215 for (row=0;row<nrows; row++)
1216 for (Int_t col=0;col<ncols; col++){
1217 Float_t q = digarr.GetDigitFast(row,col);
1218 q/=16; //konversion faktor
1220 q = gRandom->Gaus(q,fTPCParam->GetNoise()*fTPCParam->GetNoiseNormFac());
1221 if(q > fTPCParam->GetADCSat()) q = fTPCParam->GetADCSat();
1223 digrow->SetDigitFast((Short_t)q,row,col);
1224 for (Int_t tr=0;tr<3;tr++)
1225 ((AliSimDigits*)digrow)->SetTrackIDFast(digarr.GetTrackIDFast(row,col,tr),row,col,tr);
1232 arr->StoreRow(sec,row);
1233 // printf("*** Sector, row, compressed digits %d %d %d ***\n",sec,row,ndig);
1234 arr->ClearRow(sec,row);
1240 cerr<<"Digitizing TPC...\n";
1242 //Hits2Digits(eventnumber);
1247 // char treeName[100];
1249 // sprintf(treeName,"TreeD_%s_%d",fTPCParam->GetTitle(),eventnumber);
1251 arr->GetTree()->SetName(dname);
1252 arr->GetTree()->Write();
1257 /*_________________________________________
1258 void AliTPC::SDigits2Digits(Int_t eventnumber)
1262 cerr<<"Digitizing TPC...\n";
1264 Hits2Digits(eventnumber);
1269 // char treeName[100];
1271 // sprintf(treeName,"TreeD_%s_%d",fTPCParam->GetTitle(),eventnumber);
1273 // GetDigitsArray()->GetTree()->Write(treeName);
1276 //__________________________________________________________________
1277 void AliTPC::SetDefaults(){
1280 cerr<<"Setting default parameters...\n";
1282 // Set response functions
1284 AliTPCParamSR *param=(AliTPCParamSR*)gDirectory->Get("75x40_100x60");
1285 AliTPCPRF2D * prfinner = new AliTPCPRF2D;
1286 AliTPCPRF2D * prfouter = new AliTPCPRF2D;
1287 AliTPCRF1D * rf = new AliTPCRF1D(kTRUE);
1288 rf->SetGauss(param->GetZSigma(),param->GetZWidth(),1.);
1289 rf->SetOffset(3*param->GetZSigma());
1292 TDirectory *savedir=gDirectory;
1293 TFile *f=TFile::Open("$ALICE_ROOT/TPC/AliTPCprf2d.root");
1295 cerr<<"Can't open $ALICE_ROOT/TPC/AliTPCprf2d.root !\n" ;
1298 prfinner->Read("prf_07504_Gati_056068_d02");
1299 prfouter->Read("prf_10006_Gati_047051_d03");
1303 param->SetInnerPRF(prfinner);
1304 param->SetOuterPRF(prfouter);
1305 param->SetTimeRF(rf);
1315 //__________________________________________________________________
1316 void AliTPC::Hits2Digits(Int_t eventnumber)
1318 //----------------------------------------------------
1319 // Loop over all sectors for a single event
1320 //----------------------------------------------------
1323 if(fDefaults == 0) SetDefaults(); // check if the parameters are set
1325 //setup TPCDigitsArray
1327 if(GetDigitsArray()) delete GetDigitsArray();
1329 AliTPCDigitsArray *arr = new AliTPCDigitsArray;
1330 arr->SetClass("AliSimDigits");
1331 arr->Setup(fTPCParam);
1332 arr->MakeTree(fDigitsFile);
1333 SetDigitsArray(arr);
1335 fDigitsSwitch=0; // standard digits
1337 cerr<<"Digitizing TPC...\n";
1339 for(Int_t isec=0;isec<fTPCParam->GetNSector();isec++) Hits2DigitsSector(isec);
1345 sprintf(treeName,"TreeD_%s_%d",fTPCParam->GetTitle(),eventnumber);
1347 GetDigitsArray()->GetTree()->SetName(treeName);
1348 GetDigitsArray()->GetTree()->Write();
1355 //__________________________________________________________________
1356 void AliTPC::Hits2SDigits2(Int_t eventnumber)
1359 //-----------------------------------------------------------
1360 // summable digits - 16 bit "ADC", no noise, no saturation
1361 //-----------------------------------------------------------
1363 //----------------------------------------------------
1364 // Loop over all sectors for a single event
1365 //----------------------------------------------------
1368 if(fDefaults == 0) SetDefaults();
1370 //setup TPCDigitsArray
1372 if(GetDigitsArray()) delete GetDigitsArray();
1374 AliTPCDigitsArray *arr = new AliTPCDigitsArray;
1375 arr->SetClass("AliSimDigits");
1376 arr->Setup(fTPCParam);
1377 arr->MakeTree(fDigitsFile);
1378 SetDigitsArray(arr);
1380 cerr<<"Digitizing TPC...\n";
1382 fDigitsSwitch=1; // summable digits
1384 for(Int_t isec=0;isec<fTPCParam->GetNSector();isec++) Hits2DigitsSector(isec);
1391 sprintf(treeName,"TreeS_%s_%d",fTPCParam->GetTitle(),eventnumber);
1393 GetDigitsArray()->GetTree()->SetName(treeName);
1394 GetDigitsArray()->GetTree()->Write();
1400 //__________________________________________________________________
1401 void AliTPC::Hits2SDigits()
1404 //-----------------------------------------------------------
1405 // summable digits - 16 bit "ADC", no noise, no saturation
1406 //-----------------------------------------------------------
1408 //----------------------------------------------------
1409 // Loop over all sectors for a single event
1410 //----------------------------------------------------
1411 //MI change - for pp run
1412 Int_t eventnumber = gAlice->GetEvNumber();
1414 if(fDefaults == 0) SetDefaults();
1416 //setup TPCDigitsArray
1418 if(GetDigitsArray()) delete GetDigitsArray();
1420 AliTPCDigitsArray *arr = new AliTPCDigitsArray;
1421 arr->SetClass("AliSimDigits");
1422 arr->Setup(fTPCParam);
1423 arr->MakeTree(fDigitsFile);
1424 SetDigitsArray(arr);
1426 cerr<<"Digitizing TPC...\n";
1428 // fDigitsSwitch=1; // summable digits -for the moment direct
1430 for(Int_t isec=0;isec<fTPCParam->GetNSector();isec++) Hits2DigitsSector(isec);
1436 sprintf(treeName,"TreeD_%s_%d",fTPCParam->GetTitle(),eventnumber);
1438 GetDigitsArray()->GetTree()->SetName(treeName);
1439 GetDigitsArray()->GetTree()->Write();
1444 //_____________________________________________________________________________
1445 void AliTPC::Hits2DigitsSector(Int_t isec)
1447 //-------------------------------------------------------------------
1448 // TPC conversion from hits to digits.
1449 //-------------------------------------------------------------------
1451 //-----------------------------------------------------------------
1452 // Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
1453 //-----------------------------------------------------------------
1455 //-------------------------------------------------------
1456 // Get the access to the track hits
1457 //-------------------------------------------------------
1459 // check if the parameters are set - important if one calls this method
1460 // directly, not from the Hits2Digits
1462 if(fDefaults == 0) SetDefaults();
1464 TTree *tH = gAlice->TreeH(); // pointer to the hits tree
1465 Stat_t ntracks = tH->GetEntries();
1469 //-------------------------------------------
1470 // Only if there are any tracks...
1471 //-------------------------------------------
1475 //printf("*** Processing sector number %d ***\n",isec);
1477 Int_t nrows =fTPCParam->GetNRow(isec);
1479 row= new TObjArray* [nrows];
1481 MakeSector(isec,nrows,tH,ntracks,row);
1483 //--------------------------------------------------------
1484 // Digitize this sector, row by row
1485 // row[i] is the pointer to the TObjArray of TVectors,
1486 // each one containing electrons accepted on this
1487 // row, assigned into tracks
1488 //--------------------------------------------------------
1492 if (fDigitsArray->GetTree()==0) fDigitsArray->MakeTree(fDigitsFile);
1494 for (i=0;i<nrows;i++){
1496 AliDigits * dig = fDigitsArray->CreateRow(isec,i);
1498 DigitizeRow(i,isec,row);
1500 fDigitsArray->StoreRow(isec,i);
1502 Int_t ndig = dig->GetDigitSize();
1505 //printf("*** Sector, row, compressed digits %d %d %d ***\n",isec,i,ndig);
1507 fDigitsArray->ClearRow(isec,i);
1510 } // end of the sector digitization
1512 for(i=0;i<nrows;i++){
1517 delete [] row; // delete the array of pointers to TObjArray-s
1521 } // end of Hits2DigitsSector
1524 //_____________________________________________________________________________
1525 void AliTPC::DigitizeRow(Int_t irow,Int_t isec,TObjArray **rows)
1527 //-----------------------------------------------------------
1528 // Single row digitization, coupling from the neighbouring
1529 // rows taken into account
1530 //-----------------------------------------------------------
1532 //-----------------------------------------------------------------
1533 // Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
1534 // Modified: Marian Ivanov GSI Darmstadt, m.ivanov@gsi.de
1535 //-----------------------------------------------------------------
1538 Float_t zerosup = fTPCParam->GetZeroSup();
1539 Int_t nrows =fTPCParam->GetNRow(isec);
1540 fCurrentIndex[1]= isec;
1543 Int_t nofPads = fTPCParam->GetNPads(isec,irow);
1544 Int_t nofTbins = fTPCParam->GetMaxTBin();
1545 Int_t indexRange[4];
1547 // Integrated signal for this row
1548 // and a single track signal
1550 TMatrix *m1 = new TMatrix(0,nofPads,0,nofTbins); // integrated
1551 TMatrix *m2 = new TMatrix(0,nofPads,0,nofTbins); // single
1553 TMatrix &total = *m1;
1555 // Array of pointers to the label-signal list
1557 Int_t nofDigits = nofPads*nofTbins; // number of digits for this row
1558 Float_t **pList = new Float_t* [nofDigits];
1562 for(lp=0;lp<nofDigits;lp++)pList[lp]=0; // set all pointers to NULL
1566 Int_t row1 = TMath::Max(irow-fTPCParam->GetNCrossRows(),0);
1567 Int_t row2 = TMath::Min(irow+fTPCParam->GetNCrossRows(),nrows-1);
1568 for (Int_t row= row1;row<=row2;row++){
1569 Int_t nTracks= rows[row]->GetEntries();
1570 for (i1=0;i1<nTracks;i1++){
1571 fCurrentIndex[2]= row;
1572 fCurrentIndex[3]=irow;
1574 m2->Zero(); // clear single track signal matrix
1575 Float_t trackLabel = GetSignal(rows[row],i1,m2,m1,indexRange);
1576 GetList(trackLabel,nofPads,m2,indexRange,pList);
1578 else GetSignal(rows[row],i1,0,m1,indexRange);
1584 AliDigits *dig = fDigitsArray->GetRow(isec,irow);
1585 for(Int_t ip=0;ip<nofPads;ip++){
1586 for(Int_t it=0;it<nofTbins;it++){
1588 Float_t q = total(ip,it);
1590 Int_t gi =it*nofPads+ip; // global index
1592 if(fDigitsSwitch == 0){
1594 q = gRandom->Gaus(q,fTPCParam->GetNoise()*fTPCParam->GetNoiseNormFac());
1598 if(q <=zerosup) continue; // do not fill zeros
1599 if(q > fTPCParam->GetADCSat()) q = fTPCParam->GetADCSat(); // saturation
1609 // "real" signal or electronic noise (list = -1)?
1612 for(Int_t j1=0;j1<3;j1++){
1613 tracks[j1] = (pList[gi]) ?(Int_t)(*(pList[gi]+j1)) : -1;
1618 <A NAME="AliDigits"></A>
1619 using of AliDigits object
1622 dig->SetDigitFast((Short_t)q,it,ip);
1623 if (fDigitsArray->IsSimulated())
1625 ((AliSimDigits*)dig)->SetTrackIDFast(tracks[0],it,ip,0);
1626 ((AliSimDigits*)dig)->SetTrackIDFast(tracks[1],it,ip,1);
1627 ((AliSimDigits*)dig)->SetTrackIDFast(tracks[2],it,ip,2);
1631 } // end of loop over time buckets
1632 } // end of lop over pads
1635 // This row has been digitized, delete nonused stuff
1638 for(lp=0;lp<nofDigits;lp++){
1639 if(pList[lp]) delete [] pList[lp];
1648 } // end of DigitizeRow
1650 //_____________________________________________________________________________
1652 Float_t AliTPC::GetSignal(TObjArray *p1, Int_t ntr, TMatrix *m1, TMatrix *m2,
1656 //---------------------------------------------------------------
1657 // Calculates 2-D signal (pad,time) for a single track,
1658 // returns a pointer to the signal matrix and the track label
1659 // No digitization is performed at this level!!!
1660 //---------------------------------------------------------------
1662 //-----------------------------------------------------------------
1663 // Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
1664 // Modified: Marian Ivanov
1665 //-----------------------------------------------------------------
1669 tv = (TVector*)p1->At(ntr); // pointer to a track
1672 Float_t label = v(0);
1673 Int_t centralPad = (fTPCParam->GetNPads(fCurrentIndex[1],fCurrentIndex[3])-1)/2;
1675 Int_t nElectrons = (tv->GetNrows()-1)/4;
1676 indexRange[0]=9999; // min pad
1677 indexRange[1]=-1; // max pad
1678 indexRange[2]=9999; //min time
1679 indexRange[3]=-1; // max time
1681 // Float_t IneffFactor = 0.5; // inefficiency in the gain close to the edge, as above
1683 TMatrix &signal = *m1;
1684 TMatrix &total = *m2;
1686 // Loop over all electrons
1688 for(Int_t nel=0; nel<nElectrons; nel++){
1690 Float_t aval = v(idx+4);
1691 Float_t eltoadcfac=aval*fTPCParam->GetTotalNormFac();
1692 Float_t xyz[3]={v(idx+1),v(idx+2),v(idx+3)};
1693 Int_t n = fTPCParam->CalcResponse(xyz,fCurrentIndex,fCurrentIndex[3]);
1695 if (n>0) for (Int_t i =0; i<n; i++){
1696 Int_t *index = fTPCParam->GetResBin(i);
1697 Int_t pad=index[1]+centralPad; //in digit coordinates central pad has coordinate 0
1698 if ( ( pad<(fTPCParam->GetNPads(fCurrentIndex[1],fCurrentIndex[3]))) && (pad>0)) {
1699 Int_t time=index[2];
1700 Float_t weight = fTPCParam->GetResWeight(i); //we normalise response to ADC channel
1701 weight *= eltoadcfac;
1703 if (m1!=0) signal(pad,time)+=weight;
1704 total(pad,time)+=weight;
1705 indexRange[0]=TMath::Min(indexRange[0],pad);
1706 indexRange[1]=TMath::Max(indexRange[1],pad);
1707 indexRange[2]=TMath::Min(indexRange[2],time);
1708 indexRange[3]=TMath::Max(indexRange[3],time);
1711 } // end of loop over electrons
1713 return label; // returns track label when finished
1716 //_____________________________________________________________________________
1717 void AliTPC::GetList(Float_t label,Int_t np,TMatrix *m,Int_t *indexRange,
1720 //----------------------------------------------------------------------
1721 // Updates the list of tracks contributing to digits for a given row
1722 //----------------------------------------------------------------------
1724 //-----------------------------------------------------------------
1725 // Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
1726 //-----------------------------------------------------------------
1728 TMatrix &signal = *m;
1730 // lop over nonzero digits
1732 for(Int_t it=indexRange[2];it<indexRange[3]+1;it++){
1733 for(Int_t ip=indexRange[0];ip<indexRange[1]+1;ip++){
1736 // accept only the contribution larger than 500 electrons (1/2 s_noise)
1738 if(signal(ip,it)<0.5) continue;
1741 Int_t globalIndex = it*np+ip; // globalIndex starts from 0!
1743 if(!pList[globalIndex]){
1746 // Create new list (6 elements - 3 signals and 3 labels),
1749 pList[globalIndex] = new Float_t [6];
1753 *pList[globalIndex] = -1.;
1754 *(pList[globalIndex]+1) = -1.;
1755 *(pList[globalIndex]+2) = -1.;
1756 *(pList[globalIndex]+3) = -1.;
1757 *(pList[globalIndex]+4) = -1.;
1758 *(pList[globalIndex]+5) = -1.;
1761 *pList[globalIndex] = label;
1762 *(pList[globalIndex]+3) = signal(ip,it);
1766 // check the signal magnitude
1768 Float_t highest = *(pList[globalIndex]+3);
1769 Float_t middle = *(pList[globalIndex]+4);
1770 Float_t lowest = *(pList[globalIndex]+5);
1773 // compare the new signal with already existing list
1776 if(signal(ip,it)<lowest) continue; // neglect this track
1780 if (signal(ip,it)>highest){
1781 *(pList[globalIndex]+5) = middle;
1782 *(pList[globalIndex]+4) = highest;
1783 *(pList[globalIndex]+3) = signal(ip,it);
1785 *(pList[globalIndex]+2) = *(pList[globalIndex]+1);
1786 *(pList[globalIndex]+1) = *pList[globalIndex];
1787 *pList[globalIndex] = label;
1789 else if (signal(ip,it)>middle){
1790 *(pList[globalIndex]+5) = middle;
1791 *(pList[globalIndex]+4) = signal(ip,it);
1793 *(pList[globalIndex]+2) = *(pList[globalIndex]+1);
1794 *(pList[globalIndex]+1) = label;
1797 *(pList[globalIndex]+5) = signal(ip,it);
1798 *(pList[globalIndex]+2) = label;
1802 } // end of loop over pads
1803 } // end of loop over time bins
1808 //___________________________________________________________________
1809 void AliTPC::MakeSector(Int_t isec,Int_t nrows,TTree *TH,
1810 Stat_t ntracks,TObjArray **row)
1813 //-----------------------------------------------------------------
1814 // Prepares the sector digitization, creates the vectors of
1815 // tracks for each row of this sector. The track vector
1816 // contains the track label and the position of electrons.
1817 //-----------------------------------------------------------------
1819 //-----------------------------------------------------------------
1820 // Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
1821 //-----------------------------------------------------------------
1823 Float_t gasgain = fTPCParam->GetGasGain();
1827 AliTPChit *tpcHit; // pointer to a sigle TPC hit
1830 if (fHitType&2) branch = TH->GetBranch("TPC2");
1831 else branch = TH->GetBranch("TPC");
1834 //----------------------------------------------
1835 // Create TObjArray-s, one for each row,
1836 // each TObjArray will store the TVectors
1837 // of electrons, one TVector per each track.
1838 //----------------------------------------------
1840 Int_t *nofElectrons = new Int_t [nrows]; // electron counter for each row
1841 TVector **tracks = new TVector* [nrows]; //pointers to the track vectors
1842 for(i=0; i<nrows; i++){
1843 row[i] = new TObjArray;
1850 //--------------------------------------------------------------------
1851 // Loop over tracks, the "track" contains the full history
1852 //--------------------------------------------------------------------
1854 Int_t previousTrack,currentTrack;
1855 previousTrack = -1; // nothing to store so far!
1857 for(Int_t track=0;track<ntracks;track++){
1858 Bool_t isInSector=kTRUE;
1863 TBranch * br = TH->GetBranch("fTrackHitsInfo");
1864 br->GetEvent(track);
1865 AliObjectArray * ar = fTrackHits->fTrackHitsInfo;
1866 for (UInt_t j=0;j<ar->GetSize();j++){
1867 if ( ((AliTrackHitsInfo*)ar->At(j))->fVolumeID==isec) isInSector=kTRUE;
1870 if (!isInSector) continue;
1872 branch->GetEntry(track); // get next track
1876 tpcHit = (AliTPChit*)FirstHit(-1);
1878 //--------------------------------------------------------------
1880 //--------------------------------------------------------------
1885 Int_t sector=tpcHit->fSector; // sector number
1886 // if(sector != isec) continue;
1888 tpcHit = (AliTPChit*) NextHit();
1892 currentTrack = tpcHit->Track(); // track number
1895 if(currentTrack != previousTrack){
1897 // store already filled fTrack
1899 for(i=0;i<nrows;i++){
1900 if(previousTrack != -1){
1901 if(nofElectrons[i]>0){
1902 TVector &v = *tracks[i];
1903 v(0) = previousTrack;
1904 tracks[i]->ResizeTo(4*nofElectrons[i]+1); // shrink if necessary
1905 row[i]->Add(tracks[i]);
1908 delete tracks[i]; // delete empty TVector
1914 tracks[i] = new TVector(481); // TVectors for the next fTrack
1916 } // end of loop over rows
1918 previousTrack=currentTrack; // update track label
1921 Int_t qI = (Int_t) (tpcHit->fQ); // energy loss (number of electrons)
1923 //---------------------------------------------------
1924 // Calculate the electron attachment probability
1925 //---------------------------------------------------
1928 Float_t time = 1.e6*(fTPCParam->GetZLength()-TMath::Abs(tpcHit->Z()))
1929 /fTPCParam->GetDriftV();
1931 Float_t attProb = fTPCParam->GetAttCoef()*
1932 fTPCParam->GetOxyCont()*time; // fraction!
1934 //-----------------------------------------------
1935 // Loop over electrons
1936 //-----------------------------------------------
1939 for(Int_t nel=0;nel<qI;nel++){
1940 // skip if electron lost due to the attachment
1941 if((gRandom->Rndm(0)) < attProb) continue; // electron lost!
1946 // protection for the nonphysical avalanche size (10**6 maximum)
1948 Double_t rn=TMath::Max(gRandom->Rndm(0),1.93e-22);
1949 xyz[3]= (Float_t) (-gasgain*TMath::Log(rn));
1952 TransportElectron(xyz,index); //MI change -august
1954 fTPCParam->GetPadRow(xyz,index); //MI change august
1955 rowNumber = index[2];
1956 //transform position to local digit coordinates
1957 //relative to nearest pad row
1958 if ((rowNumber<0)||rowNumber>=fTPCParam->GetNRow(isec)) continue;
1959 nofElectrons[rowNumber]++;
1960 //----------------------------------
1961 // Expand vector if necessary
1962 //----------------------------------
1963 if(nofElectrons[rowNumber]>120){
1964 Int_t range = tracks[rowNumber]->GetNrows();
1965 if((nofElectrons[rowNumber])>(range-1)/4){
1967 tracks[rowNumber]->ResizeTo(range+400); // Add 100 electrons
1971 TVector &v = *tracks[rowNumber];
1972 Int_t idx = 4*nofElectrons[rowNumber]-3;
1974 v(idx)= xyz[0]; // X - pad row coordinate
1975 v(idx+1)=xyz[1]; // Y - pad coordinate (along the pad-row)
1976 v(idx+2)=xyz[2]; // Z - time bin coordinate
1977 v(idx+3)=xyz[3]; // avalanche size
1978 } // end of loop over electrons
1980 tpcHit = (AliTPChit*)NextHit();
1982 } // end of loop over hits
1983 } // end of loop over tracks
1986 // store remaining track (the last one) if not empty
1989 for(i=0;i<nrows;i++){
1990 if(nofElectrons[i]>0){
1991 TVector &v = *tracks[i];
1992 v(0) = previousTrack;
1993 tracks[i]->ResizeTo(4*nofElectrons[i]+1); // shrink if necessary
1994 row[i]->Add(tracks[i]);
2003 delete [] nofElectrons;
2006 } // end of MakeSector
2009 //_____________________________________________________________________________
2013 // Initialise TPC detector after definition of geometry
2018 printf("\n%s: ",ClassName());
2019 for(i=0;i<35;i++) printf("*");
2020 printf(" TPC_INIT ");
2021 for(i=0;i<35;i++) printf("*");
2022 printf("\n%s: ",ClassName());
2024 for(i=0;i<80;i++) printf("*");
2029 //_____________________________________________________________________________
2030 void AliTPC::MakeBranch(Option_t* option, const char *file)
2033 // Create Tree branches for the TPC.
2035 Int_t buffersize = 4000;
2036 char branchname[10];
2037 sprintf(branchname,"%s",GetName());
2039 AliDetector::MakeBranch(option,file);
2041 const char *d = strstr(option,"D");
2043 if (fDigits && gAlice->TreeD() && d) {
2044 MakeBranchInTree(gAlice->TreeD(),
2045 branchname, &fDigits, buffersize, file);
2048 if (fHitType&2) MakeBranch2(option,file); // MI change 14.09.2000
2051 //_____________________________________________________________________________
2052 void AliTPC::ResetDigits()
2055 // Reset number of digits and the digits array for this detector
2058 if (fDigits) fDigits->Clear();
2061 //_____________________________________________________________________________
2062 void AliTPC::SetSecAL(Int_t sec)
2064 //---------------------------------------------------
2065 // Activate/deactivate selection for lower sectors
2066 //---------------------------------------------------
2068 //-----------------------------------------------------------------
2069 // Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
2070 //-----------------------------------------------------------------
2075 //_____________________________________________________________________________
2076 void AliTPC::SetSecAU(Int_t sec)
2078 //----------------------------------------------------
2079 // Activate/deactivate selection for upper sectors
2080 //---------------------------------------------------
2082 //-----------------------------------------------------------------
2083 // Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
2084 //-----------------------------------------------------------------
2089 //_____________________________________________________________________________
2090 void AliTPC::SetSecLows(Int_t s1,Int_t s2,Int_t s3,Int_t s4,Int_t s5, Int_t s6)
2092 //----------------------------------------
2093 // Select active lower sectors
2094 //----------------------------------------
2096 //-----------------------------------------------------------------
2097 // Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
2098 //-----------------------------------------------------------------
2108 //_____________________________________________________________________________
2109 void AliTPC::SetSecUps(Int_t s1,Int_t s2,Int_t s3,Int_t s4,Int_t s5, Int_t s6,
2110 Int_t s7, Int_t s8 ,Int_t s9 ,Int_t s10,
2111 Int_t s11 , Int_t s12)
2113 //--------------------------------
2114 // Select active upper sectors
2115 //--------------------------------
2117 //-----------------------------------------------------------------
2118 // Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
2119 //-----------------------------------------------------------------
2135 //_____________________________________________________________________________
2136 void AliTPC::SetSens(Int_t sens)
2139 //-------------------------------------------------------------
2140 // Activates/deactivates the sensitive strips at the center of
2141 // the pad row -- this is for the space-point resolution calculations
2142 //-------------------------------------------------------------
2144 //-----------------------------------------------------------------
2145 // Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
2146 //-----------------------------------------------------------------
2152 void AliTPC::SetSide(Float_t side=0.)
2154 // choice of the TPC side
2159 //____________________________________________________________________________
2160 void AliTPC::SetGasMixt(Int_t nc,Int_t c1,Int_t c2,Int_t c3,Float_t p1,
2161 Float_t p2,Float_t p3)
2164 // gax mixture definition
2178 //_____________________________________________________________________________
2180 void AliTPC::TransportElectron(Float_t *xyz, Int_t *index)
2183 // electron transport taking into account:
2185 // 2.ExB at the wires
2186 // 3. nonisochronity
2188 // xyz and index must be already transformed to system 1
2191 fTPCParam->Transform1to2(xyz,index);
2194 Float_t driftl=xyz[2];
2195 if(driftl<0.01) driftl=0.01;
2196 driftl=TMath::Sqrt(driftl);
2197 Float_t sigT = driftl*(fTPCParam->GetDiffT());
2198 Float_t sigL = driftl*(fTPCParam->GetDiffL());
2199 xyz[0]=gRandom->Gaus(xyz[0],sigT);
2200 xyz[1]=gRandom->Gaus(xyz[1],sigT);
2201 xyz[2]=gRandom->Gaus(xyz[2],sigL);
2205 if (fTPCParam->GetMWPCReadout()==kTRUE){
2207 fTPCParam->Transform2to2NearestWire(xyz,index);
2208 Float_t dx=xyz[0]-x1;
2209 xyz[1]+=dx*(fTPCParam->GetOmegaTau());
2211 //add nonisochronity (not implemented yet)
2215 ClassImp(AliTPCdigit)
2217 //_____________________________________________________________________________
2218 AliTPCdigit::AliTPCdigit(Int_t *tracks, Int_t *digits):
2222 // Creates a TPC digit object
2224 fSector = digits[0];
2225 fPadRow = digits[1];
2228 fSignal = digits[4];
2234 //_____________________________________________________________________________
2235 AliTPChit::AliTPChit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
2239 // Creates a TPC hit object
2250 //________________________________________________________________________
2251 // Additional code because of the AliTPCTrackHits
2253 void AliTPC::MakeBranch2(Option_t *option,const char *file)
2256 // Create a new branch in the current Root Tree
2257 // The branch of fHits is automatically split
2258 // MI change 14.09.2000
2259 if (fHitType&2==0) return;
2260 char branchname[10];
2261 sprintf(branchname,"%s2",GetName());
2263 // Get the pointer to the header
2264 const char *cH = strstr(option,"H");
2266 if (fTrackHits && gAlice->TreeH() && cH) {
2267 AliObjectBranch * branch = new AliObjectBranch(branchname,"AliTPCTrackHits",&fTrackHits,
2268 gAlice->TreeH(),fBufferSize,99);
2269 gAlice->TreeH()->GetListOfBranches()->Add(branch);
2271 printf("* AliDetector::MakeBranch * Making Branch %s for trackhits\n",branchname);
2272 const char folder [] = "RunMC/Event/Data";
2274 printf("%15s: Publishing %s to %s\n",ClassName(),branchname,folder);
2275 Publish(folder,&fTrackHits,branchname);
2277 TBranch *b = gAlice->TreeH()->GetBranch(branchname);
2278 TDirectory *wd = gDirectory;
2280 TIter next( b->GetListOfBranches());
2281 while ((b=(TBranch*)next())) {
2286 cout << "Diverting branch " << branchname << " to file " << file << endl;
2291 void AliTPC::SetTreeAddress()
2293 if (fHitType&1) AliDetector::SetTreeAddress();
2294 if (fHitType&2) SetTreeAddress2();
2297 void AliTPC::SetTreeAddress2()
2300 // Set branch address for the TrackHits Tree
2303 char branchname[20];
2304 sprintf(branchname,"%s2",GetName());
2306 // Branch address for hit tree
2307 TTree *treeH = gAlice->TreeH();
2309 branch = treeH->GetBranch(branchname);
2310 if (branch) branch->SetAddress(&fTrackHits);
2314 void AliTPC::FinishPrimary()
2316 if (fTrackHits) fTrackHits->FlushHitStack();
2320 void AliTPC::AddHit2(Int_t track, Int_t *vol, Float_t *hits)
2323 // add hit to the list
2326 int primary = gAlice->GetPrimary(track);
2327 gAlice->Particle(primary)->SetBit(kKeepBit);
2331 gAlice->FlagTrack(track);
2333 //AliTPChit *hit = (AliTPChit*)fHits->UncheckedAt(fNhits-1);
2334 //if (hit->fTrack!=rtrack)
2335 // cout<<"bad track number\n";
2337 fTrackHits->AddHitKartez(vol[0],rtrack, hits[0],
2338 hits[1],hits[2],(Int_t)hits[3]);
2341 void AliTPC::ResetHits()
2343 if (fHitType&1) AliDetector::ResetHits();
2344 if (fHitType&2) ResetHits2();
2347 void AliTPC::ResetHits2()
2351 if (fTrackHits) fTrackHits->Clear();
2354 AliHit* AliTPC::FirstHit(Int_t track)
2356 if (fHitType&2) return FirstHit2(track);
2357 return AliDetector::FirstHit(track);
2359 AliHit* AliTPC::NextHit()
2361 if (fHitType&2) return NextHit2();
2362 return AliDetector::NextHit();
2365 AliHit* AliTPC::FirstHit2(Int_t track)
2368 // Initialise the hit iterator
2369 // Return the address of the first hit for track
2370 // If track>=0 the track is read from disk
2371 // while if track<0 the first hit of the current
2372 // track is returned
2375 gAlice->ResetHits();
2376 gAlice->TreeH()->GetEvent(track);
2380 fTrackHits->First();
2381 return fTrackHits->GetHit();
2386 AliHit* AliTPC::NextHit2()
2389 //Return the next hit for the current track
2393 return fTrackHits->GetHit();
2399 void AliTPC::LoadPoints(Int_t)
2403 /* if(fHitType==1) return AliDetector::LoadPoints(a);
2406 if(fHitType==1) AliDetector::LoadPoints(a);
2407 else LoadPoints2(a);
2414 void AliTPC::RemapTrackHitIDs(Int_t *map)
2416 if (!fTrackHits) return;
2417 AliObjectArray * arr = fTrackHits->fTrackHitsInfo;
2418 for (UInt_t i=0;i<arr->GetSize();i++){
2419 AliTrackHitsInfo * info = (AliTrackHitsInfo *)(arr->At(i));
2420 info->fTrackID = map[info->fTrackID];
2426 //_____________________________________________________________________________
2427 void AliTPC::LoadPoints2(Int_t)
2430 // Store x, y, z of all hits in memory
2432 if (fTrackHits == 0) return;
2434 Int_t nhits = fTrackHits->GetEntriesFast();
2435 if (nhits == 0) return;
2436 Int_t tracks = gAlice->GetNtrack();
2437 if (fPoints == 0) fPoints = new TObjArray(tracks);
2440 Int_t *ntrk=new Int_t[tracks];
2441 Int_t *limi=new Int_t[tracks];
2442 Float_t **coor=new Float_t*[tracks];
2443 for(Int_t i=0;i<tracks;i++) {
2449 AliPoints *points = 0;
2452 Int_t chunk=nhits/4+1;
2454 // Loop over all the hits and store their position
2456 ahit = FirstHit2(-1);
2457 //for (Int_t hit=0;hit<nhits;hit++) {
2459 // ahit = (AliHit*)fHits->UncheckedAt(hit);
2460 trk=ahit->GetTrack();
2461 if(ntrk[trk]==limi[trk]) {
2463 // Initialise a new track
2464 fp=new Float_t[3*(limi[trk]+chunk)];
2466 memcpy(fp,coor[trk],sizeof(Float_t)*3*limi[trk]);
2467 delete [] coor[trk];
2474 fp[3*ntrk[trk] ] = ahit->X();
2475 fp[3*ntrk[trk]+1] = ahit->Y();
2476 fp[3*ntrk[trk]+2] = ahit->Z();
2481 for(trk=0; trk<tracks; ++trk) {
2483 points = new AliPoints();
2484 points->SetMarkerColor(GetMarkerColor());
2485 points->SetMarkerSize(GetMarkerSize());
2486 points->SetDetector(this);
2487 points->SetParticle(trk);
2488 points->SetPolyMarker(ntrk[trk],coor[trk],GetMarkerStyle());
2489 fPoints->AddAt(points,trk);
2490 delete [] coor[trk];
2500 //_____________________________________________________________________________
2501 void AliTPC::LoadPoints3(Int_t)
2504 // Store x, y, z of all hits in memory
2505 // - only intersection point with pad row
2506 if (fTrackHits == 0) return;
2508 Int_t nhits = fTrackHits->GetEntriesFast();
2509 if (nhits == 0) return;
2510 Int_t tracks = gAlice->GetNtrack();
2511 if (fPoints == 0) fPoints = new TObjArray(2*tracks);
2512 fPoints->Expand(2*tracks);
2515 Int_t *ntrk=new Int_t[tracks];
2516 Int_t *limi=new Int_t[tracks];
2517 Float_t **coor=new Float_t*[tracks];
2518 for(Int_t i=0;i<tracks;i++) {
2524 AliPoints *points = 0;
2527 Int_t chunk=nhits/4+1;
2529 // Loop over all the hits and store their position
2531 ahit = FirstHit2(-1);
2532 //for (Int_t hit=0;hit<nhits;hit++) {
2536 // ahit = (AliHit*)fHits->UncheckedAt(hit);
2537 trk=ahit->GetTrack();
2538 Float_t x[3]={ahit->X(),ahit->Y(),ahit->Z()};
2539 Int_t index[3]={1,((AliTPChit*)ahit)->fSector,0};
2540 Int_t currentrow = fTPCParam->GetPadRow(x,index) ;
2541 if (currentrow!=lastrow){
2542 lastrow = currentrow;
2543 //later calculate intersection point
2544 if(ntrk[trk]==limi[trk]) {
2546 // Initialise a new track
2547 fp=new Float_t[3*(limi[trk]+chunk)];
2549 memcpy(fp,coor[trk],sizeof(Float_t)*3*limi[trk]);
2550 delete [] coor[trk];
2557 fp[3*ntrk[trk] ] = ahit->X();
2558 fp[3*ntrk[trk]+1] = ahit->Y();
2559 fp[3*ntrk[trk]+2] = ahit->Z();
2566 for(trk=0; trk<tracks; ++trk) {
2568 points = new AliPoints();
2569 points->SetMarkerColor(GetMarkerColor()+1);
2570 points->SetMarkerStyle(5);
2571 points->SetMarkerSize(0.2);
2572 points->SetDetector(this);
2573 points->SetParticle(trk);
2574 // points->SetPolyMarker(ntrk[trk],coor[trk],GetMarkerStyle()20);
2575 points->SetPolyMarker(ntrk[trk],coor[trk],30);
2576 fPoints->AddAt(points,tracks+trk);
2577 delete [] coor[trk];
2588 void AliTPC::FindTrackHitsIntersection(TClonesArray * arr)
2592 //fill clones array with intersection of current point with the
2597 const Int_t kcmaxhits=30000;
2598 TVector * xxxx = new TVector(kcmaxhits*4);
2599 TVector & xxx = *xxxx;
2600 Int_t maxhits = kcmaxhits;
2603 AliTPChit * tpcHit=0;
2604 tpcHit = (AliTPChit*)FirstHit2(-1);
2605 Int_t currentIndex=0;
2606 Int_t lastrow=-1; //last writen row
2609 if (tpcHit==0) continue;
2610 sector=tpcHit->fSector; // sector number
2611 ipart=tpcHit->Track();
2615 Float_t x[3]={tpcHit->X(),tpcHit->Y(),tpcHit->Z()};
2616 Int_t index[3]={1,sector,0};
2617 Int_t currentrow = fTPCParam->GetPadRow(x,index) ;
2618 if (currentrow<0) continue;
2619 if (lastrow<0) lastrow=currentrow;
2620 if (currentrow==lastrow){
2621 if ( currentIndex>=maxhits){
2623 xxx.ResizeTo(4*maxhits);
2625 xxx(currentIndex*4)=x[0];
2626 xxx(currentIndex*4+1)=x[1];
2627 xxx(currentIndex*4+2)=x[2];
2628 xxx(currentIndex*4+3)=tpcHit->fQ;
2632 if (currentIndex>2){
2644 for (Int_t index=0;index<currentIndex;index++){
2646 x=x2=x3=x4=xxx(index*4);
2654 sumy+=xxx(index*4+1);
2655 sumxy+=xxx(index*4+1)*x;
2656 sumx2y+=xxx(index*4+1)*x2;
2657 sumz+=xxx(index*4+2);
2658 sumxz+=xxx(index*4+2)*x;
2659 sumx2z+=xxx(index*4+2)*x2;
2660 sumq+=xxx(index*4+3);
2662 Float_t centralPad = (fTPCParam->GetNPads(sector,lastrow)-1)/2;
2663 Float_t det=currentIndex*(sumx2*sumx4-sumx3*sumx3)-sumx*(sumx*sumx4-sumx2*sumx3)+
2664 sumx2*(sumx*sumx3-sumx2*sumx2);
2666 Float_t detay=sumy*(sumx2*sumx4-sumx3*sumx3)-sumx*(sumxy*sumx4-sumx2y*sumx3)+
2667 sumx2*(sumxy*sumx3-sumx2y*sumx2);
2668 Float_t detaz=sumz*(sumx2*sumx4-sumx3*sumx3)-sumx*(sumxz*sumx4-sumx2z*sumx3)+
2669 sumx2*(sumxz*sumx3-sumx2z*sumx2);
2671 Float_t detby=currentIndex*(sumxy*sumx4-sumx2y*sumx3)-sumy*(sumx*sumx4-sumx2*sumx3)+
2672 sumx2*(sumx*sumx2y-sumx2*sumxy);
2673 Float_t detbz=currentIndex*(sumxz*sumx4-sumx2z*sumx3)-sumz*(sumx*sumx4-sumx2*sumx3)+
2674 sumx2*(sumx*sumx2z-sumx2*sumxz);
2676 Float_t y=detay/det+centralPad;
2677 Float_t z=detaz/det;
2678 Float_t by=detby/det; //y angle
2679 Float_t bz=detbz/det; //z angle
2680 sumy/=Float_t(currentIndex);
2681 sumz/=Float_t(currentIndex);
2683 AliComplexCluster cl;
2689 cl.fTracks[0]=ipart;
2691 AliTPCClustersRow * row = (fClustersArray->GetRow(sector,lastrow));
2692 if (row!=0) row->InsertCluster(&cl);
2695 } //end of calculating cluster for given row
2697 } // end of loop over hits
2701 //_______________________________________________________________________________
2702 void AliTPC::Digits2Reco(Int_t firstevent,Int_t lastevent)
2704 // produces rec points from digits and writes them on the root file
2705 // AliTPCclusters.root
2707 TDirectory *cwd = gDirectory;
2710 AliTPCParam *dig=(AliTPCParam *)gDirectory->Get("75x40_100x60");
2712 cout<<"AliTPC::Digits2Reco: TPC parameteres have been set"<<endl;
2714 if(!gSystem->Getenv("CONFIG_FILE")){
2715 out=TFile::Open("AliTPCclusters.root","recreate");
2721 tmp1=gSystem->Getenv("CONFIG_FILE_PREFIX");
2722 tmp2=gSystem->Getenv("CONFIG_OUTDIR");
2723 sprintf(tmp3,"%s%s/AliTPCclusters.root",tmp1,tmp2);
2724 out=TFile::Open(tmp3,"recreate");
2728 cout<<"AliTPC::Digits2Reco - determination of rec points begins"<<endl;
2731 for(Int_t iev=firstevent;iev<lastevent+1;iev++){
2733 printf("Processing event %d\n",iev);
2734 Digits2Clusters(out,iev);
2736 cout<<"AliTPC::Digits2Reco - determination of rec points ended"<<endl;