Added lambdas to PID histos
authormfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Oct 2011 15:00:38 +0000 (15:00 +0000)
committermfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Oct 2011 15:00:38 +0000 (15:00 +0000)
PWG0/genLevelSimulation/AliAnalysisTaskdNdetaMC.cxx
PWG0/genLevelSimulation/AliAnalysisTaskdNdetaMC.h
PWG0/genLevelSimulation/runTaskProof.C

index 238cf0d..9ce5773 100644 (file)
@@ -45,9 +45,13 @@ using namespace std;
 ClassImp(AliAnalysisTaskdNdetaMC)
 
 Float_t      AliAnalysisTaskdNdetaMC::fEtaMax = 0.5;
-Int_t        AliAnalysisTaskdNdetaMC::fPDGCodes[]  = {211,2212,321,-11,-13,-211,-2212,-321,11,13,0} ; // 0 ==> all others
+Int_t        AliAnalysisTaskdNdetaMC::fPDGCodes[]  = {211,2212,321,-11,-13,
+                                                     -211,-2212,-321,11,13,
+                                                     3122,-3122,3122,-3122,
+                                                     0} ; // 0 ==> all others
 const char * AliAnalysisTaskdNdetaMC::fPartNames[] = {"PionPos", "ProtonPos", "KaonPos", "ePos", "muPos", 
                                                      "PionNeg", "ProtonNeg", "KaonNeg", "eNeg", "muNeg", 
+                                                     "Lambda", "Lambda_bar", "LambdaInclusive", "Lambda_barInclusive",
                                                      "Others"} ;
 
 
@@ -315,7 +319,7 @@ void AliAnalysisTaskdNdetaMC::UserExec(Option_t *)
     if(headPho->ProcessType() != 5 && headPho->ProcessType() != 6  && headPho->ProcessType() != 7 ) {
       isND = kTRUE;
     }       
-  }
+  } 
 
   // HL definition: is there at least one particle in |eta|<1?
   Bool_t isThereOneCentralPart = kFALSE;
@@ -334,20 +338,46 @@ void AliAnalysisTaskdNdetaMC::UserExec(Option_t *)
     }
   }
 
-  
-
-  fHistIev->Fill(kHistINEL);
-  if (!isSD)                 fHistIev->Fill(kHistNSD);
-  if (isSD)                  fHistIev->Fill(kHistSiD);
-  if (isND)                  fHistIev->Fill(kHistND);
-  if (isThereOneCentralPart) fHistIev->Fill(kHistHL);
-  if(!(Int_t(fHistIev->GetBinContent(fHistIev->FindBin(kHistINEL)))%500)) 
-    cout << "Event " << Int_t(fHistIev->GetBinContent(fHistIev->FindBin(kHistINEL))) << endl;
+    
   
 
   static const Float_t ymax =0.5;
   // Track loop
   Int_t multiplicity[kNHist][kNEtaHist] = {{0}};  
+
+  // first loop to determine multiplicity
+  for (Int_t iTrack = 0; iTrack < mcEvent->GetNumberOfTracks(); iTrack++) {
+    AliMCParticle *track = (AliMCParticle*)mcEvent->GetTrack(iTrack);
+    if (!track) {
+      Printf("ERROR: Could not receive track %d", iTrack);
+      continue;
+    }
+    Bool_t isPrimary = mcEvent->Stack()->IsPhysicalPrimary(iTrack);
+    if (isPrimary && track->Charge() != 0){
+      for(Int_t ihist = 0; ihist < kNEtaHist; ihist++){
+       if(track->Eta() > -fEtaBins[ihist] && track->Eta() < fEtaBins[ihist]) {
+         multiplicity[kHistINEL][ihist]++;
+         if(!isSD)                  multiplicity[kHistNSD][ihist]++;
+         if(isSD)                   multiplicity[kHistSiD][ihist]++;
+         if(isND)                   multiplicity[kHistND] [ihist]++;
+         if(isThereOneCentralPart)  multiplicity[kHistHL] [ihist]++;
+  
+       }
+      }
+    }
+  }
+
+  // if(multiplicity[kHistINEL][kEta05] < 1450 || multiplicity[kHistINEL][kEta05] > 1750) return; // FIXME:  ONLY CENTRAL EVENTS 1600 +- 150
+  // fHistIev->Fill(kHistINEL);
+  // if (!isSD)                 fHistIev->Fill(kHistNSD);
+  // if (isSD)                  fHistIev->Fill(kHistSiD);
+  // if (isND)                  fHistIev->Fill(kHistND);
+  // if (isThereOneCentralPart) fHistIev->Fill(kHistHL);
+  // if(!(Int_t(fHistIev->GetBinContent(fHistIev->FindBin(kHistINEL)))%500)) 
+    
+    cout << "Event " << Int_t(fHistIev->GetBinContent(fHistIev->FindBin(kHistINEL))) << endl;
+         
+
   for (Int_t iTrack = 0; iTrack < mcEvent->GetNumberOfTracks(); iTrack++) {
     AliMCParticle *track = (AliMCParticle*)mcEvent->GetTrack(iTrack);
     if (!track) {
@@ -365,7 +395,9 @@ void AliAnalysisTaskdNdetaMC::UserExec(Option_t *)
       Int_t particleID = kNPart;
       for(Int_t ipart = 0; ipart < kNPart; ipart++){
        if(track->PdgCode() == fPDGCodes[ipart]) particleID = ipart; // Found one otf the expected particles, will be used to fille species histos
+       
        if(track->Y() > -ymax && track->Y() < ymax && track->PdgCode() == fPDGCodes[ipart]) {
+         cout << "Found " << iTrack <<" "  << fPartNames[ipart] << endl;
          fHistPtID[kHistINEL][ipart]->Fill(track->Pt());
        }
        else if(track->Y() > -ymax && track->Y() < ymax) {
@@ -405,7 +437,7 @@ void AliAnalysisTaskdNdetaMC::UserExec(Option_t *)
        fHistEta[kHistND]->Fill(track->Eta());      
        if (isEtaLess08) fHistPt [kHistND]->Fill(track->Pt());      
        if(track->Eta() > -fEtaMax && track->Eta() < fEtaMax) fHistNParticlesAtMidRapidity->Fill(kHistND);
-               for(Int_t ipart = 0; ipart < kNPart; ipart++){
+       for(Int_t ipart = 0; ipart < kNPart; ipart++){
          if(track->Y() > -ymax && track->Y() < ymax && track->PdgCode() == fPDGCodes[ipart])  fHistPtID[kHistND][ipart]->Fill(track->Pt());
          //      else fHistPtID[kHistINEL][kNPart]->Fill(track->Pt()); // all others
        }
@@ -423,18 +455,33 @@ void AliAnalysisTaskdNdetaMC::UserExec(Option_t *)
       }
 
       // fill array of multiplicity for different classes of events
-      // and in different eta ranges
-      for(Int_t ihist = 0; ihist < kNEtaHist; ihist++){
-       if(track->Eta() > -fEtaBins[ihist] && track->Eta() < fEtaBins[ihist]) {
-         multiplicity[kHistINEL][ihist]++;
-         if(!isSD)                  multiplicity[kHistNSD][ihist]++;
-         if(isSD)                   multiplicity[kHistSiD][ihist]++;
-         if(isND)                   multiplicity[kHistND] [ihist]++;
-         if(isThereOneCentralPart)  multiplicity[kHistHL] [ihist]++;
+      // and in different eta ranges 
+      // MOVED IN A SEPARATE LOOP
+      // for(Int_t ihist = 0; ihist < kNEtaHist; ihist++){
+      //       if(track->Eta() > -fEtaBins[ihist] && track->Eta() < fEtaBins[ihist]) {
+      //         multiplicity[kHistINEL][ihist]++;
+      //         if(!isSD)                  multiplicity[kHistNSD][ihist]++;
+      //         if(isSD)                   multiplicity[kHistSiD][ihist]++;
+      //         if(isND)                   multiplicity[kHistND] [ihist]++;
+      //         if(isThereOneCentralPart)  multiplicity[kHistHL] [ihist]++;
   
-       }
+      //       }
+      //}
+    } // if (primary and charged)
+    // extra loop to check for lambdas
+    for(Int_t ipart = kLambda; ipart < kLambdaInclusive; ipart++){
+      //       if(track->PdgCode() == fPDGCodes[ipart]) particleID = ipart; // Found one otf the expected particles, will be used to fille species histos
+      if(track->Y() > -ymax && track->Y() < ymax && track->PdgCode() == fPDGCodes[ipart]) {
+       //      cout << "Found (LAMBDA)" << " " << iTrack << " " << isPrimary << " " << fPartNames[ipart] << " " << fPartNames[ipart+2] << endl;
+       if(isPrimary) {
+         //      cout << " - prim" << endl;
+         fHistPtID[kHistINEL][ipart]->Fill(track->Pt());
+       } else if(mcEvent->Stack()->IsSecondaryFromWeakDecay(iTrack)) {
+         fHistPtID[kHistINEL][ipart+2]->Fill(track->Pt()); // inclusive lambdas are offset by 2 elements
+       }       
       }
     }
+
   } //track loop 
 
 
index 1535358..6b6e9fa 100644 (file)
@@ -14,6 +14,7 @@ enum {kHistINEL,kHistNSD,kHistND,kHistSiD,kHistHL,kNHist};
 enum {kEta05,kEta10,kEta14,kNEtaHist};// 
 enum {kPionPos, kProtonPos, kKaonPos, kElectronPos, kMuonPos,
       kPionNeg, kProtonNeg, kKaonNeg, kElectronNeg, kMuonNeg,
+      kLambda, kLambdaBar, kLambdaInclusive, kLambdaBarInclusive,
       kNPart}; //Particles used for identified particles pt spectra
 #include "AliAnalysisTaskSE.h"
 
index fa5c15a..20e0452 100644 (file)
@@ -1,19 +1,20 @@
 void runTaskProof(const char * dataset, const char * datasetpath="/COMMON/COMMON/", const char * outdir="") {
   gEnv->SetValue("XSec.GSI.DelegProxy","2");
-  TProof::Open("alice-caf","workers=50");
+  TProof::Open("alice-caf","workers=1x");
+  gProof->EnablePackage("VO_ALICE@AliRoot::v4-21-33-AN");
   
   //  gSystem->AddIncludePath("-I${ALICE_ROOT}/include/ -I${ALICE_ROOT}/PWG0/ -I${ALICE_ROOT}/PWG0/dNdEta/");
-  gSystem->AddIncludePath("-I${ALICE_ROOT}/include/");
-  gProof->UploadPackage("$ALICE_ROOT/STEERBase");
-  gProof->EnablePackage("$ALICE_ROOT/STEERBase");
-  gProof->UploadPackage("$ALICE_ROOT/ESD");
-  gProof->EnablePackage("$ALICE_ROOT/ESD");
-  gProof->UploadPackage("$ALICE_ROOT/AOD");
-  gProof->EnablePackage("$ALICE_ROOT/AOD");
-  gProof->UploadPackage("$ALICE_ROOT/ANALYSIS");
-  gProof->EnablePackage("$ALICE_ROOT/ANALYSIS");
-  gProof->UploadPackage("$ALICE_ROOT/ANALYSISalice");
-  gProof->EnablePackage("$ALICE_ROOT/ANALYSISalice");
+  // gSystem->AddIncludePath("-I${ALICE_ROOT}/include/");
+  // gProof->UploadPackage("$ALICE_ROOT/STEERBase");
+  // gProof->EnablePackage("$ALICE_ROOT/STEERBase");
+  // gProof->UploadPackage("$ALICE_ROOT/ESD");
+  // gProof->EnablePackage("$ALICE_ROOT/ESD");
+  // gProof->UploadPackage("$ALICE_ROOT/AOD");
+  // gProof->EnablePackage("$ALICE_ROOT/AOD");
+  // gProof->UploadPackage("$ALICE_ROOT/ANALYSIS");
+  // gProof->EnablePackage("$ALICE_ROOT/ANALYSIS");
+  // gProof->UploadPackage("$ALICE_ROOT/ANALYSISalice");
+  // gProof->EnablePackage("$ALICE_ROOT/ANALYSISalice");
  
 
     // Make the analysis manager
@@ -48,6 +49,7 @@ void runTaskProof(const char * dataset, const char * datasetpath="/COMMON/COMMON
        
   mgr->PrintStatus();
   mgr->StartAnalysis("proof",Form("%s%s#TE",datasetpath,dataset),5000);
+  // mgr->StartAnalysis("proof",Form("%s%s#TE",datasetpath,dataset),5000);
   //  mgr->StartAnalysis("proof","/COMMON/COMMON/LHC09b14_7TeV_0.5T_Phojet#esdTree");
 
   if (!strcmp(outdir,"")){