Starting a simple Proof-Lite code with Error in <TProofServLite::HandleSocketInput>

Dear experts,

I am new to PROOF, and trying to make a toy analysis with it. I went through some documents, but mostly are explaining the structure of the Selector, and I was trying to make a TPROOF work first. The error message that I got in the log is:
Error in TProofServLite::HandleSocketInput. It seems that there is some issue when collecting the output, but I don’t know why it happens and how to fix it. Apologize is the question is too naive.

I have a few NanoAOD root files (the file contains several flat trees), and I made a TSelector based on the “Events” Tree. I made a very simple TSelector, and used the following code in root interface:

root [1] #include "Events.h"
root [2] TChain *chain = new TChain("Events");
root [3] chain->Add("~/eos/NanoAODv2_skimmed/Era_2018/Background/DYJetsToLL_M-50/skimmed_nano_1.root");
root [4] TProof *proof = TProof::Open("workers=1");
 +++ Starting PROOF-Lite with 1 workers +++
Opening connections to workers: OK (1 workers)                 
Setting up worker servers: OK (1 workers)                 
PROOF set to parallel mode (1 worker)
root [5] proof->Load("Events.C");
09:44:44  9473 Wrk-0.0 | Info in <TProofServLite::HandleCache>: loading macro Events.C ...
root [6] Events *e = new Events();
root [7] chain->SetProof();
root [8] chain->Process((TSelector *)e);
 
Info in <TProofLite::SetQueryRunning>: starting query: 1
Info in <TProofQueryResult::SetRunning>: nwrks: 1
Looking up for exact location of files: OK (1 files)                 
Looking up for exact location of files: OK (1 files)                 
Info in <TPacketizer::TPacketizer>: Initial number of workers: 1
Validating files: OK (1 files)                 
Warning in <TSelector::Terminate>: histogram not foundsending)   
Lite-0: all output objects have been merged

The Events.h is the automatic generated one from Events->MakeSelector(), but with an extra public member for the output Histogram:

TH1F            *fHisto;

The Events.C is the automatic generated one with the modified Begin(), SlaveBegin(), Process(Long64_t entry) and Terminate() functions:

void Events::Begin(TTree * /*tree*/) {  
   TString option = GetOption();
    fHisto = 0;
}

void Events::SlaveBegin(TTree * /*tree*/) {  
   TString option = GetOption();
   // Create the histogram
   fHisto = new TH1F("histo", "leadingMuPt", 200, 0, 200);
   fHisto->GetYaxis()->SetTitle("number of events");
   fHisto->GetXaxis()->SetTitle("leadingMuPt");

   //adding histo to selector output list
   fOutput->Add(fHisto);
}

Bool_t Events::Process(Long64_t entry) {
   fReader.SetLocalEntry(entry);
   if (*nMuon > 0) fHisto->Fill(Muon_pt[0]); // nMuon is defined in Events.h with TTreeReaderValue<UInt_t> nMuon = {fReader, "nMuon"}; Muon_pt is defined as TTreeReaderArray<Float_t> Muon_pt = {fReader, "Muon_pt"};

   return kTRUE;
}

void Events::Terminate() {
   TCanvas *c1 = new TCanvas("c1","Proof ProofEvent canvas",200,10,700,700);
   fHisto = dynamic_cast<TH1F *>(fOutput->FindObject(Form("histo")));
   if (fHisto) {
      fHisto->Draw("h");

      // Final update
      c1->cd();
      c1->Update();
   } else {
      Warning("Terminate", "histogram not found");
   }
}

Please read tips for efficient and successful posting and posting code

_ROOT Version:6.22/09
_Platform:linux bash shell, cmsplc interactive node
_Compiler: root interface, g++


As it is a TProof question may be @ganis can help.

Dear Yao_Yao,
Since you are new to PROOF and you are trying to use PROOF-Lite (the version for multi-core machines), I would suggest you try out the currently supported alternatives, i.e. RDataFrame (check here for an initial set of docs).
PROOF is not supported any longer and will be removed from the distribution in the future.

G Ganis

@Yao_Yao As you can see, I’m afraid you will not get any decent help here with your problem. Try to ask your colleagues from your collaboration for help. If you succeed in solving this problem, please return and report the solution here. I think many people may benefit from it in the future.

1 Like

@Yao_Yao Try the following “unnamed macro”:

{ // root [0] .x ThisMacro.C
  // ... set up a TChain ...
  TChain *ch = new TChain("Events", "My TChain with Events");
  ch->Add("~/eos/NanoAODv2_skimmed/Era_2018/Background/DYJetsToLL_M-50/skimmed_nano_1.root");
  // ... analyze the TChain ...
  TProof::Open("workers=1");  // start PROOF-Lite
  ch->SetProof();
  gSystem->Exec("rm -f Events_C*");
  ch->Process("Events.C++");
  // ... cleanup ...
  // delete ch;
  // gSystem->Exec("rm -f Events_C*");
}

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.