New function for TrueChic added and a cut with open photon R added
authorpgonzale <pedro.gonzalez.zamora@cern.ch>
Tue, 21 Oct 2014 13:38:37 +0000 (15:38 +0200)
committerpgonzale <pedro.gonzalez.zamora@cern.ch>
Tue, 21 Oct 2014 13:41:02 +0000 (15:41 +0200)
PWGGA/GammaConv/AliAnalysisTaskGammaConvDalitzV1.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaConvDalitzV1.h
PWGGA/GammaConv/macros/AddTask_GammaConvDalitzQAV1_pPb.C

index c6be532..83b56a6 100644 (file)
@@ -1904,10 +1904,10 @@ void AliAnalysisTaskGammaConvDalitzV1::CalculatePi0DalitzCandidates(){
                                AliAODConversionPhoton *Vgamma=dynamic_cast<AliAODConversionPhoton*>(fGoodVirtualGammas->At(virtualGammaIndex));
                                if (Vgamma==NULL) continue;
                                //Check for same Electron ID
-                               if(gamma->GetTrackLabelPositive() == Vgamma->GetTrackLabelPositive() ||
-                               gamma->GetTrackLabelNegative() == Vgamma->GetTrackLabelNegative() ||
-                               gamma->GetTrackLabelNegative() == Vgamma->GetTrackLabelPositive() ||
-                               gamma->GetTrackLabelPositive() == Vgamma->GetTrackLabelNegative() ) continue;
+                            if(gamma->GetTrackLabelPositive()    == Vgamma->GetTrackLabelPositive() ||
+                               gamma->GetTrackLabelNegative()    == Vgamma->GetTrackLabelNegative() ||
+                               gamma->GetTrackLabelNegative()    == Vgamma->GetTrackLabelPositive() ||
+                               gamma->GetTrackLabelPositive()    == Vgamma->GetTrackLabelNegative() ) continue;
 
                                AliAODConversionMother *pi0cand = new AliAODConversionMother(gamma,Vgamma);
                                pi0cand->SetLabels(GammaIndex,virtualGammaIndex);
@@ -1938,6 +1938,10 @@ void AliAnalysisTaskGammaConvDalitzV1::CalculatePi0DalitzCandidates(){
                                                        hESDMotherInvMassPt[fiCut]->Fill(pi0cand->M(),pi0cand->Pt());   
                                                        Double_t sparesFill[4] = {pi0cand->M(),pi0cand->Pt(),(Double_t)zbin,(Double_t)mbin};
                                                        sESDMotherInvMassPtZM[fiCut]->Fill(sparesFill,1);
+                                                       
+                                                       if(fMCEvent){
+                                                         ProcessTrueMesonCandidates(pi0cand,gamma,Vgamma);
+                                                       }
                                                
                                                        if ( fDoMesonQA ) {
                                                                hESDMotherPhi[fiCut]->Fill(pi0cand->Phi());
@@ -1955,6 +1959,10 @@ void AliAnalysisTaskGammaConvDalitzV1::CalculatePi0DalitzCandidates(){
                                                Double_t sparesFill[4] = {pi0cand->M(),pi0cand->Pt(),(Double_t)zbin,(Double_t)mbin};
                                                sESDMotherInvMassPtZM[fiCut]->Fill(sparesFill,1);
                                                
+                                               if(fMCEvent){
+                                                         ProcessTrueMesonCandidates(pi0cand,gamma,Vgamma);
+                                               }
+                                               
                                                if ( fDoMesonQA ) {
                                                        hESDMotherPhi[fiCut]->Fill(pi0cand->Phi());
                                                        if( lGoodVirtualGamma[virtualGammaIndex] == kFALSE ) {
@@ -1974,11 +1982,15 @@ void AliAnalysisTaskGammaConvDalitzV1::CalculatePi0DalitzCandidates(){
                                                if( Vgamma->M() > 2.5 && Vgamma->M() < 3.4){
                                                        hESDPi0MotherDiffLimInvMassPt[fiCut]->Fill( diffMass , pi0cand->Pt() );
                                                }
+                                               
+                                               if(fMCEvent){
+                                                 ProcessTrueChicCandidates(pi0cand,gamma,Vgamma);
+                                               }
+                                               
+                                               
                                        }
                                        
-                                       if(fMCEvent){
-                                               ProcessTrueMesonCandidates(pi0cand,gamma,Vgamma);
-                                       }
+                                       
                                }
                                delete pi0cand;
                                pi0cand=0x0;
@@ -2151,23 +2163,23 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessTrueMesonCandidates(AliAODConversi
 
        // Process True Mesons
        AliStack *MCStack = fMCEvent->Stack();
-       if(     TrueGammaCandidate->GetV0Index()<fESDEvent->GetNumberOfV0s()    ){
-               //cout<<"Entro True Meson"<<endl;
+       
+       if( TrueGammaCandidate->GetV0Index() < fESDEvent->GetNumberOfV0s() ){
+               
+         
 
                Bool_t isTruePi0 = kFALSE;
                Bool_t isTrueEta = kFALSE;
-               Bool_t massCutAccept = kFALSE;
-               //Bool_t isTrueChiC = kFALSE;
-               Int_t gammaMCLabel = TrueGammaCandidate->GetMCParticleLabel(MCStack);
+               
+               Int_t gammaMCLabel = TrueGammaCandidate->GetMCParticleLabel(MCStack);
                Int_t gammaMotherLabel = -1;
+               
+               
 
-               if(  ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->DoMassCut() == kTRUE ) {          
-                       if( ((AliDalitzElectronCuts*) fCutElectronArray->At(fiCut))->MassCut( Pi0Candidate->Pt() , TrueVirtualGammaCandidate->M() ) == kTRUE ){
-                               massCutAccept = kTRUE;
-                       }
-               } else {
-                       massCutAccept  = kTRUE;
-               }
+               
+               
+               //Checking if the gamma candidate is a real gamma
+               
                
                if(gammaMCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother
                        // Daughters Gamma 0
@@ -2185,13 +2197,16 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessTrueMesonCandidates(AliAODConversi
                }
 
 
+               
+               //Checking if the virtual gamma is a real virtual gamma
+               
                Int_t virtualGammaMCLabel = TrueVirtualGammaCandidate->GetMCParticleLabel(MCStack);
                Int_t virtualGammaMotherLabel = -1;
-               Int_t virtualGamma = 1;
-               Int_t virtualGammaGrandMotherLabel =-1;
+               Int_t virtualGamma = -1;
+               
 
 
-               if(virtualGammaMCLabel != -1){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother
+               if( virtualGammaMCLabel != -1 ){ // Gamma is Combinatorial; MC Particles don't belong to the same Mother
                        // Daughters Gamma 1
                        TParticle * negativeMC = (TParticle*)TrueVirtualGammaCandidate->GetNegativeMCDaughter(MCStack);
                        TParticle * positiveMC = (TParticle*)TrueVirtualGammaCandidate->GetPositiveMCDaughter(MCStack);
@@ -2201,9 +2216,8 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessTrueMesonCandidates(AliAODConversi
 
                                if( virtualGammaMotherMC->GetPdgCode() != 22 ){
                                        virtualGammaMotherLabel=virtualGammaMCLabel;
-                                       if(virtualGammaMotherMC->GetPdgCode() == 443){
-                                               virtualGammaGrandMotherLabel=virtualGammaMotherMC->GetFirstMother();
-                                       }
+                                       virtualGamma = 1;
+                                       
                                } else if (negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() ==5){ // ... From Conversion ...
                                        virtualGammaMotherLabel=virtualGammaMotherMC->GetFirstMother();
                                        virtualGamma = 0; //no virtual gamma
@@ -2211,8 +2225,11 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessTrueMesonCandidates(AliAODConversi
                        }
                }
 
+               
+               //Checking if both gamma and virtual gamma comming from Pi0 or Eta
+               
 
-               if(gammaMotherLabel >= 0 && ( gammaMotherLabel == virtualGammaMotherLabel) ){
+               if( gammaMotherLabel >= 0 && ( gammaMotherLabel == virtualGammaMotherLabel) ){
                        if(((TParticle*)MCStack->Particle(virtualGammaMotherLabel))->GetPdgCode() == 111){
                                isTruePi0=kTRUE;
                        }
@@ -2221,19 +2238,9 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessTrueMesonCandidates(AliAODConversi
                        }
                }
 
-               if( fDoChicAnalysis) {
-                       if(gammaMotherLabel>=0 && ( gammaMotherLabel == virtualGammaGrandMotherLabel) ){
-                               if(((TParticle*)MCStack->Particle(virtualGammaGrandMotherLabel))->GetPdgCode() == 445 ||
-                                       ((TParticle*)MCStack->Particle(virtualGammaGrandMotherLabel))->GetPdgCode() == 10443 ||
-                                       ((TParticle*)MCStack->Particle(virtualGammaGrandMotherLabel))->GetPdgCode() == 20443 ){
-                               
-                                       hESDTrueMotherChiCInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
-                                       hESDTrueMotherChiCDiffInvMassPt[fiCut]->Fill(Pi0Candidate->M()-TrueVirtualGammaCandidate->M(),Pi0Candidate->Pt());
-                               }
-                       }  
-               }
+               
 
-               if( ( isTruePi0 || isTrueEta) && massCutAccept ){ // True Pion or Eta
+               if(  isTruePi0 || isTrueEta ){ // True Pion or Eta
                        if ( virtualGamma == 1 ) { //True Dalitz        
                                Float_t weighted= 1;
                                
@@ -2291,8 +2298,8 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessTrueMesonCandidates(AliAODConversi
                        }
                }
 
-               if(!isTruePi0 && !isTrueEta && massCutAccept ){ // Background
-                       if(gammaMotherLabel>-1 && virtualGammaMotherLabel>-1 && virtualGamma == 0){ // Both Tracks are Photons and have a mother but not Pi0 or Eta
+               if( !isTruePi0 && !isTrueEta ){ // Background
+                       if( gammaMotherLabel > -1 && virtualGammaMotherLabel > -1 && virtualGamma == 0 ){ // Both Tracks are Photons and have a mother but not Pi0 or Eta
                                hESDTrueBckGGInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
                        } else { // No photon or without mother
                                hESDTrueBckContInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
@@ -2301,6 +2308,86 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessTrueMesonCandidates(AliAODConversi
        }
 }
 
+//______________________________________________________________________
+void AliAnalysisTaskGammaConvDalitzV1::ProcessTrueChicCandidates(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate, AliAODConversionPhoton *TruejpsiCandidate)
+{
+
+       
+       AliStack *MCStack = fMCEvent->Stack();
+       
+       
+       if(     TrueGammaCandidate->GetV0Index() < fESDEvent->GetNumberOfV0s()  ){
+               
+         
+         
+               //Checking gamma
+               
+               Int_t gammaMCLabel = TrueGammaCandidate->GetMCParticleLabel(MCStack);
+               Int_t gammaMotherLabel = -1;
+
+               
+               
+               if( gammaMCLabel != -1){// Gamma is Combinatorial; MC Particles don't belong to the same Mother
+                       // Daughters Gamma 0
+                       
+                       TParticle * negativeMC = (TParticle*)TrueGammaCandidate->GetNegativeMCDaughter(MCStack);
+                       TParticle * positiveMC = (TParticle*)TrueGammaCandidate->GetPositiveMCDaughter(MCStack);
+                       TParticle * gammaMC = (TParticle*)MCStack->Particle(gammaMCLabel);
+
+                       if( TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11 ){  // Electrons ...
+                               if( negativeMC->GetUniqueID() == 5 && positiveMC->GetUniqueID() == 5 ){ // ... From Conversion ...
+                                       if(gammaMC->GetPdgCode() == 22){ // ... with Gamma Mother
+                                               gammaMotherLabel=gammaMC->GetFirstMother();
+                                       }
+                               }
+                       }
+               }
+
+
+               
+               //Checking jpsi
+               
+               Int_t jpsiMCLabel               = TruejpsiCandidate->GetMCParticleLabel(MCStack);
+               Int_t jpsiMotherLabel           = -1;
+
+               
+
+               if( jpsiMCLabel != -1 ){ 
+                       
+                       TParticle * negativeMC = (TParticle*)TruejpsiCandidate->GetNegativeMCDaughter(MCStack);
+                       TParticle * positiveMC = (TParticle*)TruejpsiCandidate->GetPositiveMCDaughter(MCStack);
+                       TParticle * jpsiMC = (TParticle*)MCStack->Particle(jpsiMCLabel);
+
+                       if(TMath::Abs(negativeMC->GetPdgCode())==11 && TMath::Abs(positiveMC->GetPdgCode())==11){  // Electrons ...
+
+                                                                       
+                               if(jpsiMC->GetPdgCode() == 443){
+                                 
+                                               jpsiMotherLabel=jpsiMC->GetFirstMother();
+                                               
+                               }
+                                
+                                                               
+                       }
+               }
+
+
+               if( gammaMotherLabel>=0 && ( gammaMotherLabel == jpsiMotherLabel) ){
+                 if(                   ((TParticle*)MCStack->Particle(jpsiMotherLabel))->GetPdgCode() == 445   ||
+                                       ((TParticle*)MCStack->Particle(jpsiMotherLabel))->GetPdgCode() == 10443 ||
+                                       ((TParticle*)MCStack->Particle(jpsiMotherLabel))->GetPdgCode() == 20443 ){
+                               
+                                       hESDTrueMotherChiCInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+                                       hESDTrueMotherChiCDiffInvMassPt[fiCut]->Fill(Pi0Candidate->M()-TruejpsiCandidate->M(),Pi0Candidate->Pt());
+                 }
+               }  
+               
+       }
+}
+
+
+
+
 
 //________________________________________________________________________
 void AliAnalysisTaskGammaConvDalitzV1::MoveParticleAccordingToVertex(AliAODConversionPhoton* particle,const AliGammaConversionAODBGHandler::GammaConversionVertex *vertex){
index a4f9977..f023158 100644 (file)
@@ -68,6 +68,7 @@ class AliAnalysisTaskGammaConvDalitzV1: public AliAnalysisTaskSE
                void ProcessPhotonCandidates();
                void ProcessTruePhotonCandidates(AliAODConversionPhoton*);
                void ProcessTrueMesonCandidates(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate, AliAODConversionPhoton *TrueVirtualGammaCandidate);
+               void ProcessTrueChicCandidates(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate, AliAODConversionPhoton *TruejpsiCandidate);
                void MoveParticleAccordingToVertex(AliAODConversionPhoton* particle,const AliGammaConversionAODBGHandler::GammaConversionVertex *vertex);
                void ProcessElectronCandidates();
                void ProcessVirtualGammasCandidates();
index 5c4aaa8..94494a4 100644 (file)
@@ -416,6 +416,15 @@ if( trainConfig == 1 ) {  // No eta shift |Y| < 0.8
 } else if( trainConfig == 51 ){
   
        eventCutArray[0]="8000011"; photonCutArray[0] = "009093603007200000000"; ElecCutarray[0] = "90475400233202623710"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100  //Tracks 2011 + kAny + new psiPair Cut + gammaR >  7.5 cm
+       
+} else if( trainConfig == 52 ){
+  
+       eventCutArray[0]="8000011"; photonCutArray[0] = "000093603007200000000"; ElecCutarray[0] = "90475400233202623710"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100  //Tracks 2011 + kAny + new psiPair Cut + gammaR >  0 cm
+       
+} else if( trainConfig == 53 ) {  
+                                            
+        eventCutArray[0]="8000011"; photonCutArray[0] = "002093603007200000000"; ElecCutarray[0] = "90475400233202623700"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100  //Tracks 2011  + kAny  + New psi pair cut + New psi pair cut  fPsiPairCut = 0.60    fDeltaPhiCutMin = 0.0 fDeltaPhiCutMax = 0.12
+
 }
        
 
@@ -461,8 +470,7 @@ if( trainConfig == 1 ) {  // No eta shift |Y| < 0.8
 
          if (  ( trainConfig >= 1 && trainConfig <= 6 ) || trainConfig == 9  ||  trainConfig == 11  || trainConfig == 13 || trainConfig == 14 || trainConfig == 16 || trainConfig == 17 || trainConfig == 18 || trainConfig == 19 || trainConfig == 20 || trainConfig == 21 || trainConfig == 22 || trainConfig == 23 ||
                  trainConfig == 28 || trainConfig == 29 || trainConfig == 30 ||  trainConfig == 31  || trainConfig == 32 || trainConfig == 33 || trainConfig == 37 || trainConfig == 38 || trainConfig == 39 || trainConfig == 40 || trainConfig == 41 || trainConfig == 41 || trainConfig == 43 || trainConfig == 44 ||
-                 trainConfig == 45 || trainConfig == 46 || trainConfig == 47 ||  trainConfig == 48  || trainConfig == 49 || trainConfig == 50 || trainConfig == 51 )
-         ){
+                 trainConfig == 45 || trainConfig == 46 || trainConfig == 47 ||  trainConfig == 48  || trainConfig == 49 || trainConfig == 50 || trainConfig == 51 || trainConfig == 52 ) {
            
            if (doWeighting){
              if (generatorName.CompareTo("DPMJET")==0){