fHistMaxTrgCluster->GetYaxis()->SetTitle("counts");
fOutput->Add(fHistMaxTrgCluster);
- for (Int_t i = 0; i < 3; i++) {
+ for (Int_t i = 0; i < 4; i++) {
TString histnamephi("fHistTrackPhi_");
histnamephi += i;
fHistTrackPhi[i] = new TH1F(histnamephi.Data(),histnamephi.Data(), 32, 0, 6.4);
fHistTrackEta[1]->SetLineColor(kBlue);
fHistTrackPhi[2]->SetLineColor(kGreen);
fHistTrackEta[2]->SetLineColor(kGreen);
+ fHistTrackPhi[3]->SetLineColor(kBlack);
+ fHistTrackEta[3]->SetLineColor(kBlack);
PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram
}
}
fHistTrPhiEta->Fill(eta, phi);
+ fHistTrackEta[3]->Fill(eta);
+ fHistTrackPhi[3]->Fill(phi);
if (label >= 0 && label < 3) {
fHistTrackEta[label]->Fill(eta);
TH2F *fHistClusPhiEta; // Phi-Eta distribution of clusters
TH2F *fHistJetPhiEta; // Phi-Eta distribution of jets
TH1F *fHistMaxTrgCluster; // Energy distribution of max trigger clusters
- TH1F *fHistTrackPhi[3]; // Phi distribution of hybrid tracks
- TH1F *fHistTrackEta[3]; // Eta distribution of hybrid tracks
+ TH1F *fHistTrackPhi[4]; // Phi distribution of hybrid tracks
+ TH1F *fHistTrackEta[4]; // Eta distribution of hybrid tracks
Int_t Ptbins; // No. of pt bins
Float_t Ptlow; // Min pt
--- /dev/null
+// $Id: AliEmcalPicoTrackMaker.cxx $
+//
+// Class to make PicoTracks in AOD/ESD events.
+//
+//
+
+#include <TClonesArray.h>
+
+#include "AliAnalysisManager.h"
+#include "AliVEvent.h"
+#include "AliPicoTrack.h"
+#include "AliVTrack.h"
+#include "AliAODTrack.h"
+#include "AliESDtrack.h"
+#include "AliESDtrackCuts.h"
+#include "AliLog.h"
+
+#include "AliEmcalPicoTrackMaker.h"
+
+ClassImp(AliEmcalPicoTrackMaker)
+
+//________________________________________________________________________
+AliEmcalPicoTrackMaker::AliEmcalPicoTrackMaker() :
+ AliAnalysisTaskSE("AliEmcalPicoTrackMaker"),
+ fESDtrackCuts(0),
+ fTracksOutName("PicoTracks"),
+ fTracksInName("tracks"),
+ fTracksIn(0),
+ fTracksOut(0)
+{
+ // Constructor.
+}
+
+//________________________________________________________________________
+AliEmcalPicoTrackMaker::AliEmcalPicoTrackMaker(const char *name) :
+ AliAnalysisTaskSE("AliEmcalPicoTrackMaker"),
+ fESDtrackCuts(0),
+ fTracksOutName("PicoTracks"),
+ fTracksInName("tracks"),
+ fTracksIn(0),
+ fTracksOut(0)
+{
+ // Constructor.
+
+ if (!name)
+ return;
+
+ SetName(name);
+
+ fBranchNames = "ESD:AliESDHeader.,AliESDRun.,SPDVertex.,Tracks";
+}
+
+//________________________________________________________________________
+AliEmcalPicoTrackMaker::~AliEmcalPicoTrackMaker()
+{
+ //Destructor
+
+}
+
+//________________________________________________________________________
+void AliEmcalPicoTrackMaker::UserCreateOutputObjects()
+{
+ // Create histograms.
+
+ fTracksOut = new TClonesArray("AliPicoTrack");
+ fTracksOut->SetName(fTracksOutName);
+}
+
+//________________________________________________________________________
+void AliEmcalPicoTrackMaker::UserExec(Option_t *)
+{
+ // Main loop, called for each event.
+
+ AliAnalysisManager *am = AliAnalysisManager::GetAnalysisManager();
+ if (!am) {
+ AliError("Manager zero, returning");
+ return;
+ }
+
+ RetrieveEventObjects();
+
+ // add tracks to event if not yet there
+ if (!(InputEvent()->FindListObject(fTracksOutName)))
+ InputEvent()->AddObject(fTracksOut);
+
+ Int_t Ntracks = GetNumberOfTracks();
+ for (Int_t iTracks = 0, nacc = 0; iTracks < Ntracks; ++iTracks) {
+ AliVTrack *track = GetTrack(iTracks);
+
+ if (!AcceptTrack(track))
+ continue;
+
+ Int_t label = 0;
+
+ if (track->InheritsFrom("AliAODTrack")) {
+ AliAODTrack *aodtrack = dynamic_cast<AliAODTrack*>(track);
+ if (aodtrack->TestFilterBit(fAODfilterBits[0]))
+ label = 0;
+ else if (aodtrack->TestFilterBit(fAODfilterBits[1]))
+ label = 1;
+ else //if (aodtrack->TestFilterBit(fAODfilterBits[2]))
+ label = 2;
+ }
+ else {
+ label = track->GetLabel();
+ }
+
+ AliPicoTrack *picotrack = new ((*fTracksOut)[nacc]) AliPicoTrack(track->Pt(), track->Eta(), track->Phi(),
+ track->Charge(), label,
+ track->GetTrackEtaOnEMCal(), track->GetTrackPhiOnEMCal(), track->IsEMCAL());
+ if (track->IsEMCAL()) {
+ picotrack->SetEMCALcluster(track->GetEMCALcluster());
+ }
+ //cout << iTracks << " - is emcal = " << track->IsEMCAL() << ", phiemc = " << track->GetTrackPhiOnEMCal() << ", etaemc = " << track->GetTrackEtaOnEMCal() << ", emcid = " << track->GetEMCALcluster() << endl;
+ ++nacc;
+ }
+}
+
+
+//________________________________________________________________________
+Bool_t AliEmcalPicoTrackMaker::AcceptTrack(AliVTrack *track)
+{
+ if (!track)
+ return kFALSE;
+
+ if (track->InheritsFrom("AliAODTrack")) {
+ AliAODTrack *aodtrack = dynamic_cast<AliAODTrack*>(track);
+ if (aodtrack) {
+ //cout << "filter bit = " << fFilterBit << ", filter map = " << aodtrack->GetFilterMap() << endl;
+ return aodtrack->TestFilterBit(fAODfilterBits[0]+fAODfilterBits[1]+fAODfilterBits[2]);
+ //return aodtrack->IsHybridGlobalConstrainedGlobal();
+ }
+ else {
+ AliError("Could not cast AOD track!");
+ return kFALSE;
+ }
+ }
+ else if (track->InheritsFrom("AliESDtrack")) {
+ if (fESDtrackCuts) {
+ AliESDtrack *esdtrack = dynamic_cast<AliESDtrack*>(track);
+ if (esdtrack) {
+ return fESDtrackCuts->AcceptTrack(esdtrack);
+ }
+ else {
+ AliError("Could not cast ESD track!");
+ return kFALSE;
+ }
+ }
+ else {
+ return kTRUE;
+ }
+ }
+ else if (track->InheritsFrom("PicoTrack")) {
+ AliWarning("PicoTrack: nothing to filter!");
+ return kTRUE;
+ }
+}
+
+//________________________________________________________________________
+void AliEmcalPicoTrackMaker::RetrieveEventObjects()
+{
+ fTracksIn = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTracksInName));
+
+ if (!fTracksIn) {
+ AliError(Form("ERROR: Could not retrieve tracks %s!", fTracksInName.Data()));
+ }
+}
+
+//________________________________________________________________________
+AliVTrack* AliEmcalPicoTrackMaker::GetTrack(const Int_t i) const
+{
+ if (fTracksIn)
+ return dynamic_cast<AliVTrack*>(fTracksIn->At(i));
+ else
+ return 0;
+}
+
+//________________________________________________________________________
+Int_t AliEmcalPicoTrackMaker::GetNumberOfTracks() const
+{
+ if (fTracksIn)
+ return fTracksIn->GetEntriesFast();
+ else
+ return 0;
+}
--- /dev/null
+#ifndef ALIEMCALPICOTRACKMAKER_H
+#define ALIEMCALPICOTRACKMAKER_H
+
+// $Id: AliEmcalPicoTrackMaker.h 54003 2012-01-19 16:40:42Z loizides $
+
+class TClonesArray;
+class AliVEvent;
+class AliVTrack;
+class AliESDtrackCuts;
+
+#include "AliAnalysisTaskSE.h"
+
+class AliEmcalPicoTrackMaker : public AliAnalysisTaskSE {
+ public:
+ AliEmcalPicoTrackMaker();
+ AliEmcalPicoTrackMaker(const char *name);
+ virtual ~AliEmcalPicoTrackMaker();
+
+ void UserCreateOutputObjects();
+ void UserExec(Option_t *option);
+
+ void SetAODfilterBits(Int_t b0 = 0, Int_t b1 = 0, Int_t b2 = 0) { fAODfilterBits[0] = b0; fAODfilterBits[1] = b1; fAODfilterBits[2] = b2; }
+ void SetTracksOutName(const char *name) { fTracksOutName = name; }
+ void SetTracksInName(const char *name) { fTracksInName = name; }
+ void SetESDtrackCuts(AliESDtrackCuts *cuts) { fESDtrackCuts = cuts; }
+
+ protected:
+ Bool_t AcceptTrack(AliVTrack *track) ;
+ void RetrieveEventObjects() ;
+ AliVTrack* GetTrack(const Int_t i) const;
+ Int_t GetNumberOfTracks() const;
+
+ Int_t fAODfilterBits[3]; // AOD track filter bit map
+ AliESDtrackCuts *fESDtrackCuts; // ESD track cuts
+ TString fTracksOutName; // Name of output track array
+ TString fTracksInName; // Name of input track array
+ TClonesArray *fTracksIn; //!Track array in
+ TClonesArray *fTracksOut; //!Track array out
+
+ private:
+ AliEmcalPicoTrackMaker(const AliEmcalPicoTrackMaker&); // not implemented
+ AliEmcalPicoTrackMaker &operator=(const AliEmcalPicoTrackMaker&); // not implemented
+
+ ClassDef(AliEmcalPicoTrackMaker, 1); // Class to make PicoTracks in AOD/ESD events
+};
+
+#endif
{
fEMCALTender->ProcessEvent();
}
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/* $Id: AliEmcalTenderTask.cxx 48689 2011-03-23 21:35:50Z agheata $ */
-
-#include <TChain.h>
-#include <TFile.h>
-
-#include "TenderSupplies/AliEMCALTenderSupply.h"
-#include "AliAnalysisManager.h"
-
-#include "AliEmcalTenderTask.h"
-
-ClassImp(AliEmcalTenderTask)
-
-//______________________________________________________________________________
-AliEmcalTenderTask::AliEmcalTenderTask():
- AliAnalysisTaskSE(),
- fEMCALTender(NULL)
-{
-// Dummy constructor
-}
-
-//______________________________________________________________________________
-AliEmcalTenderTask::AliEmcalTenderTask(const char* name):
- AliAnalysisTaskSE(name),
- fEMCALTender(NULL)
-{
-// Default constructor
- //DefineOutput(1, AliESDEvent::Class());
-}
-
-//______________________________________________________________________________
-AliEmcalTenderTask::~AliEmcalTenderTask()
-{
-// Destructor
- if (fEMCALTender)
- fEMCALTender->Delete();
-}
-
-//______________________________________________________________________________
-void AliEmcalTenderTask::SetEMCALTenderSupply(AliEMCALTenderSupply *supply)
-{
- fEMCALTender = supply;
- supply->SetTask(this);
-}
-
-//______________________________________________________________________________
-void AliEmcalTenderTask::ConnectInputData(Option_t *option)
-{
- AliAnalysisTaskSE::ConnectInputData(option);
- fEMCALTender->Init();
-}
-
-//______________________________________________________________________________
-void AliEmcalTenderTask::UserCreateOutputObjects()
-{
-// Nothing for the moment, but we may need ESD/AOD event replication here.
-
-}
-
-//______________________________________________________________________________
-void AliEmcalTenderTask::UserExec(Option_t* option)
-{
- fEMCALTender->ProcessEvent();
-}
/* $Id: AliEmcalTenderTask.h $ */
-#ifndef ALIANALYSISTASKSE_H
-#include "AliAnalysisTaskSE.h"
-#endif
-
-class AliEMCALTenderSupply;
-
-class AliEmcalTenderTask : public AliAnalysisTaskSE {
-
-protected:
- AliEMCALTenderSupply *fEMCALTender;
-
-private:
- AliEmcalTenderTask(const AliEmcalTenderTask &other);
- AliEmcalTenderTask& operator=(const AliEmcalTenderTask &other);
-
-public:
- AliEmcalTenderTask();
- AliEmcalTenderTask(const char *name);
- virtual ~AliEmcalTenderTask();
-
- void SetEMCALTenderSupply(AliEMCALTenderSupply *supply);
-
- // Run control
- virtual void ConnectInputData(Option_t *option);
- virtual void UserCreateOutputObjects();
- virtual void UserExec(Option_t *option);
-
- ClassDef(AliEmcalTenderTask,1)
-};
-#endif
-#ifndef ALIEMCALTENDERTASK_H
-#define ALIEMCAKTENDERTASK_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id: AliEmcalTenderTask.h $ */
-
-
#ifndef ALIANALYSISTASKSE_H
#include "AliAnalysisTaskSE.h"
#endif
return ana;
}
-AliEmcalTenderTask *AddTaskEmcalAodTender(const char *geoname="EMCAL_COMPLETEV1", const char* datatype="pp")
-{
- // Parameters: geoname = "EMCAL_FIRSTYEARV1" or "EMCAL_COMPLETEV1" or ""
-
- // Get the pointer to the existing analysis manager via the static access method.
- //==============================================================================
- AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
- if (!mgr) {
- ::Error("AddTaskTrgContam", "No analysis manager to connect to.");
- return NULL;
- }
-
- // Create the task and configure it.
- //===========================================================================
- AliEmcalTenderTask* ana = new AliEmcalTenderTask("AliEmcalTenderTask");
-
- ana->SelectCollisionCandidates( AliVEvent::kEMC1 | AliVEvent::kMB | AliVEvent::kEMC7 | AliVEvent::kINT7);
-
- Bool_t ismc = (mgr->GetMCtruthEventHandler() != NULL);
-
- mgr->AddTask(ana);
- // Adding EMCAL supply
- AliEMCALTenderSupply *EMCALSupply=new AliEMCALTenderSupply("EMCALtender");
- EMCALSupply->SetDebugLevel(2);
-
- AliEMCALRecParam *params = new AliEMCALRecParam();
- params->SetClusteringThreshold(0.1); // 100 MeV
- params->SetMinECut(0.05); //50 MeV
- params->SetW0(4.5);
- params->SetTimeCut(1e6);//Open this cut for AODs
- params->SetTimeMin(-1);//Open this cut for AODs
- params->SetTimeMax(1e6);//Open this cut for AODs
- EMCALSupply->SetRecParam(params);
-
- EMCALSupply->SetEMCALGeometryName(geoname);
-
- EMCALSupply->SwitchOffCellFiducialRegion(); //Does NOT remove edge clusters
- if (!ismc) {
- if (1){//datatype == "pp") {
- //::Info("AddTaskEMCALTender", "USING pp data configuration...");
- //params->SetClusterizerFlag(AliEMCALRecParam::kClusterizerv2); //Std for pbpb
- EMCALSupply->SwitchOnRecalDistBadChannel();
- EMCALSupply->SwitchOnReCalibrateCluster();
- EMCALSupply->SwitchOnRecalculateClusPos();
- //EMCALSupply->SetNonLinearityFunction(AliEMCALTenderSupply::kBeamTestCorrected);
- //EMCALSupply->SwitchOnUpdateCell(); // will update cells and reclusterize
- //EMCALSupply->SwitchOnReclustering(); //SwitchOnReclustering if needed
- } else {
- //::Info("AddTaskEMCALTender", "USING PbPb data configuration...");
- //params->SetClusterizerFlag(AliEMCALRecParam::kClusterizerv2); //Std for pbpb
- EMCALSupply->SwitchOnUpdateCell(); // will update cells and reclusterize
- //EMCALSupply->SwitchOnReclustering(); //SwitchOnReclustering if needed
- }
- } else {
- ::Info("AddTaskEMCALTender", "USING MC configuration...");
- }
- EMCALSupply->SetMass(0.139);
- //EMCALSupply->SetStep(5);
- //EMCALSupply->SwitchOnCutEtaPhiSum();
- //EMCALSupply->SetRCut(0.0025);
-
- EMCALSupply->SwitchOnCutEtaPhiSeparate();
- EMCALSupply->SetEtaCut(0.025);
- EMCALSupply->SetPhiCut(0.05);
-
- ana->SetEMCALTenderSupply(EMCALSupply);
- // Create ONLY the output containers for the data produced by the task.
- // Get and connect other common input/output containers via the manager as below
- //==============================================================================
- /*AliAnalysisDataContainer *coutput1 =
- mgr->CreateContainer("tender_event",
- AliESDEvent::Class(),
- AliAnalysisManager::kExchangeContainer,
- "default_tender");
- */
- mgr->ConnectInput (ana, 0, mgr->GetCommonInputContainer());
- //mgr->ConnectOutput (ana, 1, coutput1 );
-
- return ana;
-}
--- /dev/null
+AliEmcalPicoTrackMaker* AddTaskEmcalPicoTrackMaker(
+ const char *name = "PicoTracks",
+ const char *inname = "tracks",
+ const char *runPeriod = "LHC11h",
+ AliESDtrackCuts *cuts = 0
+ )
+{
+ // Get the pointer to the existing analysis manager via the static access method.
+ //==============================================================================
+ AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+ if (!mgr)
+ {
+ ::Error("AddTaskEmcalPicoTrackMaker", "No analysis manager to connect to.");
+ return NULL;
+ }
+
+ // Check the analysis type using the event handlers connected to the analysis manager.
+ //==============================================================================
+ if (!mgr->GetInputEventHandler())
+ {
+ ::Error("AddTaskEmcalPicoTrackMaker", "This task requires an input event handler");
+ return NULL;
+ }
+
+ //-------------------------------------------------------
+ // Init the task and do settings
+ //-------------------------------------------------------
+
+ // Add aod track filter task.
+
+ AliEmcalPicoTrackMaker *eTask = new AliEmcalPicoTrackMaker();
+ eTask->SetTracksOutName(name);
+ eTask->SetTracksInName(inname);
+ if (!strcmp(runPeriod, "LHC11h")) {
+ eTask->SetAODfilterBits(256,512,1024); // hybrid tracks for LHC11h
+ }
+ else {
+ AliWarning(Form("Run period %s not known. AOD filter bit not set.", renPeriod));
+ }
+ eTask->SetESDtrackCuts(cuts);
+
+ //-------------------------------------------------------
+ // Final settings, pass to manager and set the containers
+ //-------------------------------------------------------
+
+ mgr->AddTask(eTask);
+
+ // Create containers for input/output
+ AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
+
+ mgr->ConnectInput (eTask, 0, cinput1 );
+
+ return eTask;
+
+}