X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=PWG4%2FAliAnaCaloTrigger.cxx;fp=PWG4%2FAliTriggerPHOS.cxx;h=df93e60fcf1b3c15cbae2597d6a72a8729a9f119;hp=c5339f04b37ba133666df8b414846c1f010d84f5;hb=f3299f82b958b69e5249bc864f30fc995bbe6ec5;hpb=05d1294c9062ba4a5ca14f0d795cb09aa21b63d8 diff --git a/PWG4/AliTriggerPHOS.cxx b/PWG4/AliAnaCaloTrigger.cxx similarity index 73% rename from PWG4/AliTriggerPHOS.cxx rename to PWG4/AliAnaCaloTrigger.cxx index c5339f04b37..df93e60fcf1 100644 --- a/PWG4/AliTriggerPHOS.cxx +++ b/PWG4/AliAnaCaloTrigger.cxx @@ -14,9 +14,9 @@ **************************************************************************/ //_________________________________________________________________________ -// An analysis task to check the PHOS photon data in simulated data +// An analysis task to check the PHOS/EMCAL simulated trigger // -//*-- Yves Schutz +//*-- Yves Schutz & Gustavo Conesa Balbastre ////////////////////////////////////////////////////////////////////////////// #include @@ -24,16 +24,17 @@ #include #include -#include "AliTriggerPHOS.h" +#include "AliAnaCaloTrigger.h" #include "AliESD.h" #include "AliLog.h" //______________________________________________________________________________ -AliTriggerPHOS::AliTriggerPHOS(const char *name) : +AliAnaCaloTrigger::AliAnaCaloTrigger(const char *name) : AliAnalysisTask(name,""), fChain(0), fESD(0), fOutputContainer(0), + fCalorimeter("PHOS"), fNtTrigger22(0), fNtTriggerNN(0) @@ -46,7 +47,7 @@ AliTriggerPHOS::AliTriggerPHOS(const char *name) : } //______________________________________________________________________________ -AliTriggerPHOS::~AliTriggerPHOS() +AliAnaCaloTrigger::~AliAnaCaloTrigger() { // dtor fOutputContainer->Clear() ; @@ -57,7 +58,7 @@ AliTriggerPHOS::~AliTriggerPHOS() //______________________________________________________________________________ -void AliTriggerPHOS::ConnectInputData(const Option_t*) +void AliAnaCaloTrigger::ConnectInputData(const Option_t*) { // Initialisation of branch container and histograms @@ -82,12 +83,12 @@ void AliTriggerPHOS::ConnectInputData(const Option_t*) //________________________________________________________________________ -void AliTriggerPHOS::CreateOutputObjects() +void AliAnaCaloTrigger::CreateOutputObjects() { // create histograms - fNtTrigger22 = new TNtuple("PHOStrigger22", "Trigger data 2x2 patch", "a22:a220:enMax:phEnMax:eta22:phi22:etaMax:phiMax:phEtaMax:phPhiMax"); - fNtTriggerNN = new TNtuple("PHOStriggerNN", "Trigger data NxN patch", "aNN:aNN0:enMax:phEnMax:etaNN:phiNN:etaMax:phiMax:phEtaMax:phPhiMax"); + fNtTrigger22 = new TNtuple(fCalorimeter+"trigger22", "Trigger data 2x2 patch", "a22:a220:enMax:phEnMax:eta22:phi22:etaMax:phiMax:phEtaMax:phPhiMax"); + fNtTriggerNN = new TNtuple(fCalorimeter+"triggerNN", "Trigger data NxN patch", "aNN:aNN0:enMax:phEnMax:etaNN:phiNN:etaMax:phiMax:phEtaMax:phPhiMax"); // create output container @@ -100,7 +101,7 @@ void AliTriggerPHOS::CreateOutputObjects() } //______________________________________________________________________________ -void AliTriggerPHOS::Exec(Option_t *) +void AliAnaCaloTrigger::Exec(Option_t *) { // Processing of one event @@ -114,18 +115,32 @@ void AliTriggerPHOS::Exec(Option_t *) if ( !((entry-1)%100) ) AliInfo(Form("%s ----> Processing event # %lld", (dynamic_cast(fChain))->GetFile()->GetName(), entry)) ; - // ************************ PHOS ************************************* - // Get trigger information + // Get trigger information of fCalorimeter + TArrayF * triggerAmplitudes = 0x0 ; + TArrayF * triggerPosition = 0x0 ; + Int_t firstCaloCluster = 0 ; + Int_t numberOfCaloClusters = 0 ; + + if(fCalorimeter == "PHOS"){ + triggerAmplitudes = fESD->GetPHOSTriggerAmplitudes(); + triggerPosition = fESD->GetPHOSTriggerPosition(); + firstCaloCluster = fESD->GetFirstPHOSCluster() ; + numberOfCaloClusters = fESD->GetNumberOfPHOSClusters() ; + } + else if(fCalorimeter == "EMCAL"){ + triggerAmplitudes = fESD->GetEMCALTriggerAmplitudes(); + triggerPosition = fESD->GetEMCALTriggerPosition(); + firstCaloCluster = fESD->GetFirstEMCALCluster() ; + numberOfCaloClusters = fESD->GetNumberOfEMCALClusters() ; + } // trigger amplitudes - const TArrayF * triggerAmplitudes = fESD->GetPHOSTriggerAmplitudes(); const Float_t a22 = static_cast(triggerAmplitudes->At(0)) ; const Float_t a22O = static_cast(triggerAmplitudes->At(1)) ; const Float_t aNN = static_cast(triggerAmplitudes->At(2)) ; const Float_t aNNO = static_cast(triggerAmplitudes->At(3)) ; // trigger position - const TArrayF * triggerPosition = fESD->GetPHOSTriggerPosition(); const Float_t x22 = static_cast(triggerPosition->At(0)) ; const Float_t y22 = static_cast(triggerPosition->At(1)) ; const Float_t z22 = static_cast(triggerPosition->At(2)) ; @@ -133,8 +148,7 @@ void AliTriggerPHOS::Exec(Option_t *) const Float_t yNN = static_cast(triggerPosition->At(4)) ; const Float_t zNN = static_cast(triggerPosition->At(5)) ; - Int_t firstPhosCluster = fESD->GetFirstPHOSCluster() ; - const Int_t numberOfPhosClusters = fESD->GetNumberOfPHOSClusters() ; + Float_t enMax = 0. ; Float_t phEnMax = 0. ; @@ -150,19 +164,19 @@ void AliTriggerPHOS::Exec(Option_t *) Float_t etaNN = vposNN.Eta() ; Float_t phiNN = vposNN.Phi() * TMath::RadToDeg() + 360. ; - Int_t phosCluster ; + Int_t icaloCluster ; - // loop over the PHOS Cluster + // loop over the Calorimeters Clusters - for(phosCluster = firstPhosCluster ; phosCluster < firstPhosCluster + numberOfPhosClusters ; phosCluster++) { - AliESDCaloCluster * caloCluster = fESD->GetCaloCluster(phosCluster) ; - if (caloCluster) { + for(icaloCluster = firstCaloCluster ; icaloCluster < firstCaloCluster + numberOfCaloClusters ; icaloCluster++) { + AliESDCaloCluster * cluster = fESD->GetCaloCluster(icaloCluster) ; + if (cluster) { - Float_t cluEnergy = caloCluster->GetClusterEnergy() ; + Float_t cluEnergy = cluster->GetClusterEnergy() ; Float_t pos[3] ; TVector3 vpos ; - caloCluster->GetGlobalPosition( pos ) ; + cluster->GetGlobalPosition( pos ) ; if ( cluEnergy > enMax) { enMax = cluEnergy ; @@ -171,7 +185,7 @@ void AliTriggerPHOS::Exec(Option_t *) phiMax = vpos.Phi() ; } - Float_t * pid = caloCluster->GetPid() ; + Float_t * pid = cluster->GetPid() ; if(pid[AliPID::kPhoton] > 0.9) { if ( cluEnergy > phEnMax) { @@ -193,7 +207,7 @@ void AliTriggerPHOS::Exec(Option_t *) } //______________________________________________________________________________ -void AliTriggerPHOS::Terminate(Option_t *) +void AliAnaCaloTrigger::Terminate(Option_t *) { // Processing when the event loop is ended