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