#include "AliHBTPairCut.h"
#include "AliHBTPair.h"
-#include <iostream.h>
-
ClassImp(AliHBTPairCut)
const Int_t AliHBTPairCut::fkgMaxCuts = 50;
/**********************************************************/
-AliHBTPairCut::AliHBTPairCut()
+AliHBTPairCut::AliHBTPairCut():
+ fNCuts(0)
{
//constructor
fFirstPartCut = new AliHBTEmptyParticleCut(); //empty cuts
fSecondPartCut= new AliHBTEmptyParticleCut(); //empty cuts
fCuts = new AliHbtBasePairCut*[fkgMaxCuts];
- fNCuts = 0;
}
/**********************************************************/
AliHBTPairCut::AliHBTPairCut(const AliHBTPairCut& in)
{
- //copy constructor
+//copy constructor
fCuts = new AliHbtBasePairCut*[fkgMaxCuts];
fNCuts = in.fNCuts;
AliHBTPairCut::~AliHBTPairCut()
{
//destructor
+ if (fFirstPartCut != fSecondPartCut)
+ {
+ delete fSecondPartCut;
+ }
+ delete fFirstPartCut;
for (Int_t i = 0;i<fNCuts;i++)
{
delete fCuts[i];
//if NOT returns TRUE
if(!pair)
{
- Warning("Pass()","No Pasaran! We never accept NULL pointers");
+ Warning("Pass","No Pasaran! We never accept NULL pointers");
return kTRUE;
}
//check particle's cuts
- if( ( fFirstPartCut->Pass( pair->Particle1() ) ) ||
- ( fSecondPartCut->Pass(pair->Particle2() ) ) )
+ if( ( fFirstPartCut->Pass( pair->Particle1()) ) ||
+ ( fSecondPartCut->Pass(pair->Particle2()) ) )
{
return kTRUE;
}
-
+ return PassPairProp(pair);
+}
+/**********************************************************/
+
+Bool_t AliHBTPairCut::PassPairProp(AliHBTPair* pair)
+{
+//methods which checks if given pair meets all criteria of the cut
+//if it meets returns FALSE
+//if NOT returns TRUE
//examine all base pair cuts
for (Int_t i = 0;i<fNCuts;i++)
{
if ( (fCuts[i]->Pass(pair)) ) return kTRUE; //if one of the cuts reject, then reject
}
-
-// cout<<"passed "<<pair->Particle1()->GetPdgCode()<<" "<<pair->Particle2()->GetPdgCode()<<endl;
return kFALSE;
}
/**********************************************************/
}
/**********************************************************/
+void AliHBTPairCut::SetKStarRange(Double_t min, Double_t max)
+{
+ AliHBTKStarCut* cut= (AliHBTKStarCut*)FindCut(kHbtPairCutPropKStar);
+ if(cut) cut->SetRange(min,max);
+ else fCuts[fNCuts++] = new AliHBTKStarCut(min,max);
+}
+/**********************************************************/
+
AliHbtBasePairCut* AliHBTPairCut::FindCut(AliHBTPairCutProperty property)
{
for (Int_t i = 0;i<fNCuts;i++)
void AliHBTPairCut::Streamer(TBuffer &b)
{
- // Stream all objects in the array to or from the I/O buffer.
+ // Stream all objects in the array to or from the I/O buffer.
UInt_t R__s, R__c;
if (b.IsReading())
Version_t v = b.ReadVersion(&R__s, &R__c);
if (v > -1)
{
+ delete fFirstPartCut;
+ delete fSecondPartCut;
+ fFirstPartCut = 0x0;
+ fSecondPartCut = 0x0;
TObject::Streamer(b);
b >> fFirstPartCut;
b >> fSecondPartCut;