]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
1) Choose correction file with TString in AddTask (no file means no correction) 2...
authormiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 3 May 2013 12:36:51 +0000 (12:36 +0000)
committermiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 3 May 2013 12:36:51 +0000 (12:36 +0000)
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskBFPsi.cxx
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskBFPsi.h

index 45b77eed3bbd96f4c875eb14f78676bae53be50a..cc29c675f1d92f7273460c5ea8e3c7a7de877dd7 100755 (executable)
@@ -502,15 +502,23 @@ void AliAnalysisTaskBFPsi::UserCreateOutputObjects() {
 \r
 \r
 //________________________________________________________________________\r
-void AliAnalysisTaskBFPsi::SetInputCorrection(const char* filename, \r
-                                             const char* gCollSystem) {\r
+void AliAnalysisTaskBFPsi::SetInputCorrection(TString filename, \r
+                                             TString gCollSystem) {\r
   //Open files that will be used for correction\r
   TString gCollidingSystem = gCollSystem;\r
 \r
+  cout<<filename<<endl;\r
+\r
+  // No file specified -> run without corrections\r
+  if(!filename.Contains(".root")) {\r
+    AliInfo(Form("No correction file specified (= %s) --> run without corrections",filename.Data()));\r
+    return;\r
+  }\r
+\r
   //Open the input file\r
   TFile *f = TFile::Open(filename);\r
   if(!f->IsOpen()) {\r
-    Printf("File not found!!!");\r
+    AliInfo(Form("File %s not found --> run without corrections",filename.Data()));\r
     return;\r
   }\r
     \r
@@ -1135,7 +1143,6 @@ TObjArray* AliAnalysisTaskBFPsi::GetAcceptedTracks(AliVEvent *event, Double_t gC
       \r
       //=======================================correction\r
       Double_t correction = GetTrackbyTrackCorrectionMatrix(vEta, vPhi, vPt, vCharge, gCentrality);  \r
-\r
       //Printf("CORRECTIONminus: %.2f | Centrality %lf",correction,gCentrality);\r
       \r
       // add the track to the TObjArray\r
@@ -1170,30 +1177,39 @@ TObjArray* AliAnalysisTaskBFPsi::GetAcceptedTracks(AliVEvent *event, Double_t gC
       if( vPt < fPtMin || vPt > fPtMax)      continue;\r
       if( vEta < fEtaMin || vEta > fEtaMax)  continue;\r
 \r
-      // //Exclude resonances\r
-      // if(fExcludeResonancesInMC) {\r
-      //       TParticle *particle = track->Particle();\r
-      //       if(!particle) continue;\r
+      // Remove neutral tracks\r
+      if( vCharge == 0 ) continue;\r
+\r
+      //Exclude resonances\r
+      if(fExcludeResonancesInMC) {\r
        \r
-      //       Bool_t kExcludeParticle = kFALSE;\r
-      //       Int_t gMotherIndex = particle->GetFirstMother();\r
-      //       if(gMotherIndex != -1) {\r
-      //         AliMCParticle* motherTrack = dynamic_cast<AliMCParticle *>(event->GetTrack(gMotherIndex));\r
-      //         if(motherTrack) {\r
-      //           TParticle *motherParticle = motherTrack->Particle();\r
-      //           if(motherParticle) {\r
-      //             Int_t pdgCodeOfMother = motherParticle->GetPdgCode();\r
-      //             //if((pdgCodeOfMother == 113)||(pdgCodeOfMother == 213)||(pdgCodeOfMother == 221)||(pdgCodeOfMother == 223)||(pdgCodeOfMother == 331)||(pdgCodeOfMother == 333)) {\r
-      //             if(pdgCodeOfMother == 113) {\r
-      //               kExcludeParticle = kTRUE;\r
-      //             }\r
-      //           }\r
-      //         }\r
-      //       }\r
+       Bool_t kExcludeParticle = kFALSE;\r
+       Int_t gMotherIndex = aodTrack->GetMother();\r
+       if(gMotherIndex != -1) {\r
+         AliAODMCParticle* motherTrack = dynamic_cast<AliAODMCParticle *>(mcEvent->GetTrack(gMotherIndex));\r
+         if(motherTrack) {\r
+           Int_t pdgCodeOfMother = motherTrack->GetPdgCode();\r
+           //if((pdgCodeOfMother == 113)||(pdgCodeOfMother == 213)||(pdgCodeOfMother == 221)||(pdgCodeOfMother == 223)||(pdgCodeOfMother == 331)||(pdgCodeOfMother == 333)) {\r
+           //if(pdgCodeOfMother == 113) {\r
+           if(pdgCodeOfMother == 113  // rho0\r
+              || pdgCodeOfMother == 213 || pdgCodeOfMother == -213 // rho+\r
+              || pdgCodeOfMother == 221  // eta\r
+              || pdgCodeOfMother == 331  // eta'\r
+              || pdgCodeOfMother == 223  // omega\r
+              || pdgCodeOfMother == 333  // phi\r
+              || pdgCodeOfMother == 311  || pdgCodeOfMother == -311 // K0\r
+              || pdgCodeOfMother == 313  || pdgCodeOfMother == -313 // K0*\r
+              || pdgCodeOfMother == 323  || pdgCodeOfMother == -323 // K+*\r
+              \r
+              ) {\r
+             kExcludeParticle = kTRUE;\r
+           }\r
+         }\r
+       }\r
        \r
-      //       //Exclude from the analysis decay products of rho0, rho+, eta, eta' and phi\r
-      //       if(kExcludeParticle) continue;\r
-      // }\r
+       //Exclude from the analysis decay products of rho0, rho+, eta, eta' and phi\r
+       if(kExcludeParticle) continue;\r
+      }\r
 \r
       // fill QA histograms\r
       fHistPt->Fill(vPt,gCentrality);\r
@@ -1205,8 +1221,9 @@ TObjArray* AliAnalysisTaskBFPsi::GetAcceptedTracks(AliVEvent *event, Double_t gC
       if(vCharge > 0)      fHistEtaPhiPos->Fill(vEta,vPhi,gCentrality);                 \r
       else if(vCharge < 0) fHistEtaPhiNeg->Fill(vEta,vPhi,gCentrality);\r
       \r
-      //=======================================correction (NO corrections in case of MC truth)\r
-      Double_t correction = 1.;      \r
+      //=======================================correction\r
+      Double_t correction = GetTrackbyTrackCorrectionMatrix(vEta, vPhi, vPt, vCharge, gCentrality);  \r
+      //Printf("CORRECTIONminus: %.2f | Centrality %lf",correction,gCentrality);   \r
       \r
       // add the track to the TObjArray\r
       tracksAccepted->Add(new AliBFBasicParticle(vEta, vPhi, vPt, vCharge, correction));  \r
@@ -1420,6 +1437,7 @@ TObjArray* AliAnalysisTaskBFPsi::GetAcceptedTracks(AliVEvent *event, Double_t gC
        //exclude non stable particles\r
        if(!(gMCEvent->IsPhysicalPrimary(iTracks))) continue;\r
        \r
+       vCharge = track->Charge();\r
        vEta    = track->Eta();\r
        vPt     = track->Pt();\r
        vY      = track->Y();\r
@@ -1432,6 +1450,9 @@ TObjArray* AliAnalysisTaskBFPsi::GetAcceptedTracks(AliVEvent *event, Double_t gC
        else if (fUsePID){\r
          if( vY < fEtaMin || vY > fEtaMax)  continue;\r
        }\r
+\r
+       // Remove neutral tracks\r
+       if( vCharge == 0 ) continue;\r
        \r
        //analyze one set of particles\r
        if(fUseMCPdgCode) {\r
@@ -1475,7 +1496,6 @@ TObjArray* AliAnalysisTaskBFPsi::GetAcceptedTracks(AliVEvent *event, Double_t gC
          if(kExcludeParticle) continue;\r
        }\r
        \r
-       vCharge = track->Charge();\r
        vPhi    = track->Phi();\r
        //Printf("phi (before): %lf",vPhi);\r
        \r
@@ -1519,8 +1539,9 @@ TObjArray* AliAnalysisTaskBFPsi::GetAcceptedTracks(AliVEvent *event, Double_t gC
        \r
        //vPhi *= TMath::RadToDeg();\r
        \r
-       //=======================================correction (NO corrections in case of MC truth)\r
-       Double_t correction = 1.;\r
+      //=======================================correction\r
+      Double_t correction = GetTrackbyTrackCorrectionMatrix(vEta, vPhi, vPt, vCharge, gCentrality);  \r
+      //Printf("CORRECTIONminus: %.2f | Centrality %lf",correction,gCentrality);\r
 \r
        tracksAccepted->Add(new AliBFBasicParticle(vEta, vPhi, vPt, vCharge, correction)); \r
       } //track loop\r
index ee505f976ffa761fab25b497f142d71f00704ca0..e43c2b33112426a6e260604de0bc1e77ad9ab455 100755 (executable)
@@ -40,9 +40,7 @@ class AliAnalysisTaskBFPsi : public AliAnalysisTaskSE {
   virtual void   Terminate(Option_t *);\r
 \r
   //========================correction\r
-  virtual void   SetInputCorrection(const char* filename, const char* gCollSystem);//{\r
-    //fileNameCorrection = filename;//++++++++++++++++++++++++++++++=\r
-    //;}\r
+  virtual void   SetInputCorrection(TString filename, TString gCollSystem);//{\r
   //========================correction\r
 \r
   void SetAnalysisObject(AliBalancePsi *const analysis) {\r
@@ -149,8 +147,6 @@ class AliAnalysisTaskBFPsi : public AliAnalysisTaskSE {
         fEventClass = receivedEventClass;\r
     }\r
 \r
-    //========================correction=============================//\r
-    // void SetInputCorrection(const char* filename = "efficiencyCorrection.root"){}\r
 \r
  private:\r
   Double_t    IsEventAccepted(AliVEvent* event);\r
@@ -234,8 +230,6 @@ class AliAnalysisTaskBFPsi : public AliAnalysisTaskSE {
   Double_t fPIDNSigma;//nsigma cut for PID\r
   Double_t fMinAcceptedPIDProbability;//probability cut for PID\r
 \r
-  //const char*  fileNameCorrection; //++++++++++++++++++++++++++++++++++\r
-\r
   //============PID============//\r
 \r
   AliESDtrackCuts *fESDtrackCuts; //ESD track cuts\r