Changes to improve performance while running over MC
authormfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 1 Nov 2010 17:06:48 +0000 (17:06 +0000)
committermfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 1 Nov 2010 17:06:48 +0000 (17:06 +0000)
PWG0/multPbPb/AliAnalysisTaskMultPbTracks.cxx
PWG0/multPbPb/correct.C
PWG0/multPbPb/run.C

index a478960..2a91119 100644 (file)
@@ -151,8 +151,10 @@ void AliAnalysisTaskMultPbTracks::UserExec(Option_t *)
     } else {
       
       //loop on the MC event
-      Int_t nMCTracks = fMCEvent->GetNumberOfTracks();
-      for (Int_t ipart=0; ipart<nMCTracks; ipart++) { 
+      //      Int_t nMCTracks = fMCEvent->GetNumberOfTracks();
+      Int_t offset    = fMCEvent->GetPrimaryOffset();
+      Int_t nMCTracks = fMCEvent->GetNumberOfPrimaries()+offset;
+      for (Int_t ipart=offset; ipart<nMCTracks; ipart++) { 
        
        AliMCParticle *mcPart  = (AliMCParticle*)fMCEvent->GetTrack(ipart);
        
index 66a2b0a..9e890e3 100644 (file)
@@ -150,13 +150,12 @@ Double_t CheckSecondaries() {
   c1->SetLogy();
   // Draw all
   //  hDataDCA->Draw();
-  // //  hMCDCAGen ->Draw("same");
   //  hMCDCARec ->Draw("same");
   // hMCDCAPri ->Draw("same");
   // hMCDCASW ->Draw("same");
   // hMCDCASM ->Draw("same");
   // hMCDCAFak ->Draw("same");
-  //  return;
+  //  return 1;
   
   TH1D * hMCPrimSMFak = (TH1D*) hMCDCAPri->Clone("hMCPrimSMFak");
   hMCPrimSMFak->Add(hMCDCASM);
index 7bcb04c..3ac7bb5 100644 (file)
@@ -29,6 +29,7 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
 
   if(isMC) {
     AliMCEventHandler* handler = new AliMCEventHandler;
+    handler->SetPreReadMode(AliMCEventHandler::kLmPreRead);
     mgr->SetMCtruthEventHandler(handler);
   }