1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
17 #include "Riostream.h"
18 #include "FlowEventSimpleMaker.h"
19 #include "AliFlowEventSimple.h"
20 #include "AliFlowTrackSimple.h"
22 #include "TParticle.h"
23 #include "AliFlowTrackSimpleCuts.h"
26 // FlowEventSimpleMaker:
27 // Class to fill the AliFlowEventSimple
28 // with AliFlowTrackSimple objects
29 // ouside the AliRoot Framework
30 // Has fill methods for TTree,
32 ClassImp(FlowEventSimpleMaker)
33 //-----------------------------------------------------------------------
34 FlowEventSimpleMaker::FlowEventSimpleMaker()
39 //-----------------------------------------------------------------------
40 FlowEventSimpleMaker::~FlowEventSimpleMaker()
45 //-----------------------------------------------------------------------
46 AliFlowEventSimple* FlowEventSimpleMaker::FillTracks(TTree* anInput, AliFlowTrackSimpleCuts* intCuts, AliFlowTrackSimpleCuts* diffCuts)
48 //fills the event from a TTree of kinematic.root files
50 // number of times to use the same particle (trick to introduce nonflow)
53 //flags for particles passing int. and diff. flow cuts
54 Bool_t bPassedIntFlowCuts = kFALSE;
55 Bool_t bPassedDiffFlowCuts = kFALSE;
58 Double_t dPtMaxInt = intCuts->GetPtMax();
59 Double_t dPtMinInt = intCuts->GetPtMin();
60 Double_t dEtaMaxInt = intCuts->GetEtaMax();
61 Double_t dEtaMinInt = intCuts->GetEtaMin();
62 Double_t dPhiMaxInt = intCuts->GetPhiMax();
63 Double_t dPhiMinInt = intCuts->GetPhiMin();
64 Int_t iPIDInt = intCuts->GetPID();
66 Double_t dPtMaxDiff = diffCuts->GetPtMax();
67 Double_t dPtMinDiff = diffCuts->GetPtMin();
68 Double_t dEtaMaxDiff = diffCuts->GetEtaMax();
69 Double_t dEtaMinDiff = diffCuts->GetEtaMin();
70 Double_t dPhiMaxDiff = diffCuts->GetPhiMax();
71 Double_t dPhiMinDiff = diffCuts->GetPhiMin();
72 Int_t iPIDDiff = diffCuts->GetPID();
74 Int_t iNumberOfInputTracks = anInput->GetEntries() ;
75 //cerr<<"iNumberOfInputTracks = "<<iNumberOfInputTracks<<endl;
76 TParticle* pParticle = new TParticle();
77 anInput->SetBranchAddress("Particles",&pParticle);
78 // AliFlowEventSimple* pEvent = new AliFlowEventSimple(iNumberOfInputTracks);
79 AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
80 //cerr<<pEvent<<" pEvent "<<endl;
82 Int_t iN = iNumberOfInputTracks; // additional variable to artificially fix the number of tracks
83 // Int_t iN = 576; //multiplicity for chi=1.5
84 // Int_t iN = 256; //multiplicity for chi=1
85 // Int_t iN = 164; //multiplicity for chi=0.8
87 Int_t iGoodTracks = 0;
89 Int_t iSelParticlesDiff = 0;
90 Int_t iSelParticlesInt = 0;
92 while (itrkN < iNumberOfInputTracks) {
93 anInput->GetEntry(itrkN); //get input particle
94 //checking the cuts for int. and diff. flow
95 if (pParticle->Pt() > dPtMinInt && pParticle->Pt() < dPtMaxInt &&
96 pParticle->Eta() > dEtaMinInt && pParticle->Eta() < dEtaMaxInt &&
97 pParticle->Phi() > dPhiMinInt && pParticle->Phi() < dPhiMaxInt &&
98 TMath::Abs(pParticle->GetPdgCode()) == iPIDInt) {
99 bPassedIntFlowCuts = kTRUE;
102 if (pParticle->Pt() > dPtMinDiff && pParticle->Pt() < dPtMaxDiff &&
103 pParticle->Eta() > dEtaMinDiff && pParticle->Eta() < dEtaMaxDiff &&
104 pParticle->Phi() > dPhiMinDiff && pParticle->Phi() < dPhiMaxDiff &&
105 TMath::Abs(pParticle->GetPdgCode()) == iPIDDiff){
106 bPassedDiffFlowCuts = kTRUE;
109 if (bPassedIntFlowCuts || bPassedDiffFlowCuts) {
110 for(Int_t d=0;d<iLoops;d++) {
111 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
112 pTrack->SetPt(pParticle->Pt());
113 pTrack->SetEta(pParticle->Eta());
114 pTrack->SetPhi(pParticle->Phi());
116 //marking the particles used for int. flow:
117 if(bPassedIntFlowCuts && iSelParticlesInt < iN*iLoops) {
118 pTrack->SetForIntegratedFlow(kTRUE);
121 //marking the particles used for diff. flow:
122 if(bPassedDiffFlowCuts) {
123 pTrack->SetForDifferentialFlow(kTRUE);
126 //adding a particles which were used either for int. or diff. flow to the list
127 pEvent->TrackCollection()->Add(pTrack);
129 }//end of for(Int_t d=0;d<iLoops;d++)
130 }//end of if(bPassedIntFlowCuts || bPassedDiffFlowCuts)
132 bPassedIntFlowCuts = kFALSE;
133 bPassedDiffFlowCuts = kFALSE;
134 }//end of while (itrkN < iNumberOfInputTracks)
136 pEvent->SetEventNSelTracksIntFlow(iSelParticlesInt);
137 pEvent->SetNumberOfTracks(iGoodTracks);//tracks used either for int. or for diff. flow
139 cout<<" iGoodTracks = "<<iGoodTracks<<endl;
140 cout<<" # of selected tracks for int. flow = "<<iSelParticlesInt<<endl;
141 cout<<" # of selected tracks for diff. flow = "<<iSelParticlesDiff<<endl;