+
+
+
+// -----------------------------------------------------------------
+Int_t processEMCALClusters(AliHLTHOMERBlockDesc* block) {
+
+ cout << "EMCAL"<<endl;
+
+ AliHLTCaloChannelDataHeaderStruct *dhs = reinterpret_cast<AliHLTCaloChannelDataHeaderStruct*> (block->GetData());
+ Short_t nC = dhs->fNChannels;
+ AliHLTUInt8_t *ui = reinterpret_cast<AliHLTUInt8_t*>(dhs) + sizeof(AliHLTCaloChannelDataHeaderStruct);
+ AliHLTCaloChannelDataStruct *ds = reinterpret_cast<AliHLTCaloChannelDataStruct*>(ui);
+
+ UShort_t fX =0;
+ UShort_t fZ =0;
+ UShort_t fGain =0;
+ UShort_t fModuleId =0;
+
+
+
+ for(Short_t s = 0; s < nC; s++ ) {
+
+ fX = ds->fChannelID&0x3f;
+ fZ = (ds->fChannelID >> 6)&0x3f;
+ fGain = (ds->fChannelID >> 12)&0x1;
+ fModuleId = (ds->fChannelID >> 13)&0x1f;
+
+ // cout << fX << " " << fZ << " " << fGain << " " << fModuleId <<endl;
+
+ if ( ( fModuleId < 12 ) ) {
+ gEMCALBoxSet[fModuleId]->AddBox(10, fX*6-12*6, fZ*6-24*6, ds->fEnergy/4, 6, 6);
+ gEMCALBoxSet[fModuleId]->DigitValue(static_cast<Int_t>(ds->fEnergy));
+ }
+ ds++;
+
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------
+Int_t processITSClusters(AliHLTHOMERBlockDesc* block, TEvePointSet* cont) {
+
+ AliHLTITSClusterData *cd = reinterpret_cast<AliHLTITSClusterData*> (block->GetData());
+ UChar_t *data = reinterpret_cast<UChar_t*> (cd->fSpacePoints);
+
+ if ( cd->fSpacePointCnt != 0 ) {
+ for (Int_t iter = 0; iter < cd->fSpacePointCnt; ++iter, data += sizeof(AliHLTITSSpacePointData)) {
+ AliHLTITSSpacePointData *sp = reinterpret_cast<AliHLTITSSpacePointData*> (data);
+
+ Int_t lab[4] = {0,0,0,0};
+ Float_t hit[6] = {0,0,0,0,0,0};
+ Int_t info[3] = {0,0,0};
+
+ lab[0] = sp->fTracks[0];
+ lab[1] = sp->fTracks[1];
+ lab[2] = sp->fTracks[2];
+ lab[3] = sp->fIndex;
+ hit[0] = sp->fY;
+ hit[1] = sp->fZ;
+ hit[2] = sp->fSigmaY2;
+ hit[3] = sp->fSigmaZ2;
+ hit[4] = sp->fQ;
+ hit[5] = sp->fSigmaYZ;
+ info[0] = sp->fNy;
+ info[1] = sp->fNz;
+ info[2] = sp->fLayer;
+
+ Float_t xyz[3];
+ AliITSRecPoint recpoint(lab,hit,info);
+ recpoint.GetGlobalXYZ(xyz);
+
+ cont->SetNextPoint(xyz[0], xyz[1], xyz[2]);
+ }
+ }
+ return 0;
+}
+
+// -----------------------------------------------------------------
+Int_t processTPCClusters(AliHLTHOMERBlockDesc* block, TEvePointSet* cont, TEvePointSetArray *contCol ) {
+
+
+
+ Int_t slice = block->GetSubDetector();
+ Float_t phi = ( slice + 0.5 ) * TMath::Pi() / 9.0;
+ Float_t cos = TMath::Cos( phi );
+ Float_t sin = TMath::Sin( phi );
+
+ AliHLTTPCClusterData *cd = reinterpret_cast<AliHLTTPCClusterData*> (block->GetData());
+ UChar_t *data = reinterpret_cast<UChar_t*> (cd->fSpacePoints);
+
+
+ if(!gTPCCanvas){
+ gTPCCanvas = gEve->AddCanvasTab("TPC QA");
+ gTPCCharge = new TH1F("ClusterCharge","ClusterCharge",100,0,500);
+ gTPCQMax = new TH1F("QMax","QMax",50,0,250);
+ gTPCQMaxOverCharge = new TH1F("QMaxOverCharge","QMaxOverCharge",50,0,1);
+ }
+
+
+
+
+
+
+
+
+
+ if ( cd->fSpacePointCnt != 0 ) {
+ for (Int_t iter = 0; iter < cd->fSpacePointCnt; ++iter, data += sizeof(AliHLTTPCSpacePointData)) {
+ AliHLTTPCSpacePointData *sp = reinterpret_cast<AliHLTTPCSpacePointData*> (data);
+ cont->SetNextPoint(cos*sp->fX - sin*sp->fY, sin*sp->fX + cos*sp->fY, sp->fZ);
+ if (contCol)
+ contCol->Fill(cos*sp->fX - sin*sp->fY, sin*sp->fX + cos*sp->fY, sp->fZ, sp->fCharge);
+
+ gTPCCharge->Fill(sp->fCharge);
+ gTPCQMax->Fill(sp->fQMax);
+ gTPCQMaxOverCharge->Fill(((Float_t)sp->fQMax)/((Float_t)sp->fCharge));
+ }
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------
+Int_t processMUONClusters(AliHLTHOMERBlockDesc* block) {
+
+ Int_t iResult = 0;
+
+ unsigned long size = block->GetSize();
+ Int_t * buffer ;
+
+ buffer = (Int_t *)block->GetData();
+// cout<<"block size : "<<size<<", buffer : "<<buffer<<", DataType : "<<block->GetDataType()<<endl;
+
+// // for(int idata=0;idata<int(size);idata++)
+// // printf("\tbuffer[%d] : %d\n",idata,buffer[idata]);
+
+
+
+ if(block->GetDataType().CompareTo("RECHITS") == 0){
+
+ AliHLTMUONRecHitsBlockReader trackblock((char*)buffer, size);
+ const AliHLTMUONRecHitStruct* hit = trackblock.GetArray();
+
+ for(AliHLTUInt32_t ientry = 0; ientry < trackblock.Nentries(); ientry++){
+// cout << setw(13) << left << hit->fX << setw(0);
+// cout << setw(13) << left << hit->fY << setw(0);
+// cout << hit->fZ << setw(0) << endl;
+ if(hit->fX!=0.0 && hit->fY!=0.0 && hit->fZ!=0.0)
+ gMUONClusters->SetNextPoint(hit->fX,hit->fY,hit->fZ);
+ hit++;
+
+ }// track hit loop
+ }
+
+ else{// if rechits
+ // if(!strcmp((BlockType(ULong64_t(reader->GetBlockDataType(i)))).Data(),"TRIGRECS")){
+
+ AliHLTMUONTriggerRecordsBlockReader trigblock(buffer, size);
+ const AliHLTMUONTriggerRecordStruct* trigrec = trigblock.GetArray();
+ for(AliHLTUInt32_t ientry = 0; ientry < trigblock.Nentries(); ientry++){
+
+ const AliHLTMUONRecHitStruct* hit = &trigrec->fHit[0];
+ for(AliHLTUInt32_t ch = 0; ch < 4; ch++)
+ {
+// cout << setw(10) << left << ch + 11 << setw(0);
+// cout << setw(13) << left << hit->fX << setw(0);
+// cout << setw(13) << left << hit->fY << setw(0);
+// cout << hit->fZ << setw(0) << endl;
+ if(hit->fX!=0.0 && hit->fY!=0.0 && hit->fZ!=0.0)
+ gMUONClusters->SetNextPoint(hit->fX,hit->fY,hit->fZ);
+ hit++;
+ }// trig chamber loop
+ trigrec++;
+ }//trig hit loop
+ }//else trigger
+
+ return iResult;
+}
+
+// -----------------------------------------------------------------
+Int_t processMUONTracks(AliHLTHOMERBlockDesc* block) {
+
+ Int_t iResult = 0;
+
+ unsigned long size = block->GetSize();
+ Int_t * buffer = (Int_t *)block->GetData();
+ AliHLTMUONRecHitStruct hit1,hit2;
+ hit1.fX = hit1.fY = hit1.fZ = hit2.fX = hit2.fY = hit2.fZ = 0;
+ Int_t ch1=0, ch2=0;
+ Float_t x0=0.0,y0=0.0,z0=0.0;
+ Float_t x3=0.0,y3=0.0,z3=0.0;
+ if(block->GetDataType().CompareTo("MANTRACK") == 0){
+ AliHLTMUONMansoTracksBlockReader mantrackblock(buffer, size);
+ const AliHLTMUONMansoTrackStruct* mtrack = mantrackblock.GetArray();
+ for(AliHLTUInt32_t ientry = 0; ientry < mantrackblock.Nentries(); ientry++){
+ const AliHLTMUONRecHitStruct* hit = &mtrack->fHit[0];
+ for(AliHLTUInt32_t ch = 0; ch < 4; ch++){
+ // cout << setw(10) << left << ch + 7 << setw(0);
+ // cout << setw(13) << left << hit->fX << setw(0);
+ // cout << setw(13) << left << hit->fY << setw(0);
+ // cout << hit->fZ << setw(0) << endl;
+ if(hit->fZ != 0.0){
+ if(ch==0 || ch==1){
+ hit1 = *hit; ch1 = ch+6;
+ }else{
+ hit2 = *hit; ch2 = ch+6;
+ }
+ }
+ hit++;
+ }// trig chamber loop
+ // printf("ch : %d, (X,Y,Z) : (%f,%f,%f)\n",ch1,hit1.fX,hit1.fY,hit1.fZ);
+ // printf("ch : %d, (X,Y,Z) : (%f,%f,%f)\n",ch2,hit2.fX,hit2.fY,hit2.fZ);
+ // meminfo();
+ z3 = AliMUONConstants::DefaultChamberZ(ch2+4);
+ y3 = hit1.fY - (hit1.fZ-z3)*(hit1.fY - hit2.fY)/(hit1.fZ - hit2.fZ) ;
+ x3 = hit1.fX - (hit1.fZ-z3)*(hit1.fX - hit2.fX)/(hit1.fZ - hit2.fZ) ;
+
+ z0 = AliMUONConstants::DefaultChamberZ(ch1);
+ y0 = hit1.fY - (hit1.fZ-z0)*(hit1.fY - hit2.fY)/(hit1.fZ - hit2.fZ) ;
+ x0 = hit1.fX - (hit1.fZ-z0)*(hit1.fX - hit2.fX)/(hit1.fZ - hit2.fZ) ;
+
+
+ gMUONTracks->AddLine(x0,y0,z0,x3,y3,z3);
+ mtrack++;
+ }
+ cout<<"NofManso Tracks : "<<mantrackblock.Nentries()<<endl;
+ }
+
+ return iResult;
+
+}
+
+
+// -----------------------------------------------------------------
+Int_t processTRDClusters(AliHLTHOMERBlockDesc* block, TEvePointSet *cont, TEvePointSetArray *contCol) {
+
+ Int_t iResult = 0;
+
+ Int_t sm = block->GetSubDetector();
+ if ( sm == 6 ) sm = 7;
+
+ Float_t phi = ( sm + 0.5 ) * TMath::Pi() / 9.0;
+ Float_t cos = TMath::Cos( phi );
+ Float_t sin = TMath::Sin( phi );
+
+ Byte_t* ptrData = reinterpret_cast<Byte_t*>(block->GetData());
+ UInt_t ptrSize = block->GetSize();
+
+ for (UInt_t size = 0; size+sizeof(AliHLTTRDCluster) <= ptrSize; size+=sizeof(AliHLTTRDCluster) ) {
+ AliHLTTRDCluster *cluster = reinterpret_cast<AliHLTTRDCluster*>(&(ptrData[size]));
+
+ AliTRDcluster *trdCluster = new AliTRDcluster;
+ cluster->ExportTRDCluster( trdCluster );
+
+ contCol->Fill(cos*trdCluster->GetX() - sin*trdCluster->GetY(),
+ sin*trdCluster->GetX() + cos*trdCluster->GetY(),
+ trdCluster->GetZ(),
+ trdCluster->GetQ() );
+
+ cont->SetNextPoint(cos*trdCluster->GetX() - sin*trdCluster->GetY(),
+ sin*trdCluster->GetX() + cos*trdCluster->GetY(), trdCluster->GetZ());
+ }
+
+ return iResult;
+}
+
+// -----------------------------------------------------------------
+Int_t processTRDHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {
+
+ Int_t iResult = 0;
+
+ if ( ! block->GetClassName().CompareTo("TH1F")) {
+ TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());
+ ++gTRDHistoCount;
+
+ TVirtualPad* pad = canvas->cd(gTRDHistoCount);
+ histo->Draw();
+ pad->SetGridy();
+ pad->SetGridx();
+
+ if ( ! strcmp(histo->GetName(), "nscls") ) {
+ gTRDEvents = static_cast<Int_t>(histo->GetEntries());
+ histo->GetXaxis()->SetRangeUser(0.,15.);
+ }
+
+ if ( ! strcmp(histo->GetName(),"sclsdist") ||
+ ! strcmp(histo->GetName(),"evSize") )
+ pad->SetLogy();
+ }
+
+ gTRDCanvas->Update();
+
+ return iResult;
+}
+
+// -----------------------------------------------------------------
+Int_t processPrimVertexHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {
+
+ Int_t iResult = 0;
+
+ if ( ! block->GetClassName().CompareTo("TH1F")) {
+ TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());
+ if( histo ){
+ TString name(histo->GetName());
+ if( !name.CompareTo("primVertexZ") ){
+ canvas->cd(2);
+ histo->Draw();
+ }else if( !name.CompareTo("primVertexX") ){
+ canvas->cd(3);
+ histo->Draw();
+ }else if( !name.CompareTo("primVertexY") ){
+ canvas->cd(4);
+ histo->Draw();
+ }
+ }
+ } else if ( ! block->GetClassName().CompareTo("TH2F")) {
+ TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject());
+ if (hista ){
+ TString name(hista->GetName());
+ if( !name.CompareTo("primVertexXY")) {
+ canvas->cd(1);
+ hista->Draw();
+ }
+ }
+ }
+ canvas->cd();
+
+ return iResult;
+}
+
+// -----------------------------------------------------------------
+Int_t processSPDVertexHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {
+
+ Int_t iResult = 0;
+
+ if ( ! block->GetClassName().CompareTo("TH1F")) {
+ TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());
+ ++gSPDVertexHistoCount;
+
+ canvas->cd(gSPDVertexHistoCount);
+ histo->Draw();
+
+ }
+ else if ( ! block->GetClassName().CompareTo("TH2F")) {
+ TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject());
+ if (hista) {
+ ++gSPDVertexHistoCount;
+
+ canvas->cd(gSPDVertexHistoCount);
+ hista->Draw();
+ }
+ }
+ canvas->cd();
+
+ return iResult;
+}
+
+// -----------------------------------------------------------------
+Int_t processV0Histograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {
+
+ cout << "Processing to see if it's V0 histogram, !!!!!!!!!"<<endl;
+
+ Int_t iResult = 0;
+ bool update = 0;
+ if ( ! block->GetClassName().CompareTo("TH1F")) {
+ TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());
+ if( histo ){
+ TString name(histo->GetName());
+ if( !name.CompareTo("hKShort") ){
+ canvas->cd(1);
+ histo->Draw();
+ update = 1;
+ }else if( !name.CompareTo("hLambda") ){
+ canvas->cd(3);
+ histo->Draw();
+ update = 1;
+ }
+ }
+ } else if ( ! block->GetClassName().CompareTo("TH2F")) {
+ TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject());
+ if (hista ){
+ TString name(hista->GetName());
+ if( !name.CompareTo("hAP")) {
+ canvas->cd(2);
+ hista->Draw();
+ update = 1;
+ }
+ else if( !name.CompareTo("hGammaXY")) {
+ canvas->cd(4);
+ hista->Draw();
+ update = 1;
+ }
+ }
+ }
+ if( update ){
+ canvas->cd();
+ canvas->Update();
+ }
+ return iResult;
+}
+
+
+// -----------------------------------------------------------------
+Int_t processITSHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {
+
+ Int_t iResult = 0;
+
+ if ( ! block->GetClassName().CompareTo("TH1F")) {
+ TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());
+ ++gITSHistoCount;
+
+ canvas->cd(gITSHistoCount);
+ histo->Draw();
+
+ }
+ else if ( ! block->GetClassName().CompareTo("TH2F")) {
+ TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject());
+ if (hista) {
+ ++gITSHistoCount;
+
+ canvas->cd(gITSHistoCount);
+ hista->Draw("COLZ");
+ }
+ }
+ canvas->cd();
+
+ return iResult;
+}
+
+
+Int_t AddHistogramsToCanvas(AliHLTHOMERBlockDesc * block, TCanvas * canvas, Int_t &cdCount ) {
+
+ if (canvas == NULL)
+ cout <<"fucked canvasn"<<endl;
+
+
+ Int_t iResult = 0;
+
+ if ( ! block->GetClassName().CompareTo("TObjArray")) {
+ TIter next((TObjArray*)(block->GetTObject()));
+ TObject *object;
+ while (( object = (TObject*) next())) {
+ TH1* histo = dynamic_cast<TH1*>(object);
+ cout <<" cd "<< cdCount << endl;
+ canvas->cd(++cdCount);
+ cout <<"draw"<<endl;
+ histo->Draw();
+ cout <<"drew"<<endl;
+ }
+ }
+
+ // canvas->cd();
+ canvas->Update();
+
+ return iResult;
+}
+
+
+// -----------------------------------------------------------------
+Int_t processSSDHistograms(AliHLTHOMERBlockDesc* block, TCanvas *canvas0, TCanvas *canvas1) {
+
+ Int_t iResult = 0;
+
+ if ( ! block->GetClassName().CompareTo("TH1F")) {
+ TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());
+ ++gSSDHistoCount0;
+
+ canvas0->cd(gSSDHistoCount0);
+ histo->Draw();
+ }
+ else if ( ! block->GetClassName().CompareTo("TH2F")) {
+ TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject());
+ if (hista) {
+ ++gSSDHistoCount1;
+
+ canvas1->cd(gSSDHistoCount1);
+ hista->Draw("COLZ");
+ }
+ } else if ( ! block->GetClassName().CompareTo("TObjArray")) {
+ TIter next((TObjArray*)(block->GetTObject()));
+ TObject *object;
+ while (( object = (TObject*) next())) {
+ TString string;
+ string = "TH1F";
+ TString string2;
+ string2 = "TH2F";
+
+ if ( !(string.CompareTo(object->ClassName())) ) {
+ TH1F* histo = reinterpret_cast<TH1F*>(object);
+ ++gSSDHistoCount0;
+
+ canvas0->cd(gSSDHistoCount0);
+ histo->Draw();
+
+ }
+ else if ( !(string2.CompareTo(object->ClassName()) ) ) {
+ TH2F* histo = reinterpret_cast<TH2F*>(object);
+ ++gSSDHistoCount1;
+
+ canvas1->cd(gSSDHistoCount1);
+ histo->Draw("COLZ");
+ }
+ }
+ }
+
+ canvas0->cd(); canvas1->cd();
+
+ return iResult;
+}
+
+
+//*--------------------------------------------------------------------------------------
+Int_t processTRDCalibHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {
+ Int_t iResult = 0;
+
+ TObjArray *HistArray=(TObjArray*)block->GetTObject();
+ Int_t nCalibHistos=HistArray->GetEntriesFast();
+ for(Int_t CalibHistoCount=0;CalibHistoCount<nCalibHistos;CalibHistoCount++){
+ canvas->cd(CalibHistoCount+1);
+
+ if(HistArray->At(CalibHistoCount)->InheritsFrom("TH2S")){
+ TH2S *histCalib=(TH2S*)(HistArray->At(CalibHistoCount));
+ histCalib->Draw("colz");
+ }
+ else if(HistArray->At(CalibHistoCount)->InheritsFrom("TH2")){
+ //TH2D *histCalib=dynamic_cast<TH2D*>(HistArray->At(CalibHistoCount));
+ TH2D *histCalib=(TH2D*)(HistArray->At(CalibHistoCount));
+ histCalib->Draw("lego2");
+ }
+ else if(HistArray->At(CalibHistoCount)->InheritsFrom("TH1")){
+ //TH1D *histCalib=dynamic_cast<TH1D*>(HistArray->At(CalibHistoCount));
+ TH1D *histCalib=(TH1D*)(HistArray->At(CalibHistoCount));
+ histCalib->Draw();
+ }
+ else if(HistArray->At(CalibHistoCount)->InheritsFrom("AliTRDCalibraVdriftLinearFit")){
+ //TH2S *histCalib = ((dynamic_cast<AliTRDCalibraVdriftLinearFit*>(HistArray->At(CalibHistoCount)))->GetLinearFitterHisto(10,kTRUE));
+ TH2S *histCalib =(TH2S*)(((AliTRDCalibraVdriftLinearFit*)HistArray->At(CalibHistoCount))->GetLinearFitterHisto(10,kTRUE));
+
+ histCalib->Draw();
+ }
+
+
+ }
+
+ gTRDCalibCanvas->Update();
+
+ return iResult;
+}
+//****************************************************************************
+
+
+
+void writeToFile(){
+
+ TList * bList = gHomerManager->GetBlockList();
+ TFile * file = TFile::Open(Form("Event_0x%016X_ITS.root", gHomerManager->GetEventID()), "RECREATE");
+ bList->Write("blockList", TObject::kSingleKey);
+ file->Close();
+
+ bList = gHomerManager->GetAsyncBlockList();
+ TFile * afile = TFile::Open(Form("Event_0x%016X_Async.root", gHomerManager->GetEventID()), "RECREATE");
+ bList->Write("blockList", TObject::kSingleKey);
+ afile->Close();
+
+
+// TIter next(bList);
+
+// AliHLTHOMERBlockDesc* block = 0;
+
+// // -- Iterate over blocks in the block list
+// // ------------------------------------------
+// while ((block = (AliHLTHOMERBlockDesc*)next())) {
+// cout << "balle " << endl;
+// }
+
+}
+
+
+// -----------------------------------------------------------------
+void loopEvent() {
+ eventTimer.SetCommand("nextEvent()");
+ eventTimer.Start(6000);
+}
+
+// -----------------------------------------------------------------
+void stopLoopEvent() {
+ eventTimer.Stop();
+}
+
+
+// -----------------------------------------------------------------
+void loopEventFast() {
+ eventTimerFast.SetCommand("nextEvent()");
+ eventTimerFast.Start(500);
+}
+
+// -----------------------------------------------------------------
+void stopLoopEventFast() {
+ eventTimerFast.Stop();
+}
+
+// -----------------------------------------------------------------
+void EventLoopFast() {
+
+ // Start/stop event loop
+ if ( gEventLoopStarted ) {
+ loopEventFast();
+ gEventLoopStarted = kTRUE;
+
+ } else {
+ stopLoopEventFast();
+ gEventLoopStarted = kFALSE;
+
+ }
+}
+
+
+
+Int_t processBlock (AliHLTHOMERBlockDesc * block ){
+
+
+#if 1//DEBUG
+ printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n");
+ printf( "Detector : %s\n", block->GetDetector().Data() );
+ printf( "Datatype : %s\n", block->GetDataType().Data() );
+ if (block->IsTObject() )
+ printf( "Is TObject of class: %s\n", block->GetClassName().Data() );
+ printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n");
+#endif
+
+
+ Int_t iResult = 0;
+
+ if ( ! block->GetDetector().CompareTo("HLT") )
+ processHLTBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("TPC") )
+ processTPCBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("TRD") )
+ iResult = processTRDBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("MUON") && gShowMUON )
+ processMUONBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("ISPD") )
+ processISPDBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("ISDD") )
+ processISDDBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("ISSD") )
+ processISSDBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("PHOS") )
+ processPHOSBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("EMCA") )
+ processEMCALBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("ITS") )
+ processITSBlock(block);
+
+
+
+ if ( block->GetDataType().CompareTo("ROOTHIST") == 0 )
+ processV0Histograms( block , gV0Canvas);
+
+ return iResult;
+}
+
+
+void processITSBlock(AliHLTHOMERBlockDesc * block) {
+
+ if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {
+ if(!gITSCanvas){
+ gITSCanvas = gEve->AddCanvasTab("ITS QA");
+ }
+ processITSHistograms( block , gITSCanvas);
+ gITSCanvas->Update();
+ }
+}
+
+
+ Int_t processTRDBlock (AliHLTHOMERBlockDesc * block) {
+
+ Int_t iResult = 0;
+
+ if ( ! block->GetDataType().CompareTo("CLUSTERS") ) {
+
+ if(!gTRDClusters){
+ gTRDClusters = new TEvePointSet("TRD Clusters");
+ gTRDClusters->SetMainColor(kBlue);
+ gTRDClusters->SetMarkerStyle((Style_t)kFullDotSmall);
+ //gEve->AddElement(gTRDClusters);
+ }
+
+ if(!gTRDColClusters){
+ gTRDColClusters = new TEvePointSetArray("TRD Clusters Colorized");
+ gTRDColClusters->SetMainColor(kRed);
+ gTRDColClusters->SetMarkerStyle(4); // antialiased circle
+ // gTRDColClusters->SetMarkerStyle((Style_t)kFullDotSmall);
+ gTRDColClusters->SetMarkerSize(0.4);
+ gTRDColClusters->InitBins("Cluster Charge", gTRDBins, 0., gTRDBins*100.);
+
+ //TColor::SetPalette(1, 0); // Spectrum palette
+ const Int_t nCol = TColor::GetNumberOfColors();
+ for (Int_t ii = 0; ii < gTRDBins+1; ++ii)
+ gTRDColClusters->GetBin(ii)->SetMainColor(TColor::GetColorPalette(ii * nCol / (gTRDBins+2)));
+
+ gEve->AddElement(gTRDColClusters);
+ }
+
+ iResult = processTRDClusters( block, gTRDClusters, gTRDColClusters );
+ //gTRDClusters->ElementChanged();
+ gTRDColClusters->ElementChanged();
+ }
+
+ // -- Process TRD Histograms
+ else if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {
+ if(!gTRDCanvas) {
+ gTRDCanvas = gEve->AddCanvasTab("TRD");
+ gTRDCanvas->Divide(3,2);
+ }
+ iResult = processTRDHistograms( block, gTRDCanvas );
+ }
+
+ else if(block->GetDataType().CompareTo("CALIBRAH")==0){
+
+ if(!gTRDCalibCanvas){
+ gTRDCalibCanvas = gEve->AddCanvasTab("TRD Calib");
+ gTRDCalibCanvas->Divide(2,2);
+ }
+
+ iResult=processTRDCalibHistograms(block,gTRDCalibCanvas);
+ }
+
+ else if(block->GetDataType().CompareTo("CALIBEOR")==0){
+
+ if(!gTRDEORCanvas){
+ gTRDEORCanvas = gEve->AddCanvasTab("TRD QA");
+ gTRDEORCanvas->Divide(3,2);
+ }
+
+ iResult=processTRDCalibHistograms(block,gTRDEORCanvas);
+ }
+ return iResult;
+}
+
+void processMUONBlock(AliHLTHOMERBlockDesc * block){
+
+ // -- Process MUON Clusters
+ if ( (block->GetDataType().CompareTo("RECHITS") == 0) || (block->GetDataType().CompareTo("TRIGRECS") == 0) ) {
+
+ if ( !gMUONClusters ) {
+ gMUONClusters = new TEvePointSet("MUON RecHits");
+ gMUONClusters->SetMainColor(kBlue);
+ gMUONClusters->SetMarkerStyle(20);
+ gEve->AddElement(gMUONClusters);
+ }
+
+ processMUONClusters( block );
+ gMUONClusters->ElementChanged();
+
+ }else if(block->GetDataType().CompareTo("MANTRACK") == 0){
+
+ if ( !gMUONTracks ) {
+ gMUONTracks = new TEveStraightLineSet("MUON Tracks");
+ gMUONTracks->SetMainColor(kRed);
+ gMUONTracks->SetLineWidth(3);
+ gEve->AddElement(gMUONTracks);
+ }
+
+ processMUONTracks( block );
+ gMUONTracks->ElementChanged();
+
+
+ }
+}
+
+
+void processISPDBlock( AliHLTHOMERBlockDesc * block) {
+
+ if ( block->GetDataType().CompareTo("CLUSTERS") == 0 ) {
+
+ if(!gSPDClusters){
+ gSPDClusters = new TEvePointSet("SPD Clusters");
+ gSPDClusters->SetMainColor(kBlack);
+ gSPDClusters->SetMarkerStyle((Style_t)kFullDotMedium);
+ gEve->AddElement(gSPDClusters);
+ }
+
+ processITSClusters( block , gSPDClusters);
+ gSPDClusters->ElementChanged();
+
+ } else if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {
+ processSPDVertexHistograms( block , gSPDVertexCanvas);
+ gSPDVertexCanvas->Update();
+ }
+}
+
+void processISDDBlock(AliHLTHOMERBlockDesc * block){
+
+ if ( block->GetDataType().CompareTo("CLUSTERS") == 0 ) {
+
+ if(!gSDDClusters){
+ gSDDClusters = new TEvePointSet("SDD Clusters");
+ gSDDClusters->SetMainColor(kPink);
+ gSDDClusters->SetMarkerStyle((Style_t)kFullDotMedium);
+ gEve->AddElement(gSDDClusters);
+ }
+
+ processITSClusters( block , gSDDClusters);
+ gSDDClusters->ElementChanged();
+ }
+}
+
+void processISSDBlock(AliHLTHOMERBlockDesc * block){
+ if ( block->GetDataType().CompareTo("CLUSTERS") == 0 ) {
+
+ if(!gSSDClusters){
+ gSSDClusters = new TEvePointSet("SSD Clusters");
+ gSSDClusters->SetMainColor(kBlue);
+ gSSDClusters->SetMarkerStyle((Style_t)kFullDotMedium);
+ gEve->AddElement(gSSDClusters);
+ }
+
+ processITSClusters( block , gSSDClusters);
+ gSSDClusters->ElementChanged();
+ }
+
+ else if ( block->GetDataType().CompareTo("ROOTOBAR") == 0 ) {
+ processSSDHistograms( block , gSSDCanvas0, gSSDCanvas1);
+ gSSDCanvas0->Update();
+ gSSDCanvas1->Update();
+ }
+}
+
+
+
+Int_t processPHOSBlock(AliHLTHOMERBlockDesc * block) {
+
+ Int_t iResult = 0;
+
+ if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {
+
+ if(!gPHOSCanvas) {
+ gPHOSCanvas = CreateCanvas("PHOS QA", "PHOS QA");
+ gPHOSCanvas->Divide(3, 2);
+ }
+
+ AddHistogramsToCanvas(block, gPHOSCanvas, gPHOSHistoCount);
+
+
+ } else {
+
+ cout <<"PHOS block not histo"<<endl;
+
+ if( !gPHOSElementList )
+ gPHOSElementList = createPHOSElementList();
+
+ if ( block->GetDataType().CompareTo("CALOCLUS") == 0 )
+ iResult = processPHOSClusters( block );
+
+ else if ( block->GetDataType().CompareTo("DIGITTYP") == 0 )
+ iResult = processPHOSDigits( block);
+
+ else if ( block->GetDataType().CompareTo("CHANNELT") == 0 )
+ iResult = processPHOSClusters( block );
+
+
+ //Update the eve elements
+ for(int im = 0; im < 5; im++)
+ gPHOSBoxSet[im]->ElementChanged();
+
+ }
+
+ return iResult;
+}
+
+
+TEveElementList * createPHOSElementList() {
+
+ TEveElementList * elementList = new TEveElementList("PHOS Cells");
+
+ gEve->AddElement(elementList);
+
+ TVector3 center;
+ Float_t angle;
+
+ // -- Create boxsets
+ for(int im = 0; im < 5; im++) {
+
+ TEveRGBAPalette* pal = new TEveRGBAPalette(0,120);
+ pal->SetLimits(-0.1, 1024);
+ gPHOSBoxSet[im] = new TEveBoxSet(Form("Cells Module %d" , im));
+ gPHOSBoxSet[im]->SetPalette(pal);
+ gPHOSBoxSet[im]->Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
+ gPHOSBoxSet[im]->SetOwnIds(kTRUE);
+
+
+ gPHOSGeom->GetModuleCenter(center, "CPV", im+1);
+ angle = gPHOSGeom->GetPHOSAngle(im+1)*TMath::Pi()/180;
+
+ gPHOSBoxSet[im]->RefitPlex();
+ TEveTrans& t = gPHOSBoxSet[im]->RefMainTrans();
+ t.SetupRotation(1, 2, angle );
+ t.SetPos(center.X(), center.Y(), center.Z());
+
+ elementList->AddElement(gPHOSBoxSet[im]);
+ }
+
+ return elementList;
+}
+
+
+void processEMCALBlock(AliHLTHOMERBlockDesc * block) {
+
+ Int_t iResult = 0;
+
+ if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {
+
+ if(!gEMCALCanvas) {
+ gEMCALCanvas = CreateCanvas("EMCAL QA", "EMCAL QA");
+ gEMCALCanvas->Divide(3, 2);
+ }
+ AddHistogramsToCanvas(block, gEMCALCanvas, gEMCALHistoCount);
+
+
+ } else {
+
+ if( !gEMCALElementList ){
+ gEMCALElementList = createEMCALElementList();
+ }
+
+ if ( block->GetDataType().CompareTo("CALOCLUS") == 0 ) {
+ iResult = processEMCALClusters( block );
+ for(int sm = 0; sm < 12; sm++) {
+ gEMCALBoxSet[sm]->ElementChanged();
+ }
+ }
+ }
+}
+
+TEveElementList * createEMCALElementList() {
+ TEveElementList * elementList = new TEveElementList("EMCAL Cells");
+ elementList->SetTitle("Tooltip");
+ gEve->AddElement(elementList);
+
+ gStyle->SetPalette(1, 0);
+ TEveRGBAPalette* pal = new TEveRGBAPalette(0, 512);
+ pal->SetLimits(0, 1024);
+
+
+ for (Int_t sm=0; sm<12; ++sm) {
+
+ TEveBoxSet* q = new TEveBoxSet(Form("SM %d", sm+1));
+ q->SetOwnIds(kTRUE);
+
+ q->Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
+ q->RefMainTrans().SetFrom(*gEMCALNode->GetDaughter(sm)->GetMatrix());
+ q->SetPalette(pal);
+
+ gEve->AddElement(q, elementList);
+ gEMCALBoxSet[sm] = q;
+ }
+
+ return elementList;
+}
+
+void processHLTBlock(AliHLTHOMERBlockDesc * block) {
+
+ if ( ! block->GetDataType().CompareTo("ALIESDV0") ) {
+ if(!gTPCTrack){
+ gTPCTrack = new TEveTrackList("ESD Tracks");
+ gTPCTrack->SetMainColor(6);
+ gEve->AddElement(gTPCTrack);
+ }
+
+ processEsdTracks(block, gTPCTrack);
+ gTPCTrack->ElementChanged();
+ }
+
+ else if ( ! block->GetDataType().CompareTo("ROOTTOBJ") ) {
+ processROOTTOBJ( block, gHLTText );
+ }
+
+ else if ( ! block->GetDataType().CompareTo("HLTRDLST") ) {
+ processHLTRDLST( block );
+ }
+
+ else if ( !block->GetDataType().CompareTo("ROOTHIST") ) {
+
+ processPrimVertexHistograms( block , gPrimVertexCanvas);
+ gPrimVertexCanvas->Update();
+ }
+
+}
+
+
+void processTPCBlock(AliHLTHOMERBlockDesc * block) {
+
+ cout <<"Processing tpc clusters"<<endl;
+
+ if ( ! block->GetDataType().CompareTo("CLUSTERS") ) {
+ if(!gTPCClusters){
+ gTPCClusters = new TEvePointSet("TPC Clusters");
+ //gTPCClusters->ApplyVizTag("TPC Clusters");
+ gTPCClusters->SetMainColor(kRed);
+ gTPCClusters->SetMarkerStyle((Style_t)kFullDotSmall);
+ //gEve->AddElement(gTPCClusters);
+ }
+
+ if(!gTPCColClusters){
+ gTPCColClusters = new TEvePointSetArray("TPC Clusters Colorized");
+ gTPCColClusters->SetMainColor(kRed);
+ gTPCColClusters->SetMarkerStyle(4); // antialiased circle
+ gTPCColClusters->SetMarkerSize(0.4);
+ gTPCColClusters->InitBins("Cluster Charge", gTPCBins, 0., gTPCBins*20.);
+
+ const Int_t nCol = TColor::GetNumberOfColors();
+
+ for (Int_t ii = 0; ii < gTPCBins+1; ++ii)
+ gTPCColClusters->GetBin(ii)->SetMainColor(TColor::GetColorPalette(ii * nCol / (gTPCBins+2)));
+
+ gEve->AddElement(gTPCColClusters);
+ }
+
+ processTPCClusters(block, gTPCClusters, gTPCColClusters);
+ //gTPCClusters->ElementChanged();
+ gTPCColClusters->ElementChanged();
+ }
+
+ else if ( ! block->GetDataType().CompareTo("HWCL_ALT") ) {
+ if(!gTPCTestClusters){
+
+ gTPCTestClusters = new TEvePointSet("TPC Clusters Test");
+ //ggTPCTestClusters->ApplyVizTag("TPC Clusters");
+ gTPCTestClusters->SetMainColor(kBlue);
+ gTPCTestClusters->SetMarkerStyle((Style_t)kFullDotSmall);
+ gEve->AddElement(gTPCTestClusters);
+ }
+
+ processTPCClusters(block, gTPCTestClusters);
+ gTPCTestClusters->ElementChanged();
+ }
+}