Coding rule violations corrected.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 14 Nov 2003 08:21:29 +0000 (08:21 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 14 Nov 2003 08:21:29 +0000 (08:21 +0000)
EVGEN/AliDimuCombinator.cxx
EVGEN/AliDimuCombinator.h

index 4d64b095f9044f9f103401a8e8f90a36aab147e0..d74079ba841c11cf43682854efc45fbd4e8bd8c1 100644 (file)
 
 /* $Id$ */
 
-/ 
- Class for dimuon analysis and fast dimuon simulation.
- It provides single and dimuon iterators, cuts, weighting, kinematic
- It uses the AliRun particle tree.
- Comments and suggestions to 
- andreas.morsch@cern.ch
-*/
+// 
+// Class for dimuon analysis and fast dimuon simulation.
+// It provides single and dimuon iterators, cuts, weighting, kinematic
+// It uses the AliRun particle tree.
+// Comments and suggestions to 
+// andreas.morsch@cern.ch
+
 
 #include <TClonesArray.h>
 #include <TParticle.h>
@@ -65,8 +65,10 @@ AliDimuCombinator::AliDimuCombinator(const AliDimuCombinator & combinator)
 //
 //                       Iterators
 // 
-TParticle* AliDimuCombinator::Particle(Int_t i)
+TParticle* AliDimuCombinator::Particle(Int_t i) const
 {
+//  Return next particle
+//
     return gAlice->GetMCApp()->Particle(i);
 }
 
@@ -165,7 +167,7 @@ void AliDimuCombinator::NextPartnerSelected()
 }
 
 
-TParticle*  AliDimuCombinator::Partner()
+TParticle*  AliDimuCombinator::Partner() const
 {
 // Returns current partner for muon to form a dimuon
     return fMuon2;
@@ -240,7 +242,7 @@ void AliDimuCombinator::SetSecondRange(Int_t from, Int_t to)
 //                       Selection
 //
 
-Bool_t AliDimuCombinator::Selected(TParticle* part)
+Bool_t AliDimuCombinator::Selected(TParticle* part) const
 {
 // Selection cut for single muon 
 //
@@ -253,7 +255,7 @@ Bool_t AliDimuCombinator::Selected(TParticle* part)
     }
 }
 
-Bool_t AliDimuCombinator::Selected(TParticle* part1, TParticle* part2)
+Bool_t AliDimuCombinator::Selected(TParticle* part1, TParticle* part2) const
 {
 // Selection cut for dimuons
 //
@@ -262,7 +264,7 @@ Bool_t AliDimuCombinator::Selected(TParticle* part1, TParticle* part2)
 //
 //                       Kinematics
 //
-Float_t AliDimuCombinator::Mass(TParticle* part1, TParticle* part2)
+Float_t AliDimuCombinator::Mass(TParticle* part1, TParticle* part2) const
 {
 // Invariant mass
 //
@@ -279,7 +281,7 @@ Float_t AliDimuCombinator::Mass(TParticle* part1, TParticle* part2)
     }
 }
 
-Float_t AliDimuCombinator::PT(TParticle* part1, TParticle* part2)
+Float_t AliDimuCombinator::PT(TParticle* part1, TParticle* part2) const
 {
 // Transverse momentum of dimuons
 //
@@ -289,14 +291,14 @@ Float_t AliDimuCombinator::PT(TParticle* part1, TParticle* part2)
     return TMath::Sqrt(px*px+py*py);
 }
 
-Float_t AliDimuCombinator::Pz(TParticle* part1, TParticle* part2)
+Float_t AliDimuCombinator::Pz(TParticle* part1, TParticle* part2) const
 {
 // Pz of dimuon system
 //
     return part1->Pz()+part2->Pz();
 }
 
-Float_t AliDimuCombinator::Y(TParticle* part1, TParticle* part2)
+Float_t AliDimuCombinator::Y(TParticle* part1, TParticle* part2) const
 {
 // Rapidity of dimuon system
 //
@@ -307,7 +309,7 @@ Float_t AliDimuCombinator::Y(TParticle* part1, TParticle* part2)
 }
 //                  Response
 //
-void AliDimuCombinator::SmearGauss(Float_t width, Float_t & value)
+void AliDimuCombinator::SmearGauss(Float_t width, Float_t & value) const
 {
 // Apply gaussian smearing
 //
@@ -316,7 +318,7 @@ void AliDimuCombinator::SmearGauss(Float_t width, Float_t & value)
 //              Weighting
 // 
 
-Float_t AliDimuCombinator::DecayProbability(TParticle* part)
+Float_t AliDimuCombinator::DecayProbability(TParticle* part) const
 {
 // Calculate decay probability for muons from pion and kaon decays
 // 
@@ -365,7 +367,7 @@ Float_t AliDimuCombinator::DecayProbability(TParticle* part)
 //End_Html
 
 
-Float_t AliDimuCombinator::Weight(TParticle* part1, TParticle* part2)
+Float_t AliDimuCombinator::Weight(TParticle* part1, TParticle* part2) const
 {
 // Dimuon weight
 
@@ -432,39 +434,32 @@ Indeed the 2 muons come from the same mother so the
 //End_Html
 
 
-Float_t AliDimuCombinator::Weight(TParticle* part)
+Float_t AliDimuCombinator::Weight(TParticle* part) const
 {
 // Single muon weight
     return (part->GetWeight())*(Parent(part)->GetWeight())*fRate1;
 }
 
-Bool_t  AliDimuCombinator::Correlated(TParticle* part1, TParticle* part2)
+Bool_t  AliDimuCombinator::Correlated(TParticle* part1, TParticle* part2) const
 {
 // Check if muons are correlated
 //
     if ((Origin(part1) >= 0) && Origin(part1) == Origin(part2)) {
-/*
-       printf("\n origin %d %d ", 
-              Type(Particle(Origin(part1))),
-              Type(Particle(Origin(part2))));
-       printf("\n parent %d %d \n \n ", 
-              Type(Parent(part1)),
-              Type(Parent(part2)));
-*/     
+
        return kTRUE;
     } else {
        return kFALSE;
     }
 }
 
-TParticle* AliDimuCombinator::Parent(TParticle* part)
+TParticle* AliDimuCombinator::Parent(TParticle* part) const
 {
 // Return pointer to parent
 //
     return Particle(part->GetFirstMother());
 }
 
-Int_t AliDimuCombinator::Origin(TParticle* part)
+Int_t AliDimuCombinator::Origin(TParticle* part) const
 {
 // Return pointer to primary particle
 //
@@ -482,7 +477,7 @@ Int_t AliDimuCombinator::Origin(TParticle* part)
     return iparent;
 }
 
-Int_t AliDimuCombinator::Type(TParticle *part) 
+Int_t AliDimuCombinator::Type(TParticle *part)  const
 {
 // Return particle type for 
 return part->GetPdgCode();
index 5eec3444e94f2804288ab851b146e2e5b1e91c74..d1bbdb7c2166151ff5f1daf0368cf8bd23cd4ca2 100644 (file)
@@ -26,7 +26,7 @@ public:
 //    
 //  Iterators
 //  Access to particle stack
-    TParticle* Particle(Int_t i);
+    TParticle* Particle(Int_t i) const;
 //  Single muons
     TParticle* FirstMuon();
     TParticle* NextMuon();
@@ -48,32 +48,32 @@ public:
     void SetPtMin(Float_t ptmin) {fPtMin=ptmin;}
     void SetEtaCut(Float_t etamin, Float_t etamax)
        {fEtaMin=etamin; fEtaMax=etamax;}
-    Bool_t Selected(TParticle* part);
-    Bool_t Selected(TParticle* part1, TParticle* part2);
+    Bool_t Selected(TParticle* part) const;
+    Bool_t Selected(TParticle* part1, TParticle* part2) const;
 // Kinematics
-    Float_t Mass(TParticle* part1, TParticle* part);
-    Float_t PT(TParticle* part1, TParticle* part);
-    Float_t Pz(TParticle* part1, TParticle* part);
-    Float_t Y(TParticle* part1, TParticle* part);
+    Float_t Mass(TParticle* part1, TParticle* part) const;
+    Float_t PT(TParticle* part1, TParticle* part) const;
+    Float_t Pz(TParticle* part1, TParticle* part) const;
+    Float_t Y(TParticle* part1, TParticle* part) const;
 // Response
-    void SmearGauss(Float_t width, Float_t & value);
+    void SmearGauss(Float_t width, Float_t & value) const;
 // Weight
-    Bool_t  Correlated(TParticle* part1, TParticle* part2);
+    Bool_t  Correlated(TParticle* part1, TParticle* part2) const;
     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);
+    Float_t Weight(TParticle* part) const;
+    Float_t Weight(TParticle* part1, TParticle* part) const;
+    Float_t DecayProbability(TParticle* part) const;
     
  private:
     void FirstPartner();
     void NextPartner();
     void FirstPartnerSelected();
     void NextPartnerSelected();
-    Int_t Origin(TParticle* part);
-    TParticle* Parent(TParticle* part);
-    TParticle* Partner();
-    Int_t Type(TParticle *part);
+    Int_t Origin(TParticle* part) const;
+    TParticle* Parent(TParticle* part) const;
+    TParticle* Partner() const;
+    Int_t Type(TParticle *part) const;
     AliDimuCombinator(const AliDimuCombinator &combinator);
     AliDimuCombinator & operator=(const AliDimuCombinator & rhs);