Analysis code updated
[u/mrichter/AliRoot.git] / MFT / AliMuonForwardTrackAnalysis.C
1 enum {kNoOption, kPionsKaons, kResonanceOnly};
2
3 //================================================================================================================================
4
5 void AliMuonForwardTrackAnalysis(const Char_t *readDir= ".",
6                                  Int_t option = kNoOption,
7                                  Int_t nMassBin = 100, 
8                                  Double_t massMin = 0.,
9                                  Double_t massMax = 10.,
10                                  Bool_t useCutOnOffsetChi2 = kFALSE,
11                                  Int_t maxNWrongClusters = 999,
12                                  const Char_t *outDir = ".",
13                                  Bool_t singleMuonAnalysis = kTRUE,
14                                  Bool_t muonPairAnalysis = kTRUE,
15                                  Int_t firstEvent = -1,
16                                  Int_t lastEvent = -1, 
17                                  Int_t myRandom = 0,
18                                  Double_t ptMinSingleMuons = 0.0,
19                                  Bool_t evalDimuonVtxResolution=kFALSE) {
20   
21   gROOT -> LoadMacro("./AliMuonForwardTrackAnalysis.cxx+");
22   //  AliLog::SetClassDebugLevel("AliMuonForwardTrackPair", 1);
23   //  AliLog::SetClassDebugLevel("AliMuonForwardTrackAnalysis", 1);
24
25   //  TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG, AliMagF::kBeamTypeAA, 2750.));
26   //  TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG, AliMagF::kBeamTypepp, 7000.));
27   TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG));
28   
29   AliMuonForwardTrackAnalysis *myAnalysis = new AliMuonForwardTrackAnalysis();
30   myAnalysis->ReadEvents(firstEvent, lastEvent);
31   myAnalysis->SetInputDir(readDir);
32   myAnalysis->SetOutputDir(outDir);
33   myAnalysis->SetMassRange(nMassBin, massMin, massMax);
34   myAnalysis->SetSingleMuonAnalysis(singleMuonAnalysis);
35   myAnalysis->SetMuonPairAnalysis(muonPairAnalysis);
36   myAnalysis->SetOption(option);
37   myAnalysis->SetMaxNWrongClustersMC(maxNWrongClusters);
38   myAnalysis->SetPtMinSingleMuons(ptMinSingleMuons);
39   myAnalysis->UseCutOnOffsetChi2(useCutOnOffsetChi2);
40
41   myAnalysis->SetPtDimuRange(5, 0., 5.);
42   myAnalysis->SetMatchTrigger(kTRUE);
43   myAnalysis->UseBransonForCut(kFALSE);
44   myAnalysis->UseBransonForKinematics(kFALSE);
45
46   myAnalysis->EvalDimuonVtxResolution(evalDimuonVtxResolution);    // only with prompt quarkonia
47
48   myAnalysis->Init("MuonGlobalTracks.root");
49
50   while (myAnalysis->LoadNextEvent()) continue;
51
52   myAnalysis->Terminate(Form("outFiles/outFile.%d.%d.%d.root", myAnalysis->GetFirstEvent(), myAnalysis->GetLastEvent(), myRandom));
53
54 }
55
56 //================================================================================================================================
57