2 // Wagon contacts: EMCAL Gustavo.Conesa.Balbastre@cern.ch
3 // PHOS Yuri.Kharlov@cern.ch
6 AliAnalysisTaskParticleCorrelation *AddTaskCalorimeterQA(TString data, Bool_t kPrintSettings = kFALSE,Bool_t kSimulation = kFALSE)
8 // Creates a PartCorr task for calorimeters performance studies, configures it and adds it to the analysis manager.
10 // Get the pointer to the existing analysis manager via the static access method.
11 //==============================================================================
12 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
14 ::Error("AddTaskPartCorr", "No analysis manager to connect to.");
18 // Check the analysis type using the event handlers connected to the analysis manager.
19 //==============================================================================
20 if (!mgr->GetInputEventHandler()) {
21 ::Error("AddTaskPartCorr", "This task requires an input event handler");
24 TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
26 Bool_t kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
28 cout<<"********* ACCESS KINE? "<<kUseKinematics<<endl;
31 //===========================================================================
34 //For this particular analysis few things done by the reader.
35 //Nothing else needs to be set.
36 AliCaloTrackReader * reader = 0x0;
37 if(data=="AOD") reader = new AliCaloTrackAODReader();
38 else if(data=="ESD") reader = new AliCaloTrackESDReader();
39 //reader->SetDebug(10);//10 for lots of messages
40 reader->SwitchOffEMCAL();
41 reader->SwitchOffPHOS();
42 reader->SwitchOffCTS();
45 if(inputDataType == "ESD"){
46 reader->SwitchOnStack();
47 reader->SwitchOffAODMCParticles();
49 else if(inputDataType == "AOD"){
50 reader->SwitchOffStack();
51 reader->SwitchOnAODMCParticles();
54 //if(!kSimulation) reader->SetFiredTriggerClassName("CINT1B-ABCE-NOPF-ALL");
55 reader->SetDeltaAODFileName(""); //Do not create deltaAOD file, this analysis do not create branches.
56 if(kPrintSettings) reader->Print("");
58 // ##### Analysis algorithm settings ####
59 //Only needed now for MC data
60 //AliFiducialCut * fidCut = new AliFiducialCut();
61 //fidCut->DoCTSFiducialCut(kFALSE) ;
62 //fidCut->DoEMCALFiducialCut(kTRUE) ;
63 //fidCut->DoPHOSFiducialCut(kTRUE) ;
65 AliAnaCalorimeterQA *emcalQA = new AliAnaCalorimeterQA();
66 //emcalQA->SetDebug(2); //10 for lots of messages
67 emcalQA->SetCalorimeter("EMCAL");
68 if(kUseKinematics) emcalQA->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
69 else emcalQA->SwitchOffDataMC() ;
70 emcalQA->AddToHistogramsName("EMCAL_"); //Begining of histograms name
71 //emcalQA->SetFiducialCut(fidCut);
72 emcalQA->SwitchOffFiducialCut();
73 emcalQA->SwitchOffPlotsMaking();
74 emcalQA->SwitchOnCalorimetersCorrelation();
75 emcalQA->SetTimeCut(550,750);
76 //Set Histrograms bins and ranges
77 emcalQA->SetHistoPtRangeAndNBins(0, 10, 100) ;
78 emcalQA->SetHistoPhiRangeAndNBins(75*TMath::DegToRad(), 125*TMath::DegToRad(), 100) ;
79 emcalQA->SetHistoEtaRangeAndNBins(-0.8, 0.8, 80) ;
80 emcalQA->SetNumberOfModules(4); //EMCAL first year
81 emcalQA->SetHistoMassRangeAndNBins(0., 0.6, 200) ;
82 emcalQA->SetHistoAsymmetryRangeAndNBins(0., 1. , 10) ;
83 emcalQA->SetHistoPOverERangeAndNBins(0,10.,100);
84 emcalQA->SetHistodEdxRangeAndNBins(0.,400.,200);
85 emcalQA->SetHistodRRangeAndNBins(0.,TMath::Pi(),150);
86 emcalQA->SetHistoTimeRangeAndNBins(400.,800,200);
87 emcalQA->SetHistoRatioRangeAndNBins(0.,2.,100);
88 emcalQA->SetHistoVertexDistRangeAndNBins(0.,500.,100);
89 emcalQA->SetHistoNClusterCellRangeAndNBins(0,300,300);
90 emcalQA->SetHistoXRangeAndNBins(-230,90,160);
91 emcalQA->SetHistoYRangeAndNBins(370,450,35);
92 emcalQA->SetHistoZRangeAndNBins(-400,400,100);
93 emcalQA->SetHistoRRangeAndNBins(400,450,25);
95 //emcalQA->GetMCAnalysisUtils()->SetDebug(10);
97 if(kPrintSettings) emcalQA->Print("");
99 AliAnaCalorimeterQA *phosQA = new AliAnaCalorimeterQA();
100 //phosQA->SetDebug(2); //10 for lots of messages
101 phosQA->SetCalorimeter("PHOS");
102 if(kUseKinematics) phosQA->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
103 else phosQA->SwitchOffDataMC() ;
104 phosQA->AddToHistogramsName("PHOS_");//Begining of histograms name
105 //phosQA->SetFiducialCut(fidCut);
106 phosQA->SwitchOffFiducialCut();
107 //phosQA->GetMCAnalysisUtils()->SetDebug(10);
108 phosQA->SwitchOffPlotsMaking();
109 //Set Histrograms bins and ranges
110 phosQA->SetHistoPtRangeAndNBins(0, 10, 100) ;
111 phosQA->SetHistoPhiRangeAndNBins(255*TMath::DegToRad(), 325*TMath::DegToRad(), 100) ;
112 phosQA->SetHistoEtaRangeAndNBins(-0.13, 0.13, 80) ;
113 phosQA->SetNumberOfModules(3); //PHOS first year
114 phosQA->SetHistoMassRangeAndNBins(0., 0.6, 200) ;
115 phosQA->SetHistoAsymmetryRangeAndNBins(0., 1. , 25) ;
116 phosQA->SetHistoPOverERangeAndNBins(0,10.,100);
117 phosQA->SetHistodEdxRangeAndNBins(0.,400.,200);
118 phosQA->SetHistodRRangeAndNBins(0.,TMath::Pi(),150);
119 phosQA->SetHistoTimeRangeAndNBins(0.,400,200);
120 phosQA->SetHistoRatioRangeAndNBins(0.,2.,100);
121 phosQA->SetHistoVertexDistRangeAndNBins(0.,500.,100);
122 phosQA->SetHistoNClusterCellRangeAndNBins(0,300,300);
123 phosQA->SetHistoXRangeAndNBins(-100,400,150);
124 phosQA->SetHistoYRangeAndNBins(-490,-290,100);
125 phosQA->SetHistoZRangeAndNBins(-80,80,80);
126 phosQA->SetHistoRRangeAndNBins(440,480,40);
128 //if(kPrintSettings)phosQA->Print("");
130 // #### Configure Maker ####
131 AliAnaPartCorrMaker * maker = new AliAnaPartCorrMaker();
132 maker->SetReader(reader);//pointer to reader
133 maker->AddAnalysis(emcalQA,0);
134 maker->AddAnalysis(phosQA,1);
135 maker->SetAnaDebug(-1) ; // 0 to at least print the event number
136 maker->SwitchOnHistogramsMaker() ;
137 maker->SwitchOffAODsMaker() ;
138 if(kPrintSettings) maker->Print("");
141 printf("======================== \n");
142 printf(" End Configuration of Calorimeter QA \n");
143 printf("======================== \n");
146 //===========================================================================
147 AliAnalysisTaskParticleCorrelation * task = new AliAnalysisTaskParticleCorrelation ("CalorimeterPerformance");
148 task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
149 //task->SetDebugLevel(-1);
150 task->SelectCollisionCandidates();
151 task->SetAnalysisMaker(maker);
154 // AliAnalysisDataContainer *cout_pc = mgr->CreateContainer("Calo.Performance",TList::Class(),
155 // AliAnalysisManager::kOutputContainer, "Calo.Performance.root");
158 TString outputfile = AliAnalysisManager::GetCommonFileName();
159 AliAnalysisDataContainer *cout_pc = mgr->CreateContainer("CaloQA", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:CaloQA",outputfile.Data()));
162 // Create ONLY the output containers for the data produced by the task.
163 // Get and connect other common input/output containers via the manager as below
164 //==============================================================================
165 mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
166 mgr->ConnectOutput (task, 1, cout_pc);