From 323834f09c15c8b702e0fb1156e2ed418d5d2e83 Mon Sep 17 00:00:00 2001 From: loizides Date: Fri, 1 Apr 2011 20:59:29 +0000 Subject: [PATCH] more histos --- .../CaloCalib/AliAnalysisTaskEMCALPi0PbPb.cxx | 187 +++++++++--------- PWG4/CaloCalib/AliAnalysisTaskEMCALPi0PbPb.h | 4 +- 2 files changed, 101 insertions(+), 90 deletions(-) diff --git a/PWG4/CaloCalib/AliAnalysisTaskEMCALPi0PbPb.cxx b/PWG4/CaloCalib/AliAnalysisTaskEMCALPi0PbPb.cxx index 14eb56df810..97bb05e66c0 100644 --- a/PWG4/CaloCalib/AliAnalysisTaskEMCALPi0PbPb.cxx +++ b/PWG4/CaloCalib/AliAnalysisTaskEMCALPi0PbPb.cxx @@ -247,7 +247,7 @@ void AliAnalysisTaskEMCALPi0PbPb::UserExec(Option_t *) } if (!fGeom) { // set misalignment matrices (stored in first event) - fGeom = new AliEMCALGeoUtils("EMCAL_FIRSTYEARV1","EMCAL"); + fGeom = new AliEMCALGeoUtils("EMCAL_FIRSTYEARV1","EMCAL"); //todo need to set name if (fEsdEv) { for (Int_t i=0; i<4; ++i) fGeom->SetMisalMatrix(fEsdEv->GetESDRun()->GetEMCALMatrix(i),i); @@ -382,6 +382,7 @@ void AliAnalysisTaskEMCALPi0PbPb::UserExec(Option_t *) FillCellHists(); FillClusHists(); FillPionHists(); + FillOtherHists(); PostData(1, fOutput); } @@ -400,6 +401,97 @@ void AliAnalysisTaskEMCALPi0PbPb::Terminate(Option_t *) AliInfo(Form("\n%s: Accepted %lld events", GetName(), fNEvs)); } +//________________________________________________________________________ +void AliAnalysisTaskEMCALPi0PbPb::ClusterAfterburner() +{ + // + + AliVCaloCells *cells = fEsdCells; + if (!cells) + cells = fAodCells; + + if (!cells) + return; + + Int_t ncells = cells->GetNumberOfCells(); + if (ncells<=0) + return; + + Double_t cellMeanE = 0, cellSigE = 0; + for (Int_t i = 0; iGetAmplitude(i); + cellMeanE += cellE; + cellSigE += cellE*cellE; + } + cellMeanE /= ncells; + cellSigE /= ncells; + cellSigE -= cellMeanE*cellMeanE; + if (cellSigE<0) + cellSigE = 0; + cellSigE = TMath::Sqrt(cellSigE / ncells); + + Double_t subE = cellMeanE - 7*cellSigE; + if (subE<0) + return; + + for (Int_t i = 0; iGetCell(i, id, amp, time)) + continue; + amp -= cellMeanE; + if (amp<0.001) + amp = 0; + cells->SetCell(i, id, amp, time); + } + + TObjArray *clusters = fEsdClusters; + if (!clusters) + clusters = fAodClusters; + + if (!clusters) + return; + + Int_t nclus = clusters->GetEntries(); + for (Int_t i = 0; i(clusters->At(i)); + if (!clus->IsEMCAL()) + continue; + Int_t nc = clus->GetNCells(); + Double_t clusE = 0; + UShort_t ids[100] = {0}; + Double_t fra[100] = {0}; + for (Int_t j = 0; jGetCellAbsId(j)); + Double_t cen = cells->GetCellAmplitude(id); + clusE += cen; + if (cen>0) { + ids[nc] = id; + ++nc; + } + } + if (clusE<=0) { + clusters->RemoveAt(i); + continue; + } + + for (Int_t j = 0; jGetCellAmplitude(id); + fra[j] = cen/clusE; + } + clus->SetE(clusE); + AliAODCaloCluster *aodclus = dynamic_cast(clus); + if (aodclus) { + aodclus->Clear(""); + aodclus->SetNCells(nc); + aodclus->SetCellsAmplitudeFraction(fra); + aodclus->SetCellsAbsId(ids); + } + } + clusters->Compress(); +} + //________________________________________________________________________ void AliAnalysisTaskEMCALPi0PbPb::FillCellHists() { @@ -417,7 +509,7 @@ void AliAnalysisTaskEMCALPi0PbPb::FillCellHists() if (ncells==0) return; - for (Int_t i = 0; iGetCellNumber(i)); Double_t cellE = cells->GetAmplitude(i); fHCellE->Fill(cellE); @@ -440,7 +532,9 @@ void AliAnalysisTaskEMCALPi0PbPb::FillCellHists() fHCellH->Fill(cellMaxE); cellMeanE /= ncells; fHCellM->Fill(cellMeanE); - fHCellM2->Fill(cellMeanE*ncells/24/48/4); //hard-coded but there is a way to figure out from geometry + fHCellM2->Fill(cellMeanE*ncells/24/48/4); //hard-coded but there is a way to figure out from geometry + //Double_t avgE = totE / AliEMCALGeometry::GetInstance(fGeomName)->GetNumberOfSuperModules()/48/24; + for (Int_t i=0; i<4; ++i) fHCellMult[i]->Fill(cellModCount[i]); } @@ -572,92 +666,9 @@ void AliAnalysisTaskEMCALPi0PbPb::FillPionHists() } //________________________________________________________________________ -void AliAnalysisTaskEMCALPi0PbPb::ClusterAfterburner() +void AliAnalysisTaskEMCALPi0PbPb::FillOtherHists() { - // - - AliVCaloCells *cells = fEsdCells; - if (!cells) - cells = fAodCells; - - if (!cells) - return; - - Int_t ncells = cells->GetNumberOfCells(); - if (ncells<=0) - return; - - Double_t cellMeanE = 0, cellSigE = 0; - for (Int_t i = 0; iGetAmplitude(i); - cellMeanE += cellE; - cellSigE += cellE*cellE; - } - cellMeanE /= ncells; - cellSigE /= ncells; - cellSigE -= cellMeanE*cellMeanE; - if (cellSigE<0) - cellSigE = 0; - cellSigE = TMath::Sqrt(cellSigE / ncells); - - Double_t subE = cellMeanE - 7*cellSigE; - if (subE<0) - return; - - for (Int_t i = 0; iGetCell(i, id, amp, time)) - continue; - amp -= cellMeanE; - if (amp<0.001) - amp = 0; - cells->SetCell(i, id, amp, time); - } - - TObjArray *clusters = fEsdClusters; - if (!clusters) - clusters = fAodClusters; - - if (!clusters) - return; - - Int_t nclus = clusters->GetEntries(); - for (Int_t i = 0; i(clusters->At(i)); - Int_t nc = clus->GetNCells(); - Double_t clusE = 0; - UShort_t ids[100] = {0}; - Double_t fra[100] = {0}; - for (Int_t j = 0; jGetCellAbsId(j)); - Double_t cen = cells->GetCellAmplitude(id); - clusE += cen; - if (cen>0) { - ids[nc] = id; - ++nc; - } - } - if (clusE<=0) { - clusters->RemoveAt(i); - continue; - } - - for (Int_t j = 0; jGetCellAmplitude(id); - fra[j] = cen/clusE; - } - clus->SetE(clusE); - AliAODCaloCluster *aodclus = dynamic_cast(clus); - if (aodclus) { - aodclus->Clear(""); - aodclus->SetNCells(nc); - aodclus->SetCellsAmplitudeFraction(fra); - aodclus->SetCellsAbsId(ids); - } - } - clusters->Compress(); + // Fill histograms related to cell properties. } //________________________________________________________________________ diff --git a/PWG4/CaloCalib/AliAnalysisTaskEMCALPi0PbPb.h b/PWG4/CaloCalib/AliAnalysisTaskEMCALPi0PbPb.h index d6bb8d7e271..791c821b560 100644 --- a/PWG4/CaloCalib/AliAnalysisTaskEMCALPi0PbPb.h +++ b/PWG4/CaloCalib/AliAnalysisTaskEMCALPi0PbPb.h @@ -42,11 +42,11 @@ class AliAnalysisTaskEMCALPi0PbPb : public AliAnalysisTaskSE { void SetVertexRange(Double_t z1, Double_t z2) { fVtxZMin=z1; fVtxZMax=z2; } protected: + virtual void ClusterAfterburner(); virtual void FillCellHists(); virtual void FillClusHists(); virtual void FillPionHists(); - virtual void ClusterAfterburner(); - + virtual void FillOtherHists(); Double_t GetMaxCellEnergy(AliVCluster *c); void GetSigma(AliVCluster *c, Double_t &sigmaMax, Double_t &sigmaMin); -- 2.43.0