// $Id$
//
+// Task to compute the trigger contamination by exotics.
//
-//
-//
+// Authors: M.Cosentino
#include "TChain.h"
#include "TTree.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TCanvas.h"
+
#include "AliAnalysisTask.h"
#include "AliAnalysisManager.h"
#include "AliESDEvent.h"
ClassImp(AliAnalysisTaskTrgContam)
+AliAnalysisTaskTrgContam::AliAnalysisTaskTrgContam() :
+ AliAnalysisTaskSE(),
+ fCaloClusters(0),
+ fEMCalCells(0),
+ fGeom(0x0),
+ fGeoName("EMCAL_COMPLETEV1"),
+ fPeriod("LHC11c"),
+ fIsTrain(0),
+ fTrigThresh(4.8),
+ fExoticCut(0.97),
+ fESD(0),
+ fOutputList(0),
+ fEvtSel(0),
+ fClusEt(0),
+ fClusEtTM(0),
+ fClusEtLead(0),
+ fClusEtSubLead(0),
+ fClusEtLeadTM(0),
+ fClusEtSubLeadTM(0),
+ fClusEtExotic(0),
+ fClusEtExoticTM(0),
+ fClusEtSingleExotic(0),
+ fCellEnergy(0),
+ fM02Et(0),
+ fM02EtTM(0),
+ fM02EtExot(0),
+ fM02EtExotTM(0)
+{
+ // Default constructor.
+}
+
//________________________________________________________________________
-AliAnalysisTaskTrgContam::AliAnalysisTaskTrgContam(const char *name)
- : AliAnalysisTaskSE(name),
+AliAnalysisTaskTrgContam::AliAnalysisTaskTrgContam(const char *name) :
+ AliAnalysisTaskSE(name),
fCaloClusters(0),
fEMCalCells(0),
fGeom(0x0),
fClusEtExotic(0),
fClusEtExoticTM(0),
fClusEtSingleExotic(0),
+ fCellEnergy(0),
fM02Et(0),
fM02EtTM(0),
fM02EtExot(0),
//________________________________________________________________________
void AliAnalysisTaskTrgContam::UserCreateOutputObjects()
{
- // Create histograms
- // Called once
+ // Create histograms, called once.
fCaloClusters = new TRefArray();
fOutputList = new TList();
fOutputList->SetOwner();// Container cleans up all histos (avoids leaks in merging)
- fGeom = AliEMCALGeometry::GetInstance(fGeoName);
+ fGeom = AliEMCALGeometry::GetInstance(fGeoName.Data());
fEvtSel = new TH1F("hEvtSel","Event selection counter (0=all trg, 1=pvz cut) ;evt cut ;dN/dcut}",2,0,2);
fOutputList->Add(fEvtSel);
-
fClusEt = new TH1F("hClusEt","Clusters E_{T} ;E_{T} ;dN/dE_{T}",400,0,200);
fOutputList->Add(fClusEt);
fClusEtSingleExotic = new TH1F("hClusEtSingleExotic","Exotic trigger clusters (only this above thrs.) E_{T} ;E_{T} ;dN/dE_{T}",400,0,200);
fOutputList->Add(fClusEtSingleExotic);
+
+ fCellEnergy = new TH1F("hCellE","cell energy spectrum;E_{cell} (GeV);entries",200,0,20);
+ fOutputList->Add(fCellEnergy);
fM02Et = new TH2F("hM02Et","#lambda_{0}^{2} vs. E_{T} for trigger clusters ;E_{T} ;#lambda_{0}^{2}",400,0,200, 400,0,4);
fOutputList->Add(fM02Et);
//________________________________________________________________________
void AliAnalysisTaskTrgContam::UserExec(Option_t *)
{
- //event trigger selection
+ // User exec. Called once per event.
+
Bool_t isSelected = 0;
if(fPeriod.Contains("11a"))
isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kEMC1);
else
- isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kEMC7);
+ isSelected = ((((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kCentral) ||
+ (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kSemiCentral));
if(!isSelected )
- return;
- // Main loop
- // Called for each event
+ return;
- // Post output data.
fESD = dynamic_cast<AliESDEvent*>(InputEvent());
if (!fESD) {
printf("ERROR: fESD not available\n");
return;
}
-
- fEvtSel->Fill(0);
-
- AliESDVertex *pv = (AliESDVertex*)fESD->GetPrimaryVertex();
- if(!pv)
- return;
- if(TMath::Abs(pv->GetZ())>15)
- return;
+ fEvtSel->Fill(0);
+ if (0) {
+ AliESDVertex *pv = (AliESDVertex*)fESD->GetPrimaryVertex();
+ if(!pv)
+ return;
+ if(TMath::Abs(pv->GetZ())>15)
+ return;
+ }
fEvtSel->Fill(1);
-
-
- if(!fIsTrain){
+ if (!fIsTrain) {
for(Int_t mod=0; mod < (fGeom->GetEMCGeometry())->GetNumberOfSuperModules(); mod++){
if(fGeoName=="EMCAL_FIRSTYEARV1" && mod>3)
break;
}
fESD->GetEMCALClusters(fCaloClusters);
fEMCalCells = fESD->GetEMCALCells();
-
-
+ for(int i=0;i<fEMCalCells->GetNumberOfCells();i++){
+ Double_t e = fEMCalCells->GetCellAmplitude(TMath::Abs(fEMCalCells->GetAmplitude(i)));
+ fCellEnergy->Fill(e);
+ }
FillClusHists();
-
+
fCaloClusters->Clear();
PostData(1, fOutputList);
-}
-
+}
+
//________________________________________________________________________
void AliAnalysisTaskTrgContam::FillClusHists()
{
+ // Fill cluster histograms.
+
if(!fCaloClusters)
return;
const Int_t nclus = fCaloClusters->GetEntries();
if(nclus==0)
return;
- Double_t EtArray[nclus]; memset(EtArray,0,nclus*sizeof(Double_t));
- Bool_t isTM[nclus]; memset(isTM,0,nclus*sizeof(Bool_t));
- Bool_t isEx[nclus]; memset(isEx,0,nclus*sizeof(Bool_t));
- Int_t index[nclus]; memset(index,0,nclus*sizeof(Int_t));
+ Double_t EtArray[nclus];
+ Bool_t isTM[nclus];
+ Bool_t isEx[nclus];
+ Int_t index[nclus];
Int_t nthresholds = 0;
for(Int_t ic=0;ic<nclus;ic++){
EtArray[ic]=0;
if (!cells)
return 0;
-
if (!fGeom)
return 0;
//________________________________________________________________________
void AliAnalysisTaskTrgContam::Terminate(Option_t *)
{
- // Draw result to the screen
// Called once at the end of the query
}