updating makefile to include evgen headers to compile systematics selector
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Sep 2006 14:19:48 +0000 (14:19 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Sep 2006 14:19:48 +0000 (14:19 +0000)
adding the disabling of non-needed branches in AliESDtrackCuts and AlidNdEtaAnalysisESDSelector

PWG0/AliPWG0Helper.cxx
PWG0/Makefile
PWG0/dNdEta/AlidNdEtaAnalysisESDSelector.cxx
PWG0/dNdEta/dNdEtaAnalysis.cxx
PWG0/dNdEta/drawPlots.C
PWG0/dNdEta/drawSystematics.C
PWG0/dNdEta/testAnalysis2.C
PWG0/esdTrackCuts/AliESDtrackCuts.cxx
PWG0/esdTrackCuts/AliESDtrackCuts.h
PWG0/libPWG0selectors.pkg

index ade222c0d7ecfa3d739c4e9d0dd58a4f3000571f..a7eaad95b9493ed3dacd72f71925f3f1b8546dde 100644 (file)
@@ -19,6 +19,8 @@ Bool_t AliPWG0Helper::IsEventTriggered(AliESD* aEsd)
 {
   // check if the event was triggered
   //
+  // this function needs the branch fTriggerMask
+  //
   // MB should be
   // ITS_SPD_GFO_L0  : 32
   // VZERO_OR_LEFT   : 1
@@ -36,6 +38,9 @@ Bool_t AliPWG0Helper::IsEventTriggered(AliESD* aEsd)
 Bool_t AliPWG0Helper::IsVertexReconstructed(AliESD* aEsd)
 {
   // checks if the vertex is reasonable
+  //
+  // this function needs the branches fSPDVertex*
+
 
   const AliESDVertex* vtxESD = aEsd->GetVertex();
 
index f7123ee0aca1457e7413c7d6d93d6e8f802f099e..dab6032ce083e3df53703c3958b3c1304d359d39 100644 (file)
@@ -8,7 +8,7 @@ ALICEINC      = -I.
 
 ### define include dir for local case and par case
 ifneq ($(ALICE_ROOT),)
-  ALICEINC += -I$(ALICE_ROOT)/include
+  ALICEINC += -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/PYTHIA6 -I$(ALICE_ROOT)/EVGEN
 else
   ifneq ($(ESD_INCLUDE),)
     ALICEINC += -I../$(ESD_INCLUDE)
index c068884b28a6977ed0dd28b97188ccd96b50f0a6..16b5d9a0795ec8d5bbc26199d8c36537c0ac2516 100644 (file)
@@ -43,36 +43,6 @@ AlidNdEtaAnalysisESDSelector::~AlidNdEtaAnalysisESDSelector()
 
   // histograms are in the output list and deleted when the output
   // list is deleted by the TSelector dtor
-
-  if (fdNdEtaAnalysis)
-  {
-    delete fdNdEtaAnalysis;
-    fdNdEtaAnalysis = 0;
-  }
-
-  if (fdNdEtaAnalysisMB)
-  {
-    delete fdNdEtaAnalysisMB;
-    fdNdEtaAnalysisMB = 0;
-  }
-
-  if (fdNdEtaAnalysisMBVtx)
-  {
-    delete fdNdEtaAnalysisMBVtx;
-    fdNdEtaAnalysisMBVtx = 0;
-  }
-
-  /*if (fEsdTrackCuts)
-  {
-    delete fEsdTrackCuts;
-    fEsdTrackCuts = 0;
-  }
-
-  if (fdNdEtaCorrection)
-  {
-    delete fdNdEtaCorrection;
-    fdNdEtaCorrection = 0;
-  }*/
 }
 
 void AlidNdEtaAnalysisESDSelector::Begin(TTree* tree)
@@ -126,6 +96,16 @@ void AlidNdEtaAnalysisESDSelector::Init(TTree* tree)
   // read the user objects
 
   AliSelector::Init(tree);
+
+  // Enable only the needed branches
+  if (tree)
+  {
+    tree->SetBranchStatus("*", 0);
+    tree->SetBranchStatus("fTriggerMask", 1);
+    tree->SetBranchStatus("fSPDVertex*", 1);
+
+    AliESDtrackCuts::EnableNeededBranches(tree);
+  }
 }
 
 Bool_t AlidNdEtaAnalysisESDSelector::Process(Long64_t entry)
@@ -171,10 +151,16 @@ Bool_t AlidNdEtaAnalysisESDSelector::Process(Long64_t entry)
   }
 
   if (AliPWG0Helper::IsEventTriggered(fESD) == kFALSE)
+  {
+    AliDebug(AliLog::kDebug+1, Form("Skipping event %d because it was not triggered", (Int_t) entry));
     return kTRUE;
+  }
 
   if (AliPWG0Helper::IsVertexReconstructed(fESD) == kFALSE)
+  {
+    AliDebug(AliLog::kDebug+1, Form("Skipping event %d because its vertex was not reconstructed", (Int_t) entry));
     return kTRUE;
+  }
 
   // ########################################################
   // get the EDS vertex
index 778319397f0bbcea44a27c622a24c87681d290f7..b6aa85a6e044611885842b65ab75934f108af559 100644 (file)
@@ -46,7 +46,7 @@ dNdEtaAnalysis::dNdEtaAnalysis(Char_t* name, Char_t* title) :
 {
   // constructor
 
-  fData  = new TH3F(Form("%s_analysis", name),"Input data",80,-20,20,120,-6,6,100, 0, 10);
+  fData  = new TH3F(Form("%s_analysis", name),"Input data",80,-20,20,40,-2,2,100, 0, 10);
   fData->SetXTitle("vtx z [cm]");
   fData->SetYTitle("#eta");
   fData->SetZTitle("p_{T}");
index a3698971b5a066728649d66f6fb9342e524000d7..7dd18d3fb58070dce3c076496fc438deda7cf71c 100644 (file)
@@ -306,6 +306,9 @@ void TriggerBiasVtxRecon(const char* fileName = "correction_map.root", const cha
   Prepare2DPlot(corrVtx);
   corrVtx->SetTitle("b) Vertex reconstruction correction");
 
+  corrTrigger->GetYaxis()->SetTitle("Multiplicity");
+  corrVtx->GetYaxis()->SetTitle("Multiplicity");
+
   TCanvas* canvas = new TCanvas("TriggerBiasVtxRecon", "TriggerBiasVtxRecon", 1000, 500);
   canvas->Divide(2, 1);
 
@@ -342,7 +345,7 @@ void TriggerBias(const char* fileName = "correction_map.root")
 {
   TFile* file = TFile::Open(fileName);
 
-  TH2* corr = dynamic_cast<TH2*> (file->Get("dndeta_correction/corr_trigger"));
+  TH2* corr = dynamic_cast<TH2*> (file->Get("dndeta_correction/corr_dndeta_correction_trigger"));
 
   Prepare2DPlot(corr);
   corr->SetTitle("Trigger bias correction");
@@ -548,6 +551,8 @@ void Track2Particle1D(const char* fileName = "correction_map.root", const char*
   canvas->SaveAs(Form("Track2Particle1D_%s_%f.gif", fileName, upperPtLimit));
   canvas->SaveAs(Form("Track2Particle1D_%s_%f.eps", fileName, upperPtLimit));
 
+  //TPaveText* pave = new TPaveText(-0.4, 1.35, 0.4, 1.45);
+
   canvasName.Form("Track2Particle1D_%s_etapt", folder);
   TCanvas* canvas = new TCanvas(canvasName, canvasName, 1000, 500);
   canvas->Divide(2, 1);
@@ -558,12 +563,22 @@ void Track2Particle1D(const char* fileName = "correction_map.root", const char*
   corrY->GetYaxis()->SetRangeUser(1, 1.5);
   corrY->GetYaxis()->SetTitleOffset(1.5);
   corrY->DrawCopy();
+  TPaveText* pave = new TPaveText(0.3, 0.7, 0.7, 0.8, "NDC");
+  pave->AddText("|z| < 10 cm");
+  pave->AddText("0.3 GeV/c < p_{T} < 10 GeV/c");
+  pave->Draw();
 
   canvas->cd(2);
   InitPad();
-  corrZ->GetYaxis()->SetRangeUser(1, 1.5);
+  gPad->SetLogx();
+  corrZ->GetYaxis()->SetRangeUser(1, 2.5);
+  corrZ->GetXaxis()->SetRangeUser(0.101, upperPtLimit);
   corrZ->GetYaxis()->SetTitleOffset(1.5);
   corrZ->DrawCopy();
+  pave = new TPaveText(0.5, 0.7, 0.8, 0.8, "NDC");
+  pave->AddText("|z| < 10 cm");
+  pave->AddText("|#eta| < 0.8");
+  pave->Draw();
 
   canvas->SaveAs(Form("Track2Particle1D_etapt_%s_%f.eps", fileName, upperPtLimit));
 }
index 56e4feeab3835c2a65d4a4e08d95844724b97341..5696e8a0d1c5b6f8f2bdec19184384a588aaa8de 100644 (file)
@@ -693,7 +693,7 @@ TH1F* Sigma2VertexSimulation()
     return;
   }
 
-  TH1F* ratio = new TH1F("sigmavertexsimulation_ratio", "sigmavertexsimulation_ratio;N#sigma;% included 3 #sigma / % included N#sigma", sigmavertex->GetNbinsX(), sigmavertex->GetXaxis()->GetXmin(), sigmavertex->GetXaxis()->GetXmax());
+  TH1F* ratio = new TH1F("sigmavertexsimulation_ratio", "sigmavertexsimulation_ratio;N#sigma;% included in 3 #sigma / % included in N#sigma", sigmavertex->GetNbinsX(), sigmavertex->GetXaxis()->GetXmin(), sigmavertex->GetXaxis()->GetXmax());
 
   for (Int_t i=1; i<=sigmavertex->GetNbinsX(); ++i)
     ratio->SetBinContent(i, sigmavertex->GetBinContent(sigmavertex->GetXaxis()->FindBin(3)) / sigmavertex->GetBinContent(i));
@@ -738,9 +738,14 @@ void Sigma2VertexCompare()
   TCanvas* canvas = new TCanvas("Sigma2VertexCompare", "Sigma2VertexCompare", 500, 500);
   InitPad();
 
+  ratio2->SetMarkerStyle(21);
+  ratio1->SetMarkerStyle(22);
+
+  ratio2->GetYaxis()->SetRangeUser(0.8, 1.2);
   ratio2->SetLineColor(kRed);
-  ratio2->Draw();
-  ratio1->Draw("SAME");
+  ratio2->SetMarkerColor(kRed);
+  ratio2->Draw("PL");
+  ratio1->Draw("SAMEPL");
 
   legend->Draw();
 
index 3e2e8895d32612af445fde70b1614ab0c1bc4799..752e06b70d04a21d0f474e6bd12cdff3afb1d8ad 100644 (file)
@@ -11,7 +11,7 @@
 #include "../CreateESDChain.C"
 #include "../PWG0Helper.C"
 
-void testAnalysis2(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aMC = kFALSE, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE, const char* correctionMapFile = "correction_map.root", const char* correctionMapFolder = "dndeta_correction")
+void testAnalysis2(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aMC = kFALSE, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE, const char* correctionMapFile = "correction_map.root", const char* correctionMapFolder = "dndeta_correction", const char* option = "")
 {
   if (aProof)
     connectProof("proof01@lxb6046");
@@ -63,7 +63,7 @@ void testAnalysis2(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aMC = kF
   if (aDebug != kFALSE)
     selectorName += "g";
 
-  Int_t result = executeQuery(chain, &inputList, selectorName);
+  Int_t result = executeQuery(chain, &inputList, selectorName, option);
 
   if (result >= 0)
   {
index fd990cc512feaeb80c40730d50d0d8af722a06ae..38b03f576f522ce316dec7f12a14f76e978c44ae 100644 (file)
@@ -4,6 +4,7 @@
 #include <AliESDtrack.h>
 #include <AliESD.h>
 #include <AliLog.h>
+#include <TTree.h>
 
 //____________________________________________________________________
 ClassImp(AliESDtrackCuts)
@@ -447,6 +448,26 @@ Float_t AliESDtrackCuts::GetSigmaToVertex(AliESDtrack* esdTrack)
   return d;
 }
 
+void AliESDtrackCuts::EnableNeededBranches(TTree* tree)
+{
+  // enables the branches needed by AcceptTrack, for a list see comment of AcceptTrack
+
+  tree->SetBranchStatus("fTracks.fFlags", 1);
+  tree->SetBranchStatus("fTracks.fITSncls", 1);
+  tree->SetBranchStatus("fTracks.fTPCncls", 1);
+  tree->SetBranchStatus("fTracks.fITSchi2", 1);
+  tree->SetBranchStatus("fTracks.fTPCchi2", 1);
+  tree->SetBranchStatus("fTracks.fC*", 1);
+  tree->SetBranchStatus("fTracks.fD", 1);
+  tree->SetBranchStatus("fTracks.fZ", 1);
+  tree->SetBranchStatus("fTracks.fCdd", 1);
+  tree->SetBranchStatus("fTracks.fCdz", 1);
+  tree->SetBranchStatus("fTracks.fCzz", 1);
+  tree->SetBranchStatus("fTracks.fP*", 1);
+  tree->SetBranchStatus("fTracks.fR*", 1);
+  tree->SetBranchStatus("fTracks.fKinkIndexes*", 1);
+}
+
 //____________________________________________________________________
 Bool_t
 AliESDtrackCuts::AcceptTrack(AliESDtrack* esdTrack) {
@@ -457,7 +478,22 @@ AliESDtrackCuts::AcceptTrack(AliESDtrack* esdTrack) {
   // retrieved from the track. then it is found out what cuts the
   // track did not survive and finally the cuts are imposed.
 
-
+  // this function needs the following branches:
+  // fTracks.fFlags
+  // fTracks.fITSncls
+  // fTracks.fTPCncls
+  // fTracks.fITSchi2
+  // fTracks.fTPCchi2
+  // fTracks.fC   //GetExternalCovariance
+  // fTracks.fD   //GetImpactParameters
+  // fTracks.fZ   //GetImpactParameters
+  // fTracks.fCdd //GetImpactParameters
+  // fTracks.fCdz //GetImpactParameters
+  // fTracks.fCzz //GetImpactParameters
+  // fTracks.fP   //GetPxPyPz
+  // fTracks.fR   //GetMass
+  // fTracks.fP   //GetMass
+  // fTracks.fKinkIndexes
 
   UInt_t status = esdTrack->GetStatus();
 
@@ -475,7 +511,7 @@ AliESDtrackCuts::AcceptTrack(AliESDtrack* esdTrack) {
   if (nClustersITS!=0)
     chi2PerClusterITS = esdTrack->GetITSchi2()/Float_t(nClustersITS);
   if (nClustersTPC!=0)
-    chi2PerClusterTPC = esdTrack->GetTPCchi2()/Float_t(nClustersTPC);  
+    chi2PerClusterTPC = esdTrack->GetTPCchi2()/Float_t(nClustersTPC);
 
   Double_t extCov[15];
   esdTrack->GetExternalCovariance(extCov);
@@ -535,7 +571,7 @@ AliESDtrackCuts::AcceptTrack(AliESDtrack* esdTrack) {
   // if n sigma could not be calculated
   if (nSigmaToVertex<0 && fCutSigmaToVertexRequired)
     cuts[12]=kTRUE;
-  if (!fCutAcceptKinkDaughters && esdTrack->GetKinkIndex(0)>0) 
+  if (!fCutAcceptKinkDaughters && esdTrack->GetKinkIndex(0)>0)
     cuts[13]=kTRUE;
   // track kinematics cut
   if((momentum < fPMin) || (momentum > fPMax)) 
index 1c758d625526deb150be328d42692e5827dd02ec..789c343cfbe102bf6d6070fcd7cd3f31410afc2a 100644 (file)
@@ -30,6 +30,7 @@
 class AliESD;
 class AliESDtrack;
 class AliLog;
+class TTree;
 
 class AliESDtrackCuts : public TObject 
 {
@@ -81,6 +82,8 @@ public:
   
   virtual void Print(const Option_t* = "") const;
 
+  static void EnableNeededBranches(TTree* tree);
+
   // void SaveQualityCuts(Char_t* file)
   // void LoadQualityCuts(Char_t* file)
 
index 423002c4d702df00062d5fff9a31e2b5eb00c441..aa2439e6696ddef3c4236b04f324c727a578b2f3 100644 (file)
@@ -15,4 +15,4 @@ SRCS = $(HDRS:.h=.cxx)
 
 DHDR= PWG0selectorsLinkDef.h
 
-EINCLUDE=
+EINCLUDE=PYTHIA6 EVGEN