-//
-// Class AliRsnPairDef
-//
-// Defines a decay channel for a resonance,
-// resulting in a specified PDG code for the mother,
-// and the particle type for the daughters, defined
-// according to the internal PID format of the package
-//
-// author: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
-//
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// This class is a simple set of definitions which are used to define a
+// decay tree to be studied for a resonance, in terms of the PID and charge
+// of its candidate daughters, which in turn determins what kind of objects
+// the analysis must take into account.
+// This object contains two AliRsnDaughterDef which define a model for each
+// of the two expected daughters (see also AliRsnDaughterDef class) plus a
+// mass hypothesis for the resonance, which is used for computin quantities
+// which need it (like rapidity or Mt), and a PDG code, which is used to
+// check for true pairs, when needed. In all other cases, these two additional
+// values can be left to their default (meaningless) value.
+// Since this object must define a decay channel, the only provided constructor
+// allow to set a PID and a charge.
+//
+// authors: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
+// M. Vala (martin.vala@cern.ch)
+//
+////////////////////////////////////////////////////////////////////////////////
#include "AliLog.h"
-#include "AliRsnDaughter.h"
+#include "AliRsnMother.h"
#include "AliRsnPairDef.h"
ClassImp(AliRsnPairDef)
//_____________________________________________________________________________
-AliRsnPairDef::AliRsnPairDef() : fMotherPDG(0)
+AliRsnPairDef::AliRsnPairDef() :
+ fMotherMass(0.0),
+ fMotherPDG(0),
+ fDef1(),
+ fDef2()
{
//
-// Empty constructor.
-// Initializes the data members to default values:
-// - no definition of particles in the pair;
-// - histogram binning undefined.
-// When using this constructor, all analysis elements (particles, histogram)
-// must be defined before starting event processing.
+// Constructor.
+// If the two pointers are well initialized, they are used to init the members.
//
-
- Int_t i;
- for (i = 0; i < 2; i++)
- {
- fCharge[i] = '0';
- fMass[i] = 0.0;
- fType[i] = AliRsnPID::kUnknown;
- }
}
//_____________________________________________________________________________
AliRsnPairDef::AliRsnPairDef
-(Char_t sign1, AliRsnPID::EType type1, Char_t sign2, AliRsnPID::EType type2, Int_t motherPDG) :
- fMotherPDG(motherPDG)
+(EPARTYPE type1, Char_t ch1, EPARTYPE type2, Char_t ch2, Int_t pdg, Double_t mass) :
+ fMotherMass(mass),
+ fMotherPDG(pdg),
+ fDef1(type1, ch1),
+ fDef2(type2, ch2)
{
//
-// Constructor with arguments.
-// This constructor allows to define all the working parameters.
+// Constructor.
+// If the two pointers are well initialized, they are used to init the members.
//
-
- SetPair(sign1, type1, sign2, type2);
}
//_____________________________________________________________________________
AliRsnPairDef::AliRsnPairDef
-(AliRsnPID::EType type1, Char_t sign1, AliRsnPID::EType type2, Char_t sign2, Int_t motherPDG) :
- fMotherPDG(motherPDG)
+(AliRsnDaughter::ESpecies type1, Char_t ch1, AliRsnDaughter::ESpecies type2, Char_t ch2, Int_t pdg, Double_t mass) :
+ fMotherMass(mass),
+ fMotherPDG(pdg),
+ fDef1(type1, ch1),
+ fDef2(type2, ch2)
{
//
-// Constructor with arguments.
-// This constructor allows to define all the working parameters.
+// Constructor.
+// If the two pointers are well initialized, they are used to init the members.
//
-
- SetPair(sign1, type1, sign2, type2);
}
-
-
+
//_____________________________________________________________________________
AliRsnPairDef::AliRsnPairDef(const AliRsnPairDef ©) :
- TObject(copy),
- fMotherPDG(copy.fMotherPDG)
+ TObject(copy),
+ fMotherMass(copy.fMotherMass),
+ fMotherPDG(copy.fMotherPDG),
+ fDef1(copy.fDef1),
+ fDef2(copy.fDef2)
{
//
// Copy constructor with standard behavior
//
-
- SetPair(copy.fCharge[0], copy.fType[0], copy.fCharge[1], copy.fType[1]);
}
//_____________________________________________________________________________
// Assignment operator with standard behavior.
//
- fMotherPDG = copy.fMotherPDG;
- SetPair(copy.fCharge[0], copy.fType[0], copy.fCharge[1], copy.fType[1]);
-
- return (*this);
-}
-
-//_____________________________________________________________________________
-Bool_t AliRsnPairDef::SetPairElement(Int_t i, Char_t charge, AliRsnPID::EType type)
-{
-//
-// Set one element of the pair
-// and returns warnings if the type is not valid.
-//
- if (i < 0 || i > 1)
- {
- AliError("Index out of range");
- return kFALSE;
- }
- if (charge != '+' && charge != '-')
- {
- AliError(Form("Character '%c' not recognized as charge sign"));
- return kFALSE;
- }
- if (type < AliRsnPID::kElectron && type > AliRsnPID::kUnknown)
- {
- AliError("Type index out of enumeration range");
- return kFALSE;
- }
- fCharge[i] = charge;
- fType[i] = type;
- fMass[i] = AliRsnPID::ParticleMass(type);
-
- return kTRUE;
-}
-
-//_____________________________________________________________________________
-Bool_t AliRsnPairDef::SetPair
-(Char_t charge1, AliRsnPID::EType type1, Char_t charge2, AliRsnPID::EType type2)
-{
-//
-// Set both elements of the pair,
-// returning logical AND of check for each one.
-//
- Bool_t part1 = SetPairElement(0, charge1, type1);
- Bool_t part2 = SetPairElement(1, charge2, type2);
-
- return (part1 && part2);
-}
-
-//_____________________________________________________________________________
-Double_t AliRsnPairDef::ComputeWeight(AliRsnDaughter *d0, AliRsnDaughter *d1)
-{
-//
-// Compute a weight for filling the histograms:
-// probability of first track to be identified as 'type[0]' times
-// the probability of second track to be identified as 'type[1]',
-// according to the order of appearance in argument list.
-//
-
- Double_t prob0 = d0->PIDProb()[fType[0]];
- Double_t prob1 = d1->PIDProb()[fType[1]];
-
- return prob0*prob1;
-}
-
-//_____________________________________________________________________________
-TString AliRsnPairDef::GetPairName()
-{
-//
-// Returns a compact string with the name of the pair,
-// to be used for naming objects related to it.
-//
-
- TString sName;
- sName += AliRsnPID::ParticleName(fType[0]);
- sName += fCharge[0];
- sName += AliRsnPID::ParticleName(fType[1]);
- sName += fCharge[1];
+ fMotherMass = copy.fMotherMass;
+ fMotherPDG = copy.fMotherPDG;
+ fDef1 = copy.fDef1;
+ fDef2 = copy.fDef2;
- return sName;
+ return (*this);
}