]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGHF/vertexingHF/AliAnalysisTaskSEDplus.cxx
trial to improve the calculation time
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / AliAnalysisTaskSEDplus.cxx
index 6470547e299eb9324d1a917ef95b8be0b21621ca..9a3b1371f0c768eefc8b6731a3006c8fe1177de6 100644 (file)
@@ -404,6 +404,7 @@ void AliAnalysisTaskSEDplus::Init(){
   
   //PostData(2,fRDCutsloose);//we should then put those cuts in a tlist if we have more than 1
   fListCuts=new TList();
+  fListCuts->SetOwner();
   AliRDHFCutsDplustoKpipi *analysis = new AliRDHFCutsDplustoKpipi(*fRDCutsAnalysis);
   analysis->SetName("AnalysisCuts");
   
@@ -662,8 +663,8 @@ void AliAnalysisTaskSEDplus::UserCreateOutputObjects()
 
   fPtVsMass=new TH2F("hPtVsMass","PtVsMass (prod. cuts)",nbins,fLowmasslimit,fUpmasslimit,200,0.,20.);
   fPtVsMassTC=new TH2F("hPtVsMassTC","PtVsMass (analysis cuts)",nbins,fLowmasslimit,fUpmasslimit,200,0.,20.);  
-  fYVsPt=new TH2F("hYVsPt","YvsPt (prod. cuts)",40,0.,20.,80,-2.,2.);
-  fYVsPtTC=new TH2F("hYVsPtTC","YvsPt (analysis cuts)",40,0.,20.,80,-2.,2.);
+  fYVsPt=new TH3F("hYVsPt","YvsPt (prod. cuts)",40,0.,20.,80,-2.,2.,nbins,fLowmasslimit,fUpmasslimit);
+  fYVsPtTC=new TH3F("hYVsPtTC","YvsPt (analysis cuts)",40,0.,20.,80,-2.,2.,nbins,fLowmasslimit,fUpmasslimit);
   fYVsPtSig=new TH2F("hYVsPtSig","YvsPt (MC, only sig., prod. cuts)",40,0.,20.,80,-2.,2.);
   fYVsPtSigTC=new TH2F("hYVsPtSigTC","YvsPt (MC, only Sig, analysis cuts)",40,0.,20.,80,-2.,2.);
   fPhiEtaCand=new TH2F("hPhiEtaCand","phi vs. eta candidates",20,-1.,1.,50,0.,2*TMath::Pi());
@@ -872,8 +873,8 @@ void AliAnalysisTaskSEDplus::UserExec(Option_t */*option*/)
 
       Double_t invMass=d->InvMassDplus();
       Double_t rapid=d->YDplus();
-      fYVsPt->Fill(ptCand,rapid);
-      if(passTightCuts) {fYVsPtTC->Fill(ptCand,rapid);nOS++;}
+      fYVsPt->Fill(ptCand,rapid,invMass);
+      if(passTightCuts) {fYVsPtTC->Fill(ptCand,rapid,invMass);nOS++;}
       Bool_t isFidAcc=fRDCutsAnalysis->IsInFiducialAcceptance(ptCand,rapid);
       if(isFidAcc){
        fPtVsMass->Fill(invMass,ptCand);
@@ -901,8 +902,8 @@ void AliAnalysisTaskSEDplus::UserExec(Option_t */*option*/)
        cxy=d->CosPointingAngleXY();
       }
       Double_t impparXY=d->ImpParXY()*10000.;
-      Double_t arrayForSparse[6]={invMass,ptCand,impparXY,cosp,dlen,tracklets};
-      Double_t arrayForSparseTrue[6]={invMass,ptCand,trueImpParXY,cosp,dlen,tracklets};
+      Double_t arrayForSparse[6]={invMass,ptCand,impparXY,cosp,dlen,static_cast<Double_t>(tracklets)};
+      Double_t arrayForSparseTrue[6]={invMass,ptCand,trueImpParXY,cosp,dlen,static_cast<Double_t>(tracklets)};
 
       //Ntuple
       Float_t tmp[31];
@@ -983,10 +984,8 @@ void AliAnalysisTaskSEDplus::UserExec(Option_t */*option*/)
       
       if(fReadMC){
        if(isFidAcc){
-         Int_t correlIndex=0;
          if(labDp>=0) {
            index=GetSignalHistoIndex(iPtBin);
-           correlIndex=1;
            if(passTightCuts&&fDoImpPar){
              if(isPrimary) fHistMassPtImpParTC[1]->Fill(arrayForSparse);
              else{
@@ -996,7 +995,6 @@ void AliAnalysisTaskSEDplus::UserExec(Option_t */*option*/)
            }
          }else{
            index=GetBackgroundHistoIndex(iPtBin);
-           correlIndex=2;
            if(passTightCuts&&fDoImpPar)fHistMassPtImpParTC[4]->Fill(arrayForSparse);
          }
          
@@ -1032,8 +1030,8 @@ void AliAnalysisTaskSEDplus::UserExec(Option_t */*option*/)
          }
        }else{//outside fidAcc
          if(labDp>=0){
-           fYVsPtSig->Fill(ptCand,rapid);
-           if(passTightCuts)fYVsPtSigTC->Fill(ptCand,rapid);
+           fYVsPtSig->Fill(ptCand,rapid, invMass);
+           if(passTightCuts)fYVsPtSigTC->Fill(ptCand,rapid, invMass);
          }
        }
       }//readmc
@@ -1249,7 +1247,7 @@ Int_t AliAnalysisTaskSEDplus::CheckOrigin(TClonesArray* arrayMC, const AliAODMCP
   Int_t istep = 0;
   Int_t abspdgGranma =0;
   Bool_t isFromB=kFALSE;
-  Bool_t isQuarkFound=kFALSE;
+  //  Bool_t isQuarkFound=kFALSE;
   while (mother >0 ){
     istep++;
     AliAODMCParticle* mcGranma = dynamic_cast<AliAODMCParticle*>(arrayMC->At(mother));
@@ -1259,7 +1257,7 @@ Int_t AliAnalysisTaskSEDplus::CheckOrigin(TClonesArray* arrayMC, const AliAODMCP
       if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
        isFromB=kTRUE;
       }
-      if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
+      //     if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
       mother = mcGranma->GetMother();
     }else{
       AliError("Failed casting the mother particle!");