X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=ANALYSIS%2FAliAODParticleCut.cxx;h=27d38e34108f7c37d8562f84200c82f5024cffe6;hp=bf5c977bb0e35d00e30f71c2c269f7475633e759;hb=f9f11a4bba2fd55c0f9c1479433ef7e61c6b552c;hpb=fb734f7024ef4b04be6338097eec88a0e904c1a3 diff --git a/ANALYSIS/AliAODParticleCut.cxx b/ANALYSIS/AliAODParticleCut.cxx index bf5c977bb0e..27d38e34108 100644 --- a/ANALYSIS/AliAODParticleCut.cxx +++ b/ANALYSIS/AliAODParticleCut.cxx @@ -4,20 +4,31 @@ // // // class AliAODParticleCut // // // -// Classes for single particle cuts // -// User should use only AliAODParticleCut, eventually // -// EmptyCut which passes all particles // +// Classes for single particle cuts. // +// User should use mainly AliAODParticleCut interface methods, // +// eventually EmptyCut which passes all particles. // +// // // There is all interface for setting cuts on all particle properties // -// The main method is Pass - which returns // +// The main method is Rejected - which returns // // True to reject particle // // False in case it meets all the criteria of the given cut // // // -// User should create (and also destroy) cuts himself // -// and then pass them to the Analysis And Function by a proper method // +// This class has the list of base particle cuts that perform check on // +// single property. Particle is rejected if any of cuts rejects it. // +// There are implemented logical base cuts that perform logical // +// operations on results of two other base cuts. Using them user can // +// create a tree structure of a base cuts that performs sophisticated // +// cut. // +// // +// User can also implement a base cut that performs complicated // +// calculations, if it is only more convenient and/or efficint. // // // +// User should delete created cuts himself // +// because when setting a cut, other objects (functions,analyses, // +// readers, other cuts) make their own copy of a cut. // // // -// more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html // -// responsible: Piotr Skowronski@cern.ch // +// more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html // +// responsible: Piotr Skowronski@cern.ch // // // //////////////////////////////////////////////////////////////////////////// @@ -120,7 +131,7 @@ void AliAODParticleCut::AddBasePartCut(AliAODParticleBaseCut* basecut) } /******************************************************************/ -AliAODParticleBaseCut* AliAODParticleCut::FindCut(EAODCutProperty property) +AliAODParticleBaseCut* AliAODParticleCut::FindCut(AliAODParticleBaseCut::EAODCutProperty property) { //returns pointer to the cut checking the given property for (Int_t i = 0;iSetRange(min,max); else fCuts[fNCuts++] = new AliAODMomentumCut(min,max); } @@ -147,7 +158,7 @@ void AliAODParticleCut::SetMomentumRange(Double_t min, Double_t max) void AliAODParticleCut::SetPtRange(Double_t min, Double_t max) { //name self descriptive - AliAODPtCut* cut= (AliAODPtCut*)FindCut(kAODPt); + AliAODPtCut* cut= (AliAODPtCut*)FindCut(AliAODParticleBaseCut::kAODPt); if(cut) cut->SetRange(min,max); else fCuts[fNCuts++] = new AliAODPtCut(min,max); @@ -157,7 +168,7 @@ void AliAODParticleCut::SetPtRange(Double_t min, Double_t max) void AliAODParticleCut::SetEnergyRange(Double_t min, Double_t max) { //name self descriptive - AliAODEnergyCut* cut= (AliAODEnergyCut*)FindCut(kAODE); + AliAODEnergyCut* cut= (AliAODEnergyCut*)FindCut(AliAODParticleBaseCut::kAODE); if(cut) cut->SetRange(min,max); else fCuts[fNCuts++] = new AliAODEnergyCut(min,max); @@ -167,7 +178,7 @@ void AliAODParticleCut::SetEnergyRange(Double_t min, Double_t max) void AliAODParticleCut::SetRapidityRange(Double_t min, Double_t max) { //name self descriptive - AliAODParticleBaseCut* cut = FindCut(kAODRapidity); + AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODRapidity); if(cut) cut->SetRange(min,max); else fCuts[fNCuts++] = new AliAODRapidityCut(min,max); @@ -177,7 +188,7 @@ void AliAODParticleCut::SetRapidityRange(Double_t min, Double_t max) void AliAODParticleCut::SetPseudoRapidityRange(Double_t min, Double_t max) { //name self descriptive - AliAODParticleBaseCut* cut = FindCut(kAODPseudoRapidity); + AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODPseudoRapidity); if(cut) cut->SetRange(min,max); else fCuts[fNCuts++] = new AliAODPseudoRapidityCut(min,max); @@ -187,7 +198,7 @@ void AliAODParticleCut::SetPseudoRapidityRange(Double_t min, Double_t max) void AliAODParticleCut::SetPxRange(Double_t min, Double_t max) { //name self descriptive - AliAODParticleBaseCut* cut = FindCut(kAODPx); + AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODPx); if(cut) cut->SetRange(min,max); else fCuts[fNCuts++] = new AliAODPxCut(min,max); } @@ -196,7 +207,7 @@ void AliAODParticleCut::SetPxRange(Double_t min, Double_t max) void AliAODParticleCut::SetPyRange(Double_t min, Double_t max) { //name self descriptive - AliAODParticleBaseCut* cut = FindCut(kAODPy); + AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODPy); if(cut) cut->SetRange(min,max); else fCuts[fNCuts++] = new AliAODPyCut(min,max); } @@ -205,7 +216,7 @@ void AliAODParticleCut::SetPyRange(Double_t min, Double_t max) void AliAODParticleCut::SetPzRange(Double_t min, Double_t max) { //name self descriptive - AliAODParticleBaseCut* cut = FindCut(kAODPz); + AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODPz); if(cut) cut->SetRange(min,max); else fCuts[fNCuts++] = new AliAODPzCut(min,max); } @@ -214,7 +225,7 @@ void AliAODParticleCut::SetPzRange(Double_t min, Double_t max) void AliAODParticleCut::SetPhiRange(Double_t min, Double_t max) { //name self descriptive - AliAODParticleBaseCut* cut = FindCut(kAODPhi); + AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODPhi); if(cut) cut->SetRange(min,max); else fCuts[fNCuts++] = new AliAODPhiCut(min,max); } @@ -223,7 +234,7 @@ void AliAODParticleCut::SetPhiRange(Double_t min, Double_t max) void AliAODParticleCut::SetThetaRange(Double_t min, Double_t max) { //name self descriptive - AliAODParticleBaseCut* cut = FindCut(kAODTheta); + AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODTheta); if(cut) cut->SetRange(min,max); else fCuts[fNCuts++] = new AliAODThetaCut(min,max); } @@ -232,7 +243,7 @@ void AliAODParticleCut::SetThetaRange(Double_t min, Double_t max) void AliAODParticleCut::SetVxRange(Double_t min, Double_t max) { //name self descriptive - AliAODParticleBaseCut* cut = FindCut(kAODVx); + AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODVx); if(cut) cut->SetRange(min,max); else fCuts[fNCuts++] = new AliAODVxCut(min,max); } @@ -241,7 +252,7 @@ void AliAODParticleCut::SetVxRange(Double_t min, Double_t max) void AliAODParticleCut::SetVyRange(Double_t min, Double_t max) { //name self descriptive - AliAODParticleBaseCut* cut = FindCut(kAODVy); + AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODVy); if(cut) cut->SetRange(min,max); else fCuts[fNCuts++] = new AliAODVyCut(min,max); } @@ -250,7 +261,7 @@ void AliAODParticleCut::SetVyRange(Double_t min, Double_t max) void AliAODParticleCut::SetVzRange(Double_t min, Double_t max) { //name self descriptive - AliAODParticleBaseCut* cut = FindCut(kAODVz); + AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODVz); if(cut) cut->SetRange(min,max); else fCuts[fNCuts++] = new AliAODVzCut(min,max); } @@ -305,8 +316,8 @@ void AliAODParticleCut::Print(void) const /******************************************************************/ /******************************************************************/ - ClassImp(AliAODParticleEmptyCut) + void AliAODParticleEmptyCut::Streamer(TBuffer &b) { //stramer @@ -315,173 +326,3 @@ void AliAODParticleEmptyCut::Streamer(TBuffer &b) /******************************************************************/ /******************************************************************/ /******************************************************************/ - -/******************************************************************/ -/******************************************************************/ -/******************************************************************/ - -ClassImp(AliAODParticleBaseCut) -void AliAODParticleBaseCut::Print(void) const -{ - // prints the information anout the base cut to stdout - cout<<"fMin="<Clone():0x0), - fSecond((second)?(AliAODParticleBaseCut*)second->Clone():0x0) -{ - //ctor - if ( (fFirst && fSecond) == kFALSE) - { - Fatal("AliAODLogicalOperCut","One of parameters is NULL!"); - } -} -/******************************************************************/ - -AliAODLogicalOperCut::~AliAODLogicalOperCut() -{ - //destructor - delete fFirst; - delete fSecond; -} -/******************************************************************/ - -Bool_t AliAODLogicalOperCut::AliAODDummyBaseCut::Rejected(AliVAODParticle* /*part*/) const -{ - //checks if particles passes properties defined by this cut - Warning("Pass","You are using dummy base cut! Probobly some logical cut is not set up properly"); - return kFALSE;//accept -} -/******************************************************************/ - -void AliAODLogicalOperCut::Streamer(TBuffer &b) -{ - // Stream all objects in the array to or from the I/O buffer. - UInt_t R__s, R__c; - if (b.IsReading()) - { - delete fFirst; - delete fSecond; - fFirst = 0x0; - fSecond = 0x0; - - b.ReadVersion(&R__s, &R__c); - TObject::Streamer(b); - b >> fFirst; - b >> fSecond; - b.CheckByteCount(R__s, R__c,AliAODLogicalOperCut::IsA()); - } - else - { - R__c = b.WriteVersion(AliAODLogicalOperCut::IsA(), kTRUE); - TObject::Streamer(b); - b << fFirst; - b << fSecond; - b.SetByteCount(R__c, kTRUE); - } -} - -/******************************************************************/ -ClassImp(AliAODOrCut) - -Bool_t AliAODOrCut::Rejected(AliVAODParticle * p) const -{ - //returns true when rejected - //AND operation is a little bit misleading but is correct - //User wants to build logical cuts with natural (positive) logic - //while AODAN use inernally reverse (returns true when rejected) - if (fFirst->Rejected(p) && fSecond->Rejected(p)) return kTRUE;//rejected (both rejected, returned kTRUE) - return kFALSE;//accepted, at least one accepted (returned kFALSE) -} -/******************************************************************/ - -ClassImp(AliAODAndCut) - -Bool_t AliAODAndCut::Rejected(AliVAODParticle * p) const -{ - //returns true when rejected - //OR operation is a little bit misleading but is correct - //User wants to build logical cuts with natural (positive) logic - //while AODAN use inernally reverse (returns true when rejected) - if (fFirst->Rejected(p) || fSecond->Rejected(p)) return kTRUE;//rejected (any of two rejected(returned kTRUE) ) - return kFALSE;//accepted (both accepted (returned kFALSE)) -} -/******************************************************************/