]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG3/vertexingHF/AliCFTaskVertexingHF.cxx
Added PostData in UserCreateOutputObjects (Chiara)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliCFTaskVertexingHF.cxx
index bdba29e7997ee26065be7c42b8e4dd0099ced7e0..bfb6cf0b85fcdf74cf2715bfd5c9e840f0809432 100644 (file)
@@ -100,7 +100,9 @@ AliCFTaskVertexingHF::AliCFTaskVertexingHF() :
        fDauNames(""),
        fSign(2),
        fCentralitySelection(kTRUE),
-       fFakeSelection(0)
+       fFakeSelection(0),
+       fRejectIfNoQuark(kTRUE),        
+       fUseMCVertex(kFALSE)
 {
        //
        //Default ctor
@@ -134,7 +136,9 @@ AliCFTaskVertexingHF::AliCFTaskVertexingHF(const Char_t* name, AliRDHFCuts* cuts
        fDauNames(""),
        fSign(2), 
        fCentralitySelection(kTRUE),
-       fFakeSelection(0)
+       fFakeSelection(0),
+       fRejectIfNoQuark(kTRUE),
+       fUseMCVertex(kFALSE)
 {
        //
        // Constructor. Initialization of Inputs and Outputs
@@ -194,7 +198,9 @@ AliCFTaskVertexingHF::AliCFTaskVertexingHF(const AliCFTaskVertexingHF& c) :
        fDauNames(c.fDauNames),
        fSign(c.fSign),
        fCentralitySelection(c.fCentralitySelection),
-       fFakeSelection(c.fFakeSelection)
+       fFakeSelection(c.fFakeSelection),
+       fRejectIfNoQuark(c.fRejectIfNoQuark),
+       fUseMCVertex(c.fUseMCVertex)
 {
        //
        // Copy Constructor
@@ -298,8 +304,7 @@ void AliCFTaskVertexingHF::UserExec(Option_t *)
        
        PostData(1,fHistEventsProcessed) ;
        PostData(2,fCFManager->GetParticleContainer()) ;
-       PostData(3,fCorrelation) ;
-       
+       PostData(3,fCorrelation) ;      
 
        if (fFillFromGenerated){
                AliWarning("Flag to fill container with generated value ON ---> dca, d0pi, d0K, d0xd0, cosPointingAngle will be set as dummy!");
@@ -450,7 +455,13 @@ void AliCFTaskVertexingHF::UserExec(Option_t *)
        
        Double_t zPrimVertex = aodVtx ->GetZ();
        Double_t zMCVertex = mcHeader->GetVtxZ();
-       
+       if (TMath::Abs(zMCVertex) > fCuts->GetMaxVtxZ()){
+         AliDebug(3,Form("z coordinate of MC vertex = %f, it was required to be within [-%f, +%f], skipping event", zMCVertex, fCuts->GetMaxVtxZ(), fCuts->GetMaxVtxZ()));
+         delete[] containerInput;
+         delete[] containerInputMC;
+         return;
+       }
+
        AliESDtrackCuts** trackCuts = new AliESDtrackCuts*[cfVtxHF->GetNProngs()];
        if (fDecayChannel == 21){
                // for the D*, setting the third element of the array of the track cuts to those for the soft pion
@@ -471,14 +482,26 @@ void AliCFTaskVertexingHF::UserExec(Option_t *)
        cfVtxHF->SetFillFromGenerated(fFillFromGenerated);
        cfVtxHF->SetNVar(fNvar);
        cfVtxHF->SetFakeSelection(fFakeSelection);
+       cfVtxHF->SetRejectCandidateIfNotFromQuark(fRejectIfNoQuark);
+
+       // switch-off the trigger class selection (doesn't work for MC)
+       fCuts->SetTriggerClass("");
+
+       // MC vertex, to be used, in case, for pp
+       if (fUseMCVertex) fCuts->SetUseMCVertex(); 
 
-       if (fCentralitySelection)
+       if (fCentralitySelection){ // keep only the requested centrality
          if(fCuts->IsEventSelectedInCentrality(aodEvent)!=0) {
            delete[] containerInput;
            delete[] containerInputMC;
             delete [] trackCuts;
             return;
           }    
+       }  else { // keep all centralities
+         fCuts->SetMinCentrality(0.);
+         fCuts->SetMaxCentrality(100.);
+       }
+       
        
        Float_t centValue = fCuts->GetCentrality(aodEvent);
        cfVtxHF->SetCentralityValue(centValue);  
@@ -934,6 +957,11 @@ void AliCFTaskVertexingHF::UserCreateOutputObjects()
        //slot #1
        OpenFile(1);
        fHistEventsProcessed = new TH1I("CFHFchist0","",1,0,1) ;
+
+       PostData(1,fHistEventsProcessed) ;
+       PostData(2,fCFManager->GetParticleContainer()) ;
+       PostData(3,fCorrelation) ;
+
 }