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 // Comment describing what this class does needed!
18 //===========================================================
19 // Dummy comment, should be replaced by a real one
22 //===========================================================
27 #include "AliJBaseTrack.h"
28 #include "AliJCorrelations.h"
29 #include "AliJEventPool.h"
30 #include "AliJHistos.h"
31 #include "AliJEfficiency.h"
34 #include "AliJJetCORRAnalysis.h"
35 #include "AliJHistManager.h"
37 AliJJetCORRAnalysis::AliJJetCORRAnalysis():
64 AliJJetCORRAnalysis::AliJJetCORRAnalysis( AliJCard * card ):
91 AliJJetCORRAnalysis::AliJJetCORRAnalysis( const AliJJetCORRAnalysis & obj ):
92 fInputList(obj.fInputList),
93 fJetList(obj.fJetList),
94 fJetListOfList(obj.fJetListOfList),
95 fIsFullAcceptance(obj.fIsFullAcceptance),
96 fJetEtaRange(obj.fJetEtaRange),
97 fTrackJetMap(obj.fTrackJetMap),
98 fJetPtBins(obj.fJetPtBins),
99 fJetPtMinCut(obj.fJetPtMinCut),
101 fHistos(obj.fHistos),
102 fEfficiency(obj.fEfficiency),
103 ftriggList(obj.ftriggList),
104 fassocList(obj.fassocList),
105 fcorrelations(obj.fcorrelations),
106 fassocPool(obj.fassocPool),
118 AliJJetCORRAnalysis& AliJJetCORRAnalysis::operator=(const AliJJetCORRAnalysis & obj){
120 this->~AliJJetCORRAnalysis();
121 new(this) AliJJetCORRAnalysis(obj);
126 AliJJetCORRAnalysis::~AliJJetCORRAnalysis(){
132 delete fcorrelations;
138 void AliJJetCORRAnalysis::UserCreateOutputObjects(){
140 fJetPtBins = fCard->GetVector("Jet:PtBins");
141 fJetPtMinCut = fCard->Get("Jet:PtMinCut");
143 fInputList = new TClonesArray("AliJBaseTrack",1500);
144 fInputList->SetOwner(kTRUE);
145 ftriggList = new TClonesArray("AliJBaseTrack",1500);
146 fassocList = new TClonesArray("AliJBaseTrack",1500);
148 fHistos = new AliJHistos(fCard);
149 fHistos->CreateEventTrackHistos();
150 fHistos->CreateAzimuthCorrHistos();
151 fHistos->CreateIAAMoons();
152 fHistos->CreateXEHistos();
153 fHistos->CreateXtHistos();
154 fHistos->CreatePairPtCosThetaStar();
156 fHistos->fHMG->Print();
158 fcorrelations = new AliJCorrelations(fCard, fHistos);
159 fassocPool = new AliJEventPool( fCard, fHistos, fcorrelations, kJHadron);
161 fEfficiency = new AliJEfficiency();
162 fEfficiency->SetMode( fCard->Get("EfficiencyMode") ); // 0:NoEff, 1:Period 2:RunNum 3:Auto
163 fEfficiency->SetDataPath("alien:///alice/cern.ch/user/d/djkim/legotrain/efficieny/data"); // Efficiency root file location local or alien
165 fHistos->fHMG->WriteConfig();
169 void AliJJetCORRAnalysis::ClearBeforeEvent(){
173 void AliJJetCORRAnalysis::UserExec(){
175 TObjArray *jets = (TObjArray*) fJetListOfList[fTargetJetIndex]; // only for one jet finder
179 //Make Trigger list and assocList
180 int noTrigg=0,noAssoc=0;
181 for(int ii=0;ii<jets->GetEntriesFast();ii++) {
182 AliJJet *jet = (AliJJet*)jets->At(ii);
183 jet->SetTriggBin( fCard->GetBin(kTriggType, jet->Pt()) );
184 jet->SetTrackEff( 1.0 );
185 if( jet->GetTriggBin() > -1 ) { new ((*ftriggList)[noTrigg++]) AliJBaseTrack(*jet); }
187 TObjArray *constituents = (TObjArray*)jet->GetConstituents();
188 for(int jj=0;jj<constituents->GetEntriesFast();jj++) {
189 AliJBaseTrack *con = (AliJBaseTrack*)constituents->At(jj);
190 con->SetAssocBin( fCard->GetBin(kAssocType, con->Pt()) );
191 con->SetParticleType(kJHadron);
192 double pt = con->Pt();
193 con->SetTrackEff( fEfficiency->GetCorrection(pt, 5, fcent) ); // only here for hybrid cut = 5
194 if( con->GetAssocBin() > -1 ) { new ((*fassocList)[noAssoc++]) AliJBaseTrack(*con); }
195 if(con->GetAssocBin() > -1){
196 int ipta = con->GetAssocBin();
197 double effCorrection = 1.0/con->GetTrackEff();
198 fHistos->fhIphiAssoc[cBin][ipta]->Fill( con->Phi(), effCorrection);
199 fHistos->fhIetaAssoc[cBin][ipta]->Fill( con->Eta(), effCorrection);
204 if(fDebugMode) cout << "Start of Correlation Loop noTrigg = "<< ftriggList->GetEntriesFast()<<"\t noAssoc="<<fassocList->GetEntriesFast()<<endl;
205 if(fassocList->GetEntriesFast()>0 ) fassocPool->AcceptList(fassocList, fcent, zVert, fInputList->GetEntriesFast(), fevt);
206 PlayCorrelation(ftriggList, fassocList);
207 fassocPool->Mix(ftriggList, kAzimuthFill, fcent, zVert, fInputList->GetEntriesFast(), fevt);
209 void AliJJetCORRAnalysis::Terminate() const{
214 void AliJJetCORRAnalysis::FillHistosJets(TObjArray *Jets){
215 for(int i=0; i<Jets->GetEntries();i++) {
216 AliJJet *jet = (AliJJet*)Jets->At(i);
221 void AliJJetCORRAnalysis::CreateHistos(){
226 //________________________________________________________________________
227 void AliJJetCORRAnalysis::PlayCorrelation(TClonesArray *triggList, TClonesArray *assocList){
228 int noTrigg = triggList->GetEntries();
229 int noAssoc = assocList->GetEntries();
231 fHistos->fhAssocMult->Fill(noAssoc);
232 //------------------------------------------------------------------
233 //==== Correlation Loop
234 //------------------------------------------------------------------
235 for(int ii=0;ii<noTrigg;ii++){ // trigger loop
236 AliJBaseTrack * triggTr = (AliJBaseTrack*)triggList->At(ii);
237 int iptt = triggTr->GetTriggBin();
238 if( iptt < 0 ) continue;
239 double effCorr = 1.0/triggTr->GetTrackEff();
240 fHistos->fhTriggPtBin[cBin][zBin][iptt]->Fill(triggTr->Pt(), effCorr);//inclusive
241 for(int jj=0;jj<noAssoc;jj++){ // assoc loop
242 AliJBaseTrack *assocTr = (AliJBaseTrack*)assocList->At(jj);
243 fcorrelations->FillAzimuthHistos(kReal, cBin, zBin, triggTr, assocTr); // cBin and zBin from the members in header vis setter from TaskCode.