X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSsimulationFastPoints.cxx;h=c236f935f1beac6f4c62fa8b7e940dd6ead9b208;hb=0ff6d0b8a484743d451cf7a610ae8e36eeb96687;hp=5c6f36125da63a1885e3d72464a26e54809a98d8;hpb=4465d46846a6cffb6e4d101d91dab9f6337b2f4d;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSsimulationFastPoints.cxx b/ITS/AliITSsimulationFastPoints.cxx index 5c6f36125da..c236f935f1b 100644 --- a/ITS/AliITSsimulationFastPoints.cxx +++ b/ITS/AliITSsimulationFastPoints.cxx @@ -13,33 +13,14 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -Revision 1.10 2002/06/10 17:30:24 nilsen -A new CreateFastRecPoints has been made and the old one made compatible. +/* $Id$ */ +////////////////////////////////////////////////////////// +// implements fast simulation // +// // +// // +////////////////////////////////////////////////////////// -Revision 1.9 2001/10/01 19:36:03 nilsen -fixed a compilation warning about unused variable. -Revision 1.8 2001/07/27 08:06:49 hristov -Use global gRandom generator (M.Ivanov) - -Revision 1.7 2001/05/11 09:15:21 barbera -Corrected to make fast point creation working with PPR geometry - -Revision 1.6 2000/10/29 18:30:14 barbera -Z resolution of pixel changed according with the default lenght of 425 microns - -Revision 1.1.2.6 2000/10/29 18:29:51 barbera -Z resolution of pixel changed according with the default lenght of 425 microns - -Revision 1.1.2.5 2000/10/02 16:03:20 barbera -Forward declarations added - -Revision 1.4 2000/09/22 12:43:59 nilsen -Default track number set to -3 and not 0. - -*/ #include #include "AliITS.h" @@ -71,91 +52,95 @@ AliITSsimulationFastPoints::AliITSsimulationFastPoints() } //------------------------------------------------------------- -void AliITSsimulationFastPoints::CreateFastRecPoints(Int_t module){ +void AliITSsimulationFastPoints::CreateFastRecPoints(Int_t module, TClonesArray* recp){ // Fast points simulator AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS"); CreateFastRecPoints((AliITSmodule *)(aliITS->GetModule(module)), - module,gRandom); + module,gRandom,recp); } //------------------------------------------------------------- void AliITSsimulationFastPoints::CreateFastRecPoints(AliITSmodule *mod, Int_t module, - TRandom *random){ - // Fast points simulator - AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS"); - AliITSgeom *gm = aliITS->GetITSgeom(); - - const Float_t kdEdXtoQ = 2.778e+8; - - Int_t ihit,flag,numofhits; - Float_t locals[3]; - Float_t globals[3]; - Double_t sigmarphi=0., sigmaz=0., sigmade=0., thrde=0.; - Float_t deltaXl,deltaZl,deltaDe; - - Int_t hitlay, hitlad, hitdet, hitstatus; - Float_t hitpx, hitpy, hitpz, hitdestep; - - Int_t hitstatus1, hittrack1; - Float_t hitx1, hity1, hitz1; - Float_t hitdestep1; - Float_t xMg,yMg,zMg; - - numofhits = mod->GetNhits(); - //printf("numofhits %d \n",numofhits); - for(ihit=0;ihitGetHit(ihit); - hit->GetPositionG(hitx1,hity1,hitz1); - hitstatus1 = hit->GetTrackStatus(); - hitdestep1 = hit->GetIonization(); - hittrack1 = hit->GetTrack(); - - mod->MedianHit(module,hitx1,hity1,hitz1,hitstatus1,xMg,yMg,zMg,flag); - if (flag!=1) { - hitdestep = hit->GetIonization(); - - if (hitdestep > 0) { - hit->GetDetectorID(hitlay,hitlad,hitdet); - hit->GetMomentumG(hitpx,hitpy,hitpz); - hitstatus = hitstatus1; + TRandom *random, + TClonesArray* recp) { + // Fast points simulator + + TClonesArray &pt=*recp; + AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS"); + AliITSgeom *gm = aliITS->GetITSgeom(); + const Float_t kdEdXtoQ = 2.778e+8; + + Int_t lay,lad,det; + gm->GetModuleId(module,lay,lad,det); + Int_t ind=(lad-1)*gm->GetNdetectors(lay)+(det-1); + Int_t lyr=(lay-1); + + + Int_t ihit,flag,numofhits; + Float_t locals[3]; + Float_t globals[3]; + Double_t sigmarphi=0., sigmaz=0., sigmade=0., thrde=0.; + Float_t deltaXl,deltaZl,deltaDe; + + Int_t hitlay, hitlad, hitdet, hitstatus; + Float_t hitpx, hitpy, hitpz, hitdestep; + + Int_t hitstatus1, hittrack1; + Float_t hitx1, hity1, hitz1; + Float_t hitdestep1; + Float_t xMg,yMg,zMg; + Int_t irecp=0; + numofhits = mod->GetNhits(); + //printf("numofhits %d \n",numofhits); + for(ihit=0;ihitGetHit(ihit); + hit->GetPositionG(hitx1,hity1,hitz1); + hitstatus1 = hit->GetTrackStatus(); + hitdestep1 = hit->GetIonization(); + hittrack1 = hit->GetTrack(); + + mod->MedianHit(module,hitx1,hity1,hitz1,hitstatus1,xMg,yMg,zMg,flag); + if (flag!=1) { + hitdestep = hit->GetIonization(); + + if (hitdestep > 0) { + hit->GetDetectorID(hitlay,hitlad,hitdet); + hit->GetMomentumG(hitpx,hitpy,hitpz); + hitstatus = hitstatus1; // Transform to the module local frame - globals[0] = xMg; - globals[1] = yMg; - globals[2] = zMg; - gm->GtoL(hitlay,hitlad,hitdet,globals,locals); - // Retrieve sigma values for position and energy, and energy - // threshold - sigmarphi = SigmaRPhi(hitlay); - sigmaz = SigmaZ(hitlay); - sigmade = SigmaDe(hitlay); - thrde = ThrDe(hitlay); - deltaXl = random->Gaus(0,sigmarphi); - deltaZl = random->Gaus(0,sigmaz); - deltaDe = random->Gaus(0,sigmade); - - // Apply energy threshold and trasform back to global reference - // system - - if ( (hitdestep+deltaDe) > thrde ){ - locals[0] += deltaXl; - locals[2] += deltaZl; - AliITSRecPoint rp; - rp.fTracks[0]=hit->GetTrack(); - // rp.fTracks[0]=mod->GetHitTrackIndex(ihit); - rp.fTracks[1]=-3; - rp.fTracks[2]=-3; - rp.SetX(locals[0]); - rp.SetZ(locals[2]); - rp.SetdEdX(hitdestep+deltaDe); - rp.SetQ(kdEdXtoQ*(hitdestep+deltaDe)); // number of e - rp.SetSigmaX2(sigmarphi*sigmarphi); - rp.SetSigmaZ2(sigmaz*sigmaz); - aliITS->AddRecPoint(rp); - } // end if ( (hitdestep+deltaDe) - } // end if (hitdestep > 0) - } // end if (flag!=1) - } // end for ihit + globals[0] = xMg; + globals[1] = yMg; + globals[2] = zMg; + gm->GtoL(hitlay,hitlad,hitdet,globals,locals); + // Retrieve sigma values for position and energy, and energy + // threshold + sigmarphi = SigmaRPhi(hitlay); + sigmaz = SigmaZ(hitlay); + sigmade = SigmaDe(hitlay); + thrde = ThrDe(hitlay); + deltaXl = random->Gaus(0,sigmarphi); + deltaZl = random->Gaus(0,sigmaz); + deltaDe = random->Gaus(0,sigmade); + + // Apply energy threshold and trasform back to global reference + // system + + if ( (hitdestep+deltaDe) > thrde ){ + locals[0] += deltaXl; + locals[2] += deltaZl; + Int_t lab[4] = {hit->GetTrack(),-3,-3,ind}; + Float_t hit[5] = {locals[0],locals[2],sigmarphi*sigmarphi,sigmaz*sigmaz,kdEdXtoQ*(hitdestep+deltaDe)}; + Int_t info[3] = {0,0,lyr}; + AliITSRecPoint rp(lab,hit,info,kTRUE); + rp.SetdEdX(hitdestep+deltaDe); + + new (pt[irecp]) AliITSRecPoint(rp); + irecp++; + } // end if ( (hitdestep+deltaDe) + } // end if (hitdestep > 0) + } // end if (flag!=1) + } // end for ihit } //_______________________________________________________________________ void AliITSsimulationFastPoints::SetSigmaRPhi(Double_t srphi[6])