Added extra protection and some extra histograms (Kathrin)
authorkaamodt <kaamodt@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Apr 2010 15:14:07 +0000 (15:14 +0000)
committerkaamodt <kaamodt@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Apr 2010 15:14:07 +0000 (15:14 +0000)
PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx
PWG4/GammaConv/AliGammaConversionBGHandler.cxx
PWG4/GammaConv/AliV0Reader.cxx
PWG4/macros/ConfigGammaConversion.C

index 65933f1..a7a96b3 100644 (file)
@@ -290,6 +290,8 @@ void AliAnalysisTaskGammaConversion::SetESDtrackCuts()
 void AliAnalysisTaskGammaConversion::UserExec(Option_t */*option*/)
 {
   // Execute analysis for current event
+  
+  //  ConnectInputData("");
        
   //Each event needs an empty branch
   //  fAODBranch->Clear();
@@ -439,6 +441,7 @@ void AliAnalysisTaskGammaConversion::ProcessMCData(){
       if(particle->GetNDaughters()==2){
        if(TMath::Abs(fStack->Particle(particle->GetFirstDaughter())->GetPdgCode()) == 11 &&
           TMath::Abs(fStack->Particle(particle->GetLastDaughter())->GetPdgCode()) == 11){
+
          TParticle* daug0 = fStack->Particle(particle->GetFirstDaughter());
          TParticle* daug1 = fStack->Particle(particle->GetLastDaughter());
          if(TMath::Abs(daug0->Eta()) < 0.9 && TMath::Abs(daug1->Eta()) < 0.9)
@@ -838,15 +841,19 @@ void AliAnalysisTaskGammaConversion::ProcessMCData(){
          fHistograms->FillHistogram("MC_Pi0_ZR", particle->Vz(),particle->R());
          fHistograms->FillHistogram("MC_Pi0_GammaDaughter_OpeningAngle", GetMCOpeningAngle(daughter0,daughter1));
          fHistograms->FillHistogram("MC_Pi0_XY", particle->Vx(), particle->Vy());//only fill from one daughter to avoid multiple filling
-                                       
+         if(TMath::Abs(particle->Eta())<0.9)fHistograms->FillHistogram("MC_Pi0_Pt_Fiducial", particle->Pt());
+                       
          if(gammaEtaCut && gammaRCut){
            //    if(TMath::Abs(daughter0->Eta()) <= fV0Reader->GetEtaCut() && TMath::Abs(daughter1->Eta()) <= fV0Reader->GetEtaCut() ){
            fHistograms->FillHistogram("MC_Pi0_Pt_Eta_withinAcceptance", particle->Pt(),particle->Eta());
            fHistograms->FillHistogram("MC_Pi0_Pt_Rapid_withinAcceptance", particle->Pt(),rapidity);
+           if(TMath::Abs(particle->Eta())<0.9)fHistograms->FillHistogram("MC_Pi0_Pt_withinAcceptance_Fiducial", particle->Pt());
+
            if(daughter0Electron && daughter0Positron && daughter1Electron && daughter1Positron){
              fHistograms->FillHistogram("MC_Pi0_Pt_Eta_ConvGamma_withinAcceptance", particle->Pt(),particle->Eta());
              fHistograms->FillHistogram("MC_Pi0_Pt_Rapid_ConvGamma_withinAcceptance", particle->Pt(),rapidity);
              fHistograms->FillHistogram("MC_Pi0_ZR_ConvGamma_withinAcceptance", particle->Vz(),particle->R());
+             if(TMath::Abs(particle->Eta())<0.9)fHistograms->FillHistogram("MC_Pi0_Pt_ConvGamma_withinAcceptance_Fiducial", particle->Pt());
            }
          }
        }
index 276d5e7..dc3a232 100644 (file)
@@ -108,7 +108,9 @@ void AliGammaConversionBGHandler::Initialize(Double_t * const zBinLimitsArray, D
   else{
     //Print warning
   }
-  fBGEventCounter= new Int_t*[fNBinsZ];
+  if(fBGEventCounter == NULL){
+    fBGEventCounter= new Int_t*[fNBinsZ];
+  }
   for(Int_t z=0;z<fNBinsZ;z++){
     fBGEventCounter[z]=new Int_t[fNBinsMultiplicity];
   }
index d004767..e5cc367 100644 (file)
@@ -257,7 +257,9 @@ void AliV0Reader::Initialize(){
   AliKFParticle::SetField(fESDEvent->GetMagneticField());
 
   //  fCurrentEventGoodV0s = new TClonesArray("TClonesArray", 0);
-  fCurrentEventGoodV0s = new TClonesArray("AliKFParticle", 0);
+  if(fCurrentEventGoodV0s == NULL){
+    fCurrentEventGoodV0s = new TClonesArray("AliKFParticle", 0);
+  }
 
   if(fCalculateBackground == kTRUE){
     if(fBGEventInitialized == kFALSE){
index 357c73c..380cd9d 100644 (file)
@@ -355,6 +355,10 @@ Bool_t kGCplotESDNumberOfSurvivingV0s = kTRUE;
 Bool_t kGCplotESDNumberOfContributorsVtx = kTRUE;
 Bool_t kGCplotESDNumberOfGoodESDTracks = kTRUE;
 
+Bool_t kGCplotMCPi0PtFiducial                            = kTRUE;
+Bool_t kGCplotMCPi0PtWithinAcceptanceFiducial            = kTRUE;
+Bool_t kGCplotMCPi0PtConvGammaWithinAcceptanceFiducial   = kTRUE; 
+
 //  debug histograms
 Bool_t kGCplotESDCutGetOnFly      = kTRUE;
 Bool_t kGCplotESDCutNContributors = kTRUE;
@@ -1731,6 +1735,10 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
     if(kGCplotESDTrueConvGammaTrackLength == kTRUE){histograms->AddHistogram("ESD_TrueConvGamma_TrackLength","Track length of TrueConvGamma",kGCnXBinsTrackLength,kGCfirstXBinTrackLength,kGClastXBinTrackLength,"","");}
     if(kGCplotESDTrueConvGammaTrackLengthVSInvMass == kTRUE){histograms->AddHistogram("ESD_TrueConvGamma_TrackLengthVSInvMass","Track length of TrueConvGamma vs Inv mass",kGCnXBinsTrackLength,kGCfirstXBinTrackLength,kGClastXBinTrackLength,kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt,"","");}
                
+    if(kGCplotMCPi0PtFiducial == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Fiducial" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
+    if(kGCplotMCPi0PtWithinAcceptanceFiducial == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_withinAcceptance_Fiducial" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");}
+    if(kGCplotMCPi0PtConvGammaWithinAcceptanceFiducial == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_ConvGamma_withinAcceptance_Fiducial" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");} 
+
                
     if(kGCplotPi0Spectra == kTRUE){
       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
@@ -1743,6 +1751,7 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
       histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt0909" ,"Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]");
 
 
+
       //      if(kGCdoNeutralMesonV0MCCheck == kTRUE){
        histograms->AddHistogram("ESD_TruePi0_InvMass","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");
        histograms->AddHistogram("ESD_TruePi0_InvMass_1212","Invariant mass",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass [GeV]","Counts");