/*
$Log$
+Revision 1.6 2000/06/14 15:19:47 morsch
+Include clean-up (IH)
+
Revision 1.5 2000/06/09 20:35:32 morsch
All coding rule violations except RS3 corrected
#include "AliPDG.h"
#include <TRandom.h>
#include <TClonesArray.h>
+#include <TParticle.h>
//
ClassImp(AliDimuCombinator)
fPartArray=Partarray;
fNParticle=fPartArray->GetEntriesFast();
- fimuon1 =0;
- fimuon2 =0;
- fmuon1 =0;
- fmuon2 =0;
- fimin1 = 0;
- fimin2 = 0;
- fimax1 = fNParticle;
- fimax2 = fNParticle;
+ fImuon1 =0;
+ fImuon2 =0;
+ fMuon1 =0;
+ fMuon2 =0;
+ fImin1 = 0;
+ fImin2 = 0;
+ fImax1 = fNParticle;
+ fImax2 = fNParticle;
fPtMin =0;
fEtaMin =-10;
fEtaMax =-10;
TParticle* AliDimuCombinator::FirstMuon()
{
// Single muon iterator: initialisation
- fimuon1=fimin1;
- fmuon1 = (TParticle*) fPartArray->UncheckedAt(fimuon1);
- while(Type(fmuon1)!=kMuonPlus && Type(fmuon1)!=kMuonMinus) {
- fimuon1++;
- if (fimuon1 >= fimax1) {fmuon1=0; break;}
- fmuon1 = (TParticle*) fPartArray->UncheckedAt(fimuon1);
+ fImuon1=fImin1;
+ fMuon1 = (TParticle*) fPartArray->UncheckedAt(fImuon1);
+ while(Type(fMuon1)!=kMuonPlus && Type(fMuon1)!=kMuonMinus) {
+ fImuon1++;
+ if (fImuon1 >= fImax1) {fMuon1=0; break;}
+ fMuon1 = (TParticle*) fPartArray->UncheckedAt(fImuon1);
}
- return fmuon1;
+ return fMuon1;
}
TParticle* AliDimuCombinator::FirstMuonSelected()
TParticle* AliDimuCombinator::NextMuon()
{
// Single muon iterator: increment
- fimuon1++;
- if (fimuon1>=fNParticle) {fmuon1 = 0; return fmuon1;}
+ fImuon1++;
+ if (fImuon1>=fNParticle) {fMuon1 = 0; return fMuon1;}
- fmuon1 = (TParticle*) fPartArray->UncheckedAt(fimuon1);
- while(Type(fmuon1)!=kMuonPlus && Type(fmuon1)!=kMuonMinus) {
- fimuon1++;
- if (fimuon1>=fimax1) {fmuon1 = 0; break;}
- fmuon1 = (TParticle*) fPartArray->UncheckedAt(fimuon1);
+ fMuon1 = (TParticle*) fPartArray->UncheckedAt(fImuon1);
+ while(Type(fMuon1)!=kMuonPlus && Type(fMuon1)!=kMuonMinus) {
+ fImuon1++;
+ if (fImuon1>=fImax1) {fMuon1 = 0; break;}
+ fMuon1 = (TParticle*) fPartArray->UncheckedAt(fImuon1);
}
- return fmuon1;
+ return fMuon1;
}
TParticle* AliDimuCombinator::NextMuonSelected()
void AliDimuCombinator::FirstPartner()
{
// Helper for dimuon iterator: initialisation
- if (fimin1==fimin2) {
- fimuon2=fimuon1+1;
+ if (fImin1==fImin2) {
+ fImuon2=fImuon1+1;
} else {
- fimuon2=fimin2;
+ fImuon2=fImin2;
}
- if (fimuon2 >= fimax2) {fmuon2=0; return;}
- fmuon2 = (TParticle*) fPartArray->UncheckedAt(fimuon2);
- while(Type(fmuon2)!=kMuonPlus && Type(fmuon2)!=kMuonMinus) {
- fimuon2++;
- if (fimuon2 >= fimax2) {fmuon2=0; break;}
- fmuon2 = (TParticle*) fPartArray->UncheckedAt(fimuon2);
+ if (fImuon2 >= fImax2) {fMuon2=0; return;}
+ fMuon2 = (TParticle*) fPartArray->UncheckedAt(fImuon2);
+ while(Type(fMuon2)!=kMuonPlus && Type(fMuon2)!=kMuonMinus) {
+ fImuon2++;
+ if (fImuon2 >= fImax2) {fMuon2=0; break;}
+ fMuon2 = (TParticle*) fPartArray->UncheckedAt(fImuon2);
}
}
{
// Helper for selected dimuon iterator: initialisation
FirstPartner();
- while(fmuon2 !=0 && !Selected(fmuon2)) {NextPartner();}
+ while(fMuon2 !=0 && !Selected(fMuon2)) {NextPartner();}
}
void AliDimuCombinator::NextPartner()
{
// Helper for dimuon iterator: increment
- fimuon2++;
- if (fimuon2>=fimax2) {fmuon2 = 0; return;}
+ fImuon2++;
+ if (fImuon2>=fImax2) {fMuon2 = 0; return;}
- fmuon2 = (TParticle*) fPartArray->UncheckedAt(fimuon2);
+ fMuon2 = (TParticle*) fPartArray->UncheckedAt(fImuon2);
- while(Type(fmuon2)!=kMuonPlus && Type(fmuon2)!=kMuonMinus) {
- fimuon2++;
- if (fimuon2>=fimax2) {fmuon2 = 0; break;}
- fmuon2 = (TParticle*) fPartArray->UncheckedAt(fimuon2);
+ while(Type(fMuon2)!=kMuonPlus && Type(fMuon2)!=kMuonMinus) {
+ fImuon2++;
+ if (fImuon2>=fImax2) {fMuon2 = 0; break;}
+ fMuon2 = (TParticle*) fPartArray->UncheckedAt(fImuon2);
}
}
{
// Helper for selected dimuon iterator: increment
NextPartner();
- while(fmuon2 !=0 && !Selected(fmuon2)) {NextPartner();}
+ while(fMuon2 !=0 && !Selected(fMuon2)) {NextPartner();}
}
TParticle* AliDimuCombinator::Partner()
{
// Returns current partner for muon to form a dimuon
- return fmuon2;
+ return fMuon2;
}
void AliDimuCombinator::FirstMuonPair(TParticle* & muon1, TParticle* & muon2)
// Dimuon iterator: initialisation
FirstMuon();
FirstPartner();
- muon1=fmuon1;
- muon2=fmuon2;
+ muon1=fMuon1;
+ muon2=fMuon2;
}
void AliDimuCombinator::NextMuonPair(TParticle* & muon1, TParticle* & muon2)
NextMuon();
FirstPartner();
}
- muon1=fmuon1;
- muon2=fmuon2;
+ muon1=fMuon1;
+ muon2=fMuon2;
}
void AliDimuCombinator::FirstMuonPairSelected(TParticle* & muon1,
TParticle* & muon2)
// Selected dimuon iterator: initialisation
FirstMuonSelected();
FirstPartnerSelected();
- muon1=fmuon1;
- muon2=fmuon2;
+ muon1=fMuon1;
+ muon2=fMuon2;
}
void AliDimuCombinator::NextMuonPairSelected(TParticle* & muon1,
NextMuonSelected();
FirstPartnerSelected();
}
- muon1=fmuon1;
- muon2=fmuon2;
+ muon1=fMuon1;
+ muon2=fMuon2;
}
void AliDimuCombinator::ResetRange()
{
// Reset index ranges for single muons
- fimin1=fimin2=0;
- fimax1=fimax2=fNParticle;
+ fImin1=fImin2=0;
+ fImax1=fImax2=fNParticle;
}
void AliDimuCombinator::SetFirstRange(Int_t from, Int_t to)
{
// Reset index range for first muon
- fimin1=from;
- fimax1=to;
- if (fimax1 > fNParticle) fimax1=fNParticle;
+ fImin1=from;
+ fImax1=to;
+ if (fImax1 > fNParticle) fImax1=fNParticle;
}
void AliDimuCombinator::SetSecondRange(Int_t from, Int_t to)
{
// Reset index range for second muon
- fimin2=from;
- fimax2=to;
- if (fimax2 > fNParticle) fimax2=fNParticle;
+ fImin2=from;
+ fImax2=to;
+ if (fImax2 > fNParticle) fImax2=fNParticle;
}
//
// Selection
return iparent;
}
+Int_t AliDimuCombinator::Type(TParticle *part)
+{
+// Return particle type for
+return part->GetPdgCode();
+}
+
AliDimuCombinator& AliDimuCombinator::operator=(const AliDimuCombinator& rhs)
{
// Assignment operator
* See cxx source for full Copyright notice */
/* $Id$ */
-#include <TParticle.h>
#include <TObject.h>
+#include <TParticle.h>
class TClonesArray;
class TParticle;
void SmearGauss(Float_t width, Float_t & value);
// Weight
Bool_t Correlated(TParticle* part1, TParticle* part2);
- void SetRate(Float_t rate){fRate1=rate;}
- void SetRate(Float_t rate1, Float_t rate2 ){fRate1=rate1; fRate2=rate2;}
+ void SetRate(Float_t rate) {fRate1=rate;}
+ void SetRate(Float_t rate1, Float_t rate2 ) {fRate1=rate1; fRate2=rate2;}
Float_t Weight(TParticle* part);
Float_t Weight(TParticle* part1, TParticle* part);
Float_t DecayProbability(TParticle* part);
Int_t Origin(TParticle* part);
TParticle* Parent(TParticle* part);
TParticle* Partner();
- Int_t Type(TParticle *part) {return part->GetPdgCode();}
-private:
+ Int_t Type(TParticle *part);
+ private:
TClonesArray *fPartArray; // MC Event
Int_t fNParticle; // Number of particles
- Int_t fimuon1; // Index of first muon
- Int_t fimuon2; // Index of second muon
- Int_t fimin1; // Lowest index for first muon
- Int_t fimin2; // Lowest index for second muon
- Int_t fimax1; // Highest index for first muon
- Int_t fimax2; // Highest index for second muon
+ Int_t fImuon1; // Index of first muon
+ Int_t fImuon2; // Index of second muon
+ Int_t fImin1; // Lowest index for first muon
+ Int_t fImin2; // Lowest index for second muon
+ Int_t fImax1; // Highest index for first muon
+ Int_t fImax2; // Highest index for second muon
Float_t fRate1; // weight factor
Float_t fRate2; // weight factor
- TParticle *fmuon1; // First muon
- TParticle *fmuon2; // Second muon
+ TParticle *fMuon1; // First muon
+ TParticle *fMuon2; // Second muon
Float_t fPtMin; // pT-cut
Float_t fEtaMin; // Minimum pseudorapidity cut
Float_t fEtaMax; // Maximum pseudorapidity cut
+
+
+