allowing other root versions for acr reco
[u/mrichter/AliRoot.git] / prod / acrcaf / reco / run.C
CommitLineData
294ca602 1void run(Int_t runNumber, Int_t nev = 10000, Int_t firstev = 0, const char* rootVersion = 0)
fb6fc115 2{
3 gEnv->SetValue("XSec.GSI.DelegProxy","2");
4 // Select ROOT version
294ca602 5 if (rootVersion)
6 TProof::Mgr("aliprod@alicecaf")->SetROOTVersion(rootVersion);
fb6fc115 7 // Login to CAF
8 TProof::Open("aliprod@alicecaf");
9
10 // Enable AliRoot
11 gProof->UploadPackage("/afs/cern.ch/alice/caf/sw/ALICE/PARs/v4-17-Release.rec/AF-v4-17-rec.par");
12 gProof->EnablePackage("AF-v4-17-rec.par");
13
14 gSystem->Load("libMonaLisa.so");
15 TMonaLisaWriter monalisa("pcalishuttle02.cern.ch",
16 "SHIFTER_RECO_CAF");
17 SendMonaLisaData(&monalisa,runNumber,"Started",0);
18
19 // Temporary fix in order to avoid timeouts on the master
20 gProof->SetParameter("PROOF_PacketAsAFraction",20);
21
22 // Run reconstruction
23 gROOT->LoadMacro("rec.C");
24 gROOT->ProcessLine(Form("rec(%d,%d,%d);",runNumber,nev,firstev));
25
26 TProof::Mgr("aliprod@alicecaf")->GetSessionLogs()->Save("*",Form("log/run%d.log",runNumber));
27
28 // Check the produced dataset
29 TFileCollection *coll = gProof->GetDataSet(Form("run%d",runNumber));
30 if (coll) {
31 Int_t nEvents = coll->GetTotalEntries("/esdTree");
32 if (nEvents > 0) {
33 cout << "===========================================================================" << endl;
34 cout << nEvents << " events reconstructed and stored in the dataset run" << runNumber << endl;
35 cout << "===========================================================================" << endl;
36 cout << "The dataset is:" << endl;
37 coll->Print();
38 cout << "===========================================================================" << endl;
39 SendMonaLisaData(&monalisa,runNumber,"Done",nEvents);
40 }
41 else {
42 SendMonaLisaData(&monalisa,runNumber,"No_Events",nEvents);
43 }
44 }
45 else {
46 SendMonaLisaData(&monalisa,runNumber,"Failure",0);
47 }
48}
49
50void SendMonaLisaData(TMonaLisaWriter *monalisa, Int_t runNumber, const char* status, Int_t nEvents)
51{
52 TMonaLisaText mlStatus("Status",status);
53 TMonaLisaValue mlEventCount("Event_count",nEvents);
54 TList mlList;
55 mlList.Add(&mlStatus);
56 mlList.Add(&mlEventCount);
57 TString mlID;
58 mlID.Form("%d",runNumber);
59 monalisa->SendParameters(&mlList, mlID.Data());
60}