For AliAnalysisTaskSingleMu: remove check for IsPileupSPD; possibility to add the...
authorpcrochet <pcrochet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Aug 2013 15:12:30 +0000 (15:12 +0000)
committerpcrochet <pcrochet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Aug 2013 15:12:30 +0000 (15:12 +0000)
PWG/muon/AddTaskSingleMuonAnalysis.C
PWG/muon/AliAnalysisTaskSingleMu.cxx
PWG/muon/AliAnalysisTaskSingleMu.h
PWG/muon/AliMergeableCollection.cxx
PWG/muon/AliMergeableCollection.h
PWG/muon/AliVAnalysisMuon.h

index 2c33bb8..8a62ed5 100644 (file)
@@ -12,7 +12,7 @@
 #include "AliAnalysisTaskSingleMu.h"
 #endif
 
-AliAnalysisTaskSingleMu* AddTaskSingleMuonAnalysis(Bool_t isMC = kFALSE)
+AliAnalysisTaskSingleMu* AddTaskSingleMuonAnalysis(Bool_t isMC = kFALSE, TString changeName = "")
 {
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) {
@@ -27,19 +27,21 @@ AliAnalysisTaskSingleMu* AddTaskSingleMuonAnalysis(Bool_t isMC = kFALSE)
   }
 
   // Create container
-  TString currName = "";
   TString outputfile = mgr->GetCommonFileName();
-  if ( ! outputfile.IsNull() ) outputfile += ":PWG3_SingleMu";
-  else outputfile = "SingleMuAnalysis.root";
+  if ( ! outputfile.IsNull() ) outputfile += ":PWG3_SingleMu" + changeName;
+  else outputfile = "SingleMuAnalysis" + changeName + ".root";
 
-  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("SingleMuOut",TObjArray::Class(),AliAnalysisManager::kOutputContainer,outputfile);
+  TString containerName = "SingleMuOut" + changeName;
+  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(containerName.Data(),TObjArray::Class(),AliAnalysisManager::kOutputContainer,outputfile);
 
   // Create cuts
-  AliMuonTrackCuts* muonTrackCuts = new AliMuonTrackCuts("TestStandardMuonTrackCuts", "TestStandardMuonTrackCuts");
+  TString cutsName = "StdMuonTrackCuts" + changeName;
+  AliMuonTrackCuts* muonTrackCuts = new AliMuonTrackCuts(cutsName.Data(), cutsName.Data());
   muonTrackCuts->SetIsMC(isMC);
 
   // Create task
-  AliAnalysisTaskSingleMu *singleMuAnalysisTask = new AliAnalysisTaskSingleMu("SingleMuTask", *muonTrackCuts);
+  TString taskName = "SingleMuTask" + changeName;
+  AliAnalysisTaskSingleMu *singleMuAnalysisTask = new AliAnalysisTaskSingleMu(taskName.Data(), *muonTrackCuts);
   if ( isMC ) singleMuAnalysisTask->SetTrigClassPatterns("ANY");
   mgr->AddTask(singleMuAnalysisTask);
 
index f781858..a16b08b 100644 (file)
@@ -203,8 +203,8 @@ void AliAnalysisTaskSingleMu::ProcessEvent(TString physSel, const TObjArray& sel
     ((TH1*)GetMergeableObject(physSel, trigClassName, centrality, "hIpVtx"))->Fill(ipVz);
   }
 
-  Bool_t isPileupFromSPD = ( fAODEvent && ! fAODEvent->GetTracklets() ) ? InputEvent()->IsPileupFromSPD(3, 0.8, 3., 2., 5.) : InputEvent()->IsPileupFromSPDInMultBins(); // Avoid break when reading Muon AODs (tracklet info is not present and IsPileupFromSPDInMultBins crashes
-  if ( isPileupFromSPD ) return;
+  // Bool_t isPileupFromSPD = ( fAODEvent && ! fAODEvent->GetTracklets() ) ? InputEvent()->IsPileupFromSPD(3, 0.8, 3., 2., 5.) : InputEvent()->IsPileupFromSPDInMultBins(); // Avoid break when reading Muon AODs (tracklet info is not present and IsPileupFromSPDInMultBins crashes // UNCOMMENT TO REJECT PILEUP
+  // if ( isPileupFromSPD ) return; // UNCOMMENT TO REJECT PILEUP
   
   Double_t containerInput[kNvars];
   AliVParticle* track = 0x0;
index 42f8ea1..4d36974 100644 (file)
@@ -27,18 +27,13 @@ class AliAnalysisTaskSingleMu : public AliVAnalysisMuon {
 
   void MyUserCreateOutputObjects();
   void ProcessEvent(TString physSel, const TObjArray& selectTrigClasses, TString centrality);
-
- private:
-
-  AliAnalysisTaskSingleMu(const AliAnalysisTaskSingleMu&);
-  AliAnalysisTaskSingleMu& operator=(const AliAnalysisTaskSingleMu&);
-
+  
   enum {
     kIPVz,           ///< Interaction point vertex distribution
     kTrackContainer, ///< CF container for tracks
     kNobjectTypes    ///< Number of objects
   };
-
+  
   enum {
     kThetaAbs23,  ///< Theta abs 2-3 deg
     kThetaAbs310, ///< Theta abs 3-10 deg
@@ -49,7 +44,7 @@ class AliAnalysisTaskSingleMu : public AliVAnalysisMuon {
     kStepReconstructed,  ///< Reconstructed tracks
     kStepGeneratedMC,    ///< Generated tracks (MC)
     kNsteps              ///< Number of steps
-  };  
+  };
   
   enum {
     kHvarPt,         ///< Pt at vertex
@@ -62,6 +57,11 @@ class AliAnalysisTaskSingleMu : public AliVAnalysisMuon {
     kNvars           ///< THnSparse dimensions
   };
 
+ private:
+
+  AliAnalysisTaskSingleMu(const AliAnalysisTaskSingleMu&);
+  AliAnalysisTaskSingleMu& operator=(const AliAnalysisTaskSingleMu&);
+
   TObjArray* fThetaAbsKeys;    ///< Name of theta at absorber end
 
   ClassDef(AliAnalysisTaskSingleMu, 3); // Single muon analysis
index 31e1521..92bad4d 100644 (file)
@@ -447,7 +447,7 @@ AliMergeableCollection::GetObject(const char* identifier,
 }
 
 //_____________________________________________________________________________
-TObject* AliMergeableCollection::GetSum(const char* idPattern)
+TObject* AliMergeableCollection::GetSum(const char* idPattern) const
 {
   /// Sum objects
   /// The pattern must be in the form:
index 04ad577..56821a7 100644 (file)
@@ -105,7 +105,7 @@ public:
   
   static Bool_t MergeObject(TObject* baseObject, TObject* objToAdd);
   
-  TObject* GetSum(const char* idPattern);
+  TObject* GetSum(const char* idPattern) const;
   
   Bool_t IsEmptyObject(TObject* obj) const;
   
index f6fdef9..c9064c6 100644 (file)
@@ -69,6 +69,25 @@ class AliVAnalysisMuon : public AliAnalysisTaskSE {
   
   void SetWeight ( TObject* wgtObj );
   TObject* GetWeight ( const char* wgtName );
+  
+  enum {
+    kPhysSelPass,    ///< Physics selected events
+    kPhysSelReject,  ///< Events non-passing selection
+    kNselections     ///< Number of selections
+  };
+  
+  enum {
+    kCharmMu,       ///< Mu from charm
+    kBeautyMu,      ///< Mu from beauty
+    kQuarkoniumMu,  ///< Mu from resonance
+    kWbosonMu,      ///< Mu from W
+    kDecayMu,       ///< Decay mu
+    kSecondaryMu,   ///< Secondary mu
+    kRecoHadron,    ///< Reconstructed hadron
+    kUnidentified,  ///< Particle that fails matching kine
+    kNtrackSources  ///< Total number of track sources
+  };
+
 
  protected:
   
@@ -101,24 +120,7 @@ class AliVAnalysisMuon : public AliAnalysisTaskSE {
   TObject* GetMergeableObject(TString physSel, TString trigClassName, TString centrality, TString objectName);
   TObject* GetSum(TString physSel, TString trigClassNames, TString centrality, TString objectPattern);
   
-  enum {
-    kPhysSelPass,    ///< Physics selected events
-    kPhysSelReject,  ///< Events non-passing selection
-    kNselections     ///< Number of selections
-  };
-  
-  enum {
-    kCharmMu,       ///< Mu from charm
-    kBeautyMu,      ///< Mu from beauty
-    kQuarkoniumMu,  ///< Mu from resonance
-    kWbosonMu,      ///< Mu from W
-    kDecayMu,       ///< Decay mu
-    kSecondaryMu,   ///< Secondary mu
-    kRecoHadron,    ///< Reconstructed hadron
-    kUnidentified,  ///< Particle that fails matching kine
-    kNtrackSources  ///< Total number of track sources
-  };
-  
+    
   AliMuonEventCuts* fMuonEventCuts; ///< Muon event cuts
   AliMuonTrackCuts* fMuonTrackCuts; ///< Muon track cuts
   AliMuonPairCuts* fMuonPairCuts;   ///< Muon pair track cuts