Separate task for muon tracks added. (R. Arnaldi)
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 May 2008 10:14:33 +0000 (10:14 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 May 2008 10:14:33 +0000 (10:14 +0000)
ANALYSIS/AliAnalysisTaskESDfilter.cxx
STEER/CreateAODfromESD.C

index 83c4c79..7d7d385 100644 (file)
@@ -746,47 +746,6 @@ void AliAnalysisTaskESDfilter::ConvertESDtoAOD() {
        }       
     } // end of loop on tracks
     
-    // muon tracks
-    Int_t nMuTracks = esd->GetNumberOfMuonTracks();
-    for (Int_t nMuTrack = 0; nMuTrack < nMuTracks; ++nMuTrack) {
-       
-       AliESDMuonTrack *esdMuTrack = esd->GetMuonTrack(nMuTrack);     
-       p[0] = esdMuTrack->Px(); 
-       p[1] = esdMuTrack->Py(); 
-       p[2] = esdMuTrack->Pz();
-       pos[0] = primary->GetX(); 
-       pos[1] = primary->GetY(); 
-       pos[2] = primary->GetZ();
-       
-       // has to be changed once the muon pid is provided by the ESD
-       for (Int_t i = 0; i < 10; pid[i++] = 0.); pid[AliAODTrack::kMuon]=1.;
-       
-       primary->AddDaughter(aodTrack =
-           new(tracks[jTracks++]) AliAODTrack(0, // no ID provided
-                                              0, // no label provided
-                                              p,
-                                              kTRUE,
-                                              pos,
-                                              kFALSE,
-                                              NULL, // no covariance matrix provided
-                                              (Short_t)-99, // no charge provided
-                                              0, // no ITSClusterMap
-                                              pid,
-                                              primary,
-                                              kTRUE,  // check if this is right
-                                              kTRUE,  // not used for vertex fit
-                                              AliAODTrack::kPrimary)
-           );
-  
-       aodTrack->ConvertAliPIDtoAODPID();
-       aodTrack->SetHitsPatternInTrigCh(esdMuTrack->GetHitsPatternInTrigCh());
-       Int_t track2Trigger = esdMuTrack->GetMatchTrigger();
-       aodTrack->SetMatchTrigger(track2Trigger);
-       if (track2Trigger) 
-         aodTrack->SetChi2MatchTrigger(esdMuTrack->GetChi2MatchTrigger());
-       else 
-         aodTrack->SetChi2MatchTrigger(0.);
-    }
     tracks.Expand(jTracks); // remove 'empty slots' due to unwritten tracks
   
     // Access to the AOD container of PMD clusters
index 87c39d1..3dd0289 100644 (file)
@@ -21,8 +21,9 @@ void CreateAODfromESD(const char *inFileName = "AliESDs.root",
     
     gSystem->Load("libANALYSIS");
     gSystem->Load("libANALYSISalice");
-    TChain *chain = new TChain("esdTree");
+    gSystem->Load("libPWG3muon");
 
+    TChain *chain = new TChain("esdTree");
     // Steering input chain
     chain->Add(inFileName);
     AliAnalysisManager *mgr  = new AliAnalysisManager("ESD to AOD", "Analysis Manager");
@@ -37,8 +38,12 @@ void CreateAODfromESD(const char *inFileName = "AliESDs.root",
     mgr->SetOutputEventHandler(aodHandler);
 
     // Task
+    // Barrel Tracks
     AliAnalysisTaskESDfilter *filter = new AliAnalysisTaskESDfilter("Filter");
     mgr->AddTask(filter);
+    // Muons
+    AliAnalysisTaskESDMuonFilter *esdmuonfilter = new AliAnalysisTaskESDMuonFilter("ESD Muon Filter");
+    mgr->AddTask(esdmuonfilter);
 
     AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts", "Standard");
     esdTrackCutsL->SetMinNClustersTPC(50);
@@ -66,6 +71,9 @@ void CreateAODfromESD(const char *inFileName = "AliESDs.root",
     mgr->ConnectInput (filter, 0, cinput1 );
     mgr->ConnectOutput(filter, 0, coutput1);
 
+    mgr->ConnectInput (esdmuonfilter, 0, cinput1 );
+    mgr->ConnectOutput(esdmuonfilter, 0, coutput1);
+
     //
     // Run the analysis
     //