Fixed most coding violations.
authorkaamodt <kaamodt@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 May 2009 12:44:30 +0000 (12:44 +0000)
committerkaamodt <kaamodt@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 May 2009 12:44:30 +0000 (12:44 +0000)
PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx
PWG4/GammaConv/AliAnalysisTaskGammaConversion.h

index 8e983c93e5bad469b12c45a8eaf1d955bda4f8ac..c1b7ab1b0429d9cd3cbac819af212b1f8c5092d9 100644 (file)
@@ -26,7 +26,7 @@
 #include "AliAnalysisTaskGammaConversion.h"\r
 #include "AliStack.h"\r
 #include "AliLog.h"\r
-#include <vector>\r
+#include "TNtuple.h"\r
 \r
 class AliKFVertex;\r
 class AliAODHandler;\r
@@ -58,8 +58,8 @@ AliAnalysisTaskSE(),
   fMCGammaChic(),\r
   fKFReconstructedGammas(),\r
   fIsTrueReconstructedGammas(),\r
-  electronv1(),\r
-  electronv2(),\r
+  fElectronv1(),\r
+  fElectronv2(),\r
   fElectronMass(-1),\r
   fGammaMass(-1),\r
   fPi0Mass(-1),\r
@@ -96,8 +96,8 @@ AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion(const char* name)
   fMCGammaChic(),\r
   fKFReconstructedGammas(),\r
   fIsTrueReconstructedGammas(),\r
-  electronv1(),\r
-  electronv2(),\r
+  fElectronv1(),\r
+  fElectronv2(),\r
   fElectronMass(-1),\r
   fGammaMass(-1),\r
   fPi0Mass(-1),\r
@@ -158,8 +158,8 @@ void AliAnalysisTaskGammaConversion::Exec(Option_t */*option*/)
        \r
   fKFReconstructedGammas.clear();\r
   fIsTrueReconstructedGammas.clear();\r
-  electronv1.clear();\r
-  electronv2.clear();\r
+  fElectronv1.clear();\r
+  fElectronv2.clear();\r
        \r
   //Clear the data in the v0Reader\r
   fV0Reader->UpdateEventByEventData();\r
@@ -556,7 +556,8 @@ void AliAnalysisTaskGammaConversion::ProcessMCData(){
 \r
 \r
 void AliAnalysisTaskGammaConversion::FillNtuple(){\r
-       \r
+  //Fills the ntuple with the different values\r
+\r
   if(fGammaNtuple == NULL){\r
     return;\r
   }\r
@@ -605,6 +606,7 @@ void AliAnalysisTaskGammaConversion::FillNtuple(){
 }\r
 \r
 void AliAnalysisTaskGammaConversion::ProcessV0sNoCut(){\r
+  // Process all the V0's without applying any cuts to it\r
 \r
   Int_t numberOfV0s = fV0Reader->GetNumberOfV0s();\r
   for(Int_t i=0;i<numberOfV0s;i++){\r
@@ -732,8 +734,8 @@ void AliAnalysisTaskGammaConversion::ProcessV0s(){
     // end mapping\r
                \r
     fKFReconstructedGammas.push_back(*fV0Reader->GetMotherCandidateKFCombination());\r
-    electronv1.push_back(fV0Reader->GetCurrentV0()->GetPindex());\r
-    electronv2.push_back(fV0Reader->GetCurrentV0()->GetNindex());\r
+    fElectronv1.push_back(fV0Reader->GetCurrentV0()->GetPindex());\r
+    fElectronv2.push_back(fV0Reader->GetCurrentV0()->GetNindex());\r
 \r
                \r
     //----------------------------------- checking for "real" conversions (MC match) --------------------------------------\r
@@ -842,10 +844,10 @@ void AliAnalysisTaskGammaConversion::ProcessGammasForNeutralMesonAnalysis(){
       AliKFParticle * twoGammaDecayCandidateDaughter0 = &fKFReconstructedGammas[firstGammaIndex];\r
       AliKFParticle * twoGammaDecayCandidateDaughter1 = &fKFReconstructedGammas[secondGammaIndex];\r
       \r
-      if(electronv1[firstGammaIndex]==electronv1[secondGammaIndex] || electronv1[firstGammaIndex]==electronv2[secondGammaIndex]){\r
+      if(fElectronv1[firstGammaIndex]==fElectronv1[secondGammaIndex] || fElectronv1[firstGammaIndex]==fElectronv2[secondGammaIndex]){\r
        continue;\r
       }\r
-      if(electronv2[firstGammaIndex]==electronv1[secondGammaIndex] || electronv2[firstGammaIndex]==electronv2[secondGammaIndex]){\r
+      if(fElectronv2[firstGammaIndex]==fElectronv1[secondGammaIndex] || fElectronv2[firstGammaIndex]==fElectronv2[secondGammaIndex]){\r
        continue;\r
       }\r
 \r
@@ -866,8 +868,8 @@ void AliAnalysisTaskGammaConversion::ProcessGammasForNeutralMesonAnalysis(){
                                \r
        if(chi2TwoGammaCandidate>0 && chi2TwoGammaCandidate<fV0Reader->GetChi2CutMeson()){                                      \r
                                        \r
-         TVector3 MomentumVectorTwoGammaCandidate(twoGammaCandidate->GetPx(),twoGammaCandidate->GetPy(),twoGammaCandidate->GetPz());\r
-         TVector3 SpaceVectorTwoGammaCandidate(twoGammaCandidate->GetX(),twoGammaCandidate->GetY(),twoGammaCandidate->GetZ());\r
+         TVector3 momentumVectorTwoGammaCandidate(twoGammaCandidate->GetPx(),twoGammaCandidate->GetPy(),twoGammaCandidate->GetPz());\r
+         TVector3 spaceVectorTwoGammaCandidate(twoGammaCandidate->GetX(),twoGammaCandidate->GetY(),twoGammaCandidate->GetZ());\r
                                        \r
          Double_t openingAngleTwoGammaCandidate = twoGammaDecayCandidateDaughter0->GetAngle(*twoGammaDecayCandidateDaughter1);                                 \r
          Double_t rapidity;\r
@@ -882,15 +884,15 @@ void AliAnalysisTaskGammaConversion::ProcessGammasForNeutralMesonAnalysis(){
 \r
          fHistograms->FillHistogram("ESD_Mother_GammaDaughter_OpeningAngle", openingAngleTwoGammaCandidate);\r
          fHistograms->FillHistogram("ESD_Mother_Energy", twoGammaCandidate->GetE());\r
-         fHistograms->FillHistogram("ESD_Mother_Pt", MomentumVectorTwoGammaCandidate.Pt());\r
-         fHistograms->FillHistogram("ESD_Mother_Eta", MomentumVectorTwoGammaCandidate.Eta());\r
+         fHistograms->FillHistogram("ESD_Mother_Pt", momentumVectorTwoGammaCandidate.Pt());\r
+         fHistograms->FillHistogram("ESD_Mother_Eta", momentumVectorTwoGammaCandidate.Eta());\r
          fHistograms->FillHistogram("ESD_Mother_Rapid", rapidity);                                     \r
-         fHistograms->FillHistogram("ESD_Mother_Phi", SpaceVectorTwoGammaCandidate.Phi());\r
+         fHistograms->FillHistogram("ESD_Mother_Phi", spaceVectorTwoGammaCandidate.Phi());\r
          fHistograms->FillHistogram("ESD_Mother_Mass", massTwoGammaCandidate);\r
-         fHistograms->FillHistogram("ESD_Mother_R", SpaceVectorTwoGammaCandidate.Pt());    // Pt in Space == R!!!\r
-         fHistograms->FillHistogram("ESD_Mother_ZR", twoGammaCandidate->GetZ(), SpaceVectorTwoGammaCandidate.Pt());\r
+         fHistograms->FillHistogram("ESD_Mother_R", spaceVectorTwoGammaCandidate.Pt());    // Pt in Space == R!!!\r
+         fHistograms->FillHistogram("ESD_Mother_ZR", twoGammaCandidate->GetZ(), spaceVectorTwoGammaCandidate.Pt());\r
          fHistograms->FillHistogram("ESD_Mother_XY", twoGammaCandidate->GetX(), twoGammaCandidate->GetY());\r
-         fHistograms->FillHistogram("ESD_Mother_InvMass_vs_Pt",massTwoGammaCandidate ,MomentumVectorTwoGammaCandidate.Pt());\r
+         fHistograms->FillHistogram("ESD_Mother_InvMass_vs_Pt",massTwoGammaCandidate ,momentumVectorTwoGammaCandidate.Pt());\r
        }\r
       }\r
       delete twoGammaCandidate;\r
@@ -995,7 +997,7 @@ void AliAnalysisTaskGammaConversion::UserCreateOutputObjects()
   fOutputContainer->SetName(GetName());\r
 }\r
 \r
-Double_t AliAnalysisTaskGammaConversion::GetMCOpeningAngle(TParticle* daughter0, TParticle* daughter1) const{\r
+Double_t AliAnalysisTaskGammaConversion::GetMCOpeningAngle(TParticle* const daughter0, TParticle* const daughter1) const{\r
   //helper function\r
   TVector3 v3D0(daughter0->Px(),daughter0->Py(),daughter0->Pz());\r
   TVector3 v3D1(daughter1->Px(),daughter1->Py(),daughter1->Pz());\r
index 6d442979741488f9c27c2100e173de0a21f24198..3be9301ef60cc461fec062b7c605ceab1880b8f5 100644 (file)
@@ -13,8 +13,8 @@
 #include "AliAnalysisTaskSE.h"\r
 #include <vector>\r
 #include "AliV0Reader.h"\r
-#include "TNtuple.h"\r
 \r
+class TNtuple;\r
 class AliGammaConversionHistograms;\r
 class AliESDv0;\r
 class AliKFParticle;\r
@@ -43,7 +43,7 @@ class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE
   void ProcessV0sNoCut();\r
   void ProcessV0s();\r
   void ProcessGammasForNeutralMesonAnalysis();\r
-  void SetHistograms(AliGammaConversionHistograms *histograms){fHistograms=histograms;}\r
+  void SetHistograms(AliGammaConversionHistograms *const histograms){fHistograms=histograms;}\r
   void SetDoMCTruth(Bool_t flag){fDoMCTruth=flag;}\r
   void SetElectronMass(Double_t electronMass){fElectronMass = electronMass;}\r
   void SetGammaMass(Double_t gammaMass){fGammaMass = gammaMass;}\r
@@ -53,56 +53,56 @@ class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE
   void SetEtaMass(Double_t etaMass){fEtaMass = etaMass;}\r
   void SetEtaWidth(Double_t etaWidth){fEtaWidth = etaWidth;}\r
   void SetMinOpeningAngleGhostCut(Double_t ghostCut){fMinOpeningAngleGhostCut = ghostCut;}\r
-  void SetV0Reader(AliV0Reader* reader){fV0Reader=reader;}\r
+  void SetV0Reader(AliV0Reader* const reader){fV0Reader=reader;}\r
   void SetCalculateBackground(Bool_t bg){fCalculateBackground=bg;}\r
   void CalculateBackground();\r
   void SetWriteNtuple(Bool_t writeNtuple){fWriteNtuple = writeNtuple;}\r
   void FillNtuple();\r
-  Double_t GetMCOpeningAngle(TParticle* daughter0, TParticle* daughter1) const;\r
+  Double_t GetMCOpeningAngle(TParticle* const daughter0, TParticle* const daughter1) const;\r
 \r
  private:\r
   AliAnalysisTaskGammaConversion(const AliAnalysisTaskGammaConversion&); // Not implemented\r
   AliAnalysisTaskGammaConversion& operator=(const AliAnalysisTaskGammaConversion&); // Not implemented\r
 \r
-  AliV0Reader* fV0Reader;\r
+  AliV0Reader* fV0Reader; // The V0 reader object \r
 \r
-  AliStack * fStack;\r
+  AliStack * fStack; // pointer to the MC particle stack\r
 \r
   TList * fOutputContainer ; // Histogram container\r
 \r
-  AliGammaConversionHistograms *fHistograms;\r
+  AliGammaConversionHistograms *fHistograms; // Pointer to the histogram handling class\r
 \r
-  Bool_t fDoMCTruth;\r
+  Bool_t fDoMCTruth; // Flag to switch on/off MC truth \r
     \r
-  vector<TParticle*> fMCAllGammas;\r
-  vector<TParticle*> fMCPi0s;\r
-  vector<TParticle*> fMCEtas;\r
-  vector<TParticle*> fMCGammaChic;\r
+  vector<TParticle*> fMCAllGammas; // vector containing all MC gammas\r
+  vector<TParticle*> fMCPi0s; //vector containing all MC Pi0s\r
+  vector<TParticle*> fMCEtas; //vector containing all MC Etas\r
+  vector<TParticle*> fMCGammaChic; //vector containing all MC Chi_c's\r
 \r
-  vector<AliKFParticle> fKFReconstructedGammas;\r
-  vector<Bool_t> fIsTrueReconstructedGammas;\r
-  vector<Int_t> electronv1;\r
-  vector<Int_t> electronv2;\r
+  vector<AliKFParticle> fKFReconstructedGammas; // vector containing all reconstructed gammas\r
+  vector<Bool_t> fIsTrueReconstructedGammas;    // vector containing information if this was a true gamma or not (follows the index of fKFReconstructedGammas)\r
+  vector<Int_t> fElectronv1; // vector containing index of electron 1\r
+  vector<Int_t> fElectronv2; // vector containing index of electron 2\r
 \r
   //mass defines\r
-  Double_t fElectronMass;\r
-  Double_t fGammaMass;\r
-  Double_t fPi0Mass;\r
-  Double_t fEtaMass;\r
+  Double_t fElectronMass; //electron mass\r
+  Double_t fGammaMass;    //gamma mass\r
+  Double_t fPi0Mass;      //pi0mass\r
+  Double_t fEtaMass;      //eta mass\r
 \r
   // width defines\r
-  Double_t fGammaWidth;\r
-  Double_t fPi0Width;\r
-  Double_t fEtaWidth;\r
+  Double_t fGammaWidth; //gamma width cut\r
+  Double_t fPi0Width;   // pi0 width cut\r
+  Double_t fEtaWidth;   // eta width cut\r
 \r
-  Double_t fMinOpeningAngleGhostCut;\r
+  Double_t fMinOpeningAngleGhostCut; // minimum angle cut\r
 \r
-  Bool_t fCalculateBackground;\r
-  Bool_t fWriteNtuple;\r
-  TNtuple *fGammaNtuple;\r
-  TNtuple *fNeutralMesonNtuple;\r
+  Bool_t fCalculateBackground; //flag to set backgrount calculation on/off\r
+  Bool_t fWriteNtuple;         // flag to set if writing to ntuple on/off\r
+  TNtuple *fGammaNtuple;       // Ntuple for gamma values\r
+  TNtuple *fNeutralMesonNtuple;// NTuple for mesons\r
 \r
-  Int_t fTotalNumberOfAddedNtupleEntries;\r
+  Int_t fTotalNumberOfAddedNtupleEntries; // number of added ntuple entries\r
 \r
   ClassDef(AliAnalysisTaskGammaConversion, 2); // Analysis task for gamma conversions\r
 };\r