add new full mc track selection to event
authorrbertens <rbertens@cern.ch>
Thu, 27 Feb 2014 13:02:10 +0000 (14:02 +0100)
committerrbertens <rbertens@cern.ch>
Thu, 27 Feb 2014 13:03:23 +0000 (14:03 +0100)
PWG/FLOW/Tasks/AliAnalysisTaskJetFlowMC.cxx
PWG/FLOW/Tasks/AliAnalysisTaskJetFlowMC.h

index 2da6b9f..ff04394 100644 (file)
@@ -21,7 +21,7 @@ using namespace std;
 ClassImp(AliAnalysisTaskJetFlowMC)
 
 //_____________________________________________________________________________
-AliAnalysisTaskJetFlowMC::AliAnalysisTaskJetFlowMC() : AliAnalysisTaskSE("AliAnalysisTaskJetFlowMC"), fTracksOutName("JetFlowMC"),  fTracksInName("PicoTrack"), fTracksIn(0),  fTracksOut(0), fCenBin(-1), fCentralityClasses(0), fFuncVn(0), fOutputList(0), fTrackSpectrum(0), fJetSpectrumSF(0), fNoOfSFJets(0), fHistIntV2(0), fHistIntV3(0), fFlowFluctuations(-10), fMaxNumberOfIterations(100), fPsi2(-10), fPsi3(-10), fPrecisionPhi(1e-10), fDetectorType(kVZEROC), fHistSFJetSpectrum(0), fHistSFJetEtaPhi(0) {
+AliAnalysisTaskJetFlowMC::AliAnalysisTaskJetFlowMC() : AliAnalysisTaskSE("AliAnalysisTaskJetFlowMC"), fTracksOutName("JetFlowMC"),  fTracksInName("PicoTrack"), fTracksIn(0),  fTracksOut(0), fCenBin(-1), fCentralityClasses(0), fFuncVn(0), fOutputList(0), fTrackSpectrum(0), fRandomizeEta(kTRUE), fJetSpectrumSF(0), fNoOfSFJets(0), fHistIntV2(0), fHistIntV3(0), fFlowFluctuations(-10), fMaxNumberOfIterations(100), fPsi2(-10), fPsi3(-10), fPrecisionPhi(1e-10), fDetectorType(kVZEROC), fHistSFJetSpectrum(0), fHistSFJetEtaPhi(0) {
     // default constructor for root IO
     for(Int_t i(0); i < 10; i++) {
         fFuncDiffV2[i]                  = 0x0;
@@ -38,7 +38,7 @@ AliAnalysisTaskJetFlowMC::AliAnalysisTaskJetFlowMC() : AliAnalysisTaskSE("AliAna
     }
 }
 //_____________________________________________________________________________
-AliAnalysisTaskJetFlowMC::AliAnalysisTaskJetFlowMC(const char *name) : AliAnalysisTaskSE(name), fTracksOutName("JetFlowMC"), fTracksInName("PicoTrack"), fTracksIn(0), fTracksOut(0), fCenBin(-1), fCentralityClasses(0), fFuncVn(0), fOutputList(0), fTrackSpectrum(0), fJetSpectrumSF(0), fNoOfSFJets(0), fHistIntV2(0), fHistIntV3(0), fFlowFluctuations(-10), fMaxNumberOfIterations(100), fPsi2(-10), fPsi3(-10), fPrecisionPhi(1e-10), fDetectorType(kVZEROC), fHistSFJetSpectrum(0), fHistSFJetEtaPhi(0) {
+AliAnalysisTaskJetFlowMC::AliAnalysisTaskJetFlowMC(const char *name) : AliAnalysisTaskSE(name), fTracksOutName("JetFlowMC"), fTracksInName("PicoTrack"), fTracksIn(0), fTracksOut(0), fCenBin(-1), fCentralityClasses(0), fFuncVn(0), fOutputList(0), fTrackSpectrum(0), fRandomizeEta(kTRUE), fJetSpectrumSF(0), fNoOfSFJets(0), fHistIntV2(0), fHistIntV3(0), fFlowFluctuations(-10), fMaxNumberOfIterations(100), fPsi2(-10), fPsi3(-10), fPrecisionPhi(1e-10), fDetectorType(kVZEROC), fHistSFJetSpectrum(0), fHistSFJetEtaPhi(0) {
     // constructor
     DefineInput(0, TChain::Class());
     DefineOutput(1, TList::Class());
@@ -194,7 +194,7 @@ void AliAnalysisTaskJetFlowMC::UserExec(Option_t *)
     for (Int_t iTracks = 0; iTracks < Ntracks; ++iTracks) {
         AliPicoTrack* track = static_cast<AliPicoTrack*>(fTracksIn->At(iTracks));
         if(!track) continue;
-        Double_t phi(track->Phi()), pt((fTrackSpectrum) ? GetTrackPt() : track->Pt()), eta(track->Eta());
+        Double_t phi(track->Phi()), pt((fTrackSpectrum) ? GetTrackPt() : track->Pt()), eta(fRandomizeEta ? GetTrackEta() : track->Eta());
         // fill qa histo's before applying any (possible) afterburner
         FillHistogramsOriginalData(pt, eta, phi);
         if(fHistDiffV2[fCenBin] || fFuncDiffV2[fCenBin])        V2AfterBurner(phi, eta, pt);
index 00736d0..d1b6e56 100644 (file)
@@ -28,7 +28,7 @@ class AliAnalysisTaskJetFlowMC : public AliAnalysisTaskSE
         TH2F*   BookTH2F(const char* name, const char* x, const char* y, Int_t binsx, Double_t minx, Double_t maxx, Int_t binsy, Double_t miny, Double_t maxy, Int_t c = -1, Bool_t append = kTRUE);
 
         void    UserExec(Option_t *option);
-        void    SetDebugMode(Bool_t d)                          {fDebug = d;}
+        void    SetDebugMode(Bool_t d)                          { fDebug = d;}
         void    SetTracksInName(const char *name)               { fTracksInName     = name; }
         void    SetTracksOutName(const char *name)              { fTracksOutName    = name; }
         // additional setters
@@ -41,6 +41,7 @@ class AliAnalysisTaskJetFlowMC : public AliAnalysisTaskSE
         void    SetIntegratedV2(TH1* v2)                        { fHistIntV2 = v2; }
         void    SetIntegratedV3(TH1* v3)                        { fHistIntV3 = v3; }
         void    SetTrackSpectrum(TF1* ts)                       { fTrackSpectrum = ts; }
+        void    SetRandomizeEta(Bool_t b)                       { fRandomizeEta = b; }
         void    SetSingleFragmentationJetSpectrum(TF1* js)      { fJetSpectrumSF = js; }
         void    SetNoOfSFJets(Int_t n)                          { fNoOfSFJets = n; }
         // additional methods
@@ -50,6 +51,7 @@ class AliAnalysisTaskJetFlowMC : public AliAnalysisTaskSE
         void    CalculateEventPlane();
         // inlined helper calculations
         Double_t        GetTrackPt()       const                { return fTrackSpectrum->GetRandom();}
+        Double_t        GetTrackEta()       const               { return gRandom->Uniform(-.9, .9); }
         /* inline */    Double_t GetV2(Double_t pt) const { 
             return (fFuncDiffV2[fCenBin]) ? fFuncDiffV2[fCenBin]->Eval(pt) :
             fHistDiffV2[fCenBin]->GetBinContent(fHistDiffV2[fCenBin]->GetXaxis()->FindBin(pt));
@@ -90,11 +92,12 @@ class AliAnalysisTaskJetFlowMC : public AliAnalysisTaskSE
         TString         fTracksInName;          // name of input track array
         TClonesArray   *fTracksIn;              //!track array in
         TClonesArray   *fTracksOut;             //!track array out
-        Int_t           fCenBin; //! centrality bin
+        Int_t           fCenBin;                //! centrality bin
         TArrayI*        fCentralityClasses;     // centrality classes (max 10) 
         TF1*            fFuncVn;                //! vn function
         TList*          fOutputList;            // output list
         TF1*            fTrackSpectrum;         // track pt spectrum
+        Bool_t          fRandomizeEta;          // randomize eta
         TF1*            fJetSpectrumSF;         // single fragmentation spectrum of jets
         Int_t           fNoOfSFJets;            // number of single fragmentation jets that will be added
         TF1*            fFuncDiffV2[10];        // differential v2 of charged tracks