From: gconesab Date: Thu, 2 Sep 2010 16:06:26 +0000 (+0000) Subject: Correct MCReader: do not fill created AODCaloClusters to AODEvent X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=0ae57829959398aa6e23d675ab880b29c802fdb0 Correct MCReader: do not fill created AODCaloClusters to AODEvent AliAnaPhoton: Use cell cut only for data, not for MC data All: Remove declaration, usage of AliAODCaloClusters and move to AliVClusters AliCaloTrackESD/AODReader: Clean up a bit the classes, move the track status initizalization to the AliCaloTrackReader Declare as virtual in AliCaloTrackReader some setters only used in AliCaloTrackMCReader --- diff --git a/PWG4/PartCorrBase/AliCaloPID.cxx b/PWG4/PartCorrBase/AliCaloPID.cxx index b80f755bf0d..177947f844f 100755 --- a/PWG4/PartCorrBase/AliCaloPID.cxx +++ b/PWG4/PartCorrBase/AliCaloPID.cxx @@ -20,7 +20,7 @@ // being kPhoton, kElectron, kPi0 ... as defined in the header file // - GetPdg(const TString calo, const Double_t * pid, const Float_t energy) // Reads the PID weights array of the ESDs and depending on its magnitude identifies the particle -// - GetPdg(const TString calo,const TLorentzVector mom, const AliAODCaloCluster * cluster) +// - GetPdg(const TString calo,const TLorentzVector mom, const AliVCluster * cluster) // Recalcultes PID, the bayesian or any new one to be implemented in the future // Right now only the possibility to recalculate EMCAL with bayesian and simple PID. // In order to recalculate Bayesian, it is necessary to load the EMCALUtils library @@ -46,7 +46,7 @@ //---- ANALYSIS system ---- #include "AliCaloPID.h" -#include "AliAODCaloCluster.h" +#include "AliVCluster.h" #include "AliAODPWG4Particle.h" #include "AliEMCALPIDUtils.h" ClassImp(AliCaloPID) @@ -294,7 +294,7 @@ Int_t AliCaloPID::GetPdg(const TString calo, const Double_t * pid, const Float_t } //_______________________________________________________________ -Int_t AliCaloPID::GetPdg(const TString calo,const TLorentzVector mom, const AliAODCaloCluster * cluster) const { +Int_t AliCaloPID::GetPdg(const TString calo,const TLorentzVector mom, const AliVCluster * cluster) const { //Recalculated PID with all parameters Float_t lambda0 = cluster->GetM02(); Float_t energy = mom.E(); @@ -415,7 +415,7 @@ void AliCaloPID::Print(const Option_t * opt) const } //_______________________________________________________________ -void AliCaloPID::SetPIDBits(const TString calo, const AliAODCaloCluster * cluster, AliAODPWG4Particle * ph) { +void AliCaloPID::SetPIDBits(const TString calo, const AliVCluster * cluster, AliAODPWG4Particle * ph) { //Set Bits for PID selection //Dispersion/lambdas diff --git a/PWG4/PartCorrBase/AliCaloPID.h b/PWG4/PartCorrBase/AliCaloPID.h index 465cc938338..c461e9186fa 100755 --- a/PWG4/PartCorrBase/AliCaloPID.h +++ b/PWG4/PartCorrBase/AliCaloPID.h @@ -10,7 +10,7 @@ // being kPhoton, kElectron, kPi0 ... as defined in the header file // - GetPdg(const TString calo, const Double_t * pid, const Float_t energy) // Reads the PID weights array of the ESDs and depending on its magnitude identifies the particle -// - GetPdg(const TString calo,const TLorentzVector mom, const AliAODCaloCluster * cluster) +// - GetPdg(const TString calo,const TLorentzVector mom, const AliVCluster * cluster) // Recalcultes PID, the bayesian or any new one to be implemented in the future // Right now only the possibility to recalculate EMCAL with bayesian and simple PID. // In order to recalculate Bayesian, it is necessary to load the EMCALUtils library @@ -35,7 +35,7 @@ class TLorentzVector ; class TTask; //--- AliRoot system --- -class AliAODCaloCluster; +class AliVCluster; class AliAODPWG4Particle; class AliEMCALPIDUtils; @@ -72,11 +72,11 @@ public: Int_t GetPdg(const TString calo, const Double_t * pid, const Float_t energy) const ; - Int_t GetPdg(const TString calo,const TLorentzVector mom, const AliAODCaloCluster * cluster) const ; + Int_t GetPdg(const TString calo,const TLorentzVector mom, const AliVCluster * cluster) const ; TString GetPIDParametersList(); - void SetPIDBits(const TString calo, const AliAODCaloCluster * cluster, AliAODPWG4Particle *aodph); + void SetPIDBits(const TString calo, const AliVCluster * cluster, AliAODPWG4Particle *aodph); void Print(const Option_t * opt)const; diff --git a/PWG4/PartCorrBase/AliCaloTrackAODReader.cxx b/PWG4/PartCorrBase/AliCaloTrackAODReader.cxx index 44997506752..ef90778301f 100755 --- a/PWG4/PartCorrBase/AliCaloTrackAODReader.cxx +++ b/PWG4/PartCorrBase/AliCaloTrackAODReader.cxx @@ -31,10 +31,6 @@ //---- ANALYSIS system ---- #include "AliCaloTrackAODReader.h" -#include "AliAODCaloCluster.h" -#include "AliAODTrack.h" -#include "AliESDtrack.h" -#include "AliFiducialCut.h" #include "AliAODInputHandler.h" #include "AliMultiEventInputHandler.h" #include "AliAnalysisManager.h" @@ -52,30 +48,8 @@ AliCaloTrackAODReader::AliCaloTrackAODReader() : fDataType=kAOD; fReadStack = kTRUE; fReadAODMCParticles = kFALSE; - //We want tracks fitted in the detectors: - fTrackStatus=AliESDtrack::kTPCrefit; - fTrackStatus|=AliESDtrack::kITSrefit; - + } -/* -//____________________________________________________________________________ -AliCaloTrackAODReader::AliCaloTrackAODReader(const AliCaloTrackAODReader & aodr) : - AliCaloTrackReader(aodr), fWriteOutputStdAOD(aodr.fWriteOutputStdAOD) -{ - // cpy ctor -} -*/ -//_________________________________________________________________________ -//AliCaloTrackAODReader & AliCaloTrackAODReader::operator = (const AliCaloTrackAODReader & source) -//{ -// // assignment operator -// -// if(&source == this) return *this; -// -// return *this; -// -//} - //____________________________________________________________________________ //void AliCaloTrackAODReader::GetSecondInputAODVertex(Double_t v[3]) const { diff --git a/PWG4/PartCorrBase/AliCaloTrackESDReader.cxx b/PWG4/PartCorrBase/AliCaloTrackESDReader.cxx index 63a1f6ae5c9..2562064067c 100755 --- a/PWG4/PartCorrBase/AliCaloTrackESDReader.cxx +++ b/PWG4/PartCorrBase/AliCaloTrackESDReader.cxx @@ -19,11 +19,7 @@ // Class for reading data (ESDs) in order to do prompt gamma // or other particle identification and correlations // -// It is a filtering class, transforms ESD tracks or CaloClusters -// into AOD tracks and calocluters, which are the basic input of the analysis -// classes in this frame. -// It is recommended to use the official filter AliAnalysisTaskESDfilter, and -// then the reader for AODs AliCaloTrackAODReader. +// // // //*-- Author: Gustavo Conesa (LNF-INFN) @@ -35,14 +31,9 @@ //---- ANALYSIS system ---- #include "AliCaloTrackESDReader.h" -#include "AliESDCaloCluster.h" -#include "AliAODCaloCluster.h" -#include "AliAODTrack.h" -#include "AliAODPid.h" #include "AliAODEvent.h" #include "AliMultiEventInputHandler.h" #include "AliAnalysisManager.h" -#include "AliFiducialCut.h" #include "AliMixedEvent.h" @@ -58,375 +49,8 @@ AliCaloTrackReader() fDataType=kESD; fReadStack = kTRUE; fReadAODMCParticles = kFALSE; - //We want tracks fitted in the detectors: - fTrackStatus=AliESDtrack::kTPCrefit; - fTrackStatus|=AliESDtrack::kITSrefit; - //This reader creates the AOD objects (Tracks-clusters), so it owns them - //fAODCTS ->SetOwner(kTRUE); - //fAODEMCAL->SetOwner(kTRUE); - //fAODPHOS ->SetOwner(kTRUE); -} -/* -//____________________________________________________________________________ -AliCaloTrackESDReader::AliCaloTrackESDReader(const AliCaloTrackESDReader & g) : - AliCaloTrackReader(g) -{ - // cpy ctor -} -*/ -//_________________________________________________________________________ -//AliCaloTrackESDReader & AliCaloTrackESDReader::operator = (const AliCaloTrackESDReader & source) -//{ -// // assignment operator -// -// if(&source == this) return *this; -// -// return *this; -// -//} - -//____________________________________________________________________________ -//void AliCaloTrackESDReader::FillInputCTS() { -// //Return array with CTS tracks -// if(fDebug > 2 ) printf("AliCaloTrackESDReader::FillInputCTS()\n"); -// -// //TObjArray * fAODCTS = new TObjArray(); -// Int_t nTracks = fInputEvent->GetNumberOfTracks() ; -// Int_t naod = 0; -// Double_t pos[3]; -// Double_t p[3]; -// Double_t covTr[21]; -// Double_t pid[10]; -// Double_t bfield = fInputEvent->GetMagneticField(); -// -// Double_t timezero = 0; //TO BE FIXED -// -// //List of output tracks -// TClonesArray &tracks = *(fOutputEvent->GetTracks()); -// -// //To be replaced by call to AliEMCALGeoUtils when the class becomes available -// Double_t radius = 441.0; //[cm] EMCAL radius +13cm -// -// if(fDebug > 1) printf("AliCaloTrackESDReader::FillInputCTS() - org entries %d\n", nTracks); -// for (Int_t itrack = 0; itrack < nTracks; itrack++) {////////////// track loop -// AliESDtrack * track = (AliESDtrack*) fInputEvent->GetTrack(itrack) ; // retrieve track from esd -// -// //We want tracks fitted in the detectors: TPCrefit, ITSrefit ... check the set bits. -// if (fTrackStatus && !((track->GetStatus() & fTrackStatus) == fTrackStatus)) continue ; -// -// track->GetPxPyPz(p) ; -// TLorentzVector momentum(p[0],p[1],p[2],0); -// -// if(fCTSPtMin < momentum.Pt()){ -// -// if(fCheckFidCut && !fFiducialCut->IsInFiducialCut(momentum,"CTS")) continue; -// -// if(fDebug > 3 && momentum.Pt() > 0.2) printf("AliCaloTrackESDReader::FillInputCTS() - Selected tracks E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", -// momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); -// -// track->GetXYZ(pos); -// track->GetCovarianceXYZPxPyPz(covTr); -// track->GetESDpid(pid); -// -// Float_t impactXY, impactZ; -// -// track->GetImpactParameters(impactXY,impactZ); -// -// if (impactXY<3) { -// // track inside the beam pipe -// //Put new aod object in file in AOD tracks array -// AliAODTrack *aodTrack = new(tracks[naod++]) -// //AliAODTrack *aodTrack = new((*(fOutputEvent->GetTracks()))[naod++]) -// AliAODTrack(track->GetID(), track->GetLabel(), p, kTRUE, pos, kFALSE,covTr, (Short_t)track->GetSign(), track->GetITSClusterMap(), -// pid, -// 0x0,//primary, -// kTRUE, // check if this is right -// kTRUE, // check if this is right -// AliAODTrack::kPrimary, -// 0); -// -// aodTrack->SetFlags(track->GetStatus()); -// aodTrack->ConvertAliPIDtoAODPID(); -// -// //fill needed AliAODPid information, including -// //Extrapolate track to EMCAL surface for AOD-level track-cluster matching -// AliAODPid *aodpid = new AliAODPid; -// aodpid->SetITSsignal(track->GetITSsignal()); -// aodpid->SetTPCsignal(track->GetTPCsignal()); -// //n TRD planes = 6 -// Int_t nslices = track->GetNumberOfTRDslices()*6; -// Double_t *trdslices = new Double_t[nslices]; -// for(Int_t iSl =0; iSl < track->GetNumberOfTRDslices(); iSl++) { -// for(Int_t iPl =0; iPl<6; iPl++) trdslices[iPl*track->GetNumberOfTRDslices()+iSl] = track->GetTRDslice(iPl,iSl); -// } -// aodpid->SetTRDsignal(track->GetNumberOfTRDslices()*6,trdslices); -// Double_t times[AliAODPid::kSPECIES]; track->GetIntegratedTimes(times); -// aodpid->SetIntegratedTimes(times); -// -// aodpid->SetTOFsignal(track->GetTOFsignal()-timezero); // to be fixed -// aodpid->SetHMPIDsignal(track->GetHMPIDsignal()); -// -// Double_t emcpos[3] = {0.,0.,0.}; -// Double_t emcmom[3] = {0.,0.,0.}; -// aodpid->SetEMCALPosition(emcpos); -// aodpid->SetEMCALMomentum(emcmom); -// -// AliExternalTrackParam *outerparam = (AliExternalTrackParam*)track->GetOuterParam(); -// if(!outerparam) continue; -// -// Bool_t okpos = outerparam->GetXYZAt(radius,bfield,emcpos); -// Bool_t okmom = outerparam->GetPxPyPzAt(radius,bfield,emcmom); -// if(!(okpos && okmom)) continue; -// -// aodpid->SetEMCALPosition(emcpos); -// aodpid->SetEMCALMomentum(emcmom); -// -// aodTrack->SetDetPID(aodpid); -// } -// else continue; // outside the beam pipe: orphan track -// }//Pt and Fiducial cut passed. -// }// track loop -// -// //Put references to selected tracks in array -// for(Int_t itrack = 0; itrack < (fOutputEvent->GetTracks())->GetEntriesFast(); itrack++){ -// AliAODTrack * track = (AliAODTrack*) (fOutputEvent->GetTracks())->At(itrack); -// fAODCTS->Add(track); -// } -// -// if(fDebug > 1) printf("AliCaloTrackESDReader::FillInputCTS() - aod entries %d\n", fAODCTS->GetEntriesFast()); -//} -// -////____________________________________________________________________________ -//void AliCaloTrackESDReader::FillInputEMCAL() { -// //Return array with EMCAL clusters in aod format -// if(fDebug > 2 ) printf("AliCaloTrackESDReader::FillInputEMCAL()\n"); -// -// Float_t pos[3] ; -// Int_t naod = (fOutputEvent->GetCaloClusters())->GetEntriesFast(); -// Int_t nTracks = fInputEvent->GetNumberOfTracks() ; -// -// //Loop to select clusters in fiducial cut and fill container with aodClusters -// for (Int_t iclus = 0; iclus < fInputEvent->GetNumberOfCaloClusters(); iclus++) { -// AliESDCaloCluster * clus = 0; -// if ( (clus = (AliESDCaloCluster *)fInputEvent->GetCaloCluster(iclus)) ) { -// if (clus->IsEMCAL()){ -// -// //Check if the cluster contains any bad channel and if close to calorimeter borders -// Int_t vindex = 0 ; -// if (fMixedEvent) -// vindex = fMixedEvent->EventIndexForCaloCluster(iclus); -// -// if( GetCaloUtils()->ClusterContainsBadChannel("EMCAL",clus->GetCellsAbsId(), clus->GetNCells())) -// continue; -// if(!GetCaloUtils()->CheckCellFiducialRegion(clus, fInputEvent->GetEMCALCells(), fInputEvent, vindex)) -// continue; -// -// TLorentzVector momentum ; -// clus->GetMomentum(momentum, fVertex[vindex]); -// if(fDebug > 3 && momentum.E() > 0.1) -// printf("AliCaloTrackESDReader::FillInputEMCAL() - all clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", -// momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); -// if(fEMCALPtMin < momentum.Pt()){ -// -// if(fCheckFidCut && !fFiducialCut->IsInFiducialCut(momentum,"EMCAL")) -// continue; -// -// if(fDebug > 2 && momentum.E() > 0.1) -// printf("AliCaloTrackESDReader::FillInputEMCAL() - Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", -// momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); -// -// clus->GetPosition(pos) ; -// Int_t id = clus->GetID(); -// -// Int_t nLabel = clus->GetNLabels(); -// Int_t *labels = clus->GetLabels(); -// -// Float_t energy = clus->E(); -// Char_t ttype= AliAODCluster::kEMCALClusterv1; -// -// //Recalibrate the cluster energy -// if(GetCaloUtils()->IsRecalibrationOn()) -// energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, GetEMCALCells()); -// -// -// //Put new aod object in file in AOD calo clusters array -// AliAODCaloCluster *caloCluster = new((*(fOutputEvent->GetCaloClusters()))[naod++]) -// AliAODCaloCluster(id,nLabel,labels,energy, pos, NULL,ttype,0); -// -// // printf("Reader PID ESD: ph %0.2f, pi0 %0.2f, el %0.2f, conv el %0.2f,pi %0.2f, k %0.2f, p %0.2f, k0 %0.2f, n %0.2f, mu %0.2f \n", -// // pid[AliPID::kPhoton],pid[AliPID::kPi0],pid[AliPID::kElectron],pid[AliPID::kEleCon],pid[AliPID::kPion], -// // pid[AliPID::kKaon],pid[AliPID::kProton], pid[AliPID::kKaon0],pid[AliPID::kNeutron], pid[AliPID::kMuon]); -// caloCluster->SetPIDFromESD(clus->GetPID()); -// caloCluster->SetCaloCluster(clus->GetDistanceToBadChannel(), clus->GetDispersion(), -// clus->GetM20(), clus->GetM02(), -// clus->GetEmcCpvDistance(), clus->GetNExMax(), clus->GetTOF()) ; -// -// -// if(fDebug > 3 && momentum.E() > 0.1) -// printf("AliCaloTrackESDReader::FillInputEMCAL() - Selected clusters Distance BC %2.2f, dispersion %2.2f, M20 %f, M02 %3.2f, NexMax %d, TOF %e\n", -// clus->GetDistanceToBadChannel(), clus->GetDispersion(),clus->GetM20(), clus->GetM02(), -// clus->GetNExMax(), clus->GetTOF()); -// -// caloCluster->SetNCells(clus->GetNCells()); -// caloCluster->SetCellsAbsId(clus->GetCellsAbsId()); -// caloCluster->SetCellsAmplitudeFraction(clus->GetCellsAmplitudeFraction()); -// -// TArrayI* matchedT = clus->GetTracksMatched(); -// if (nTracks > 0 && matchedT && clus->GetTrackMatchedIndex() >= 0) { -// for (Int_t im = 0; im < matchedT->GetSize(); im++) { -// Int_t iESDtrack = matchedT->At(im); -// if(iESDtrack < nTracks && iESDtrack > -1) -// caloCluster->AddTrackMatched((fInputEvent->GetTrack(iESDtrack))); -// } -// } -// //Fill reference array -// }//Pt and Fiducial cut passed. -// }//EMCAL cluster -// }//cluster exists -// }//esd cluster loop -// -// //Put references to selected clusters in array -// for(Int_t iclus = 0; iclus < (fOutputEvent->GetCaloClusters())->GetEntriesFast(); iclus++){ -// AliAODCaloCluster * clus = (AliAODCaloCluster*) (fOutputEvent->GetCaloClusters())->At(iclus); -// if (fMixedEvent) { -// clus->SetID(iclus) ; -// } -// fAODEMCAL->Add(clus); -// } -// if(fDebug > 1) printf("AliCaloTrackESDReader::FillInputEMCAL() - aod entries %d\n", fAODEMCAL->GetEntriesFast()); -// -//} -// -// //____________________________________________________________________________ -//void AliCaloTrackESDReader::FillInputPHOS() { -// //Return array with PHOS clusters in aod format -// if(fDebug > 2 ) printf("AliCaloTrackESDReader::FillInputPHOS()\n"); -// -// Int_t nPHOS = (fOutputEvent->GetCaloClusters())->GetEntriesFast(); -// Float_t pos[3] ; -// Int_t naod = (fOutputEvent->GetCaloClusters())->GetEntriesFast(); -// Int_t nTracks = fInputEvent->GetNumberOfTracks() ; -// -// //Loop to select clusters in fiducial cut and fill container with aodClusters -// for (Int_t iclus = 0; iclus < fInputEvent->GetNumberOfCaloClusters(); iclus++) { -// AliESDCaloCluster * clus = 0; -// if ( (clus = (AliESDCaloCluster *)fInputEvent->GetCaloCluster(iclus)) ) { -// if (clus->IsPHOS()){ -// //Check if the cluster contains any bad channel and if close to calorimeter borders -// Int_t vindex = 0 ; -// if (fMixedEvent) -// vindex = fMixedEvent->EventIndexForCaloCluster(iclus); -// if( GetCaloUtils()->ClusterContainsBadChannel("PHOS",clus->GetCellsAbsId(), clus->GetNCells())) -// continue; -// if(!GetCaloUtils()->CheckCellFiducialRegion(clus, (AliESDCaloCells*)fInputEvent->GetPHOSCells(), fInputEvent, vindex)) -// continue; -// -// TLorentzVector momentum ; -// clus->GetMomentum(momentum, fVertex[vindex]); -// if(fDebug > 3 && momentum.E() > 0.1) -// printf("AliCaloTrackESDReader::FillInputPHOS() - all clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", -// momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); -// if(fPHOSPtMin < momentum.Pt()){ -// -// if(fCheckFidCut && !fFiducialCut->IsInFiducialCut(momentum,"PHOS")) -// continue; -// -// if(fDebug > 2 && momentum.E() > 0.1) -// printf("AliCaloTrackESDReader::FillInputPHOS() - Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", -// momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); -// -// clus->GetPosition(pos) ; -// Int_t id = clus->GetID(); -// Int_t nLabel = clus->GetNLabels(); -// Int_t *labels = clus->GetLabels(); -// Float_t energy = clus->E(); -// -// //Phos cluster type -// const Double_t * pid = clus->GetPID(); -// // printf("Reader PID ESD: ph %0.2f, pi0 %0.2f, el %0.2f, conv el %0.2f,pi %0.2f, k %0.2f, p %0.2f, k0 %0.2f, n %0.2f, mu %0.2f \n", -// // pid[AliPID::kPhoton],pid[AliPID::kPi0],pid[AliPID::kElectron],pid[AliPID::kEleCon],pid[AliPID::kPion], -// // pid[AliPID::kKaon],pid[AliPID::kProton], pid[AliPID::kKaon0],pid[AliPID::kNeutron], pid[AliPID::kMuon]); -// Char_t ttype= AliAODCluster::kPHOSNeutral; -// Float_t wNeutral = pid[AliPID::kNeutron]+ pid[AliPID::kKaon0]+pid[AliPID::kPhoton]+pid[AliPID::kPi0]; -// Float_t wCharged = pid[AliPID::kMuon] + pid[AliPID::kElectron] + pid[AliPID::kEleCon]+ -// pid[AliPID::kProton]+pid[AliPID::kKaon]+pid[AliPID::kPion]; -// if( wCharged > wNeutral) ttype= AliAODCluster::kPHOSCharged; -// -// //Recalibrate the cluster energy -// if(GetCaloUtils()->IsRecalibrationOn()) -// energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, GetPHOSCells()); -// -// //Put new aod object in file in AOD calo clusters array -// AliAODCaloCluster *caloCluster = new((*(fOutputEvent->GetCaloClusters()))[naod++]) -// AliAODCaloCluster(id,nLabel,labels,energy, pos, NULL, ttype, 0); -// -// -// caloCluster->SetPIDFromESD(pid); -// caloCluster->SetCaloCluster(clus->GetDistanceToBadChannel(), clus->GetDispersion(), -// clus->GetM20(), clus->GetM02(), -// clus->GetEmcCpvDistance(), clus->GetNExMax()) ; -// -// if(fDebug > 3 && momentum.E() > 0.2) -// printf("AliCaloTrackESDReader::FillInputPHOS() - Selected clusters Distance BC %2.2f, dispersion %2.2f, M20 %f, M02 %3.2f, EmcCpvDist %3.3f, NexMax %d, TOF %e\n", -// clus->GetDistanceToBadChannel(), clus->GetDispersion(),clus->GetM20(), clus->GetM02(), -// clus->GetEmcCpvDistance(), clus->GetNExMax(), clus->GetTOF()); -// -// caloCluster->SetNCells(clus->GetNCells()); -// caloCluster->SetCellsAbsId(clus->GetCellsAbsId()); -// caloCluster->SetCellsAmplitudeFraction(clus->GetCellsAmplitudeFraction()); -// -// TArrayI* matchedT = clus->GetTracksMatched(); -// if (nTracks > 0 && matchedT && clus->GetTrackMatchedIndex() >= 0) { -// for (Int_t im = 0; im < matchedT->GetSize(); im++) { -// Int_t iESDtrack = matchedT->At(im); -// if(iESDtrack < nTracks && iESDtrack > -1) -// caloCluster->AddTrackMatched((fInputEvent->GetTrack(iESDtrack))); -// } -// } -// }//Pt and Fiducial cut passed. -// }//PHOS cluster -// }//cluster exists -// }//esd cluster loop -// -// //Put references to selected clusters in array -// -// for(Int_t iclus = nPHOS; iclus < (fOutputEvent->GetCaloClusters())->GetEntriesFast(); iclus++){ -// AliAODCaloCluster * clus = (AliAODCaloCluster*) (fOutputEvent->GetCaloClusters())->At(iclus); -// if (fMixedEvent) { -// clus->SetID(iclus) ; -// } -// fAODPHOS->Add(clus); -// } -// if(fDebug > 1) printf("AliCaloTrackESDReader::FillInputPHOS() - aod entries %d\n", fAODPHOS->GetEntriesFast()); -// -//} -// -// //____________________________________________________________________________ -//void AliCaloTrackESDReader::FillInputEMCALCells() { -// //Return array with EMCAL cells in esd format -// -// fEMCALCells = fInputEvent->GetEMCALCells(); -// -//} -// -////____________________________________________________________________________ -//void AliCaloTrackESDReader::FillInputPHOSCells() { -// //Return array with PHOS cells in esd format -// -// fPHOSCells = fInputEvent->GetPHOSCells(); -// -//} -// - -//____________________________________________________________________________ -//void AliCaloTrackESDReader::GetVertex(Double_t v[3]) const { -// //Return vertex position -// -// //((AliESDEvent*)fInputEvent)->GetVertex()->GetXYZ(v) ;//SPD -// fInputEvent->GetPrimaryVertex()->GetXYZ(v); -// -//} +} //____________________________________________________________________________ Double_t AliCaloTrackESDReader::GetBField() const { diff --git a/PWG4/PartCorrBase/AliCaloTrackESDReader.h b/PWG4/PartCorrBase/AliCaloTrackESDReader.h index c903e630cc8..9c08307e6a3 100755 --- a/PWG4/PartCorrBase/AliCaloTrackESDReader.h +++ b/PWG4/PartCorrBase/AliCaloTrackESDReader.h @@ -8,11 +8,8 @@ // Class for reading data (ESDs) in order to do prompt gamma // or other particle identification and correlations // -// It is a filtering class, transforms ESD tracks or CaloClusters -// into AOD tracks and calocluters, which are the basic input of the analysis -// classes in this frame. -// It is recommended to use the official filter AliAnalysisTaskESDfilter, and -// then the reader for AODs AliCaloTrackAODReader.// +// +// // //*-- Author: Gustavo Conesa (INFN-LNF) @@ -30,14 +27,7 @@ class AliCaloTrackESDReader : public AliCaloTrackReader { //AliCaloTrackESDReader(const AliCaloTrackESDReader & g) ; // cpy ctor //AliCaloTrackESDReader & operator = (const AliCaloTrackESDReader & g) ;//cpy assignment virtual ~AliCaloTrackESDReader() {;} //virtual dtor - -// void FillInputCTS () ; -// void FillInputEMCAL() ; -// void FillInputPHOS () ; -// void FillInputEMCALCells() ; -// void FillInputPHOSCells() ; - -// void GetVertex(Double_t v[3]) const ; + Double_t GetBField() const; void SetInputOutputMCEvent(AliVEvent* esd, AliAODEvent* aod, AliMCEvent* mc) ; diff --git a/PWG4/PartCorrBase/AliCaloTrackMCReader.cxx b/PWG4/PartCorrBase/AliCaloTrackMCReader.cxx index 7a210d677e0..184669cb776 100755 --- a/PWG4/PartCorrBase/AliCaloTrackMCReader.cxx +++ b/PWG4/PartCorrBase/AliCaloTrackMCReader.cxx @@ -37,7 +37,7 @@ #include "AliCaloTrackMCReader.h" #include "AliGenEventHeader.h" #include "AliStack.h" -#include "AliAODCaloCluster.h" +#include "AliVCluster.h" #include "AliAODTrack.h" #include "AliAODEvent.h" #include "AliFiducialCut.h" @@ -189,8 +189,7 @@ void AliCaloTrackMCReader::CheckOverlap(const Float_t anglethres, const Int_t i } //____________________________________________________________________________ -void AliCaloTrackMCReader::FillCalorimeters(Int_t & iParticle, TParticle* particle, TLorentzVector momentum, - Int_t &ncalo) { +void AliCaloTrackMCReader::FillCalorimeters(Int_t & iParticle, TParticle* particle, TLorentzVector momentum) { //Fill AODCaloClusters or TParticles lists of PHOS or EMCAL //In PHOS if(fFillPHOS && momentum.Pt() > fPHOSPtMin){ @@ -202,12 +201,11 @@ void AliCaloTrackMCReader::FillCalorimeters(Int_t & iParticle, TParticle* parti if(fCheckOverlap) CheckOverlap(fPHOSOverlapAngle,particle->GetFirstMother(),index, iParticle, momentum, pdg); - Char_t ttype= AliAODCluster::kPHOSNeutral; + Char_t ttype= AliVCluster::kPHOSNeutral; Int_t labels[] = {index}; Float_t x[] = {momentum.X(), momentum.Y(), momentum.Z()}; //Create object and write it to file - AliAODCaloCluster *calo = new((*(fOutputEvent->GetCaloClusters()))[ncalo++]) - AliAODCaloCluster(index,1,labels,momentum.E(), x, NULL, ttype, 0); + AliAODCaloCluster *calo = new AliAODCaloCluster(index,1,labels,momentum.E(), x, NULL, ttype, 0); SetCaloClusterPID(pdg,calo) ; if(fDebug > 3 && momentum.Pt() > 0.2) @@ -227,12 +225,11 @@ void AliCaloTrackMCReader::FillCalorimeters(Int_t & iParticle, TParticle* parti if(fCheckOverlap) CheckOverlap(fEMCALOverlapAngle,particle->GetFirstMother(),iParticle, index, momentum, pdg); - Char_t ttype= AliAODCluster::kEMCALClusterv1; + Char_t ttype= AliVCluster::kEMCALClusterv1; Int_t labels[] = {index}; Float_t x[] = {momentum.X(), momentum.Y(), momentum.Z()}; //Create object and write it to file - AliAODCaloCluster *calo = new((*(fOutputEvent->GetCaloClusters()))[ncalo++]) - AliAODCaloCluster(iParticle,1,labels,momentum.E(), x, NULL, ttype, 0); + AliAODCaloCluster *calo = new AliAODCaloCluster(iParticle,1,labels,momentum.E(), x, NULL, ttype, 0); SetCaloClusterPID(pdg,calo) ; if(fDebug > 3 && momentum.Pt() > 0.2) @@ -256,8 +253,6 @@ Bool_t AliCaloTrackMCReader::FillInputEvent(const Int_t iEntry, const char * cur Int_t iParticle = 0 ; Double_t charge = 0.; - Int_t ncalo = (fOutputEvent->GetCaloClusters())->GetEntriesFast(); - Int_t ntrack = (fOutputEvent->GetTracks())->GetEntriesFast(); for (iParticle = 0 ; iParticle < GetStack()->GetNtrack() ; iParticle++) { TParticle * particle = GetStack()->Particle(iParticle); @@ -288,8 +283,7 @@ Bool_t AliCaloTrackMCReader::FillInputEvent(const Int_t iEntry, const char * cur x[0] = particle->Vx(); x[1] = particle->Vy(); x[2] = particle->Vz(); p[0] = particle->Px(); p[1] = particle->Py(); p[2] = particle->Pz(); //Create object and write it to file - AliAODTrack *aodTrack = new((*(fOutputEvent->GetTracks()))[ntrack++]) - AliAODTrack(0, iParticle, p, kTRUE, x, kFALSE,NULL, 0, 0, + AliAODTrack *aodTrack = new AliAODTrack(0, iParticle, p, kTRUE, x, kFALSE,NULL, 0, 0, NULL, 0x0,//primary, kFALSE, // No fit performed @@ -300,7 +294,7 @@ Bool_t AliCaloTrackMCReader::FillInputEvent(const Int_t iEntry, const char * cur fAODCTS->Add(aodTrack);//reference the selected object to the list } //Keep some charged particles in calorimeters lists - if((fFillPHOS || fFillEMCAL) && KeepChargedParticles(pdg)) FillCalorimeters(iParticle, particle, momentum, ncalo); + if((fFillPHOS || fFillEMCAL) && KeepChargedParticles(pdg)) FillCalorimeters(iParticle, particle, momentum); }//Charged @@ -311,7 +305,7 @@ Bool_t AliCaloTrackMCReader::FillInputEvent(const Int_t iEntry, const char * cur if(SkipNeutralParticles(pdg)) continue ; //Fill particle/calocluster arrays if(!fDecayPi0) { - FillCalorimeters(iParticle, particle, momentum, ncalo); + FillCalorimeters(iParticle, particle, momentum); } else { //Sometimes pi0 are stable for the generator, if needed decay it by hand @@ -329,11 +323,11 @@ Bool_t AliCaloTrackMCReader::FillInputEvent(const Int_t iEntry, const char * cur TParticle * pPhoton2 = new TParticle(22,1,iParticle,0,0,0,lvGamma2.Px(),lvGamma2.Py(), lvGamma2.Pz(),lvGamma2.E(),0,0,0,0); //Fill particle/calocluster arrays - FillCalorimeters(iParticle,pPhoton1,lvGamma1, ncalo); - FillCalorimeters(iParticle,pPhoton2,lvGamma2, ncalo); + FillCalorimeters(iParticle,pPhoton1,lvGamma1); + FillCalorimeters(iParticle,pPhoton2,lvGamma2); }//pt cut }//pi0 - else FillCalorimeters(iParticle,particle, momentum, ncalo); //Add the rest + else FillCalorimeters(iParticle,particle, momentum); //Add the rest } }//neutral particles } //particle with correct status @@ -379,6 +373,8 @@ void AliCaloTrackMCReader::Print(const Option_t * opt) const if(! opt) return; + AliCaloTrackReader::Print(opt); + printf("**** Print **** %s %s ****\n", GetName(), GetTitle() ) ; printf("Decay Pi0? : %d\n", fDecayPi0) ; @@ -704,7 +700,7 @@ void AliCaloTrackMCReader::SetTrackChargeAndPID(const Int_t pdgCode, AliAODTrack } //____________________________________________________________________ -void AliCaloTrackMCReader::SetCaloClusterPID(const Int_t pdgCode, AliAODCaloCluster *calo) const { +void AliCaloTrackMCReader::SetCaloClusterPID(const Int_t pdgCode, AliVCluster *calo) const { //Give a PID weight for CaloClusters equal to 1 depending on the particle type Float_t pid[13] = {0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.}; @@ -712,198 +708,198 @@ void AliCaloTrackMCReader::SetCaloClusterPID(const Int_t pdgCode, AliAODCaloClus switch (pdgCode) { case 22: // gamma - pid[AliAODCaloCluster::kPhoton] = 1.; + pid[AliVCluster::kPhoton] = 1.; calo->SetPID(pid); break; case 11: // e- - pid[AliAODCaloCluster::kElectron] = 1.; + pid[AliVCluster::kElectron] = 1.; calo->SetPID(pid); break; case -11: // e+ - pid[AliAODCaloCluster::kElectron] = 1.; + pid[AliVCluster::kElectron] = 1.; calo->SetPID(pid); break; case 13: // mu- - pid[AliAODCaloCluster::kCharged] = 1.; + pid[AliVCluster::kCharged] = 1.; calo->SetPID(pid); break; case -13: // mu+ - pid[AliAODCaloCluster::kCharged] = 1.; + pid[AliVCluster::kCharged] = 1.; calo->SetPID(pid); break; case 111: // pi0 - pid[AliAODCaloCluster::kPi0] = 1.; + pid[AliVCluster::kPi0] = 1.; calo->SetPID(pid); break; case 211: // pi+ - pid[AliAODCaloCluster::kCharged] = 1.; + pid[AliVCluster::kCharged] = 1.; calo->SetPID(pid); break; case -211: // pi- - pid[AliAODCaloCluster::kCharged] = 1.; + pid[AliVCluster::kCharged] = 1.; calo->SetPID(pid); break; case 130: // K0L - pid[AliAODCaloCluster::kKaon0] = 1.; - pid[AliAODCaloCluster::kNeutral] = 1; + pid[AliVCluster::kKaon0] = 1.; + pid[AliVCluster::kNeutral] = 1; calo->SetPID(pid); break; case 321: // K+ - pid[AliAODCaloCluster::kCharged] = 1.; + pid[AliVCluster::kCharged] = 1.; calo->SetPID(pid); break; case -321: // K- - pid[AliAODCaloCluster::kCharged] = 1.; + pid[AliVCluster::kCharged] = 1.; calo->SetPID(pid); break; case 2112: // n - pid[AliAODCaloCluster::kNeutron] = 1.; - pid[AliAODCaloCluster::kNeutral] = 1.; + pid[AliVCluster::kNeutron] = 1.; + pid[AliVCluster::kNeutral] = 1.; calo->SetPID(pid); break; case 2212: // p - pid[AliAODCaloCluster::kCharged] = 1.; + pid[AliVCluster::kCharged] = 1.; calo->SetPID(pid); break; case -2212: // anti-p - pid[AliAODCaloCluster::kCharged] = 1.; + pid[AliVCluster::kCharged] = 1.; calo->SetPID(pid); break; case 310: // K0S - pid[AliAODCaloCluster::kKaon0] = 1.; - pid[AliAODCaloCluster::kNeutral] = 1.; + pid[AliVCluster::kKaon0] = 1.; + pid[AliVCluster::kNeutral] = 1.; calo->SetPID(pid); break; case 311: // K0 - pid[AliAODCaloCluster::kKaon0] = 1.; - pid[AliAODCaloCluster::kNeutral] = 1.; + pid[AliVCluster::kKaon0] = 1.; + pid[AliVCluster::kNeutral] = 1.; calo->SetPID(pid); break; case -311: // anti-K0 - pid[AliAODCaloCluster::kKaon0] = 1.; - pid[AliAODCaloCluster::kNeutral] = 1.; + pid[AliVCluster::kKaon0] = 1.; + pid[AliVCluster::kNeutral] = 1.; calo->SetPID(pid); break; case 221: // eta - pid[AliAODCaloCluster::kNeutral] = 1.; + pid[AliVCluster::kNeutral] = 1.; calo->SetPID(pid); break; case 3122: // lambda - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case 3222: // Sigma+ - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case 3212: // Sigma0 - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case 3112: // Sigma- - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case 3322: // Xi0 - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case 3312: // Xi- - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case 3334: // Omega- - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case -2112: // n-bar - pid[AliAODCaloCluster::kNeutron] = 1.; - pid[AliAODCaloCluster::kNeutral] = 1.; + pid[AliVCluster::kNeutron] = 1.; + pid[AliVCluster::kNeutral] = 1.; calo->SetPID(pid); break; case -3122: // anti-Lambda - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case -3222: // anti-Sigma- - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case -3212: // anti-Sigma0 - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case -3112: // anti-Sigma+ - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case -3322: // anti-Xi0 - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case -3312: // anti-Xi+ - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case -3334: // anti-Omega+ - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case 411: // D+ - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case -411: // D- - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case 421: // D0 - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; case -421: // anti-D0 - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); break; default : // unknown - pid[AliAODCaloCluster::kUnknown] = 1.; + pid[AliVCluster::kUnknown] = 1.; calo->SetPID(pid); } diff --git a/PWG4/PartCorrBase/AliCaloTrackMCReader.h b/PWG4/PartCorrBase/AliCaloTrackMCReader.h index 4a418b5c3e5..14964644166 100755 --- a/PWG4/PartCorrBase/AliCaloTrackMCReader.h +++ b/PWG4/PartCorrBase/AliCaloTrackMCReader.h @@ -21,7 +21,7 @@ class TParticle ; // --- AliRoot system --- #include "AliCaloTrackReader.h" -class AliAODCaloCluster ; +class AliVCluster ; class AliAODTrack ; class AliAODEvent ; class AliMCEvent ; @@ -69,7 +69,7 @@ public: AliVEvent* GetInputEvent() const {return (AliVEvent *) GetMC();} void SetInputOutputMCEvent(AliVEvent* esd, AliAODEvent* aod, AliMCEvent* mc) ; - void SetCaloClusterPID(const Int_t pdgCode, AliAODCaloCluster *calo) const ; + void SetCaloClusterPID(const Int_t pdgCode, AliVCluster *calo) const ; void SetTrackChargeAndPID(const Int_t pdgCode, AliAODTrack *track) const ; void SwitchOnOverlapCheck() {fCheckOverlap = kTRUE;} @@ -84,8 +84,7 @@ public: void CheckOverlap(const Float_t anglethres, const Int_t imom, Int_t & iPrimary, Int_t & index, TLorentzVector & mom, Int_t & pdg); void MakePi0Decay(TLorentzVector &p0, TLorentzVector &p1, TLorentzVector &p2) const ;//, Double_t &angle); - void FillCalorimeters(Int_t & iParticle, TParticle* particle, TLorentzVector momentum, - Int_t &naod) ; + void FillCalorimeters(Int_t & iParticle, TParticle* particle, TLorentzVector momentum) ; private: Bool_t fDecayPi0 ; // If not decayed, decay pi0 by hand diff --git a/PWG4/PartCorrBase/AliCaloTrackReader.cxx b/PWG4/PartCorrBase/AliCaloTrackReader.cxx index 7fbc14f4a6b..3a610c3492f 100755 --- a/PWG4/PartCorrBase/AliCaloTrackReader.cxx +++ b/PWG4/PartCorrBase/AliCaloTrackReader.cxx @@ -42,6 +42,7 @@ #include "AliVTrack.h" #include "AliVParticle.h" #include "AliMixedEvent.h" +#include "AliESDtrack.h" ClassImp(AliCaloTrackReader) @@ -399,6 +400,11 @@ void AliCaloTrackReader::InitParameters() fFiredTriggerClassName = ""; fAnaLED = kFALSE; + + //We want tracks fitted in the detectors: + fTrackStatus=AliESDtrack::kTPCrefit; + fTrackStatus|=AliESDtrack::kITSrefit; + } //________________________________________________________________ diff --git a/PWG4/PartCorrBase/AliCaloTrackReader.h b/PWG4/PartCorrBase/AliCaloTrackReader.h index 59288a3995a..da564d855f8 100755 --- a/PWG4/PartCorrBase/AliCaloTrackReader.h +++ b/PWG4/PartCorrBase/AliCaloTrackReader.h @@ -202,6 +202,24 @@ public: void SwitchOffWriteDeltaAOD() {fWriteOutputDeltaAOD = kFALSE ; } Bool_t WriteDeltaAODToFile() const {return fWriteOutputDeltaAOD ; } + + //MC reader methods: + + virtual void AddNeutralParticlesArray(TArrayI & /*array*/) { ; } + virtual void AddChargedParticlesArray(TArrayI & /*array*/) { ; } + virtual void AddStatusArray(TArrayI & /*array*/) { ; } + + virtual void SwitchOnPi0Decay() { ; } + virtual void SwitchOffPi0Decay() { ; } + virtual void SwitchOnStatusSelection() { ; } + virtual void SwitchOffStatusSelection() { ; } + virtual void SwitchOnOverlapCheck() { ; } + virtual void SwitchOffOverlapCheck() { ; } + + virtual void SetEMCALOverlapAngle(Float_t /*angle*/) { ; } + virtual void SetPHOSOverlapAngle(Float_t /*angle*/) { ; } + + protected: Int_t fEventNumber; // Event number TString fCurrentFileName;// Current file name under analysis diff --git a/PWG4/PartCorrBase/AliIsolationCut.cxx b/PWG4/PartCorrBase/AliIsolationCut.cxx index 0e57cbbedd7..6efed3e5f37 100755 --- a/PWG4/PartCorrBase/AliIsolationCut.cxx +++ b/PWG4/PartCorrBase/AliIsolationCut.cxx @@ -34,7 +34,7 @@ #include "AliIsolationCut.h" #include "AliAODPWG4ParticleCorrelation.h" #include "AliAODTrack.h" -#include "AliAODCaloCluster.h" +#include "AliVCluster.h" #include "AliCaloTrackReader.h" ClassImp(AliIsolationCut) @@ -188,7 +188,7 @@ void AliIsolationCut::MakeIsolationCut(TObjArray * const plCTS, TObjArray * co } TLorentzVector mom ; for(Int_t ipr = 0;ipr < plNe->GetEntries() ; ipr ++ ){ - AliAODCaloCluster * calo = (AliAODCaloCluster *)(plNe->At(ipr)) ; + AliVCluster * calo = (AliVCluster *)(plNe->At(ipr)) ; //Do not count the candidate (photon or pi0) or the daughters of the candidate if(calo->GetID() == pCandidate->GetCaloLabel(0) || calo->GetID() == pCandidate->GetCaloLabel(1)) continue ; //Skip matched clusters with tracks diff --git a/PWG4/PartCorrDep/AliAnaBtag.cxx b/PWG4/PartCorrDep/AliAnaBtag.cxx index d750e9ee3a6..1bcfa107706 100644 --- a/PWG4/PartCorrDep/AliAnaBtag.cxx +++ b/PWG4/PartCorrDep/AliAnaBtag.cxx @@ -35,7 +35,7 @@ #include "AliAnaBtag.h" #include "AliCaloTrackReader.h" #include "AliMCAnalysisUtils.h" -#include "AliAODCaloCluster.h" +#include "AliVCluster.h" #include "AliFiducialCut.h" #include "AliAODTrack.h" #include "AliAODPid.h" @@ -214,7 +214,7 @@ void AliAnaBtag::MakeAnalysisFillAOD() //CLUSTER STUFF if(1){ for(Int_t iclus = 0; iclus < ntot; iclus++) { - AliAODCaloCluster * clus = (AliAODCaloCluster*) (cl->At(iclus)); + AliVCluster * clus = (AliVCluster*) (cl->At(iclus)); if(!clus) continue; fhClusterEnergy->Fill(clus->E()); } @@ -281,7 +281,7 @@ void AliAnaBtag::MakeAnalysisFillAOD() Double_t minPt = -1; for(Int_t iclus = 0; iclus < ntot; iclus++) { - AliAODCaloCluster * clus = (AliAODCaloCluster*) (cl->At(iclus)); + AliVCluster * clus = (AliVCluster*) (cl->At(iclus)); if(!clus) continue; //As of 11-Oct-2009 @@ -418,89 +418,89 @@ void AliAnaBtag::MakeAnalysisFillAOD() void AliAnaBtag::MakeAnalysisFillHistograms() { //Do analysis and fill histograms - + AliStack * stack = 0x0; -// TParticle * primary = 0x0; - - - - + // TParticle * primary = 0x0; + + + + if(IsDataMC()) { if(GetReader()->ReadStack()){ stack = GetMCStack() ; if(!stack) - printf("AliAnaBtag::MakeAnalysisFillHistograms() *** no stack ***: \n"); + printf("AliAnaBtag::MakeAnalysisFillHistograms() *** no stack ***: \n"); } }// is data and MC - + //////////////////////////////////// //Loop over jets and check for b-tag //////////////////////////////////// double maxjetEta=-4.; double maxjetPhi=-4.; - - Int_t njets = (GetReader()->GetOutputEvent())->GetNJets(); + + Int_t njets = 0; + if(GetReader()->GetOutputEvent()) njets = (GetReader()->GetOutputEvent())->GetNJets(); if(njets > 0) { if(GetDebug() > 0) printf("AliAnaBtag::MakeAnalysisFillHistograms() - Jet AOD branch has %d jets. Performing b-jet tag analysis\n",njets); - + for(Int_t ijet = 0; ijet < njets ; ijet++) { AliAODJet * jet = (AliAODJet*)(GetReader()->GetOutputEvent())->GetJet(ijet) ; - + if(ijet==0){ maxjetEta=jet->Eta(); maxjetPhi=jet->Phi(); } - + fhJets->Fill(jet->Pt(),1); fhJetsAllEtaPhi->Fill(jet->Eta(),jet->Phi()); - + if(jet->Pt() < 0.) continue; //This has to be adjusted depending on pp or AA! fhJets->Fill(jet->Pt(),3); //All jets after pt cut - + //Geometric EMCAL cut if(TMath::Abs(jet->Eta()) > fJetEtaCut) continue; if(jet->Phi() < fJetPhiMin || jet->Phi() > fJetPhiMax) continue; fhJets->Fill(jet->Pt(),4); //All jets after geometric cut - + Bool_t leadJet = kFALSE; if (ijet==0){ - fhJets->Fill(jet->Pt(),5); //Leading jets - leadJet= kTRUE; + fhJets->Fill(jet->Pt(),5); //Leading jets + leadJet= kTRUE; } - - + + Bool_t dvmJet = kFALSE; TRefArray* rt = jet->GetRefTracks(); Int_t ntrk = rt->GetEntries(); - + for(Int_t itrk = 0; itrk < ntrk; itrk++) { AliAODTrack* jetTrack = (AliAODTrack*)jet->GetTrack(itrk); - Bool_t isDVM = CheckIfBjet(jetTrack); - if(isDVM) dvmJet = kTRUE; + Bool_t isDVM = CheckIfBjet(jetTrack); + if(isDVM) dvmJet = kTRUE; } - + if(dvmJet) - fhJets->Fill(jet->Pt(),6); - - - + fhJets->Fill(jet->Pt(),6); + + if(IsDataMC()) { - //determine tagging efficiency & mis-tagging rate - //using b-quarks from stack - Bool_t isTrueBjet = IsMcBJet(jet->Eta(), jet->Phi()); - Bool_t isTrueDjet = IsMcDJet(jet->Eta(), jet->Phi()); - if (isTrueBjet && GetDebug() > 0) printf("== True Bjet==\n"); - if (isTrueDjet && GetDebug() > 0) printf("== True Charm-jet==\n"); - if (dvmJet && GetDebug() > 0) printf("== found DVM jet==\n"); + //determine tagging efficiency & mis-tagging rate + //using b-quarks from stack + Bool_t isTrueBjet = IsMcBJet(jet->Eta(), jet->Phi()); + Bool_t isTrueDjet = IsMcDJet(jet->Eta(), jet->Phi()); + if (isTrueBjet && GetDebug() > 0) printf("== True Bjet==\n"); + if (isTrueDjet && GetDebug() > 0) printf("== True Charm-jet==\n"); + if (dvmJet && GetDebug() > 0) printf("== found DVM jet==\n"); } - + } //jet loop } //jets exist - - - + + + //Electron loop, read back electrons, fill histos Int_t naod = GetOutputAODBranch()->GetEntriesFast(); if(GetDebug() > 0) printf("AliAnaBtag::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod); @@ -508,25 +508,25 @@ void AliAnaBtag::MakeAnalysisFillHistograms() for(Int_t iaod = 0; iaod < naod ; iaod++){ AliAODPWG4Particle* ele = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod)); Int_t pdg = ele->GetPdg(); - - + + if(TMath::Abs(pdg) != AliCaloPID::kElectron) continue; //not necessary.. - + //MC tag of this electron // Int_t mctag = ele->GetTag(); - - + + fhElectrons->Fill(ele->Pt(),1); //All electrons Bool_t photonic = kFALSE; photonic = PhotonicV0(ele->GetTrackLabel(0)); //check against V0s if(!photonic) fhElectrons->Fill(ele->Pt(),3); //nonphotonic electrons if(photonic) fhElectrons->Fill(ele->Pt(),4); //photonic electrons - + //Fill electron histograms Float_t phiele = ele->Phi(); Float_t etaele = ele->Eta(); - - + + if(ele->GetBtag()>0){ // removed bit tag shit fhElectrons->Fill(ele->Pt(),5); if(!photonic) fhElectrons->Fill(ele->Pt(),6); @@ -541,7 +541,7 @@ void AliAnaBtag::MakeAnalysisFillHistograms() } }//electron aod loop - + } //__________________________________________________________________ diff --git a/PWG4/PartCorrDep/AliAnaElectron.cxx b/PWG4/PartCorrDep/AliAnaElectron.cxx index ad4cfacf701..d0ad62b2408 100755 --- a/PWG4/PartCorrDep/AliAnaElectron.cxx +++ b/PWG4/PartCorrDep/AliAnaElectron.cxx @@ -36,7 +36,7 @@ #include "AliAnaElectron.h" #include "AliCaloTrackReader.h" #include "AliMCAnalysisUtils.h" -#include "AliAODCaloCluster.h" +#include "AliVCluster.h" #include "AliFiducialCut.h" #include "AliAODTrack.h" #include "AliAODPid.h" @@ -783,7 +783,7 @@ void AliAnaElectron::MakeAnalysisFillAOD() Double_t minPt = -1; for(Int_t iclus = 0; iclus < ntot; iclus++) { - AliAODCaloCluster * clus = (AliAODCaloCluster*) (cl->At(iclus)); + AliVCluster * clus = (AliVCluster*) (cl->At(iclus)); if(!clus) continue; //As of 11-Oct-2009 diff --git a/PWG4/PartCorrDep/AliAnaExample.cxx b/PWG4/PartCorrDep/AliAnaExample.cxx index 9229707c714..8336a624938 100755 --- a/PWG4/PartCorrDep/AliAnaExample.cxx +++ b/PWG4/PartCorrDep/AliAnaExample.cxx @@ -157,7 +157,7 @@ void AliAnaExample::MakeAnalysisFillAOD() if(!partList || partList->GetEntriesFast() == 0) return ; - //Fill AODCaloClusters and AODParticle with PHOS/EMCAL aods + //Fill AODParticle with PHOS/EMCAL aods if(fDetector == "EMCAL" || fDetector == "PHOS"){ //Get vertex for photon momentum calculation @@ -223,7 +223,6 @@ void AliAnaExample::MakeAnalysisFillAOD() if(GetDebug() > 0) { if(fDetector!="CTS" && GetReader()->GetDataType()!= AliCaloTrackReader::kMC) - //printf("Example: final aod calocluster entries %d\n", GetAODCaloClusters()->GetEntriesFast()); printf("AliAnaExample::MakeAnalysisFillAOD() - Final aod branch entries %d\n", GetOutputAODBranch()->GetEntriesFast()); // if(fDetector!="CTS" && GetReader()->GetDataType()!= AliCaloTrackReader::kMC) //printf("Example: final aod cell entries %d\n", GetAODCaloCells()->GetNumberOfCells()); diff --git a/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.cxx b/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.cxx index e7d2d041a51..5cca75028b3 100755 --- a/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.cxx +++ b/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.cxx @@ -40,7 +40,7 @@ #include "AliAODPWG4ParticleCorrelation.h" #include "AliFiducialCut.h" #include "AliAODTrack.h" -#include "AliAODCaloCluster.h" +#include "AliVCluster.h" #include "AliMCAnalysisUtils.h" #include "TParticle.h" #include "AliStack.h" @@ -817,7 +817,7 @@ void AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD(AliAODPWG4P //Int_t iEvent= GetReader()->GetEventNumber() ; Int_t nclus = pl->GetEntriesFast(); for(Int_t iclus = 0;iclus < nclus ; iclus ++ ){ - AliAODCaloCluster * calo = (AliAODCaloCluster *) (pl->At(iclus)) ; + AliVCluster * calo = (AliVCluster *) (pl->At(iclus)) ; Int_t evtIndex1 = 0 ; if (GetMixedEvent()) { @@ -879,7 +879,7 @@ void AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD(AliAODPWG4P //Search the photon companion in case it comes from a Pi0 decay //Apply several cuts to select the good pair; for(Int_t jclus = iclus+1; jclus < pl->GetEntries() ; jclus ++ ){ - AliAODCaloCluster * calo2 = (AliAODCaloCluster *) (pl->At(jclus)) ; + AliVCluster * calo2 = (AliVCluster *) (pl->At(jclus)) ; Int_t evtIndex2 = 0 ; if (GetMixedEvent()) { evtIndex2=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ; @@ -1072,7 +1072,7 @@ void AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms(AliA //____________________________________________________________________________ -Bool_t AliAnaParticleHadronCorrelation::SelectCluster(AliAODCaloCluster * calo, Double_t *vertex, TLorentzVector & mom, Int_t & pdg) { +Bool_t AliAnaParticleHadronCorrelation::SelectCluster(AliVCluster * calo, Double_t *vertex, TLorentzVector & mom, Int_t & pdg) { //Select cluster depending on its pid and acceptance selections //Skip matched clusters with tracks diff --git a/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.h b/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.h index 02645dc136e..941a9a62bf0 100755 --- a/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.h +++ b/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.h @@ -61,7 +61,7 @@ class AliAnaParticleHadronCorrelation : public AliAnaPartCorrBaseClass { void MakeAnalysisFillAOD() ; void MakeAnalysisFillHistograms() ; - Bool_t SelectCluster(AliAODCaloCluster * calo, Double_t *vertex, TLorentzVector & mom, Int_t & pdg) ; + Bool_t SelectCluster(AliVCluster * calo, Double_t *vertex, TLorentzVector & mom, Int_t & pdg) ; private: diff --git a/PWG4/PartCorrDep/AliAnaParticleIsolation.cxx b/PWG4/PartCorrDep/AliAnaParticleIsolation.cxx index a065f62f337..adce75d7f62 100755 --- a/PWG4/PartCorrDep/AliAnaParticleIsolation.cxx +++ b/PWG4/PartCorrDep/AliAnaParticleIsolation.cxx @@ -41,7 +41,7 @@ #include "AliAODPWG4ParticleCorrelation.h" #include "AliMCAnalysisUtils.h" #include "AliAODTrack.h" -#include "AliAODCaloCluster.h" +#include "AliVCluster.h" ClassImp(AliAnaParticleIsolation) @@ -796,7 +796,7 @@ void AliAnaParticleIsolation::MakeAnalysisFillHistograms() if(refclusters){ TLorentzVector mom ; for(Int_t icalo=0; icalo < refclusters->GetEntriesFast(); icalo++){ - AliAODCaloCluster* calo = (AliAODCaloCluster *) refclusters->At(icalo); + AliVCluster* calo = (AliVCluster *) refclusters->At(icalo); Int_t input = 0; // if (fCalorimeter == "EMCAL" && GetReader()->GetAODEMCALNormalInputEntries() <= icalo) input = 1 ; // else if(fCalorimeter == "PHOS" && GetReader()->GetAODPHOSNormalInputEntries() <= icalo) input = 1; diff --git a/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.cxx b/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.cxx index a969f359707..4c8d64e0e7a 100755 --- a/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.cxx +++ b/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.cxx @@ -36,7 +36,7 @@ //---- Analysis system ---- #include "AliAODTrack.h" -#include "AliAODCaloCluster.h" +#include "AliVCluster.h" #include "AliCaloTrackReader.h" #include "AliNeutralMesonSelection.h" #include "AliAnaParticleJetLeadingConeCorrelation.h" @@ -44,7 +44,6 @@ #include "AliAODPWG4ParticleCorrelation.h" #include "AliFiducialCut.h" #include "AliAODTrack.h" -#include "AliAODCaloCluster.h" ClassImp(AliAnaParticleJetLeadingConeCorrelation) @@ -953,7 +952,7 @@ void AliAnaParticleJetLeadingConeCorrelation::GetLeadingPi0(AliAODPWG4ParticleC //Cluster loop, select pairs with good pt, phi and fill AODs or histograms for(Int_t iclus = 0;iclus < GetAODEMCAL()->GetEntriesFast() ; iclus ++ ){ - AliAODCaloCluster * calo = (AliAODCaloCluster *)(GetAODEMCAL()->At(iclus)) ; + AliVCluster * calo = (AliVCluster *)(GetAODEMCAL()->At(iclus)) ; //Input from second AOD? Int_t inputi = 0; @@ -993,7 +992,7 @@ void AliAnaParticleJetLeadingConeCorrelation::GetLeadingPi0(AliAODPWG4ParticleC //Search the photon companion in case it comes from a Pi0 decay //Apply several cuts to select the good pair for(Int_t jclus = iclus+1; jclus < GetAODEMCAL()->GetEntriesFast() ; jclus ++ ){ - AliAODCaloCluster * calo2 = (AliAODCaloCluster *) (GetAODEMCAL()->At(jclus)) ; + AliVCluster * calo2 = (AliVCluster *) (GetAODEMCAL()->At(jclus)) ; //Input from second AOD? Int_t inputj = 0; @@ -1502,7 +1501,7 @@ void AliAnaParticleJetLeadingConeCorrelation::MakeAODJet(AliAODPWG4ParticleCorre } for(Int_t iclus = 0;iclus < (GetAODEMCAL())->GetEntriesFast() ; iclus ++ ){ - AliAODCaloCluster * calo = (AliAODCaloCluster *) (GetAODEMCAL()->At(iclus)) ; + AliVCluster * calo = (AliVCluster *) (GetAODEMCAL()->At(iclus)) ; //Cluster selection, not charged if(IsTrackMatched(calo)) continue ; @@ -1622,7 +1621,7 @@ void AliAnaParticleJetLeadingConeCorrelation::MakeJetFromAOD(AliAODPWG4ParticleC //Loop on jet particles if(refclusters){ for(Int_t iclus = 0;iclus < refclusters->GetEntriesFast() ; iclus ++ ){ - AliAODCaloCluster * calo = (AliAODCaloCluster *) refclusters->At(iclus) ; + AliVCluster * calo = (AliVCluster *) refclusters->At(iclus) ; //Input from second AOD? Int_t input = 0; @@ -1640,7 +1639,7 @@ void AliAnaParticleJetLeadingConeCorrelation::MakeJetFromAOD(AliAODPWG4ParticleC //Loop on background particles if(refclustersbkg){ for(Int_t iclus = 0;iclus < refclustersbkg->GetEntriesFast() ; iclus ++ ){ - AliAODCaloCluster * calo = (AliAODCaloCluster *) refclustersbkg->At(iclus) ; + AliVCluster * calo = (AliVCluster *) refclustersbkg->At(iclus) ; //Input from second AOD? Int_t input = 0; @@ -1668,7 +1667,7 @@ void AliAnaParticleJetLeadingConeCorrelation::MakeJetFromAOD(AliAODPWG4ParticleC } //____________________________________________________________________________ -Bool_t AliAnaParticleJetLeadingConeCorrelation::SelectCluster(AliAODCaloCluster * calo, Double_t *vertex, TLorentzVector & mom, Int_t & pdg) { +Bool_t AliAnaParticleJetLeadingConeCorrelation::SelectCluster(AliVCluster * calo, Double_t *vertex, TLorentzVector & mom, Int_t & pdg) { //Select cluster depending on its pid and acceptance selections //Skip matched clusters with tracks diff --git a/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.h b/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.h index aa113e9519e..583664c6366 100755 --- a/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.h +++ b/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.h @@ -21,7 +21,7 @@ class TH2F; //---- Analysis system ---- class AliAODTrack; -class AliAODCaloCluster; +class AliVCluster; class AliCaloTrackReader; class AliNeutralMesonSelection; @@ -125,7 +125,7 @@ public: void MakeJetFromAOD(AliAODPWG4ParticleCorrelation * particle, const TLorentzVector pLeading, TLorentzVector & jet, TLorentzVector & bkg) const ; - Bool_t SelectCluster(AliAODCaloCluster * calo, Double_t *vertex, TLorentzVector & mom, Int_t & pdg) ; + Bool_t SelectCluster(AliVCluster * calo, Double_t *vertex, TLorentzVector & mom, Int_t & pdg) ; private: diff --git a/PWG4/PartCorrDep/AliAnaPhoton.cxx b/PWG4/PartCorrDep/AliAnaPhoton.cxx index a965348c253..baee29296a0 100755 --- a/PWG4/PartCorrDep/AliAnaPhoton.cxx +++ b/PWG4/PartCorrDep/AliAnaPhoton.cxx @@ -38,7 +38,7 @@ #include "AliCaloPID.h" #include "AliMCAnalysisUtils.h" #include "AliFiducialCut.h" -#include "AliAODCaloCluster.h" +#include "AliVCluster.h" #include "AliAODMCParticle.h" #include "AliMixedEvent.h" @@ -49,12 +49,12 @@ ClassImp(AliAnaPhoton) AliAnaPhoton::AliAnaPhoton() : AliAnaPartCorrBaseClass(), fCalorimeter(""), fMinDist(0.),fMinDist2(0.),fMinDist3(0.),fRejectTrackMatch(0), - fCheckConversion(kFALSE),fAddConvertedPairsToAOD(kFALSE), fMassCut(0), + fCheckConversion(kFALSE),fAddConvertedPairsToAOD(kFALSE), fMassCut(0), fTimeCutMin(-1), fTimeCutMax(9999999), fNCellsCut(0), - fhPtPhoton(0),fhPhiPhoton(0),fhEtaPhoton(0), + fhPtPhoton(0),fhPhiPhoton(0),fhEtaPhoton(0), //MC fhDeltaE(0), fhDeltaPt(0),fhRatioE(0), fhRatioPt(0),fh2E(0),fh2Pt(0), - fhPtMCPhoton(0),fhPhiMCPhoton(0),fhEtaMCPhoton(0), + fhPtMCPhoton(0),fhPhiMCPhoton(0),fhEtaMCPhoton(0), fhPtPrompt(0),fhPhiPrompt(0),fhEtaPrompt(0), fhPtFragmentation(0),fhPhiFragmentation(0),fhEtaFragmentation(0), fhPtISR(0),fhPhiISR(0),fhEtaISR(0), @@ -473,18 +473,20 @@ void AliAnaPhoton::MakeAnalysisFillAOD() pl = GetAODPHOS(); else if (fCalorimeter == "EMCAL") pl = GetAODEMCAL(); - - //Fill AODCaloClusters and AODParticle with PHOS/EMCAL aods + + + //Fill AODParticle with PHOS/EMCAL aods TLorentzVector mom, mom2 ; Int_t nCaloClusters = pl->GetEntriesFast(); + if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillAOD() - input %s cluster entries %d\n", fCalorimeter.Data(), nCaloClusters); Bool_t * indexConverted = new Bool_t[nCaloClusters]; for (Int_t i = 0; i < nCaloClusters; i++) indexConverted[i] = kFALSE; for(Int_t icalo = 0; icalo < nCaloClusters; icalo++){ - AliAODCaloCluster * calo = (AliAODCaloCluster*) (pl->At(icalo)); - + AliVCluster * calo = (AliVCluster*) (pl->At(icalo)); + //printf("calo %d, %f\n",icalo,calo->E()); Int_t evtIndex = 0 ; if (GetMixedEvent()) { evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ; @@ -510,15 +512,17 @@ void AliAnaPhoton::MakeAnalysisFillAOD() if(tof < fTimeCutMin || tof > fTimeCutMax) continue; - if(calo->GetNCells() <= fNCellsCut) continue; + if(calo->GetNCells() <= fNCellsCut && GetReader()->GetDataType() != AliCaloTrackReader::kMC) continue; - //printf("AliAnaPhoton::Current Event %d; Current File Name : %s, E %f, pT %f, Ecl %f\n",GetReader()->GetEventNumber(),(GetReader()->GetCurrentFileName()).Data(), mom.E(), mom.Pt(),calo->E()); + //printf("AliAnaPhoton::Current Event %d; Current File Name : %s, E %2.2f, pT %2.2f, Ecl %2.2f, phi %2.2f, eta %2.2f\n",GetReader()->GetEventNumber(),(GetReader()->GetCurrentFileName()).Data(), + // mom.E(), mom.Pt(),calo->E(),mom.Phi()*TMath::RadToDeg(),mom.Eta()); //Check acceptance selection if(IsFiducialCutOn()){ Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ; if(! in ) continue ; } + //printf("Fiducial cut passed \n"); //Create AOD for analysis AliAODPWG4Particle aodph = AliAODPWG4Particle(mom); @@ -605,7 +609,7 @@ void AliAnaPhoton::MakeAnalysisFillAOD() //Check if set previously as converted couple, if so skip its use. if (indexConverted[jcalo]) continue; //printf("Check Conversion indeces %d and %d\n",icalo,jcalo); - AliAODCaloCluster * calo2 = (AliAODCaloCluster*) (pl->At(jcalo)); //Get cluster kinematics + AliVCluster * calo2 = (AliVCluster*) (pl->At(jcalo)); //Get cluster kinematics Int_t evtIndex2 = 0 ; if (GetMixedEvent()) { evtIndex2=GetMixedEvent()->EventIndexForCaloCluster(calo2->GetID()) ; diff --git a/PWG4/PartCorrDep/AliAnaPhoton.h b/PWG4/PartCorrDep/AliAnaPhoton.h index e2c71cc07d2..19d88f4b62a 100755 --- a/PWG4/PartCorrDep/AliAnaPhoton.h +++ b/PWG4/PartCorrDep/AliAnaPhoton.h @@ -21,8 +21,6 @@ class TObjString; // --- ANALYSIS system --- #include "AliAnaPartCorrBaseClass.h" -//#include "AliStack.h" -//#include "TParticle.h" class AliStack; class TParticle; diff --git a/PWG4/PartCorrDep/AliAnaPi0.cxx b/PWG4/PartCorrDep/AliAnaPi0.cxx index bbd5dcf2550..ec3a93c3628 100755 --- a/PWG4/PartCorrDep/AliAnaPi0.cxx +++ b/PWG4/PartCorrDep/AliAnaPi0.cxx @@ -41,7 +41,6 @@ #include "AliStack.h" #include "AliFiducialCut.h" #include "TParticle.h" -#include "AliAODCaloCluster.h" #include "AliVEvent.h" #include "AliESDCaloCluster.h" #include "AliESDEvent.h" @@ -317,7 +316,7 @@ TList * AliAnaPi0::GetCreateOutputObjects() //Histograms filled only if MC data is requested - if(IsDataMC() || (GetReader()->GetDataType() == AliCaloTrackReader::kMC) ){ + if(IsDataMC()){ // if(fhEtalon->GetXaxis()->GetXbins() && fhEtalon->GetXaxis()->GetXbins()->GetSize()){ //Variable bin size // fhPrimPt = new TH1D("hPrimPt","Primary pi0 pt",fhEtalon->GetXaxis()->GetNbins(),fhEtalon->GetXaxis()->GetXbins()->GetArray()) ; // fhPrimAccPt = new TH1D("hPrimAccPt","Primary pi0 pt with both photons in acceptance",fhEtalon->GetXaxis()->GetNbins(), @@ -552,6 +551,8 @@ void AliAnaPi0::MakeAnalysisFillHistograms() }// DoOwnMix //Acceptance + printf("Fill acceptance histograms? %d, %d\n", IsDataMC(), GetReader()->ReadStack()); + if(IsDataMC() && GetReader()->ReadStack()){ AliStack * stack = GetMCStack(); if(stack && (IsDataMC() || (GetReader()->GetDataType() == AliCaloTrackReader::kMC)) ){ @@ -809,7 +810,7 @@ Int_t AliAnaPi0::GetEventIndex(AliAODPWG4Particle * part, Double_t * vert) GetMixedEvent()->GetVertexOfEvent(rv)->GetXYZ(vert); if(vert[2] < -fZvtxCut || vert[2] > fZvtxCut) rv = -2 ; //Event can not be used (vertex, centrality,... cuts not fulfilled) - } else { + } else if(GetReader()->GetDataType()!=AliCaloTrackReader::kMC){ Double_t * tempo = GetReader()->GetVertex() ; vert[0] = tempo[0] ; vert[1] = tempo[1] ; @@ -818,6 +819,8 @@ Int_t AliAnaPi0::GetEventIndex(AliAODPWG4Particle * part, Double_t * vert) rv = -1 ; //Event can not be used (vertex, centrality,... cuts not fulfilled) else rv = 0 ; - } + }//No MC reader + else rv = 0; + return rv ; } diff --git a/PWG4/PartCorrDep/AliAnaPi0EbE.cxx b/PWG4/PartCorrDep/AliAnaPi0EbE.cxx index e093d3f4d96..c88ac03d30e 100755 --- a/PWG4/PartCorrDep/AliAnaPi0EbE.cxx +++ b/PWG4/PartCorrDep/AliAnaPi0EbE.cxx @@ -42,7 +42,7 @@ #include "AliStack.h" #include "AliFiducialCut.h" #include "TParticle.h" -#include "AliAODCaloCluster.h" +#include "AliVCluster.h" #include "AliAODEvent.h" #include "AliAODMCParticle.h" @@ -479,10 +479,10 @@ void AliAnaPi0EbE::MakeShowerShapeIdentification() pl = GetAODPHOS(); else if (fCalorimeter == "EMCAL") pl = GetAODEMCAL(); - //Fill AODCaloClusters and AODParticle with PHOS aods + TLorentzVector mom ; for(Int_t icalo = 0; icalo < pl->GetEntriesFast(); icalo++){ - AliAODCaloCluster * calo = (AliAODCaloCluster*) (pl->At(icalo)); + AliVCluster * calo = (AliVCluster*) (pl->At(icalo)); //Cluster selection, not charged, with pi0 id and in fiducial cut diff --git a/PWG4/macros/AddTaskPartCorr.C b/PWG4/macros/AddTaskPartCorr.C index a88ed8c64d4..adaf552ce87 100644 --- a/PWG4/macros/AddTaskPartCorr.C +++ b/PWG4/macros/AddTaskPartCorr.C @@ -136,7 +136,7 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori else {//EMCAL //anaphoton->SetNCellCut(0);// At least 2 cells anaphoton->SetMinPt(0.1); // no effect minium EMCAL cut. - if(kUseKinematics) anaphoton->SetTimeCut(525,725);// Time window of [550-750] ns + if(!kUseKinematics) anaphoton->SetTimeCut(400,900);// Time window of [400-900] ns anaphoton->SetMinDistanceToBadChannel(6, 12, 18); } anaphoton->SetCalorimeter(calorimeter); @@ -191,7 +191,8 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori anapi0->SetNZvertBin(1); anapi0->SetNRPBin(1); anapi0->SetNMaxEvMix(10); - anapi0->SwitchOffDataMC() ;//Access MC stack and fill more histograms + if(kUseKinematics)anapi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms + else anapi0->SwitchOffDataMC() ; if(calorimeter=="PHOS") anapi0->SetNumberOfModules(3); //PHOS first year else anapi0->SetNumberOfModules(4); //EMCAL first year anapi0->SetHistoPtRangeAndNBins(0, 50, 200) ; diff --git a/PWG4/macros/QA/AddTaskCalorimeterQA.C b/PWG4/macros/QA/AddTaskCalorimeterQA.C index 6b58ae7b35d..97580d50443 100644 --- a/PWG4/macros/QA/AddTaskCalorimeterQA.C +++ b/PWG4/macros/QA/AddTaskCalorimeterQA.C @@ -115,7 +115,7 @@ AliAnalysisTaskParticleCorrelation *AddTaskCalorimeterQA(TString data, Bool_t kP emcalQA->SwitchOffFiducialCut(); emcalQA->SwitchOffPlotsMaking(); emcalQA->SwitchOnCalorimetersCorrelation(); - if(kUseKinematics)emcalQA->SetTimeCut(420,825);//Open for the moment + if(!kUseKinematics)emcalQA->SetTimeCut(400,850);//Open for the moment //Set Histrograms bins and ranges emcalQA->SetHistoPtRangeAndNBins(0, 5, 50) ; emcalQA->SetHistoFinePtRangeAndNBins(0, 5, 1000) ; // bining for fhAmpId