Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:03:49

0001 #include <TProof.h>
0002 #include <TDSet.h>
0003 #include <TEnv.h>
0004 
0005 using namespace std;
0006 
0007 #include "FWCore/FWLite/interface/FWLiteEnabler.h"
0008 
0009 void proof_thing_sel() {
0010   if (gSystem->Getenv("TMPDIR")) {
0011     std::string t = gSystem->Getenv("TMPDIR");
0012     if (t.size() > 80)
0013       t = "/tmp";
0014     t += "/proof";
0015     gEnv->SetValue("Proof.Sandbox", t.c_str());
0016     gEnv->SetValue("ProofLite.SockPathDir", t.c_str());
0017   }
0018 
0019   //Setup the proof server
0020   TProof *myProof = TProof::Open("", "workers=2");
0021 
0022   // This makes sure the TSelector library and dictionary are properly
0023   // installed in the remote PROOF servers
0024 
0025   // This works, but results in an annoying error message from 'cp',
0026   // something not right with the how the macro is sent?
0027   //myProof->Exec(".x proof_remote.C");
0028 
0029   // So inline it...
0030   myProof->Exec(
0031       "gSystem->Load(\"libFWCoreFWLite\"); "
0032       "FWLiteEnabler::enable(); "
0033       "gSystem->Load(\"libFWCoreTFWLiteSelectorTest\");");
0034 
0035   // This creates the 'data set' which defines what files we need to process
0036   // NOTE: the files given must be accessible by the remote systems
0037   TDSet c("TTree", "Events");
0038   c.Add("testTFWLiteSelector.root");
0039 
0040   //This makes the actual processing happen
0041   c.Process("tfwliteselectortest::ThingsTSelector");
0042 
0043   myProof->Close("S");
0044 }