+
+//____________________________________________________________
+void AliHFEsecVtx::MakeHistos(Int_t step){
+
+ //
+ // make container
+ //
+
+ TString hname=Form("step%d",step);
+ step = step*7;
+
+ const Double_t kPtbound[2] = {0.1, 20.};
+ Int_t iBin[1];
+ iBin[0] = 44; // bins in pt
+ Double_t* binEdges[1];
+ binEdges[0] = AliHFEtools::MakeLogarithmicBinning(iBin[0], kPtbound[0], kPtbound[1]);
+
+ fSecVtxList->AddAt(new TH1F(hname+"taggedElec", "pT of e", iBin[0],binEdges[0]), step);
+ fSecVtxList->AddAt(new TH1F(hname+"charmElec", "pT of e", iBin[0],binEdges[0]), step+1);
+ fSecVtxList->AddAt(new TH1F(hname+"beautyElec", "pT of e", iBin[0],binEdges[0]), step+2);
+ fSecVtxList->AddAt(new TH1F(hname+"conversionElec", "pT of e", iBin[0],binEdges[0]), step+3);
+ fSecVtxList->AddAt(new TH1F(hname+"ebgElec", "pT of e", iBin[0],binEdges[0]), step+4);
+ fSecVtxList->AddAt(new TH1F(hname+"hcontaminElec", "pT of e", iBin[0],binEdges[0]), step+5);
+ fSecVtxList->AddAt(new TH1F(hname+"elseElec", "pT of e", iBin[0],binEdges[0]), step+6);
+}
+
+//____________________________________________________________
+void AliHFEsecVtx::FillHistos(Int_t step, const AliESDtrack *track){
+
+ //
+ // make container
+ //
+
+ step = step*7;
+
+ AliMCParticle *mctrack = NULL;
+ TParticle* mcpart = NULL;
+
+ (static_cast<TH1F *>(fSecVtxList->At(step)))->Fill(track->Pt()); // electrons tagged
+
+ if(HasMCData() && fMCQA){
+ if(!(mctrack = dynamic_cast<AliMCParticle *>(fMCEvent->GetTrack(TMath::Abs(track->GetLabel()))))) return;
+ mcpart = mctrack->Particle();
+
+ Int_t esource=fMCQA->GetElecSource(mcpart);
+ if(esource==1) {
+ //if(!(dynamic_cast<TH1F *>(fSecVtxList->At(step+1)))) return;
+ (static_cast<TH1F *>(fSecVtxList->At(step+1)))->Fill(mcpart->Pt()); //charm
+ }
+ else if(esource==2 || esource==3) {
+ //if(!(dynamic_cast<TH1F *>(fSecVtxList->At(step+2)))) return;
+ (static_cast<TH1F *>(fSecVtxList->At(step+2)))->Fill(mcpart->Pt()); //beauty
+ }
+ else if(esource>12 && esource<19) {
+ //else if(esource==4) {
+ //if(!(dynamic_cast<TH1F *>(fSecVtxList->At(step+3)))) return;
+ (static_cast<TH1F *>(fSecVtxList->At(step+3)))->Fill(mcpart->Pt()); //conversion
+ }
+ else if(esource==7) {
+ //if(!(dynamic_cast<TH1F *>(fSecVtxList->At(step+5)))) return;
+ (static_cast<TH1F *>(fSecVtxList->At(step+5)))->Fill(mcpart->Pt()); //contamination
+ }
+ else if(!(esource<0)) {
+ //if(!(dynamic_cast<TH1F *>(fSecVtxList->At(step+4)))) return;
+ (static_cast<TH1F *>(fSecVtxList->At(step+4)))->Fill(mcpart->Pt()); //e backgrounds
+ }
+ else {
+ //if(!(dynamic_cast<TH1F *>(fSecVtxList->At(step+6)))) return;
+ (static_cast<TH1F *>(fSecVtxList->At(step+6)))->Fill(mcpart->Pt()); //something else?
+ }
+ }
+
+}