#include "AliTRDdigitsManager.h"
#include "AliTRDgeometry.h"
#include "AliTRDhit.h"
-#include "AliTRDpoints.h"
#include "AliTRDrawData.h"
#include "AliTRDSimParam.h"
#include "AliTRDCommonParam.h"
}
-//_____________________________________________________________________________
-void AliTRD::LoadPoints(Int_t )
-{
- //
- // Store x, y, z of all hits in memory.
- // Hit originating from TR photons are given a different color
- //
-
- if (fHits == 0) {
- return;
- }
-
- Int_t nhits = fHits->GetEntriesFast();
- if (nhits == 0) {
- return;
- }
-
- Int_t tracks = gAlice->GetMCApp()->GetNtrack();
- if (fPoints == 0) {
- fPoints = new TObjArray(tracks);
- }
-
- AliTRDhit *ahit;
-
- Int_t *ntrkE = new Int_t[tracks];
- Int_t *ntrkT = new Int_t[tracks];
- Int_t *limiE = new Int_t[tracks];
- Int_t *limiT = new Int_t[tracks];
- Float_t **coorE = new Float_t*[tracks];
- Float_t **coorT = new Float_t*[tracks];
- for(Int_t i = 0; i < tracks; i++) {
- ntrkE[i] = 0;
- ntrkT[i] = 0;
- coorE[i] = 0;
- coorT[i] = 0;
- limiE[i] = 0;
- limiT[i] = 0;
- }
-
- AliTRDpoints *points = 0;
- Float_t *fp = 0;
- Int_t trk;
- Int_t chunk = nhits / 4 + 1;
-
- // Loop over all the hits and store their position
- ahit = (AliTRDhit *) FirstHit(-1);
- while (ahit) {
-
- // dEdx hits
- if (ahit->GetCharge() >= 0) {
-
- trk = ahit->GetTrack();
- if (ntrkE[trk] == limiE[trk]) {
- // Initialise a new track
- fp = new Float_t[3*(limiE[trk]+chunk)];
- if (coorE[trk]) {
- memcpy(fp,coorE[trk],sizeof(Float_t)*3*limiE[trk]);
- delete [] coorE[trk];
- }
- limiE[trk] += chunk;
- coorE[trk] = fp;
- }
- else {
- fp = coorE[trk];
- }
- fp[3*ntrkE[trk] ] = ahit->X();
- fp[3*ntrkE[trk]+1] = ahit->Y();
- fp[3*ntrkE[trk]+2] = ahit->Z();
- ntrkE[trk]++;
-
- }
- // TR photon hits
- else if ((ahit->GetCharge() < 0) &&
- (fDrawTR)) {
-
- trk = ahit->GetTrack();
- if (ntrkT[trk] == limiT[trk]) {
- // Initialise a new track
- fp = new Float_t[3*(limiT[trk]+chunk)];
- if (coorT[trk]) {
- memcpy(fp,coorT[trk],sizeof(Float_t)*3*limiT[trk]);
- delete [] coorT[trk];
- }
- limiT[trk] += chunk;
- coorT[trk] = fp;
- }
- else {
- fp = coorT[trk];
- }
- fp[3*ntrkT[trk] ] = ahit->X();
- fp[3*ntrkT[trk]+1] = ahit->Y();
- fp[3*ntrkT[trk]+2] = ahit->Z();
- ntrkT[trk]++;
-
- }
-
- ahit = (AliTRDhit *) NextHit();
-
- }
-
- for (trk = 0; trk < tracks; ++trk) {
-
- if (ntrkE[trk] || ntrkT[trk]) {
-
- points = new AliTRDpoints();
- points->SetDetector(this);
- points->SetParticle(trk);
-
- // Set the dEdx points
- if (ntrkE[trk]) {
- points->SetMarkerColor(kWhite); //PH This is the default color in TRD
- points->SetMarkerSize(1); //PH Default size=1
- points->SetPolyMarker(ntrkE[trk],coorE[trk],1); //PH Default style=1
- delete [] coorE[trk];
- coorE[trk] = 0;
- }
-
- // Set the TR photon points
- if (ntrkT[trk]) {
- points->SetTRpoints(ntrkT[trk],coorT[trk]);
- delete [] coorT[trk];
- coorT[trk] = 0;
- }
-
- fPoints->AddAt(points,trk);
-
- }
-
- }
-
- delete [] coorE;
- delete [] coorT;
- delete [] ntrkE;
- delete [] ntrkT;
- delete [] limiE;
- delete [] limiT;
-
-}
-
//_____________________________________________________________________________
void AliTRD::ResetDigits()
{