- fix data container naming issues
[u/mrichter/AliRoot.git] / MFT / AliMuonForwardTrackAnalysis.C
CommitLineData
cabfe25b 1enum {kNoOption, kResonanceOnly};
e806e863 2
cabfe25b 3const Double_t mJpsi = TDatabasePDG::Instance()->GetParticle("J/psi")->Mass();
4
5//=============================================================================================================================================================
e806e863 6
cabfe25b 7void AliMuonForwardTrackAnalysis(const Char_t *readDir= ".", // the directory with the MuonGlobalTracks.root and geometry.root files
8 Int_t option = kNoOption, // for resonance analysis: kResonanceOnly
9 Double_t massMin = 0., // lower limit for the cut on dimuon mass
10 Double_t massMax = 10., // upper limit for the cut on dimuon mass
11 Double_t maxChi2SingleMuons = 1.5, // upper limit for the cut on the single muon chi2
12 Double_t maxOffsetSingleMuons = 250., // upper limit for the cut on the single muon offset w.r.t. the primary vtx
13 Bool_t correlateCutOnOffsetChi2 = kTRUE, // if true, the cur region in the chi2-offset plane for single muons is a quadrant aorund the origin
14 Double_t maxWOffsetMuonPairsAtPrimaryVtx = 1.e9, // upper limit for the cut on weighted offset of dimuond w.r.t. the primary vtx
15 Double_t maxWOffsetMuonPairsAtPCA = 1.e9, // upper limit for the cut on weighted offset of dimuond w.r.t. their PCA
16 Double_t maxDistancePrimaryVtxPCA = 1.e9, // upper limit for the cut on the distance between primary vtx and PCA
17 Double_t minPCAQuality = 0., // lower limit for the cut on the PCA quality
18 Int_t triggerLevel = 1, // level of the trigger both muons must satisfy
19 Int_t maxNWrongClusters = 999, // maximum number of wrong MFT clusters for a global muon track
20 const Char_t *outDir = ".", // directory where the output file will be created
21 Bool_t singleMuonAnalysis = kTRUE, // if true, the aalysis of single muons will be performed
22 Bool_t muonPairAnalysis = kTRUE, // if true, the aalysis of muon pairs will be performed
e806e863 23 Int_t firstEvent = -1,
24 Int_t lastEvent = -1,
cabfe25b 25 Int_t myRandom = 0, // number which will tag the name of the output file
26 Double_t ptMinSingleMuons = 0.0, // lower limit for the cut on the single muon pt
27 Double_t trueMass = mJpsi, // used to evaluate the pseudo proper decay length, usually for J/psi only
28 Bool_t evalDimuonVtxResolution=kFALSE) { // to be set true only if prompt dimuon sources are analyzed
e806e863 29
30 gROOT -> LoadMacro("./AliMuonForwardTrackAnalysis.cxx+");
31 // AliLog::SetClassDebugLevel("AliMuonForwardTrackPair", 1);
32 // AliLog::SetClassDebugLevel("AliMuonForwardTrackAnalysis", 1);
33
e806e863 34 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG));
35
36 AliMuonForwardTrackAnalysis *myAnalysis = new AliMuonForwardTrackAnalysis();
37 myAnalysis->ReadEvents(firstEvent, lastEvent);
38 myAnalysis->SetInputDir(readDir);
39 myAnalysis->SetOutputDir(outDir);
cabfe25b 40 myAnalysis->SetMassRange(massMin, massMax);
41 myAnalysis->SetTrueMass(trueMass);
e806e863 42 myAnalysis->SetSingleMuonAnalysis(singleMuonAnalysis);
43 myAnalysis->SetMuonPairAnalysis(muonPairAnalysis);
44 myAnalysis->SetOption(option);
cabfe25b 45
e806e863 46 myAnalysis->SetMaxNWrongClustersMC(maxNWrongClusters);
cabfe25b 47 myAnalysis->SetMinPtSingleMuons(ptMinSingleMuons);
48 myAnalysis->SetMaxChi2SingleMuons(maxChi2SingleMuons);
49 myAnalysis->SetMaxOffsetSingleMuons(maxOffsetSingleMuons);
50 myAnalysis->CorrelateCutOnOffsetChi2(correlateCutOnOffsetChi2);
51
52 myAnalysis->SetMaxWOffsetMuonPairsAtPrimaryVtx(maxWOffsetMuonPairsAtPrimaryVtx);
53 myAnalysis->SetMaxWOffsetMuonPairsAtPCA(maxWOffsetMuonPairsAtPCA);
54 myAnalysis->SetMaxDistancePrimaryVtxPCA(maxDistancePrimaryVtxPCA);
55 myAnalysis->SetMinPCAQuality(minPCAQuality);
3b6fd486 56
cabfe25b 57 myAnalysis->SetMatchTrigger(triggerLevel);
e806e863 58
cabfe25b 59 myAnalysis->EvalDimuonVtxResolution(evalDimuonVtxResolution); // it should be true only with prompt dimuon sources
5f74a7f3 60
e806e863 61 myAnalysis->Init("MuonGlobalTracks.root");
62
63 while (myAnalysis->LoadNextEvent()) continue;
64
65 myAnalysis->Terminate(Form("outFiles/outFile.%d.%d.%d.root", myAnalysis->GetFirstEvent(), myAnalysis->GetLastEvent(), myRandom));
66
67}
68
69//================================================================================================================================
70