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