# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
// Get reference multiplicity for AODs
if ( analysisType == "AOD" && fAODevent ) {
- mult=fAODevent->GetHeader()->GetTPConlyRefMultiplicity();
+ AliAODHeader * header=dynamic_cast<AliAODHeader*>(fAODevent->GetHeader());
+ if(!header) AliFatal("Not a standard AOD");
+ mult=header->GetTPConlyRefMultiplicity();
}
/*if (mult < 0) {
ClassImp(AliAnalysisTaskSE)
////////////////////////////////////////////////////////////////////////
-AliAODHeader* AliAnalysisTaskSE::fgAODHeader = NULL;
+AliVHeader* AliAnalysisTaskSE::fgAODHeader = NULL;
AliTOFHeader* AliAnalysisTaskSE::fgTOFHeader = NULL;
AliAODVZERO* AliAnalysisTaskSE::fgAODVZERO = NULL;
TClonesArray* AliAnalysisTaskSE::fgAODTracks = NULL;
// Output histos for QA
TList* fHistosQA; //! Output histos for QA
// Provisions for replication
- static AliAODHeader* fgAODHeader; //! Header for replication
+ static AliVHeader* fgAODHeader; //! Header for replication
static AliTOFHeader* fgTOFHeader; //! TOFHeader for replication
static AliAODVZERO* fgAODVZERO; //! VZERO for replication
static TClonesArray* fgAODTracks; //! Tracks for replication
if(fisAOD){
AliAODHeader *aodheader = 0x0;
- aodheader = aod->GetHeader();
+ aodheader = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+ if(!aodheader) AliFatal("Not a standard AOD");
if(!aodheader){
AliFatal("AOD header not there ?!");
return kFALSE;
AliFatal("Event is neither of AOD nor ESD type");
return kFALSE;
}
- Int_t bc2 = (aod)?aod->GetHeader()->GetIRInt2ClosestInteractionMap():esd->GetHeader()->GetIRInt2ClosestInteractionMap();
+ Int_t bc2 = (aod)?((AliVAODHeader*)aod->GetHeader())->GetIRInt2ClosestInteractionMap():esd->GetHeader()->GetIRInt2ClosestInteractionMap();
if (bc2 != 0)
return kTRUE;
- Int_t bc1 = (aod)?aod->GetHeader()->GetIRInt1ClosestInteractionMap():esd->GetHeader()->GetIRInt1ClosestInteractionMap();
+ Int_t bc1 = (aod)?((AliVAODHeader*)aod->GetHeader())->GetIRInt1ClosestInteractionMap():esd->GetHeader()->GetIRInt1ClosestInteractionMap();
if (bc1 != 0)
return kTRUE;
//nTracks = event->GetNumberOfTracks();
nTracks = fTrackCuts ? (Short_t)fTrackCuts->GetReferenceMultiplicity(esd,kTRUE):-1;
} else {
- AliAODHeader *h = aod->GetHeader();
+ AliAODHeader *h = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+ if(!h) AliFatal("Not a standard AOD");
nTracks = h!=0 ? (Short_t)h->GetTPConlyRefMultiplicity():-1;
}
Short_t nTrTPCcandle = 0;
for (Int_t iTracks = 0; iTracks < aod->GetNumberOfTracks(); iTracks++) {
- AliAODTrack* track = aod->GetTrack(iTracks);
+ AliAODTrack* track = dynamic_cast<AliAODTrack*>(aod->GetTrack(iTracks));
+ if(!track) AliFatal("Not a standard AOD");
if (!track) continue;
if (!track->TestFilterBit(1<<5) &&
} else {
AliAODTracklets *mult = aod->GetTracklets();
nTracklets = mult->GetNumberOfTracklets();
- AliAODHeader *h = aod->GetHeader();
+ AliAODHeader *h = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+ if(!h) AliFatal("Not a standard AOD");
for(Int_t ilay=0; ilay<6; ilay++){
nClusters[ilay] = h->GetNumberOfITSClusters(ilay);
}
if (zpcFired) zpcTower = ZPCtower[0];
} else {
- AliAODHeader *h = aod->GetHeader();
+ AliAODHeader *h = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+ if(!h) AliFatal("Not a standard AOD");
zncEnergy = (Float_t) (h->GetZDCN1Energy());
zpcEnergy = (Float_t) (h->GetZDCP1Energy());
znaEnergy = (Float_t) (h->GetZDCN2Energy());
if (aod){
// get centrality of the event
- AliAODHeader *header=aod->GetHeader();
+ AliAODHeader *header=dynamic_cast<AliAODHeader*>(aod->GetHeader());
+ if(!header) AliFatal("Not a standard AOD");
AliCentrality *centrality=header->GetCentralityP();
if(!centrality) AliError(Form("No AliCentrality attached to AOD header"));
fCentrality = centrality->GetCentralityPercentile("V0M");
if (headerH) fRP = headerH->GetReactionPlaneAngle();
}
- esdEP = aod->GetHeader()->GetEventplaneP();
+ esdEP = header->GetEventplaneP();
if(!esdEP) return; // protection against missing EP branch (nanoAODs)
esdEP->Reset();
}
}
- AliAODTrack* trmax = aod->GetTrack(0);
+ AliAODTrack* trmax = dynamic_cast<AliAODTrack*>(aod->GetTrack(0));
+ if(!trmax) AliFatal("Not a standard AOD");
for (int iter = 1; iter<NT;iter++){
AliAODTrack* track = dynamic_cast<AliAODTrack*> (tracklist->At(iter));
if (track && (track->Pt() > trmax->Pt())) trmax = track;
Int_t ntpc = fESDtrackCuts->GetMinNClusterTPC();
for (Int_t i = 0; i < aod->GetNumberOfTracks() ; i++){
- tr = aod->GetTrack(i);
+ tr = dynamic_cast<AliAODTrack*>(aod->GetTrack(i));
+ if(!tr) AliFatal("Not a standard AOD");
maxidtemp = tr->GetID();
if(maxidtemp < 0 && fAODfilterbit != 128) continue;
if(maxidtemp > -1 && fAODfilterbit == 128) continue;
const AliESDVertex* vertex = aEsd->GetPrimaryVertexSPD();
const AliMultiplicity* mult = aEsd->GetMultiplicity();
- if (mult && vertex && vertex->GetNContributors() > 0 && (!vertex->IsFromVertexerZ() || vertex->GetDispersion() < 0.02) && TMath::Abs(vertex->GetZv()) < 5.5) {
+ if (mult && vertex && vertex->GetNContributors() > 0 && (!vertex->IsFromVertexerZ() || vertex->GetDispersion() < 0.02) && TMath::Abs(vertex->GetZ()) < 5.5) {
for (Int_t i=0; i<mult->GetNumberOfTracklets(); ++i) {
if (TMath::Abs(mult->GetEta(i)) < 1) {
decision = kTRUE;
fEsdTrackCuts->GetPtRange(ptmin,ptmax);
AliDebug(3, Form("ptmin = %f, ptmax = %f\n",ptmin, ptmax));
- if (vertex && vertex->GetNContributors() > 0 && (!vertex->IsFromVertexerZ() || vertex->GetDispersion() < 0.02) && TMath::Abs(vertex->GetZv()) < 10.) {
+ if (vertex && vertex->GetNContributors() > 0 && (!vertex->IsFromVertexerZ() || vertex->GetDispersion() < 0.02) && TMath::Abs(vertex->GetZ()) < 10.) {
AliDebug(3,Form("Check on the vertex passed\n"));
for (Int_t i=0; i<aEsd->GetNumberOfTracks(); ++i){
if (fTPCOnly == kFALSE){
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
AliCodeTimerAuto("",0);
- AliAODHeader* header = AODEvent()->GetHeader();
+ AliAODHeader* header = dynamic_cast<AliAODHeader*>(AODEvent()->GetHeader());
+ if(!header) AliFatal("Not a standard AOD");
header->SetRunNumber(esd.GetRunNumber());
header->SetOfflineTrigger(fInputHandler->IsEventSelected()); // propagate the decision of the physics selection
vCascade,
kTRUE, // usedForVtxFit = kFALSE ? FIXME
vtx->UsesTrack(esdCascadeBach->GetID()),
- AliAODTrack::kSecondary,
+ AliAODTrack::kFromDecayVtx,
selectInfo);
aodTrack->SetPIDForTracking(esdCascadeBach->GetPIDForTracking());
aodTrack->SetTPCFitMap(esdCascadeBach->GetTPCFitMap());
vV0FromCascade,
kTRUE, // usedForVtxFit = kFALSE ? FIXME
vtx->UsesTrack(esdCascadePos->GetID()),
- AliAODTrack::kSecondary,
+ AliAODTrack::kFromDecayVtx,
selectInfo);
aodTrack->SetPIDForTracking(esdCascadePos->GetPIDForTracking());
aodTrack->SetTPCFitMap(esdCascadePos->GetTPCFitMap());
vV0FromCascade,
kTRUE, // usedForVtxFit = kFALSE ? FIXME
vtx->UsesTrack(esdCascadeNeg->GetID()),
- AliAODTrack::kSecondary,
+ AliAODTrack::kFromDecayVtx,
selectInfo);
aodTrack->SetPIDForTracking(esdCascadeNeg->GetPIDForTracking());
aodTrack->SetTPCFitMap(esdCascadeNeg->GetTPCFitMap());
vV0,
kTRUE, // check if this is right
vtx->UsesTrack(esdV0Pos->GetID()),
- AliAODTrack::kSecondary,
+ AliAODTrack::kFromDecayVtx,
selectInfo);
aodTrack->SetPIDForTracking(esdV0Pos->GetPIDForTracking());
aodTrack->SetTPCFitMap(esdV0Pos->GetTPCFitMap());
vV0,
kTRUE, // check if this is right
vtx->UsesTrack(esdV0Neg->GetID()),
- AliAODTrack::kSecondary,
+ AliAODTrack::kFromDecayVtx,
selectInfo);
aodTrack->SetPIDForTracking(esdV0Neg->GetPIDForTracking());
aodTrack->SetTPCFitMap(esdV0Neg->GetTPCFitMap());
vkink,
kTRUE, // check if this is right
vtx->UsesTrack(esdTrack->GetID()),
- AliAODTrack::kSecondary,
+ AliAODTrack::kFromDecayVtx,
selectInfo);
daughter->SetPIDForTracking(esdTrackD->GetPIDForTracking());
daughter->SetTPCFitMap(esdTrackD->GetTPCFitMap());
DistanceToBadChannel(mod,&locPos,minDist);
clu->SetDistanceToBadChannel(minDist) ;
+ Double_t ecross = EvalEcross(&cluPHOS);
+ clu->SetMCEnergyFraction(ecross) ;
}
}
else{//AOD
Double_t minDist=clu->GetDistanceToBadChannel() ;//Already calculated
DistanceToBadChannel(mod,&locPos,minDist);
clu->SetDistanceToBadChannel(minDist) ;
+
+ Double_t ecross = EvalEcross(&cluPHOS);
+ clu->SetMCEnergyFraction(ecross) ;
}
}
-AliGenerator *AddMCGenAmpt()
+AliGenerator *AddMCGenAmpt(
+ Double_t Energy = 2760., // CM energy
+ Double_t bmin = 0.0, // minimum impact parameter
+ Double_t bmax = 20.0, // maximum impact parameter
+ Double_t ptHardMin = 3.0, // minimum pt hard (was 3.0 in previous AMPT productions)
+ Bool_t stringMelting = kTRUE, // string melting option
+ Bool_t useART = kTRUE // use hadronic rescattering phase (ART)
+ )
{
-// User defined generator
+ // User defined generator
gSystem->Load("libampt.so");
gSystem->Load("libTAmpt.so");
+ gSystem->Load("libEGPythia6");
+ gSystem->Load("libpythia6.so");
+ gSystem->Load("libAliPythia6.so");
+
AliGenAmpt *genAMPT = new AliGenAmpt(-1);
+ //=========================================================================
+
+
+ // User settings
+ Int_t Flag_SM = 4; // flag for string melting: 1 = default, 4 = String Melting
+ Int_t NTmax = 150; // NTMAX: number of timesteps (Default = 150), to turn off ART set it to 3
+ Double_t mu = 3.2264; // parton screening mass in fm^(-1) (Default = 3.2264)
+ Double_t alpha_s = 1./3.; // change mu and alpha_s (Default = 1./3.) to vary scattering cross-section
+ // mu = 3.2 fm^-1 and alpha_s = 0.33 ==> sigma_{partonic} = 1.5mb
+ if(!stringMelting)
+ Flag_SM = 1;
+
+ if(!useART)
+ NTmax = 3;
+ //=========================================================================
+
+
+ // Decayer
+ AliDecayer *decayer = new AliDecayerPythia();
+ genAMPT->SetForceDecay( kHadronicD );
+ genAMPT->SetDecayer( decayer );
+ //=========================================================================
- // will be made optional later
- genAMPT->SetEnergyCMS(2760);
+ // Collision system
+ genAMPT->SetEnergyCMS(Energy);
genAMPT->SetReferenceFrame("CMS");
genAMPT->SetProjectile("A", 208, 82);
genAMPT->SetTarget ("A", 208, 82);
- genAMPT->SetPtHardMin (2);
- genAMPT->SetImpactParameterRange(0.00,20.00);
- genAMPT->SetJetQuenching(0); // enable jet quenching
- genAMPT->SetShadowing(1); // enable shadowing
- genAMPT->SetDecaysOff(1); // neutral pion and heavy particle decays switched off
- genAMPT->SetSpectators(0); // track spectators
- genAMPT->SetIsoft(4); // 4=string melting, 1=standard AMPT
- genAMPT->SetXmu(3.2264); // parton xsection
- genAMPT->SetNtMax(150); // time bins
-
- genAMPT->SetAlpha(1./3.); //alpha =0.333
- genAMPT->SetStringFrag(0.5,0.9); //string fragmentation parameters
- genAMPT->SetIpop(1); //enable popcorn mechanism (net-baryon stopping)
- // This particular choice of gives scattering cross section to be 1.5 mb
+ genAMPT->SetPtHardMin (ptHardMin);
+ genAMPT->SetImpactParameterRange(bmin,bmax);
+ //=========================================================================
+
+ // options
+ genAMPT->SetJetQuenching(0); // enable jet quenching
+ genAMPT->SetShadowing(1); // enable shadowing
+ genAMPT->SetDecaysOff(1); // neutral pion and heavy particle decays switched off
+ genAMPT->SetSpectators(0); // track spectators
+ genAMPT->SetIsoft(Flag_SM); // 4=string melting, 1=standard AMPT
+ genAMPT->SetXmu(mu); // parton xsection
+ genAMPT->SetNtMax(NTmax); // time bins
+ genAMPT->SetAlpha(alpha_s); // alpha =0.333
+ genAMPT->SetStringFrag(0.5,0.9); // string fragmentation parameters
+ genAMPT->SetIpop(1); // enable popcorn mechanism (net-baryon stopping)
+ //=========================================================================
+ // Boost into LHC lab frame
+ genAMPT->SetBoostLHC(1);
+
+ // randomize reaction plane
genAMPT->SetRandomReactionPlane(kTRUE);
return genAMPT;
-
-
-
}
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
#--------------------------------------------------------------------------------#
# Set Basic CMake Configuration #
// Pick up the position and uncertainties
Double_t vtxPos[3];
- vtxPos[0] = vtxESD->GetXv();
- vtxPos[1] = vtxESD->GetYv();
- vtxPos[2] = vtxESD->GetZv();
+ vtxPos[0] = vtxESD->GetX();
+ vtxPos[1] = vtxESD->GetY();
+ vtxPos[2] = vtxESD->GetZ();
Double_t vtxRes[3];
vtxRes[0] = vtxESD->GetXRes();
// Require the vertex to have been reconstructed successfully
if (strcmp(vtxESD->GetName(), "default")==0)return;
// vertex position and uncertainties
- fhQA[kVtxPosX] [index]->Fill(vtxESD->GetXv());
- fhQA[kVtxPosY] [index]->Fill(vtxESD->GetYv());
- fhQA[kVtxPosZ] [index]->Fill(vtxESD->GetZv());
+ fhQA[kVtxPosX] [index]->Fill(vtxESD->GetX());
+ fhQA[kVtxPosY] [index]->Fill(vtxESD->GetY());
+ fhQA[kVtxPosZ] [index]->Fill(vtxESD->GetZ());
fhQA[kVtxResX] [index]->Fill(vtxESD->GetXRes());
fhQA[kVtxResY] [index]->Fill(vtxESD->GetYRes());
fhQA[kVtxResZ] [index]->Fill(vtxESD->GetZRes());
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
//If the input event is AOD, the starting point for extrapolation is at vertex
//AOD tracks are selected according to its filterbit.
else if (aodevent) {
- aodTrack = aodevent->GetTrack(itr);
+ aodTrack = dynamic_cast<AliAODTrack*>(aodevent->GetTrack(itr));
+ if(!aodTrack) AliFatal("Not a standard AOD");
if (!aodTrack) continue;
if (fAODTPCOnlyTracks) { // Match with TPC only tracks, default from May 2013, before filter bit 32
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
-\section{EMCAL geometry software - Marco +++}
-
+\section{EMCAL geometry software}
+(Marco Bregant, Alexandre Shabetai, Gustavo Conesa Balbastre)\\
This page is intended for a description of the EMCAL geometry and the methods to access it.
{\it This is a very preliminary version that needs work.}
The EMCAL geometry is implemented in several classes : {\color{red} (right now very brief description, it should be completed) }
\begin{itemize}
-\item AliEMCALGeoUtils: Steering geometry class. No dependencies on STEER or EMCAL non geometry classes. Can be called during the analysis without loading all aliroot classes.
-\item AliEMCALGeometry: Derives from AliEMCALGeoUtils, contains dependencies on other EMCAL classes (AliEMCALRecPoint).
+\item AliEMCALGeometry: Steering geometry class. No dependencies on STEER or EMCAL non geometry classes. Can be called during the analysis without loading all AliRoot classes.
\item AliEMCALEMCGeometry: Does the geometry initialization. Does all the definitions of the geometry (towers composition, size, Super Modules number ...)
\item AliEMCALGeoParams: Class container of some of the geometry parameters so that it can be accessed everywhere in the EMCAL code, to avoid "magic numbers". Its use has to be propagated to all the code.
\item AliEMCALShishKebabTrd1Module: Here the modules are defined and the position of the modules in the local super module reference system is calculated
\end{itemize}
\subsection{Accessing the geometry}
-One can get the geometry pointer in the following ways:
-\begin{itemize}
-\item If galice.root is available:
+One can get the geometry pointer in the following way:
+
+%\begin{DDbox}{\linewidth}
+\begin{lstlisting}
+AliEMCALGeometry * geom = AliEMCALGeometry::GetInstance(GeoName) ;
+\end{lstlisting}
+%\end{DDbox}
+
+where "GeoName" is a string, the different options are specified in the next section. If you have a already generated simulation file and want to access the geometry used there, if the file {\it galice.root} is available:
\begin{DDbox}{\linewidth}
\begin{lstlisting}
AliRunLoader *rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),"read");
rl->LoadgAlice();//Needed to get geometry
-AliEMCALLoader *emcalLoader = dynamic\_cast<AliEMCALLoader*>(rl->GetDetectorLoader("EMCAL"));
+AliEMCALLoader *emcalLoader = dynamic_cast<AliEMCALLoader*>(rl->GetDetectorLoader("EMCAL"));
AliRun * alirun = rl->GetAliRun();
AliEMCAL * emcal = (AliEMCAL*)alirun->GetDetector("EMCAL"); AliEMCALGeometry * geom = emcal->GetGeometry();
-else, if galice.root is not available:
-AliEMCALGeometry * geom = AliEMCALGeometry::GetInstance("EMCAL_COMPLETE") ;
-
\end{lstlisting}
\end{DDbox}
-\end{itemize}
-In this case you might need the file geometry.root if you want to access to certain methods that require local to global position transformations. This file can be generated doing a simple simulation, it just contains the transformation matrix to go from global to local.
+
+In this case you might need the file {\it geometry.root} if you want to access to certain methods that require local to global position transformations. This file can be generated doing a simple simulation, it just contains the transformation matrix to go from global to local.
The way to load this file is:
%\begin{DDbox}{\linewidth}
\end{lstlisting}
%\end{DDbox}
-The transformation matrices are also stored in the ESDs so if you do not load this file, you can have to load these matrices from the ESDs.
+The transformation matrices are also stored in the ESDs so if you do not load this file, you can have to load these matrices from the ESDs. They are also stored in the OADB.
- If you want to see different parameters used in the geometry printed (cells centers, distance to IP, etc), one just has to execute the method PrintGeometry().
+ If you want to see different parameters used in the geometry printed (cells centers, distance to IP, etc), one just has to execute the method {\it PrintGeometry()}.
\subsection{Geometry configuration options}
Right now the following geometry options are implemented:
\begin{itemize}
-\item EMCAL\_COMPLETE: 12 Super Modules (2 half Super Modules)
-\item EMCAL\_FIRSTYEAR: 4 Super Modules (year 2010)
\item EMCAL\_FIRSTYEARV1: 4 Super Modules, corrected geometry (year 2010)
\item EMCAL\_COMPLETEV1: 10 Super Modules, corrected geometry (year 2011)
\item EMCAL\_COMPLETE12SMV1: 12 Super Modules (10+2$\times$1/3), corrected geometry (year 2012), full EMCal
\item EMCAL\_COMPLETE12SMV1\_DCAL\_DEV: Full EMCal plus 10 DCal super-modules (possible future configuration).
\end{itemize}
-Other options exists but need to be removed as they {\bf should not be used}:
+Other options exists but need to be removed as they {\bf should not be used} or that should be avoided:
\begin{itemize}
\item EMCAL\_PDC06: Old geometry, for reading old data (which do not exist anymore).
\item EMCAL\_WSU: Prototype geometry.
+\item EMCAL\_COMPLETE: 12 Super Modules (2 half Super Modules). Use the option with "V1" in the name.
+\item EMCAL\_FIRSTYEAR: 4 Super Modules (year 2010). Use the option with "V1" in the name.
\end{itemize}
By default, the geometry is loaded with the EMCAL\_COMPLETE12SMV1 configuration. For details on the implementation of the DCal geometry have a look here~\cite{DCalGeoOff}
+ \subsection{Setting the geometry in simulations}
+
+When configuring a simulation, a typical file {\it Config.C} is used. Inside this file, the detectors to be used in the generation are specified, and particularly EMCal is initialized in this way:
+
+\begin{lstlisting}
+AliEMCAL *EMCAL = = new AliEMCALv2("EMCAL", TString GeoName, Bool_t checkGeoRun);
+\end{lstlisting}
+
+Where:
+\begin{itemize}
+ \item {\it AliEMCAL} is the main steering class for the simulation. The derived classes {\t AliEMCALvX}:
+ \begin{itemize}
+ \item {\it AliEMCALv0} does the geometry initialization, materials creation etc.
+ \item {\it AliEMCALv1} derives from {\it v0}, DO NOT USE for simulation, originally it was meant for fast simulations, it does not generate hits.
+ \item {\it AliEMCALv2} derives from {\it v1}, USE for simulation. It does all the particle propagation in the EMCal material
+\end{itemize}
+ \item {\it TString GeoName}: Geometry names listed in the previous section
+ \item {\it Bool\_t checkGeoRun}: Bool that activates the geometry initialization depending on the run number. Since EMCal geometry changed over time, to avoid mistakes in the configuration files of simulations anchored to particular run numbers, by default this is set to TRUE and the name set in the initialization of AliEMCAL is not taken into account but the one corresponding to this run.
+\end{itemize}
+
+
\subsection{Mapping}
The tower row/column mapping online and offline follows the alice numbering convention. Figures~\ref{fig:Map1} to \ref{fig:Map2} display the position of the super modules from different points of view and the position of the tower index in them.
\begin{DDbox}{\linewidth}
\begin{lstlisting}
-Int\_t nSupMod, nModule, nIphi, nIeta, iphi, ieta;
+Int_t nSupMod, nModule, nIphi, nIeta, iphi, ieta;
//Check if this absId exists
if(!CheckAbsCellId(absId)) return kFALSE;
// Get from the absId the super module number, the module number and the eta-phi index (0 or 1) in the module
\begin{DDbox}{\linewidth}
\begin{lstlisting}
-Int\_t GetSuperModuleNumber(Int\_t absId)
+Int_t GetSuperModuleNumber(Int_t absId)
\end{lstlisting}
\end{DDbox}
\end{itemize}
\begin{DDbox}{\linewidth}
\begin{lstlisting}
- Bool\_t AliEMCALGeoUtils::RelPosCellInSModule(Int\_t absId, Double\_t \&xr, Double\_t \&yr, Double\_t \&zr) const;
+ Bool_t AliEMCALGeoUtils::RelPosCellInSModule(Int_t absId, Double_t &xr, Double_t &yr, Double_t &zr) const;
- Bool\_t AliEMCALGeoUtils::RelPosCellInSModule(Int\_t absId, Double\_t loc[3]) const;
+ Bool_t AliEMCALGeoUtils::RelPosCellInSModule(Int_t absId, Double_t loc[3]) const;
- Bool\_t AliEMCALGeoUtils::RelPosCellInSModule(Int\_t absId, TVector3 \&vloc) const;
+ Bool_t AliEMCALGeoUtils::RelPosCellInSModule(Int_t absId, TVector3 &vloc) const;
\end{lstlisting}
\end{DDbox}
\begin{DDbox}{\linewidth}
\begin{lstlisting}
-AliEMCALGeometry::RelPosCellInSModule(Int\_t absId, Int\_t maxAbsId, Double\_t tmax, Double\_t \&xr, Double\_t \&yr, Double\_t \&zr)
+AliEMCALGeometry::RelPosCellInSModule(Int_t absId, Int_t maxAbsId, Double_t tmax, Double_t &xr, Double_t &yr, Double_t &zr)
\end{lstlisting}
\end{DDbox}
\begin{DDbox}{\linewidth}
\begin{lstlisting}
- Double\_t AliEMCALRecPoint::TmaxInCm(const Double\_t e){
+ Double\t AliEMCALRecPoint::TmaxInCm(const Double_t e){
//e: energy sum of cells
-static Double\_t ca = 4.82;// shower max parameter - first guess; ca=TMath::Log(1000./8.07)
+static Double_t ca = 4.82;// shower max parameter - first guess; ca=TMath::Log(1000./8.07)
- static Double\_t x0 = 1.23; // radiation lenght (cm)
+ static Double_t x0 = 1.23; // radiation lenght (cm)
- static Double\_t tmax = 0.; // position of electromagnetic shower max in cm
+ static Double_t tmax = 0.; // position of electromagnetic shower max in cm
tmax = TMath::Log(e) + ca+0.5;
\begin{DDbox}{\linewidth}
\begin{lstlisting}
- w(cell i) = TMath::Max( 0., logWeight + TMath::Log( energy[cell i] / summed\_cluster\_cell\_energy ));
+ w(cell i) = TMath::Max( 0., logWeight + TMath::Log( energy[cell i] / summed_cluster_cell_energy ));
\end{lstlisting}
\end{DDbox}
\begin{DDbox}{\linewidth}
\begin{lstlisting}
- void GetGlobal(const Double\_t *loc, Double\_t *glob, int ind) const;
+ void GetGlobal(const Double_t *loc, Double_t *glob, int ind) const;
- void GetGlobal(const TVector3 \&vloc, TVector3 \&vglob, int ind) const;
+ void GetGlobal(const TVector3 &vloc, TVector3 &vglob, int ind) const;
- void GetGlobal(Int\_t absId, Double\_t glob[3]) const;
+ void GetGlobal(Int_t absId, Double_t glob[3]) const;
- void GetGlobal(Int\_t absId, TVector3 \&vglob) const;
+ void GetGlobal(Int_t absId, TVector3 &vglob) const;
\end{lstlisting}
\end{DDbox}
\begin{DDbox}{\linewidth}
\begin{lstlisting}
-void EtaPhiFromIndex(Int\_t absId, Double\_t \&eta, Double\_t \&phi) const;
-void EtaPhiFromIndex(Int\_t absId, Float\_t \&eta, Float\_t \&phi) const;
+void EtaPhiFromIndex(Int_t absId, Double_t &eta, Double_t &phi) const;
+void EtaPhiFromIndex(Int_t absId, Float_t &eta, Float_t &phi) const;
\end{lstlisting}
\end{DDbox}
\item Print information of the cells. For "pri>0" returns more information. "tit" has not much use, this value is printed.
\begin{DDbox}{\linewidth}
\begin{lstlisting}
-void PrintCellIndexes(Int\_t absId, int pri, const char *tit)
+void PrintCellIndexes(Int_t absId, int pri, const char *tit)
\end{lstlisting}
\end{DDbox}
\end{itemize}
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
AliESDVertex* spdVertex = (AliESDVertex*) esd->GetVertex();
if (spdVertex->GetNContributors()) {
- spdVertexZ = spdVertex->GetZv();
- spdVertexY = spdVertex->GetYv();
- spdVertexX = spdVertex->GetXv();
+ spdVertexZ = spdVertex->GetZ();
+ spdVertexY = spdVertex->GetY();
+ spdVertexX = spdVertex->GetX();
}
AliESDVertex* esdVertex = (AliESDVertex*) esd->GetPrimaryVertex();
if (esdVertex->GetNContributors()) {
- esdVertexZ = esdVertex->GetZv();
- esdVertexY = esdVertex->GetYv();
- esdVertexX = esdVertex->GetXv();
+ esdVertexZ = esdVertex->GetZ();
+ esdVertexY = esdVertex->GetY();
+ esdVertexX = esdVertex->GetX();
}
Float_t t0v = esd->GetT0zVertex();
v0->GetParamN()->GetXYZ(v); rcV0.fVNeg.Set(v);
v0->GetParamP()->GetXYZ(v); rcV0.fVPos.Set(v);
- rcV0.fV0Birth.Set(primVtx->GetXv(), primVtx->GetYv(), primVtx->GetZv());
+ rcV0.fV0Birth.Set(primVtx->GetX(), primVtx->GetY(), primVtx->GetZ());
// Simulation data not directly available in AliESDv0
//rcV0.fDLabel[0] = v0->GetNindex();
cascade->GetParamN()->GetXYZ(v); rcV0.fVNeg.Set(v);
cascade->GetParamP()->GetXYZ(v); rcV0.fVPos.Set(v);
- rcV0.fV0Birth.Set(primVtx->GetXv(), primVtx->GetYv(), primVtx->GetZv());
+ rcV0.fV0Birth.Set(primVtx->GetX(), primVtx->GetY(), primVtx->GetZ());
Double_t pCascade[3]={0.}, pBac[3]={0.}, pNeg[3]={0.}, pPos[3]={0.}, cv[21]={0.};
//cascade->GetPxPyPz(pCascade[0], pCascade[1], pCascade[2]);
cascade->GetXYZcascade(v[0], v[1], v[2]);
rcCascade.fCascadeVCa.Set(v);
- rcCascade.fCascadeBirth.Set(primVtx->GetXv(), primVtx->GetYv(), primVtx->GetZv());
+ rcCascade.fCascadeBirth.Set(primVtx->GetX(), primVtx->GetY(), primVtx->GetZ());
// Simulation data not directly available in AliESDcascade
// rcCascade.fDLabel = cascade->GetBindex();
cascade->Phi() * 180/TMath::Pi(),
cascade->Theta() * 180/TMath::Pi(),
cascade->GetDcaXiDaughters(),
- cascade->GetCascadeCosineOfPointingAngle(primVtx->GetXv(),
- primVtx->GetYv(),
- primVtx->GetZv()),
+ cascade->GetCascadeCosineOfPointingAngle(primVtx->GetX(),
+ primVtx->GetY(),
+ primVtx->GetZ()),
cascade->GetEffMassXi()
)
);
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
if (vertex) {
AliFMDDebug(2, ("Got %s (%s) from ESD: %f",
- vertex->GetName(), vertex->GetTitle(), vertex->GetZv()));
- fCurrentVertex = vertex->GetZv();
+ vertex->GetName(), vertex->GetTitle(), vertex->GetZ()));
+ fCurrentVertex = vertex->GetZ();
fVertexType = kESDVertex;
return;
}
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
option(HLT_CUDA "Build HLT GPU tracker using CUDA" OFF)
option(HLT_OPENCL "Build HLT GPU tracker using OpenCL" OFF)
// Float_t dca[2];
// if(vertHLT->GetStatus()==kTRUE){
-// esdtrackHLT->GetDZ(esdHLT->GetPrimaryVertex()->GetXv(), esdHLT->GetPrimaryVertex()->GetYv(), esdHLT->GetPrimaryVertex()->GetZv(), bfield, dca);
+// esdtrackHLT->GetDZ(esdHLT->GetPrimaryVertex()->GetX(), esdHLT->GetPrimaryVertex()->GetY(), esdHLT->GetPrimaryVertex()->GetZ(), bfield, dca);
// fDCArHLT->Fill(dca[0]);
// fDCAzHLT->Fill(dca[1]);
// }
// // calculate the offline DCAs the same way like for HLT. The above way is calculating the DCA for the TPC inner barrel surface (Kelly, 17.04.11)
// Float_t dca[2];
// if(vertOFF->GetStatus()==kTRUE){
-// esdtrackOFF->GetDZ(esdOFF->GetPrimaryVertex()->GetXv(), esdOFF->GetPrimaryVertex()->GetYv(), esdOFF->GetPrimaryVertex()->GetZv(), bfield, dca);
+// esdtrackOFF->GetDZ(esdOFF->GetPrimaryVertex()->GetX(), esdOFF->GetPrimaryVertex()->GetY(), esdOFF->GetPrimaryVertex()->GetZ(), bfield, dca);
// }
fChargeOff->Fill(esdtrackOFF->Charge());
}
else{
//Calculating DCA "old" fashion
- esdTrackHLT->GetDZ(esdHLT->GetPrimaryVertex()->GetXv(), esdHLT->GetPrimaryVertex()->GetYv(), esdHLT->GetPrimaryVertex()->GetZv(), bfield, dca);
+ esdTrackHLT->GetDZ(esdHLT->GetPrimaryVertex()->GetX(), esdHLT->GetPrimaryVertex()->GetY(), esdHLT->GetPrimaryVertex()->GetZ(), bfield, dca);
// plotting the DCA calculated by Sergey
//esdTrackHLT->GetImpactParametersTPC(DCAr,DCAz);
}
// }
// else{
// //Calculating DCA "old" fashion
-// esdTrackHLT->GetDZ(esdHLT->GetPrimaryVertex()->GetXv(), esdHLT->GetPrimaryVertex()->GetYv(), esdHLT->GetPrimaryVertex()->GetZv(), bfield, dca);
+// esdTrackHLT->GetDZ(esdHLT->GetPrimaryVertex()->GetX(), esdHLT->GetPrimaryVertex()->GetY(), esdHLT->GetPrimaryVertex()->GetZ(), bfield, dca);
// // plotting the DCA calculated by Sergey
// esdTrackHLT->GetImpactParametersTPC(DCAr,DCAz);
// }
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
// second pass
if(killOutliers && fAccEvents.TestBitNumber(i)){
vert=(AliESDVertex*)fVertArray[i];
- Double_t dist=(vert->GetXv()-wpos[0])*(vert->GetXv()-wpos[0]);
- dist+=(vert->GetYv()-wpos[1])*(vert->GetYv()-wpos[1]);
+ Double_t dist=(vert->GetX()-wpos[0])*(vert->GetX()-wpos[0]);
+ dist+=(vert->GetY()-wpos[1])*(vert->GetY()-wpos[1]);
dist=sqrt(dist)*10.; // distance in mm
fDistH->Fill(dist);
if(dist>fRCut)fAccEvents.SetBitNumber(i,kFALSE);
FillESDsData(11,(Float_t)(vtxTrk->GetNIndices())/(Float_t)nITSrefit5);
if(vtxSPD->GetNContributors()>0) {
- FillESDsData(4,vtxSPD->GetXv());
- FillESDsData(5,vtxSPD->GetYv());
- FillESDsData(6,vtxSPD->GetZv());
+ FillESDsData(4,vtxSPD->GetX());
+ FillESDsData(5,vtxSPD->GetY());
+ FillESDsData(6,vtxSPD->GetZ());
}
if(vtxTrk->GetNContributors()>0) {
- FillESDsData(8,vtxTrk->GetXv());
- FillESDsData(9,vtxTrk->GetYv());
- FillESDsData(10,vtxTrk->GetZv());
+ FillESDsData(8,vtxTrk->GetX());
+ FillESDsData(9,vtxTrk->GetY());
+ FillESDsData(10,vtxTrk->GetZ());
}
if(vtxSPD->GetNContributors()>0 &&
vtxTrk->GetNContributors()>0) {
- FillESDsData(12,vtxSPD->GetXv()-vtxTrk->GetXv());
- FillESDsData(13,vtxSPD->GetYv()-vtxTrk->GetYv());
- FillESDsData(14,vtxSPD->GetZv()-vtxTrk->GetZv());
+ FillESDsData(12,vtxSPD->GetX()-vtxTrk->GetX());
+ FillESDsData(13,vtxSPD->GetY()-vtxTrk->GetY());
+ FillESDsData(14,vtxSPD->GetZ()-vtxTrk->GetZ());
}
// SPD Tracklets
vertz.SetHighLimit(fZCutDiamond);
AliESDVertex* vtxz = vertz.FindVertexForCurrentEvent(itsClusterTree);
if(vtxz){
- Double_t position[3]={GetNominalPos()[0],GetNominalPos()[1],vtxz->GetZv()};
+ Double_t position[3]={GetNominalPos()[0],GetNominalPos()[1],vtxz->GetZ()};
Double_t covmatrix[6];
vtxz->GetCovMatrix(covmatrix);
Double_t chi2=99999.;
//______________________________________________________________________
void AliITSVertexer3D::FindVertex3D(TTree *itsClusterTree){
// Instantiates the fCurrentVertex object. calle by FindVertexForCurrenEvent
- Double_t vRadius=TMath::Sqrt(fVert3D.GetXv()*fVert3D.GetXv()+fVert3D.GetYv()*fVert3D.GetYv());
+ Double_t vRadius=TMath::Sqrt(fVert3D.GetX()*fVert3D.GetX()+fVert3D.GetY()*fVert3D.GetY());
if(vRadius<GetPipeRadius() && fVert3D.GetNContributors()>0){
- Double_t position[3]={fVert3D.GetXv(),fVert3D.GetYv(),fVert3D.GetZv()};
+ Double_t position[3]={fVert3D.GetX(),fVert3D.GetY(),fVert3D.GetZ()};
Double_t covmatrix[6];
fVert3D.GetCovMatrix(covmatrix);
Double_t chi2=99999.;
Double_t* zP=new Double_t[maxPoints];
Int_t* index1=new Int_t[maxPoints];
Int_t* index2=new Int_t[maxPoints];
- Double_t xbeam=fVert3D.GetXv();
- Double_t ybeam=fVert3D.GetYv();
+ Double_t xbeam=fVert3D.GetX();
+ Double_t ybeam=fVert3D.GetY();
Int_t iPoint=0;
for(Int_t ilin1=0; ilin1<nLines; ilin1++){
if(nGoodVert > 1){
fIsPileup = kTRUE;
fNTrpuv = fVertArray[1].GetNContributors();
- fZpuv = fVertArray[1].GetZv();
+ fZpuv = fVertArray[1].GetZ();
}
- Double_t vRadius=TMath::Sqrt(fVertArray[0].GetXv()*fVertArray[0].GetXv()+fVertArray[0].GetYv()*fVertArray[0].GetYv());
+ Double_t vRadius=TMath::Sqrt(fVertArray[0].GetX()*fVertArray[0].GetX()+fVertArray[0].GetY()*fVertArray[0].GetY());
if(vRadius<GetPipeRadius() && fVertArray[0].GetNContributors()>0){
- Double_t position[3]={fVertArray[0].GetXv(),fVertArray[0].GetYv(),fVertArray[0].GetZv()};
+ Double_t position[3]={fVertArray[0].GetX(),fVertArray[0].GetY(),fVertArray[0].GetZ()};
Double_t covmatrix[6];
fVertArray[0].GetCovMatrix(covmatrix);
Double_t chi2=99999.;
// at least one second vertex is present
fIsPileup = kTRUE;
fNTrpuv = fVertArray[kk].GetNContributors();
- fZpuv = fVertArray[kk].GetZv();
+ fZpuv = fVertArray[kk].GetZ();
}
}
- Double_t vRadius=TMath::Sqrt(fVertArray[0].GetXv()*fVertArray[0].GetXv()+fVertArray[0].GetYv()*fVertArray[0].GetYv());
+ Double_t vRadius=TMath::Sqrt(fVertArray[0].GetX()*fVertArray[0].GetX()+fVertArray[0].GetY()*fVertArray[0].GetY());
if(vRadius<GetPipeRadius() && fVertArray[0].GetNContributors()>0){
- Double_t position[3]={fVertArray[0].GetXv(),fVertArray[0].GetYv(),fVertArray[0].GetZv()};
+ Double_t position[3]={fVertArray[0].GetX(),fVertArray[0].GetY(),fVertArray[0].GetZ()};
Double_t covmatrix[6];
fVertArray[0].GetCovMatrix(covmatrix);
Double_t chi2=99999.;
Double_t deltaR=fCoarseMaxRCut;
Double_t dZmax=fZCutDiamond;
if(optCuts==1){
- xbeam=fVert3D.GetXv();
- ybeam=fVert3D.GetYv();
- zvert=fVert3D.GetZv();
+ xbeam=fVert3D.GetX();
+ ybeam=fVert3D.GetY();
+ zvert=fVert3D.GetZ();
deltaPhi = fDiffPhiMax;
deltaR=fMaxRCut;
dZmax=fMaxZCut;
deltaR=fMaxRCut2;
}
} else if(optCuts==2){
- xbeam=fVert3D.GetXv();
- ybeam=fVert3D.GetYv();
+ xbeam=fVert3D.GetX();
+ ybeam=fVert3D.GetY();
deltaPhi = fDiffPhiforPileup;
deltaR=fMaxRCut;
}
Double_t deltaR=fCoarseMaxRCut;
Double_t dZmax=fZCutDiamond;
if(optCuts==1){
- xbeam=fVert3D.GetXv();
- ybeam=fVert3D.GetYv();
- zvert=fVert3D.GetZv();
+ xbeam=fVert3D.GetX();
+ ybeam=fVert3D.GetY();
+ zvert=fVert3D.GetZ();
deltaR=fMaxRCut;
dZmax=fMaxZCut;
if(fPileupAlgo == 2){
deltaR=fMaxRCut2;
}
}else if(optCuts==2){
- xbeam=fVert3D.GetXv();
- ybeam=fVert3D.GetYv();
+ xbeam=fVert3D.GetX();
+ ybeam=fVert3D.GetY();
deltaR=fMaxRCut;
}
//________________________________________________________
Int_t AliITSVertexer3D::RemoveTracklets(){
// Remove trackelts close to first found vertex
- Double_t vert[3]={fVert3D.GetXv(),fVert3D.GetYv(),fVert3D.GetZv()};
+ Double_t vert[3]={fVert3D.GetX(),fVert3D.GetY(),fVert3D.GetZ()};
Int_t nRemoved=0;
for(Int_t i=0; i<fLines.GetEntriesFast();i++){
AliStrLine *lin = (AliStrLine*)fLines.At(i);
fVertArray[nFoundVert]=fVert3D;
nFoundVert++;
if(nFoundVert==2){
- fZpuv=fVert3D.GetZv();
+ fZpuv=fVert3D.GetZ();
fNTrpuv=fVert3D.GetNContributors();
}
}
cout <<"========================================================\n";
cout << "Event number: "<<i<<") Z Vertex:"<<endl;
if(vert){
- cout<<"FOUND: "<<vert->GetZv()<<"; ";
+ cout<<"FOUND: "<<vert->GetZ()<<"; ";
cout<<vert->GetZRes()<<"; "<<vert->GetNContributors()<<endl;
cout <<" True Z position "<<primaryVertex[2]<<", diff= ";
- cout<<(primaryVertex[2]-vert->GetZv())*10000.<<endl;
+ cout<<(primaryVertex[2]-vert->GetZ())*10000.<<endl;
} else {
cout<<"NOT FOUND"<<endl;
}
}
if(vert){
- Float_t found = vert->GetZv();
+ Float_t found = vert->GetZ();
diff2->Fill(primaryVertex[2],found);
found = 10000.*(found-primaryVertex[2]);
if(vert->GetZRes()!=0){
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
ntrkz = vtxz->GetNContributors();
if(ntrkz>0)goodz++;
- zz=vtxz->GetZv();
+ zz=vtxz->GetZ();
zresz =vtxz->GetZRes(); // microns
zdiffz = 10000.*(zz-mcVertex[2]); // microns
}
if(vtx3d->IsFromVertexer3D()) is3d=kTRUE;
ntrk3d = vtx3d->GetNContributors();
if(is3d && ntrk3d>0)good3d++;
- x3d = vtx3d->GetXv();
+ x3d = vtx3d->GetX();
xerr3d=vtx3d->GetXRes();
xdiff3d = 10000.*(x3d-mcVertex[0]); // microns
- y3d = vtx3d->GetYv();
+ y3d = vtx3d->GetY();
yerr3d=vtx3d->GetYRes();
ydiff3d = 10000.*(y3d-mcVertex[1]); // microns
- z3d = vtx3d->GetZv();
+ z3d = vtx3d->GetZ();
zerr3d=vtx3d->GetZRes();
zdiff3d = 10000.*(z3d-mcVertex[2]); // microns
#include "AliITSUClusterizer.h"
#include "AliITSUGeomTGeo.h"
#include "AliITSUSegmentationPix.h"
-#include "AliITSdigit.h"
+#include "AliITSUDigitPix.h"
#include "AliITSURecoParam.h"
#include "AliITSUAux.h"
using namespace TMath;
AliITSUClusterizer::AliITSUClusterizerClusterDigit* AliITSUClusterizer::NextDigit()
{
// get next digit
- if (fInputDigitsReadIndex<fInputDigits->GetEntriesFast()) {
- AliITSdigit *tmp=static_cast<AliITSdigit*>(fInputDigits->UncheckedAt(fInputDigitsReadIndex++));
+ while (fInputDigitsReadIndex<fInputDigits->GetEntriesFast()) {
+ AliITSUDigitPix *tmp=static_cast<AliITSUDigitPix*>(fInputDigits->UncheckedAt(fInputDigitsReadIndex++));
+ if (TMath::Abs(tmp->GetROCycle())>=fRecoParam->GetMaxROCycle()) continue;
AliITSUClusterizerClusterDigit *digit=AllocDigit();
digit->fDigit=tmp;
return digit;
}
- else
- return 0;
+ return 0;
}
//______________________________________________________________________________
,fTrackingConditions(0)
,fTracker(0)
,fSAonly(kFALSE)
+ ,fMaxROCycle(126) // like in AliITSUSimulation::kMaxROCycleAccept
{
// def c-tor
SetName("ITS");
,fTrackingConditions(0)
,fTracker(0)
,fSAonly(kFALSE)
+ ,fMaxROCycle(126) // like in AliITSUSimulation::kMaxROCycleAccept
{
// def c-tor
SetName("ITS");
Bool_t GetUseMatLUT(Int_t step) const {return (step<0||step>=kNTrackingPhases) ? kFALSE:fUseMatLUT[step];}
Int_t GetTracker() const {return fTracker;}
Bool_t GetSAonly() const {return fSAonly;}
+ Int_t GetMaxROCycle() const {return fMaxROCycle;}
//
void SetNLayers(Int_t n);
void SetTanLorentzAngle(Int_t lr, Double_t v);
virtual void Print(Option_t *opt="") const;
void SetTracker(Int_t opt) {fTracker=opt;}
void SetSAonly(Bool_t sa=kTRUE) {fSAonly=sa;}
+ void SetMaxROCycle(Int_t ro) {fMaxROCycle=ro;}
//
protected:
Int_t fNLayers; // number of layers
static const Bool_t fgkAllowDiagonalClusterization; // clusters of pixels with common corners
//
Int_t fTracker; // 0 - global, 1 - cooked, 2 - CA
- Bool_t fSAonly; // kTRUE, if ITSU standalone tracking only
+ Bool_t fSAonly; // kTRUE, if ITSU standalone tracking only
+ Int_t fMaxROCycle; // max RO cycle accepted by the cluster finder
private:
AliITSURecoParam(const AliITSURecoParam & param);
AliITSURecoParam & operator=(const AliITSURecoParam ¶m);
const AliESDVertex *vtx=0;
vtx=event->GetPrimaryVertexSPD();
if (vtx->GetStatus()) {
- xyz[0]=vtx->GetXv(); xyz[1]=vtx->GetYv(); xyz[2]=vtx->GetZv();
+ xyz[0]=vtx->GetX(); xyz[1]=vtx->GetY(); xyz[2]=vtx->GetZ();
SetVertex(xyz);
MakeSeeds();
}
for (Int_t v=0; v<nfoundSPD; v++) {
vtx=(AliESDVertex *)verticesSPD->UncheckedAt(v);
if (!vtx->GetStatus()) continue;
- xyz[0]=vtx->GetXv(); xyz[1]=vtx->GetYv(); xyz[2]=vtx->GetZv();
+ xyz[0]=vtx->GetX(); xyz[1]=vtx->GetY(); xyz[2]=vtx->GetZ();
SetVertex(xyz);
MakeSeeds();
}
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
}
Int_t ngood=refs->GetEntriesFast();
cout<<"Found SPD vertices: "<<nfoundSPD<<
- " Reconstructable vertics: "<<ngood<<endl;
+ " Reconstructable vertices: "<<ngood<<endl;
h2spd->Fill(ngood,nfoundSPD);
h2trk->Fill(ngood,nfoundTRK);
Int_t Associate(const AliESDVertex *g, const AliESDVertex *f,
const AliESDEvent *esd);
const AliESDVertex *vtxg=(AliESDVertex*)refs->UncheckedAt(g);
- Double_t zg=vtxg->GetZv();
+ Double_t zg=vtxg->GetZ();
Double_t ng=vtxg->GetNIndices();
hgood->Fill(zg);
hngood->Fill(ng);
if (Associate(vtxg,vtxf,event)==0) goto trk;
}
- zf=vtxf->GetZv();
+ zf=vtxf->GetZ();
hfoundspd->Fill(zg);
hzspd->Fill(zf-zg);
ncor+=n;
nwro+=(vtxf->GetNIndices()-n);
- zf=vtxf->GetZv();
+ zf=vtxf->GetZ();
if (Float_t(n)/vtxf->GetNIndices() > fracMin) {
hfoundtrk->Fill(zg);
if (nf==0) {
// SPD vertex
- Double_t zg=g->GetZv();
- Double_t zf=f->GetZv();
+ Double_t zg=g->GetZ();
+ Double_t zf=f->GetZ();
if (TMath::Abs(zf-zg)>2e-2) return 0;
return 1;
}
Float_t t=h->InteractionTime();
UShort_t *idx=new UShort_t[np];
Int_t ntrk=FindContributors(t,stack,idx);
- if (ntrk < nMin) continue;
+ if (ntrk < nMin) {delete[] idx; continue;}
AliESDVertex *vertex=new ((*refs)[nv]) AliESDVertex();
vertex->SetXv(vtx[0]);
vertex->SetYv(vtx[1]);
vertex->SetZv(vtx[2]);
vertex->SetNContributors(ntrk);
vertex->SetIndices(ntrk,idx);
- delete idx;
+ delete[] idx;
nv++;
}
refTree.Fill();
itsRecoParam->SetTitle("Cosmic");
itsRecoParam->SetTracker(0);
itsRecoParam->SetSAonly(kFALSE);
+ itsRecoParam->SetMaxROCycle(126); // AliITSUSimulation::kMaxROCycleAccept
recoParamArray->AddLast(itsRecoParam);
}
//
itsRecoParam->SetTitle("LowMult");
itsRecoParam->SetTracker(0);
itsRecoParam->SetSAonly(kFALSE);
+ itsRecoParam->SetMaxROCycle(126); // AliITSUSimulation::kMaxROCycleAccept
recoParamArray->AddLast(itsRecoParam);
//******************************************************************
for (int i=0;i<nLr;i++) itsRecoParam->SetAllowDiagonalClusterization(i,kAllowDiagCl);
itsRecoParam->SetTitle("HighMult");
itsRecoParam->SetTracker(0);
itsRecoParam->SetSAonly(kFALSE);
+ itsRecoParam->SetMaxROCycle(126); // AliITSUSimulation::kMaxROCycleAccept
recoParamArray->AddLast(itsRecoParam);
//******************************************************************
for (int i=0;i<nLr;i++) itsRecoParam->SetAllowDiagonalClusterization(i,kAllowDiagCl);
cout<<"-------- Event "<<iEvent<<endl;
printf(" Tracks # = %d\n",esd->GetNumberOfTracks());
const AliESDVertex *spdv=esd->GetVertex();
- printf(" SPD Primary Vertex in %f %f %f with %d contributors\n",spdv->GetXv(),spdv->GetYv(),spdv->GetZv(),spdv->GetNContributors());
+ printf(" SPD Primary Vertex in %f %f %f with %d contributors\n",spdv->GetX(),spdv->GetY(),spdv->GetZ(),spdv->GetNContributors());
const AliESDVertex *trkv=esd->GetPrimaryVertex();
printf(" Track Primary Vertex with %d contributors\n",trkv->GetNContributors());
if(spdv->IsFromVertexer3D()){
- hvx->Fill(spdv->GetXv());
- hvy->Fill(spdv->GetYv());
- hvz->Fill(spdv->GetZv());
+ hvx->Fill(spdv->GetX());
+ hvy->Fill(spdv->GetY());
+ hvz->Fill(spdv->GetZ());
}
Double_t itss[4];
for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) {
cout <<"========================================================\n";
cout << "Event number: "<<i<<") Z Vertex:"<<endl;
if(vert){
- cout<<"FOUND: "<<vert->GetZv()<<"; "<<vert->GetZRes()<<endl;
+ cout<<"FOUND: "<<vert->GetZ()<<"; "<<vert->GetZRes()<<endl;
cout <<" True Z position "<<primaryVertex[2]<<endl;
- cout<<", diff= "<<(primaryVertex[2]-vert->GetZv())*10000.<<endl;
+ cout<<", diff= "<<(primaryVertex[2]-vert->GetZ())*10000.<<endl;
}
else {
cout<<"NOT FOUND "<<endl;
for(Int_t it=0; it<nTracks; ++it){
AliAODTrack *tmpTr = 0x0;
- if(fEmbedMode==kAODFull) tmpTr = fAODevent->GetTrack(it);
+ if(fEmbedMode==kAODFull) {
+ tmpTr = dynamic_cast<AliAODTrack*>(fAODevent->GetTrack(it));
+ if(!tmpTr) AliFatal("Not a standard AOD");
+ }
if(fEmbedMode==kAODJetTracks) tmpTr = dynamic_cast<AliAODTrack*>(leadJet->GetRefTracks()->At(it));
if(!tmpTr) continue;
Double_t rd=rndm->Uniform(0.,1.);
TLorentzVector backgroundv;
Float_t cent=0.;
- if(fAODOut)cent = fAODOut->GetHeader()->GetCentrality();
- if(fAODIn) cent = fAODIn->GetHeader()->GetCentrality();
+ if(fAODOut)cent = ((AliVAODHeader*)fAODOut->GetHeader())->GetCentrality();
+ if(fAODIn) cent = ((AliVAODHeader*)fAODIn->GetHeader() )->GetCentrality();
if(evBkg)sigma=evBkg->GetSigma(1);
TString vtxTitle(vtxAOD->GetTitle());
zVtx = vtxAOD->GetZ();
- cent = fAOD->GetHeader()->GetCentrality();
+ cent = ((AliVAODHeader*)fAOD->GetHeader())->GetCentrality();
if(cent<10)cenClass = 0;
else if(cent<30)cenClass = 1;
else if(cent<50)cenClass = 2;
}
for(int it = 0;it < aod->GetNumberOfTracks();++it){
- AliAODTrack *tr = aod->GetTrack(it);
+ AliAODTrack *tr = dynamic_cast<AliAODTrack*>(aod->GetTrack(it));
+ if(!tr) AliFatal("Not a standard AOD");
Bool_t bGood = false;
if(fFilterType == 0)bGood = true;
else if(fFilterType == 1)bGood = tr->IsHybridTPCConstrainedGlobal();
for(int jt = 0;jt < aod->GetNumberOfTracks();++jt){
- const AliAODTrack *tr2 = aod->GetTrack(jt);
+ AliAODTrack *tr2 = dynamic_cast<AliAODTrack*>(aod->GetTrack(jt));
+ if(!tr2) AliFatal("Not a standard AOD");
Int_t idtr2 = tr2->GetID();
if (!(tr2->TestFilterBit(BIT(4)))) continue;
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
if(NOT FASTJET_FOUND)
set(PACKAGES CMakelibJETAN.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
# This will only build MONITOR only if ZeroMQ is found
set ( DHDR MONITORzmqLinkDef.h)
-set ( EINCLUDE TPC TPC/Rec ITS RAW STEER/STEER STEER/CDB STEER/STEERBase MONITOR/alistoragemanager)
+set ( EINCLUDE TPC TPC/Rec ITS RAW STEER/STEER STEER/CDB STEER/ESD STEER/STEERBase MONITOR/alistoragemanager)
set(DIMDIR $ENV{DIMDIR})
set(ODIR $ENV{ODIR})
if( handler )
{
AliAODEvent* aod = handler->GetAOD();
- AliAODHeader* header = aod->GetHeader();
+ AliAODHeader* header = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+ if(!header) AliFatal("Not a standard AOD");
header->SetRunNumber(lESD->GetRunNumber());
AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
AliESDVertex* vertex = (AliESDVertex*) fESD->GetVertex();
Double_t zVertex = 0. ;
- if (vertex) zVertex = vertex->GetZv();
+ if (vertex) zVertex = vertex->GetZ();
Int_t nTracks = (Int_t)fESD->GetNumberOfMuonTracks() ;
ULong64_t trigword=fESD->GetTriggerMask();
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
// get the SPD reconstructed vertex (vertexer) and fill the histogram
AliESDVertex* Vertex = (AliESDVertex*) esd->GetVertex();
if (Vertex->GetNContributors()) {
- fZVertex = Vertex->GetZv();
- fYVertex = Vertex->GetYv();
- fXVertex = Vertex->GetXv();
+ fZVertex = Vertex->GetZ();
+ fYVertex = Vertex->GetY();
+ fXVertex = Vertex->GetX();
errXVtx = Vertex->GetXRes();
errYVtx = Vertex->GetYRes();
}
// get the SPD reconstructed vertex (vertexer) and fill the histogram
AliESDVertex* Vertex = (AliESDVertex*) esd->GetVertex();
if (Vertex->GetNContributors()) {
- fZVertex = Vertex->GetZv();
- fYVertex = Vertex->GetYv();
- fXVertex = Vertex->GetXv();
+ fZVertex = Vertex->GetZ();
+ fYVertex = Vertex->GetY();
+ fXVertex = Vertex->GetX();
errXVtx = Vertex->GetXRes();
errYVtx = Vertex->GetYRes();
}
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
if(fESD){
const AliESDVertex *esdVtx = fESD->GetVertex() ;
if(esdVtx && esdVtx->GetChi2()!=0.){
- fVtx.SetXYZ(esdVtx->GetXv(),esdVtx->GetYv(),esdVtx->GetZv()) ;
+ fVtx.SetXYZ(esdVtx->GetX(),esdVtx->GetY(),esdVtx->GetZ()) ;
return ;
}
}
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
# Author: Johny Jose m(johny.jose@cern.ch)
# Port of previous Makefile build to cmake
-cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
file(GLOB PACKAGES CMake*.pkg)
DevNanoAOD/AliAnalysisTaskNanoAODFilter.cxx
DevNanoAOD/AliESEHelpers.cxx
DevNanoAOD/AliNanoAODCustomSetter.cxx
- DevNanoAOD/AliNanoAODHeader.cxx
DevNanoAOD/AliNanoAODReplicator.cxx
- DevNanoAOD/AliNanoAODStorage.cxx
DevNanoAOD/AliNanoAODTrack.cxx
- DevNanoAOD/AliNanoAODTrackMapping.cxx
DevNanoAOD/AliAnalysisTaskSpectraAllChNanoAOD.cxx
)
EMCAL/AliEmcalMCTrackSelector.cxx
EMCAL/AliEmcalParticle.cxx
EMCAL/AliEmcalParticleMaker.cxx
+ EMCAL/AliEmcalPatchFromCellMaker.cxx
EMCAL/AliEmcalPhysicsSelection.cxx
EMCAL/AliEmcalPhysicsSelectionTask.cxx
EMCAL/AliEmcalPicoTrackMaker.cxx
FLOW/Tasks/AliAnalysisTaskFlowEPCascade.cxx
FLOW/Tasks/AliAnalysisTaskJetFlowMC.cxx
FLOW/Tasks/AliAnalysisTaskMultiparticleCorrelations.cxx
+ FLOW/Tasks/AliAnalysisTaskPIDconfig.cxx
)
string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
void AliNanoAODSimpleSetter::SetNanoAODHeader(const AliAODEvent * event , AliNanoAODHeader * head ) {
+
+ AliAODHeader * header = dynamic_cast<AliAODHeader*>(event->GetHeader());
+ if (!header) AliFatal("Not a standard AOD");
// Set custom nano aod vars
- Double_t centr = event->GetHeader()->GetCentralityP()->GetCentralityPercentile("V0M");
- Double_t magfield = event->GetHeader()->GetMagneticField();
+ Double_t centr = header->GetCentralityP()->GetCentralityPercentile("V0M");
+ Double_t magfield = header->GetMagneticField();
head->SetVar(0, centr);
head->SetVar(1, magfield);
+++ /dev/null
-#ifndef _ALINANOAODHEADER_H_
-#define _ALINANOAODHEADER_H_
-
-#include "AliVHeader.h"
-#include "AliNanoAODStorage.h"
-
-
-
-class AliNanoAODHeader : public AliVHeader, public AliNanoAODStorage
-{
-public:
- using AliVHeader::ClassName;
- AliNanoAODHeader() {;}
- AliNanoAODHeader(Int_t size){ AllocateInternalStorage(size);}
- virtual ~AliNanoAODHeader(){;}
-
-
- // Interface methods
- // AliNanoAODHeader(const AliVHeader& evt);
- AliNanoAODHeader& operator=(const AliNanoAODHeader& evt);
-
- virtual UShort_t GetBunchCrossNumber() const { AliError("Not implemented");return 0;}
- virtual UInt_t GetOrbitNumber() const { AliError("Not implemented");return 0;}
- virtual UInt_t GetPeriodNumber() const { AliError("Not implemented");return 0;}
- virtual ULong64_t GetTriggerMask() const { AliError("Not implemented");return 0;}
- virtual UChar_t GetTriggerCluster() const { AliError("Not implemented");return 0;}
- virtual UInt_t GetEventType() const { AliError("Not implemented");return 0;}
- virtual void Print(Option_t* /*option = ""*/) const {Printf("I'm a special header!");}
-
- virtual void Clear(Option_t * opt) ;
-
-
- Double_t GetMagneticField() const { return GetVar(1); }
- Double_t GetCentrality (const char *estimator = "V0M") { return GetVar(0);}
-
- ClassDef(AliNanoAODHeader, 1)
-
-};
-
-#endif /* _ALINANOAODHEADER_H_ */
AliAnalysisManager *am = AliAnalysisManager::GetAnalysisManager();
offtrigger = ((AliInputEventHandler*)(am->GetInputEventHandler()))->IsEventSelected();
} else {
- offtrigger = fAod->GetHeader()->GetOfflineTrigger();
+ offtrigger = ((AliVAODHeader*)fAod->GetHeader())->GetOfflineTrigger();
}
if (!MCEvent()) {
if (fEsd) {
gm = fEsd->GetEMCALMatrix(mod);
} else {
- AliAODHeader *aodheader = fAod->GetHeader();
+ AliAODHeader *aodheader = dynamic_cast<AliAODHeader*>(fAod->GetHeader());
+ if(!aodheader) AliFatal("Not a standard AOD");
if (aodheader) {
gm = aodheader->GetEMCALMatrix(mod);
}
fTrackPtCut(0),
fMinNTrack(0),
fUseAliAnaUtils(kFALSE),
+ fRejectPileup(kFALSE),
fAliAnalysisUtils(0x0),
fOffTrigger(AliVEvent::kAny),
fTrigClass(),
fTrackPtCut(0),
fMinNTrack(0),
fUseAliAnaUtils(kFALSE),
+ fRejectPileup(kFALSE),
fAliAnalysisUtils(0x0),
fOffTrigger(AliVEvent::kAny),
fTrigClass(),
} else {
const AliAODEvent *aev = dynamic_cast<const AliAODEvent*>(InputEvent());
if (aev) {
- res = aev->GetHeader()->GetOfflineTrigger();
+ res = ((AliVAODHeader*)aev->GetHeader())->GetOfflineTrigger();
}
}
if ((res & fOffTrigger) == 0) {
return kFALSE;
}
- if (fAliAnalysisUtils->IsPileUpEvent(InputEvent())) {
+ if (fRejectPileup && fAliAnalysisUtils->IsPileUpEvent(InputEvent())) {
if (fGeneralHistograms) fHistEventRejection->Fill("PileUp",1);
return kFALSE;
}
void SetTracksName(const char *n) { AddParticleContainer(n) ; }
void SetTrigClass(const char *n) { fTrigClass = n ; }
void SetTriggerTypeSel(TriggerType t) { fTriggerTypeSel = t ; }
- void SetUseAliAnaUtils(Bool_t b) { fUseAliAnaUtils = b ; }
+ void SetUseAliAnaUtils(Bool_t b, Bool_t bRejPilup = kTRUE) { fUseAliAnaUtils = b ; fRejectPileup = bRejPilup ; }
void SetVzRange(Double_t min, Double_t max) { fMinVz = min ; fMaxVz = max ; }
protected:
Double_t fMaxVz; // max vertex for event selection
Double_t fTrackPtCut; // cut on track pt in event selection
Int_t fMinNTrack; // minimum nr of tracks in event with pT>fTrackPtCut
- Bool_t fUseAliAnaUtils; // used for LHC13* data
+ Bool_t fUseAliAnaUtils; // used for LHC13* data: z-vtx, Ncontributors, z-vtx resolution cuts
+ Bool_t fRejectPileup; // Reject pilup using function AliAnalysisUtils::IsPileUpEvent()
AliAnalysisUtils *fAliAnalysisUtils; //! vertex selection (optional)
UInt_t fOffTrigger; // offline trigger for event selection
TString fTrigClass; // trigger class name for event selection
Int_t fMinMCLabel; // minimum MC label value for the tracks/clusters being considered MC particles
Int_t fMCLabelShift; // if MC label > fMCLabelShift, MC label -= fMCLabelShift
Int_t fNcentBins; // how many centrality bins
- Bool_t fNeedEmcalGeom; // whether or not the task need the emcal geometry
+ Bool_t fNeedEmcalGeom; // whether or not the task needs the emcal geometry
Bool_t fIsEsd; //!whether it's an ESD analysis
AliEMCALGeometry *fGeom; //!emcal geometry
TClonesArray *fTracks; //!tracks
AliAnalysisTaskEmcal(const AliAnalysisTaskEmcal&); // not implemented
AliAnalysisTaskEmcal &operator=(const AliAnalysisTaskEmcal&); // not implemented
- ClassDef(AliAnalysisTaskEmcal, 10) // EMCAL base analysis task
+ ClassDef(AliAnalysisTaskEmcal, 11) // EMCAL base analysis task
};
#endif
AliEmcalContainer(const char *name);
virtual ~AliEmcalContainer(){;}
- TClonesArray *GetArray() { return fClArray ; }
+ TClonesArray *GetArray() const { return fClArray ; }
const TString& GetArrayName() const { return fClArrayName ; }
Int_t GetCurrentID() const { return fCurrentID-1 ; }
Bool_t GetIsParticleLevel() const { return fIsParticleLevel ; }
--- /dev/null
+// $Id$
+//
+// Class to put cells into trigger patches
+//
+// Author: M. Verweij
+
+#include <TClonesArray.h>
+#include <TRandom3.h>
+#include <TProfile.h>
+#include <TH3F.h>
+
+#include "AliAnalysisManager.h"
+#include "AliLog.h"
+#include "AliEMCALGeometry.h"
+#include "AliEmcalTriggerPatchInfo.h"
+
+#include "AliEmcalPatchFromCellMaker.h"
+
+ClassImp(AliEmcalPatchFromCellMaker)
+
+//________________________________________________________________________
+AliEmcalPatchFromCellMaker::AliEmcalPatchFromCellMaker() :
+ AliAnalysisTaskEmcal("AliEmcalPatchFromCellMaker",kTRUE),
+ fCaloTriggersOutName("EmcalPatches32x32"),
+ fCaloTriggersOut(0),
+ fPatchDim(32),
+ fMinCellE(0.15),
+ fCellTimeMin(485e-9),
+ fCellTimeMax(685e-9),
+ fL1Slide(0),
+ fh3EEtaPhiCell(0),
+ fh2CellEnergyVsTime(0),
+ fh1CellEnergySum(0)
+{
+ // Constructor.
+ for (Int_t i = 0; i < kPatchCols; i++) {
+ for (Int_t j = 0; j < kPatchRows; j++) {
+ fPatchADCSimple[i][j] = 0.;
+ fPatchESimple[i][j] = 0.;
+ }
+ }
+
+ SetMakeGeneralHistograms(kTRUE);
+}
+
+//________________________________________________________________________
+AliEmcalPatchFromCellMaker::AliEmcalPatchFromCellMaker(const char *name) :
+ AliAnalysisTaskEmcal(name,kTRUE),
+ fCaloTriggersOutName("EmcalPatches32x32"),
+ fCaloTriggersOut(0),
+ fPatchDim(32),
+ fMinCellE(0.15),
+ fCellTimeMin(485e-9),
+ fCellTimeMax(685e-9),
+ fL1Slide(0),
+ fh3EEtaPhiCell(0),
+ fh2CellEnergyVsTime(0),
+ fh1CellEnergySum(0)
+{
+ // Constructor.
+ for (Int_t i = 0; i < kPatchCols; i++) {
+ for (Int_t j = 0; j < kPatchRows; j++) {
+ fPatchADCSimple[i][j] = 0.;
+ fPatchESimple[i][j] = 0.;
+ }
+ }
+
+ SetMakeGeneralHistograms(kTRUE);
+}
+
+//________________________________________________________________________
+AliEmcalPatchFromCellMaker::~AliEmcalPatchFromCellMaker()
+{
+ // Destructor.
+}
+
+//________________________________________________________________________
+void AliEmcalPatchFromCellMaker::ExecOnce()
+{
+ // Init the analysis.
+
+ AliAnalysisTaskEmcal::ExecOnce();
+
+ if (!fInitialized)
+ return;
+
+ if (!fCaloTriggersOutName.IsNull()) {
+ fCaloTriggersOut = new TClonesArray("AliEmcalTriggerPatchInfo");
+ fCaloTriggersOut->SetName(fCaloTriggersOutName);
+
+ if (!(InputEvent()->FindListObject(fCaloTriggersOutName))) {
+ InputEvent()->AddObject(fCaloTriggersOut);
+ }
+ else {
+ fInitialized = kFALSE;
+ AliFatal(Form("%s: Container with same name %s already present. Aborting", GetName(), fCaloTriggersOutName.Data()));
+ return;
+ }
+ }
+
+}
+
+//________________________________________________________________________
+void AliEmcalPatchFromCellMaker::UserCreateOutputObjects()
+{
+ // Create user output.
+
+ AliAnalysisTaskEmcal::UserCreateOutputObjects();
+
+ Int_t fgkNPhiBins = 18*8;
+ Float_t kMinPhi = 0.;
+ Float_t kMaxPhi = 2.*TMath::Pi();
+ Double_t *binsPhi = new Double_t[fgkNPhiBins+1];
+ for(Int_t i=0; i<=fgkNPhiBins; i++) binsPhi[i]=(Double_t)kMinPhi + (kMaxPhi-kMinPhi)/fgkNPhiBins*(Double_t)i ;
+
+ Int_t fgkNEtaBins = 100;
+ Float_t fgkEtaMin = -1.;
+ Float_t fgkEtaMax = 1.;
+ Double_t *binsEta=new Double_t[fgkNEtaBins+1];
+ for(Int_t i=0; i<=fgkNEtaBins; i++) binsEta[i]=(Double_t)fgkEtaMin + (fgkEtaMax-fgkEtaMin)/fgkNEtaBins*(Double_t)i ;
+
+ Int_t fgkNTimeBins = 600;
+ Float_t kMinTime = -200.;
+ Float_t kMaxTime = 1000;
+ Double_t *binsTime = new Double_t[fgkNTimeBins+1];
+ for(Int_t i=0; i<=fgkNTimeBins; i++) binsTime[i]=(Double_t)kMinTime + (kMaxTime-kMinTime)/fgkNTimeBins*(Double_t)i ;
+
+ Double_t enBinEdges[3][2];
+ enBinEdges[0][0] = 1.; //10 bins
+ enBinEdges[0][1] = 0.1;
+ enBinEdges[1][0] = 5.; //8 bins
+ enBinEdges[1][1] = 0.5;
+ enBinEdges[2][0] = 100.;//95 bins
+ enBinEdges[2][1] = 1.;
+
+ const Float_t enmin1 = 0;
+ const Float_t enmax1 = enBinEdges[0][0];
+ const Float_t enmin2 = enmax1 ;
+ const Float_t enmax2 = enBinEdges[1][0];
+ const Float_t enmin3 = enmax2 ;
+ const Float_t enmax3 = enBinEdges[2][0];//fgkEnMax;
+ const Int_t nbin11 = (int)((enmax1-enmin1)/enBinEdges[0][1]);
+ const Int_t nbin12 = (int)((enmax2-enmin2)/enBinEdges[1][1])+nbin11;
+ const Int_t nbin13 = (int)((enmax3-enmin3)/enBinEdges[2][1])+nbin12;
+
+ Int_t fgkNEnBins=nbin13;
+ Double_t *binsEn=new Double_t[fgkNEnBins+1];
+ for(Int_t i=0; i<=fgkNEnBins; i++) {
+ if(i<=nbin11) binsEn[i]=(Double_t)enmin1 + (enmax1-enmin1)/nbin11*(Double_t)i ;
+ if(i<=nbin12 && i>nbin11) binsEn[i]=(Double_t)enmin2 + (enmax2-enmin2)/(nbin12-nbin11)*((Double_t)i-(Double_t)nbin11) ;
+ if(i<=nbin13 && i>nbin12) binsEn[i]=(Double_t)enmin3 + (enmax3-enmin3)/(nbin13-nbin12)*((Double_t)i-(Double_t)nbin12) ;
+ }
+
+ fh3EEtaPhiCell = new TH3F("fh3EEtaPhiCell","fh3EEtaPhiCell;E_{cell};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
+ fOutput->Add(fh3EEtaPhiCell);
+
+ fh2CellEnergyVsTime = new TH2F("fh2CellEnergyVsTime","fh2CellEnergyVsTime;E_{cell};time",fgkNEnBins,binsEn,fgkNTimeBins,binsTime);
+ fOutput->Add(fh2CellEnergyVsTime);
+
+ fh1CellEnergySum = new TH1F("fh1CellEnergySum","fh1CellEnergySum;E_{cell};time",fgkNEnBins,binsEn);
+ fOutput->Add(fh1CellEnergySum);
+
+ PostData(1, fOutput); // Post data for ALL output slots > 0 here.
+
+ if(binsEn) delete [] binsEn;
+ if(binsPhi) delete [] binsPhi;
+ if(binsEta) delete [] binsEta;
+ if(binsTime) delete [] binsTime;
+}
+
+//________________________________________________________________________
+Bool_t AliEmcalPatchFromCellMaker::Run()
+{
+ // Main loop, called for each event.
+
+ fCaloTriggersOut->Delete();
+
+ if (!fCaloCells) {
+ AliError(Form("Calo cells container %s not available.", fCaloCellsName.Data()));
+ return kFALSE;
+ }
+
+ for (Int_t i = 0; i < kPatchCols; i++) {
+ for (Int_t j = 0; j < kPatchRows; j++) {
+ fPatchADCSimple[i][j] = 0.;
+ fPatchESimple[i][j] = 0.;
+ }
+ }
+
+ if(!FillPatchADCSimple()) {
+ AliError(Form("%s Could not create simple ADC patches",GetName()));
+ return kFALSE;
+ }
+
+ RunSimpleOfflineTrigger();
+
+ Double_t sum = 0.;
+ for (Int_t i = 0; i < kPatchCols; i++) {
+ for (Int_t j = 0; j < kPatchRows; j++) {
+ sum+=fPatchESimple[i][j];
+ }
+ }
+
+ return kTRUE;
+}
+
+//________________________________________________________________________
+Bool_t AliEmcalPatchFromCellMaker::FillPatchADCSimple()
+{
+
+ // fill the array for offline trigger processing
+
+ // fill the patch ADCs from cells
+ Double_t sum = 0.;
+ Int_t nCell = fCaloCells->GetNumberOfCells();
+ for(Int_t iCell = 0; iCell < nCell; ++iCell) {
+ // get the cell info, based in index in array
+ Short_t cellId = fCaloCells->GetCellNumber(iCell);
+
+ Double_t cellT = fCaloCells->GetCellTime(cellId);
+ Double_t amp = fCaloCells->GetAmplitude(iCell);
+ fh2CellEnergyVsTime->Fill(amp,cellT*1e9);
+
+ //timing cuts
+ if(cellT<fCellTimeMin || cellT>fCellTimeMax) continue;
+ //energy cut
+ if(amp<fMinCellE) continue;
+ sum+=amp;
+
+ // get position
+ Int_t absId=-1;
+ fGeom->GetFastORIndexFromCellIndex(cellId, absId);
+ Int_t globCol=-1, globRow=-1;
+ fGeom->GetPositionInEMCALFromAbsFastORIndex(absId, globCol, globRow);
+ // add
+ fPatchADCSimple[globCol][globRow] += amp/kEMCL1ADCtoGeV;
+ fPatchESimple[globCol][globRow] += amp;
+
+ TVector3 pos;
+ fGeom->GetGlobal(cellId, pos);
+ TLorentzVector lv(pos,amp);
+ Double_t cellEta = lv.Eta();
+ Double_t cellPhi = lv.Phi();
+ if(cellPhi<0.) cellPhi+=TMath::TwoPi();
+ if(cellPhi>TMath::TwoPi()) cellPhi-=TMath::TwoPi();
+ fh3EEtaPhiCell->Fill(amp,cellEta,cellPhi);
+ }
+ fh1CellEnergySum->Fill(sum);
+
+ return kTRUE;
+}
+
+//________________________________________________________________________
+void AliEmcalPatchFromCellMaker::RunSimpleOfflineTrigger()
+{
+ // Runs a simple offline trigger algorithm.
+ // It creates separate patches with dimension fPatchDim
+
+ // run the trigger algo, stepping by stepsize (in trigger tower units)
+ Int_t itrig = 0;
+ Int_t patchSize = GetDimFastor();
+ Int_t stepSize = GetSlidingStepSizeFastor();
+ Int_t maxCol = kPatchCols - patchSize;
+ Int_t maxRow = kPatchRows - patchSize;
+
+ for (Int_t i = 0; i <= maxCol; i += stepSize) {
+ for (Int_t j = 0; j <= maxRow; j += stepSize) {
+ // get the trigger towers composing the patch
+ Int_t adcAmp = 0;
+ Double_t enAmp = 0.;
+ // window
+ for (Int_t k = 0; k < patchSize; ++k) {
+ for (Int_t l = 0; l < patchSize; ++l) {
+ // add amplitudes
+ adcAmp += (ULong64_t)fPatchADCSimple[i+k][j+l];
+ enAmp += fPatchESimple[i+k][j+l];
+ }
+ }
+
+ if (adcAmp == 0) {
+ AliDebug(2,"EMCal trigger patch with 0 ADC counts.");
+ continue;
+ }
+
+ Int_t absId=-1;
+ Int_t cellAbsId[4]={-1,-1,-1,-1};
+
+ // get low left edge (eta max, phi min)
+ fGeom->GetAbsFastORIndexFromPositionInEMCAL(i, j, absId);
+ // convert to the 4 absId of the cells composing the trigger channel
+ fGeom->GetCellIndexFromFastORIndex(absId, cellAbsId);
+ TVector3 edge1;
+ fGeom->GetGlobal(cellAbsId[0], edge1);
+
+ // get up right edge (eta min, phi max)
+ fGeom->GetAbsFastORIndexFromPositionInEMCAL(i+patchSize-1, j+patchSize-1, absId);
+ fGeom->GetCellIndexFromFastORIndex(absId, cellAbsId);
+ TVector3 edge2;
+ fGeom->GetGlobal(cellAbsId[3], edge2);
+
+ // get the center of the patch
+ Int_t offsetCenter = TMath::FloorNint(0.5*patchSize);
+ fGeom->GetAbsFastORIndexFromPositionInEMCAL(i+offsetCenter-1, j+offsetCenter-1, absId);
+ fGeom->GetCellIndexFromFastORIndex(absId, cellAbsId);
+ TVector3 center1;
+ fGeom->GetGlobal(cellAbsId[3], center1);
+
+ fGeom->GetAbsFastORIndexFromPositionInEMCAL(i+offsetCenter, j+offsetCenter, absId);
+ fGeom->GetCellIndexFromFastORIndex(absId, cellAbsId);
+ TVector3 center2;
+ fGeom->GetGlobal(cellAbsId[0], center2);
+
+ TVector3 centerGeo(center1);
+ centerGeo += center2;
+ centerGeo *= 0.5;
+
+ // save the trigger object
+ AliEmcalTriggerPatchInfo *trigger =
+ new ((*fCaloTriggersOut)[itrig]) AliEmcalTriggerPatchInfo();
+ itrig++;
+ trigger->SetCenterGeo(centerGeo, enAmp);
+ trigger->SetEdge1(edge1, enAmp);
+ trigger->SetEdge2(edge2, enAmp);
+ trigger->SetADCAmp(adcAmp);
+ trigger->SetEdgeCell(i*2, j*2); // from triggers to cells
+ }
+ } // trigger algo
+ AliDebug(2,Form("Created %d trigger patches (%d) in this event",itrig,patchSize));
+
+}
+
+//________________________________________________________________________
+Int_t AliEmcalPatchFromCellMaker::GetDimFastor() const {
+
+ Int_t dim = TMath::FloorNint((Double_t)(fPatchDim/2.));
+ return dim;
+}
+
+//________________________________________________________________________
+Int_t AliEmcalPatchFromCellMaker::GetSlidingStepSizeFastor() const {
+
+ Int_t dim = GetDimFastor();
+ if(!fL1Slide) return dim;
+
+ if(dim==2) return 2;
+ else if(dim==4) return 4;
+ else if(dim==8) return 4;
+ else if(dim==16) return 8;
+ else return -1;
+}
+
+
+
+
--- /dev/null
+#ifndef ALIEMCALPATCHFROMCELLMAKER_H
+#define ALIEMCALPATCHFROMCELLMAKER_H
+
+class TClonesArray;
+class TH3F;
+
+#include "AliEMCALTriggerTypes.h"
+#include "AliAnalysisTaskEmcal.h"
+
+class AliEmcalPatchFromCellMaker : public AliAnalysisTaskEmcal {
+ public:
+ AliEmcalPatchFromCellMaker();
+ AliEmcalPatchFromCellMaker(const char *name);
+ virtual ~AliEmcalPatchFromCellMaker();
+
+ void SetCaloTriggersOutName(const char *name) { fCaloTriggersOutName = name; }
+ void SetPatchDimension(Int_t i) { fPatchDim = i; }
+ void SetMinCellE(Double_t e) { fMinCellE = e; }
+ void SetCellTimeCuts(Double_t min, Double_t max) { fCellTimeMin = min; fCellTimeMax = max; }
+ void ActivateSlidingPatch(Bool_t b) { fL1Slide = b; }
+
+ protected:
+ enum{
+ kPatchCols = 48,
+ kPatchRows = 64
+ };
+
+ void ExecOnce();
+ Bool_t Run();
+ // Bool_t FillHistograms();
+ void UserCreateOutputObjects();
+
+ Bool_t FillPatchADCSimple();
+ void RunSimpleOfflineTrigger();
+
+ //Getters
+ Int_t GetPatchDimension() const { return fPatchDim; }
+ Double_t GetPatchArea() const { return (Double_t)(fPatchDim*fPatchDim)*0.014*0.014; }
+ Int_t GetDimFastor() const;
+ Int_t GetSlidingStepSizeFastor() const;
+
+ TString fCaloTriggersOutName; // name of output patch array
+ TClonesArray *fCaloTriggersOut; //!trigger array out
+
+ Double_t fPatchADCSimple[kPatchCols][kPatchRows]; // patch map for simple offline trigger
+ Double_t fPatchESimple[kPatchCols][kPatchRows]; // patch map for simple offline trigger
+
+ Int_t fPatchDim; // dimension of patch in #cells
+ Double_t fMinCellE; // minimum cell energy
+ Double_t fCellTimeMin; // minimum time cell
+ Double_t fCellTimeMax; // maximum time cell
+ Bool_t fL1Slide; // sliding window on
+
+ private:
+ TH3F *fh3EEtaPhiCell; //! cell E, eta, phi
+ TH2F *fh2CellEnergyVsTime; //! emcal cell energy vs time
+ TH1F *fh1CellEnergySum; //! sum of energy in all emcal cells
+
+ AliEmcalPatchFromCellMaker(const AliEmcalPatchFromCellMaker&); // not implemented
+ AliEmcalPatchFromCellMaker &operator=(const AliEmcalPatchFromCellMaker&); // not implemented
+
+ ClassDef(AliEmcalPatchFromCellMaker, 1); // Task to make PicoTracks in a grid corresponding to EMCAL/DCAL acceptance
+};
+#endif
am->LoadBranch("AliESDRun.");
TString title(eev->GetHeader()->GetTitle());
if (1&&(title.Length()>0)) {
- res = eev->GetHeader()->GetUniqueID();
+ res = ((AliVAODHeader*)eev->GetHeader())->GetUniqueID();
res &= 0x4FFFFFFF;
} else {
res = IsCollisionCandidate(eev);
}
} else {
aev = dynamic_cast<const AliAODEvent*>(obj);
- res = aev->GetHeader()->GetOfflineTrigger();
+ res = ((AliVAODHeader*)aev->GetHeader())->GetOfflineTrigger();
}
// return 0, if 0 found
// Author: J.Kral
#include <TClonesArray.h>
#include <TArrayI.h>
+#include <THashList.h>
#include "AliAODCaloTrigger.h"
#include "AliEMCALGeometry.h"
#include "AliEMCALTriggerTypes.h"
#include "AliVVZERO.h"
#include "AliEmcalTriggerMaker.h"
+#include "THistManager.h"
+#include "TString.h"
+
ClassImp(AliEmcalTriggerMaker)
using namespace std;
fCaloTriggerSetupOut(0),
fSimpleOfflineTriggers(0),
fV0(0),
- fITrigger(0)
+ fITrigger(0),
+ fDoQA(kFALSE),
+ fQAHistos(NULL)
{
// Constructor.
memset(fThresholdConstants, 0, sizeof(Int_t) * 12);
memset(fPatchADCSimple, 0, sizeof(Int_t) * kPatchCols * kPatchRows);
memset(fPatchADC, 0, sizeof(Int_t) * kPatchCols * kPatchRows);
- memset(fPatchAmplitude, 0, sizeof(Float_t) * kPatchCols * kPatchRows);
}
//________________________________________________________________________
-AliEmcalTriggerMaker::AliEmcalTriggerMaker(const char *name) :
- AliAnalysisTaskEmcal(name,kFALSE),
+AliEmcalTriggerMaker::AliEmcalTriggerMaker(const char *name, Bool_t doQA) :
+ AliAnalysisTaskEmcal(name,doQA),
fCaloTriggersOutName("EmcalTriggers"),
fCaloTriggerSetupOutName("EmcalTriggersSetup"),
fV0InName("AliAODVZERO"),
fCaloTriggerSetupOut(0),
fSimpleOfflineTriggers(0),
fV0(0),
- fITrigger(0)
+ fITrigger(0),
+ fDoQA(doQA),
+ fQAHistos(NULL)
{
// Constructor.
- memset(fThresholdConstants, 0, sizeof(Int_t) * 12);
- memset(fPatchADCSimple, 0, sizeof(Int_t) * kPatchCols * kPatchRows);
- memset(fPatchADC, 0, sizeof(Int_t) * kPatchCols * kPatchRows);
- memset(fPatchAmplitude, 0, sizeof(Float_t) * kPatchCols * kPatchRows);
+ memset(fThresholdConstants, 0, sizeof(Int_t) * 12);
+ memset(fPatchADCSimple, 0, sizeof(Int_t) * kPatchCols * kPatchRows);
+ memset(fPatchADC, 0, sizeof(Int_t) * kPatchCols * kPatchRows);
}
//________________________________________________________________________
fSimpleOfflineTriggers->Allocate(0);
}
+//________________________________________________________________________
+void AliEmcalTriggerMaker::UserCreateOutputObjects()
+{
+ // Do basic QA monitoring (if requested)
+ AliAnalysisTaskEmcal::UserCreateOutputObjects();
+
+ if(fDoQA){
+ fQAHistos = new THistManager("TriggerQA");
+
+ TString trtypenames[3] = {"EJE", "EGA", "EL0"};
+ for(int itype = 0; itype < 3; itype++){
+ fQAHistos->CreateTH2(Form("RCPos%s", trtypenames[itype].Data()), Form("Lower edge position of %s patches (col-row)", trtypenames[itype].Data()), 48, -0.5, 47.5, 64, -0.5, 63.5);
+ fQAHistos->CreateTH2(Form("EPCentPos%s", trtypenames[itype].Data()), Form("Center position of the %s trigger patches", trtypenames[itype].Data()), 20, -0.8, 0.8, 100., 1., 4.);
+ fQAHistos->CreateTH2(Form("PatchADCvsE%s", trtypenames[itype].Data()), Form("Patch ADC value for trigger type %s", trtypenames[itype].Data()), 200, 0., 200, 200, 0., 200);
+ }
+ fQAHistos->CreateTH1("triggerBitsAll", "Trigger bits for all incoming patches", 64, -0.5, 63.5);
+ fQAHistos->CreateTH1("triggerBitsSel", "Trigger bits for reconstructed patches", 64, -0.5, 63.5);
+ fOutput->Add(fQAHistos->GetListOfHistograms());
+ PostData(1, fOutput);
+ }
+}
+
//________________________________________________________________________
Bool_t AliEmcalTriggerMaker::Run()
{
if (fCaloTriggers->GetEntries() > 0) {
// zero the arrays
memset(fPatchADC, 0, sizeof(Int_t) * kPatchCols * kPatchRows);
- memset(fPatchAmplitude, 0, sizeof(Float_t) * kPatchCols * kPatchRows);
// go throuth the trigger channels
while (fCaloTriggers->Next()) {
// A0 left bottom (0,0)
Int_t globCol=-1, globRow=-1;
fCaloTriggers->GetPosition(globCol, globRow);
- // Look at L0 information
- Float_t amp = -1;
- if(CheckForL0(*fCaloTriggers))
- fCaloTriggers->GetAmplitude(amp);
- if(amp > -1)
- fPatchAmplitude[globCol][globRow] = amp;
// for some strange reason some ADC amps are initialized in reconstruction
// as -1, neglect those
Int_t adcAmp=-1;
fCaloTriggers->GetTriggerBits(tBits);
else
fSimpleOfflineTriggers->GetTriggerBits(tBits);
+
+ Int_t nBitsFound = 0;
+ Int_t bitsFound[64];
+ if(fDoQA){
+ for(unsigned int ibit = 0; ibit < sizeof(tBits)*8; ibit++) {
+ if(tBits & (1 << ibit)){
+ bitsFound[nBitsFound++] = ibit;
+ fQAHistos->FillTH1("triggerBitsAll", ibit);
+ }
+ }
+ }
if ((type == kTMEMCalJet && !IsEJE( tBits )) ||
(type == kTMEMCalGamma && !IsEGA( tBits )) ||
- (type == kTMEMCalLevel0 && !(IsLevel0(tBits) || CheckForL0(*fCaloTriggers))))
+ (type == kTMEMCalLevel0 && !(CheckForL0(*fCaloTriggers))))
return 0;
-
+ TString trtypenames[3] = {"EJE", "EGA", "EL0"}; // For QA
+
// save primary vertex in vector
TVector3 vertex;
vertex.SetXYZ(fVertex[0], fVertex[1], fVertex[2]);
// add the STU ADCs in the patch (in case of L1) or the TRU Amplitude (in case of L0)
if (!isOfflineSimple )
if(type == kTMEMCalLevel0){
- adcAmp += static_cast<Int_t>(fPatchAmplitude[globCol+i][globRow+j]); // precision loss in case of global integer field
+ adcAmp += fPatchADC[globCol+i][globRow+j] * 4; // precision loss in case of global integer field
} else
adcAmp += fPatchADC[globCol+i][globRow+j];
else
trigger->SetTriggerBits(tBits);
trigger->SetOffSet(offSet);
trigger->SetEdgeCell(globCol*2, globRow*2); // from triggers to cells
+ if(fDoQA){
+ fQAHistos->FillTH2(Form("RCPos%s", trtypenames[type].Data()), globCol, globRow);
+ fQAHistos->FillTH2(Form("EPCentPos%s", trtypenames[type].Data()), centerGeo.Eta(), centerGeo.Phi());
+ fQAHistos->FillTH2(Form("PatchADCvsE%s", trtypenames[type].Data()), adcAmp, trigger->GetPatchE());
+ if(nBitsFound){
+ for(int ibit = 0; ibit < nBitsFound; ibit++)
+ fQAHistos->FillTH1("triggerBitsSel", bitsFound[ibit]);
+ }
+ }
return trigger;
}
//________________________________________________________________________
Bool_t AliEmcalTriggerMaker::CheckForL0(const AliVCaloTrigger& trg) const {
- // Check from the level0 times if the trigger has fired at level0
- Int_t nl0times(0);
- Bool_t l0fired(kFALSE);
- trg.GetNL0Times(nl0times);
- if(nl0times){
- TArrayI l0times(nl0times);
- trg.GetL0Times(l0times.GetArray());
- // Apply timing cut to see if a L0 has fired
- for(Int_t *l0timeIter = l0times.GetArray(); l0timeIter < l0times.GetArray() + l0times.GetSize(); l0timeIter++){
- if(*l0timeIter > 7 && *l0timeIter < 10){
- l0fired = kTRUE;
- break;
- }
+ // Check whether the patch is a level0 patch
+ if(MCEvent()){
+ // For Monte-Carlo select
+ Int_t tbits(-1);
+ trg.GetTriggerBits(tbits);
+ return tbits & (1 << kL0);
+ } else {
+ // For Data check from the level0 times if the trigger has fired at level0
+ Int_t nl0times(0);
+ Bool_t l0fired(kFALSE);
+ trg.GetNL0Times(nl0times);
+ if(nl0times){
+ TArrayI l0times(nl0times);
+ trg.GetL0Times(l0times.GetArray());
+ // Apply timing cut to see if a L0 has fired
+ for(Int_t *l0timeIter = l0times.GetArray(); l0timeIter < l0times.GetArray() + l0times.GetSize(); l0timeIter++){
+ if(*l0timeIter > 7 && *l0timeIter < 10){
+ l0fired = kTRUE;
+ break;
+ }
+ }
}
+ return l0fired;
}
- return l0fired;
}
class AliEmcalTriggerSetupInfo;
class AliAODCaloTrigger;
class AliVVZERO;
+class THistManager;
#include "AliEMCALTriggerTypes.h"
#include "AliAnalysisTaskEmcal.h"
kTMEMCalLevel0 = 2
};
AliEmcalTriggerMaker();
- AliEmcalTriggerMaker(const char *name);
+ AliEmcalTriggerMaker(const char *name, Bool_t doQA = kFALSE);
virtual ~AliEmcalTriggerMaker();
void SetCaloTriggersOutName(const char *name) { fCaloTriggersOutName = name; }
kPatchCols = 48,
kPatchRows = 64
};
+ void UserCreateOutputObjects();
void ExecOnce();
Bool_t Run();
void RunSimpleOfflineTrigger();
Bool_t NextTrigger( Bool_t &isOfflineSimple );
AliEmcalTriggerPatchInfo* ProcessPatch(TriggerMakerTriggerType_t type, Bool_t isOfflineSimple);
- Bool_t CheckForL0(const AliVCaloTrigger &trg) const;
+ Bool_t CheckForL0(const AliVCaloTrigger &trg) const;
TString fCaloTriggersOutName; // name of output track array
TString fCaloTriggerSetupOutName; // name of output track array
AliVVZERO *fV0; //!V0 object
Double_t fPatchADCSimple[kPatchCols][kPatchRows]; //!patch map for simple offline trigger
Int_t fPatchADC[kPatchCols][kPatchRows]; //!ADC values map
- Float_t fPatchAmplitude[kPatchCols][kPatchRows]; //!Trigger patch amplituded(for L0 triggers)
Int_t fITrigger; //!trigger counter
+ Bool_t fDoQA; // Fill QA histograms
+ THistManager *fQAHistos; //! Histograms for QA
private:
AliEmcalTriggerMaker(const AliEmcalTriggerMaker&); // not implemented
--- /dev/null
+// $Id$
+
+AliEmcalPatchFromCellMaker* AddTaskEmcalPatchFromCellMaker(
+ Int_t patchDim = 32,
+ Double_t cellMinE = 0.15,
+ Bool_t bSlideL1 = kFALSE,
+ const char *patchOutName = "EmcalPatches",
+ const char *cellsName = 0,
+ const char *taskName = "PatchFromCellMaker")
+{
+ // Get the pointer to the existing analysis manager via the static access method.
+ //==============================================================================
+ AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+ if (!mgr)
+ {
+ ::Error("AddTaskEmcalPatchFromCellMaker", "No analysis manager to connect to.");
+ return NULL;
+ }
+
+ // Check the analysis type using the event handlers connected to the analysis manager.
+ //==============================================================================
+ AliVEventHandler *evhand = mgr->GetInputEventHandler();
+ if (!evhand) {
+ ::Error("AddTaskEmcalPatchFromCellMaker", "This task requires an input event handler");
+ return NULL;
+ }
+
+ TString strCellsName(cellsName);
+ if(strCellsName.IsNull()) {
+ if (evhand->InheritsFrom("AliESDInputHandler")) {
+ strCellsName = "EMCALCells";
+ ::Info("AddTaskEmcalPatchFromCellMaker", Form( "ESD analysis, cellsName = \"%s\"", strCellsName.Data() ));
+ }
+ else {
+ strCellsName = "emcalCells";
+ ::Info("AddTaskEmcalPatchFromCellMaker", Form( "AOD analysis, cellsName = \"%s\"", strCellsName.Data() ));
+ }
+ }
+
+ TString strPatchOutName = Form("%s%dx%d",patchOutName,patchDim,patchDim);
+ TString name = Form("%s_%s",taskName,strPatchOutName.Data());
+
+ //-------------------------------------------------------
+ // Init the task and do settings
+ //-------------------------------------------------------
+
+ AliEmcalPatchFromCellMaker *eTask = new AliEmcalPatchFromCellMaker(name);
+ eTask->SetCaloTriggersOutName(strPatchOutName.Data());
+ eTask->SetCaloCellsName(strCellsName.Data());
+ eTask->SetPatchDimension(patchDim);
+ eTask->SetMinCellE(cellMinE);
+ eTask->ActivateSlidingPatch(bSlideL1);
+
+ //-------------------------------------------------------
+ // Final settings, pass to manager and set the containers
+ //-------------------------------------------------------
+ mgr->AddTask(eTask);
+
+ // Create containers for input/output
+ AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
+ TString contname(name);
+ contname += "_histos";
+ AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
+ TList::Class(),AliAnalysisManager::kOutputContainer,
+ Form("%s", AliAnalysisManager::GetCommonFileName()));
+
+ mgr->ConnectInput (eTask, 0, cinput1 );
+ mgr->ConnectOutput (eTask, 1, coutput1 );
+
+ return eTask;
+}
int jetLowC = 0,
int jetHighA = 0,
int jetHighB = 0,
- int jetHighC = 0
+ int jetHighC = 0,
+ bool doQA = kFALSE
)
{
// Get the pointer to the existing analysis manager via the static access method.
// Init the task and do settings
//-------------------------------------------------------
- AliEmcalTriggerMaker *eTask = new AliEmcalTriggerMaker(taskName);
+ AliEmcalTriggerMaker *eTask = new AliEmcalTriggerMaker(taskName, doQA);
eTask->SetCaloTriggersName(strTriggersName.Data());
eTask->SetCaloTriggersOutName(triggersOutName);
eTask->SetCaloTriggerSetupOutName(triggerSetupOutName);
// Create containers for input/output
AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
mgr->ConnectInput (eTask, 0, cinput1 );
-
+
+ if(doQA){
+ TString commonoutput = mgr->GetCommonFileName();
+ commonoutput += ":TriggerQA";
+ mgr->ConnectOutput(eTask, 1, mgr->CreateContainer("TriggerQA", TList::Class(), AliAnalysisManager::kOutputContainer, commonoutput.Data()));
+ }
return eTask;
}
//At the momment the cutting class does not handle AOD event properly
//so we are doing the cuts explicitly here
- AliAODHeader *aodHeader = fAOD->GetHeader();
+ AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+ if(!aodHeader) AliFatal("Not a standard AOD");
if(!aodHeader) return;
AliCentrality *centrality = aodHeader->GetCentralityP();
if(!centrality) return;
void AliAnalysisTaskFlowEPCascade::ReadFromAODv0(AliAODEvent *fAOD){
- AliEventplane * ep = (fAOD->GetHeader())->GetEventplaneP();
+ AliEventplane * ep = ((AliVAODHeader*)fAOD->GetHeader())->GetEventplaneP();
Double_t psiTPC = ep->GetEventplane("Q", fAOD, 2); // in range of [0, pi]
// if(psiTPC > TMath::PiOver2())
// psiTPC -= TMath::Pi();
// Update the header
- AliAODHeader* header = AODEvent()->GetHeader();
+ AliAODHeader* header = dynamic_cast<AliAODHeader*>(AODEvent()->GetHeader());
+ if(!header) AliFatal("Not a standard AOD");
header->SetRunNumber(esd->GetRunNumber());
header->SetQTheta(dRP,1);
//=======================================================================
Bool_t AliAnalysisTaskFlowStrange::MinimumRequirementsAA(AliAODEvent *tAOD) {
fRunNumber = tAOD->GetRunNumber();
- AliCentrality *cent = tAOD->GetHeader()->GetCentralityP();
+ AliCentrality *cent = ((AliVAODHeader*)tAOD->GetHeader())->GetCentralityP();
fV0M = cent->GetCentralityPercentile("V0M");
fTRK = cent->GetCentralityPercentile("TRK");
TString mycent = fCentMethod;
Int_t rawN = tAOD->GetNumberOfTracks();
Int_t ref=0;
for(Int_t id=0; id!=rawN; ++id) {
- track = tAOD->GetTrack(id);
+ track = dynamic_cast<AliAODTrack*>(tAOD->GetTrack(id));
+ if(!track) AliFatal("Not a standard AOD");
if(!track->TestFilterBit(fRFPFilterBit)) continue;
++ref;
}
// PA reading discontinued: TO BE UPDATED
/*
//if(aod->GetHeader()->GetEventNumberESDFile() == 0) return; //rejecting first chunk NOT NEEDED ANYMORE
- Int_t bc2 = tAOD->GetHeader()->GetIRInt2ClosestInteractionMap();
+ Int_t bc2 = ((AliVAODHeader*)tAOD->GetHeader())->GetIRInt2ClosestInteractionMap();
if(bc2!=0) return kFALSE;
- Int_t bc1 = tAOD->GetHeader()->GetIRInt1ClosestInteractionMap();
+ Int_t bc1 = ((AliVAODHeader*)tAOD->GetHeader())->GetIRInt1ClosestInteractionMap();
if(bc1!=0) return kFALSE;
Short_t isPileup = tAOD->IsPileupFromSPD(5);
if(isPileup!=0) return kFALSE;
ReadStack(mcArray);
}
for(int i=0; i!=tAOD->GetNumberOfTracks(); ++i) {
- AliAODTrack *t = tAOD->GetTrack( i );
+ AliAODTrack *t = dynamic_cast<AliAODTrack*>(tAOD->GetTrack( i ));
if(!t) continue;
if( !t->TestFilterBit(1) ) continue;
fDecayMass=0.0; // using mass as nsigmas control plot
//=>looping
Int_t rawN = tAOD->GetNumberOfTracks();
for(Int_t id=0; id!=rawN; ++id) {
- track = tAOD->GetTrack(id);
+ track = dynamic_cast<AliAODTrack*>(tAOD->GetTrack(id));
+ if(!track) AliFatal("Not a standard AOD");
//=>cuts
if(!track->TestFilterBit(fRFPFilterBit)) continue;
if( fExcludeTPCEdges )
Int_t AliAnalysisTaskFlowStrange::RefMult(AliAODEvent *tAOD, Int_t fb) {
Int_t found = 0;
for(int i=0; i!=tAOD->GetNumberOfTracks(); ++i) {
- AliAODTrack *t = tAOD->GetTrack( i );
+ AliAODTrack *t = dynamic_cast<AliAODTrack*>(tAOD->GetTrack( i ));
if(!t) continue;
if( !t->TestFilterBit(fb) ) continue;
if( t->Eta()<-0.8 || t->Eta()>+0.8 ) continue;
if(!ev) return -1;
Int_t found = 0;
for(int i=0; i!=ev->GetNumberOfTracks(); ++i) {
- AliAODTrack *t = ev->GetTrack( i );
+ AliAODTrack *t = dynamic_cast<AliAODTrack*>(ev->GetTrack( i ));
if(!t) continue;
if( !t->TestFilterBit(1) ) continue;
if( t->Eta()<-0.8 || t->Eta()>+0.8 ) continue;
if(!ev) return -1;
Int_t found = 0;
for(int i=0; i!=ev->GetNumberOfTracks(); ++i) {
- AliAODTrack *t = ev->GetTrack( i );
+ AliAODTrack *t = dynamic_cast<AliAODTrack*>(ev->GetTrack( i ));
if(!t) continue;
if( !t->TestFilterBit(16) ) continue;
if( t->Eta()<-0.8 || t->Eta()>+0.8 ) continue;
--- /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: AliAnalysisTaskPIDconfig.cxx 43811 2014-10-11 Naghmeh Mohammadi $ */
+
+#include "TChain.h"
+#include "TTree.h"
+#include "TList.h"
+#include "TMath.h"
+#include "TObjArray.h"
+#include "TCanvas.h"
+#include "TGraphErrors.h"
+#include "TString.h"
+#include "TFile.h"
+#include "TH1F.h"
+#include "TH2F.h"
+#include "TH3F.h"
+#include "TH2D.h"
+#include "TH3D.h"
+#include "TArrayF.h"
+#include "TF1.h"
+#include "TROOT.h"
+#include "stdio.h"
+#include "TCutG.h"
+
+
+#include "AliTHn.h"
+#include "AliLog.h"
+#include "AliAnalysisManager.h"
+#include "AliESDEvent.h"
+#include "AliAODInputHandler.h"
+#include "AliAODEvent.h"
+#include "AliAODTrack.h"
+#include "AliAODInputHandler.h"
+#include "AliCollisionGeometry.h"
+#include "AliGenEventHeader.h"
+#include "AliAnalysisUtils.h"
+#include "AliPIDCombined.h"
+#include "AliAnalysisTask.h"
+#include "AliAODHandler.h"
+#include <AliInputEventHandler.h>
+#include <AliVEventHandler.h>
+#include <AliVParticle.h>
+#include <AliVTrack.h>
+#include <AliTPCPIDResponse.h>
+#include <AliTOFPIDResponse.h>
+#include "AliAnalysisTaskPIDconfig.h"
+#include "AliAnalysisTaskSE.h"
+#include "AliAODPid.h"
+#include "AliPhysicsSelection.h"
+#include "AliCentralitySelectionTask.h"
+#include "AliCentrality.h"
+#include "AliKFParticle.h"
+#include "AliKFVertex.h"
+#include "AliPID.h"
+#include "AliPIDResponse.h"
+#include "AliCFContainer.h"
+#include "AliCFManager.h"
+#include "AliVEvent.h"
+#include "AliAODVZERO.h"
+
+
+ClassImp(AliAnalysisTaskPIDconfig)
+//ClassImp()
+//___________________________________________________________________
+AliAnalysisTaskPIDconfig::AliAnalysisTaskPIDconfig():
+AliAnalysisTaskSE(),
+fVevent(0),
+fESD(0),
+fAOD(0),
+fPIDResponse(0),
+fTriggerSelection(0),
+fCentralityPercentileMin(0.),
+fCentralityPercentileMax(5.),
+fFilterBit(128),
+fDCAxyCut(-1),
+fDCAzCut(-1),
+fData2011(kFALSE),
+fTriggerMB(kTRUE),
+fTriggerCentral(kFALSE),
+fUseCentrality(kTRUE),
+fCutTPCmultiplicityOutliersAOD(kFALSE),
+fPIDcuts(kFALSE),
+fCentralityEstimator("V0M"),
+fContourCutList(0),
+fListQA(0x0),
+fListQAtpctof(0x0),
+fListQAInfo(0x0),
+fhistCentralityPass(0),
+fNoEvents(0),
+fpVtxZ(0),
+fhistDCABefore(0),
+fhistDCAAfter(0),
+fhistPhiDistBefore(0),
+fhistPhiDistAfter(0),
+fhistEtaDistBefore(0),
+fhistEtaDistAfter(0),
+fTPCvsGlobalMultBeforeOutliers(0),
+fTPCvsGlobalMultAfterOutliers(0),
+fTPCvsGlobalMultAfter(0),
+fHistBetavsPTOFbeforePID(0),
+fHistdEdxVsPTPCbeforePID(0),
+fHistBetavsPTOFafterPID(0),
+fHistdEdxVsPTPCafterPID(0),
+fhistNsigmaP(0),
+fhistNsigmaPt(0)
+//fSparseSpecies(0),
+//fvalueSpecies(0)
+{
+ //Dummy Constructor
+}
+
+
+//
+
+AliAnalysisTaskPIDconfig::AliAnalysisTaskPIDconfig(const char *name):
+AliAnalysisTaskSE(name),
+fVevent(0),
+fESD(0),
+fAOD(0),
+fPIDResponse(0),
+fTriggerSelection(0),
+fCentralityPercentileMin(0.),
+fCentralityPercentileMax(5.),
+fFilterBit(1),
+fDCAxyCut(-1),
+fDCAzCut(-1),
+fData2011(kFALSE),
+fTriggerMB(kTRUE),
+fTriggerCentral(kFALSE),
+fUseCentrality(kTRUE),
+fCutTPCmultiplicityOutliersAOD(kFALSE),
+fPIDcuts(kFALSE),
+fCentralityEstimator("V0M"),
+fContourCutList(0),
+fListQA(0x0),
+fListQAtpctof(0x0),
+fListQAInfo(0x0),
+fhistCentralityPass(0),
+fNoEvents(0),
+fpVtxZ(0),
+fhistDCABefore(0),
+fhistDCAAfter(0),
+fhistPhiDistBefore(0),
+fhistPhiDistAfter(0),
+fhistEtaDistBefore(0),
+fhistEtaDistAfter(0),
+fTPCvsGlobalMultBeforeOutliers(0),
+fTPCvsGlobalMultAfterOutliers(0),
+fTPCvsGlobalMultAfter(0),
+fHistBetavsPTOFbeforePID(0),
+fHistdEdxVsPTPCbeforePID(0),
+fHistBetavsPTOFafterPID(0),
+fHistdEdxVsPTPCafterPID(0),
+fhistNsigmaP(0),
+fhistNsigmaPt(0)
+//fSparseSpecies(0),
+//fvalueSpecies(0)
+{
+ //fvalueSpecies = new Double_t[9];
+ //Default Constructor
+ DefineInput(0,TChain::Class());
+ DefineOutput(1,TList::Class());
+}
+
+//_____________________________________________________________________
+AliAnalysisTaskPIDconfig::~AliAnalysisTaskPIDconfig()
+{
+ //Destructor
+
+ // delete fPID;
+ // delete fPIDqa;
+ // delete fTrackCuts;
+ // delete fSparseSpecies;
+ //delete []fvalueSpecies;
+
+
+}
+//______________________________________________________________________
+void AliAnalysisTaskPIDconfig::UserCreateOutputObjects()
+{
+ //
+ // Create the output QA objects
+ //
+
+ AliLog::SetClassDebugLevel("AliAnalysisTaskPIDconfig",10);
+
+ //input hander
+ AliAnalysisManager *mgr=AliAnalysisManager::GetAnalysisManager();
+ AliInputEventHandler *inputHandler=dynamic_cast<AliInputEventHandler*>(mgr->GetInputEventHandler());
+ if (!inputHandler) AliFatal("Input handler needed");
+
+ //pid response object
+ fPIDResponse=inputHandler->GetPIDResponse();
+ if (!fPIDResponse) AliError("PIDResponse object was not created");
+
+ //
+ fListQA=new TList;
+ fListQA->SetOwner();
+
+ fListQAtpctof=new TList;
+ fListQAtpctof->SetOwner();
+ fListQAtpctof->SetName("PID_TPC_TOF");
+
+ fListQAInfo=new TList;
+ fListQAInfo->SetOwner();
+ fListQAInfo->SetName("Event_Track_Info");
+
+ fListQA->Add(fListQAtpctof);
+ fListQA->Add(fListQAInfo);
+
+ SetupTPCTOFqa();
+ SetupEventInfo();
+
+ PostData(1,fListQA);
+}
+//______________________________________________________________________
+void AliAnalysisTaskPIDconfig::UserExec(Option_t*){
+ //Main loop
+ //Called for each event
+
+ // create pointer to event
+ fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
+ fESD = dynamic_cast<AliESDEvent*>(InputEvent());
+
+ Int_t ntracks=fAOD->GetNumberOfTracks();
+
+
+ if(!(fESD || fAOD)){
+ printf("ERROR: fESD & fAOD not available\n");
+ return;
+ }
+ fVevent = dynamic_cast<AliVEvent*>(InputEvent());
+ if (!fVevent) {
+ printf("ERROR: fVevent not available\n");
+ return;
+ }
+
+ Bool_t pass = kFALSE;
+
+ CheckCentrality(fVevent,pass);
+
+ if(!pass){ return;}
+
+ const AliVVertex *pVtx = fVevent->GetPrimaryVertex();
+
+ Double_t pVtxZ = -999;
+ pVtxZ = pVtx->GetZ();
+
+ if(TMath::Abs(pVtxZ)>10) return;
+
+ TH1F *hNoEvents = (TH1F*)fListQAInfo->At(1);
+ TH1F *histpVtxZ = (TH1F*)fListQAInfo->At(2);
+
+ if(hNoEvents) hNoEvents->Fill(0);
+ if(histpVtxZ) histpVtxZ->Fill(pVtxZ);
+
+ if(ntracks<2) return;
+
+ // if(!pass) return;
+
+ TH2F *HistTPCvsGlobalMultBeforeOutliers = (TH2F*)fListQAInfo->At(3);
+
+ TH2F *HistTPCvsGlobalMultAfterOutliers = (TH2F*)fListQAInfo->At(4);
+
+
+ Float_t multTPC(0.); // tpc mult estimate
+ Float_t multGlobal(0.); // global multiplicity
+
+ const Int_t nGoodTracks = fVevent->GetNumberOfTracks();
+ if(!fData2011) { // cut on outliers
+
+ for(Int_t iTrack = 0; iTrack < nGoodTracks; iTrack++) { // fill tpc mult
+ AliAODTrack* AODtrack =dynamic_cast<AliAODTrack*>(fVevent->GetTrack(iTrack));
+ if (!AODtrack) continue;
+ if (!(AODtrack->TestFilterBit(1))) continue;
+ if ((AODtrack->Pt() < .2) || (AODtrack->Pt() > 5.0) || (TMath::Abs(AODtrack->Eta()) > .8) || (AODtrack->GetTPCNcls() < 70) || (AODtrack->GetDetPid()->GetTPCsignal() < 10.0) || (AODtrack->Chi2perNDF() < 0.2)) continue;
+ multTPC++;
+ }//track loop
+
+ for(Int_t iTrack = 0; iTrack < nGoodTracks; iTrack++) { // fill global mult
+ AliAODTrack *AODtrack=dynamic_cast<AliAODTrack*>(fVevent->GetTrack(iTrack));
+ if (!AODtrack) continue;
+ if (!(AODtrack->TestFilterBit(16))) continue;
+ if ((AODtrack->Pt() < .2) || (AODtrack->Pt() > 5.0) || (TMath::Abs(AODtrack->Eta()) > .8) || (AODtrack->GetTPCNcls() < 70) || (AODtrack->GetDetPid()->GetTPCsignal() < 10.0) || (AODtrack->Chi2perNDF() < 0.1)) continue;
+ Double_t b[2] = {-99., -99.};
+ Double_t bCov[3] = {-99., -99., -99.};
+ AliAODTrack copy(*AODtrack);
+ if (!(copy.PropagateToDCA(fVevent->GetPrimaryVertex(), fVevent->GetMagneticField(), 100., b, bCov))) continue;
+ if ((TMath::Abs(b[0]) > 0.3) || (TMath::Abs(b[1]) > 0.3)) continue;
+ multGlobal++;
+ } //track loop
+
+ HistTPCvsGlobalMultBeforeOutliers->Fill(multGlobal,multTPC);
+
+ if(multTPC < (-40.3+1.22*multGlobal) || multTPC > (32.1+1.59*multGlobal)){ pass = kFALSE;}
+
+ if(!pass) return;
+ HistTPCvsGlobalMultAfterOutliers->Fill(multGlobal,multTPC);
+
+ }
+
+
+ if(fData2011) { // cut on outliers
+ //Float_t multTPC(0.); // tpc mult estimate
+ //Float_t multGlob(0.); // global multiplicity
+ for(Int_t iTrack = 0; iTrack < nGoodTracks; iTrack++) { // fill tpc mult
+ AliAODTrack *AODtrack=dynamic_cast<AliAODTrack*>(fVevent->GetTrack(iTrack));
+ if (!AODtrack) continue;
+ if (!(AODtrack->TestFilterBit(1))) continue;
+ if ((AODtrack->Pt() < .2) || (AODtrack->Pt() > 5.0) || (TMath::Abs(AODtrack->Eta()) > .8) || (AODtrack->GetTPCNcls() < 70) || (AODtrack->GetDetPid()->GetTPCsignal() < 10.0) || (AODtrack->Chi2perNDF() < 0.2)) continue;
+ multTPC++;
+ }
+ for(Int_t iTrack = 0; iTrack < nGoodTracks; iTrack++) { // fill global mult
+ AliAODTrack *AODtrack=dynamic_cast<AliAODTrack*>(fVevent->GetTrack(iTrack));
+ if (!AODtrack) continue;
+ if (!(AODtrack->TestFilterBit(16))) continue;
+ if ((AODtrack->Pt() < .2) || (AODtrack->Pt() > 5.0) || (TMath::Abs(AODtrack->Eta()) > .8) || (AODtrack->GetTPCNcls() < 70) || (AODtrack->GetDetPid()->GetTPCsignal() < 10.0) || (AODtrack->Chi2perNDF() < 0.1)) continue;
+ Double_t b[2] = {-99., -99.};
+ Double_t bCov[3] = {-99., -99., -99.};
+ AliAODTrack copy(*AODtrack);
+ if (!(copy.PropagateToDCA(fVevent->GetPrimaryVertex(), fVevent->GetMagneticField(), 100., b, bCov))) continue;
+ if ((TMath::Abs(b[0]) > 0.3) || (TMath::Abs(b[1]) > 0.3)) continue;
+ multGlobal++;
+
+ } //track loop
+
+ HistTPCvsGlobalMultBeforeOutliers->Fill(multGlobal,multTPC);
+
+ if(multTPC < (-36.73 + 1.48*multGlobal) || multTPC > (62.87 + 1.78*multGlobal)){pass = kFALSE;}
+
+ if(!pass) return;
+ HistTPCvsGlobalMultAfterOutliers->Fill(multGlobal,multTPC);
+
+ }
+
+
+
+ for(Int_t itrack = 0; itrack < ntracks; itrack++){
+
+ AliAODTrack *track=dynamic_cast<AliAODTrack*>(fVevent->GetTrack(itrack));
+ if(!track) continue;
+
+ Float_t dcaXY = track->DCA();
+ Float_t dcaZ = track->ZAtDCA();
+
+ TH2F* HistDCAbefore =(TH2F*)fListQAInfo->At(5);
+ HistDCAbefore->Fill(dcaZ,dcaXY);
+
+ Double_t p = -999, pTPC = -999, pT = -999, phi = -999, eta = -999, dEdx =-999;
+ Double_t length = -999., beta =-999, tofTime = -999., tof = -999.;
+ Double_t c = TMath::C()*1.E-9;// m/ns
+
+ //cout<<"track->GetFilterMap()= "<<track->GetFilterMap()<<endl;
+ if(!track->TestFilterBit(fFilterBit)) continue;
+
+ //Float_t dcaXY = -999, dcaZ = -999;
+ p=track->P();
+ pTPC=track->GetTPCmomentum();
+ pT=track->Pt();
+ phi=track->Phi();
+ eta=track->Eta();
+ dEdx=track->GetDetPid()->GetTPCsignal();
+
+ if ( (track->IsOn(AliAODTrack::kTOFin)) &&
+ (track->IsOn(AliAODTrack::kTIME)) && (track->IsOn(AliAODTrack::kTOFout))) {
+ // if ( (track->IsOn(AliAODTrack::kTOFin)) &&
+ // (track->IsOn(AliAODTrack::kTOFout)) ) {
+
+ tofTime = track->GetTOFsignal();//in ps
+ length = track->GetIntegratedLength();
+
+ tof = tofTime*1E-3; // ns
+ //cout<<"tof = "<<tof<<endl;
+ if (tof <= 0)continue;
+ //cout<<"length = "<<length<<endl;
+ if (length <= 0) continue;
+
+ length = length*0.01; // in meters
+ tof = tof*c;
+ beta = length/tof;
+
+ TH2F *HistBetavsPTOFbeforePID = (TH2F*)fListQAInfo->At(6);
+ HistBetavsPTOFbeforePID ->Fill(track->P()*track->Charge(),beta);
+ }//TOF signal
+
+ TH2F *HistdEdxVsPTPCbeforePID = (TH2F*)fListQAInfo->At(7);
+ HistdEdxVsPTPCbeforePID -> Fill(p*track->Charge(),dEdx); //TPC signal
+
+
+ //QA plot
+ TH1F *HistPhiDistBefore = (TH1F*)fListQAInfo->At(8);
+ HistPhiDistBefore->Fill(phi);
+ //
+ TH1F *HistEtaDistBefore = (TH1F*)fListQAInfo->At(9);
+ HistEtaDistBefore->Fill(eta);
+
+
+ if(pT<0.1) continue;
+ if(TMath::Abs(eta)>0.8) continue;
+
+ Int_t TPCNcls = track->GetTPCNcls();
+
+ if(TPCNcls<70 || dEdx<10) continue;
+
+ // fill QA histograms
+
+ TH2F* HistDCAAfter =(TH2F*)fListQAInfo->At(10);
+ HistDCAAfter->Fill(dcaZ,dcaXY);
+
+ TH1F *HistPhiDistAfter = (TH1F*)fListQAInfo->At(11);
+ HistPhiDistAfter->Fill(phi);
+
+ TH1F *HistEtaDistAfter = (TH1F*)fListQAInfo->At(12);
+ HistEtaDistAfter->Fill(eta);
+
+ Bool_t pWithinRange = kFALSE;
+ Int_t pRange = -999;
+ TCutG *cut[3][10];
+ if(fPIDcuts){
+ TGraph *ContourCut[3][10];
+ Double_t plow[10] = {0.2,0.5,1,1.5,2,2.5,3,3.5,4,4.5};
+ Double_t phigh[10] = {0.5,1,1.5,2,2.5,3,3.5,4,4.5,5};
+ // TString species[3] = {pion,kaon,proton};
+ for(int i=0;i<3;i++){
+ for(int j=0;j<10;j++){
+ if(p>plow[j] && p<phigh[j]){
+ pWithinRange = kTRUE;
+ pRange = j;
+ TList *Scontours = (TList*)fContourCutList->At(i);
+ TList *Pcontours = (TList*)Scontours->At(j);
+ if (!Pcontours || !Scontours) return;
+ ContourCut[i][j] = (TGraph*)Pcontours->First();
+ cut[i][j] = new TCutG("cut",ContourCut[i][j]->GetN(),ContourCut[i][j]->GetX(),ContourCut[i][j]->GetY());
+ //ContourCut[i][j] = (TGraph *)fContourCutList->At(10*i+j);
+ }
+ }
+ }
+ }
+
+ for (Int_t ispecie=0; ispecie<AliPID::kSPECIESC; ++ispecie){
+ //TOF nSigma
+ Double_t nSigmaTOF=fPIDResponse->NumberOfSigmasTOF(track, (AliPID::EParticleType)ispecie);
+ Double_t nSigmaTPC=fPIDResponse->NumberOfSigmasTPC(track, (AliPID::EParticleType)ispecie);
+ if(fPIDcuts && ispecie>1 && ispecie<5 && pWithinRange){// for pions, kaons and protons only
+ if(cut[ispecie-2][pRange]->IsInside(nSigmaTOF,nSigmaTPC)){
+ pass = kTRUE;
+ }
+ else{
+ pass = kFALSE;
+ continue;
+ }
+ }
+
+ //TPC and TOF cuts, TPC TOF nsigma vs. momentum
+ if(pass){
+ TH3 *hist1 = (TH3*)fListQAtpctof->At(ispecie);
+ if (hist1){
+ hist1->Fill(nSigmaTPC,nSigmaTOF,p);}
+
+ TH3 *hist2 = (TH3*)fListQAtpctof->At(ispecie+AliPID::kSPECIESC);
+ if (hist2){
+ hist2->Fill(nSigmaTPC,nSigmaTOF,pT);}
+ }
+
+ }
+
+
+ }//track loop
+
+ TH2F *HistTPCvsGlobalMultAfter = (TH2F*) fListQAInfo->At(13);
+ HistTPCvsGlobalMultAfter->Fill(multGlobal,multTPC);
+
+}
+//_________________________________________
+void AliAnalysisTaskPIDconfig::CheckCentrality(AliVEvent* event, Bool_t ¢ralitypass)
+{
+ // Check if event is within the set centrality range. Falls back to V0 centrality determination if no method is set
+ if (!fUseCentrality) AliFatal("No centrality method set! FATAL ERROR!");
+ Double_t centvalue = event->GetCentrality()->GetCentralityPercentile(fCentralityEstimator);
+ //cout << "Centrality evaluated-------------------------: " << centvalue <<endl;
+ if ((centvalue >= fCentralityPercentileMin) && (centvalue < fCentralityPercentileMax))
+ {
+ TH1F *hCentralityPass = (TH1F*)fListQAInfo->At(0);
+ hCentralityPass->Fill(centvalue);
+ //cout << "--------------Fill pass-------------------------"<<endl;
+ centralitypass = kTRUE;
+ }
+
+}
+//______________________________________________________________________________
+void AliAnalysisTaskPIDconfig::SetupTPCTOFqa()
+{
+ //
+ // Create the qa objects for TPC + TOF combination
+
+
+ //TPC and TOF signal vs. momentum
+ for (Int_t ispecie=0; ispecie<AliPID::kSPECIESC; ++ispecie){
+ fhistNsigmaP = new TH3F(Form("NsigmaP_TPC_TOF_%s",AliPID::ParticleName(ispecie)),Form("TPC n#sigma vs. TOF n#sigma %s vs. p ;TPC n#sigma;TOF n#sigma;p [GeV]",AliPID::ParticleName(ispecie)),200,-20,20,200,-20,20,60,0.1,6);
+ fListQAtpctof->Add(fhistNsigmaP);
+ }
+ //TPC and TOF signal vs. transverse momentum
+ for (Int_t ispecie=0; ispecie<AliPID::kSPECIESC; ++ispecie){
+ fhistNsigmaPt = new TH3F(Form("NsigmaPt_TPC_TOF_%s",AliPID::ParticleName(ispecie)),Form("TPC n#sigma vs. TOF n#sigma %s vs. Pt ;TPC n#sigma;TOF n#sigma;pT [GeV]",AliPID::ParticleName(ispecie)),200,-20,20,200,-20,20,60,0.1,6);
+ fListQAtpctof->Add(fhistNsigmaPt);
+ }
+
+}
+//______________________________________________________________________________
+void AliAnalysisTaskPIDconfig::SetupEventInfo()
+{
+ //event and track info
+
+ fhistCentralityPass = new TH1F("fcentralityPass","centralityPass", 100,0,100);
+ fListQAInfo->Add(fhistCentralityPass);
+
+ fNoEvents = new TH1F("number of events","no. of events",1,0,1);
+ fListQAInfo->Add(fNoEvents);
+
+ fpVtxZ = new TH1F("pVtxZ","pVtxZ",100,-20,20);
+ fListQAInfo->Add(fpVtxZ);
+
+ fTPCvsGlobalMultBeforeOutliers = new TH2F("TPC vs. Global Multiplicity Before","TPC vs. Global Multiplicity Before",500,0,6000,500,0,6000);
+ fListQAInfo->Add(fTPCvsGlobalMultBeforeOutliers);
+
+ fTPCvsGlobalMultAfterOutliers = new TH2F("TPC vs. Global Multiplicity After outliers","TPC vs. Global Multiplicity After outliers",500,0,6000,500,0,6000);
+ fListQAInfo->Add(fTPCvsGlobalMultAfterOutliers);
+
+ fhistDCABefore = new TH2F("DCA xy vs z (before)","DCA before",200,0,10,200,0,10);
+ fListQAInfo->Add(fhistDCABefore);
+
+ fHistBetavsPTOFbeforePID = new TH2F("momentum vs beta before PID","momentum vs beta before PID",1000,-10.,10.,1000,0,1.2);
+ fListQAInfo->Add(fHistBetavsPTOFbeforePID);
+
+ fHistdEdxVsPTPCbeforePID = new TH2F("momentum vs dEdx before PID","momentum vs dEdx before PID",1000,-10.,10.,1000,0,1000);
+ fListQAInfo->Add(fHistdEdxVsPTPCbeforePID);
+
+ fhistPhiDistBefore = new TH1F("Phi Distribution Before Cuts","Phi Distribution Before Cuts",200,0,6.4);
+ fListQAInfo->Add(fhistPhiDistBefore);
+
+ fhistEtaDistBefore = new TH1F("Eta Distribution Before Cuts","Eta Distribution Before Cuts",200,-10,10);
+ fListQAInfo->Add(fhistEtaDistBefore);
+
+ fhistDCAAfter = new TH2F("DCA xy vs z (after)","DCA after",200,0,10,200,0,10);
+ fListQAInfo->Add(fhistDCAAfter);
+
+ fhistPhiDistAfter = new TH1F("Phi Distribution After Cuts","Phi Distribution After Cuts",200,0,6.4);
+ fListQAInfo->Add(fhistPhiDistAfter);
+
+ fhistEtaDistAfter = new TH1F("Eta Distribution After Cuts","Eta Distribution After Cuts",200,-10,10);
+ fListQAInfo->Add(fhistEtaDistAfter);
+
+ fTPCvsGlobalMultAfter = new TH2F("TPC vs. Global Multiplicity After","TPC vs. Global Multiplicity After",500,0,6000,500,0,6000);
+ fListQAInfo->Add(fTPCvsGlobalMultAfter);
+
+// fHistBetavsPTOFafterPID = new TH2F("momentum vs beta after PID","momentum vs beta after PID",1000,-10.,10.,1000,0,1.2);
+// fListQAInfo->Add(