List events panel in ED looks better now + preparation for sending RecPoints from...
authorjniedzie <jeremi.niedziela@cern.ch>
Mon, 8 Dec 2014 07:14:12 +0000 (08:14 +0100)
committerjniedzie <jeremi.niedziela@cern.ch>
Mon, 8 Dec 2014 07:14:31 +0000 (08:14 +0100)
MONITOR/alionlinereco/AliOnlineReconstruction.cxx
MONITOR/alistoragemanager/AliStorageAdministratorPanelListEvents.cxx
MONITOR/alistoragemanager/AliStorageAdministratorPanelListEvents.h
MONITOR/alistoragemanager/AliStorageEventManager.cxx
MONITOR/alistoragemanager/AliStorageEventManager.h
MONITOR/alistoragemanager/AliStorageTypes.h
MONITOR/alistoragemanager/alifakedisplay.cxx

index 29343d8..5387edd 100644 (file)
@@ -83,10 +83,11 @@ void AliOnlineReconstruction::StartOfRun()
       return;
     }
   gSystem->cd(recoBaseDir.Data());
+  // gSystem->cd("/");
   cout<<"\n\nRetriving GRP\n\n"<<endl;
   TString gdcs;
   if (RetrieveGRP(gdcs) <= 0 || gdcs.IsNull()){return;}
-
+  //gSystem->cd(recoBaseDir.Data());
   gSystem->Exec(Form("rm -fr run%d;mkdir run%d",fRun,fRun));
   gSystem->cd(Form("run%d",fRun));
 
@@ -105,10 +106,13 @@ int AliOnlineReconstruction::RetrieveGRP(TString &gdc)
        TString password = fSettings.GetValue("logbook.pass", DEFAULT_LOGBOOK_PASS);
        TString cdbPath = fSettings.GetValue("cdb.defaultStorage", DEFAULT_CDB_STORAGE);
 
+       //      cdbPath = gSystem->pwd();
+       cout<<"CDB path for GRP:"<<cdbPath<<endl;
+
        Int_t ret=AliGRPPreprocessor::ReceivePromptRecoParameters(fRun, dbHost.Data(),
                                                                  dbPort, dbName.Data(),
                                                                  user.Data(), password.Data(),
-                                                                 Form("local://%s",cdbPath.Data()),
+                                                                 Form("%s",cdbPath.Data()),
                                                                  gdc);
 
        if(ret>0) Info("RetrieveGRP","Last run of the same type is: %d",ret);
@@ -158,6 +162,7 @@ void AliOnlineReconstruction::ReconstructionLoop()
        AliStorageEventManager *eventManager = AliStorageEventManager::GetEventManagerInstance();
        eventManager->CreateSocket(EVENTS_SERVER_PUB);
        eventManager->CreateSocket(XML_PUB);
+       eventManager->CreateSocket(ITS_POINTS_PUB);
 
        cout<<"\n\nStarting reconstruction\n\n"<<endl;
        fAliReco->Begin(NULL);
@@ -166,39 +171,82 @@ void AliOnlineReconstruction::ReconstructionLoop()
        if (fAliReco->GetAbort() != TSelector::kContinue) return;
        cout<<"\n\nStarting loop over events\n\n"<<endl;
 
+       TString recoBaseDir = fSettings.GetValue("server.saveRecoDir",DEFAULT_SERVER_SAVE_RECO_DIR);
+
+
        //******* The loop over events
        Int_t iEvent = 0;
        AliESDEvent* event;
+       struct recPointsStruct *files;
        //      while (fAliReco->HasNextEventAfter(iEvent) && !gQuit)
        while (!gQuit)
        {
          if(fAliReco->HasNextEventAfter(iEvent))
            {
-               if (!fAliReco->HasEnoughResources(iEvent)) break;
-               cout<<"\n\nProcessing event:"<<iEvent<<endl<<endl;
-               Bool_t status = fAliReco->ProcessEvent(iEvent);
+             // remove files for previous event: (needed to send RecPoints:
+             /*
+             gSystem->cd(recoBaseDir.Data());
+             gSystem->Exec(Form("rm -fr run%d;mkdir run%d",fRun,fRun));
+             gSystem->cd(Form("run%d",fRun));
+             */
+             
+             if (!fAliReco->HasEnoughResources(iEvent)) break;
+             cout<<"\n\nProcessing event:"<<iEvent<<endl<<endl;
+             Bool_t status = fAliReco->ProcessEvent(iEvent);
       
-               if (status){
-                       event = fAliReco->GetESDEvent();
-                       eventManager->Send(event,EVENTS_SERVER_PUB);
-                       eventManager->SendAsXml(event,XML_PUB);
-                       /*
-                       TFile *file = new TFile(Form("/local/storedFiles/AliESDs.root_%d",iEvent),"recreate");
-                        TTree* tree= new TTree("esdTree", "esdTree");
-                        event->WriteToTree(tree);
-                        tree-> Fill();
-                        tree->Write();
-                        file->Close();
-                       */
-               }
-               else{
-                 cout<<"Event server -- aborting"<<endl;
-                 fAliReco->Abort("ProcessEvent",TSelector::kAbortFile);
-               }
-               cout<<"clean"<<endl;
-               fAliReco->CleanProcessedEvent();
-               cout<<"iEvent++"<<endl;
-               iEvent++;
+             if (status){
+               event = fAliReco->GetESDEvent();
+               eventManager->Send(event,EVENTS_SERVER_PUB);
+               eventManager->SendAsXml(event,XML_PUB);
+
+               // sending RecPoints:
+               /*
+               cout<<"loading file"<<endl;
+               files->files[0] = TFile::Open("./ITS.RecPoints.root");
+               files->files[1] = TFile::Open("./TOF.RecPoints.root");
+               files->files[2] = TFile::Open("./galice.root");
+               files->files[3] = NULL;
+               files->files[4] = NULL;
+               files->files[5] = NULL;
+               files->files[6] = NULL;
+               files->files[7] = NULL;
+               files->files[8] = NULL;
+               files->files[9] = NULL;
+
+
+               cout<<"sending files"<<endl;
+               eventManager->Send(files,ITS_POINTS_PUB);
+               cout<<"files sent"<<endl;
+       
+               for(int i=0;i<10;i++)
+                 {
+                   if(files->files[i])
+                     {
+                       files->files[i]->Close();
+                       delete files->files[i];files->files[i]=0;
+                       cout<<"file deleted"<<endl;
+                     }
+                 }
+               */
+
+               //Saving ESD to file:
+               /*
+                 TFile *file = new TFile(Form("/local/storedFiles/AliESDs.root_%d",iEvent),"recreate");
+                 TTree* tree= new TTree("esdTree", "esdTree");
+                 event->WriteToTree(tree);
+                 tree-> Fill();
+                 tree->Write();
+                 file->Close();
+               */
+             }
+             else{
+               cout<<"Event server -- aborting"<<endl;
+               fAliReco->Abort("ProcessEvent",TSelector::kAbortFile);
+             }
+             cout<<"clean"<<endl;
+             fAliReco->CleanProcessedEvent();
+             cout<<"iEvent++"<<endl;
+             iEvent++;
            }
          else
            {
index cba8e6d..acf9c11 100644 (file)
@@ -38,25 +38,29 @@ enum TEXTENTRY{
 };
 
 AliStorageAdministratorPanelListEvents::AliStorageAdministratorPanelListEvents() :
-       TGMainFrame(gClient->GetRoot(),400,400),
+  TGMainFrame(gClient->GetRoot(),10,10,kMainFrame | kVerticalFrame),
        fStatusLabel(0),
-       fRunNumberMinEntry(0),
-       fRunNumberMaxEntry(0),
-       fEventNumberMinEntry(0),
-       fEventNumberMaxEntry(0),
+       fRunMinEntry(0),
+       fRunMaxEntry(0),
+       fEventMinEntry(0),
+       fEventMaxEntry(0),
        fMultiplicityMinEntry(0),
        fMultiplicityMaxEntry(0),
-       fProtonProtonCheckButton(0),
-       fLeadLeadCheckButton(0),
-       fTempCheckButton(0),
-       fPermCheckButton(0),
-       fEventsList(0),
+       fPPcheckbox(0),
+       fPbPbcheckbox(0),
+       fTemporaryCheckbox(0),
+       fPermanentCheckbox(0),
+       fListBox(0),
        fEventsListVector(0),
        fServerSocket(SERVER_COMMUNICATION_REQ),
        fEventManager(0)
 {
        fEventManager = AliStorageEventManager::GetEventManagerInstance();
        fEventManager->CreateSocket(fServerSocket);
+
+       SetName("List");
+       SetLayoutBroken(kTRUE);
+
        InitWindow();
 }
 
@@ -80,130 +84,228 @@ void AliStorageAdministratorPanelListEvents::SelectedEvent()
 
 void AliStorageAdministratorPanelListEvents::InitWindow()
 {
-       SetCleanup(kDeepCleanup);
-       
-       //min run number
-       AddFrame(new TGLabel(this,"Minimum run number:"),new TGLayoutHints(kLHintsLeft));
-
-       fRunNumberMinEntry = new TGNumberEntry(this,
-                                           0,
-                                           6,
-                                           TEXTENTRY_RUN_MIN,
-                                           TGNumberFormat::kNESInteger,
-                                           TGNumberFormat::kNEAPositive,
-                                           TGNumberFormat::kNELNoLimits);
-       AddFrame(fRunNumberMinEntry,new TGLayoutHints(kLHintsLeft));
-
-       //max run number
-       AddFrame(new TGLabel(this,"Maximum run number:"),new TGLayoutHints(kLHintsLeft));
-
-       fRunNumberMaxEntry = new TGNumberEntry(this,
-                                           999999,
-                                           6,
-                                           TEXTENTRY_RUN_MAX,
-                                           TGNumberFormat::kNESInteger,
-                                           TGNumberFormat::kNEAPositive,
-                                           TGNumberFormat::kNELNoLimits);
-       AddFrame(fRunNumberMaxEntry,new TGLayoutHints(kLHintsLeft));
-
-       //min event number
-       AddFrame(new TGLabel(this,"Minimum event number:"),new TGLayoutHints(kLHintsLeft));
-
-       fEventNumberMinEntry = new TGNumberEntry(this,
-                                             0,
-                                             6,
-                                             TEXTENTRY_EVENT_MIN,
-                                             TGNumberFormat::kNESInteger,
-                                             TGNumberFormat::kNEAPositive,
-                                             TGNumberFormat::kNELNoLimits);
-       AddFrame(fEventNumberMinEntry,new TGLayoutHints(kLHintsLeft));  
-
-       //max event number
-       AddFrame(new TGLabel(this,"Maximum event number:"),new TGLayoutHints(kLHintsLeft));
-
-       fEventNumberMaxEntry = new TGNumberEntry(this,
-                                             99999,
-                                             6,
-                                             TEXTENTRY_EVENT_MAX,
-                                             TGNumberFormat::kNESInteger,
-                                             TGNumberFormat::kNEAPositive,
-                                             TGNumberFormat::kNELNoLimits);
-       AddFrame(fEventNumberMaxEntry,new TGLayoutHints(kLHintsLeft));  
-
-       //min multiplicity
-       AddFrame(new TGLabel(this,"Minimum multiplicity:"),new TGLayoutHints(kLHintsLeft));
-
-       fMultiplicityMinEntry = new TGNumberEntry(this,
-                                             0,
-                                             6,
-                                             TEXTENTRY_MULTIPLICITY_MIN,
-                                             TGNumberFormat::kNESInteger,
-                                             TGNumberFormat::kNEAPositive,
-                                             TGNumberFormat::kNELNoLimits);
-       AddFrame(fMultiplicityMinEntry,new TGLayoutHints(kLHintsLeft)); 
-
-       //max multiplicity
-       AddFrame(new TGLabel(this,"Maximum multiplicity:"),new TGLayoutHints(kLHintsLeft));
-
-       fMultiplicityMaxEntry = new TGNumberEntry(this,
-                                             9999,
-                                             6,
-                                             TEXTENTRY_MULTIPLICITY_MAX,
-                                             TGNumberFormat::kNESInteger,
-                                             TGNumberFormat::kNEAPositive,
-                                             TGNumberFormat::kNELNoLimits);
-       AddFrame(fMultiplicityMaxEntry,new TGLayoutHints(kLHintsLeft)); 
-
-       //p-p check button
-       AddFrame(new TGLabel(this,"System:"),new TGLayoutHints(kLHintsLeft));
-       fProtonProtonCheckButton = new TGCheckButton(this,"p-p",BUTTON_CHECK_PP);
-       fProtonProtonCheckButton->SetOn();
-       AddFrame(fProtonProtonCheckButton,new TGLayoutHints(kLHintsLeft));
-
-       //Pb-Pb check button
-       fLeadLeadCheckButton = new TGCheckButton(this,"Pb-Pb",BUTTON_CHECK_PBPB);
-       fLeadLeadCheckButton->SetOn();
-       AddFrame(fLeadLeadCheckButton,new TGLayoutHints(kLHintsLeft));
-
-       //temp check button
-       AddFrame(new TGLabel(this,"Storage type:"),new TGLayoutHints(kLHintsLeft));
-       fTempCheckButton = new TGCheckButton(this,"Temporary",BUTTON_CHECK_TEMP);
-       fTempCheckButton->SetOn();
-       AddFrame(fTempCheckButton,new TGLayoutHints(kLHintsLeft));
-
-       //perm check button
-       fPermCheckButton = new TGCheckButton(this,"Permanent",BUTTON_CHECK_PERM);
-       fPermCheckButton->SetOn();
-       AddFrame(fPermCheckButton,new TGLayoutHints(kLHintsLeft));
-       
-       // status label
-       fStatusLabel = new TGLabel(this,"");
-       AddFrame(fStatusLabel,new TGLayoutHints(kLHintsExpandX | kLHintsLeft));
-
-       //buttons
-       fCloseButton = new TGTextButton(this,"Close",BUTTON_CLOSE);
-       AddFrame(fCloseButton,
-                new TGLayoutHints(kLHintsLeft));
-       fGetListButton = new TGTextButton(this,"Get event's list",BUTTON_GET_LIST);
-       AddFrame(fGetListButton,
-                new TGLayoutHints(kLHintsRight));
-       fMarkButton = new TGTextButton(this,"Mark selected event",BUTTON_MARK_EVENT);
-       AddFrame(fMarkButton,
-                new TGLayoutHints(kLHintsRight));
-       fLoadButton = new TGTextButton(this,"Load event",BUTTON_LOAD_EVENT);
-       AddFrame(fLoadButton,
-                new TGLayoutHints(kLHintsRight));
-    
-
-       //event's list
-       fEventsList = new TGListBox(this,0);
-       fEventsList->AddEntry(new TGString("Run   Event   System   Mult   Marked"),0);
-       AddFrame(fEventsList,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
-       
-       SetWindowName("List Events");
-       MapSubwindows();
-       Resize(WINDOWS_WIDTH,WINDOWS_HEIGHT);
-       MapWindow();
+   // "Run" group frame
+   TGGroupFrame *fRunGroupFrame = new TGGroupFrame(this,"Run");
+   fRunGroupFrame->SetLayoutBroken(kTRUE);
+   
+   fRunNumberSlider = new TGDoubleHSlider(fRunGroupFrame,312,kSlider1 | kScaleBoth,-1,kHorizontalFrame);
+   fRunNumberSlider->SetRange(0,999999);
+   fRunNumberSlider->SetPosition(0,999999);
+   fRunGroupFrame->AddFrame(fRunNumberSlider, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fRunNumberSlider->MoveResize(10,20,312,24);
+   fRunNumberSlider->Connect("PositionChanged()","AliStorageAdministratorPanelListEvents",this,"RunSliderPositionChanged()");
+
+   fRunMinEntry = new TGNumberEntry(fRunGroupFrame, 
+                                   (Double_t) 0,
+                                   10,
+                                   TEXTENTRY_RUN_MIN,
+                                   (TGNumberFormat::EStyle) 0,
+                                   (TGNumberFormat::EAttribute) 1,
+                                   (TGNumberFormat::ELimit) 2,1,999999);
+   fRunGroupFrame->AddFrame(fRunMinEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fRunMinEntry->MoveResize(50,50,88,22);
+   fRunMinEntry->Connect("ValueSet(Long_t)","AliStorageAdministratorPanelListEvents",this,"RunChanged()");
+   
+   fRunMaxEntry = new TGNumberEntry(fRunGroupFrame, 
+                                   (Double_t) 999999,
+                                   10,
+                                   TEXTENTRY_RUN_MAX,
+                                   (TGNumberFormat::EStyle) 0,
+                                   (TGNumberFormat::EAttribute) 1,
+                                   (TGNumberFormat::ELimit) 2,0,999999);
+   fRunGroupFrame->AddFrame(fRunMaxEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fRunMaxEntry->MoveResize(200,50,88,22);
+   fRunMaxEntry->Connect("ValueSet(Long_t)","AliStorageAdministratorPanelListEvents",this,"RunChanged()");
+   
+   TGLabel *fRunNumberMinLabel = new TGLabel(fRunGroupFrame,"Min:");
+   fRunNumberMinLabel->SetTextJustify(36);
+   fRunNumberMinLabel->SetMargins(0,0,0,0);
+   fRunNumberMinLabel->SetWrapLength(-1);
+   fRunGroupFrame->AddFrame(fRunNumberMinLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fRunNumberMinLabel->MoveResize(10,50,40,18);
+   TGLabel *fRunNumberMaxLabel = new TGLabel(fRunGroupFrame,"Max:");
+   fRunNumberMaxLabel->SetTextJustify(36);
+   fRunNumberMaxLabel->SetMargins(0,0,0,0);
+   fRunNumberMaxLabel->SetWrapLength(-1);
+   fRunGroupFrame->AddFrame(fRunNumberMaxLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fRunNumberMaxLabel->MoveResize(150,50,40,24);
+
+   fRunGroupFrame->SetLayoutManager(new TGVerticalLayout(fRunGroupFrame));
+   fRunGroupFrame->Resize(330,90);
+   AddFrame(fRunGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fRunGroupFrame->MoveResize(8,8,330,90);
+
+  // "Event" group frame
+   TGGroupFrame *fEventGroupFrame = new TGGroupFrame(this,"Event");
+   fEventGroupFrame->SetLayoutBroken(kTRUE);
+   
+   fEventSlider = new TGDoubleHSlider(fEventGroupFrame,312,kSlider1 | kScaleBoth,-1,kHorizontalFrame);
+   fEventSlider->SetRange(0,999999);
+   fEventSlider->SetPosition(0,999999);
+   fEventGroupFrame->AddFrame(fEventSlider, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fEventSlider->MoveResize(10,20,312,24);
+   fEventSlider->Connect("PositionChanged()","AliStorageAdministratorPanelListEvents",this,"EventSliderPositionChanged()");
+   fEventMinEntry = new TGNumberEntry(fEventGroupFrame,0,10,TEXTENTRY_EVENT_MIN,(TGNumberFormat::EStyle) 0,(TGNumberFormat::EAttribute) 1,(TGNumberFormat::ELimit) 0,0,999999);
+   fEventGroupFrame->AddFrame(fEventMinEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fEventMinEntry->MoveResize(50,50,88,22);
+   fEventMinEntry->Connect("ValueSet(Long_t)","AliStorageAdministratorPanelListEvents",this,"EventChanged()");
+   
+   fEventMaxEntry = new TGNumberEntry(fEventGroupFrame,999999,10,TEXTENTRY_EVENT_MAX,(TGNumberFormat::EStyle) 5,(TGNumberFormat::EAttribute) 1,(TGNumberFormat::ELimit) 0,0,999999);
+   fEventGroupFrame->AddFrame(fEventMaxEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fEventMaxEntry->MoveResize(200,50,88,22);
+   fEventMaxEntry->Connect("ValueSet(Long_t)","AliStorageAdministratorPanelListEvents",this,"EventChanged()");
+  
+   TGLabel *fEventMinLabel = new TGLabel(fEventGroupFrame,"Min:");
+   fEventMinLabel->SetTextJustify(36);
+   fEventMinLabel->SetMargins(0,0,0,0);
+   fEventMinLabel->SetWrapLength(-1);
+   fEventGroupFrame->AddFrame(fEventMinLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fEventMinLabel->MoveResize(10,50,40,18);
+   
+   TGLabel *fEventMaxLabel = new TGLabel(fEventGroupFrame,"Max:");
+   fEventMaxLabel->SetTextJustify(36);
+   fEventMaxLabel->SetMargins(0,0,0,0);
+   fEventMaxLabel->SetWrapLength(-1);
+   fEventGroupFrame->AddFrame(fEventMaxLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fEventMaxLabel->MoveResize(150,50,40,24);
+
+   fEventGroupFrame->SetLayoutManager(new TGVerticalLayout(fEventGroupFrame));
+   fEventGroupFrame->Resize(330,100);
+   AddFrame(fEventGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fEventGroupFrame->MoveResize(8,102,330,100);
+
+  // "Multiplicity" group frame
+   TGGroupFrame *fMultiplicityGroupFrame = new TGGroupFrame(this,"Multiplicity");
+   fMultiplicityGroupFrame->SetLayoutBroken(kTRUE);
+  
+   fMultiplicitySlider = new TGDoubleHSlider(fMultiplicityGroupFrame,312,kSlider1 | kScaleBoth,-1,kHorizontalFrame);
+   fMultiplicitySlider->SetRange(0,99999);
+   fMultiplicitySlider->SetPosition(0,99999);
+   fMultiplicityGroupFrame->AddFrame(fMultiplicitySlider, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fMultiplicitySlider->MoveResize(10,20,312,24);
+   fMultiplicitySlider->Connect("PositionChanged()","AliStorageAdministratorPanelListEvents",this,"MultiplicitySliderPositionChanged()");
+   
+   fMultiplicityMinEntry = new TGNumberEntry(fMultiplicityGroupFrame,0,10,TEXTENTRY_MULTIPLICITY_MIN,(TGNumberFormat::EStyle) 0,(TGNumberFormat::EAttribute) 1,(TGNumberFormat::ELimit) 0,0,999999);
+   fMultiplicityGroupFrame->AddFrame(fMultiplicityMinEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fMultiplicityMinEntry->MoveResize(50,50,88,22);
+   fMultiplicityMinEntry->Connect("ValueSet(Long_t)","AliStorageAdministratorPanelListEvents",this,"MultiplicityChanged()");
+
+   fMultiplicityMaxEntry = new TGNumberEntry(fMultiplicityGroupFrame,99999,10,TEXTENTRY_MULTIPLICITY_MAX,(TGNumberFormat::EStyle) 0,(TGNumberFormat::EAttribute) 1,(TGNumberFormat::ELimit) 0,0,999999);
+   fMultiplicityGroupFrame->AddFrame(fMultiplicityMaxEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fMultiplicityMaxEntry->MoveResize(200,50,88,22);
+   fMultiplicityMaxEntry->Connect("ValueSet(Long_t)","AliStorageAdministratorPanelListEvents",this,"MultiplicityChanged()");
+
+   TGLabel *fMultiplicityMinLabel = new TGLabel(fMultiplicityGroupFrame,"Min:");
+   fMultiplicityMinLabel->SetTextJustify(36);
+   fMultiplicityMinLabel->SetMargins(0,0,0,0);
+   fMultiplicityMinLabel->SetWrapLength(-1);
+   fMultiplicityGroupFrame->AddFrame(fMultiplicityMinLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fMultiplicityMinLabel->MoveResize(10,50,40,18);
+   
+   TGLabel *fMultiplicityMaxLabel = new TGLabel(fMultiplicityGroupFrame,"Max:");
+   fMultiplicityMaxLabel->SetTextJustify(36);
+   fMultiplicityMaxLabel->SetMargins(0,0,0,0);
+   fMultiplicityMaxLabel->SetWrapLength(-1);
+   fMultiplicityGroupFrame->AddFrame(fMultiplicityMaxLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fMultiplicityMaxLabel->MoveResize(150,50,40,24);
+
+   fMultiplicityGroupFrame->SetLayoutManager(new TGVerticalLayout(fMultiplicityGroupFrame));
+   fMultiplicityGroupFrame->Resize(330,100);
+   AddFrame(fMultiplicityGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fMultiplicityGroupFrame->MoveResize(8,196,330,100);
+
+
+   // "Beam" group frame
+   TGGroupFrame *fBeamGroupFrame = new TGGroupFrame(this,"Beam");
+   fBeamGroupFrame->SetLayoutBroken(kTRUE);
+   
+   fPPcheckbox = new TGCheckButton(fBeamGroupFrame,"p-p",BUTTON_CHECK_PP);
+   fPPcheckbox->SetTextJustify(36);
+   fPPcheckbox->SetMargins(0,0,0,0);
+   fPPcheckbox->SetWrapLength(-1);
+   fBeamGroupFrame->AddFrame(fPPcheckbox, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fPPcheckbox->MoveResize(10,20,60,24);
+   
+   fPbPbcheckbox = new TGCheckButton(fBeamGroupFrame,"Pb-Pb",BUTTON_CHECK_PBPB);
+   fPbPbcheckbox->SetTextJustify(36);
+   fPbPbcheckbox->SetMargins(0,0,0,0);
+   fPbPbcheckbox->SetWrapLength(-1);
+   fBeamGroupFrame->AddFrame(fPbPbcheckbox, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fPbPbcheckbox->MoveResize(90,20,60,24);
+
+   fBeamGroupFrame->SetLayoutManager(new TGVerticalLayout(fBeamGroupFrame));
+   fBeamGroupFrame->Resize(330,60);
+   AddFrame(fBeamGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fBeamGroupFrame->MoveResize(8,290,330,60);
+  
+   fGetListButton = new TGTextButton(this,"Get events' list",BUTTON_GET_LIST);
+   fGetListButton->SetTextJustify(36);
+   fGetListButton->SetMargins(0,0,0,0);
+   fGetListButton->SetWrapLength(-1);
+   fGetListButton->Resize(130,24);
+   AddFrame(fGetListButton, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fGetListButton->MoveResize(8,408,130,24);
+   
+   fMarkButton = new TGTextButton(this,"Mark selected event",BUTTON_MARK_EVENT);
+   fMarkButton->SetTextJustify(36);
+   fMarkButton->SetMargins(0,0,0,0);
+   fMarkButton->SetWrapLength(-1);
+   fMarkButton->Resize(130,24);
+   AddFrame(fMarkButton, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fMarkButton->MoveResize(8,432,130,24);
+   
+   fLoadButton = new TGTextButton(this,"Load selected event",BUTTON_LOAD_EVENT);
+   fLoadButton->SetTextJustify(36);
+   fLoadButton->SetMargins(0,0,0,0);
+   fLoadButton->SetWrapLength(-1);
+   fLoadButton->Resize(130,24);
+   AddFrame(fLoadButton, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fLoadButton->MoveResize(8,456,130,24);
+
+   // list box
+   
+   fListBox = new TGListBox(this);
+   fListBox->SetName("fListBox");
+   fListBox->AddEntry("Entry 1",0);
+   fListBox->AddEntry("Entry 2",1);
+   fListBox->AddEntry("Entry 3",2);
+   fListBox->AddEntry("Entry 4",3);
+   fListBox->AddEntry("Entry 5",4);
+   fListBox->AddEntry("Entry 6",5);
+   fListBox->AddEntry("Entry 7",6);
+   fListBox->Resize(330,132);
+   AddFrame(fListBox, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fListBox->MoveResize(8,488,330,132);
+
+   // "Type" group frame
+   TGGroupFrame *fTypeGroupFrame = new TGGroupFrame(this,"Type");
+   fTypeGroupFrame->SetLayoutBroken(kTRUE);
+   
+   fTemporaryCheckbox = new TGCheckButton(fTypeGroupFrame,"Temporary",BUTTON_CHECK_TEMP);
+   fTemporaryCheckbox->SetTextJustify(36);
+   fTemporaryCheckbox->SetMargins(0,0,0,0);
+   fTemporaryCheckbox->SetWrapLength(-1);
+   fTypeGroupFrame->AddFrame(fTemporaryCheckbox, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fTemporaryCheckbox->MoveResize(10,20,90,24);
+   
+   fPermanentCheckbox = new TGCheckButton(fTypeGroupFrame,"Permanent",BUTTON_CHECK_PERM);
+   fPermanentCheckbox->SetTextJustify(36);
+   fPermanentCheckbox->SetMargins(0,0,0,0);
+   fPermanentCheckbox->SetWrapLength(-1);
+   fTypeGroupFrame->AddFrame(fPermanentCheckbox, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fPermanentCheckbox->MoveResize(110,20,90,24);
+
+   fTypeGroupFrame->SetLayoutManager(new TGVerticalLayout(fTypeGroupFrame));
+   fTypeGroupFrame->Resize(330,60);
+   AddFrame(fTypeGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+   fTypeGroupFrame->MoveResize(8,344,330,60);
+
+   SetMWMHints(kMWMDecorAll, kMWMFuncAll, kMWMInputModeless);
+   MapSubwindows();
+   Resize(GetDefaultSize());
+   MapWindow();
+   Resize(341,945);
 }
 
 
@@ -216,11 +318,11 @@ void AliStorageAdministratorPanelListEvents::onGetListButton()
        struct listRequestStruct list; 
 
        //get listing parameters from somwhere
-       list.runNumber[0]=fRunNumberMinEntry->GetIntNumber();
-       list.runNumber[1]=fRunNumberMaxEntry->GetIntNumber();
-       list.eventNumber[0]=fEventNumberMinEntry->GetIntNumber();
-       list.eventNumber[1]=fEventNumberMaxEntry->GetIntNumber();
-       if(fTempCheckButton->GetState()==1)
+       list.runNumber[0]=fRunMinEntry->GetIntNumber();
+       list.runNumber[1]=fRunMaxEntry->GetIntNumber();
+       list.eventNumber[0]=fEventMinEntry->GetIntNumber();
+       list.eventNumber[1]=fEventMaxEntry->GetIntNumber();
+       if(fTemporaryCheckbox->GetState()==1)
        {
                list.marked[0]=0;
        }
@@ -228,7 +330,7 @@ void AliStorageAdministratorPanelListEvents::onGetListButton()
        {
                list.marked[0]=-1;
        }
-       if(fPermCheckButton->GetState()==1)
+       if(fPermanentCheckbox->GetState()==1)
        {
                list.marked[1]=1;
        }
@@ -238,7 +340,7 @@ void AliStorageAdministratorPanelListEvents::onGetListButton()
        }
        list.multiplicity[0]=fMultiplicityMinEntry->GetIntNumber();
        list.multiplicity[1]=fMultiplicityMaxEntry->GetIntNumber();
-       if(fProtonProtonCheckButton->GetState()==1)
+       if(fPPcheckbox->GetState()==1)
        {
                strcpy(list.system[0],"p-p");
        }
@@ -246,7 +348,7 @@ void AliStorageAdministratorPanelListEvents::onGetListButton()
        {
                strcpy(list.system[0],"");
        }
-       if(fLeadLeadCheckButton->GetState()==1)
+       if(fPbPbcheckbox->GetState()==1)
        {
                strcpy(list.system[1],"A-A");
        }
@@ -260,14 +362,14 @@ void AliStorageAdministratorPanelListEvents::onGetListButton()
 
        fEventManager->Send(requestMessage,fServerSocket);
 
-       fEventsList->RemoveAll();
-       fEventsList->AddEntry(new TGString("Run   Event   System   Mult   Marked"),0);
+       fListBox->RemoveAll();
+       fListBox->AddEntry(new TGString("Run   Event   System   Mult   Marked"),0);
        
        vector<serverListStruct> receivedList = fEventManager->GetServerListVector(fServerSocket);
     
        for(unsigned int i=0;i<receivedList.size();i++)
        {
-               fEventsList->InsertEntry(Form("%d   %d   %s   %d   %d   ",
+               fListBox->InsertEntry(Form("%d   %d   %s   %d   %d   ",
                                              receivedList[i].runNumber,
                                              receivedList[i].eventNumber,
                                              receivedList[i].system,
@@ -278,7 +380,7 @@ void AliStorageAdministratorPanelListEvents::onGetListButton()
        fEventsListVector = receivedList;
        
        gClient->HandleInput();
-       gClient->NeedRedraw(fEventsList, kTRUE);
+       gClient->NeedRedraw(fListBox, kTRUE);
        gClient->HandleInput();
        MapSubwindows();
        MapWindow();
@@ -293,7 +395,7 @@ void AliStorageAdministratorPanelListEvents::onMarkButton()
        int eventNumber;
 
        //get run and event number from selected row
-       int selectedEventNumber = fEventsList->GetSelected()-1;
+       int selectedEventNumber = fListBox->GetSelected()-1;
        
        if(selectedEventNumber<0)return;
        
@@ -325,7 +427,7 @@ void AliStorageAdministratorPanelListEvents::onMarkButton()
 
 void AliStorageAdministratorPanelListEvents::onLoadButton()
 {
-    int selectedEventNumber = fEventsList->GetSelected()-1;
+    int selectedEventNumber = fListBox->GetSelected()-1;
     int runNumber=fEventsListVector[selectedEventNumber].runNumber;
     int eventNumber=fEventsListVector[selectedEventNumber].eventNumber;
     
@@ -393,31 +495,65 @@ void AliStorageAdministratorPanelListEvents::SetOfflineMode(Bool_t ison)
 {
 
   if (ison) {
-    fProtonProtonCheckButton->SetDisabledAndSelected(ison);
-    fLeadLeadCheckButton->SetDisabledAndSelected(ison);
-    fTempCheckButton->SetDisabledAndSelected(ison);
-    fPermCheckButton->SetDisabledAndSelected(ison);
+    fPPcheckbox->SetDisabledAndSelected(ison);
+    fPbPbcheckbox->SetDisabledAndSelected(ison);
+    fTemporaryCheckbox->SetDisabledAndSelected(ison);
+    fPermanentCheckbox->SetDisabledAndSelected(ison);
   }
   else {
-    fProtonProtonCheckButton->SetEnabled(!ison);
-    fLeadLeadCheckButton->SetEnabled(!ison);
-    fTempCheckButton->SetEnabled(!ison);
-    fPermCheckButton->SetEnabled(!ison);
-    fProtonProtonCheckButton->SetOn();
-    fLeadLeadCheckButton->SetOn();
-    fTempCheckButton->SetOn();
-    fPermCheckButton->SetOn();
+    fPPcheckbox->SetEnabled(!ison);
+    fPbPbcheckbox->SetEnabled(!ison);
+    fTemporaryCheckbox->SetEnabled(!ison);
+    fPermanentCheckbox->SetEnabled(!ison);
+    fPPcheckbox->SetOn();
+    fPbPbcheckbox->SetOn();
+    fTemporaryCheckbox->SetOn();
+    fPermanentCheckbox->SetOn();
   }
 
-  fRunNumberMinEntry->SetState(!ison);
-  fRunNumberMaxEntry->SetState(!ison);
-  fEventNumberMinEntry->SetState(!ison);
-  fEventNumberMaxEntry->SetState(!ison);
+  fRunMinEntry->SetState(!ison);
+  fRunMaxEntry->SetState(!ison);
+  fEventMinEntry->SetState(!ison);
+  fEventMaxEntry->SetState(!ison);
   fMultiplicityMinEntry->SetState(!ison);
   fMultiplicityMaxEntry->SetState(!ison);
 
-  fCloseButton->SetEnabled(!ison);
+  // fCloseButton->SetEnabled(!ison);
   fGetListButton->SetEnabled(!ison);
   fMarkButton->SetEnabled(!ison);
   fLoadButton->SetEnabled(!ison);
 }
+
+
+void AliStorageAdministratorPanelListEvents::RunSliderPositionChanged()
+{
+  fRunMinEntry->SetNumber(fRunNumberSlider->GetMinPosition());
+  fRunMaxEntry->SetNumber(fRunNumberSlider->GetMaxPosition());
+}
+
+void AliStorageAdministratorPanelListEvents::RunChanged()
+{
+  fRunNumberSlider->SetPosition(fRunMinEntry->GetIntNumber(),fRunMaxEntry->GetIntNumber());
+}
+
+void AliStorageAdministratorPanelListEvents::EventSliderPositionChanged()
+{
+  fEventMinEntry->SetNumber(fEventSlider->GetMinPosition());
+  fEventMaxEntry->SetNumber(fEventSlider->GetMaxPosition());
+}
+
+void AliStorageAdministratorPanelListEvents::EventChanged()
+{
+  fEventSlider->SetPosition(fEventMinEntry->GetIntNumber(),fEventMaxEntry->GetIntNumber());
+}
+
+void AliStorageAdministratorPanelListEvents::MultiplicitySliderPositionChanged()
+{
+  fMultiplicityMinEntry->SetNumber(fMultiplicitySlider->GetMinPosition());
+  fMultiplicityMaxEntry->SetNumber(fMultiplicitySlider->GetMaxPosition());
+}
+
+void AliStorageAdministratorPanelListEvents::MultiplicityChanged()
+{
+  fMultiplicitySlider->SetPosition(fMultiplicityMinEntry->GetIntNumber(),fMultiplicityMaxEntry->GetIntNumber());
+}
index 1ce741f..1800305 100644 (file)
@@ -6,6 +6,8 @@
 
 #include <TGLabel.h>
 #include <TGNumberEntry.h>
+#include <TGDoubleSlider.h>
+#include <TGSlider.h>
 #include <TGListBox.h>
 #include <TQObject.h>
 
@@ -18,6 +20,13 @@ public:
     void SelectedEvent(); //*SIGNAL*
     void SetOfflineMode(Bool_t);
 
+    void RunSliderPositionChanged();
+    void EventSliderPositionChanged();
+    void MultiplicitySliderPositionChanged();
+    void RunChanged();
+    void EventChanged();
+    void MultiplicityChanged();
+
 private:
        AliStorageAdministratorPanelListEvents();
        virtual ~AliStorageAdministratorPanelListEvents();
@@ -28,24 +37,29 @@ private:
     
        //gui components and methods
        TGLabel *fStatusLabel;
-       TGNumberEntry *fRunNumberMinEntry;
-       TGNumberEntry *fRunNumberMaxEntry;
-       TGNumberEntry *fEventNumberMinEntry;
-       TGNumberEntry *fEventNumberMaxEntry;
+       TGNumberEntry *fRunMinEntry;
+       TGNumberEntry *fRunMaxEntry;
+       TGNumberEntry *fEventMinEntry;
+       TGNumberEntry *fEventMaxEntry;
        TGNumberEntry *fMultiplicityMinEntry;
        TGNumberEntry *fMultiplicityMaxEntry;
 
-       TGCheckButton *fProtonProtonCheckButton;
-       TGCheckButton *fLeadLeadCheckButton;
-       TGCheckButton *fTempCheckButton;
-       TGCheckButton *fPermCheckButton;
+       TGDoubleHSlider *fMultiplicitySlider;
+       TGDoubleHSlider *fRunNumberSlider;
+       TGDoubleHSlider *fEventSlider;
+
+
+       TGCheckButton *fPPcheckbox;
+       TGCheckButton *fPbPbcheckbox;
+       TGCheckButton *fTemporaryCheckbox;
+       TGCheckButton *fPermanentCheckbox;
        
        TGTextButton *fCloseButton;
        TGTextButton *fGetListButton;
        TGTextButton *fMarkButton;
        TGTextButton *fLoadButton;
 
-       TGListBox *fEventsList;
+       TGListBox *fListBox;
        
        void InitWindow();
        void onCloseButton();
index 1f28d06..2c5a360 100644 (file)
@@ -62,6 +62,11 @@ AliStorageEventManager::AliStorageEventManager()
             {
                 fXmlServerPort=atoi(line.substr(from,to-from).c_str());
             }
+           else if(line.find("ITS_POINTS_SERVER_PORT=")==0)
+            {
+                fItsPointsServerPort=atoi(line.substr(from,to-from).c_str());
+               cout<<"ITS port is:"<<fItsPointsServerPort<<endl;
+            }
         }
         if(configFile.eof()){configFile.clear();}
         configFile.close();
@@ -205,6 +210,38 @@ bool AliStorageEventManager::CreateSocket(storageSockets socket)
                 return 0;
             }
         }
+       break;
+    case ITS_POINTS_PUB:
+        {
+            fSockets[ITS_POINTS_PUB] =
+            new socket_t(*fContexts[ITS_POINTS_PUB],ZMQ_PUB);
+            try
+            {
+                fSockets[ITS_POINTS_PUB]->bind(Form("tcp://*:%d",fItsPointsServerPort));
+            }
+            catch (const zmq::error_t& e)
+            {
+                cout<<"MANAGER -- "<<e.what()<<endl;
+                return 0;
+            }
+        }
+       break;
+    case ITS_POINTS_SUB:
+        {
+            fSockets[ITS_POINTS_SUB] =
+            new socket_t(*fContexts[ITS_POINTS_SUB],ZMQ_SUB);
+            fSockets[ITS_POINTS_SUB]->setsockopt(ZMQ_SUBSCRIBE,"",0);
+            try
+            {
+             fSockets[ITS_POINTS_SUB]->connect(Form("tcp://%s:%d",fEventServer.c_str(),fItsPointsServerPort));
+            }
+            catch (const zmq::error_t& e)
+            {
+                cout<<"MANAGER -- "<<e.what()<<endl;
+                return 0;
+                
+            }
+        }
             break;
         default:break;
     }
@@ -370,6 +407,70 @@ void AliStorageEventManager::Send(AliESDEvent *event, storageSockets socket)
     }
 }
 
+void AliStorageEventManager::Send(TFile *file, storageSockets socket)
+{
+  cout<<"sending tfile to socket:"<<endl;
+  TTree *tree;
+
+  if(file)
+    {
+      file->ls();
+      cout<<"1"<<endl;
+      //std::string *dfTitle = new std::string(file->GetListOfKeys()->Last()->GetTitle());
+      string *name = new string(file->GetListOfKeys()->Last()->GetTitle());
+      cout<<"treeTitle:"<<name->data()<<endl;
+      
+      tree = (TTree*)((TDirectoryFile*)file->Get(name->data()))->Get("TreeR");
+
+
+       // TDirectoryFile *df = (TDirectoryFile*)file->Get(dfTitle->data());
+       //if(df)
+       //{
+       //        cout<<"directory file extracted"<<endl;
+        //tree = (TTree*)df->Get("TreeR");
+       cout<<"2"<<endl;
+      tree->Branch("event",&name);
+      cout<<"branch created:"<<endl;
+      tree->Print();
+      tree->Fill();
+      cout<<"ttree filled with name"<<endl;
+         // delete df;
+         //}
+      tree->Print();
+    }
+  else
+    {
+      tree = NULL;
+      cout<<"file is empty"<<endl;
+    }
+
+  //TMessage::EnableSchemaEvolutionForAll(kTRUE);
+  TMessage tmess(kMESS_OBJECT);
+  tmess.Reset();
+  tmess.WriteObject(tree);
+  cout<<"file written to tmessage"<<endl;
+  int bufsize = tmess.Length();
+  char* buf = (char*) malloc(bufsize * sizeof(char));
+  memcpy(buf, tmess.Buffer(), bufsize);
+  cout<<"messaged copied to buffer"<<endl;
+      
+  message_t message((void*)buf, bufsize, freeBuff);
+  cout<<"message_t created"<<endl;
+  try{
+    fSockets[socket]->send(message);
+  }
+  catch(const zmq::error_t &e)
+    {
+      cout<<"MANAGER -- send TFile -- "<<e.what()<<endl;
+    }
+  //if(tree){delete tree;}
+}
+
+void AliStorageEventManager::Send(struct recPointsStruct *files, storageSockets socket)
+{
+  for(int i=0;i<10;i++){Send(files->files[i],socket);}
+}
 void AliStorageEventManager::SendAsXml(AliESDEvent *event,storageSockets socket)
 {
     cout<<"SENDING AS XML"<<endl;
@@ -518,6 +619,91 @@ AliESDEvent* AliStorageEventManager::GetEvent(storageSockets socket,int timeout)
     }
 }
 
+TFile* AliStorageEventManager::GetFile(storageSockets socket,int timeout)
+{
+  cout<<"get file"<<endl;
+    pollitem_t items[1] =  {{*fSockets[socket],0,ZMQ_POLLIN,0}} ;
+    if(timeout>=0){
+       try{(poll (&items[0], 1, timeout)==0);}
+       catch(const zmq::error_t &e){
+         cout<<"EVENT MANAGER -- GetFile():"<<e.what()<<endl;
+           return NULL;
+         }
+    }
+    message_t* message = new message_t();
+    cout<<"polling passed"<<endl;
+
+    try
+    {
+      cout<<"waiting for file on socket:"<<socket<<endl;
+        fSockets[socket]->recv(message);
+    }
+    catch (const zmq::error_t& e)
+    {
+        cout<<"MANAGER -- "<<e.what()<<endl;
+        return NULL;
+    }
+    cout<<"createing buffer file"<<endl;
+    TBufferFile *mess = new TBufferFile(TBuffer::kRead,
+                                       message->size()+sizeof(UInt_t),
+                                        message->data());
+
+    //TMessage *mess = new TMessage();
+    //mess->SetReadMode();
+   
+    mess->InitMap();
+    mess->ReadClass();
+    mess->SetBufferOffset(sizeof(UInt_t) + sizeof(kMESS_OBJECT));
+    mess->ResetMap();
+
+    //mess->ReadBuf(message->data(),message->size()+sizeof(UInt_t));
+    
+    cout<<"reading file from buffer"<<endl;
+    TTree* tree = (TTree*)(mess->ReadObjectAny(TTree::Class()));
+    //TFile* data = (TFile*)mess->ReadObject(TFile::Class());
+
+    if(tree)
+      {
+       cout<<"received a tree:"<<endl;
+       tree->Print();
+       std::string *dfTitle = new std::string();
+       tree->SetBranchAddress("event",&dfTitle);
+       tree->GetEntry(0);
+
+       cout<<"setting df's name to:"<<dfTitle->data()<<endl;
+       TDirectoryFile *df = new TDirectoryFile(dfTitle->data(),dfTitle->data());
+       df->Add(tree);
+       cout<<"added tree to directory file"<<endl;
+       
+       TFile *file = new TFile();
+       df->Write();
+
+       cout<<"created file:"<<endl;
+       file->ls();
+       if(message){delete message;}
+       if(df){delete df;}
+       if(tree){delete tree;}
+       return file;
+      }
+    else
+      {
+       cout<<"no tree found"<<endl;
+       if(message){delete message;}
+        return NULL;
+      }
+}
+
+struct recPointsStruct* AliStorageEventManager::GetFiles(storageSockets socket,int timeout)
+{
+  struct recPointsStruct *files = new struct recPointsStruct;
+
+  for(int i=0;i<10;i++)
+    {
+      files->files[i] = GetFile(socket,timeout);
+    }
+  return files;
+}
+
 struct serverRequestStruct* AliStorageEventManager::GetServerStruct(storageSockets socket)
 {
     struct serverRequestStruct *request = new struct serverRequestStruct;
index 890382d..c3ebf13 100644 (file)
@@ -9,6 +9,7 @@
 #include <sstream>
 
 #include <TMessage.h>
+#include <TFile.h>
 
 namespace zmq
 {
@@ -25,12 +26,16 @@ public:
        void Send(struct serverRequestStruct *request,storageSockets socket);
        bool Send(struct clientRequestStruct *request,storageSockets socket,int timeout = -1);
        void Send(AliESDEvent *event,storageSockets socket);
+       void Send(TFile *file,storageSockets socket);
+       void Send(struct recPointsStruct *files,storageSockets socket);
        void Send(long message,storageSockets socket);
        void Send(bool message,storageSockets socket);
        void SendAsXml(AliESDEvent *event,storageSockets socket);
        
        std::vector<serverListStruct> GetServerListVector(storageSockets socket,int timeout=-1);
        AliESDEvent* GetEvent(storageSockets socket,int timeout=-1);
+       TFile* GetFile(storageSockets socket,int timeout=-1);
+       struct recPointsStruct* GetFiles(storageSockets socket,int timeout=-1);
        struct serverRequestStruct* GetServerStruct(storageSockets socket);
        struct clientRequestStruct* GetClientStruct(storageSockets socket,int timeout=-1);
        long GetLong(storageSockets socket);
@@ -50,6 +55,7 @@ private:
        int fStorageClientPort;
        int fEventServerPort;
        int fXmlServerPort;
+       int fItsPointsServerPort;
        
        zmq::context_t *fContexts[7];
        zmq::socket_t *fSockets[7];
index 9e009b3..4371849 100644 (file)
@@ -2,6 +2,7 @@
 #define AliStorageTypes_H
 
 #include <TSystem.h>
+#include <TFile.h>
 
 inline const char* GetConfigFilePath(){
        return Form("%s/MONITOR/alistoragemanager/setupStorageDatabase.sh",gSystem->Getenv("ALICE_ROOT"));
@@ -15,6 +16,8 @@ enum storageSockets{
        EVENTS_SERVER_PUB,
        EVENTS_SERVER_SUB,
        XML_PUB,
+       ITS_POINTS_PUB,
+       ITS_POINTS_SUB,
        NUMBER_OF_SOCKETS
 };
        
@@ -68,6 +71,10 @@ struct serverRequestStruct{
        struct listRequestStruct list;
 };
 
+struct recPointsStruct{
+  TFile *files[10];
+};
+
 typedef struct serverListStruct{
        int runNumber;
        int eventNumber;
index fac3f9f..643286b 100644 (file)
@@ -6,6 +6,7 @@
 #include <iostream>
 
 #include <TThread.h>
+#include <TFile.h>
 
 using namespace std;
 
@@ -43,16 +44,17 @@ int main(int argc, char **argv)
     storageSockets socket;
     AliStorageEventManager *manager = AliStorageEventManager::GetEventManagerInstance();
     AliESDEvent *event;
+    struct recPointsStruct *files;
     
     if(atoi(argv[1])==0)
     {
-        socket = EVENTS_SERVER_SUB;
-        manager->CreateSocket(socket);
+        manager->CreateSocket(EVENTS_SERVER_SUB);
+       manager->CreateSocket(ITS_POINTS_SUB);
         cout<<"Socket created"<<endl;
         while(1)
         {
             cout<<"waiting for event..."<<flush;
-            event = manager->GetEvent(socket);
+            event = manager->GetEvent(EVENTS_SERVER_SUB);
             
             if(event)
             {
@@ -66,12 +68,36 @@ int main(int argc, char **argv)
                     if(strcmp(event->GetESDRun()->GetTriggerClass(i),"")){
                         cout<<event->GetESDRun()->GetTriggerClass(i)<<endl;}
                 }
-                delete event;
+                delete event;event=0;
             }
             else
             {
                 cout<<"NO EVENT"<<endl;
             }
+           
+           // Receiving RecPoints:
+           /*
+
+           files = manager->GetFiles(ITS_POINTS_SUB);
+
+       
+           cout<<"Received file."<<endl;
+
+           //file->Write("ITS.RecPoints.root",kOverwrite);
+           if(files->files[0]){files->files[0]->SaveAs("ITS.RecPoints.root","recreate");}
+           if(files->files[1]){files->files[1]->SaveAs("TOF.RecPoints.root","recreate");}
+           if(files->files[2]){files->files[2]->SaveAs("galice.root","recreate");}
+
+           for(int i=0;i<10;i++)
+           {
+           if(files->files[i])
+           {
+           files->files[i]->Close();
+           delete files->files[i];files->files[i]=0;
+           }
+           }   
+           sleep(2);
+           */
         }
     }
     else if(atoi(argv[1])==1)