Minor additions
authorpchrista <pchrista@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Oct 2013 03:14:49 +0000 (03:14 +0000)
committerpchrista <pchrista@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Oct 2013 03:14:49 +0000 (03:14 +0000)
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskBFPsi.cxx
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskBFPsi.h
PWGCF/EBYE/macros/AddTaskBalancePsiCentralityTrain.C
PWGCF/EBYE/macros/runBalanceFunctionPsi.C

index e516480..c567c38 100755 (executable)
@@ -55,6 +55,7 @@ ClassImp(AliAnalysisTaskBFPsi)
 //________________________________________________________________________\r
 AliAnalysisTaskBFPsi::AliAnalysisTaskBFPsi(const char *name) \r
 : AliAnalysisTaskSE(name),\r
+  fDebugLevel(kFALSE),\r
   fArrayMC(0), //+++++++++++++\r
   fBalance(0),\r
   fRunShuffling(kFALSE),\r
@@ -936,7 +937,8 @@ Double_t AliAnalysisTaskBFPsi::IsEventAccepted(AliVEvent *event){
              if(TMath::Abs(vertex->GetY()) < fVyMax) {\r
                if(TMath::Abs(vertex->GetZ()) < fVzMax) {\r
                  if(fUseMultiplicity) {\r
-                   //cout<<"Filling 4 for multiplicity..."<<endl;\r
+                   //if(fDebugLevel)\r
+                   //Printf("Filling 4th bin of fHistEventStats for multiplicity %lf",gRefMultiplicity);\r
                    fHistEventStats->Fill(4,gRefMultiplicity);//analyzed events\r
                  }\r
                  else if(fUseCentrality) {\r
@@ -957,7 +959,9 @@ Double_t AliAnalysisTaskBFPsi::IsEventAccepted(AliVEvent *event){
                  }\r
                  // take events only within the same multiplicity class\r
                  else if(fUseMultiplicity) {\r
-                   //cout<<"N(min): "<<fNumberOfAcceptedTracksMin<<" - N(max): "<<fNumberOfAcceptedTracksMax<<" - Nref: "<<gRefMultiplicity<<endl;\r
+                   //if(fDebugLevel) \r
+                   //Printf("N(min): %.0f, N(max): %.0f - N(ref): %.0f",fNumberOfAcceptedTracksMin,\r
+                   //fNumberOfAcceptedTracksMax,gRefMultiplicity);\r
 \r
                    if((gRefMultiplicity > fNumberOfAcceptedTracksMin)||(gRefMultiplicity < fNumberOfAcceptedTracksMax)) {\r
                      fHistEventStats->Fill(5,gRefMultiplicity); //events with correct multiplicity\r
@@ -1025,11 +1029,14 @@ Double_t AliAnalysisTaskBFPsi::GetRefMultiOrCentrality(AliVEvent *event){
     if ((fMultiplicityEstimator == "V0M")||\r
        (fMultiplicityEstimator == "V0A")||\r
        (fMultiplicityEstimator == "V0C") ||\r
-       (fMultiplicityEstimator == "TPC"))\r
+       (fMultiplicityEstimator == "TPC")) {\r
       gMultiplicity = GetReferenceMultiplicityFromAOD(event);\r
+      if(fDebugLevel) Printf("Reference multiplicity (calculated): %.0f",gMultiplicity);\r
+    }\r
     else {\r
       if(header)\r
        gMultiplicity = header->GetRefMultiplicity();\r
+      if(fDebugLevel) Printf("Reference multiplicity (AOD header): %.0f",gMultiplicity);\r
     }\r
   }\r
   else if((fEventClass=="Multiplicity")&&(gAnalysisLevel == "MC")) {\r
@@ -1141,6 +1148,9 @@ Double_t AliAnalysisTaskBFPsi::GetReferenceMultiplicityFromAOD(AliVEvent *event)
     gRefMultiplicityVZERO += event->GetVZEROEqMultiplicity(i);\r
   }//loop over PMTs\r
   \r
+  if(fDebugLevel) \r
+    Printf("VZERO multiplicity: %.0f - TPC multiplicity: %.0f",gRefMultiplicityVZERO,gRefMultiplicityTPC);\r
+\r
   fHistTPCvsVZEROMultiplicity->Fill(gRefMultiplicityVZERO,gRefMultiplicityTPC);\r
 \r
   if(fMultiplicityEstimator == "TPC") \r
index 30245a8..6d414d6 100755 (executable)
@@ -44,6 +44,7 @@ class AliAnalysisTaskBFPsi : public AliAnalysisTaskSE {
                                    Int_t nCentralityBins, \r
                                    Double_t *centralityArrayForCorrections);\r
   //========================correction\r
+  void SetDebugLevel() {fDebugLevel = kTRUE;}\r
 \r
   void SetAnalysisObject(AliBalancePsi *const analysis) {\r
     fBalance         = analysis;\r
@@ -189,6 +190,8 @@ class AliAnalysisTaskBFPsi : public AliAnalysisTaskSE {
   TObjArray* GetAcceptedTracks(AliVEvent* event, Double_t gCentrality, Double_t gReactionPlane);\r
   TObjArray* GetShuffledTracks(TObjArray* tracks, Double_t gCentrality);\r
  \r
+  Bool_t fDebugLevel; // debug level\r
+\r
   TClonesArray* fArrayMC; //! AOD object  //+++++++++++++++++++++\r
   AliBalancePsi *fBalance; //BF object\r
   Bool_t fRunShuffling;//run shuffling or not\r
index e6c41b4..0cbe027 100644 (file)
@@ -126,6 +126,7 @@ AliAnalysisTaskBFPsi *AddTaskBalancePsiCentralityTrain(Double_t centrMin=0.,
   if(fArgEventClass == "Multiplicity") {\r
     taskBF->SetMultiplicityRange(centrMin,centrMax);\r
     taskBF->SetMultiplicityEstimator(centralityEstimator);\r
+    cout<<"Multiplicity estimator "<<centralityEstimator.Data()<<endl;\r
   }\r
   else if(fArgEventClass == "Centrality") {\r
     if(analysisType == "MC")\r
@@ -134,6 +135,7 @@ AliAnalysisTaskBFPsi *AddTaskBalancePsiCentralityTrain(Double_t centrMin=0.,
       taskBF->SetCentralityPercentileRange(centrMin,centrMax);\r
       // centrality estimator (default = V0M)\r
       taskBF->SetCentralityEstimator(centralityEstimator);\r
+      cout<<"Centrality estimator "<<centralityEstimator.Data()<<endl;\r
     }\r
   }\r
 \r
index d219e38..88bcd21 100644 (file)
@@ -104,7 +104,7 @@ void runBalanceFunctionPsi(
       }\r
       else if((bAOD)&&(!bMCtruth)) {\r
        chain = new TChain("aodTree");\r
-       for(Int_t i = 1; i < 2; i++) {\r
+       for(Int_t i = 1; i < 20; i++) {\r
          filename = "/glusterfs/alice1/alice2/pchrist/pp/LHC10c/7TeV/Data/Set";\r
          filename += i; filename += "/AliAOD.root";\r
          chain->Add(filename.Data());\r
@@ -133,7 +133,7 @@ void runBalanceFunctionPsi(
     }//local mode\r
 \r
     // input handler (ESD or AOD)\r
-    Aliveventhandler* inputH = NULL;\r
+    AliVEventHandler* inputH = NULL;\r
     if(!bAOD){\r
       inputH = new AliESDInputHandler();\r
     }\r
@@ -215,16 +215,10 @@ void runBalanceFunctionPsi(
     AliVZEROEPSelectionTask* epSelTask = AddTaskVZEROEPSelection();\r
 \r
     //Add the BF task (all centralities)\r
-    \r
     gROOT->LoadMacro("$ALICE_ROOT/PWGCF/EBYE/macros/AddTaskBalancePsiCentralityTrain.C"); \r
-    //for (Int_t i = 0; i<numberOfCentralityBins; i++) {\r
-    //Double_t lowCentralityBinEdge = centralityArray[i];\r
-    //Double_t highCentralityBinEdge = centralityArray[i+1];\r
-    //Printf("\nWagon for centrality bin %i: %.0f-%.0f",i,lowCentralityBinEdge,highCentralityBinEdge);\r
-    //AliAnalysisTaskBFPsi *task = AddTaskBalancePsiCentralityTrain(lowCentralityBinEdge,highCentralityBinEdge,0,1,0,"V0M",vZ[0],DCAxy[0],DCAz[0],ptMin[0],ptMax[0],etaMin[0],etaMax[0],-1,-1,kUsePID,bResonancesCut,bUseHBTCut,bUseConversionCut,bMomentumDifferenceCut,128,0,"AnalysisResults","Centrality","AOD",1); \r
-      //} // end of for (Int_t i=0; i<numberOfCentralityBins; i++)\r
-\r
-    AddTaskBalancePsiCentralityTrain(0, 500, kFALSE, kTRUE, kFALSE, "", 10, -1, -1, 0.2, 20.0, -0.8, 0.8, -1, -1, kUsePID, kTRUE, kTRUE, kTRUE, kTRUE, 0.1, 128, 1, "AnalysisResults","Multiplicity","AOD",kTRUE, kNSigmaElectronRejection);\r
+\r
+    AliAnalysisTaskBFPsi *taskBF = AddTaskBalancePsiCentralityTrain(0, 500, kFALSE, kTRUE, kFALSE, "V0M", 10, -1, -1, 0.2, 20.0, -0.8, 0.8, -1, -1, kUsePID, kFALSE, kTRUE, 0.02, kFALSE, 0.04, kTRUE, 0.1, 128, 1, "AnalysisResults","TE","Multiplicity","AOD",kTRUE, kNSigmaElectronRejection);\r
+    //taskBF->SetDebugLevel();\r
 \r
     // enable debug printouts\r
     //mgr->SetDebugLevel(2);\r