From e60f3265657e1a18e69397d2fd83a16ccd76d278 Mon Sep 17 00:00:00 2001 From: amarin Date: Thu, 9 Sep 2010 21:27:05 +0000 Subject: [PATCH] adding histos for BeamPipe studies. adding protection for corrupted MC files --- .../AliAnalysisTaskGammaConversion.cxx | 26 ++++++++++++++++--- PWG4/macros/ConfigGammaConversion.C | 24 ++++++++++++++++- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx b/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx index 9361d198fed..de3a5d1527b 100644 --- a/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx +++ b/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx @@ -36,6 +36,7 @@ #include "AliGammaConversionBGHandler.h" #include "AliESDCaloCluster.h" // for combining PHOS and GammaConv #include "AliKFVertex.h" +#include class AliESDTrackCuts; class AliCFContainer; class AliCFManager; @@ -371,6 +372,16 @@ void AliAnalysisTaskGammaConversion::UserExec(Option_t */*option*/) // Write warning here cuts and so on are default if this ever happens } + if (fMCEvent ) { + // To avoid crashes due to unzip errors. Sometimes the trees are not there. + + AliMCEventHandler* mcHandler = dynamic_cast (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); + if (!mcHandler){ AliError("Could not retrive MC event handler!"); return; } + if (!mcHandler->InitOk() ) return; + if (!mcHandler->TreeK() ) return; + if (!mcHandler->TreeTR() ) return; + } + fV0Reader->SetInputAndMCEvent(InputEvent(), MCEvent()); fV0Reader->Initialize(); @@ -1247,13 +1258,22 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){ while(fV0Reader->NextV0()){ nSurvivingV0s++; - + + TVector3 vtxConv(fV0Reader->GetX(),fV0Reader->GetY(), fV0Reader->GetZ()); + //-------------------------- filling v0 information ------------------------------------- fHistograms->FillHistogram("ESD_Conversion_R", fV0Reader->GetXYRadius()); fHistograms->FillHistogram("ESD_Conversion_ZR", fV0Reader->GetZ(),fV0Reader->GetXYRadius()); fHistograms->FillHistogram("ESD_Conversion_XY", fV0Reader->GetX(),fV0Reader->GetY()); fHistograms->FillHistogram("ESD_Conversion_OpeningAngle", fV0Reader->GetOpeningAngle()); - + + // Specific histograms for beam pipe studies + if( TMath::Abs(fV0Reader->GetZ()) < fV0Reader->GetLineCutZValue() ){ + fHistograms->FillHistogram("ESD_Conversion_XY_BeamPipe", fV0Reader->GetX(),fV0Reader->GetY()); + fHistograms->FillHistogram("ESD_Conversion_RPhi_BeamPipe", vtxConv.Phi(),fV0Reader->GetXYRadius()); + } + + fHistograms->FillHistogram("ESD_E_Energy", fV0Reader->GetNegativeTrackEnergy()); fHistograms->FillHistogram("ESD_E_Pt", fV0Reader->GetNegativeTrackPt()); fHistograms->FillHistogram("ESD_E_Eta", fV0Reader->GetNegativeTrackEta()); @@ -1319,7 +1339,7 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){ Int_t phiBin = fHistograms->GetPhiBin(fV0Reader->GetNegativeTrackPhi()); Double_t rFMD=30; - TVector3 vtxConv(fV0Reader->GetX(),fV0Reader->GetY(), fV0Reader->GetZ()); + // Double_t motherCandidateEta= fV0Reader->GetMotherCandidateEta(); diff --git a/PWG4/macros/ConfigGammaConversion.C b/PWG4/macros/ConfigGammaConversion.C index 649f28870de..0fffe31f614 100644 --- a/PWG4/macros/ConfigGammaConversion.C +++ b/PWG4/macros/ConfigGammaConversion.C @@ -38,7 +38,7 @@ Bool_t kGCRecalculateV0ForGamma = kFALSE; //Svein Bool_t kGCRunGammaJetTask = kFALSE; /** ---------------------------------- define cuts here ------------------------------------*/ -TString kGCAnalysisCutSelectionId="900356200010031"; // do not change here, use -set-cut-selection in argument instead +TString kGCAnalysisCutSelectionId="900356200010030"; // do not change here, use -set-cut-selection in argument instead Int_t kGCNEventsForBGCalculation=10; @@ -234,6 +234,8 @@ Bool_t kGCplotMCEtaZRConvGammaWithinAcceptance = kTRUE; Bool_t kGCplotESDConversionR = kTRUE; Bool_t kGCplotESDConversionZR = kTRUE; Bool_t kGCplotESDConversionXY = kTRUE; +Bool_t kGCplotESDConversionXYBeamPipe = kTRUE; +Bool_t kGCplotESDConversionRPhiBeamPipe = kTRUE; Bool_t kGCplotESDConversionOpeningAngle = kTRUE; Bool_t kGCplotESDConvGammaCosPointingAngle = kTRUE; Bool_t kGCplotESDConvGammaDcaDaugthers = kTRUE; @@ -485,6 +487,24 @@ Int_t kGCnYBinsXY = 800; Double_t kGCfirstYBinXY = -200.; Double_t kGClastYBinXY = 200.; +//XY-plots-BeamPipe +Int_t kGCnXBinsXYBP = 200; +Double_t kGCfirstXBinXYBP = -10.; +Double_t kGClastXBinXYBP = 10.; +Int_t kGCnYBinsXYBP = 200; +Double_t kGCfirstYBinXYBP = -10.; +Double_t kGClastYBinXYBP = 10.; + +//Rphi-plots-BeamPipe +Int_t kGCnXBinsRPhiBP = 200; +Double_t kGCfirstXBinRPhiBP = -TMath::Pi(); +Double_t kGClastXBinRPhiBP = TMath::Pi(); +Int_t kGCnYBinsRPhiBP = 200; +Double_t kGCfirstYBinRPhiBP = 0.; +Double_t kGClastYBinRPhiBP = 10.; + + + //OpenAngle-plots Int_t kGCnXBinsOpeningAngle = 400; Double_t kGCfirstXBinOpeningAngle = 0.; @@ -1664,6 +1684,8 @@ void AddHistograms(AliGammaConversionHistograms *histograms){ if(kGCplotESDConversionR == kTRUE){ histograms->AddHistogram("ESD_Conversion_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");} if(kGCplotESDConversionZR == kTRUE){ histograms->AddHistogram("ESD_Conversion_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");} if(kGCplotESDConversionXY == kTRUE){ histograms->AddHistogram("ESD_Conversion_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");} + if(kGCplotESDConversionXYBeamPipe == kTRUE){ histograms->AddHistogram("ESD_Conversion_XY_BeamPipe" ,"" , kGCnXBinsXYBP, kGCfirstXBinXYBP, kGClastXBinXYBP, kGCnYBinsXYBP, kGCfirstYBinXYBP, kGClastYBinXYBP, "", "");} + if(kGCplotESDConversionRPhiBeamPipe == kTRUE){ histograms->AddHistogram("ESD_Conversion_RPhi_BeamPipe" ,"" , kGCnXBinsRPhiBP, kGCfirstXBinRPhiBP, kGClastXBinRPhiBP, kGCnYBinsRPhiBP, kGCfirstYBinRPhiBP, kGClastYBinRPhiBP, "", "");} if(kGCplotESDConversionOpeningAngle == kTRUE){ histograms->AddHistogram("ESD_Conversion_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");} if(kGCplotESDConvGammaCosPointingAngle == kTRUE){ histograms->AddHistogram("ESD_ConvGamma_CosPointingAngle" ,"" , kGCnXBinsCosPointingAngle, kGCfirstXBinCosPointingAngle, kGClastXBinCosPointingAngle, "", "");} -- 2.43.5