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