From: skowron Date: Tue, 29 Oct 2002 14:20:16 +0000 (+0000) Subject: All cout's substituted with Info's. IsOwner implemeted. Control of mixing progress... X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=81b7b887e29b3dfcc7e5a950e0ee5b49448d5290;p=u%2Fmrichter%2FAliRoot.git All cout's substituted with Info's. IsOwner implemeted. Control of mixing progress implemented. Cleaning of the code. --- diff --git a/HBTAN/AliHBTAnalysis.cxx b/HBTAN/AliHBTAnalysis.cxx index 1b62c69a4c3..f267fba13fe 100644 --- a/HBTAN/AliHBTAnalysis.cxx +++ b/HBTAN/AliHBTAnalysis.cxx @@ -1,8 +1,4 @@ - #include "AliHBTAnalysis.h" - -#include - #include "AliHBTRun.h" #include "AliHBTEvent.h" #include "AliHBTReader.h" @@ -12,21 +8,28 @@ #include "AliHBTPairCut.h" #include "AliHBTFunction.h" #include "AliHBTMonitorFunction.h" - + #include #include - - ClassImp(AliHBTAnalysis) const UInt_t AliHBTAnalysis::fgkFctnArraySize = 100; -const Int_t AliHBTAnalysis::fgkHbtAnalyzeAll = 0; - -AliHBTAnalysis::AliHBTAnalysis() +const UInt_t AliHBTAnalysis::fgkDefaultMixingInfo = 1000; +const Int_t AliHBTAnalysis::fgkDefaultBufferSize = 5; + +AliHBTAnalysis::AliHBTAnalysis(): + fReader(0x0), + fNTrackFunctions(0), + fNParticleFunctions(0), + fNParticleAndTrackFunctions(0), + fNTrackMonitorFunctions(0), + fNParticleMonitorFunctions(0), + fNParticleAndTrackMonitorFunctions(0), + fBufferSize(2), + fDisplayMixingInfo(fgkDefaultMixingInfo), + fIsOwner(kFALSE) { - fReader = 0x0; - fTrackFunctions = new AliHBTOnePairFctn* [fgkFctnArraySize]; fParticleFunctions = new AliHBTOnePairFctn* [fgkFctnArraySize]; fParticleAndTrackFunctions = new AliHBTTwoPairFctn* [fgkFctnArraySize]; @@ -35,26 +38,45 @@ AliHBTAnalysis::AliHBTAnalysis() fTrackMonitorFunctions = new AliHBTMonOneParticleFctn* [fgkFctnArraySize]; fParticleAndTrackMonitorFunctions = new AliHBTMonTwoParticleFctn* [fgkFctnArraySize]; - fNTrackFunctions = 0; - fNParticleFunctions = 0; - fNParticleAndTrackFunctions = 0; - - fNParticleMonitorFunctions = 0; - fNTrackMonitorFunctions = 0; - fNParticleAndTrackMonitorFunctions = 0; - fPairCut = new AliHBTEmptyPairCut();//empty cut - accepts all particles - - fBufferSize = 2; } /*************************************************************************************/ +AliHBTAnalysis::AliHBTAnalysis(const AliHBTAnalysis& in): + fReader(0x0), + fNTrackFunctions(0), + fNParticleFunctions(0), + fNParticleAndTrackFunctions(0), + fNTrackMonitorFunctions(0), + fNParticleMonitorFunctions(0), + fNParticleAndTrackMonitorFunctions(0), + fTrackFunctions(0x0), + fParticleFunctions(0x0), + fParticleAndTrackFunctions(0x0), + fParticleMonitorFunctions(0x0), + fTrackMonitorFunctions(0x0), + fParticleAndTrackMonitorFunctions(0x0), + fPairCut(0x0), + fBufferSize(fgkDefaultBufferSize), + fDisplayMixingInfo(fgkDefaultMixingInfo), + fIsOwner(kFALSE) + { + Fatal("AliHBTAnalysis(const AliHBTAnalysis&)","Sensless"); + } +/*************************************************************************************/ +const AliHBTAnalysis& AliHBTAnalysis::operator=(const AliHBTAnalysis& right) + { + Fatal("AliHBTAnalysis(const AliHBTAnalysis&)","Sensless"); + return *this; + } +/*************************************************************************************/ AliHBTAnalysis::~AliHBTAnalysis() { //destructor //note that we do not delete functions itself // they should be deleted by whom where created //we only store pointers, and we use "new" only for pointers array + if (fIsOwner) DeleteFunctions(); delete [] fTrackFunctions; delete [] fParticleFunctions; delete [] fParticleAndTrackFunctions; @@ -67,7 +89,27 @@ AliHBTAnalysis::~AliHBTAnalysis() } /*************************************************************************************/ - +void AliHBTAnalysis::DeleteFunctions() +{ + UInt_t ii; + for(ii = 0;iiGetNumberOfParticles() ; j++) { - if ( (j%100) == 0) cout<<"Mixing particle "<GetParticle(j); track1= trackEvent->GetParticle(j); - - UInt_t zz; - for(zz = 0; zzProcessSameEventParticles(part1); - for(zz = 0; zzProcessSameEventParticles(track1); - for(zz = 0; zzProcessSameEventParticles(track1,part1); + + if (fPairCut->GetFirstPartCut()->Pass(part1)) continue; + + for(ii = 0; iiProcessSameEventParticles(part1); + for(ii = 0; iiProcessSameEventParticles(track1); + for(ii = 0; iiProcessSameEventParticles(track1,part1); if ( (fNParticleFunctions == 0) && (fNTrackFunctions ==0) && (fNParticleAndTrackFunctions == 0)) continue; @@ -230,9 +268,9 @@ void AliHBTAnalysis::ProcessTracksAndParticles() track2= trackEvent->GetParticle(k); trackpair->SetParticles(track1,track2); - if(fPairCut->Pass(partpair) || (fPairCut->Pass(trackpair))) //check pair cut + if(fPairCut->Pass(partpair) ) //check pair cut { //do not meets crietria of the pair cut, try with swaped pairs - if( ( fPairCut->Pass(partpair->GetSwapedPair()) ) || ( fPairCut->Pass(trackpair->GetSwapedPair()) ) ) + if( fPairCut->Pass(partpair->GetSwapedPair()) ) continue; //swaped pairs do not meet criteria of pair cut as well, take next particle else { //swaped pair meets all the criteria @@ -245,7 +283,6 @@ void AliHBTAnalysis::ProcessTracksAndParticles() tmptrackpair = trackpair; tmppartpair = partpair; } - UInt_t ii; for(ii = 0;iiProcessSameEventParticles(tmppartpair); @@ -258,10 +295,10 @@ void AliHBTAnalysis::ProcessTracksAndParticles() } } - /***** Filling denominators *********/ /***************************************/ - for (Int_t i = 0;iGetTrackEvent(i); -// N=0; - for (Int_t j = 0; j< partEvent->GetNumberOfParticles(); j++) // ... Loop over all particles ... { - part1= partEvent->GetParticle(j); - track1= trackEvent->GetParticle(j); + + if (fPairCut->GetFirstPartCut()->Pass(part1)) continue; Int_t NNN; if ( ((i+fBufferSize) >= Nev) ||( fBufferSize < 0) ) //if buffer size is negative //or current event+buffersize is greater //than max nuber of events - { - NNN = Nev; //set the max event number - } + { + NNN = Nev; //set the max event number + } else - { - NNN = i+fBufferSize; //set the current event number + fBufferSize - } + { + NNN = i+fBufferSize; //set the current event number + fBufferSize + } for (Int_t k = i+1; kGetParticleEvent(k); - if (!partEvent2) continue; + partEvent2= fReader->GetParticleEvent(k); + if (!partEvent2) continue; - trackEvent2 = fReader->GetTrackEvent(k); + trackEvent2 = fReader->GetTrackEvent(k); - if ( (j%100) == 0) cout<<"Mixing particle "<GetNumberOfParticles();l++) // ... on all particles { - - // if (N>MAXCOMB) break; - part2= partEvent2->GetParticle(l); partpair->SetParticles(part1,part2); track2= trackEvent2->GetParticle(l); trackpair->SetParticles(track1,track2); - if( (fPairCut->Pass(partpair)) || (fPairCut->Pass(trackpair)) ) //check pair cut + if( fPairCut->Pass(partpair) ) //check pair cut { //do not meets crietria of the - if( ( fPairCut->Pass(partpair->GetSwapedPair()) ) || ( fPairCut->Pass(trackpair->GetSwapedPair()) ) ) - continue; - else - { - tmppartpair = partpair->GetSwapedPair(); - tmptrackpair = trackpair->GetSwapedPair(); - } + if( fPairCut->Pass(partpair->GetSwapedPair()) ) + continue; + else + { + tmppartpair = partpair->GetSwapedPair(); + tmptrackpair = trackpair->GetSwapedPair(); + } } else {//meets criteria of the pair cut tmptrackpair = trackpair; tmppartpair = partpair; } - UInt_t ii; for(ii = 0;iiProcessDiffEventParticles(tmppartpair); @@ -339,17 +372,11 @@ void AliHBTAnalysis::ProcessTracksAndParticles() for(ii = 0;iiProcessDiffEventParticles(tmptrackpair,tmppartpair); - - }//for(Int_t l = 0; lGetNumberOfTrackEvents(); + + AliHBTPair * trackpair = new AliHBTPair(); + AliHBTPair * tmptrackpair; //temporary pointer /***************************************/ /****** Looping same events ********/ /****** filling numerators ********/ /***************************************/ - AliHBTPair * trackpair = new AliHBTPair(); - AliHBTPair * tmptrackpair; //temporary pointer - for (Int_t i = 0;iGetTrackEvent(i); if (!trackEvent) continue; - //N = 0; for (Int_t j = 0; jGetNumberOfParticles() ; j++) { - if ( (j%100) == 0) cout<<"Mixing particle "<GetParticle(j); - - UInt_t zz; - for(zz = 0; zzProcessSameEventParticles(track1); + if (fPairCut->GetFirstPartCut()->Pass(track1)) continue; + + for(ii = 0; iiProcessSameEventParticles(track1); if ( fNTrackFunctions ==0 ) continue; @@ -397,99 +423,88 @@ void AliHBTAnalysis::ProcessTracks() track2= trackEvent->GetParticle(k); trackpair->SetParticles(track1,track2); if(fPairCut->Pass(trackpair)) //check pair cut - { //do not meets crietria of the + { //do not meets crietria of the if( fPairCut->Pass(trackpair->GetSwapedPair()) ) continue; else tmptrackpair = trackpair->GetSwapedPair(); - } - else - { - tmptrackpair = trackpair; - } - UInt_t ii; - - for(ii = 0;iiProcessSameEventParticles(tmptrackpair); - - - } + } + else + { + tmptrackpair = trackpair; + } + for(ii = 0;iiProcessSameEventParticles(tmptrackpair); + } } } /***************************************/ /***** Filling diff histogram *********/ /***************************************/ - for (Int_t i = 0;iGetTrackEvent(i); if (!trackEvent) continue; -// N=0; - + for (Int_t j = 0; j< trackEvent->GetNumberOfParticles(); j++) // ... Loop over all particles ... { -// if (N>MAXCOMB) break; - - track1= trackEvent->GetParticle(j); - - Int_t NNN; + track1= trackEvent->GetParticle(j); + if (fPairCut->GetFirstPartCut()->Pass(track1)) continue; + + Int_t NNN; - if ( ((i+fBufferSize) >= Nev) ||( fBufferSize < 0) ) //if buffer size is negative - //or current event+buffersize is greater - //than max nuber of events - { - NNN = Nev; //set the max event number - } - else - { - NNN = i+fBufferSize; //set the current event number + fBufferSize - } + if ( ((i+fBufferSize) >= Nev) ||( fBufferSize < 0) ) //if buffer size is negative + //or current event+buffersize is greater + //than max nuber of events + { + NNN = Nev; //set the max event number + } + else + { + NNN = i+fBufferSize; //set the current event number + fBufferSize + } - for (Int_t k = i+1; kGetTrackEvent(k); - if (!trackEvent2) continue; + for (Int_t k = i+1; kGetTrackEvent(k); + if (!trackEvent2) continue; - if ( (j%100) == 0) cout<<"Mixing particle "<GetNumberOfParticles();l++) // ... on all particles - { - - // if (N>MAXCOMB) break; - track2= trackEvent2->GetParticle(l); - trackpair->SetParticles(track1,track2); + for(Int_t l = 0; lGetNumberOfParticles();l++) // ... on all particles + { + track2= trackEvent2->GetParticle(l); + trackpair->SetParticles(track1,track2); - if(fPairCut->Pass(trackpair)) //check pair cut - { //do not meets crietria of the - if( fPairCut->Pass(trackpair->GetSwapedPair()) ) continue; - else tmptrackpair = trackpair->GetSwapedPair(); - } - else - { - tmptrackpair = trackpair; - } - UInt_t ii; - for(ii = 0;iiProcessDiffEventParticles(tmptrackpair); + if(fPairCut->Pass(trackpair)) //check pair cut + { //do not meets crietria of the + if( fPairCut->Pass(trackpair->GetSwapedPair()) ) continue; + else tmptrackpair = trackpair->GetSwapedPair(); + } + else + { + tmptrackpair = trackpair; + } + for(ii = 0;iiProcessDiffEventParticles(tmptrackpair); - }//for(Int_t l = 0; lGetNumberOfPartEvents(); - // Nev = 1; /***************************************/ /****** Looping same events ********/ /****** filling numerators ********/ /***************************************/ -// gBenchmark->Start("id"); - for (Int_t i = 0;iGetParticleEvent(i); @@ -518,9 +528,12 @@ void AliHBTAnalysis::ProcessParticles() for (Int_t j = 0; jGetNumberOfParticles() ; j++) { - if ( (j%100) == 0) cout<<"Mixing particle "<GetParticle(j); + if (fPairCut->GetFirstPartCut()->Pass(part1)) continue; UInt_t zz; for(zz = 0; zzGetParticleEvent(i); if (!partEvent) continue; -// N=0; - for (Int_t j = 0; j< partEvent->GetNumberOfParticles(); j++) // ... Loop over all particles ... { -// if (N>MAXCOMB) break; - part1= partEvent->GetParticle(j); - + if (fPairCut->GetFirstPartCut()->Pass(part1)) continue; Int_t NNN; - + if ( ((i+fBufferSize) >= Nev) ||( fBufferSize < 0) ) //if buffer size is negative //or current event+buffersize is greater //than max nuber of events @@ -587,26 +597,25 @@ void AliHBTAnalysis::ProcessParticles() NNN = i+fBufferSize; //set the current event number + fBufferSize } -// cout<<"NNN = "<GetParticleEvent(k); if (!partEvent2) continue; - if ( (j%100) == 0) cout<<"Mixing particle "<GetNumberOfParticles();l++) // ... on all particles { - - // if (N>MAXCOMB) break; part2= partEvent2->GetParticle(l); partpair->SetParticles(part1,part2); if(fPairCut->Pass(partpair)) //check pair cut { //do not meets crietria of the if( fPairCut->Pass(partpair->GetSwapedPair()) ) continue; - else tmppartpair = partpair->GetSwapedPair(); + else tmppartpair = partpair->GetSwapedPair(); } else { @@ -619,21 +628,16 @@ void AliHBTAnalysis::ProcessParticles() }//for(Int_t l = 0; lStop("id"); -// gBenchmark->Show("id"); } - /*************************************************************************************/ - void AliHBTAnalysis::WriteFunctions() { +//Calls Write for all defined functions in analysis +//== writes all results UInt_t ii; for(ii = 0;iiWrite(); @@ -657,6 +661,7 @@ void AliHBTAnalysis::WriteFunctions() void AliHBTAnalysis::SetGlobalPairCut(AliHBTPairCut* cut) { +//Sets the global cut if (cut == 0x0) { Error("AliHBTAnalysis::SetGlobalPairCut","Pointer is NULL. Ignoring"); @@ -669,6 +674,7 @@ void AliHBTAnalysis::SetGlobalPairCut(AliHBTPairCut* cut) void AliHBTAnalysis::AddTrackFunction(AliHBTOnePairFctn* f) { +//Adds track function if (f == 0x0) return; if (fNTrackFunctions == fgkFctnArraySize) { @@ -681,6 +687,7 @@ void AliHBTAnalysis::AddTrackFunction(AliHBTOnePairFctn* f) void AliHBTAnalysis::AddParticleFunction(AliHBTOnePairFctn* f) { +//adds particle function if (f == 0x0) return; if (fNParticleFunctions == fgkFctnArraySize) @@ -694,6 +701,7 @@ void AliHBTAnalysis::AddParticleFunction(AliHBTOnePairFctn* f) void AliHBTAnalysis::AddParticleAndTrackFunction(AliHBTTwoPairFctn* f) { +//add resolution function if (f == 0x0) return; if (fNParticleAndTrackFunctions == fgkFctnArraySize) { @@ -706,6 +714,7 @@ void AliHBTAnalysis::AddParticleAndTrackFunction(AliHBTTwoPairFctn* f) void AliHBTAnalysis::AddParticleMonitorFunction(AliHBTMonOneParticleFctn* f) { +//add particle monitoring function if (f == 0x0) return; if (fNParticleMonitorFunctions == fgkFctnArraySize) @@ -719,6 +728,7 @@ void AliHBTAnalysis::AddParticleMonitorFunction(AliHBTMonOneParticleFctn* f) void AliHBTAnalysis::AddTrackMonitorFunction(AliHBTMonOneParticleFctn* f) { +//add track monitoring function if (f == 0x0) return; if (fNTrackMonitorFunctions == fgkFctnArraySize) @@ -732,6 +742,7 @@ void AliHBTAnalysis::AddTrackMonitorFunction(AliHBTMonOneParticleFctn* f) void AliHBTAnalysis::AddParticleAndTrackMonitorFunction(AliHBTMonTwoParticleFctn* f) { +//add resolution monitoring function if (f == 0x0) return; if (fNParticleAndTrackMonitorFunctions == fgkFctnArraySize) { @@ -751,13 +762,12 @@ Bool_t AliHBTAnalysis::RunCoherencyCheck() //return true if error found //if they seem to be OK return false Int_t i; - cout<<"Checking HBT Runs Coherency"<GetNumberOfPartEvents() == fReader->GetNumberOfTrackEvents() ) //check whether there is the same number of events { - cout<<"OK. "<GetNumberOfTrackEvents()<<" found"<GetNumberOfTrackEvents()); } else { //if not the same - ERROR @@ -767,7 +777,7 @@ Bool_t AliHBTAnalysis::RunCoherencyCheck() return kTRUE; } - cout<<"Checking number of Particles AND Particles Types in each event ...";fflush(stdout); + Info("RunCoherencyCheck","Checking number of Particles AND Particles Types in each event ..."); AliHBTEvent *partEvent; AliHBTEvent *trackEvent; @@ -804,8 +814,8 @@ Bool_t AliHBTAnalysis::RunCoherencyCheck() } } } - cout<<" Done"<GetNumberOfTrackEvents(); @@ -832,15 +842,17 @@ void AliHBTAnalysis::ProcessTracksAndParticlesNonIdentAnal() TList tbuffer; TList pbuffer; Int_t ninbuffer = 0; + UInt_t ii; trackEvent1 = new AliHBTEvent(); partEvent1 = new AliHBTEvent(); trackEvent1->SetOwner(kFALSE); partEvent1->SetOwner(kFALSE);; - cout<<"**************************************"<GetParticleEvent(i); @@ -850,35 +862,37 @@ void AliHBTAnalysis::ProcessTracksAndParticlesNonIdentAnal() /********************************/ /* Filtering out */ /********************************/ - if ((ninbuffer > fBufferSize) && (fBufferSize > 0)) - {//if we have in buffer desired number of events, use the last. If fBufferSize<0 mix all events for background - partEvent2 = (AliHBTEvent*)pbuffer.Remove(pbuffer.Last()); //remove from the end to be reset, filled and put on the beginning - trackEvent2 = (AliHBTEvent*)tbuffer.Remove(tbuffer.Last()); - ninbuffer--; - } - else - { - partEvent2 = new AliHBTEvent(); - trackEvent2 = new AliHBTEvent(); - partEvent2->SetOwner(kFALSE); - trackEvent2->SetOwner(kFALSE); - } + if ( (fBufferSize != 0) || ( (partEvent2==0x0)||(trackEvent2==0x0)) )//in case fBufferSize == 0 and pointers are created do not eneter + if ((ninbuffer > fBufferSize) && (fBufferSize > 0)) + {//if we have in buffer desired number of events, use the last. If fBufferSize<0 mix all events for background + partEvent2 = (AliHBTEvent*)pbuffer.Remove(pbuffer.Last()); //remove from the end to be reset, filled and put on the beginning + trackEvent2 = (AliHBTEvent*)tbuffer.Remove(tbuffer.Last()); + ninbuffer--; + } + else + { + partEvent2 = new AliHBTEvent(); + trackEvent2 = new AliHBTEvent(); + partEvent2->SetOwner(kFALSE); + trackEvent2->SetOwner(kFALSE); + } FilterOut(partEvent1, partEvent2, rawpartEvent, trackEvent1, trackEvent2, rawtrackEvent); for (Int_t j = 0; jGetNumberOfParticles() ; j++) { - if ( (j%100) == 0) cout<<"Mixing particle "<GetParticle(j); track1= trackEvent1->GetParticle(j); - UInt_t zz; - for(zz = 0; zzProcessSameEventParticles(part1); - for(zz = 0; zzProcessSameEventParticles(track1); - for(zz = 0; zzProcessSameEventParticles(track1,part1); + for(ii = 0; iiProcessSameEventParticles(part1); + for(ii = 0; iiProcessSameEventParticles(track1); + for(ii = 0; iiProcessSameEventParticles(track1,part1); /***************************************/ /****** filling numerators ********/ @@ -892,14 +906,12 @@ void AliHBTAnalysis::ProcessTracksAndParticlesNonIdentAnal() track2= trackEvent2->GetParticle(k); trackpair->SetParticles(track1,track2); - - if( (fPairCut->PassPairProp(partpair)) || (fPairCut->PassPairProp(trackpair))) //check pair cut - { //do not meets crietria of the pair cut - continue; - } + if( (fPairCut->PassPairProp(partpair)) ) //check pair cut + { //do not meets crietria of the pair cut + continue; + } else {//meets criteria of the pair cut - UInt_t ii; for(ii = 0;iiProcessSameEventParticles(partpair); @@ -911,7 +923,7 @@ void AliHBTAnalysis::ProcessTracksAndParticlesNonIdentAnal() } } - + if ( fBufferSize == 0) continue;//do not mix diff histograms /***************************************/ /***** Filling denominators *********/ /***************************************/ @@ -922,7 +934,9 @@ void AliHBTAnalysis::ProcessTracksAndParticlesNonIdentAnal() while ( (partEvent3 = (AliHBTEvent*)piter.Next()) != 0x0) { trackEvent3 = (AliHBTEvent*)titer.Next(); - if ( (j%100) == 0) cout<<"Mixing particle "<GetNumberOfParticles() ; k++) { @@ -932,11 +946,10 @@ void AliHBTAnalysis::ProcessTracksAndParticlesNonIdentAnal() track2= trackEvent3->GetParticle(k); trackpair->SetParticles(track1,track2); - - if( (fPairCut->PassPairProp(partpair)) || (fPairCut->PassPairProp(trackpair))) //check pair cut - { //do not meets crietria of the pair cut - continue; - } + if( (fPairCut->PassPairProp(partpair)) ) //check pair cut + { //do not meets crietria of the pair cut + continue; + } else {//meets criteria of the pair cut UInt_t ii; @@ -955,12 +968,16 @@ void AliHBTAnalysis::ProcessTracksAndParticlesNonIdentAnal() pbuffer.AddFirst(partEvent2); tbuffer.AddFirst(trackEvent2); + partEvent2 = 0x0; + trackEvent2 = 0x0; ninbuffer++; }//end of loop over events (1) - pbuffer.SetOwner(); //to clean stored events by the way of buffer destruction tbuffer.SetOwner(); + delete partEvent2; + delete trackEvent2; + } /*************************************************************************************/ @@ -973,8 +990,6 @@ void AliHBTAnalysis::ProcessTracksNonIdentAnal() AliHBTEvent * trackEvent3; AliHBTEvent * rawtrackEvent; -// AliHBTEvent * rawtrackEvent2,*rawpartEvent2; - Int_t Nev = fReader->GetNumberOfTrackEvents(); @@ -982,13 +997,15 @@ void AliHBTAnalysis::ProcessTracksNonIdentAnal() TList tbuffer; Int_t ninbuffer = 0; + register UInt_t ii; trackEvent1 = new AliHBTEvent(); trackEvent1->SetOwner(kFALSE); - cout<<"**************************************"<GetTrackEvent(i); @@ -997,27 +1014,29 @@ void AliHBTAnalysis::ProcessTracksNonIdentAnal() /********************************/ /* Filtering out */ /********************************/ - if ((ninbuffer > fBufferSize) && (fBufferSize > 0)) - {//if we have in buffer desired number of events, use the last. If fBufferSize<0 mix all events for background - trackEvent2 = (AliHBTEvent*)tbuffer.Remove(tbuffer.Last()); - ninbuffer--; - } - else - { - trackEvent2 = new AliHBTEvent(); - trackEvent2->SetOwner(kFALSE); - } + if ( (fBufferSize != 0) || ( trackEvent2==0x0) )//in case fBufferSize == 0 and pointers are created do not eneter + if ((ninbuffer > fBufferSize) && (fBufferSize > 0)) + {//if we have in buffer desired number of events, use the last. If fBufferSize<0 mix all events for background + trackEvent2 = (AliHBTEvent*)tbuffer.Remove(tbuffer.Last()); + ninbuffer--; + } + else + { + trackEvent2 = new AliHBTEvent(); + trackEvent2->SetOwner(kFALSE); + } FilterOut(trackEvent1, trackEvent2, rawtrackEvent); for (Int_t j = 0; jGetNumberOfParticles() ; j++) { - if ( (j%100) == 0) cout<<"Mixing particle "<GetParticle(j); - UInt_t zz; - for(zz = 0; zzProcessSameEventParticles(track1); + for(ii = 0; iiProcessSameEventParticles(track1); /***************************************/ /****** filling numerators ********/ @@ -1040,6 +1059,7 @@ void AliHBTAnalysis::ProcessTracksNonIdentAnal() fTrackFunctions[ii]->ProcessSameEventParticles(trackpair); } } + if ( fBufferSize == 0) continue;//do not mix diff histograms /***************************************/ /***** Filling denominators *********/ /***************************************/ @@ -1049,7 +1069,9 @@ void AliHBTAnalysis::ProcessTracksNonIdentAnal() while ( (trackEvent3 = (AliHBTEvent*)titer.Next()) != 0x0) { - if ( (j%100) == 0) cout<<"Mixing particle "<GetNumberOfParticles() ; k++) { @@ -1059,15 +1081,13 @@ void AliHBTAnalysis::ProcessTracksNonIdentAnal() if( fPairCut->PassPairProp(trackpair)) //check pair cut - { //do not meets crietria of the pair cut - continue; - } + { //do not meets crietria of the pair cut + continue; + } else {//meets criteria of the pair cut - UInt_t ii; - for(ii = 0;iiProcessDiffEventParticles(trackpair); - + for(ii = 0;iiProcessDiffEventParticles(trackpair); } }// for particles event2 }//while event2 @@ -1102,11 +1122,10 @@ void AliHBTAnalysis::ProcessParticlesNonIdentAnal() partEvent1 = new AliHBTEvent(); partEvent1->SetOwner(kFALSE);; - cout<<"**************************************"<Start("non_id"); for (Int_t i = 0;iGetParticleEvent(i); @@ -1129,7 +1148,9 @@ void AliHBTAnalysis::ProcessParticlesNonIdentAnal() for (Int_t j = 0; jGetNumberOfParticles() ; j++) { - if ( (j%100) == 0) cout<<"Mixing particle "<GetParticle(j); @@ -1155,7 +1176,6 @@ void AliHBTAnalysis::ProcessParticlesNonIdentAnal() UInt_t ii; for(ii = 0;iiProcessSameEventParticles(partpair); } } @@ -1168,14 +1188,15 @@ void AliHBTAnalysis::ProcessParticlesNonIdentAnal() while ( (partEvent3 = (AliHBTEvent*)piter.Next()) != 0x0) { - if ( (j%100) == 0) cout<<"Mixing particle "<GetNumberOfParticles() ; k++) { part2= partEvent3->GetParticle(k); partpair->SetParticles(part1,part2); - if(fPairCut->PassPairProp(partpair) ) //check pair cut { //do not meets crietria of the pair cut continue; @@ -1185,7 +1206,6 @@ void AliHBTAnalysis::ProcessParticlesNonIdentAnal() UInt_t ii; for(ii = 0;iiProcessDiffEventParticles(partpair); } } @@ -1198,8 +1218,6 @@ void AliHBTAnalysis::ProcessParticlesNonIdentAnal() }//end of loop over events (1) -// gBenchmark->Stop("non_id"); -// gBenchmark->Show("non_id"); pbuffer.SetOwner();//to delete stered events. } @@ -1228,8 +1246,8 @@ void AliHBTAnalysis::FilterOut(AliHBTEvent* outpart1, AliHBTEvent* outpart2, Ali part = inpart->GetParticle(i); track = intrack->GetParticle(i); - if ( (cut1->Pass(part)) || ( cut1->Pass(track) ) ) in1 = kFALSE; //if any, part or track, is rejected by cut1, in1 is false - if ( (cut2->Pass(part)) || ( cut2->Pass(track) ) ) in2 = kFALSE; //if any, part or track, is rejected by cut2, in2 is false + if ( (cut1->Pass(part)) ) in1 = kFALSE; //if part is rejected by cut1, in1 is false + if ( (cut2->Pass(part)) ) in2 = kFALSE; //if part is rejected by cut2, in2 is false if (gDebug)//to be removed in real analysis if ( in1 && in2 ) //both cuts accepted, should never happen, just in case @@ -1253,11 +1271,9 @@ void AliHBTAnalysis::FilterOut(AliHBTEvent* outpart1, AliHBTEvent* outpart2, Ali continue; } } - } - - /*************************************************************************************/ + void AliHBTAnalysis::FilterOut(AliHBTEvent* out1, AliHBTEvent* out2, AliHBTEvent* in) { //Puts particles accepted as a first particle by global cut in out1 diff --git a/HBTAN/AliHBTAnalysis.h b/HBTAN/AliHBTAnalysis.h index e4483ad3a2f..808b790a66c 100644 --- a/HBTAN/AliHBTAnalysis.h +++ b/HBTAN/AliHBTAnalysis.h @@ -3,8 +3,6 @@ #include - - class AliHBTParticleCut; class AliHBTCut; class AliHBTPairCut; @@ -25,12 +23,12 @@ class AliHBTAnalysis: public TObject { public: AliHBTAnalysis(); - + AliHBTAnalysis(const AliHBTAnalysis& in); + const AliHBTAnalysis& operator=(const AliHBTAnalysis& right); virtual ~AliHBTAnalysis(); virtual void Process(Option_t* option = "TracksAndParticles"); - void SetGlobalPairCut(AliHBTPairCut* cut); void AddTrackFunction(AliHBTOnePairFctn* f); @@ -48,7 +46,8 @@ class AliHBTAnalysis: public TObject void WriteFunctions(); void SetBufferSize(Int_t buffsize){fBufferSize=buffsize;} - + void SetOwner(Bool_t owner=kTRUE){fIsOwner=owner;} + Bool_t IsOwner() const {return fIsOwner;} Bool_t IsNonIdentAnalysis(); protected: @@ -57,8 +56,7 @@ class AliHBTAnalysis: public TObject void FilterOut(AliHBTEvent* outpart1, AliHBTEvent* outpart2, AliHBTEvent* inpart, AliHBTEvent* outtrack1, AliHBTEvent* outtrack2, AliHBTEvent* intrack); void FilterOut(AliHBTEvent* out1, AliHBTEvent* out2, AliHBTEvent* in); - - AliHBTReader* fReader;//! + void DeleteFunctions(); virtual void ProcessTracks(); virtual void ProcessParticles(); @@ -67,38 +65,41 @@ class AliHBTAnalysis: public TObject virtual void ProcessTracksAndParticlesNonIdentAnal(); virtual void ProcessParticlesNonIdentAnal(); virtual void ProcessTracksNonIdentAnal(); + + AliHBTReader* fReader;//! Pointer to reader + UInt_t fNTrackFunctions; //! Number of Tracks functions + UInt_t fNParticleFunctions; //! Number of particles functions + UInt_t fNParticleAndTrackFunctions; //! Number of resolution functions + + UInt_t fNTrackMonitorFunctions; //! Number of Track Monitor functions + UInt_t fNParticleMonitorFunctions; //! Number of Particles Monitor functions + UInt_t fNParticleAndTrackMonitorFunctions; //! Number of Resolution Monitor functions + AliHBTOnePairFctn** fTrackFunctions; //!array of pointers to functions that analyze rekonstructed tracks AliHBTOnePairFctn** fParticleFunctions; //!array of pointers to functions that analyze generated particles AliHBTTwoPairFctn** fParticleAndTrackFunctions; //!array of pointers to functions that analyze both //reconstructed tracks and generated particles //i.e. - resolution analyzers + AliHBTMonOneParticleFctn** fParticleMonitorFunctions; //! array of pointers to monitoring functions + AliHBTMonOneParticleFctn** fTrackMonitorFunctions; //! which are used for single particle analysis, + AliHBTMonTwoParticleFctn** fParticleAndTrackMonitorFunctions; //! cut monitoring, etc. - AliHBTMonOneParticleFctn** fParticleMonitorFunctions; // array of pointers to monitoring functions - AliHBTMonOneParticleFctn** fTrackMonitorFunctions; // which are used for single particle analysis, - AliHBTMonTwoParticleFctn** fParticleAndTrackMonitorFunctions; // cut monitoring, etc. - - UInt_t fNTrackFunctions; //! - UInt_t fNParticleFunctions; //! - UInt_t fNParticleAndTrackFunctions; //! - - UInt_t fNParticleMonitorFunctions; //! - UInt_t fNTrackMonitorFunctions; //! - UInt_t fNParticleAndTrackMonitorFunctions; //! /**********************************************/ /* Control parameters */ + /**********************************************/ - AliHBTPairCut *fPairCut;//! + AliHBTPairCut *fPairCut;//! Pair cut applied for all mixed particles - Int_t fBufferSize; //defines the size of buffer for mixed events; -1==MIX All - /**********************************************/ - - + Int_t fBufferSize; //!defines the size of buffer for mixed events; -1==MIX All + Int_t fDisplayMixingInfo;//!defines every which particle mixing info is displayed + Bool_t fIsOwner;//!defines of all functions are supposed to be deleted while by the way of analysis defaulr false + private: - static const Int_t fgkHbtAnalyzeAll;//! static const UInt_t fgkFctnArraySize;//! -/*********************************************/ + static const UInt_t fgkDefaultMixingInfo;//! + static const Int_t fgkDefaultBufferSize;//! public: ClassDef(AliHBTAnalysis,0) };