]>
Commit | Line | Data |
---|---|---|
a9a39f46 | 1 | // |
2 | void runAAF(TString dataset="/alice/sim/LHC10f8c_130844", | |
3 | TString outFName = "trbg.root", | |
4 | Bool_t doRec = kTRUE, // fill data histos from new reco | |
5 | Bool_t doInj = kTRUE, // create Inj. bg | |
6 | Bool_t doRot = kTRUE, // create Rot. bg | |
7 | Bool_t doMix = kFALSE,//kTRUE, // create Mix. bg | |
8 | Bool_t useMC = kTRUE, // fill MC info (doRec=kTRUE) | |
9 | Bool_t checkReconstructables = kFALSE,//kTRUE, // fill histos for reconstructable (needs useMC and doRec) | |
10 | // | |
11 | Float_t etaCut = 3.0, // max |eta| range to fill in histos | |
12 | // | |
13 | // specific parameters for reconstruction | |
14 | //----------------------- Zv selection parameters important for mixing, to be tuned | |
15 | Float_t zMin = -20, // process events with Z vertex min | |
16 | Float_t zMax = 20, // max positions | |
17 | Float_t zMixBinSz = 20, //0.1, // Zv. bin for mixing | |
18 | //--------------------------------------------------------------------------------- | |
19 | // | |
20 | //----------------------- Ntracklets selection parameters important for mixing, to be tuned | |
21 | Float_t ntMin = 1, // process events with ESDmult | |
22 | Float_t ntMax = 20000, // within this range | |
23 | Float_t ntMixBinSz = 20000, // ESDMult bin size for mixing | |
24 | //--------------------------------------------------------------------------------- | |
25 | float phiRot = 3.14159e+00, // angle for bg. generation with rotation | |
26 | float injScale = 1.,//0.7, // inject injScale*Ncl(Lr1/Lr2) hits | |
27 | Bool_t scaleDTheta = kTRUE, // scale dTheta by 1/sin^2(theta) in trackleting | |
28 | float nStdDev = 25., // number of st.dev. for tracklet cut to keep | |
29 | float dphi = 0.06, // dphi window (sigma of tracklet cut) | |
30 | float dtht = 0.025, // dtheta .... (if negative, abs will be used with additional cut on |dthetaX|, apart from w.distance | |
31 | float phishift = 0.0045, // bending shift | |
32 | Bool_t remOvl = kTRUE, | |
33 | float ovlPhiCut = 0.005, | |
34 | float ovlZetaCut = 0.05, | |
35 | Int_t nEvents = 50000000, | |
36 | Int_t nEventsSkip = 0, | |
37 | TString alirootVer = "VO_ALICE@AliRoot::v4-21-05-AN", | |
38 | TString rootVer = "default",//"VO_ALICE@ROOT::v5-27-06b", | |
39 | // | |
40 | TString proofCluster="shahoian@alice-caf.cern.ch" | |
41 | ) | |
42 | { | |
43 | // | |
44 | Bool_t runLocal = kFALSE; // true only for local test mode | |
45 | if (runLocal) { | |
46 | dataset = "/default/shahoian/test_pp"; | |
47 | //dataset = "/default/shahoian/test"; | |
48 | proofCluster = ""; | |
49 | alirootVer = "AliRootProofLite"; | |
50 | nEvents = 500; | |
51 | } | |
52 | // | |
53 | if (dataset.Contains("alice/data") && useMC) { | |
54 | printf("Running with read data dataset, switching OFF useMC\n"); | |
55 | useMC = kFALSE; | |
56 | } | |
57 | // | |
58 | printf("Start Analysis for %s, max %d Events skipping %d\n" | |
59 | "Event Cuts: |eta|<%.1f, %.2f<Zv<%.2f (Mix.Bin:%.2f), %.0f<Mult<%0.f (Mix.Bin:%.0f)\n" | |
60 | "Reco:%d Inj:%d Rot:%d Mix:%d | MCinfo:%d CheckReconstructables:%d\n" | |
61 | "PhiRot:%.4f InjScale:%.2f ScaleDTheta:%d NStdDev:%.1f DPhi:%.4f DTheta:%.4f PhiShift:%.4f\n" | |
62 | "RemoveOverlaps:%d PhiOvl:%.4f ZEtaOvl:%.4f\n", | |
63 | dataset.Data(),nEvents,nEventsSkip, | |
64 | etaCut,zMin,zMax,zMixBinSz,ntMin,ntMax,ntMixBinSz, | |
65 | doRec,doInj,doRot,doMix,useMC,checkReconstructables, | |
66 | phiRot,injScale,scaleDTheta,nStdDev,dphi,dtht,phishift, | |
67 | remOvl,ovlPhiCut,ovlZetaCut); | |
68 | // | |
69 | printf("Requested: %s %s\n",alirootVer.Data(), rootVer.Data()); | |
70 | printf("Output expected in %s\n",outFName.Data()); | |
71 | // | |
72 | gEnv->SetValue("XSec.GSI.DelegProxy","2"); | |
73 | // | |
74 | TString alirootMode="REC"; | |
75 | TString extraLibs = "ITSrec:CDB:Geom:"; // not needed in default aliroot mode | |
76 | //extraLibs+= "ANALYSIS:ANALYSISalice"; | |
77 | extraLibs+= "ANALYSIS:ANALYSISalice:EventMixing"; | |
78 | TList *list = new TList(); | |
79 | // sets $ALIROOT_MODE on each worker to let proof to know to run in special mode | |
80 | list->Add(new TNamed("ALIROOT_MODE" , alirootMode.Data())); | |
81 | list->Add(new TNamed("ALIROOT_EXTRA_LIBS", extraLibs.Data())); | |
82 | list->Add(new TNamed("ALIROOT_ENABLE_ALIEN","1")); | |
83 | // | |
84 | //REM: same version of AliRoot on client!!!!! Otherwise error!! | |
85 | TProof::Mgr(proofCluster.Data())->SetROOTVersion(rootVer.Data()); | |
86 | TProof::Open(proofCluster.Data());//,"workers=10x"); | |
87 | // TProof::Open(proofCluster.Data(),"workers=1x"); | |
88 | if (!gProof) { | |
89 | Error("runAAF.C","Connection to AF failed."); | |
90 | return; | |
91 | } | |
92 | gProof->Exec("TObject *o = gEnv->GetTable()->FindObject(\"Proof.UseMergers\");" | |
93 | "gEnv->GetTable()->Remove(o);", kTRUE); | |
94 | // gProof->SetParameter("PROOF_UseMergers", 0); | |
95 | // Lets enable aliroot + extra libs on proof cluster | |
96 | if (runLocal) gProof->UploadPackage(alirootVer.Data()); | |
97 | gProof->EnablePackage(alirootVer.Data(), list); | |
98 | // | |
99 | gROOT->LoadMacro("MyAnalysisMacro.C"); | |
100 | ||
101 | if (runLocal) { | |
102 | Int_t numWorkers = gProof->GetParallel(); | |
103 | if (numWorkers<1) {printf("No workers\n"); return;} | |
104 | gProof->SetParameter("PROOF_PacketizerStrategy", (Int_t)0); | |
105 | int frac = (Int_t) 5 / numWorkers; | |
106 | if (frac<1) frac = 1; | |
107 | gProof->SetParameter("PROOF_PacketAsAFraction", frac); | |
108 | } | |
109 | MyAnalysisMacro(dataset,outFName,doRec,doInj,doRot,doMix,useMC,checkReconstructables, | |
110 | etaCut,zMin,zMax,zMixBinSz,ntMin,ntMax,ntMixBinSz, | |
111 | phiRot,injScale,scaleDTheta,nStdDev,dphi,dtht, | |
112 | phishift,remOvl,ovlPhiCut,ovlZetaCut,nEvents,nEventsSkip); | |
113 | // | |
114 | } |