}
//____________________________________________________________________
-AliCorrection::AliCorrection(const Char_t* name, const Char_t* title) : TNamed(name, title),
+AliCorrection::AliCorrection(const Char_t* name, const Char_t* title, const char* analysis) : TNamed(name, title),
fEventCorr(0),
fTrackCorr(0)
{
// constructor initializing tnamed
- Float_t binLimitsPt[] = {0.0, 0.05, 0.1, 0.125, 0.15, 0.175, 0.2, 0.225, 0.25, 0.275, 0.3, 0.325, 0.35, 0.375, 0.4, 0.425, 0.45, 0.475, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.5, 2.0, 5.0, 10.0, 100.0};
+ Float_t* binLimitsPt = 0;
+ Int_t nBinsPt = 0;
+
+ // different binnings, better solution could be anticipated...
+ if (TString(analysis).CompareTo("tpc", TString::kIgnoreCase) == 0)
+ {
+ static Float_t binLimitsPtTmp[] = {0.0, 0.05, 0.1, 0.125, 0.15, 0.175, 0.2, 0.225, 0.25, 0.275, 0.3, 0.325, 0.35, 0.375, 0.4, 0.425, 0.45, 0.475, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.5, 2.0, 5.0, 10.0, 100.0};
+ binLimitsPt = (Float_t*) binLimitsPtTmp;
+ nBinsPt = 28;
+ } else if (TString(analysis).CompareTo("spd", TString::kIgnoreCase) == 0)
+ {
+ static Float_t binLimitsPtTmp[] = {-0.5, 0.5};
+ binLimitsPt = (Float_t*) binLimitsPtTmp;
+ nBinsPt = 1;
+ }
+
+ if (!binLimitsPt)
+ {
+ Printf("FATAL: Invalid binning");
+ return;
+ }
+
Float_t binLimitsN[] = {-0.5, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 12.5, 14.5, 16.5, 18.5, 20.5, 25.5, 30.5, 40.5, 50.5, 100.5, 300.5};
//Float_t binLimitsVtx[] = {-20,-15,-10,-6,-3,0,3,6,10,15,20};
//Float_t binLimitsVtx[] = {-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
Float_t binLimitsEta[] = {-2,-1.9,-1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,-1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0};
// Float_t binLimitsEta[] = { -7.0, -6.9, -6.8, -6.7, -6.6, -6.5, -6.4, -6.3, -6.2, -6.1, -6.0, -5.9, -5.8, -5.7, -5.6, -5.5, -5.4, -5.3, -5.2, -5.1, -5.0, -4.9, -4.8, -4.7, -4.6, -4.5, -4.4, -4.3, -4.2, -4.1, -4.0, -3.9, -3.8, -3.7, -3.6, -3.5, -3.4, -3.3, -3.2, -3.1, -3.0, -2.9, -2.8, -2.7, -2.6, -2.5, -2.4, -2.3, -2.2, -2.1, -2.0, -1.9, -1.8, -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, -0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0 };
- TH3F* dummyBinning = new TH3F("dummyBinning","dummyBinning",14, binLimitsVtx, 40, binLimitsEta , 28, binLimitsPt);
+ TH3F* dummyBinning = new TH3F("dummyBinning","dummyBinning",14, binLimitsVtx, 40, binLimitsEta , nBinsPt, binLimitsPt);
fEventCorr = new AliCorrectionMatrix2D("EventCorrection", Form("%s EventCorrection", fTitle.Data()), 14, binLimitsVtx, 22, binLimitsN);
fTrackCorr = new AliCorrectionMatrix3D("TrackCorrection", Form("%s TrackCorrection", fTitle.Data()), dummyBinning);
{
public:
AliCorrection();
- AliCorrection(const Char_t* name, const Char_t* title);
+ AliCorrection(const Char_t* name, const Char_t* title, const char* analysis = "tpc");
AliCorrection(const AliCorrection& c);
virtual ~AliCorrection();
#include <TParticlePDG.h>
#include <TH1.h>
#include <TH3.h>
+#include <TList.h>
+
+#include <AliHeader.h>
+#include <AliStack.h>
+#include <AliLog.h>
#include <AliLog.h>
#include <AliESD.h>
#include <AliESDVertex.h>
+#include <AliGenEventHeader.h>
+#include <AliGenPythiaEventHeader.h>
+#include <AliGenCocktailEventHeader.h>
+
//____________________________________________________________________
ClassImp(AliPWG0Helper)
//____________________________________________________________________
-Bool_t AliPWG0Helper::IsEventTriggered(AliESD* aEsd, Trigger trigger)
+Bool_t AliPWG0Helper::IsEventTriggered(const AliESD* aEsd, Trigger trigger)
+{
+ // see function with ULong64_t argument
+
+ ULong64_t triggerMask = aEsd->GetTriggerMask();
+ return IsEventTriggered(triggerMask, trigger);
+}
+
+//____________________________________________________________________
+Bool_t AliPWG0Helper::IsEventTriggered(ULong64_t triggerMask, Trigger trigger)
{
// check if the event was triggered
//
// VZERO_OR_LEFT : 1
// VZERO_OR_RIGHT : 2
- ULong64_t triggerMask = aEsd->GetTriggerMask();
-
switch (trigger)
{
case kMB1:
}
//____________________________________________________________________
-Bool_t AliPWG0Helper::IsVertexReconstructed(AliESD* aEsd)
+Bool_t AliPWG0Helper::IsVertexReconstructed(const AliESD* aEsd)
+{
+ // see function with AliESDVertex argument
+
+ const AliESDVertex* vtxESD = aEsd->GetVertex();
+ return IsVertexReconstructed(vtxESD);
+}
+
+//____________________________________________________________________
+Bool_t AliPWG0Helper::IsVertexReconstructed(const AliESDVertex* vtxESD)
{
// checks if the vertex is reasonable
//
// this function needs the branches fSPDVertex*
-
- const AliESDVertex* vtxESD = aEsd->GetVertex();
+ if (!vtxESD)
+ return kFALSE;
// the vertex should be reconstructed
if (strcmp(vtxESD->GetName(), "default")==0)
return 0;
}
+
+//____________________________________________________________________
+Int_t AliPWG0Helper::GetPythiaEventProcessType(AliHeader* aHeader, Bool_t adebug) {
+ //
+ // get the process type of the event.
+ //
+
+ // can only read pythia headers, either directly or from cocktalil header
+ AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(aHeader->GenEventHeader());
+
+ if (!pythiaGenHeader) {
+
+ AliGenCocktailEventHeader* genCocktailHeader = dynamic_cast<AliGenCocktailEventHeader*>(aHeader->GenEventHeader());
+ if (!genCocktailHeader) {
+ printf("AliPWG0Helper::GetProcessType : Unknown header type (not Pythia or Cocktail). \n");
+ return -1;
+ }
+
+ TList* headerList = genCocktailHeader->GetHeaders();
+ if (!headerList) {
+ return -1;
+ }
+
+ for (Int_t i=0; i<headerList->GetEntries(); i++) {
+ pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(headerList->At(i));
+ if (pythiaGenHeader)
+ break;
+ }
+
+ if (!pythiaGenHeader) {
+ printf("AliPWG0Helper::GetProcessType : Could not find Pythia header. \n");
+ return -1;
+ }
+ }
+
+ if (adebug) {
+ printf("AliPWG0Helper::GetProcessType : Pythia process type found: %d \n",pythiaGenHeader->ProcessType());
+ }
+
+ return pythiaGenHeader->ProcessType();
+}
+
+//____________________________________________________________________
+TParticle* AliPWG0Helper::FindPrimaryMother(AliStack* stack, Int_t label)
+{
+ //
+ // Finds the first mother among the primary particles of the particle identified by <label>,
+ // i.e. the primary that "caused" this particle
+ //
+
+ Int_t motherLabel = FindPrimaryMotherLabel(stack, label);
+ if (motherLabel < 0)
+ return 0;
+
+ return stack->Particle(motherLabel);
+}
+
+//____________________________________________________________________
+Int_t AliPWG0Helper::FindPrimaryMotherLabel(AliStack* stack, Int_t label)
+{
+ //
+ // Finds the first mother among the primary particles of the particle identified by <label>,
+ // i.e. the primary that "caused" this particle
+ //
+ // returns its label
+ //
+
+ Int_t nPrim = stack->GetNprimary();
+
+ while (label >= nPrim)
+ {
+ //printf("Particle %d (pdg %d) is not a primary. Let's check its mother %d\n", label, mother->GetPdgCode(), mother->GetMother(0));
+
+ TParticle* particle = stack->Particle(label);
+ if (!particle)
+ {
+ AliDebugGeneral("FindPrimaryMother", AliLog::kError, Form("UNEXPECTED: particle with label %d not found in stack.", label));
+ return -1;
+ }
+
+ // find mother
+ if (particle->GetMother(0) < 0)
+ {
+ AliDebugGeneral("FindPrimaryMother", AliLog::kError, Form("UNEXPECTED: Could not find mother of secondary particle %d.", label));
+ return -1;
+ }
+
+ label = particle->GetMother(0);
+ }
+
+ return label;
+}
// static helper functions
class AliESD;
+class AliESDVertex;
class TParticle;
class TH3;
+class AliHeader;
+class AliStack;
class AliPWG0Helper : public TObject
{
public:
enum Trigger { kMB1 = 0, kMB2 }; // definition from ALICE-INT-2005-025
- static Bool_t IsEventTriggered(AliESD* aEsd, Trigger trigger = kMB2);
- static Bool_t IsVertexReconstructed(AliESD* aEsd);
+ static Bool_t IsEventTriggered(const AliESD* aEsd, Trigger trigger = kMB2);
+ static Bool_t IsEventTriggered(ULong64_t triggerMask, Trigger trigger = kMB2);
+ static Bool_t IsVertexReconstructed(const AliESD* aEsd);
+ static Bool_t IsVertexReconstructed(const AliESDVertex* vtxESD);
static Bool_t IsPrimaryCharged(TParticle* aParticle, Int_t aTotalPrimaries, Bool_t adebug = kFALSE);
+ static Int_t GetPythiaEventProcessType(AliHeader* aHeader, Bool_t adebug = kFALSE);
+ static TParticle* FindPrimaryMother(AliStack* stack, Int_t label);
+ static Int_t FindPrimaryMotherLabel(AliStack* stack, Int_t label);
+
static void CreateProjections(TH3* hist, Bool_t save = kFALSE);
static void CreateDividedProjections(TH3* hist, TH3* hist2, const char* axis = 0, Bool_t putErrors = kFALSE, Bool_t save = kFALSE);
static const char* GetAxisTitle(TH3* hist, const char axis);
-
+
protected:
ClassDef(AliPWG0Helper, 0)
+++ /dev/null
-/**************************************************************************
- * 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$ */
-
-#include <TList.h>
-#include <TParticle.h>
-
-#include <AliPWG0depHelper.h>
-
-#include <AliHeader.h>
-#include <AliStack.h>
-#include <AliLog.h>
-
-#include <AliGenEventHeader.h>
-#include <AliGenPythiaEventHeader.h>
-#include <AliGenCocktailEventHeader.h>
-
-//____________________________________________________________________
-ClassImp(AliPWG0depHelper)
-
-//____________________________________________________________________
-Int_t AliPWG0depHelper::GetPythiaEventProcessType(AliHeader* aHeader, Bool_t adebug) {
- //
- // get the process type of the event.
- //
-
- // can only read pythia headers, either directly or from cocktalil header
- AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(aHeader->GenEventHeader());
-
- if (!pythiaGenHeader) {
-
- AliGenCocktailEventHeader* genCocktailHeader = dynamic_cast<AliGenCocktailEventHeader*>(aHeader->GenEventHeader());
- if (!genCocktailHeader) {
- printf("AliPWG0depHelper::GetProcessType : Unknown header type (not Pythia or Cocktail). \n");
- return -1;
- }
-
- TList* headerList = genCocktailHeader->GetHeaders();
- if (!headerList) {
- return -1;
- }
-
- for (Int_t i=0; i<headerList->GetEntries(); i++) {
- pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(headerList->At(i));
- if (pythiaGenHeader)
- break;
- }
-
- if (!pythiaGenHeader) {
- printf("AliPWG0depHelper::GetProcessType : Could not find Pythia header. \n");
- return -1;
- }
- }
-
- if (adebug) {
- printf("AliPWG0depHelper::GetProcessType : Pythia process type found: %d \n",pythiaGenHeader->ProcessType());
- }
-
- return pythiaGenHeader->ProcessType();
-}
-
-//____________________________________________________________________
-TParticle* AliPWG0depHelper::FindPrimaryMother(AliStack* stack, Int_t label)
-{
- //
- // Finds the first mother among the primary particles of the particle identified by <label>,
- // i.e. the primary that "caused" this particle
- //
-
- Int_t motherLabel = FindPrimaryMotherLabel(stack, label);
- if (motherLabel < 0)
- return 0;
-
- return stack->Particle(motherLabel);
-}
-
-//____________________________________________________________________
-Int_t AliPWG0depHelper::FindPrimaryMotherLabel(AliStack* stack, Int_t label)
-{
- //
- // Finds the first mother among the primary particles of the particle identified by <label>,
- // i.e. the primary that "caused" this particle
- //
- // returns its label
- //
-
- Int_t nPrim = stack->GetNprimary();
-
- while (label >= nPrim)
- {
- //printf("Particle %d (pdg %d) is not a primary. Let's check its mother %d\n", label, mother->GetPdgCode(), mother->GetMother(0));
-
- TParticle* particle = stack->Particle(label);
- if (!particle)
- {
- AliDebugGeneral("FindPrimaryMother", AliLog::kError, Form("UNEXPECTED: particle with label %d not found in stack.", label));
- return -1;
- }
-
- // find mother
- if (particle->GetMother(0) < 0)
- {
- AliDebugGeneral("FindPrimaryMother", AliLog::kError, Form("UNEXPECTED: Could not find mother of secondary particle %d.", label));
- return -1;
- }
-
- label = particle->GetMother(0);
- }
-
- return label;
-}
-
-
+++ /dev/null
-/* $Id$ */
-
-#ifndef ALIPWG0DEPHELPER_H
-#define ALIPWG0DEPHELPER_H
-
-#include <TObject.h>
-
-// static helper functions that depend on more than ESD
-
-class AliHeader;
-class TParticle;
-class AliStack;
-
-class AliPWG0depHelper : public TObject
-{
- public:
- static Int_t GetPythiaEventProcessType(AliHeader* aHeader, Bool_t adebug = kFALSE);
- static TParticle* FindPrimaryMother(AliStack* stack, Int_t label);
- static Int_t FindPrimaryMotherLabel(AliStack* stack, Int_t label);
-
- protected:
- ClassDef(AliPWG0depHelper, 0)
-
- private:
- AliPWG0depHelper(const AliPWG0depHelper&);
- AliPWG0depHelper& operator=(const AliPWG0depHelper&);
-};
-
-#endif
-
// Read the input list of files and add them to the chain
TString line;
- while(in.good())
+ while (in.good())
{
in >> line;
-
+
if (line.Length() == 0)
- continue;
-
+ continue;
+
if (offset > 0)
{
- --offset;
+ offset--;
continue;
}
delete iter;
}
+TObjArray* Chain2List(TChain* chain)
+{
+ // returns a TObjArray of TObjStrings of the file names in the chain
+
+ TObjArray* result = new TObjArray;
+
+ for (Int_t i=0; i<chain->GetListOfFiles()->GetEntries(); i++)
+ result->Add(new TObjString(chain->GetListOfFiles()->At(i)->GetTitle()));
+
+ return result;
+}
+
void LookupWrite(TChain* chain, const char* target)
{
// looks up the chain and writes the remaining files to the text file target
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AliPWG0depHelper+;
-
#pragma link C++ class AliTPCClusterHistograms+;
#pragma link C++ class AliTPCRawHistograms+;
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AlidNdEtaCorrectionSelector+;
-#pragma link C++ class AlidNdEtaAnalysisMCSelector+;
-#pragma link C++ class AlidNdEtaAnalysisESDSelector+;
-#pragma link C++ class AliMultiplicityESDSelector+;
-#pragma link C++ class AliMultiplicityMCSelector+;
#pragma link C++ class AlidNdEtaSystematicsSelector+;
-#pragma link C++ class AliTestESDtrackCutsSelector+;
#pragma link C++ class AliROCESDAnalysisSelector+;
#pragma link C++ class AliROCRawAnalysisSelector+;
#pragma link C++ class AliROCClusterAnalysisSelector+;
#pragma link C++ class AliHighMultiplicitySelector+;
+#pragma link C++ class AliMultiplicityTask+;
+#pragma link C++ class AliCutTask+;
+#pragma link C++ class AlidNdEtaTask+;
+#pragma link C++ class AlidNdEtaCorrectionTask+;
#endif
# this library contains classed that depend on STEER
-HDRS = AliPWG0depHelper.h \
- TPC/AliTPCClusterHistograms.h \
+HDRS = TPC/AliTPCClusterHistograms.h \
TPC/AliTPCRawHistograms.h
SRCS = $(HDRS:.h=.cxx)
DHDR= PWG0depLinkDef.h
-EINCLUDE= EVGEN PYTHIA6 TPC
+EINCLUDE= TPC
# this library contains the selectors, which are loaded on the fly when one uses a given selector
# thus this library is never used, it just exists for the build system to check if everything compiles
-HDRS = dNdEta/AlidNdEtaCorrectionSelector.h \
- dNdEta/AlidNdEtaAnalysisMCSelector.h \
- dNdEta/AlidNdEtaAnalysisESDSelector.h \
- dNdEta/AliMultiplicityESDSelector.h \
- dNdEta/AliMultiplicityMCSelector.h \
- dNdEta/AlidNdEtaSystematicsSelector.h \
- esdTrackCuts/AliTestESDtrackCutsSelector.h \
+HDRS = dNdEta/AlidNdEtaSystematicsSelector.h \
+ dNdEta/AlidNdEtaTask.h \
+ dNdEta/AlidNdEtaCorrectionTask.h \
TPC/AliROCESDAnalysisSelector.h \
TPC/AliROCRawAnalysisSelector.h \
TPC/AliROCClusterAnalysisSelector.h \
- highMultiplicity/AliHighMultiplicitySelector.h
+ highMultiplicity/AliHighMultiplicitySelector.h \
+ multiplicity/AliMultiplicityTask.h \
+ esdTrackCuts/AliCutTask.h
SRCS = $(HDRS:.h=.cxx)
DHDR= PWG0selectorsLinkDef.h
-EINCLUDE=PYTHIA6 EVGEN TPC RAW ITS
+EINCLUDE=TPC RAW ITS