fix dynamic cast MC particle
authormvl <mvl@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Mar 2013 08:09:15 +0000 (08:09 +0000)
committermvl <mvl@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Mar 2013 08:09:15 +0000 (08:09 +0000)
JETAN/AliAnalysisTaskFastEmbedding.cxx
JETAN/AliAnalysisTaskJetCluster.cxx
JETAN/DEV/AliAnalysisTaskFastEmbedding.cxx
JETAN/DEV/AliAnalysisTaskJetCluster.cxx

index 589d0b2..c5cf47d 100644 (file)
@@ -853,10 +853,13 @@ void AliAnalysisTaskFastEmbedding::UserExec(Option_t *)
                if(tmpPart->IsPhysicalPrimary() && tmpPart->Charge()!=0. && tmpPart->Charge()!=-99.  && tmpPart->Pt()>0.){
                 new((*mcpartOUT)[nAODmcpart++]) AliAODMCParticle(*tmpPart);
                 dummy = (*mcpartOUT)[nAODmcpart-1];
+
+                if(fDebug>10) printf("added track %d with pT=%.2f to extra branch\n",nAODmcpart,tmpPart->Pt());
                 
                 fh1MCTrackPt->Fill(tmpPart->Pt());
                 fh2MCTrackEtaPhi->Fill(tmpPart->Eta(), tmpPart->Phi());
                 nPhysicalPrimary++;
+
                }
             }
             fh1MCTrackN->Fill((Float_t)nPhysicalPrimary);
index 73ec76f..a1ffe07 100644 (file)
@@ -1935,16 +1935,17 @@ Int_t  AliAnalysisTaskJetCluster::GetListOfTracks(TList *list,Int_t type){
          continue;
        }
 
-
-       if(partmc && !partmc->IsPhysicalPrimary())continue;
+       if(!partmc) continue;
+       if(!partmc->IsPhysicalPrimary())continue;
 
        if (track->Pt()<fTrackPtCut) {
-         if(fDebug>2)  printf("track %d has too low pt %.2f\n",it,track->Pt());
+         if(fDebug>10)  printf("track %d has too low pt %.2f\n",it,track->Pt());
          continue;
        }
 
+       /*
+       AliAODTrack *trackAOD = dynamic_cast<AliAODTrack*>((*aodExtraTracks)[it]);//(track);
 
-       AliAODTrack *trackAOD = dynamic_cast<AliAODTrack*> (track);
        if(!trackAOD) {
          if(fDebug>10) printf("trackAOD %d does not exist\n",it);
          continue;
@@ -1952,12 +1953,13 @@ Int_t  AliAnalysisTaskJetCluster::GetListOfTracks(TList *list,Int_t type){
        
        trackAOD->SetFlags(AliESDtrack::kEmbedded);
        trackAOD->SetFilterMap(fFilterMask);
+       */
+       if(fDebug>10) printf("pt extra track %.2f \n", track->Pt());        
        
-       if(fDebug>10) printf("pt extra track %.2f \n", trackAOD->Pt());        
-       
-       if(TMath::Abs(trackAOD->Eta())>fTrackEtaWindow) continue;
-       if(trackAOD->Pt()<fTrackPtCut) continue;
-       list->Add(trackAOD);
+       if(TMath::Abs(track->Eta())>fTrackEtaWindow) continue;
+       if(track->Pt()<fTrackPtCut) continue;
+       list->Add(track);
+
        iCount++;
       }
     }
index 589d0b2..c5cf47d 100644 (file)
@@ -853,10 +853,13 @@ void AliAnalysisTaskFastEmbedding::UserExec(Option_t *)
                if(tmpPart->IsPhysicalPrimary() && tmpPart->Charge()!=0. && tmpPart->Charge()!=-99.  && tmpPart->Pt()>0.){
                 new((*mcpartOUT)[nAODmcpart++]) AliAODMCParticle(*tmpPart);
                 dummy = (*mcpartOUT)[nAODmcpart-1];
+
+                if(fDebug>10) printf("added track %d with pT=%.2f to extra branch\n",nAODmcpart,tmpPart->Pt());
                 
                 fh1MCTrackPt->Fill(tmpPart->Pt());
                 fh2MCTrackEtaPhi->Fill(tmpPart->Eta(), tmpPart->Phi());
                 nPhysicalPrimary++;
+
                }
             }
             fh1MCTrackN->Fill((Float_t)nPhysicalPrimary);
index 73ec76f..a1ffe07 100644 (file)
@@ -1935,16 +1935,17 @@ Int_t  AliAnalysisTaskJetCluster::GetListOfTracks(TList *list,Int_t type){
          continue;
        }
 
-
-       if(partmc && !partmc->IsPhysicalPrimary())continue;
+       if(!partmc) continue;
+       if(!partmc->IsPhysicalPrimary())continue;
 
        if (track->Pt()<fTrackPtCut) {
-         if(fDebug>2)  printf("track %d has too low pt %.2f\n",it,track->Pt());
+         if(fDebug>10)  printf("track %d has too low pt %.2f\n",it,track->Pt());
          continue;
        }
 
+       /*
+       AliAODTrack *trackAOD = dynamic_cast<AliAODTrack*>((*aodExtraTracks)[it]);//(track);
 
-       AliAODTrack *trackAOD = dynamic_cast<AliAODTrack*> (track);
        if(!trackAOD) {
          if(fDebug>10) printf("trackAOD %d does not exist\n",it);
          continue;
@@ -1952,12 +1953,13 @@ Int_t  AliAnalysisTaskJetCluster::GetListOfTracks(TList *list,Int_t type){
        
        trackAOD->SetFlags(AliESDtrack::kEmbedded);
        trackAOD->SetFilterMap(fFilterMask);
+       */
+       if(fDebug>10) printf("pt extra track %.2f \n", track->Pt());        
        
-       if(fDebug>10) printf("pt extra track %.2f \n", trackAOD->Pt());        
-       
-       if(TMath::Abs(trackAOD->Eta())>fTrackEtaWindow) continue;
-       if(trackAOD->Pt()<fTrackPtCut) continue;
-       list->Add(trackAOD);
+       if(TMath::Abs(track->Eta())>fTrackEtaWindow) continue;
+       if(track->Pt()<fTrackPtCut) continue;
+       list->Add(track);
+
        iCount++;
       }
     }