1 /**************************************************************************
2 * Copyright(c) 1998-2003, 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 **************************************************************************/
15 /////////////////////////////////////////////////////////////////////////
16 // ALICE HLT DISPLAY CLASS //
17 // Author: Mayeul ROUSSELET //
18 // e-mail: Mayeul.Rousselet@cern.ch //
19 // Last update:26/08/2003 //
20 /////////////////////////////////////////////////////////////////////////
22 #include <TPolyMarker3D.h>
24 #include "AliDisplayHLT.h"
25 #include "AliDisplay2.h"
26 #include "AliModuleInfo.h"
29 #include "AliL3MemHandler.h"
30 #include "AliL3SpacePointData.h"
31 #include "AliL3Transform.h"
32 #include "AliL3Logging.h"
35 ClassImp(AliDisplayHLT)
37 //_____________________________________________________________
38 AliDisplayHLT::AliDisplayHLT()
40 // Default constructor
41 fPoints = new TPolyMarker3D[gAliDisplay2->GetNbModules()];
42 fName = new char*[gAliDisplay2->GetNbModules()];
44 for(Int_t i=0;i<gAliDisplay2->GetNbModules();i++){
45 fPoints[i].SetMarkerSize(0.2);
46 fPoints[i].SetMarkerColor(2);
47 fPoints[i].SetMarkerStyle(1);
51 //_____________________________________________________________
52 AliDisplayHLT::~AliDisplayHLT()
57 //_____________________________________________________________
58 void AliDisplayHLT::LoadHLT(const char *name,Int_t nevent)
60 // Loads HLT clusters of TPC
61 if(strstr(name,"TPC")) LoadHLTTPC(nevent);
64 //_____________________________________________________________
65 void AliDisplayHLT::LoadHLTTPC(Int_t nevent)
67 //load TPC Clusters from the raw data
68 //raw data must be in the directorie $ALICE_ROOT/raw
69 //First we read the data from files
70 //do_mc MUST BE DEFINED AND USED FOR RAW DATA GENERATION
73 fName[fNb]=new char[strlen("TPC")];
74 strcpy(fName[fNb],"TPC");
76 AliL3MemHandler *clusterfile[36][6];
77 AliL3SpacePointData *fClusters[36][6];
79 memset(fClusters,0,36*6*sizeof(AliL3SpacePointData*));
80 // strcpy(path,gSystem->Getenv("ALICE_ROOT"));
81 //strcat(path,"/raw");
82 //printf("\nRaw data path %s",path);
84 strcpy(path,gAliDisplay2->GetRawDataPath());
85 for(Int_t s=0; s<36; s++)
87 for(Int_t p=0; p<AliL3Transform::GetNPatches(); p++)
91 clusterfile[s][p] = new AliL3MemHandler();
93 sprintf(fname,"%s/points_%d_%d.raw",path,s,patch);
95 sprintf(fname,"%s/points_%d_%d_%d.raw",path,nevent,s,patch);
96 if(!clusterfile[s][p]->SetBinaryInput(fname))
98 LOG(AliL3Log::kError,"AliL3Evaluation::Setup","File Open")
99 <<"Inputfile "<<fname<<" does not exist"<<ENDLOG;
100 delete clusterfile[s][p];
101 clusterfile[s][p] = 0;
104 fClusters[s][p] = (AliL3SpacePointData*)clusterfile[s][p]->Allocate();
105 clusterfile[s][p]->Binary2Memory(fNcl[s][p],fClusters[s][p]);
106 clusterfile[s][p]->CloseBinaryInput();
111 //Second step: we assign the clusters to the fPoints array
113 for(Int_t s=0; s<36; s++){
114 for(Int_t p=0;p<6;p++){
115 AliL3SpacePointData *points = fClusters[s][p];
116 if(!points) continue;
118 for(UInt_t i=0; i<fNcl[s][p]; i++){
119 xyz[0] = points[i].fX;
120 xyz[1] = points[i].fY;
121 xyz[2] = points[i].fZ;
122 fPoints[fNb].SetPoint(i+nbc,xyz[0],xyz[1],xyz[2]);
129 printf("This is event %d\n",nevent);
133 //_____________________________________________________________
134 void AliDisplayHLT::Draw()
136 // Draws HLT clusters
137 for(Int_t i=0;i<fNb;i++){
138 if(gAliDisplay2->GetModuleInfo()->IsEnabled(fName[i])) fPoints[i].Draw();