Fix coding convention violations (Domenico, Mariella)
authorenrico <enrico@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 May 2009 07:56:02 +0000 (07:56 +0000)
committerenrico <enrico@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 May 2009 07:56:02 +0000 (07:56 +0000)
PWG2/EVCHAR/AliAnalysisTaskSPDdNdEta.cxx
PWG2/EVCHAR/AliAnalysisTaskSPDdNdEta.h

index 2d94023..347a5bd 100644 (file)
 * provided "as is" without express or implied warranty.                  * 
 **************************************************************************/
 
-/*************************************************************************
-* Class AliAnalysisTaskSPDdNdEta                                         *
-* Analysis task for dN/dEta reconstruction with the SPD                  *
-*                                                                        *
-* Author:  M. Nicassio (INFN Bari)                                       *
-* Contact: Maria.Nicassio@ba.infn.it, Domenico.Elia@ba.infn.it           *
-**************************************************************************/
+//////////////////////////////////////////////////////////////////////////
+// Class AliAnalysisTaskSPDdNdEta                                       //
+// Analysis task for dN/dEta reconstruction with the SPD                //
+//                                                                      //
+// Author:  M. Nicassio (INFN Bari)                                     //
+// Contact: Maria.Nicassio@ba.infn.it, Domenico.Elia@ba.infn.it         //
+//////////////////////////////////////////////////////////////////////////
 
 #include "TChain.h"
 #include "TTree.h"
-#include "TBranch.h"
-#include "TClonesArray.h"
 
 #include "TH1F.h"
 #include "TH2F.h" 
 #include "TH3F.h" 
-#include "TCanvas.h"
 
-#include "AliAnalysisTask.h"
 #include "AliAnalysisManager.h"
 
 #include "AliMultiplicity.h"
-#include "AliESDVertex.h"
-#include "AliESDEvent.h"
 #include "AliESDInputHandler.h"
 
-#include "AliAnalysisTaskRL.h"
 #include "AliMCEventHandler.h"
 #include "AliMCEvent.h"
 #include "AliStack.h"
@@ -656,8 +649,8 @@ void AliAnalysisTaskSPDdNdEta::Exec(Option_t *)
     // Tracks from MC
     Int_t  multMCCharged = 0;
     Int_t  nMCPart = stack->GetNprimary();
-    Float_t* eta_gen = new Float_t[nMCPart];  
-    Float_t* pt_gen = new Float_t[nMCPart];
+    Float_t* etagen = new Float_t[nMCPart];  
+    Float_t* ptgen = new Float_t[nMCPart];
     Int_t* stackIndexOfPrimaryParts = new Int_t[nMCPart];
     Int_t* reconstructedPrimaryPart = new Int_t[nMCPart];
     Int_t* detectedPrimaryPartLay1 = new Int_t[nMCPart];
@@ -678,16 +671,16 @@ void AliAnalysisTaskSPDdNdEta::Exec(Option_t *)
     // Loop over MC particles
     for (Int_t imc=0; imc<nMCPart; imc++) {
       TParticle* part = stack->Particle(imc);
-      Bool_t IsPrimary = stack->IsPhysicalPrimary(imc);
-      if (!IsPrimary)                        continue;
+      Bool_t isPrimary = stack->IsPhysicalPrimary(imc);
+      if (!isPrimary)                        continue;
       TParticlePDG* pdgPart = part->GetPDG();
       if (TMath::Abs(pdgPart->Charge())!=3)  continue;
       Float_t theta = part->Theta();
       if (theta==0 || theta==TMath::Pi())    continue;
       Float_t eta = part->Eta();
       Float_t pt = part->Pt();
-      eta_gen[multMCCharged] = eta; 
-      pt_gen[multMCCharged] = pt;
+      etagen[multMCCharged] = eta; 
+      ptgen[multMCCharged] = pt;
       stackIndexOfPrimaryParts[multMCCharged] = imc;
 
       reconstructedPrimaryPart[multMCCharged]=kFALSE;
@@ -695,7 +688,7 @@ void AliAnalysisTaskSPDdNdEta::Exec(Option_t *)
       detectedPrimaryPartLay2[multMCCharged]=kFALSE;
       detectablePrimaryPart[multMCCharged]=kFALSE;
 
-      fHistoPt->Fill(pt_gen[multMCCharged]);
+      fHistoPt->Fill(ptgen[multMCCharged]);
 
       AliMCParticle* mcpart = mcEvent->GetTrack(imc);
       Int_t nref = mcpart->GetNumberOfTrackReferences();
@@ -703,12 +696,12 @@ void AliAnalysisTaskSPDdNdEta::Exec(Option_t *)
       // Detectable primaries 
       if (nref==0) {
         detectablePrimaryPart[multMCCharged]=kTRUE;
-        fHistoDetectableNotr->Fill(eta_gen[multMCCharged],vtxMC[2],pt_gen[multMCCharged]);
+        fHistoDetectableNotr->Fill(etagen[multMCCharged],vtxMC[2],ptgen[multMCCharged]);
       } else if (nref>0) {
         tref = mcpart->GetTrackReference(nref-1);
         if (tref->DetectorId()!=-1) {
           detectablePrimaryPart[multMCCharged]=kTRUE;
-          fHistoNonStoppingTracks->Fill(eta_gen[multMCCharged],vtxMC[2]); 
+          fHistoNonStoppingTracks->Fill(etagen[multMCCharged],vtxMC[2]); 
         } else {
           for (Int_t iref=0;iref<nref;iref++) {
             tref = mcpart->GetTrackReference(iref);
@@ -721,22 +714,22 @@ void AliAnalysisTaskSPDdNdEta::Exec(Option_t *)
                 } 
               } else if (tref->R()>rmaxL2) {
                   detectablePrimaryPart[multMCCharged]=kTRUE;
-                  fHistoDetectabletr->Fill(eta_gen[multMCCharged],vtxMC[2]);
+                  fHistoDetectabletr->Fill(etagen[multMCCharged],vtxMC[2]);
                   if (tref->DetectorId()==-1) {
-                    fHistoDetectableTRm1->Fill(eta_gen[multMCCharged],vtxMC[2]);
+                    fHistoDetectableTRm1->Fill(etagen[multMCCharged],vtxMC[2]);
                     fHistoRTRm1->Fill(tref->R());
                   }
-                  else if (tref->DetectorId()==0) fHistoDetectableTrITS->Fill(eta_gen[multMCCharged],vtxMC[2]);
-                  else if (tref->DetectorId()==1) fHistoDetectableTrTPC->Fill(eta_gen[multMCCharged],vtxMC[2]);
-                  else if (tref->DetectorId()==2) fHistoDetectableTrFRAME->Fill(eta_gen[multMCCharged],vtxMC[2]);
-                  else if (tref->DetectorId()==3) fHistoDetectableTrTRD->Fill(eta_gen[multMCCharged],vtxMC[2]);
-                  else if (tref->DetectorId()==4) fHistoDetectableTrTOF->Fill(eta_gen[multMCCharged],vtxMC[2]);
-                  else if (tref->DetectorId()==5) fHistoDetectableTrMUON->Fill(eta_gen[multMCCharged],vtxMC[2]);
-                  else if (tref->DetectorId()==6) fHistoDetectableTrHMPID->Fill(eta_gen[multMCCharged],vtxMC[2]);
-                  else if (tref->DetectorId()==7) fHistoDetectableTrT0->Fill(eta_gen[multMCCharged],vtxMC[2]);
-                  else if (tref->DetectorId()==8) fHistoDetectableTrEMCAL->Fill(eta_gen[multMCCharged],vtxMC[2]);
-                  else if (tref->DetectorId()==12) fHistoDetectableTrFMD->Fill(eta_gen[multMCCharged],vtxMC[2]);
-                  else if (tref->DetectorId()==14) fHistoDetectableTrVZERO->Fill(eta_gen[multMCCharged],vtxMC[2]);
+                  else if (tref->DetectorId()==0) fHistoDetectableTrITS->Fill(etagen[multMCCharged],vtxMC[2]);
+                  else if (tref->DetectorId()==1) fHistoDetectableTrTPC->Fill(etagen[multMCCharged],vtxMC[2]);
+                  else if (tref->DetectorId()==2) fHistoDetectableTrFRAME->Fill(etagen[multMCCharged],vtxMC[2]);
+                  else if (tref->DetectorId()==3) fHistoDetectableTrTRD->Fill(etagen[multMCCharged],vtxMC[2]);
+                  else if (tref->DetectorId()==4) fHistoDetectableTrTOF->Fill(etagen[multMCCharged],vtxMC[2]);
+                  else if (tref->DetectorId()==5) fHistoDetectableTrMUON->Fill(etagen[multMCCharged],vtxMC[2]);
+                  else if (tref->DetectorId()==6) fHistoDetectableTrHMPID->Fill(etagen[multMCCharged],vtxMC[2]);
+                  else if (tref->DetectorId()==7) fHistoDetectableTrT0->Fill(etagen[multMCCharged],vtxMC[2]);
+                  else if (tref->DetectorId()==8) fHistoDetectableTrEMCAL->Fill(etagen[multMCCharged],vtxMC[2]);
+                  else if (tref->DetectorId()==12) fHistoDetectableTrFMD->Fill(etagen[multMCCharged],vtxMC[2]);
+                  else if (tref->DetectorId()==14) fHistoDetectableTrVZERO->Fill(etagen[multMCCharged],vtxMC[2]);
                   break;
               }
             }
@@ -747,11 +740,11 @@ void AliAnalysisTaskSPDdNdEta::Exec(Option_t *)
           tref = mcpart->GetTrackReference(iref);
           if (tref->R()>rminL1&&tref->R()<rmaxL1&&tref->DetectorId()==0) {
             detectedPrimaryPartLay1[multMCCharged] = kTRUE;
-            fHistoDetectedLay1->Fill(eta_gen[multMCCharged],vtxMC[2]);
+            fHistoDetectedLay1->Fill(etagen[multMCCharged],vtxMC[2]);
           }
           if (tref->R()>rminL2&&tref->R()<rmaxL2&&tref->DetectorId()==0) {
             detectedPrimaryPartLay2[multMCCharged] = kTRUE;
-            fHistoDetectedLay2->Fill(eta_gen[multMCCharged],vtxMC[2]);
+            fHistoDetectedLay2->Fill(etagen[multMCCharged],vtxMC[2]);
           }
         }
       } 
@@ -786,16 +779,16 @@ void AliAnalysisTaskSPDdNdEta::Exec(Option_t *)
 
       for (Int_t imc=0; imc<multMCCharged; imc++) {
         if (reconstructedPrimaryPart[imc]) {
-          fHistBkgCorrNum->Fill(eta_gen[imc],vtxMC[2]);
+          fHistBkgCorrNum->Fill(etagen[imc],vtxMC[2]);
         }
-        if (detectedPrimaryPartLay1[imc]&&detectedPrimaryPartLay2[imc]) fHistAlgEffNum->Fill(eta_gen[imc],vtxMC[2]);
+        if (detectedPrimaryPartLay1[imc]&&detectedPrimaryPartLay2[imc]) fHistAlgEffNum->Fill(etagen[imc],vtxMC[2]);
 
-        fHistNonDetectableCorrNum->Fill(eta_gen[imc],vtxMC[2]);
+        fHistNonDetectableCorrNum->Fill(etagen[imc],vtxMC[2]);
 
-        if (detectablePrimaryPart[imc]) fHistNonDetectableCorrDen->Fill(eta_gen[imc],vtxMC[2]);
+        if (detectablePrimaryPart[imc]) fHistNonDetectableCorrDen->Fill(etagen[imc],vtxMC[2]);
 
-        fHistMCEtavsZTriggESDvtxEvts->Fill(eta_gen[imc],esdvtx[2]);
-        fHistMCEtavsZTriggMCvtxEvts->Fill(eta_gen[imc],vtxMC[2]);
+        fHistMCEtavsZTriggESDvtxEvts->Fill(etagen[imc],esdvtx[2]);
+        fHistMCEtavsZTriggMCvtxEvts->Fill(etagen[imc],vtxMC[2]);
       }
 
       if (esdvtx[2]>=-10. && esdvtx[2]<10.) fHistTrigVtxCorrDen->Fill(multSPD,vtxMC[2]);
@@ -804,19 +797,19 @@ void AliAnalysisTaskSPDdNdEta::Exec(Option_t *)
     if (eventTriggered) {
       fHistTrigCorrDen->Fill(multSPD,vtxMC[2]);
       for (Int_t imc=0; imc<multMCCharged; imc++) {
-        fHistTrackTrigCorrDen->Fill(eta_gen[imc],vtxMC[2]); 
+        fHistTrackTrigCorrDen->Fill(etagen[imc],vtxMC[2]); 
       }
     }
 
     for (Int_t imc=0; imc<multMCCharged; imc++) {
-      fHistTrackTrigVtxCorrNum->Fill(eta_gen[imc],vtxMC[2]);
-      fHistMCEtavsZ->Fill(eta_gen[imc],vtxMC[2]);
+      fHistTrackTrigVtxCorrNum->Fill(etagen[imc],vtxMC[2]);
+      fHistMCEtavsZ->Fill(etagen[imc],vtxMC[2]);
     }
 
     fHistTrigVtxCorrNum->Fill(multSPD,vtxMC[2]);
 
-    delete[] eta_gen;
-    delete[] pt_gen;
+    delete[] etagen;
+    delete[] ptgen;
     delete[] stackIndexOfPrimaryParts;
     delete[] reconstructedPrimaryPart;
     delete[] detectedPrimaryPartLay1;
index 78eae84..00d4895 100644 (file)
@@ -1,13 +1,13 @@
-#ifndef AliAnalysisTaskSPDdNdEta_cxx
-#define AliAnalysisTaskSPDdNdEta_cxx
+#ifndef ALIANALYSISTASKSPDDNDETA_H
+#define ALIANALYSISTASKSPDDNDETA_H
 
-/*************************************************************************
-* Class AliAnalysisTaskSPDdNdEta                                         *
-* Analysis task for dN/dEta reconstruction with the SPD                  *
-*                                                                        *
-* Author:  M. Nicassio (INFN Bari)                                       *
-* Contact: Maria.Nicassio@ba.infn.it, Domenico.Elia@ba.infn.it           *
-**************************************************************************/
+///////////////////////////////////////////////////////////////////////////
+// Class AliAnalysisTaskSPDdNdEta                                        //
+// Analysis task for dN/dEta reconstruction with the SPD                 //
+//                                                                       //
+// Author:  M. Nicassio (INFN Bari)                                      //
+// Contact: Maria.Nicassio@ba.infn.it, Domenico.Elia@ba.infn.it          //
+///////////////////////////////////////////////////////////////////////////
 
 class TH1F;
 class TH2F;
@@ -33,91 +33,83 @@ class AliAnalysisTaskSPDdNdEta : public AliAnalysisTask {
   AliESDEvent *fESD;               //ESD object
   TList* fOutput;                  //! list send on output slot 0
   
-  Bool_t fCorr;
-  Int_t fTrigger;
-  Bool_t fppAna;
+  Bool_t fCorr;                    // flag to anable the correction histo calculation
+  Int_t fTrigger;                  // to set the MBtrigger selection
+  Bool_t fppAna;                   // flag to set the proper multiplicity binning (p-p or Pb-Pb)
  
-  //Data to be corrected 
-  TH2F        *fHistSPDRAWMultvsZ;
-  TH2F        *fHistSPDRAWMultvsZTriggEvts;
-  TH2F        *fHistSPDRAWEtavsZ;
+  TH2F        *fHistSPDRAWMultvsZ;          // data to be corrected 
+  TH2F        *fHistSPDRAWMultvsZTriggEvts; // data to be corrected
+  TH2F        *fHistSPDRAWEtavsZ;           // data to be corrected
 
-  //Clusters inner layer and tracklets
-  TH1F        *fHistSPDmultEtacut;
-  TH1F        *fHistSPDmult;
-  TH1F        *fHistSPDeta;
-  TH1F        *fHistSPDcl1multEtacutLay1;
-  TH1F        *fHistSPDcl1mult;
-  TH1F        *fHistSPDcl1eta;
-  TH1F        *fHistSPDphi;
-  TH1F        *fHistSPDcl1phi;
-  TH1F        *fHistSPDtheta;
-  TH1F        *fHistSPDcl1theta;
-  TH1F        *fHistSPDdePhi;
-  TH1F        *fHistSPDdePhiZ;
-  TH1F        *fHistSPDdePhi3D;
-  TH2F        *fHistSPDphivsSPDeta;
-  TH2F        *fHistSPDcl1phivsSPDcl1eta;
+  TH1F        *fHistSPDmultEtacut;          // cluster inner layer and tracklet check histos
+  TH1F        *fHistSPDmult;                // cluster inner layer and tracklet check histos
+  TH1F        *fHistSPDeta;                 // cluster inner layer and tracklet check histos
+  TH1F        *fHistSPDcl1multEtacutLay1;   // cluster inner layer and tracklet check histos
+  TH1F        *fHistSPDcl1mult;             // cluster inner layer and tracklet check histos
+  TH1F        *fHistSPDcl1eta;              // cluster inner layer and tracklet check histos
+  TH1F        *fHistSPDphi;                 // cluster inner layer and tracklet check histos
+  TH1F        *fHistSPDcl1phi;              // cluster inner layer and tracklet check histos
+  TH1F        *fHistSPDtheta;               // cluster inner layer and tracklet check histos
+  TH1F        *fHistSPDcl1theta;            // cluster inner layer and tracklet check histos
+  TH1F        *fHistSPDdePhi;               // cluster inner layer and tracklet check histos
+  TH1F        *fHistSPDdePhiZ;              // cluster inner layer and tracklet check histos
+  TH1F        *fHistSPDdePhi3D;             // cluster inner layer and tracklet check histos
+  TH2F        *fHistSPDphivsSPDeta;         // cluster inner layer and tracklet check histos
+  TH2F        *fHistSPDcl1phivsSPDcl1eta;   // cluster inner layer and tracklet check histos
 
-  //SPD vertex distributions
-  TH1F        *fHistSPDvtx;    
-  TH3F        *fHistSPDvtx3D;
-  TH3F        *fHistSPDvtxZ;
-  TH2F        *fHistNcontribSPDvtxvsSPDvtx;
-  TH1F        *fHistNcontribSPDvtx3D;
-  TH1F        *fHistNcontribSPDvtxZ;
-  TH1F        *fHistNcontribSPDvtxall;
-  TH2F        *fHistSPDmultvsSPDvtx;
+  TH1F        *fHistSPDvtx;                 // SPD vertex distributions
+  TH3F        *fHistSPDvtx3D;               // SPD vertex distributions
+  TH3F        *fHistSPDvtxZ;                // SPD vertex distributions
+  TH2F        *fHistNcontribSPDvtxvsSPDvtx; // SPD vertex distributions
+  TH1F        *fHistNcontribSPDvtx3D;       // SPD vertex distributions
+  TH1F        *fHistNcontribSPDvtxZ;        // SPD vertex distributions
+  TH1F        *fHistNcontribSPDvtxall;      // SPD vertex distributions
+  TH2F        *fHistSPDmultvsSPDvtx;        // SPD vertex distributions
 
-  //SPD fired chips distributions            
-  TH2F        *fHistSPDcl1multvsnFiredChipsLay1;
-  TH2F        *fHistSPDmultvsnFiredChipsLay1;
-  TH2F        *fHistSPDmultvsnFiredChipsLay2;
-  TH2F        *fHistnFiredChipsLay2vsnFiredChipsLay1;
-  TH2F        *fHistnFiredChipsLay2vsnFiredChipsLay1novtxrec;
+  TH2F        *fHistSPDcl1multvsnFiredChipsLay1;              // SPD fired chips distributions
+  TH2F        *fHistSPDmultvsnFiredChipsLay1;                 // SPD fired chips distributions
+  TH2F        *fHistSPDmultvsnFiredChipsLay2;                 // SPD fired chips distributions
+  TH2F        *fHistnFiredChipsLay2vsnFiredChipsLay1;         // SPD fired chips distributions
+  TH2F        *fHistnFiredChipsLay2vsnFiredChipsLay1novtxrec; // SPD fired chips distributions
 
-  //Track level correction histograms
-  TH2F* fHistBkgCorrNum;
-  TH2F* fHistBkgCorrDen;
-  TH2F* fHistAlgEffNum;
-  TH2F* fHistNonDetectableCorrNum;
-  TH2F* fHistNonDetectableCorrDen;
-  TH2F* fHistTrackTrigVtxCorrNum;
-  TH2F* fHistTrackTrigCorrDen;
+  TH2F* fHistBkgCorrNum;           // track level correction histograms
+  TH2F* fHistBkgCorrDen;           // track level correction histograms
+  TH2F* fHistAlgEffNum;            // track level correction histograms
+  TH2F* fHistNonDetectableCorrNum; // track level correction histograms
+  TH2F* fHistNonDetectableCorrDen; // track level correction histograms
+  TH2F* fHistTrackTrigVtxCorrNum;  // track level correction histograms
+  TH2F* fHistTrackTrigCorrDen;     // track level correction histograms
    
-  //Event level correction histograms
-  TH2F* fHistTrigVtxCorrNum;
-  TH2F* fHistTrigVtxCorrDen;
+  TH2F* fHistTrigVtxCorrNum;       // event level correction histograms
+  TH2F* fHistTrigVtxCorrDen;       // event level correction histograms
 
-  TH2F* fHistTrigCorrDen;
+  TH2F* fHistTrigCorrDen;          // event level correction histograms
 
-  //MC distributions
-  TH2F* fHistMCEtavsZTriggMCvtxEvts;
-  TH2F* fHistMCEtavsZTriggESDvtxEvts;
-  TH2F* fHistMCEtavsZ;
+  TH2F* fHistMCEtavsZTriggMCvtxEvts;  // MC distributions
+  TH2F* fHistMCEtavsZTriggESDvtxEvts; // MC distributions
+  TH2F* fHistMCEtavsZ;                // MC distributions 
 
-  //Additional check histos
-  TH1F* fHistTRradius;
-  TH2F* fHistContributorsvsDeVtx;
-  TH3F* fHistoDetectableNotr;
-  TH2F* fHistoDetectabletr;
-  TH2F* fHistoNonStoppingTracks;
-  TH2F* fHistoDetectedLay1;
-  TH2F* fHistoDetectedLay2;
-  TH1F* fHistoPt;
-  TH2F* fHistoDetectableTRm1;
-  TH2F* fHistoDetectableTrITS;
-  TH2F* fHistoDetectableTrTPC;
-  TH2F* fHistoDetectableTrFRAME;
-  TH2F* fHistoDetectableTrTRD;
-  TH2F* fHistoDetectableTrTOF;
-  TH2F* fHistoDetectableTrMUON;
-  TH2F* fHistoDetectableTrHMPID;
-  TH2F* fHistoDetectableTrT0;
-  TH2F* fHistoDetectableTrEMCAL;
-  TH2F* fHistoDetectableTrFMD;
-  TH2F* fHistoDetectableTrVZERO;
-  TH1F* fHistoRTRm1;
+  TH1F* fHistTRradius;                // additional check histos
+  TH2F* fHistContributorsvsDeVtx;     // additional check histos
+  TH3F* fHistoDetectableNotr;         // additional check histos
+  TH2F* fHistoDetectabletr;           // additional check histos
+  TH2F* fHistoNonStoppingTracks;      // additional check histos
+  TH2F* fHistoDetectedLay1;           // additional check histos
+  TH2F* fHistoDetectedLay2;           // additional check histos
+  TH1F* fHistoPt;                     // additional check histos 
+  TH2F* fHistoDetectableTRm1;         // additional check histos
+  TH2F* fHistoDetectableTrITS;        // additional check histos
+  TH2F* fHistoDetectableTrTPC;        // additional check histos
+  TH2F* fHistoDetectableTrFRAME;      // additional check histos
+  TH2F* fHistoDetectableTrTRD;        // additional check histos
+  TH2F* fHistoDetectableTrTOF;        // additional check histos
+  TH2F* fHistoDetectableTrMUON;       // additional check histos
+  TH2F* fHistoDetectableTrHMPID;      // additional check histos
+  TH2F* fHistoDetectableTrT0;         // additional check histos
+  TH2F* fHistoDetectableTrEMCAL;      // additional check histos
+  TH2F* fHistoDetectableTrFMD;        // additional check histos
+  TH2F* fHistoDetectableTrVZERO;      // additional check histos
+  TH1F* fHistoRTRm1;                  // additional check histos
 
  private:    
   AliAnalysisTaskSPDdNdEta(const AliAnalysisTaskSPDdNdEta&);