]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
manual external threshold of the momentum conservation check (A.Alici)
authorzconesa <zaida.conesa.del.valle@cern.ch>
Tue, 21 Oct 2014 19:16:11 +0000 (21:16 +0200)
committerzconesa <zaida.conesa.del.valle@cern.ch>
Tue, 21 Oct 2014 19:16:11 +0000 (21:16 +0200)
PWGHF/vertexingHF/AliCFTaskVertexingHF.cxx
PWGHF/vertexingHF/AliCFTaskVertexingHF.h
PWGHF/vertexingHF/AliCFVertexingHFCascade.cxx
PWGHF/vertexingHF/AliCFVertexingHFCascade.h
PWGHF/vertexingHF/macros/AddTaskCFVertexingHFLctoV0bachelorTMVA.C

index 00996e1f9843c3267057ce46934177036c3126da..2832723aa26d40e20fa0310752b773fd0bbbba09 100644 (file)
@@ -134,7 +134,8 @@ AliCFTaskVertexingHF::AliCFTaskVertexingHF() :
   fIsPPbData(kFALSE),
   fUseAdditionalCuts(kFALSE),
   fUseCutsForTMVA(kFALSE),
-  fUseCascadeTaskForLctoV0bachelor(kFALSE)
+  fUseCascadeTaskForLctoV0bachelor(kFALSE),
+  fCutOnMomConservation(0.00001)
 {
   //
   //Default ctor
@@ -196,7 +197,8 @@ AliCFTaskVertexingHF::AliCFTaskVertexingHF(const Char_t* name, AliRDHFCuts* cuts
   fIsPPbData(kFALSE),
   fUseAdditionalCuts(kFALSE),
   fUseCutsForTMVA(kFALSE),
-  fUseCascadeTaskForLctoV0bachelor(kFALSE)
+  fUseCascadeTaskForLctoV0bachelor(kFALSE),
+  fCutOnMomConservation(0.00001)
 {
   //
   // Constructor. Initialization of Inputs and Outputs
@@ -289,7 +291,8 @@ AliCFTaskVertexingHF::AliCFTaskVertexingHF(const AliCFTaskVertexingHF& c) :
   fIsPPbData(c.fIsPPbData),
   fUseAdditionalCuts(c.fUseAdditionalCuts),
   fUseCutsForTMVA(c.fUseCutsForTMVA),
-  fUseCascadeTaskForLctoV0bachelor(c.fUseCascadeTaskForLctoV0bachelor)
+  fUseCascadeTaskForLctoV0bachelor(c.fUseCascadeTaskForLctoV0bachelor),
+  fCutOnMomConservation(c.fCutOnMomConservation)
 {
   //
   // Copy Constructor
@@ -651,6 +654,7 @@ void AliCFTaskVertexingHF::UserExec(Option_t *)
       ((AliCFVertexingHFCascade*)cfVtxHF)->SetPDGneutrDaughPositive(211);
       ((AliCFVertexingHFCascade*)cfVtxHF)->SetPDGneutrDaughNegative(211);
       ((AliCFVertexingHFCascade*)cfVtxHF)->SetPrimaryVertex(aodVtx);
+      ((AliCFVertexingHFCascade*)cfVtxHF)->SetCutOnMomConservation(fCutOnMomConservation);
       if (fUseAdditionalCuts) ((AliCFVertexingHFCascade*)cfVtxHF)->SetUseCutsForTMVA(fUseCutsForTMVA);
     }
     else {
index bc3e9b81748134479480eb496f025cf9f92f39d9..9f37e44c6e8ce3357f2348629bac7b8b1626a87f 100644 (file)
@@ -242,6 +242,9 @@ public:
        void SetUseCascadeTaskForLctoV0bachelor(Bool_t useCascadeTaskForLctoV0bachelor) {fUseCascadeTaskForLctoV0bachelor = useCascadeTaskForLctoV0bachelor;}
        Bool_t GetUseCascadeTaskForLctoV0bachelor() const {return fUseCascadeTaskForLctoV0bachelor;}
 
+       void SetCutOnMomConservation(Float_t cut) {fCutOnMomConservation = cut;}
+       Bool_t GetCutOnMomConservation() const {return fCutOnMomConservation;}
+
 protected:
        AliCFManager   *fCFManager;   //  pointer to the CF manager
        TH1I *fHistEventsProcessed;   //! simple histo for monitoring the number of events processed
@@ -299,8 +302,9 @@ protected:
        Bool_t fUseCutsForTMVA;     // flag to use additional cuts needed for Lc --> K0S + p, TMVA
                                    // these are the pre-selection cuts for the TMVA
        Bool_t fUseCascadeTaskForLctoV0bachelor;   // flag to define which task to use for Lc --> K0S+p
-   
-       ClassDef(AliCFTaskVertexingHF,22); // class for HF corrections as a function of many variables
+       Float_t fCutOnMomConservation; // cut on momentum conservation
+
+       ClassDef(AliCFTaskVertexingHF,23); // class for HF corrections as a function of many variables
 };
 
 #endif
index 8967385b854a5a449c096d9b7f262f4a126b97ce..75489e5d49dd0968dec22fa520dcb98df70edfc4 100644 (file)
@@ -47,7 +47,8 @@ AliCFVertexingHF(mcArray, originDselection),
   fPDGneutrDaughPositive(0),
   fPDGneutrDaughNegative(0),
   fPrimVtx(0x0),
-  fUseCutsForTMVA(kFALSE)
+  fUseCutsForTMVA(kFALSE),
+  fCutOnMomConservation(0.00001)
 {
   // standard constructor
 
@@ -502,9 +503,9 @@ Bool_t AliCFVertexingHFCascade::EvaluateIfCorrectNeutrDaugh(AliAODMCParticle* ne
   Double_t pzMother = neutralDaugh->Pz();
   AliDebug(3, Form("pxMother = %f, pyMother = %f, pzMother = %f", pxMother, pyMother, pzMother));
   AliDebug(3, Form("sumPxDau = %f, sumPyDau = %f, sumPzDau = %f", sumPxDau, sumPyDau, sumPzDau));
-  if(TMath::Abs(pxMother-sumPxDau)/(TMath::Abs(pxMother)+1.e-13)>0.00001 ||
-     TMath::Abs(pyMother-sumPyDau)/(TMath::Abs(pyMother)+1.e-13)>0.00001 ||
-     TMath::Abs(pzMother-sumPzDau)/(TMath::Abs(pzMother)+1.e-13)>0.00001){
+  if(TMath::Abs(pxMother-sumPxDau)/(TMath::Abs(pxMother)+1.e-13)>fCutOnMomConservation ||
+     TMath::Abs(pyMother-sumPyDau)/(TMath::Abs(pyMother)+1.e-13)>fCutOnMomConservation ||
+     TMath::Abs(pzMother-sumPzDau)/(TMath::Abs(pzMother)+1.e-13)>fCutOnMomConservation){
     AliDebug(2, "Momentum conservation violated, skipping!!");
     return isHadronic;  
   }
@@ -607,8 +608,11 @@ void AliCFVertexingHFCascade::SetAccCut()
       fPtAccCut[iP]=0.1;
       fEtaAccCut[iP]=0.9;
     }
-    fPtAccCut[2]=0.06;  // soft pion
-    fEtaAccCut[2]=0.9;  // soft pion
+
+    if (fPDGcascade != 4122){
+      fPtAccCut[2]=0.06;  // soft pion
+      fEtaAccCut[2]=0.9;  // soft pion
+    }
   }
   return;
 }
index f0bac2b51ef34e42cf80be66164842d9f66220b0..00f466fe829ed202aede61de63d7f0dfd7c8962d 100644 (file)
@@ -82,6 +82,9 @@ class AliCFVertexingHFCascade : public AliCFVertexingHF{
   void SetUseCutsForTMVA(Bool_t useCutsForTMVA) {fUseCutsForTMVA = useCutsForTMVA;}
   Bool_t GetUseCutsForTMVA() const {return fUseCutsForTMVA;}
 
+  void SetCutOnMomConservation(Float_t cut) {fCutOnMomConservation = cut;}
+  Bool_t GetCutOnMomConservation() const {return fCutOnMomConservation;}
+
  protected:
   
   
@@ -98,8 +101,9 @@ class AliCFVertexingHFCascade : public AliCFVertexingHF{
   AliAODVertex* fPrimVtx;        // primaryVertex
   Bool_t fUseCutsForTMVA;        // flag to decide whether to use or not the preselection
                                  // cuts of the TMVA when filling the CF
+  Float_t fCutOnMomConservation; // cut on momentum conservation
 
-  ClassDef(AliCFVertexingHFCascade, 3); // CF class for D* and other cascades
+  ClassDef(AliCFVertexingHFCascade,4); // CF class for D* and other cascades
   
 };
 
index 1d5e311b3e398daa66f183f5577bdaa2d5460427..fe68f6b3f206bcfe0d3c4fa5c15af41582b89652 100644 (file)
@@ -539,7 +539,6 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHFLctoV0bachelorTMVA(const char* cutFile
   task->SetCFManager(man); //here is set the CF manager
   task->SetDecayChannel(22);
   task->SetUseCascadeTaskForLctoV0bachelor(kTRUE);
-  task->SetUseAdditionalCuts(kFALSE);
   task->SetUseAdditionalCuts(kTRUE);
   task->SetUseCutsForTMVA(kFALSE);
   task->SetUseFlatPtWeight(useFlatPtWeight); 
@@ -552,6 +551,7 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHFLctoV0bachelorTMVA(const char* cutFile
   task->SetRejectCandidateIfNotFromQuark(kFALSE); // put to false if you want to keep HIJING D0!!
   task->SetUseMCVertex(kFALSE); // put to true if you want to do studies on pp
   //task->SetPtWeightsFromDataPbPb276overLHC12a17a();
+  task->SetCutOnMomConservation(0.0000005);
 
   if (isKeepDfromB && !isKeepDfromBOnly) task->SetDselection(2);
   if (isKeepDfromB && isKeepDfromBOnly) task->SetDselection(1);