1 /**************************************************************************
2 * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 * Analysis component for different trigger patches
18 * Author: Markus Fasel
20 #include <TClonesArray.h>
22 #include "AliEmcalTriggerPatchInfo.h"
23 #include "AliEMCalTriggerBinningComponent.h"
24 #include "AliEMCalTriggerEventData.h"
25 #include "AliEMCalTriggerPatchAnalysisComponent.h"
27 ClassImp(EMCalTriggerPtAnalysis::AliEMCalTriggerPatchAnalysisComponent)
29 namespace EMCalTriggerPtAnalysis {
31 //______________________________________________________________________________
32 AliEMCalTriggerPatchAnalysisComponent::AliEMCalTriggerPatchAnalysisComponent() :
33 AliEMCalTriggerTracksAnalysisComponent()
36 * Dummy (I/O) constructor, not to be used
40 //______________________________________________________________________________
41 AliEMCalTriggerPatchAnalysisComponent::AliEMCalTriggerPatchAnalysisComponent(const char *name) :
42 AliEMCalTriggerTracksAnalysisComponent(name)
45 * Main constructor, to be used by the users
49 //______________________________________________________________________________
50 void AliEMCalTriggerPatchAnalysisComponent::CreateHistos() {
52 * Create histograms for the trigger patch analysis
54 AliEMCalTriggerBinningDimension *etabinning = fBinning->GetBinning("eta"),
55 *phibinning = fBinning->GetBinning("phi");
56 const TAxis *patchenergyaxes[4] = {
57 DefineAxis("energy", 100, 0., 100),
58 DefineAxis("eta", etabinning),
59 DefineAxis("phi", phibinning),
60 DefineAxis("isMain", 2, -0.5, 1.5)
62 const TAxis *patchampaxes[4] = {
63 DefineAxis("amplitude", 10000, 0., 10000.),
64 DefineAxis("eta", etabinning),
65 DefineAxis("phi", phibinning),
66 DefineAxis("isMain", 2, -0.5, 1.5)
69 std::string patchnames[] = {"Level0", "JetHigh", "JetLow", "GammaHigh", "GammaLow"};
70 for(std::string * triggerpatch = patchnames; triggerpatch < patchnames + sizeof(patchnames)/sizeof(std::string); ++triggerpatch){
71 fHistos->CreateTHnSparse(Form("Energy%s", triggerpatch->c_str()), Form("Patch energy for %s trigger patches", triggerpatch->c_str()), 4, patchenergyaxes, "s");
72 fHistos->CreateTHnSparse(Form("EnergyRough%s", triggerpatch->c_str()), Form("Rough patch energy for %s trigger patches", triggerpatch->c_str()), 4, patchenergyaxes, "s");
73 fHistos->CreateTHnSparse(Form("Amplitude%s", triggerpatch->c_str()), Form("Patch amplitude for %s trigger patches", triggerpatch->c_str()), 4, patchampaxes, "s");
78 //______________________________________________________________________________
79 void AliEMCalTriggerPatchAnalysisComponent::Process(const AliEMCalTriggerEventData* const data) {
81 * Run trigger patch analysis
83 AliEmcalTriggerPatchInfo *triggerpatch(NULL);
84 TIter patchIter(data->GetTriggerPatchContainer());
85 while((triggerpatch = dynamic_cast<AliEmcalTriggerPatchInfo *>(patchIter()))){
86 double triggerpatchinfo[4] = {triggerpatch->GetPatchE(), triggerpatch->GetEtaGeo(), triggerpatch->GetPhiGeo(), triggerpatch->IsMainTrigger() ? 1. : 0.};
87 double triggerpatchinfoamp[4] = {static_cast<double>(triggerpatch->GetADCAmp()), triggerpatch->GetEtaGeo(), triggerpatch->GetPhiGeo(), triggerpatch->IsMainTrigger() ? 1. : 0.};
88 double triggerpatchinfoer[4] = {triggerpatch->GetADCAmpGeVRough(), triggerpatch->GetEtaGeo(), triggerpatch->GetPhiGeo(), triggerpatch->IsMainTrigger() ? 1. : 0.};
89 if(triggerpatch->IsJetHigh()){
90 fHistos->FillTHnSparse("EnergyJetHigh", triggerpatchinfo);
91 fHistos->FillTHnSparse("AmplitudeJetHigh", triggerpatchinfoamp);
92 fHistos->FillTHnSparse("EnergyRoughJetHigh", triggerpatchinfoer);
94 if(triggerpatch->IsJetLow()){
95 fHistos->FillTHnSparse("EnergyJetLow", triggerpatchinfo);
96 fHistos->FillTHnSparse("AmplitudeJetLow", triggerpatchinfoamp);
97 fHistos->FillTHnSparse("EnergyRoughJetLow", triggerpatchinfoer);
99 if(triggerpatch->IsGammaHigh()){
100 fHistos->FillTHnSparse("EnergyGammaHigh", triggerpatchinfo);
101 fHistos->FillTHnSparse("AmplitudeGammaHigh", triggerpatchinfoamp);
102 fHistos->FillTHnSparse("EnergyRoughGammaHigh", triggerpatchinfoer);
104 if(triggerpatch->IsGammaLow()){
105 fHistos->FillTHnSparse("EnergyGammaLow", triggerpatchinfo);
106 fHistos->FillTHnSparse("AmplitudeGammaLow", triggerpatchinfoamp);
107 fHistos->FillTHnSparse("EnergyRoughGammaLow", triggerpatchinfoer);
109 if(triggerpatch->IsLevel0()){
110 fHistos->FillTHnSparse("EnergyLevel0", triggerpatchinfo);
111 fHistos->FillTHnSparse("AmplitudeLevel0", triggerpatchinfoamp);
112 fHistos->FillTHnSparse("EnergyRoughLevel0", triggerpatchinfoer);
117 } /* namespace EMCalTriggerPtAnalysis */