Added option to switch on/off Branson correction in the matching stage. Analysis...
authorauras <auras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Mar 2012 15:41:57 +0000 (15:41 +0000)
committerauras <auras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Mar 2012 15:41:57 +0000 (15:41 +0000)
MFT/AliMuonForwardTrack.cxx
MFT/AliMuonForwardTrack.h
MFT/AliMuonForwardTrackAnalysis.C
MFT/AliMuonForwardTrackAnalysis.cxx
MFT/AliMuonForwardTrackAnalysis.h
MFT/AliMuonForwardTrackFinder.C
MFT/AliMuonForwardTrackFinder.cxx
MFT/AliMuonForwardTrackFinder.h

index 3e2a6a6..5cfc559 100644 (file)
@@ -42,7 +42,8 @@ AliMuonForwardTrack::AliMuonForwardTrack():
   fMUONTrack(0),
   fMCTrackRef(0),
   fMFTClusters(0),
-  fNWrongClustersMC(-1)
+  fNWrongClustersMC(-1),
+  fTrackMCId(-1)
 {
 
   // default constructor
@@ -63,7 +64,8 @@ AliMuonForwardTrack::AliMuonForwardTrack(AliMUONTrack *MUONTrack):
   fMUONTrack(0),
   fMCTrackRef(0),
   fMFTClusters(0),
-  fNWrongClustersMC(-1)
+  fNWrongClustersMC(-1),
+  fTrackMCId(-1)
 {
 
   SetMUONTrack(MUONTrack);
@@ -83,7 +85,8 @@ AliMuonForwardTrack::AliMuonForwardTrack(const AliMuonForwardTrack& track):
   fMUONTrack(0x0),
   fMCTrackRef(0x0),
   fMFTClusters(0x0),
-  fNWrongClustersMC(track.fNWrongClustersMC)
+  fNWrongClustersMC(track.fNWrongClustersMC),
+  fTrackMCId(track.fTrackMCId)
 {
 
   // copy constructor
@@ -117,6 +120,7 @@ AliMuonForwardTrack& AliMuonForwardTrack::operator=(const AliMuonForwardTrack& t
   if (track.fMCTrackRef) fMCTrackRef = new TParticle(*(track.fMCTrackRef));
   fMFTClusters      = new TClonesArray(*(track.fMFTClusters));
   fNWrongClustersMC = track.fNWrongClustersMC;
+  fTrackMCId        = track.fTrackMCId;
 
   for (Int_t iPlane=0; iPlane<AliMFTConstants::fNMaxPlanes; iPlane++) fPlaneExists[iPlane] = (track.fPlaneExists)[iPlane];
   for (Int_t iParent=0; iParent<fgkNParentsMax; iParent++) {
index 0b9af18..a108ad2 100644 (file)
@@ -76,6 +76,9 @@ public:
   Int_t GetNWrongClustersMC() { return fNWrongClustersMC; }
 
   Double_t Pt() { return TMath::Sqrt(TMath::Power(GetTrackParamAtMFTCluster(0)->Px(),2)+TMath::Power(GetTrackParamAtMFTCluster(0)->Py(),2)); }
+
+  void SetTrackMCId(Int_t id) { fTrackMCId = id; }
+  Int_t GetTrackMCId() { return fTrackMCId; }
   
 protected:
 
@@ -93,6 +96,8 @@ protected:
 
   Int_t fNWrongClustersMC;    // number of wrong associated MC clusters
 
+  Int_t fTrackMCId;   // this number will identify the track within a MC simulation: run, event, MUON track
+
   ClassDef(AliMuonForwardTrack,1)
     
 };
index 78c2ac4..f6c0cd0 100644 (file)
@@ -12,7 +12,7 @@ void AliMuonForwardTrackAnalysis(const Char_t *readDir= ".",
                                 Bool_t muonPairAnalysis = kTRUE,
                                 Int_t firstEvent = -1,
                                 Int_t lastEvent = -1, 
-                                Int_t myRandom,
+                                Int_t myRandom = 0,
                                 Int_t maxNWrongClusters = 999,
                                 Double_t ptMinSingleMuons = 0.0) {
   
@@ -35,6 +35,9 @@ void AliMuonForwardTrackAnalysis(const Char_t *readDir= ".",
   myAnalysis->SetMatchTrigger(kTRUE);
   myAnalysis->SetMaxNWrongClustersMC(maxNWrongClusters);
   myAnalysis->SetPtMinSingleMuons(ptMinSingleMuons);
+  myAnalysis->UseCutOnOffsetChi2(kFALSE);
+  myAnalysis->UseBransonForCut(kFALSE);
+  myAnalysis->UseBransonForKinematics(kFALSE);
 
   myAnalysis->Init("MuonGlobalTracks.root");
 
index 42dd32a..c1533b2 100644 (file)
@@ -33,10 +33,17 @@ AliMuonForwardTrackAnalysis::AliMuonForwardTrackAnalysis():
   TObject(),
   fInputDir(0),
   fOutputDir(0),
-  fInputTree(0),
-  fMuonForwardTracks(0),
-  fMuonForwardTrackPairs(0),
+  fInputTreeWithBranson(0x0),
+  fInputTreeWithoutBranson(0x0),
+  fMuonForwardTracksWithBranson(0),
+  fMuonForwardTrackPairsWithBranson(0),
+  fMuonForwardTracksWithoutBranson(0),
+  fMuonForwardTrackPairsWithoutBranson(0),
+  fMFTTrackWithBranson(0),
+  fMFTTrackWithoutBranson(0),
   fMFTTrack(0),
+  fMFTTrackPairWithBranson(0),
+  fMFTTrackPairWithoutBranson(0),
   fMFTTrackPair(0),
   fMCRefTrack(0),
   fEv(0),
@@ -73,8 +80,19 @@ AliMuonForwardTrackAnalysis::AliMuonForwardTrackAnalysis():
   fXVertResMC(50.e-4),
   fYVertResMC(50.e-4),
   fZVertResMC(50.e-4),
+  fPrimaryVtxX(0.),
+  fPrimaryVtxY(0.),
+  fPrimaryVtxZ(0.),
   fMaxNWrongClustersMC(999),
-  fPtMinSingleMuons(0)
+  fPtMinSingleMuons(0),
+  fUseBransonForCut(kFALSE),
+  fUseBransonForKinematics(kFALSE),
+  fCutOnOffsetChi2(kFALSE),
+  fCenterOffset(0.), 
+  fCenterChi2(1.), 
+  fScaleOffset(250.), 
+  fScaleChi2(4.5),
+  fRadiusCut(1.)
 {
 
   // default constructor
@@ -99,30 +117,39 @@ Bool_t AliMuonForwardTrackAnalysis::Init(Char_t *inputFileName) {
     AliError(Form("Error opening file %s", inputFileName));
     return kFALSE;
   }
-  fInputTree = (TTree*) inputFile->Get("AliMuonForwardTracks");
-  if (!fInputTree) {
+  fInputTreeWithBranson = (TTree*) inputFile->Get("AliMuonForwardTracksWithBranson");
+  if (!fInputTreeWithBranson) {
+    AliError("Error reading input tree");
+    return kFALSE;
+  }
+  fInputTreeWithoutBranson = (TTree*) inputFile->Get("AliMuonForwardTracksWithoutBranson");
+  if (!fInputTreeWithoutBranson) {
     AliError("Error reading input tree");
     return kFALSE;
   }
 
-  if (fFirstEvent<0 || fLastEvent<0 || fFirstEvent>fLastEvent || fFirstEvent>=fInputTree->GetEntries()) {
+  if (fFirstEvent<0 || fLastEvent<0 || fFirstEvent>fLastEvent || fFirstEvent>=fInputTreeWithBranson->GetEntries()) {
     fFirstEvent = 0;
-    fLastEvent  = fInputTree->GetEntries()-1;
+    fLastEvent  = fInputTreeWithBranson->GetEntries()-1;
   }
   else {
-    fLastEvent = TMath::Min(fLastEvent, Int_t(fInputTree->GetEntries()-1));
+    fLastEvent = TMath::Min(fLastEvent, Int_t(fInputTreeWithBranson->GetEntries()-1));
   }
 
   AliInfo(Form("Analysing events %d to %d", fFirstEvent, fLastEvent));
 
-  fMuonForwardTracks = new TClonesArray("AliMuonForwardTrack");
-  fInputTree->SetBranchAddress("tracks", &fMuonForwardTracks);  
+  fMuonForwardTracksWithBranson = new TClonesArray("AliMuonForwardTrack");
+  fInputTreeWithBranson->SetBranchAddress("tracks", &fMuonForwardTracksWithBranson);  
+
+  fMuonForwardTracksWithoutBranson = new TClonesArray("AliMuonForwardTrack");
+  fInputTreeWithoutBranson->SetBranchAddress("tracks", &fMuonForwardTracksWithoutBranson);  
 
   TGeoManager::Import(Form("%s/geometry.root",fInputDir.Data()));
 
   AliMUONTrackExtrap::SetField();
 
-  fMuonForwardTrackPairs = new TClonesArray("AliMuonForwardTrackPair");
+  fMuonForwardTrackPairsWithBranson    = new TClonesArray("AliMuonForwardTrackPair");
+  fMuonForwardTrackPairsWithoutBranson = new TClonesArray("AliMuonForwardTrackPair");
 
   return kTRUE;
 
@@ -134,23 +161,30 @@ Bool_t AliMuonForwardTrackAnalysis::LoadNextEvent() {
 
   if (fEv>fLastEvent) return kFALSE;
   if (fEv<fFirstEvent) { fEv++; return kTRUE; }
-  fMuonForwardTracks -> Clear();
-  fInputTree->GetEvent(fEv);
-  AliInfo(Form("**** analyzing event # %4d (%3d tracks) ****", fEv, fMuonForwardTracks->GetEntries()));
+  fMuonForwardTracksWithBranson -> Delete();
+  fMuonForwardTracksWithoutBranson -> Delete();
+  fInputTreeWithBranson->GetEvent(fEv);
+  fInputTreeWithoutBranson->GetEvent(fEv);
+  AliInfo(Form("**** analyzing event # %4d (%3d tracks) ****", fEv, fMuonForwardTracksWithBranson->GetEntries()));
+
+  fPrimaryVtxX = gRandom->Gaus(0., fXVertResMC);
+  fPrimaryVtxY = gRandom->Gaus(0., fYVertResMC);
+  fPrimaryVtxZ = gRandom->Gaus(0., fZVertResMC);
 
   if (fSingleMuonAnalysis) {
     fNTracksAnalyzedOfEvent = 0;
-    fNTracksOfEvent = fMuonForwardTracks->GetEntries();
+    fNTracksOfEvent = fMuonForwardTracksWithBranson->GetEntries();
     while (AnalyzeSingleMuon()) continue;
   }
   
   if (fMuonPairAnalysis) {
-    if (fMuonForwardTrackPairs) {
-      fMuonForwardTrackPairs->Clear();
+    if (fMuonForwardTrackPairsWithBranson) {
+      fMuonForwardTrackPairsWithBranson->Delete();
+      fMuonForwardTrackPairsWithoutBranson->Delete();
     }
     BuildMuonPairs();
     fNPairsAnalyzedOfEvent = 0;
-    fNPairsOfEvent = fMuonForwardTrackPairs->GetEntries();
+    fNPairsOfEvent = fMuonForwardTrackPairsWithBranson->GetEntries();
     while (AnalyzeMuonPair()) continue;
   }
 
@@ -166,41 +200,43 @@ Bool_t AliMuonForwardTrackAnalysis::AnalyzeSingleMuon() {
 
   if (fNTracksAnalyzedOfEvent>=fNTracksOfEvent) return kFALSE;
 
-  fMFTTrack = (AliMuonForwardTrack*) fMuonForwardTracks->At(fNTracksAnalyzedOfEvent);
+  fMFTTrackWithBranson    = (AliMuonForwardTrack*) fMuonForwardTracksWithBranson->At(fNTracksAnalyzedOfEvent);
+  fMFTTrackWithoutBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithoutBranson->At(fNTracksAnalyzedOfEvent);
+
   fNTracksAnalyzedOfEvent++;
+
+  Bool_t passedCut = kFALSE;
+  if (fUseBransonForCut) passedCut = PassedCutSingleMuon(fMFTTrackWithBranson);
+  else passedCut = PassedCutSingleMuon(fMFTTrackWithoutBranson);
+  if (!passedCut) return kTRUE;
+
+  if (fUseBransonForKinematics) fMFTTrack = fMFTTrackWithBranson;
+  else fMFTTrack = fMFTTrackWithoutBranson;
   if (fMatchTrigger && !fMFTTrack->GetMatchTrigger()) return kTRUE;
   fMCRefTrack = fMFTTrack->GetMCTrackRef();
 
   if (!fMCRefTrack) return kTRUE;
   if (fMFTTrack->GetNWrongClustersMC()>fMaxNWrongClustersMC) return kTRUE;
 
-  Double_t xOrig=gRandom->Gaus(0., fXVertResMC);
-  Double_t yOrig=gRandom->Gaus(0., fYVertResMC);
-//   Double_t xOrig = 0.;
-//   Double_t yOrig = 0.;
-  Double_t zOrig=gRandom->Gaus(0., fZVertResMC);
-
   AliMUONTrackParam *param = fMFTTrack->GetTrackParamAtMFTCluster(0);
-  AliMUONTrackExtrap::ExtrapToZCov(param, zOrig);
+  AliMUONTrackExtrap::ExtrapToZCov(param, fPrimaryVtxZ);
 
   TLorentzVector pMu;
   Double_t mMu = TDatabasePDG::Instance()->GetParticle("mu-")->Mass();
   Double_t energy = TMath::Sqrt(param->P()*param->P() + mMu*mMu);
   pMu.SetPxPyPzE(param->Px(), param->Py(), param->Pz(), energy);
 
-  if (fMFTTrack->Pt()<fPtMinSingleMuons) return kTRUE;
-
   TMatrixD cov(5,5);
   cov = param->GetCovariances();
 
   fHistErrorSingleMuonsX -> Fill(1.e4*TMath::Sqrt(cov(0,0)));
   fHistErrorSingleMuonsY -> Fill(1.e4*TMath::Sqrt(cov(2,2)));
 
-  Double_t dX = fMFTTrack->GetOffsetX(xOrig, zOrig);
-  Double_t dY = fMFTTrack->GetOffsetY(yOrig, zOrig);
+  Double_t dX = fMFTTrack->GetOffsetX(fPrimaryVtxX, fPrimaryVtxZ);
+  Double_t dY = fMFTTrack->GetOffsetY(fPrimaryVtxY, fPrimaryVtxZ);
   
-  Double_t offset = fMFTTrack->GetOffset(xOrig, yOrig, zOrig);
-  Double_t weightedOffset = fMFTTrack->GetWeightedOffset(xOrig, yOrig, zOrig);
+  Double_t offset = fMFTTrack->GetOffset(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ);
+  Double_t weightedOffset = fMFTTrack->GetWeightedOffset(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ);
 
   //  AliDebug(2, Form("pdg code = %d\n", fMCRefTrack->GetPdgCode()));
 
@@ -232,27 +268,32 @@ Bool_t AliMuonForwardTrackAnalysis::AnalyzeMuonPair() {
 
   if (fNPairsAnalyzedOfEvent>=fNPairsOfEvent) return kFALSE;
 
-  fMFTTrackPair = (AliMuonForwardTrackPair*) fMuonForwardTrackPairs->At(fNPairsAnalyzedOfEvent);
+  fMFTTrackPairWithBranson    = (AliMuonForwardTrackPair*) fMuonForwardTrackPairsWithBranson->At(fNPairsAnalyzedOfEvent);
+  fMFTTrackPairWithoutBranson = (AliMuonForwardTrackPair*) fMuonForwardTrackPairsWithoutBranson->At(fNPairsAnalyzedOfEvent);
 
-  if (fOption==kResonanceOnly && !fMFTTrackPair->IsResonance()) {
-    fNPairsAnalyzedOfEvent++;
-    return kTRUE;
-  }
+  fNPairsAnalyzedOfEvent++;
+
+  Bool_t passedCut = kFALSE;
+  if (fUseBransonForCut) passedCut = PassedCutMuonPair(fMFTTrackPairWithBranson);
+  else passedCut = PassedCutMuonPair(fMFTTrackPairWithoutBranson);
+
+  if (!passedCut) return kTRUE;
+
+  if (fUseBransonForKinematics) fMFTTrackPair = fMFTTrackPairWithBranson;
+  else fMFTTrackPair = fMFTTrackPairWithoutBranson;
 
-  Double_t xOrig=gRandom->Gaus(0., fXVertResMC);
-  Double_t yOrig=gRandom->Gaus(0., fYVertResMC);
-  Double_t zOrig=gRandom->Gaus(0., fZVertResMC);
-  AliDebug(1, Form("origin = (%f, %f, %f)", xOrig, yOrig, zOrig));
+  if ( fMFTTrackPair->GetTrack(0)->GetNWrongClustersMC()>fMaxNWrongClustersMC || 
+       fMFTTrackPair->GetTrack(1)->GetNWrongClustersMC()>fMaxNWrongClustersMC ) return kTRUE;
 
-  fHistMassMuonPairs           -> Fill(fMFTTrackPair->GetMass(zOrig));
-  fHistWOffsetMuonPairs        -> Fill(fMFTTrackPair->GetWeightedOffset(xOrig, yOrig, zOrig));
-  fHistMassMuonPairsWithoutMFT -> Fill(fMFTTrackPair->GetMassWithoutMFT(xOrig, yOrig, zOrig));
+  if (fOption==kResonanceOnly && !fMFTTrackPair->IsResonance()) return kTRUE;
+
+  fHistMassMuonPairs           -> Fill(fMFTTrackPair->GetMass(fPrimaryVtxZ));
+  fHistWOffsetMuonPairs        -> Fill(fMFTTrackPair->GetWeightedOffset(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ));
+  fHistMassMuonPairsWithoutMFT -> Fill(fMFTTrackPair->GetMassWithoutMFT(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ));
   fHistMassMuonPairsMC         -> Fill(fMFTTrackPair->GetMassMC());
   fHistRapidityPtMuonPairsMC   -> Fill(fMFTTrackPair->GetRapidityMC(), fMFTTrackPair->GetPtMC());
 
-  AliDebug(1, Form("mass = %f   MC = %f", fMFTTrackPair->GetMass(zOrig), fMFTTrackPair->GetMassMC()));
-
-  fNPairsAnalyzedOfEvent++;
+  AliDebug(1, Form("mass = %f   MC = %f", fMFTTrackPair->GetMass(fPrimaryVtxZ), fMFTTrackPair->GetMassMC()));
 
   return kTRUE;
 
@@ -262,24 +303,27 @@ Bool_t AliMuonForwardTrackAnalysis::AnalyzeMuonPair() {
 
 void AliMuonForwardTrackAnalysis::BuildMuonPairs() {
 
-  for (Int_t iTrack=0; iTrack<fMuonForwardTracks->GetEntries(); iTrack++) {
+  for (Int_t iTrack=0; iTrack<fMuonForwardTracksWithBranson->GetEntries(); iTrack++) {
     for (Int_t jTrack=0; jTrack<iTrack; jTrack++) {
     
-      AliMuonForwardTrack *track0 = (AliMuonForwardTrack*) fMuonForwardTracks->At(iTrack);
-      AliMuonForwardTrack *track1 = (AliMuonForwardTrack*) fMuonForwardTracks->At(jTrack);
+      AliMuonForwardTrack *track0_WithBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithBranson->At(iTrack);
+      AliMuonForwardTrack *track1_WithBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithBranson->At(jTrack);
+
+      AliMuonForwardTrack *track0_WithoutBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithoutBranson->At(iTrack);
+      AliMuonForwardTrack *track1_WithoutBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithoutBranson->At(jTrack);
 
-      if (fMatchTrigger) if (!track0->GetMatchTrigger() || !track1->GetMatchTrigger()) continue;
-      if (!track0->GetMCTrackRef() || !track1->GetMCTrackRef()) continue;
-      if (track0->GetNWrongClustersMC()>fMaxNWrongClustersMC || track1->GetNWrongClustersMC()>fMaxNWrongClustersMC) continue;
-      if (track0->Pt()<fPtMinSingleMuons || track1->Pt()<fPtMinSingleMuons) continue;
+      if (fMatchTrigger) if (!track0_WithBranson->GetMatchTrigger() || !track1_WithBranson->GetMatchTrigger()) continue;
+      if (!track0_WithBranson->GetMCTrackRef() || !track1_WithBranson->GetMCTrackRef()) continue;
 
-      AliMuonForwardTrackPair *trackPair = new AliMuonForwardTrackPair(track0, track1);
-      if (fOption==kResonanceOnly && !trackPair->IsResonance()) {
-       delete trackPair;
+      AliMuonForwardTrackPair *trackPairWithBranson    = new AliMuonForwardTrackPair(track0_WithBranson, track1_WithBranson);
+      AliMuonForwardTrackPair *trackPairWithoutBranson = new AliMuonForwardTrackPair(track0_WithoutBranson, track1_WithoutBranson);
+      if (fOption==kResonanceOnly && !trackPairWithBranson->IsResonance()) {
+       delete trackPairWithBranson;
+       delete trackPairWithoutBranson;
        continue;
       }
-      new ((*fMuonForwardTrackPairs)[fMuonForwardTrackPairs->GetEntries()]) AliMuonForwardTrackPair(*trackPair);
-
+      new ((*fMuonForwardTrackPairsWithBranson)[fMuonForwardTrackPairsWithBranson->GetEntries()]) AliMuonForwardTrackPair(*trackPairWithBranson);
+      new ((*fMuonForwardTrackPairsWithoutBranson)[fMuonForwardTrackPairsWithoutBranson->GetEntries()]) AliMuonForwardTrackPair(*trackPairWithoutBranson);
     }
   }
 
@@ -287,6 +331,38 @@ void AliMuonForwardTrackAnalysis::BuildMuonPairs() {
 
 //====================================================================================================================================================
 
+Bool_t AliMuonForwardTrackAnalysis::PassedCutSingleMuon(AliMuonForwardTrack *track) {
+
+  AliMUONTrackParam *param = track->GetTrackParamAtMFTCluster(0);
+  AliMUONTrackExtrap::ExtrapToZCov(param, fPrimaryVtxZ);
+
+  if (track->Pt()<fPtMinSingleMuons) return kFALSE;
+  
+  if (fCutOnOffsetChi2) {
+    Double_t offset = 1.e4*track->GetOffset(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ);
+    Double_t chi2OverNdf = track->GetGlobalChi2() / Double_t(track->GetNMFTClusters()+track->GetNMUONClusters()); 
+    offset /= fScaleOffset;
+    chi2OverNdf /= fScaleChi2;
+    offset -= fCenterOffset;
+    chi2OverNdf -= fCenterChi2;
+    //    printf("cut on offset and chi2: returning %d\n", TMath::Sqrt(offset*offset + chi2OverNdf*chi2OverNdf)>fRadiusCut);
+    if (TMath::Sqrt(offset*offset + chi2OverNdf*chi2OverNdf) > fRadiusCut) return kFALSE;
+  }
+
+  return kTRUE;
+
+}
+
+//====================================================================================================================================================
+
+Bool_t AliMuonForwardTrackAnalysis::PassedCutMuonPair(AliMuonForwardTrackPair *pair) {
+
+  return PassedCutSingleMuon(pair->GetTrack(0)) && PassedCutSingleMuon(pair->GetTrack(1));
+
+}
+
+//====================================================================================================================================================
+
 void AliMuonForwardTrackAnalysis::Terminate(Char_t *outputFileName) {
 
   for (Int_t rapBin=0; rapBin<fNRapBinsOffsetSingleMuons; rapBin++) {
@@ -401,8 +477,9 @@ void AliMuonForwardTrackAnalysis::BookHistos() {
     
   //--------------------------------------------
 
-  fGraphSingleMuonsOffsetChi2 = new TGraph("fGraphSingleMuonsOffsetChi2");
+  fGraphSingleMuonsOffsetChi2 = new TGraph();
   fGraphSingleMuonsOffsetChi2 -> SetName("fGraphSingleMuonsOffsetChi2");
+  fGraphSingleMuonsOffsetChi2 -> SetTitle("fGraphSingleMuonsOffsetChi2");
 
   //--------------------------------------------
 
index 64e9f54..ffa9421 100644 (file)
@@ -56,6 +56,9 @@ public:
   Bool_t AnalyzeMuonPair();
   void BuildMuonPairs();
 
+  Bool_t PassedCutSingleMuon(AliMuonForwardTrack *track);
+  Bool_t PassedCutMuonPair(AliMuonForwardTrackPair *pair);
+
   void SetVertResMC(Double_t xRes, Double_t yRes, Double_t zRes) { fXVertResMC=xRes; fYVertResMC=yRes; fZVertResMC=zRes; }
 
   void SetOption(Int_t option) { fOption = option; }
@@ -66,6 +69,10 @@ public:
   Int_t GetFirstEvent() { return fFirstEvent; }
   Int_t GetLastEvent()  { return fLastEvent; }
 
+  void UseBransonForCut(Bool_t useBranson) { fUseBransonForCut = useBranson; }
+  void UseBransonForKinematics(Bool_t useBranson) { fUseBransonForKinematics = useBranson; }
+  void UseCutOnOffsetChi2(Bool_t useCut) { fCutOnOffsetChi2 = useCut; }
+
 private:
 
   static const Int_t fNPtBinsOffsetSingleMuons  = 10;
@@ -73,12 +80,13 @@ private:
 
   TString fInputDir, fOutputDir;
 
-  TTree *fInputTree;  //!
+  TTree *fInputTreeWithBranson, *fInputTreeWithoutBranson;  //!
 
-  TClonesArray *fMuonForwardTracks, *fMuonForwardTrackPairs;  //!
-  AliMuonForwardTrack *fMFTTrack;                             //!
-  AliMuonForwardTrackPair *fMFTTrackPair;                     //!
-  TParticle *fMCRefTrack;                                     //!
+  TClonesArray *fMuonForwardTracksWithBranson,    *fMuonForwardTrackPairsWithBranson;                //!
+  TClonesArray *fMuonForwardTracksWithoutBranson, *fMuonForwardTrackPairsWithoutBranson;             //!
+  AliMuonForwardTrack *fMFTTrackWithBranson, *fMFTTrackWithoutBranson, *fMFTTrack;                   //!
+  AliMuonForwardTrackPair *fMFTTrackPairWithBranson, *fMFTTrackPairWithoutBranson, *fMFTTrackPair;   //!
+  TParticle *fMCRefTrack;                                                                            //!
 
   Int_t fEv, fFirstEvent, fLastEvent, fNTracksOfEvent, fNTracksAnalyzedOfEvent, fNTracksAnalyzed, fNPairsOfEvent, fNPairsAnalyzedOfEvent;
   
@@ -100,9 +108,14 @@ private:
   Int_t fOption;
 
   Double_t fXVertResMC, fYVertResMC, fZVertResMC;
+  Double_t fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ;
   Int_t fMaxNWrongClustersMC;
   Double_t fPtMinSingleMuons;
 
+  Bool_t fUseBransonForCut, fUseBransonForKinematics, fCutOnOffsetChi2;
+
+  Double_t fCenterOffset, fCenterChi2, fScaleOffset, fScaleChi2, fRadiusCut;
+
   ClassDef(AliMuonForwardTrackAnalysis, 1)
 
 };
index 1b34e9a..c44ae4c 100644 (file)
@@ -1,6 +1,7 @@
 //================================================================================================================================
 
 void AliMuonForwardTrackFinder(Int_t run=0,
+                              Bool_t bransonCorrection = kTRUE,
                               Double_t zVertexError=0.010,
                               Int_t matching=0,
                               const Char_t *readDir= ".",
@@ -28,9 +29,11 @@ void AliMuonForwardTrackFinder(Int_t run=0,
   //  finder -> SetLowPtCut(0.5);
   finder -> SetVertexError(0.015, 0.015, zVertexError);
   finder -> SetMatchingMode(matching);                // 0 -> real matching   1 -> ideal matching
-//  finder -> SetMinResearchRadiusAtPlane(4, 0.0);
+  //  finder -> SetMinResearchRadiusAtPlane(4, 0.0);
+  //  finder -> SetMinResearchRadiusAtPlane(3, 0.0);
   finder -> SetMinResearchRadiusAtPlane(4, 0.50);
   finder -> SetMinResearchRadiusAtPlane(3, 0.05);
+  finder -> SetBransonCorrection(bransonCorrection);
 
   while (finder->LoadNextTrack()) continue;
 
index 39d4eaa..3c9b843 100644 (file)
@@ -152,7 +152,8 @@ AliMuonForwardTrackFinder::AliMuonForwardTrackFinder():
   fMuonForwardTracks(0),
   fMatchingMode(-1),
   fGRPData(0),
-  fRunInfo(0)
+  fRunInfo(0),
+  fBransonCorrection(kTRUE)
 
 {
 
@@ -740,6 +741,7 @@ Int_t AliMuonForwardTrackFinder::LoadNextTrack() {
     FillPlanesWithTrackHistory();
     AliMuonForwardTrack *newTrack = (AliMuonForwardTrack*) fCandidateTracks->UncheckedAt(idBestCandidate);
     newTrack -> SetNWrongClustersMC(newTrack->GetNMFTClusters() - nGoodClustersBestCandidate);
+    newTrack -> SetTrackMCId(fRun*100000+fEv*1000+fCountRealTracksAnalyzedOfEvent);
     new ((*fMuonForwardTracks)[fMuonForwardTracks->GetEntries()]) AliMuonForwardTrack(*newTrack);
   }
 
@@ -815,8 +817,14 @@ void AliMuonForwardTrackFinder::FindClusterInPlane(Int_t planeId) {
     Double_t xExtrap = gRandom->Gaus(0,fVertexErrorX);
     Double_t yExtrap = gRandom->Gaus(0,fVertexErrorY);
     Double_t zExtrap = gRandom->Gaus(0,fVertexErrorZ);
-    AliMUONTrackExtrap::ExtrapToVertex(&currentParamFront, xExtrap, yExtrap, zExtrap, fVertexErrorX, fVertexErrorY); 
-    AliMUONTrackExtrap::ExtrapToVertex(&currentParamBack,  xExtrap, yExtrap, zExtrap, fVertexErrorX, fVertexErrorY); 
+    if (fBransonCorrection) {
+      AliMUONTrackExtrap::ExtrapToVertex(&currentParamFront, xExtrap, yExtrap, zExtrap, fVertexErrorX, fVertexErrorY); 
+      AliMUONTrackExtrap::ExtrapToVertex(&currentParamBack,  xExtrap, yExtrap, zExtrap, fVertexErrorX, fVertexErrorY); 
+    }
+    else {
+      AliMUONTrackExtrap::ExtrapToVertexWithoutBranson(&currentParamFront, zExtrap);
+      AliMUONTrackExtrap::ExtrapToVertexWithoutBranson(&currentParamBack,  zExtrap);
+    }
     AliMUONTrackExtrap::ExtrapToVertex(&currentParamForResearchFront, xExtrap, yExtrap, zExtrap, fVertexErrorX, fVertexErrorY); 
     AliMUONTrackExtrap::ExtrapToVertex(&currentParamForResearchBack,  xExtrap, yExtrap, zExtrap, fVertexErrorX, fVertexErrorY); 
   }
index adc97ad..e620f59 100644 (file)
@@ -140,6 +140,7 @@ public:
   Bool_t SetRunNumber();
 
   void SetMaxNTracksToBeAnalyzed(Int_t nTracks) { fMaxNTracksToBeAnalyzed = nTracks; }
+  void SetBransonCorrection(Bool_t correction) { fBransonCorrection = correction; }
 
 private:
 
@@ -254,12 +255,14 @@ protected:
 
   AliGRPObject *fGRPData;              //! Data from the GRP/GRP/Data CDB folder
   AliRunInfo *fRunInfo;                //!
+  
+  Bool_t fBransonCorrection;    // if TRUE, Branson Correction is applied when extrapolating the MUON tracks to the vertex region
 
   ClassDef(AliMuonForwardTrackFinder, 1); 
 
 };
 
-//======================================================================================================
+//====================================================================================================================================================
  
 #endif