Corrections implemented into AliAnalysisHadEtReconstructed, simulated hadronic and...
[u/mrichter/AliRoot.git] / PWG4 / totEt / AliAnalysisTaskHadEt.cxx
CommitLineData
cf6522d1 1//_________________________________________________________________________
2// Utility Class for transverse energy studies; charged hadrons
3// Task for analysis
4// - reconstruction and MC output
5// implementation file
6//
7//Created by Christine Nattrass, Rebecca Scott, Irakli Martashvili
641e1e0c 8//University of Tennessee at Knoxville
cf6522d1 9//_________________________________________________________________________
10
641e1e0c 11#include "TChain.h"
cf6522d1 12#include "TList.h"
641e1e0c 13#include "TH2F.h"
641e1e0c 14
15#include "AliESDEvent.h"
641e1e0c 16#include "AliMCEvent.h"
cf6522d1 17#include "AliESDtrackCuts.h"
18
641e1e0c 19#include "AliAnalysisTaskHadEt.h"
cf6522d1 20#include "AliAnalysisHadEtReconstructed.h"
21#include "AliAnalysisHadEtMonteCarlo.h"
641e1e0c 22
23#include <iostream>
641e1e0c 24
25using namespace std;
26
27ClassImp(AliAnalysisTaskHadEt)
28
29
30
31//________________________________________________________________________
32AliAnalysisTaskHadEt::AliAnalysisTaskHadEt(const char *name) :
33 AliAnalysisTaskSE(name)
641e1e0c 34 ,fOutputList(0)
35 ,fRecAnalysis(0)
36 ,fMCAnalysis(0)
37 ,fHistEtRecvsEtMC(0)
cf6522d1 38 ,fEsdtrackCutsITSTPC(0)
39 ,fEsdtrackCutsTPC(0)
40 ,fEsdtrackCutsITS(0)
641e1e0c 41{
42 // Constructor
43
44 fRecAnalysis = new AliAnalysisHadEtReconstructed();
45 fRecAnalysis->Init();
46 fMCAnalysis = new AliAnalysisHadEtMonteCarlo();
47 fMCAnalysis->Init();
641e1e0c 48
49 // Define input and output slots here
50 // Input slot #0 works with a TChain
51 DefineInput(0, TChain::Class());
52 // Output slot #1 writes into a TH1 container
53
54 DefineOutput(1, TList::Class());
55
56}
57
58
59//________________________________________________________________________
60void AliAnalysisTaskHadEt::UserCreateOutputObjects()
61{
62 // Create histograms
63 // Called once
64 fOutputList = new TList;
65 fMCAnalysis->SetHistoList(fOutputList);
66 fRecAnalysis->SetHistoList(fOutputList);
67 fMCAnalysis->CreateHistograms();
68 fRecAnalysis->CreateHistograms();
69 fRecAnalysis->FillOutputList();
70 fMCAnalysis->FillOutputList();
71
72
73 Bool_t selectPrimaries=kTRUE;
cf6522d1 74 fEsdtrackCutsITSTPC = AliESDtrackCuts::GetStandardITSTPCTrackCuts2009(selectPrimaries);
75 fEsdtrackCutsITSTPC->SetName("fEsdTrackCuts");
76 fEsdtrackCutsTPC = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
77 fEsdtrackCutsTPC->SetName("fEsdTrackCutsTPCOnly");
641e1e0c 78 //ITS stand alone cuts - similar to 2009 cuts but with only ITS hits required
b64de20c 79 fEsdtrackCutsITS = AliESDtrackCuts::GetStandardITSPureSATrackCuts2009(kTRUE,kFALSE);//we do want primaries but we do not want to require PID info
cf6522d1 80 fEsdtrackCutsITS->SetName("fEsdTrackCutsITS");
cf6522d1 81
82 fOutputList->Add(fEsdtrackCutsITSTPC);
83 fOutputList->Add(fEsdtrackCutsTPC);
84 fOutputList->Add(fEsdtrackCutsITS);
85 if(fEsdtrackCutsITSTPC && fEsdtrackCutsTPC){
641e1e0c 86 fRecAnalysis->SetITSTrackCuts( GetITSTrackCuts());
87 fMCAnalysis->SetITSTrackCuts( GetITSTrackCuts());
88 fRecAnalysis->SetTPCITSTrackCuts( GetTPCITSTrackCuts());
89 fMCAnalysis->SetTPCITSTrackCuts( GetTPCITSTrackCuts());
90 fRecAnalysis->SetTPCOnlyTrackCuts( GetTPCOnlyTrackCuts());
91 fMCAnalysis->SetTPCOnlyTrackCuts( GetTPCOnlyTrackCuts());
92 //add ITS stuff!
93 }
94 else{
95 Printf("Error: no track cuts!");
96 }
97
98}
99
100//________________________________________________________________________
101void AliAnalysisTaskHadEt::UserExec(Option_t *)
cf6522d1 102{ // execute method
641e1e0c 103 AliESDEvent *event = dynamic_cast<AliESDEvent*>(InputEvent());
104if (!event) {
105 Printf("ERROR: Could not retrieve event");
106 return;
107 }
108
109fRecAnalysis->AnalyseEvent(event);
110
111AliMCEvent* mcEvent = MCEvent();
112if (mcEvent)
113 {
114 ((AliAnalysisHadEtMonteCarlo*)fMCAnalysis)->AnalyseEvent((AliVEvent*)mcEvent,(AliVEvent*)event);
d6214a64 115 //cout<<"Simulated Hadronic Et "<<fMCAnalysis->GetSimulatedHadronicEt()<<" Reconstructed Hadronic Et "<<fRecAnalysis->GetCorrectedHadEtFullAcceptanceITS()<<endl;
116 //cout<<"Simulated Total Et "<<fMCAnalysis->GetSimulatedTotalEt()<<" Reconstructed Total Et "<<fRecAnalysis->GetCorrectedTotEtFullAcceptanceITS()<<endl;
117 fMCAnalysis->FillSimTotEtVsRecoTotEtFullAcceptanceTPC( fRecAnalysis->GetCorrectedTotEtFullAcceptanceTPC() );
118 fMCAnalysis->FillSimTotEtVsRecoTotEtFullAcceptanceITS( fRecAnalysis->GetCorrectedTotEtFullAcceptanceITS() );
119 fMCAnalysis->FillSimTotEtVsRecoTotEtEMCALAcceptanceTPC( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceTPC() );
120 fMCAnalysis->FillSimTotEtVsRecoTotEtEMCALAcceptanceITS( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceITS() );
121 fMCAnalysis->FillSimTotEtVsRecoTotEtPHOSAcceptanceTPC( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceTPC() );
122 fMCAnalysis->FillSimTotEtVsRecoTotEtPHOSAcceptanceITS( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceITS() );
123 fMCAnalysis->FillSimTotEtVsRecoTotEtFullAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedTotEtFullAcceptanceTPCNoPID() );
124 fMCAnalysis->FillSimTotEtVsRecoTotEtFullAcceptanceITSNoPID( fRecAnalysis->GetCorrectedTotEtFullAcceptanceITSNoPID() );
125 fMCAnalysis->FillSimTotEtVsRecoTotEtEMCALAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceTPCNoPID() );
126 fMCAnalysis->FillSimTotEtVsRecoTotEtEMCALAcceptanceITSNoPID( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceITSNoPID() );
127 fMCAnalysis->FillSimTotEtVsRecoTotEtPHOSAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceTPCNoPID() );
128 fMCAnalysis->FillSimTotEtVsRecoTotEtPHOSAcceptanceITSNoPID( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceITSNoPID() );
129 fMCAnalysis->FillSimHadEtVsRecoHadEtFullAcceptanceTPC( fRecAnalysis->GetCorrectedHadEtFullAcceptanceTPC() );
130 fMCAnalysis->FillSimHadEtVsRecoHadEtFullAcceptanceITS( fRecAnalysis->GetCorrectedHadEtFullAcceptanceITS() );
131 fMCAnalysis->FillSimHadEtVsRecoHadEtEMCALAcceptanceTPC( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceTPC() );
132 fMCAnalysis->FillSimHadEtVsRecoHadEtEMCALAcceptanceITS( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceITS() );
133 fMCAnalysis->FillSimHadEtVsRecoHadEtPHOSAcceptanceTPC( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceTPC() );
134 fMCAnalysis->FillSimHadEtVsRecoHadEtPHOSAcceptanceITS( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceITS() );
135 fMCAnalysis->FillSimHadEtVsRecoHadEtFullAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedHadEtFullAcceptanceTPCNoPID() );
136 fMCAnalysis->FillSimHadEtVsRecoHadEtFullAcceptanceITSNoPID( fRecAnalysis->GetCorrectedHadEtFullAcceptanceITSNoPID() );
137 fMCAnalysis->FillSimHadEtVsRecoHadEtEMCALAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceTPCNoPID() );
138 fMCAnalysis->FillSimHadEtVsRecoHadEtEMCALAcceptanceITSNoPID( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceITSNoPID() );
139 fMCAnalysis->FillSimHadEtVsRecoHadEtPHOSAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceTPCNoPID() );
140 fMCAnalysis->FillSimHadEtVsRecoHadEtPHOSAcceptanceITSNoPID( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceITSNoPID() );
641e1e0c 141 }
142
143// Post output data.
144PostData(1, fOutputList);
145
146}
147
148//________________________________________________________________________
149void AliAnalysisTaskHadEt::Terminate(Option_t *)
150{
151 // Draw result to the screen
152 // Called once at the end of the query
153
154 fOutputList = dynamic_cast<TList*> (GetOutputData(1));
155 if (!fOutputList) {
156 printf("ERROR: Output list not available\n");
157 return;
158 }
159}
160
161