1 /**************************************************************************
2 * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 /////////////////////////////////////////////////////////////
18 // Class AliAnalysisTaskSECharmFraction
19 // AliAnalysisTaskSE for the extraction of the fraction of prompt charm
20 // using the charm hadron impact parameter to the primary vertex
22 // Author: Andrea Rossi, andrea.rossi@pd.infn.it
23 /////////////////////////////////////////////////////////////
28 #include <THnSparse.h>
29 #include <TDatabasePDG.h>
32 #include "AliAODEvent.h"
33 #include "AliAODRecoDecayHF2Prong.h"
34 #include "AliAODRecoDecayHF.h"
35 #include "AliAODRecoDecay.h"
36 #include "AliAnalysisDataSlot.h"
37 #include "AliAnalysisDataContainer.h"
38 #include "AliAODTrack.h"
39 #include "AliAODHandler.h"
40 #include "AliESDtrack.h"
41 #include "AliAODVertex.h"
42 #include "AliESDVertex.h"
43 #include "AliVertexerTracks.h"
44 #include "AliAODMCParticle.h"
45 #include "AliAODPid.h"
46 #include "AliTPCPIDResponse.h"
47 #include "AliAODMCHeader.h"
48 #include "AliAnalysisVertexingHF.h"
49 #include "AliAnalysisTaskSECharmFraction.h"
50 #include "AliRDHFCutsD0toKpi.h"
51 #include "AliAODInputHandler.h"
52 #include "AliAnalysisManager.h"
53 #include "AliNormalizationCounter.h"
54 #include "AliVertexingHFUtils.h"
59 class AliAnalysisTaskSE;
62 ClassImp(AliAnalysisTaskSECharmFraction)
64 //________________________________________________________________________
65 AliAnalysisTaskSECharmFraction::AliAnalysisTaskSECharmFraction()
66 : AliAnalysisTaskSE(),
72 fsplitMassD0D0bar(kTRUE),
85 fsidebandInvMassCut(),
86 fsidebandInvMassWindow(),
88 fCleanCandOwnVtx(kFALSE),
92 fSignalTypeTghCuts(0),
98 flistNoCutsFromDstar(0),
100 flistLsCutsSignal(0),
103 flistLsCutsFromDstar(0),
105 flistTghCutsSignal(0),
107 flistTghCutsFromB(0),
108 flistTghCutsFromDstar(0),
109 flistTghCutsOther(0),
111 fselectForUpgrade(0),
112 fskipEventSelection(kFALSE),
115 //Default constructor
117 //________________________________________________________________________
118 AliAnalysisTaskSECharmFraction::AliAnalysisTaskSECharmFraction(const char *name)
119 : AliAnalysisTaskSE(name),
125 fsplitMassD0D0bar(kTRUE),
136 fsignalInvMassCut(-1.),
137 flargeInvMassCut(-1.),
138 fsidebandInvMassCut(-1.),
139 fsidebandInvMassWindow(-1.),
141 fCleanCandOwnVtx(kFALSE),
144 fSignalTypeLsCuts(0),
145 fSignalTypeTghCuts(0),
147 flistMCproperties(0),
148 flistNoCutsSignal(0),
151 flistNoCutsFromDstar(0),
153 flistLsCutsSignal(0),
156 flistLsCutsFromDstar(0),
158 flistTghCutsSignal(0),
160 flistTghCutsFromB(0),
161 flistTghCutsFromDstar(0),
162 flistTghCutsOther(0),
164 fselectForUpgrade(0),
165 fskipEventSelection(kFALSE),
170 // Define input and output slots here
171 // Input slot #0 works with a TChain
172 // Output slot #0 writes into a TH1 container
175 fnbins=SetStandardCuts(fptbins);// THIS TO SET NBINS AND BINNING
177 DefineOutput(1, TH1F::Class());
178 DefineOutput(2, TH1F::Class());
179 DefineOutput(3, TH1F::Class());
180 DefineOutput(4, TH1F::Class());
181 DefineOutput(5, AliNormalizationCounter::Class());
183 for(Int_t j=6;j<22;j++){
184 DefineOutput(j, TList::Class());
186 fVertUtil=new AliVertexingHFUtils();
187 // Output slot for the Cut Objects
188 DefineOutput(22,AliRDHFCutsD0toKpi::Class()); //My private output
189 DefineOutput(23,AliRDHFCutsD0toKpi::Class()); //My private output
194 AliAnalysisTaskSECharmFraction::AliAnalysisTaskSECharmFraction(const char *name,AliRDHFCutsD0toKpi *cutsA,AliRDHFCutsD0toKpi *cutsB)
195 : AliAnalysisTaskSE(name),
201 fsplitMassD0D0bar(kTRUE),
212 fsignalInvMassCut(-1.),
213 flargeInvMassCut(-1.),
214 fsidebandInvMassCut(-1.),
215 fsidebandInvMassWindow(-1.),
217 fCleanCandOwnVtx(kFALSE),
220 fSignalTypeLsCuts(0),
221 fSignalTypeTghCuts(0),
223 flistMCproperties(0),
224 flistNoCutsSignal(0),
227 flistNoCutsFromDstar(0),
229 flistLsCutsSignal(0),
232 flistLsCutsFromDstar(0),
234 flistTghCutsSignal(0),
236 flistTghCutsFromB(0),
237 flistTghCutsFromDstar(0),
238 flistTghCutsOther(0),
240 fselectForUpgrade(0),
241 fskipEventSelection(kFALSE),
246 delete fCutsTight;fCutsTight=NULL;
249 delete fCutsLoose;fCutsLoose=NULL;
252 //Check consistency between sets of cuts:
253 if(cutsA->GetNPtBins()!=cutsB->GetNPtBins()){
254 printf("Different number of pt bins between the two sets of cuts: SWITCH TO STANDARD CUTS \n");
255 fnbins=SetStandardCuts(fptbins);
258 fCutsTight=new AliRDHFCutsD0toKpi(*cutsA);
259 fCutsLoose=new AliRDHFCutsD0toKpi(*cutsB);
260 for(Int_t j=0;j<cutsA->GetNPtBins();j++){
261 if(TMath::Abs(cutsA->GetPtBinLimits()[j]-cutsB->GetPtBinLimits()[j])>1.e-7){
262 printf("Different pt bin limits in the two set of cuts: use the first as reference \n");
263 fCutsLoose->SetPtBins(cutsA->GetNPtBins(),cutsA->GetPtBinLimits());
267 SetPtBins(fCutsTight->GetNPtBins(),fCutsTight->GetPtBinLimits());
270 fVertUtil=new AliVertexingHFUtils();
271 // Output slot #0 writes into a TH1 container
272 DefineOutput(1, TH1F::Class());
273 DefineOutput(2, TH1F::Class());
274 DefineOutput(3, TH1F::Class());
275 DefineOutput(4, TH1F::Class());
276 DefineOutput(5, AliNormalizationCounter::Class());
278 for(Int_t j=6;j<22;j++){
280 DefineOutput(j, TList::Class());
282 // Output slot for the Cut Objects
283 DefineOutput(22,AliRDHFCutsD0toKpi::Class()); //My private output
284 DefineOutput(23,AliRDHFCutsD0toKpi::Class()); //My private output
288 //________________________________________________________________________
289 AliAnalysisTaskSECharmFraction::~AliAnalysisTaskSECharmFraction()
304 /* if(fAcceptanceCuts){
305 delete fAcceptanceCuts;
316 if (fSignalTypeLsCuts) {
317 delete fSignalTypeLsCuts;
318 fSignalTypeLsCuts = 0;
320 if (fSignalTypeTghCuts) {
321 delete fSignalTypeTghCuts;
322 fSignalTypeTghCuts = 0;
330 if(flistMCproperties){
331 flistMCproperties->Delete();
332 delete flistMCproperties;
336 if(flistNoCutsSignal){
337 flistNoCutsSignal->Delete();
338 delete flistNoCutsSignal;
342 flistNoCutsBack->Delete();
343 delete flistNoCutsBack;
346 if(flistNoCutsFromB){
347 flistNoCutsFromB->Delete();
348 delete flistNoCutsFromB;
351 if(flistNoCutsFromDstar){
352 flistNoCutsFromDstar->Delete();
353 delete flistNoCutsFromDstar;
354 flistNoCutsFromDstar=0;
356 if(flistNoCutsOther){
357 flistNoCutsOther->Delete();
358 delete flistNoCutsOther;
362 if(flistLsCutsSignal){
363 flistLsCutsSignal->Delete();
364 delete flistLsCutsSignal;
368 flistLsCutsBack->Delete();
369 delete flistLsCutsBack;
372 if(flistLsCutsFromB){
373 flistLsCutsFromB->Delete();
374 delete flistLsCutsFromB;
377 if(flistLsCutsFromDstar){
378 flistLsCutsFromDstar->Delete();
379 delete flistLsCutsFromDstar;
380 flistLsCutsFromDstar=0;
382 if(flistLsCutsOther){
383 flistLsCutsOther->Delete();
384 delete flistLsCutsOther;
388 if(flistTghCutsSignal){
389 flistTghCutsSignal->Delete();
390 delete flistTghCutsSignal;
391 flistTghCutsSignal=0;
393 if(flistTghCutsBack){
394 flistTghCutsBack->Delete();
395 delete flistTghCutsBack;
398 if(flistTghCutsFromB){
399 flistTghCutsFromB->Delete();
400 delete flistTghCutsFromB;
403 if(flistTghCutsFromDstar){
404 flistTghCutsFromDstar->Delete();
405 delete flistTghCutsFromDstar;
406 flistTghCutsFromDstar=0;
408 if(flistTghCutsOther){
409 flistTghCutsOther->Delete();
410 delete flistTghCutsOther;
418 //________________________________________________________________________
419 void AliAnalysisTaskSECharmFraction::Init()
423 if(fDebug > 1) printf("AnalysisTaskSED0Mass::Init() \n");
424 fmD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
426 // gROOT->LoadMacro("$ALICE_ROOT/PWG3/vertexingHF/ConfigVertexingHF.C");
427 // gROOT->LoadMacro("$ALICE_ROOT/PWG3/vertexingHF/D0fromBSetCuts.C");
428 // 2 sets of dedicated cuts: fCutsTight is assumed as the standard cut object
430 // SetAcceptanceCut();
431 if(fNtrMaxforVtx<0)SetNMaxTrForVtx(3); //DEFAULT : NO SELECTION
432 if(fsignalInvMassCut<0.||flargeInvMassCut<0.||fsidebandInvMassCut<0.||fsidebandInvMassWindow<0.){
433 printf("AliAnalysisTaskSECharmFraction: Not All info for mass selection provided: switch to default values \n");
434 SetStandardMassSelection();
437 AliRDHFCutsD0toKpi* copyfCutsTight=new AliRDHFCutsD0toKpi(*fCutsTight);
438 const char* nameoutputTight=GetOutputSlot(22)->GetContainer()->GetName();
439 copyfCutsTight->SetName(nameoutputTight);
440 AliRDHFCutsD0toKpi* copyfCutsLoose=new AliRDHFCutsD0toKpi(*fCutsLoose);
441 const char* nameoutputLoose=GetOutputSlot(23)->GetContainer()->GetName();
442 copyfCutsLoose->SetName(nameoutputLoose);
445 PostData(22,copyfCutsTight);
446 PostData(23,copyfCutsLoose);
449 fCleanCandOwnVtx=kFALSE;
450 if(fCutsTight->GetIsPrimaryWithoutDaughters()^fCutsLoose->GetIsPrimaryWithoutDaughters()) {
451 printf("Two cut objects have different selection for primary vertex recalculation w/o daughters:\n Dangerous for variable drawing!! \n");
454 if(fCutsTight->GetIsPrimaryWithoutDaughters()){
455 fCleanCandOwnVtx=kTRUE;
456 fCutsTight->SetRemoveDaughtersFromPrim(kFALSE);
457 fCutsLoose->SetRemoveDaughtersFromPrim(kFALSE);
467 //________________________________________________________________________
468 void AliAnalysisTaskSECharmFraction::UserCreateOutputObjects()
473 // ################ NAMING SCHEME ###################################
474 // LISTS NAMING SCHEME
475 // "list" + cut selection string + MC selection string
476 // cut strings: "NC" =nocuts, "LSC"= loose cuts, "TGHC"= tight cuts
477 // MC sel. strings: "sign"= D0 from c quark
478 // "fromDstar" = D0 from Dstar from c quark
479 // "fromB"= D0from B decay (->from b quark) + D0from Dstar from B
480 // "back"= backgroun, generic except the cas "other"
481 // "other"= background case for candidates made of a pion and a kaon coming from the same D0 (in 4 prong) or from D+
483 // HISTS NAMING SCHEME
485 // "h" + specific name + cut selection string + MC selection string + (InvMass region string) + (pt string)
487 // cut selection strings = those for lists
488 // MC selection strings = those for lists
489 // inv mass region strings : "PM" or "SB" for global properties and pt integrated histos
490 // "_PkMss" or "_SBMss" for impact par. pt dependent histos
491 // pt string : "_pt" + integer number of ptbin
493 //###################################################################
497 TString strnamept,strtitlept;
498 Printf("INSIDE USER CREATE \n");
500 // fNentries=new TH1F("nentriesChFr", "Look at the number of entries! = number of AODs", 2,1.,2.);
502 fNentries=new TH1F("nentriesChFr", "Analyzed sample properties", 21,-0.5,20.5);
504 fNentries->GetXaxis()->SetBinLabel(1,"nEventsAnal");
506 fNentries->GetXaxis()->SetBinLabel(2,"nEvTGHTsel");
507 fNentries->GetXaxis()->SetBinLabel(3,"nEvTGHTPile-up Rej");
508 fNentries->GetXaxis()->SetBinLabel(4,"nEvTGHTGoodVtxS");
509 fNentries->GetXaxis()->SetBinLabel(5,"nEvTGHTRejVtxZ");
510 fNentries->GetXaxis()->SetBinLabel(6,"nTracksTGHTEv");
511 fNentries->GetXaxis()->SetBinLabel(7,"nCandTGHTEv");
512 fNentries->GetXaxis()->SetBinLabel(8,"nCandSelTGHTEv");
513 fNentries->GetXaxis()->SetBinLabel(20,"nUnexpErrorTGHT");
515 fNentries->GetXaxis()->SetBinLabel(9,"nEvLSsel");
516 fNentries->GetXaxis()->SetBinLabel(10,"nEvLSPile-up Rej");
517 fNentries->GetXaxis()->SetBinLabel(11,"nEvLSGoodVtxS");
518 fNentries->GetXaxis()->SetBinLabel(12,"nEvLSRejVtxZ");
519 fNentries->GetXaxis()->SetBinLabel(13,"nTracksLSEv");
520 fNentries->GetXaxis()->SetBinLabel(14,"nCandLSEv");
521 fNentries->GetXaxis()->SetBinLabel(15,"nCandSelLSEv");
522 fNentries->GetXaxis()->SetBinLabel(21,"nUnexpErrorTGHT");
524 /* ----------------- NOT ACTIVATED YET ------------------
525 fNentries->GetXaxis()->SetBinLabel(5,"ptbin = -1");
526 fNentries->GetXaxis()->SetBinLabel(6,"no daughter");
527 fNentries->GetXaxis()->SetBinLabel(7,"nCandSel(Tr)");
528 fNentries->GetXaxis()->SetBinLabel(8,"PID=0");
529 fNentries->GetXaxis()->SetBinLabel(9,"PID=1");
530 fNentries->GetXaxis()->SetBinLabel(10,"PID=2");
531 fNentries->GetXaxis()->SetBinLabel(11,"PID=3");
532 fNentries->GetXaxis()->SetBinLabel(12,"K");
533 fNentries->GetXaxis()->SetBinLabel(13,"Lambda");
534 fNentries->GetXaxis()->SetBinLabel(14,"Pile-up Rej");
535 fNentries->GetXaxis()->SetBinLabel(15,"N. of 0SMH");
538 fNentries->GetXaxis()->SetNdivisions(1,kFALSE);
540 fSignalType=new TH1F("hsignaltype", "Histo for type of MC signal", 61,-1.,60.);
541 fSignalTypeLsCuts=new TH1F("hsignaltypeLsCuts", "Histo for type of MC signal with loose cuts", 61,-1.,60.);
542 fSignalTypeTghCuts=new TH1F("hsignaltypeTghCuts", "Histo for type of MC signal with tight cuts", 61,-1.,60.);
546 fCounter = new AliNormalizationCounter(Form("%s",GetOutputSlot(5)->GetContainer()->GetName()));
549 //########## DEFINE THE TLISTS ##################
550 flistMCproperties=new TList();
551 flistMCproperties->SetOwner();
552 flistMCproperties->SetName("listMCproperties");
554 flistNoCutsSignal = new TList();
555 flistNoCutsSignal->SetOwner();
556 flistNoCutsSignal->SetName("listNCsign");
558 flistNoCutsBack = new TList();
559 flistNoCutsBack->SetOwner();
560 flistNoCutsBack->SetName("listNCback");
562 flistNoCutsFromB = new TList();
563 flistNoCutsFromB->SetOwner();
564 flistNoCutsFromB->SetName("listNCfromB");
566 flistNoCutsFromDstar = new TList();
567 flistNoCutsFromDstar->SetOwner();
568 flistNoCutsFromDstar->SetName("listNCfromDstar");
570 flistNoCutsOther = new TList();
571 flistNoCutsOther->SetOwner();
572 flistNoCutsOther->SetName("listNCother");
575 flistLsCutsSignal = new TList();
576 flistLsCutsSignal->SetOwner();
577 flistLsCutsSignal->SetName("listLSCsign");
579 flistLsCutsBack = new TList();
580 flistLsCutsBack->SetOwner();
581 flistLsCutsBack->SetName("listLSCback");
583 flistLsCutsFromB = new TList();
584 flistLsCutsFromB->SetOwner();
585 flistLsCutsFromB->SetName("listLSCfromB");
587 flistLsCutsFromDstar = new TList();
588 flistLsCutsFromDstar->SetOwner();
589 flistLsCutsFromDstar->SetName("listLSCfromDstar");
591 flistLsCutsOther = new TList();
592 flistLsCutsOther->SetOwner();
593 flistLsCutsOther->SetName("listLSCother");
596 flistTghCutsSignal = new TList();
597 flistTghCutsSignal->SetOwner();
598 flistTghCutsSignal->SetName("listTGHCsign");
600 flistTghCutsBack = new TList();
601 flistTghCutsBack->SetOwner();
602 flistTghCutsBack->SetName("listTGHCback");
604 flistTghCutsFromB = new TList();
605 flistTghCutsFromB->SetOwner();
606 flistTghCutsFromB->SetName("listTGHCfromB");
608 flistTghCutsFromDstar = new TList();
609 flistTghCutsFromDstar->SetOwner();
610 flistTghCutsFromDstar->SetName("listTGHCfromDstar");
612 flistTghCutsOther = new TList();
613 flistTghCutsOther->SetOwner();
614 flistTghCutsOther->SetName("listTGHCother");
618 Float_t ptbinsD0arr[35]={0.,0.1,0.2,0.3,0.4,0.5,0.6,0.8,1.,1.25,1.5,1.75,2.,2.3,2.6,3.,3.5,4.,4.5,5.,5.5,6.,7.,8.,9.,10.,12.,14.,16.,20.,25.,30.,40.,50.,100.};
619 Float_t dumbinning[201];
620 for(Int_t j=0;j<201;j++){
621 dumbinning[j]=(Float_t)j*0.5;
624 // DEFINE EDGES FOR SPARSE HISTOS
625 const Int_t nPtbinsForSparse=91;//nuber of edges, -1 to get number of bins
626 Double_t ptbinsForNsparse[nPtbinsForSparse];//Binning in pt: step: 0.2 GeV/c up to 8 GeV/c, 0.5 Upto 20, 1 GeV/c up to 40, 5 upt to 70-> 8/0.2+12/0.5+20/1.+30./5
628 Double_t massbins[186],impparbins[401];
629 Double_t massHypoBins[4]={1.,2.,3.,4.};
630 Int_t nbinsSparse[5]={185,185,nPtbinsForSparse-1,400,3};
631 for(Int_t nBins=0;nBins<nPtbinsForSparse;nBins++){
632 ptbinsForNsparse[nBins]=pT;
634 else if(pT<20)pT+=0.5;
636 else if(pT<70)pT+=5.;
638 for(Int_t nBins=0;nBins<186;nBins++){
639 massbins[nBins]=1.680+nBins*(2.050-1.680)/185.;
641 for(Int_t nBins=0;nBins<401;nBins++){
642 impparbins[nBins]=-1000+nBins*(2000.)/400.;
646 // Lxy and CosPointXY study
647 Int_t nbinsSparsCxyLxy[4]={84,fCutsTight->GetNPtBins(),10,20};
648 Double_t binLowLimitSparseCxyLxy[4]={1.680,fCutsTight->GetPtBinLimits()[0],0.99,0.};// Use OverFlow/UnderFlow to get other cases
649 Double_t binUpLimitSparseCxyLxy[4]={2.100,fCutsTight->GetPtBinLimits()[fCutsTight->GetNPtBins()],1.,20.};
650 Double_t *ptbinlimitsCxyLxy=new Double_t[fCutsTight->GetNPtBins()+1];
651 for(Int_t nBins=0;nBins<=fCutsTight->GetNPtBins();nBins++){
652 ptbinlimitsCxyLxy[nBins]=fCutsTight->GetPtBinLimits()[nBins];
656 //################################################################################################
658 // HISTO FOR MC PROPERTIES OF D0, c quarks and B mesons #
660 //################################################################################################
661 TH1F *hMCcquarkAllPt=new TH1F("hMCcquarkAllPt","c quark Pt (all cquarks produced)",34,ptbinsD0arr);
662 TH1F *hMCcquarkAllEta=new TH1F("hMCcquarkAllEta","c quark Eta (all cquarks produced)",50,-3.,3.);
663 TH1F *hMCcquarkAllEnergy=new TH1F("hMCcquarkAllEnergy","c quark Pt (all cquarks produced)",200,0.,100.);
664 TH1F *hMCcquarkNdaught=new TH1F("hMCcquarkNdaught","N cquark daughters (all cquarks produced)",100,0.,100.);
665 TH1F *hMCD0fromcPt=new TH1F("hMCD0fromcPt","D0 from c Pt",34,ptbinsD0arr);
666 TH1F *hMCD0fromcEta=new TH1F("hMCD0fromcEta","D0 from c Eta",50,-3.,3.);
667 TH1F *hMCD0fromcEnergy=new TH1F("hMCD0fromcEnergy","D0 from c Energy",200,0.,100.);
669 TH2F *hMCD0VscquarkPt=new TH2F("hMCD0VscquarkPt","D0 pt Vs cquark pt",34,ptbinsD0arr,34,ptbinsD0arr);
670 TH2F *hMCD0VscquarkEnergy=new TH2F("hMCD0VscquarkEnergy","D0 Energy Vs cquark Energy",200,0.,50.,200,0.,50.);
671 TH1F *hMCD0deltacquarkEnergy=new TH1F("hMCD0deltacquarkEnergy","Fractional D0 Energy w.r.t. cquark Energy",20,0.,1.);
672 TH1F *hMCD0EnergyVsAvcquarkDaughtEn=new TH1F("hMCD0EnergyVsAvcquarkDaughtEn","#Delta(E^{D^0}-E_{avg})/E_{cquark}",40,-1.,1.);
673 TH1F *hMCD0cquarkAngle=new TH1F("hMCD0cquarkAngle","cosine of the angle between D0 and c quark particle",40,-1.,1.);
674 TH2F *hMCD0cquarkAngleEnergy=new TH2F("hMCD0cquarkAngleEnergy","cosine of the angle between D0 and c quark particle as a function of Energy",25,0.,50.,40,-1.,1.);
676 TH1I *hMCfromBpdgB=new TH1I("hMCfromBpdgB","hMCfromBpdgB",10000,0.,10000);
677 TH1F *hMCBhadrPt=new TH1F("hMCBhadrPt","B hadr Pt",34,ptbinsD0arr);
678 TH1F *hMCBhadrEta=new TH1F("hMCBhadrEta","B hadr Eta",50,-3.,3.);
679 TH1F *hMCBhadrEnergy=new TH1F("hMCBhadrEnergy","B hadr Pt",200,0.,100.);
680 TH1F *hMCBhadrNdaught=new TH1F("hMCBhadrNdaught","N Bhadr daughters",100,0.,100.);
681 TH1F *hMCD0fromBPt=new TH1F("hMCD0fromBPt","D0 from B Pt",34,ptbinsD0arr);
682 TH1F *hMCD0fromBEta=new TH1F("hMCD0fromBEta","D0 from B Eta",50,-3.,3.);
683 TH1F *hMCD0fromBEnergy=new TH1F("hMCD0fromBEnergy","D0 from B Energy",200,0.,100.);
685 TH2F *hMCD0VsBhadrPt=new TH2F("hMCD0VsBhadrPt","D0 pt Vs Bhadr pt",34,ptbinsD0arr,34,ptbinsD0arr);
686 TH2F *hMCD0VsBhadrEnergy=new TH2F("hMCD0VsBhadrEnergy","D0 Energy Vs Bhadr Energy",200,0.,50.,200,0.,50.);
687 TH1F *hMCD0deltaBhadrEnergy=new TH1F("hMCD0deltaBhadrEnergy","Fractional D0 Energy w.r.t. Bhadr Energy",20,0.,1.);
688 TH1F *hMCD0EnergyVsAvBDaughtEn=new TH1F("hMCD0EnergyVsAvBDaughtEn","#Delta(E^{D^0}-E_{avg})/E_{Bahdr}",40,-1.,1.);
689 TH1F *hMCD0BhadrAngle=new TH1F("hMCD0BhadrAngle","cosine of the angle between D0 and Bhadr particle",40,-1.,1.);
690 TH2F *hMCD0BhadrAngleEnergy=new TH2F("hMCD0BhadrAngleEnergy","cosine of the angle between D0 and Bhadr particle as a function of Energy",25,0.,50.,40,-1.,1.);
692 TH1I *hMCPartFound=new TH1I("hMCPartFound","1=c,2=D0,3=fromBall,4=fromBmeson,5=fromBbaryon",6,0,6);
695 flistMCproperties->Add(hMCcquarkAllPt);
696 flistMCproperties->Add(hMCcquarkAllEta);
697 flistMCproperties->Add(hMCcquarkAllEnergy);
698 flistMCproperties->Add(hMCcquarkNdaught);
699 flistMCproperties->Add(hMCD0fromcPt);
700 flistMCproperties->Add(hMCD0fromcEta);
701 flistMCproperties->Add(hMCD0fromcEnergy);
702 flistMCproperties->Add(hMCD0VscquarkPt);
703 flistMCproperties->Add(hMCD0VscquarkEnergy);
704 flistMCproperties->Add(hMCD0deltacquarkEnergy);
705 flistMCproperties->Add(hMCD0EnergyVsAvcquarkDaughtEn);
706 flistMCproperties->Add(hMCD0cquarkAngle);
707 flistMCproperties->Add(hMCD0cquarkAngleEnergy);
709 flistMCproperties->Add(hMCfromBpdgB);
710 flistMCproperties->Add(hMCBhadrPt);
711 flistMCproperties->Add(hMCBhadrEta);
712 flistMCproperties->Add(hMCBhadrEnergy);
713 flistMCproperties->Add(hMCBhadrNdaught);
714 flistMCproperties->Add(hMCD0fromBPt);
715 flistMCproperties->Add(hMCD0fromBEta);
716 flistMCproperties->Add(hMCD0fromBEnergy);
717 flistMCproperties->Add(hMCD0VsBhadrPt);
718 flistMCproperties->Add(hMCD0VsBhadrEnergy);
719 flistMCproperties->Add(hMCD0deltaBhadrEnergy);
720 flistMCproperties->Add(hMCD0EnergyVsAvBDaughtEn);
721 flistMCproperties->Add(hMCD0BhadrAngle);
722 flistMCproperties->Add(hMCD0BhadrAngleEnergy);
723 flistMCproperties->Add(hMCPartFound);
725 //################################################################################################
727 // HISTOS FOR NO CUTS CASE #
729 //################################################################################################
730 Printf("AFTER MC HISTOS \n");
732 //############ NO CUTS SIGNAL HISTOGRAMS ###############
734 // ####### global properties histo ############
736 TH2F *hCPtaVSd0d0NCsign=new TH2F("hCPtaVSd0d0NCsign","hCPtaVSd0d0_NoCuts_Signal",1000,-100000.,100000.,100,-1.,1.);
737 TH1F *hSecVtxZNCsign=new TH1F("hSecVtxZNCsign","hSecVtxZ_NoCuts_Signal",1000,-8.,8.);
738 TH1F *hSecVtxXNCsign=new TH1F("hSecVtxXNCsign","hSecVtxX_NoCuts_Signal",1000,-3000.,3000.);
739 TH1F *hSecVtxYNCsign=new TH1F("hSecVtxYNCsign","hSecVtxY_NoCuts_Signal",1000,-3000.,3000.);
740 TH2F *hSecVtxXYNCsign=new TH2F("hSecVtxXYNCsign","hSecVtxXY_NoCuts_Signal",1000,-3000.,3000.,1000,-3000.,3000.);
741 TH1F *hSecVtxPhiNCsign=new TH1F("hSecVtxPhiNCsign","hSecVtxPhi_NoCuts_Signal",180,-180.1,180.1);
742 TH1F *hd0singlTrackNCsign=new TH1F("hd0singlTrackNCsign","hd0singlTrackNoCuts_Signal",1000,-5000.,5000.);
743 TH1F *hCPtaNCsign=new TH1F("hCPtaNCsign","hCPta_NoCuts_Signal",100,-1.,1.);
744 TH1F *hd0xd0NCsign=new TH1F("hd0xd0NCsign","hd0xd0_NoCuts_Signal",1000,-100000.,100000.);
745 TH1F *hMassTrueNCsign=new TH1F("hMassTrueNCsign","D^{0} MC inv. Mass No Cuts Signal(All momenta)",600,1.600,2.200);
746 TH1F *hMassNCsign=new TH1F("hMassNCsign","D^{0} inv. Mass No Cuts Signal (All momenta)",600,1.600,2.200);
747 hMassNCsign->Sumw2();
748 TH1F *hMassTrueNCsignPM=new TH1F("hMassTrueNCsignPM","D^{0} MC inv. Mass No Cuts Signal, Mass Peak. (All momenta)",600,1.600,2.200);
749 TH1F *hMassNCsignPM=new TH1F("hMassNCsignPM","D^{0} inv. Mass No Cuts Signal (All momenta), MassPeak",600,1.600,2.200);
750 hMassNCsignPM->Sumw2();
752 TH1F *hMassTrueNCsignSB=new TH1F("hMassTrueNCsignSB","D^{0} MC inv. Mass in Side Bands No Cuts Signal(All momenta)",600,1.600,2.200);
753 TH1F *hMassNCsignSB=new TH1F("hMassNCsignSB","D^{0} inv. Mass in Side Bands No Cuts Signal (All momenta)",600,1.600,2.200);
754 hMassNCsignSB->Sumw2();
756 flistNoCutsSignal->Add(hCPtaVSd0d0NCsign);
757 flistNoCutsSignal->Add(hSecVtxZNCsign);
758 flistNoCutsSignal->Add(hSecVtxYNCsign);
759 flistNoCutsSignal->Add(hSecVtxXNCsign);
760 flistNoCutsSignal->Add(hSecVtxXYNCsign);
761 flistNoCutsSignal->Add(hSecVtxPhiNCsign);
762 flistNoCutsSignal->Add(hd0singlTrackNCsign);
763 flistNoCutsSignal->Add(hCPtaNCsign);
764 flistNoCutsSignal->Add(hd0xd0NCsign);
765 flistNoCutsSignal->Add(hMassTrueNCsign);
766 flistNoCutsSignal->Add(hMassNCsign);
767 flistNoCutsSignal->Add(hMassTrueNCsignPM);
768 flistNoCutsSignal->Add(hMassNCsignPM);
769 flistNoCutsSignal->Add(hMassTrueNCsignSB);
770 flistNoCutsSignal->Add(hMassNCsignSB);
772 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
773 TH1F *hdcaNCsign=new TH1F("hdcaNCsign","hdca_NoCuts_Signal",100,0.,1000.);
774 hdcaNCsign->SetXTitle("dca [#mum]");
775 hdcaNCsign->SetYTitle("Entries");
776 TH1F *hcosthetastarNCsign=new TH1F("hcosthetastarNCsign","hCosThetaStar_NoCuts_Signal",50,-1.,1.);
777 hcosthetastarNCsign->SetXTitle("cos #theta^{*}");
778 hcosthetastarNCsign->SetYTitle("Entries");
779 TH1F *hptD0NCsign=new TH1F("hptD0NCsign","D^{0} transverse momentum distribution",34,ptbinsD0arr);
780 hptD0NCsign->SetXTitle("p_{t} [GeV/c]");
781 hptD0NCsign->SetYTitle("Entries");
782 TH1F *hptD0VsMaxPtNCsign=new TH1F("hptD0VsMaxPtNCsign","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
783 TH2F *hptD0PTallsqrtNCsign=new TH2F("hptD0PTallsqrtNCsign","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
784 TH2F *hptD0PTallNCsign=new TH2F("hptD0PTallNCsign","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
785 TH2F *hptD0vsptBNCsign=new TH2F("hptD0vsptBNCsign","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
786 TH2F *hpD0vspBNCsign=new TH2F("hpD0vspBNCsign","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
787 TH2F *hptD0vsptcquarkNCsign=new TH2F("hptD0vsptcquarkNCsign","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
788 TH2F *hpD0vspcquarkNCsign=new TH2F("hpD0vspcquarkNCsign","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
789 flistNoCutsSignal->Add(hdcaNCsign);
790 flistNoCutsSignal->Add(hcosthetastarNCsign);
791 flistNoCutsSignal->Add(hptD0NCsign);
792 flistNoCutsSignal->Add(hptD0VsMaxPtNCsign);
793 flistNoCutsSignal->Add(hptD0PTallsqrtNCsign);
794 flistNoCutsSignal->Add(hptD0PTallNCsign);
795 flistNoCutsSignal->Add(hptD0vsptBNCsign);
796 flistNoCutsSignal->Add(hpD0vspBNCsign);
797 flistNoCutsSignal->Add(hptD0vsptcquarkNCsign);
798 flistNoCutsSignal->Add(hpD0vspcquarkNCsign);
800 TH1F *hd0zD0ptNCsign;
801 TH1F *hInvMassD0NCsign,*hInvMassD0barNCsign;
802 TH2F *hInvMassPtNCsign=new TH2F("hInvMassPtNCsign","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
803 flistNoCutsSignal->Add(hInvMassPtNCsign);
804 THnSparseF *hSparseNCsign=new THnSparseF("hSparseNCsign","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
805 hSparseNCsign->SetBinEdges(0,massbins);
806 hSparseNCsign->SetBinEdges(1,massbins);
807 hSparseNCsign->SetBinEdges(2,ptbinsForNsparse);
808 hSparseNCsign->SetBinEdges(3,impparbins);
809 hSparseNCsign->SetBinEdges(4,massHypoBins);
810 flistNoCutsSignal->Add(hSparseNCsign);
815 THnSparseF *hSparseCxyLxyNCsign=new THnSparseF("hSparseCxyLxyNCsign","Candidate Mass;massD0;Pt;CosXY;Lxy",4,nbinsSparsCxyLxy,binLowLimitSparseCxyLxy,binUpLimitSparseCxyLxy);
816 hSparseCxyLxyNCsign->SetBinEdges(1,ptbinlimitsCxyLxy);
817 hSparseCxyLxyNCsign->GetAxis(0)->SetName("mass");
818 hSparseCxyLxyNCsign->GetAxis(0)->SetTitle("Invariant Mass (K#pi) [GeV/c^{2}]");
819 hSparseCxyLxyNCsign->GetAxis(1)->SetName("pt");
820 hSparseCxyLxyNCsign->GetAxis(1)->SetTitle("p_{t} [GeV/c]");
821 hSparseCxyLxyNCsign->GetAxis(2)->SetName("CosPointXY");
822 hSparseCxyLxyNCsign->GetAxis(2)->SetTitle("Cos#theta_{point}^{XY}");
823 hSparseCxyLxyNCsign->GetAxis(3)->SetName("NormDecLengthXY");
824 hSparseCxyLxyNCsign->GetAxis(3)->SetTitle("Normalized XY decay length");
826 flistNoCutsSignal->Add(hSparseCxyLxyNCsign);
831 TH1F *hCosPDPBNCsign;
832 TH1F *hCosPcPDNCsign;
834 TH2F *hd0D0VSd0xd0NCsignpt;
835 TH2F *hangletracksVSd0xd0NCsignpt;
836 TH2F *hangletracksVSd0D0NCsignpt;
837 TH1F *hd0xd0NCsignpt;
839 TH1F *hPhiHistPMNCsignpt,*hPhiHistSBNCsignpt;
842 TH2F *hTOFpidNCsign=new TH2F("hTOFpidNCsign","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
843 flistNoCutsSignal->Add(hTOFpidNCsign);
848 for(Int_t i=0;i<fnbins;i++){
849 //Printf("INSIDE HISTOS CREATION LOOP: %d \n",fnbins);
851 namehist="hPhiHistPMNCsign_pt";
853 titlehist="Azimuthal correlation No Cuts Sign PM ptbin=";
855 hPhiHistPMNCsignpt=new TH1F(namehist.Data(),titlehist.Data(),100,-3.15,3.15);
856 hPhiHistPMNCsignpt->Sumw2();
857 flistNoCutsSignal->Add(hPhiHistPMNCsignpt);
859 namehist="hPhiHistSBNCsign_pt";
861 titlehist="Azimuthal correlation No Cuts Sign SB ptbin=";
863 hPhiHistSBNCsignpt=new TH1F(namehist.Data(),titlehist.Data(),100,-3.15,3.15);
864 hPhiHistSBNCsignpt->Sumw2();
865 flistNoCutsSignal->Add(hPhiHistSBNCsignpt);
868 namehist="hd0zD0ptNCsign_pt";
870 titlehist="d0(z) No Cuts Signalm ptbin=";
872 hd0zD0ptNCsign=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
873 hd0zD0ptNCsign->SetXTitle("d_{0}(z) [#mum]");
874 hd0zD0ptNCsign->SetYTitle("Entries");
875 flistNoCutsSignal->Add(hd0zD0ptNCsign);
877 namehist="hInvMassD0NCsign_pt";
879 titlehist="Invariant Mass D0 No Cuts Signal ptbin=";
881 hInvMassD0NCsign=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
882 hInvMassD0NCsign->SetXTitle("Invariant Mass [GeV]");
883 hInvMassD0NCsign->SetYTitle("Entries");
884 flistNoCutsSignal->Add(hInvMassD0NCsign);
887 namehist="hInvMassD0barNCsign_pt";
889 titlehist="Invariant Mass D0bar No Cuts Signal ptbin=";
891 hInvMassD0barNCsign=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
892 hInvMassD0barNCsign->SetXTitle("Invariant Mass [GeV]");
893 hInvMassD0barNCsign->SetYTitle("Entries");
894 flistNoCutsSignal->Add(hInvMassD0barNCsign);
897 namehist="hetaNCsign_pt";
899 titlehist="eta No Cuts Signal ptbin=";
901 hetaNCsign=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
902 hetaNCsign->SetXTitle("Pseudorapidity");
903 hetaNCsign->SetYTitle("Entries");
904 flistNoCutsSignal->Add(hetaNCsign);
906 namehist="hCosPDPBNCsign_pt";
908 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
910 hCosPDPBNCsign=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
911 hCosPDPBNCsign->SetXTitle("Cosine between D0 momentum and B momentum");
912 hCosPDPBNCsign->SetYTitle("Entries");
913 flistNoCutsSignal->Add(hCosPDPBNCsign);
915 namehist="hCosPcPDNCsign_pt";
917 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
919 hCosPcPDNCsign=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
920 hCosPcPDNCsign->SetXTitle("Cosine between c quark momentum and D0 momentum");
921 hCosPcPDNCsign->SetYTitle("Entries");
922 flistNoCutsSignal->Add(hCosPcPDNCsign);
925 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
926 namehist="hd0xd0NCsign_pt";
928 titlehist="d0xd0 No Cuts Signal ptbin=";
930 hd0xd0NCsignpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
931 hd0xd0NCsignpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
932 hd0xd0NCsignpt->SetYTitle("Entries");
933 flistNoCutsSignal->Add(hd0xd0NCsignpt);
936 namehist="hd0D0VSd0xd0NCsign_pt";
938 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} No Cuts Signal ptbin=";
940 hd0D0VSd0xd0NCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
941 hd0D0VSd0xd0NCsignpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
942 hd0D0VSd0xd0NCsignpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
943 flistNoCutsSignal->Add(hd0D0VSd0xd0NCsignpt);
946 namehist="hangletracksVSd0xd0NCsign_pt";
948 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} No Cuts Signal ptbin=";
950 hangletracksVSd0xd0NCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
951 hangletracksVSd0xd0NCsignpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
952 hangletracksVSd0xd0NCsignpt->SetYTitle(" angle between K and #p tracks [rad]");
953 flistNoCutsSignal->Add(hangletracksVSd0xd0NCsignpt);
956 namehist="hangletracksVSd0D0NCsign_pt";
958 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} No Cuts Signal ptbin=";
960 hangletracksVSd0D0NCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
961 hangletracksVSd0D0NCsignpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
962 hangletracksVSd0D0NCsignpt->SetYTitle(" angle between K and #p tracks [rad]");
963 flistNoCutsSignal->Add(hangletracksVSd0D0NCsignpt);
966 Printf("AFTER LOOP HISTOS CREATION \n");
967 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
968 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
970 // ####### d0 D0 histos ############
971 TH1F *hd0D0NCsignPM = new TH1F("hd0D0NCsignPM","D^{0} impact par. plot , No Cuts ,Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
972 hd0D0NCsignPM->SetXTitle("Impact parameter [#mum]");
973 hd0D0NCsignPM->SetYTitle("Entries");
975 TH1F *hd0D0VtxTrueNCsignPM = new TH1F("hd0D0VtxTrueNCsignPM","D^{0} impact par. w.r.t. True Vtx, No Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
976 hd0D0VtxTrueNCsignPM->SetXTitle("Impact parameter [#mum]");
977 hd0D0VtxTrueNCsignPM->SetYTitle("Entries");
979 TH1F *hMCd0D0NCsignPM = new TH1F("hMCd0D0NCsignPM","D^{0} impact par. plot, No Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
980 hMCd0D0NCsignPM->SetXTitle("MC Impact parameter [#mum]");
981 hMCd0D0NCsignPM->SetYTitle("Entries");
983 TH1F *hd0D0NCsignSB = new TH1F("hd0D0NCsignSB","D^{0} impact par. plot , No Cuts ,Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
984 hd0D0NCsignSB->SetXTitle("Impact parameter [#mum]");
985 hd0D0NCsignSB->SetYTitle("Entries");
987 TH1F *hd0D0VtxTrueNCsignSB = new TH1F("hd0D0VtxTrueNCsignSB","D^{0} impact par. w.r.t. True Vtx, No Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
988 hd0D0VtxTrueNCsignSB->SetXTitle("Impact parameter [#mum]");
989 hd0D0VtxTrueNCsignSB->SetYTitle("Entries");
991 TH1F *hMCd0D0NCsignSB = new TH1F("hMCd0D0NCsignSB","D^{0} impact par. plot, No Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
992 hMCd0D0NCsignSB->SetXTitle("MC Impact parameter [#mum]");
993 hMCd0D0NCsignSB->SetYTitle("Entries");
995 flistNoCutsSignal->Add(hd0D0NCsignPM);
996 flistNoCutsSignal->Add(hd0D0VtxTrueNCsignPM);
997 flistNoCutsSignal->Add(hMCd0D0NCsignPM);
998 flistNoCutsSignal->Add(hd0D0NCsignSB);
999 flistNoCutsSignal->Add(hd0D0VtxTrueNCsignSB);
1000 flistNoCutsSignal->Add(hMCd0D0NCsignSB);
1002 TH1F *hd0D0ptNCsignPM;
1003 TH1F *hMCd0D0ptNCsignPM;
1004 TH1F *hd0D0VtxTrueptNCsignPM;
1005 TH1F *hd0D0ptNCsignSB;
1006 TH1F *hMCd0D0ptNCsignSB;
1007 TH1F *hd0D0VtxTrueptNCsignSB;
1008 namehist="hd0D0ptNCsign_";
1009 titlehist="D^{0} impact par. plot, No Cuts, Signal, ";
1010 for(Int_t i=0;i<fnbins;i++){
1011 //Printf("IN HISTOS CREATION USING PTBINS VALUES for NAMES \n");
1013 strnamept.Append("PkMss_pt");
1016 strtitlept=titlehist;
1017 strtitlept.Append(" Mass Peak, ");
1019 strtitlept+=fptbins[i];
1020 //Printf("IN HISTOS CREATION USING PTBINS VALUES for NAMES %d: %f\n",i,fptbins[i]);
1021 strtitlept.Append("<= pt <");
1022 strtitlept+=fptbins[i+1];
1023 strtitlept.Append(" [GeV/c]");
1025 hd0D0ptNCsignPM= new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1026 hd0D0ptNCsignPM->SetXTitle("Impact parameter [#mum] ");
1027 hd0D0ptNCsignPM->SetYTitle("Entries");
1028 flistNoCutsSignal->Add(hd0D0ptNCsignPM);
1030 strnamept.ReplaceAll("hd0D0","hMCd0D0");
1031 hMCd0D0ptNCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1032 hMCd0D0ptNCsignPM->SetXTitle("MC Impact parameter [#mum] ");
1033 hMCd0D0ptNCsignPM->SetYTitle("Entries");
1034 flistNoCutsSignal->Add(hMCd0D0ptNCsignPM);
1037 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
1038 hd0D0VtxTrueptNCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1039 hd0D0VtxTrueptNCsignPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1040 hd0D0VtxTrueptNCsignPM->SetYTitle("Entries");
1041 flistNoCutsSignal->Add(hd0D0VtxTrueptNCsignPM);
1044 strnamept.Append("SBMss_pt");
1047 strtitlept=titlehist;
1048 strtitlept.Append(" Side Bands, ");
1049 strtitlept+=fptbins[i];
1050 strtitlept.Append("<= pt <");
1051 strtitlept+=fptbins[i+1];
1052 strtitlept.Append(" [GeV/c]");
1054 hd0D0ptNCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1055 hd0D0ptNCsignSB->SetXTitle("Impact parameter [#mum] ");
1056 hd0D0ptNCsignSB->SetYTitle("Entries");
1057 flistNoCutsSignal->Add(hd0D0ptNCsignSB);
1059 strnamept.ReplaceAll("hd0D0","hMCd0D0");
1060 hMCd0D0ptNCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1061 hMCd0D0ptNCsignSB->SetXTitle("MC Impact parameter [#mum] ");
1062 hMCd0D0ptNCsignSB->SetYTitle("Entries");
1063 flistNoCutsSignal->Add(hMCd0D0ptNCsignSB);
1065 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
1066 hd0D0VtxTrueptNCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1067 hd0D0VtxTrueptNCsignSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1068 hd0D0VtxTrueptNCsignSB->SetYTitle("Entries");
1069 flistNoCutsSignal->Add(hd0D0VtxTrueptNCsignSB);
1072 //Printf("AFTER SIGNAL HISTOS CREATION for NOCUTS\n");
1075 //############ NO CUTS BACKGROUND HISTOGRAMS ###########
1077 // ######## global properties histos #######
1078 TH2F *hCPtaVSd0d0NCback=new TH2F("hCPtaVSd0d0NCback","hCPtaVSd0d0_NoCuts_Background",1000,-100000.,100000.,100,-1.,1.);
1079 TH1F *hSecVtxZNCback=new TH1F("hSecVtxZNCback","hSecVtxZ_NoCuts_Background",1000,-8.,8.);
1080 TH1F *hSecVtxXNCback=new TH1F("hSecVtxXNCback","hSecVtxX_NoCuts_Background",1000,-3000.,3000.);
1081 TH1F *hSecVtxYNCback=new TH1F("hSecVtxYNCback","hSecVtxY_NoCuts_Background",1000,-3000.,3000.);
1082 TH2F *hSecVtxXYNCback=new TH2F("hSecVtxXYNCback","hSecVtxXY_NoCuts_Background",1000,-3000.,3000.,1000,-3000.,3000.);
1083 TH1F *hSecVtxPhiNCback=new TH1F("hSecVtxPhiNCback","hSecVtxPhi_NoCuts_Background",180,-180.1,180.1);
1084 TH1F *hd0singlTrackNCback=new TH1F("hd0singlTrackNCback","hd0singlTrackNoCuts_Back",1000,-5000.,5000.);
1085 TH1F *hCPtaNCback=new TH1F("hCPtaNCback","hCPta_NoCuts_Background",100,-1.,1.);
1086 TH1F *hd0xd0NCback=new TH1F("hd0xd0NCback","hd0xd0_NoCuts_Background",1000,-100000.,100000.);
1087 TH1F *hMassTrueNCback=new TH1F("hMassTrueNCback","D^{0} MC inv. Mass No Cuts Background(All momenta)",600,1.600,2.200);
1088 TH1F *hMassNCback=new TH1F("hMassNCback","D^{0} inv. Mass No Cuts Background (All momenta)",600,1.600,2.200);
1089 hMassNCback->Sumw2();
1090 TH1F *hMassTrueNCbackPM=new TH1F("hMassTrueNCbackPM","D^{0} MC inv. Mass No Cuts Background, Mass Peak. (All momenta)",600,1.600,2.200);
1091 TH1F *hMassNCbackPM=new TH1F("hMassNCbackPM","D^{0} inv. Mass No Cuts Background (All momenta), MassPeak",600,1.600,2.200);
1092 hMassNCbackPM->Sumw2();
1093 TH1F *hMassTrueNCbackSB=new TH1F("hMassTrueNCbackSB","D^{0} MC inv. Mass in Side Bands No Cuts Background(All momenta)",600,1.600,2.200);
1094 TH1F *hMassNCbackSB=new TH1F("hMassNCbackSB","D^{0} inv. Mass in Side Bands No Cuts Background (All momenta)",600,1.600,2.200);
1095 hMassNCbackSB->Sumw2();
1097 flistNoCutsBack->Add(hCPtaVSd0d0NCback);
1098 flistNoCutsBack->Add(hSecVtxZNCback);
1099 flistNoCutsBack->Add(hSecVtxYNCback);
1100 flistNoCutsBack->Add(hSecVtxXNCback);
1101 flistNoCutsBack->Add(hSecVtxXYNCback);
1102 flistNoCutsBack->Add(hSecVtxPhiNCback);
1103 flistNoCutsBack->Add(hd0singlTrackNCback);
1104 flistNoCutsBack->Add(hCPtaNCback);
1105 flistNoCutsBack->Add(hd0xd0NCback);
1106 flistNoCutsBack->Add(hMassTrueNCback);
1107 flistNoCutsBack->Add(hMassNCback);
1108 flistNoCutsBack->Add(hMassTrueNCbackPM);
1109 flistNoCutsBack->Add(hMassNCbackPM);
1110 flistNoCutsBack->Add(hMassTrueNCbackSB);
1111 flistNoCutsBack->Add(hMassNCbackSB);
1114 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
1115 TH1F *hdcaNCback=new TH1F("hdcaNCback","hdca_NoCuts_Backgr",100,0.,1000.);
1116 hdcaNCback->SetXTitle("dca [#mum]");
1117 hdcaNCback->SetYTitle("Entries");
1118 TH1F *hcosthetastarNCback=new TH1F("hcosthetastarNCback","hCosThetaStar_NoCuts_Backgr",50,-1.,1.);
1119 hcosthetastarNCback->SetXTitle("cos #theta^{*}");
1120 hcosthetastarNCback->SetYTitle("Entries");
1121 TH1F *hptD0NCback=new TH1F("hptD0NCback","D^{0} transverse momentum distribution",34,ptbinsD0arr);
1122 hptD0NCback->SetXTitle("p_{t} [GeV/c]");
1123 hptD0NCback->SetYTitle("Entries");
1124 TH1F *hptD0VsMaxPtNCback=new TH1F("hptD0VsMaxPtNCback","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
1125 TH2F *hptD0PTallsqrtNCback=new TH2F("hptD0PTallsqrtNCback","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
1126 TH2F *hptD0PTallNCback=new TH2F("hptD0PTallNCback","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
1127 TH2F *hptD0vsptBNCback=new TH2F("hptD0vsptBNCback","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1128 TH2F *hpD0vspBNCback=new TH2F("hpD0vspBNCback","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1129 TH2F *hptD0vsptcquarkNCback=new TH2F("hptD0vsptcquarkNCback","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1130 TH2F *hpD0vspcquarkNCback=new TH2F("hpD0vspcquarkNCback","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1131 flistNoCutsBack->Add(hdcaNCback);
1132 flistNoCutsBack->Add(hcosthetastarNCback);
1133 flistNoCutsBack->Add(hptD0NCback);
1134 flistNoCutsBack->Add(hptD0VsMaxPtNCback);
1135 flistNoCutsBack->Add(hptD0PTallsqrtNCback);
1136 flistNoCutsBack->Add(hptD0PTallNCback);
1137 flistNoCutsBack->Add(hptD0vsptBNCback);
1138 flistNoCutsBack->Add(hpD0vspBNCback);
1139 flistNoCutsBack->Add(hptD0vsptcquarkNCback);
1140 flistNoCutsBack->Add(hpD0vspcquarkNCback);
1142 TH1F *hd0zD0ptNCback;
1143 TH1F *hInvMassD0NCback,*hInvMassD0barNCback;
1144 TH2F *hInvMassPtNCback=new TH2F("hInvMassPtNCback","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
1145 THnSparseF *hSparseNCback=new THnSparseF("hSparseNCback","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
1146 hSparseNCback->SetBinEdges(0,massbins);
1147 hSparseNCback->SetBinEdges(1,massbins);
1148 hSparseNCback->SetBinEdges(2,ptbinsForNsparse);
1149 hSparseNCback->SetBinEdges(3,impparbins);
1150 hSparseNCback->SetBinEdges(4,massHypoBins);
1151 flistNoCutsBack->Add(hSparseNCback);
1154 TH1F *hCosPDPBNCback;
1155 TH1F *hCosPcPDNCback;
1156 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
1157 TH2F *hd0D0VSd0xd0NCbackpt;
1158 TH2F *hangletracksVSd0xd0NCbackpt;
1159 TH2F *hangletracksVSd0D0NCbackpt;
1160 TH1F *hd0xd0NCbackpt;
1161 flistNoCutsBack->Add(hInvMassPtNCback);
1163 TH2F *hTOFpidNCback=new TH2F("hTOFpidNCback","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
1164 flistNoCutsBack->Add(hTOFpidNCback);
1166 for(Int_t i=0;i<fnbins;i++){
1167 namehist="hd0zD0ptNCback_pt";
1169 titlehist="d0(z) No Cuts Backgrm ptbin=";
1171 hd0zD0ptNCback=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
1172 hd0zD0ptNCback->SetXTitle("d_{0}(z) [#mum]");
1173 hd0zD0ptNCback->SetYTitle("Entries");
1174 flistNoCutsBack->Add(hd0zD0ptNCback);
1176 namehist="hInvMassD0NCback_pt";
1178 titlehist="Invariant Mass No Cuts Backgr ptbin=";
1180 hInvMassD0NCback=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
1181 hInvMassD0NCback->SetXTitle("Invariant Mass [GeV]");
1182 hInvMassD0NCback->SetYTitle("Entries");
1183 flistNoCutsBack->Add(hInvMassD0NCback);
1186 namehist="hInvMassD0barNCback_pt";
1188 titlehist="Invariant Mass D0bar No Cuts Back ptbin=";
1190 hInvMassD0barNCback=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
1191 hInvMassD0barNCback->SetXTitle("Invariant Mass [GeV]");
1192 hInvMassD0barNCback->SetYTitle("Entries");
1193 flistNoCutsBack->Add(hInvMassD0barNCback);
1196 namehist="hetaNCback_pt";
1198 titlehist="eta No Cuts Backgr ptbin=";
1200 hetaNCback=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
1201 hetaNCback->SetXTitle("Pseudorapidity");
1202 hetaNCback->SetYTitle("Entries");
1203 flistNoCutsBack->Add(hetaNCback);
1205 namehist="hCosPDPBNCback_pt";
1207 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
1209 hCosPDPBNCback=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
1210 hCosPDPBNCback->SetXTitle("Cosine between D0 momentum and B momentum");
1211 hCosPDPBNCback->SetYTitle("Entries");
1212 flistNoCutsBack->Add(hCosPDPBNCback);
1214 namehist="hCosPcPDNCback_pt";
1216 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
1218 hCosPcPDNCback=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
1219 hCosPcPDNCback->SetXTitle("Cosine between c quark momentum and D0 momentum");
1220 hCosPcPDNCback->SetYTitle("Entries");
1221 flistNoCutsBack->Add(hCosPcPDNCback);
1224 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
1225 namehist="hd0xd0NCback_pt";
1227 titlehist="d0xd0 No Cuts Background ptbin=";
1229 hd0xd0NCbackpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
1230 hd0xd0NCbackpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
1231 hd0xd0NCbackpt->SetYTitle("Entries");
1232 flistNoCutsBack->Add(hd0xd0NCbackpt);
1235 namehist="hd0D0VSd0xd0NCback_pt";
1237 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} No Cuts Back ptbin=";
1239 hd0D0VSd0xd0NCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
1240 hd0D0VSd0xd0NCbackpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
1241 hd0D0VSd0xd0NCbackpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
1242 flistNoCutsBack->Add(hd0D0VSd0xd0NCbackpt);
1245 namehist="hangletracksVSd0xd0NCback_pt";
1247 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} No Cuts Back ptbin=";
1249 hangletracksVSd0xd0NCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
1250 hangletracksVSd0xd0NCbackpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
1251 hangletracksVSd0xd0NCbackpt->SetYTitle(" angle between K and #p tracks [rad]");
1252 flistNoCutsBack->Add(hangletracksVSd0xd0NCbackpt);
1255 namehist="hangletracksVSd0D0NCback_pt";
1257 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} No Cuts Back ptbin=";
1259 hangletracksVSd0D0NCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
1260 hangletracksVSd0D0NCbackpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
1261 hangletracksVSd0D0NCbackpt->SetYTitle(" angle between K and #p tracks [rad]");
1262 flistNoCutsBack->Add(hangletracksVSd0D0NCbackpt);
1267 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
1268 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1272 // ####### d0 D0 histos ############
1274 TH1F *hd0D0NCbackPM = new TH1F("hd0D0NCbackPM","D^{0} impact par. plot , No Cuts ,Background,Mass Peak (All momenta)",1000,-1000.,1000.);
1275 hd0D0NCbackPM->SetXTitle("Impact parameter [#mum]");
1276 hd0D0NCbackPM->SetYTitle("Entries");
1278 TH1F *hd0D0VtxTrueNCbackPM = new TH1F("hd0D0VtxTrueNCbackPM","D^{0} impact par. w.r.t. True Vtx, No Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
1279 hd0D0VtxTrueNCbackPM->SetXTitle("Impact parameter [#mum]");
1280 hd0D0VtxTrueNCbackPM->SetYTitle("Entries");
1282 TH1F *hMCd0D0NCbackPM = new TH1F("hMCd0D0NCbackPM","D^{0} impact par. plot, No Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
1283 hMCd0D0NCbackPM->SetXTitle("MC Impact parameter [#mum]");
1284 hMCd0D0NCbackPM->SetYTitle("Entries");
1286 TH1F *hd0D0NCbackSB = new TH1F("hd0D0NCbackSB","D^{0} impact par. plot , No Cuts ,Background,Mass Peak (All momenta)",1000,-1000.,1000.);
1287 hd0D0NCbackSB->SetXTitle("Impact parameter [#mum]");
1288 hd0D0NCbackSB->SetYTitle("Entries");
1290 TH1F *hd0D0VtxTrueNCbackSB = new TH1F("hd0D0VtxTrueNCbackSB","D^{0} impact par. w.r.t. True Vtx, No Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
1291 hd0D0VtxTrueNCbackSB->SetXTitle("Impact parameter [#mum]");
1292 hd0D0VtxTrueNCbackSB->SetYTitle("Entries");
1294 TH1F *hMCd0D0NCbackSB = new TH1F("hMCd0D0NCbackSB","D^{0} impact par. plot, No Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
1295 hMCd0D0NCbackSB->SetXTitle("MC Impact parameter [#mum]");
1296 hMCd0D0NCbackSB->SetYTitle("Entries");
1298 flistNoCutsBack->Add(hd0D0NCbackPM);
1299 flistNoCutsBack->Add(hd0D0VtxTrueNCbackPM);
1300 flistNoCutsBack->Add(hMCd0D0NCbackPM);
1301 flistNoCutsBack->Add(hd0D0NCbackSB);
1302 flistNoCutsBack->Add(hd0D0VtxTrueNCbackSB);
1303 flistNoCutsBack->Add(hMCd0D0NCbackSB);
1305 TH1F *hd0D0ptNCbackPM;
1306 TH1F *hMCd0D0ptNCbackPM;
1307 TH1F *hd0D0VtxTrueptNCbackPM;
1308 TH1F *hd0D0ptNCbackSB;
1309 TH1F *hMCd0D0ptNCbackSB;
1310 TH1F *hd0D0VtxTrueptNCbackSB;
1311 namehist="hd0D0ptNCback_";
1312 titlehist="D^{0} impact par. plot, No Cuts, Background, ";
1313 for(Int_t i=0;i<fnbins;i++){
1315 strnamept.Append("PkMss_pt");
1318 strtitlept=titlehist;
1319 strtitlept.Append(" Mass Peak, ");
1320 strtitlept+=fptbins[i];
1321 strtitlept.Append("<= pt <");
1322 strtitlept+=fptbins[i+1];
1323 strtitlept.Append(" [GeV/c]");
1325 hd0D0ptNCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1326 hd0D0ptNCbackPM->SetXTitle("Impact parameter [#mum] ");
1327 hd0D0ptNCbackPM->SetYTitle("Entries");
1328 flistNoCutsBack->Add(hd0D0ptNCbackPM);
1330 strnamept.ReplaceAll("hd0D0","hMCd0D0");
1331 hMCd0D0ptNCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1332 hMCd0D0ptNCbackPM->SetXTitle("MC Impact parameter [#mum] ");
1333 hMCd0D0ptNCbackPM->SetYTitle("Entries");
1334 flistNoCutsBack->Add(hMCd0D0ptNCbackPM);
1337 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
1338 hd0D0VtxTrueptNCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1339 hd0D0VtxTrueptNCbackPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1340 hd0D0VtxTrueptNCbackPM->SetYTitle("Entries");
1341 flistNoCutsBack->Add(hd0D0VtxTrueptNCbackPM);
1344 strnamept.Append("SBMss_pt");
1347 strtitlept=titlehist;
1348 strtitlept.Append(" Side Bands, ");
1349 strtitlept+=fptbins[i];
1350 strtitlept.Append("<= pt <");
1351 strtitlept+=fptbins[i+1];
1352 strtitlept.Append(" [GeV/c]");
1354 hd0D0ptNCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1355 hd0D0ptNCbackSB->SetXTitle("Impact parameter [#mum] ");
1356 hd0D0ptNCbackSB->SetYTitle("Entries");
1357 flistNoCutsBack->Add(hd0D0ptNCbackSB);
1359 strnamept.ReplaceAll("hd0D0","hMCd0D0");
1360 hMCd0D0ptNCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1361 hMCd0D0ptNCbackSB->SetXTitle("MC Impact parameter [#mum] ");
1362 hMCd0D0ptNCbackSB->SetYTitle("Entries");
1363 flistNoCutsBack->Add(hMCd0D0ptNCbackSB);
1365 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
1366 hd0D0VtxTrueptNCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1367 hd0D0VtxTrueptNCbackSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1368 hd0D0VtxTrueptNCbackSB->SetYTitle("Entries");
1369 flistNoCutsBack->Add(hd0D0VtxTrueptNCbackSB);
1374 //############ NO CUTS FROMB HISTOGRAMS ###########
1376 //####### global properties histos
1378 TH2F *hCPtaVSd0d0NCfromB=new TH2F("hCPtaVSd0d0NCfromB","hCPtaVSd0d0_NoCuts_FromB",1000,-100000.,100000.,100,-1.,1.);
1379 TH1F *hSecVtxZNCfromB=new TH1F("hSecVtxZNCfromB","hSecVtxZ_NoCuts_FromB",1000,-8.,8.);
1380 TH1F *hSecVtxXNCfromB=new TH1F("hSecVtxXNCfromB","hSecVtxX_NoCuts_FromB",1000,-3000.,3000.);
1381 TH1F *hSecVtxYNCfromB=new TH1F("hSecVtxYNCfromB","hSecVtxY_NoCuts_FromB",1000,-3000.,3000.);
1382 TH2F *hSecVtxXYNCfromB=new TH2F("hSecVtxXYNCfromB","hSecVtxXY_NoCuts_FromB",1000,-3000.,3000.,1000,-3000.,3000.);
1383 TH1F *hSecVtxPhiNCfromB=new TH1F("hSecVtxPhiNCfromB","hSecVtxPhi_NoCuts_FromB",180,-180.1,180.1);
1384 TH1F *hd0singlTrackNCfromB=new TH1F("hd0singlTrackNCfromB","hd0singlTrackNoCuts_FromB",1000,-5000.,5000.);
1385 TH1F *hCPtaNCfromB=new TH1F("hCPtaNCfromB","hCPta_NoCuts_FromB",100,-1.,1.);
1386 TH1F *hd0xd0NCfromB=new TH1F("hd0xd0NCfromB","hd0xd0_NoCuts_FromB",1000,-100000.,100000.);
1387 TH1F *hMassTrueNCfromB=new TH1F("hMassTrueNCfromB","D^{0} MC inv. Mass No Cuts FromB(All momenta)",600,1.600,2.200);
1388 TH1F *hMassNCfromB=new TH1F("hMassNCfromB","D^{0} inv. Mass No Cuts FromB (All momenta)",600,1.600,2.200);
1389 hMassNCfromB->Sumw2();
1390 TH1F *hMassTrueNCfromBPM=new TH1F("hMassTrueNCfromBPM","D^{0} MC inv. Mass No Cuts FromB, Mass Peak. (All momenta)",600,1.600,2.200);
1391 TH1F *hMassNCfromBPM=new TH1F("hMassNCfromBPM","D^{0} inv. Mass No Cuts FromB (All momenta), MassPeak",600,1.600,2.200);
1392 hMassNCfromB->Sumw2();
1393 TH1F *hMassTrueNCfromBSB=new TH1F("hMassTrueNCfromBSB","D^{0} MC inv. Mass in Side Bands No Cuts FromB(All momenta)",600,1.600,2.200);
1394 TH1F *hMassNCfromBSB=new TH1F("hMassNCfromBSB","D^{0} inv. Mass in Side Bands No Cuts FromB (All momenta)",600,1.600,2.200);
1395 hMassNCfromBSB->Sumw2();
1397 flistNoCutsFromB->Add(hCPtaVSd0d0NCfromB);
1398 flistNoCutsFromB->Add(hSecVtxZNCfromB);
1399 flistNoCutsFromB->Add(hSecVtxYNCfromB);
1400 flistNoCutsFromB->Add(hSecVtxXNCfromB);
1401 flistNoCutsFromB->Add(hSecVtxXYNCfromB);
1402 flistNoCutsFromB->Add(hSecVtxPhiNCfromB);
1403 flistNoCutsFromB->Add(hd0singlTrackNCfromB);
1404 flistNoCutsFromB->Add(hCPtaNCfromB);
1405 flistNoCutsFromB->Add(hd0xd0NCfromB);
1406 flistNoCutsFromB->Add(hMassTrueNCfromB);
1407 flistNoCutsFromB->Add(hMassNCfromB);
1408 flistNoCutsFromB->Add(hMassTrueNCfromBPM);
1409 flistNoCutsFromB->Add(hMassNCfromBPM);
1410 flistNoCutsFromB->Add(hMassTrueNCfromBSB);
1411 flistNoCutsFromB->Add(hMassNCfromBSB);
1417 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
1418 TH1F *hdcaNCfromB=new TH1F("hdcaNCfromB","hdca_NoCuts_FromB",100,0.,1000.);
1419 hdcaNCfromB->SetXTitle("dca [#mum]");
1420 hdcaNCfromB->SetYTitle("Entries");
1421 TH1F *hcosthetastarNCfromB=new TH1F("hcosthetastarNCfromB","hCosThetaStar_NoCuts_FromB",50,-1.,1.);
1422 hcosthetastarNCfromB->SetXTitle("cos #theta^{*}");
1423 hcosthetastarNCfromB->SetYTitle("Entries");
1424 TH1F *hptD0NCfromB=new TH1F("hptD0NCfromB","D^{0} transverse momentum distribution",34,ptbinsD0arr);
1425 hptD0NCfromB->SetXTitle("p_{t} [GeV/c]");
1426 hptD0NCfromB->SetYTitle("Entries");
1427 TH1F *hptD0VsMaxPtNCfromB=new TH1F("hptD0VsMaxPtNCfromB","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
1428 TH2F *hptD0PTallsqrtNCfromB=new TH2F("hptD0PTallsqrtNCfromB","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
1429 TH2F *hptD0PTallNCfromB=new TH2F("hptD0PTallNCfromB","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
1430 TH2F *hptD0vsptBNCfromB=new TH2F("hptD0vsptBNCfromB","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1431 TH2F *hpD0vspBNCfromB=new TH2F("hpD0vspBNCfromB","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1432 TH2F *hptD0vsptcquarkNCfromB=new TH2F("hptD0vsptcquarkNCfromB","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1433 TH2F *hpD0vspcquarkNCfromB=new TH2F("hpD0vspcquarkNCfromB","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1434 flistNoCutsFromB->Add(hdcaNCfromB);
1435 flistNoCutsFromB->Add(hcosthetastarNCfromB);
1436 flistNoCutsFromB->Add(hptD0NCfromB);
1437 flistNoCutsFromB->Add(hptD0VsMaxPtNCfromB);
1438 flistNoCutsFromB->Add(hptD0PTallsqrtNCfromB);
1439 flistNoCutsFromB->Add(hptD0PTallNCfromB);
1440 flistNoCutsFromB->Add(hptD0vsptBNCfromB);
1441 flistNoCutsFromB->Add(hpD0vspBNCfromB);
1442 flistNoCutsFromB->Add(hptD0vsptcquarkNCfromB);
1443 flistNoCutsFromB->Add(hpD0vspcquarkNCfromB);
1445 TH1F *hd0zD0ptNCfromB;
1446 TH1F *hInvMassD0NCfromB,*hInvMassD0barNCfromB;
1447 TH2F *hInvMassPtNCfromB=new TH2F("hInvMassPtNCfromB","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
1448 THnSparseF *hSparseNCfromB=new THnSparseF("hSparseNCfromB","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
1449 hSparseNCfromB->SetBinEdges(0,massbins);
1450 hSparseNCfromB->SetBinEdges(1,massbins);
1451 hSparseNCfromB->SetBinEdges(2,ptbinsForNsparse);
1452 hSparseNCfromB->SetBinEdges(3,impparbins);
1453 hSparseNCfromB->SetBinEdges(4,massHypoBins);
1454 flistNoCutsFromB->Add(hSparseNCfromB);
1458 THnSparseF *hSparseRecoNCfromB=new THnSparseF("hSparseRecoNCfromB","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
1459 hSparseRecoNCfromB->SetBinEdges(0,massbins);
1460 hSparseRecoNCfromB->SetBinEdges(1,massbins);
1461 hSparseRecoNCfromB->SetBinEdges(2,ptbinsForNsparse);
1462 hSparseRecoNCfromB->SetBinEdges(3,impparbins);
1463 hSparseRecoNCfromB->SetBinEdges(4,massHypoBins);
1464 flistNoCutsFromB->Add(hSparseRecoNCfromB);
1468 TH1F *hCosPDPBNCfromB;
1469 TH1F *hCosPcPDNCfromB;
1471 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
1472 TH2F *hd0D0VSd0xd0NCfromBpt;
1473 TH2F *hangletracksVSd0xd0NCfromBpt;
1474 TH2F *hangletracksVSd0D0NCfromBpt;
1475 TH1F *hd0xd0NCfromBpt;
1476 flistNoCutsFromB->Add(hInvMassPtNCfromB);
1478 TH2F *hTOFpidNCfromB=new TH2F("hTOFpidNCfromB","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
1479 flistNoCutsFromB->Add(hTOFpidNCfromB);
1481 for(Int_t i=0;i<fnbins;i++){
1482 namehist="hd0zD0ptNCfromB_pt";
1484 titlehist="d0(z) No Cuts FromB ptbin=";
1486 hd0zD0ptNCfromB=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
1487 hd0zD0ptNCfromB->SetXTitle("d_{0}(z) [#mum]");
1488 hd0zD0ptNCfromB->SetYTitle("Entries");
1489 flistNoCutsFromB->Add(hd0zD0ptNCfromB);
1491 namehist="hInvMassD0NCfromB_pt";
1493 titlehist="Invariant Mass No Cuts FromB ptbin=";
1495 hInvMassD0NCfromB=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
1496 hInvMassD0NCfromB->SetXTitle("Invariant Mass [GeV]");
1497 hInvMassD0NCfromB->SetYTitle("Entries");
1498 flistNoCutsFromB->Add(hInvMassD0NCfromB);
1501 namehist="hInvMassD0barNCfromB_pt";
1503 titlehist="Invariant Mass D0bar No Cuts FromB ptbin=";
1505 hInvMassD0barNCfromB=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
1506 hInvMassD0barNCfromB->SetXTitle("Invariant Mass [GeV]");
1507 hInvMassD0barNCfromB->SetYTitle("Entries");
1508 flistNoCutsFromB->Add(hInvMassD0barNCfromB);
1512 namehist="hetaNCfromB_pt";
1514 titlehist="eta No Cuts FromB ptbin=";
1516 hetaNCfromB=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
1517 hetaNCfromB->SetXTitle("Pseudorapidity");
1518 hetaNCfromB->SetYTitle("Entries");
1519 flistNoCutsFromB->Add(hetaNCfromB);
1521 namehist="hCosPDPBNCfromB_pt";
1523 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
1525 hCosPDPBNCfromB=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
1526 hCosPDPBNCfromB->SetXTitle("Cosine between D0 momentum and B momentum");
1527 hCosPDPBNCfromB->SetYTitle("Entries");
1528 flistNoCutsFromB->Add(hCosPDPBNCfromB);
1530 namehist="hCosPcPDNCfromB_pt";
1532 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
1534 hCosPcPDNCfromB=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
1535 hCosPcPDNCfromB->SetXTitle("Cosine between c quark momentum and D0 momentum");
1536 hCosPcPDNCfromB->SetYTitle("Entries");
1537 flistNoCutsFromB->Add(hCosPcPDNCfromB);
1539 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
1540 namehist="hd0xd0NCfromB_pt";
1542 titlehist="d0xd0 No Cuts FromB ptbin=";
1544 hd0xd0NCfromBpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
1545 hd0xd0NCfromBpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
1546 hd0xd0NCfromBpt->SetYTitle("Entries");
1547 flistNoCutsFromB->Add(hd0xd0NCfromBpt);
1550 namehist="hd0D0VSd0xd0NCfromB_pt";
1552 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} No Cuts FromB ptbin=";
1554 hd0D0VSd0xd0NCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
1555 hd0D0VSd0xd0NCfromBpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
1556 hd0D0VSd0xd0NCfromBpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
1557 flistNoCutsFromB->Add(hd0D0VSd0xd0NCfromBpt);
1560 namehist="hangletracksVSd0xd0NCfromB_pt";
1562 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} No Cuts FromB ptbin=";
1564 hangletracksVSd0xd0NCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
1565 hangletracksVSd0xd0NCfromBpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
1566 hangletracksVSd0xd0NCfromBpt->SetYTitle(" angle between K and #p tracks [rad]");
1567 flistNoCutsFromB->Add(hangletracksVSd0xd0NCfromBpt);
1570 namehist="hangletracksVSd0D0NCfromB_pt";
1572 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} No Cuts FromB ptbin=";
1574 hangletracksVSd0D0NCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
1575 hangletracksVSd0D0NCfromBpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
1576 hangletracksVSd0D0NCfromBpt->SetYTitle(" angle between K and #p tracks [rad]");
1577 flistNoCutsFromB->Add(hangletracksVSd0D0NCfromBpt);
1581 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
1582 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1586 // ######### d0 D0 histos ##############
1587 TH1F *hd0D0NCfromBPM = new TH1F("hd0D0NCfromBPM","D^{0} impact par. plot , No Cuts ,FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
1588 hd0D0NCfromBPM->SetXTitle("Impact parameter [#mum]");
1589 hd0D0NCfromBPM->SetYTitle("Entries");
1591 TH1F *hd0D0VtxTrueNCfromBPM = new TH1F("hd0D0VtxTrueNCfromBPM","D^{0} impact par. w.r.t. True Vtx, No Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
1592 hd0D0VtxTrueNCfromBPM->SetXTitle("Impact parameter [#mum]");
1593 hd0D0VtxTrueNCfromBPM->SetYTitle("Entries");
1595 TH1F *hMCd0D0NCfromBPM = new TH1F("hMCd0D0NCfromBPM","D^{0} impact par. plot, No Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
1596 hMCd0D0NCfromBPM->SetXTitle("MC Impact parameter [#mum]");
1597 hMCd0D0NCfromBPM->SetYTitle("Entries");
1599 TH1F *hd0D0NCfromBSB = new TH1F("hd0D0NCfromBSB","D^{0} impact par. plot , No Cuts ,FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
1600 hd0D0NCfromBSB->SetXTitle("Impact parameter [#mum]");
1601 hd0D0NCfromBSB->SetYTitle("Entries");
1603 TH1F *hd0D0VtxTrueNCfromBSB = new TH1F("hd0D0VtxTrueNCfromBSB","D^{0} impact par. w.r.t. True Vtx, No Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
1604 hd0D0VtxTrueNCfromBSB->SetXTitle("Impact parameter [#mum]");
1605 hd0D0VtxTrueNCfromBSB->SetYTitle("Entries");
1607 TH1F *hMCd0D0NCfromBSB = new TH1F("hMCd0D0NCfromBSB","D^{0} impact par. plot, No Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
1608 hMCd0D0NCfromBSB->SetXTitle("MC Impact parameter [#mum]");
1609 hMCd0D0NCfromBSB->SetYTitle("Entries");
1611 flistNoCutsFromB->Add(hd0D0NCfromBPM);
1612 flistNoCutsFromB->Add(hd0D0VtxTrueNCfromBPM);
1613 flistNoCutsFromB->Add(hMCd0D0NCfromBPM);
1614 flistNoCutsFromB->Add(hd0D0NCfromBSB);
1615 flistNoCutsFromB->Add(hd0D0VtxTrueNCfromBSB);
1616 flistNoCutsFromB->Add(hMCd0D0NCfromBSB);
1618 TH1F *hd0D0ptNCfromBPM;
1619 TH1F *hMCd0D0ptNCfromBPM;
1620 TH1F *hd0D0VtxTrueptNCfromBPM;
1621 TH1F *hd0D0ptNCfromBSB;
1622 TH1F *hMCd0D0ptNCfromBSB;
1623 TH1F *hd0D0VtxTrueptNCfromBSB;
1624 namehist="hd0D0ptNCfromB_";
1625 titlehist="D^{0} impact par. plot, No Cuts, FromB, ";
1626 for(Int_t i=0;i<fnbins;i++){
1628 strnamept.Append("PkMss_pt");
1631 strtitlept=titlehist;
1632 strtitlept.Append(" Mass Peak, ");
1633 strtitlept+=fptbins[i];
1634 strtitlept.Append("<= pt <");
1635 strtitlept+=fptbins[i+1];
1636 strtitlept.Append(" [GeV/c]");
1638 hd0D0ptNCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1639 hd0D0ptNCfromBPM->SetXTitle("Impact parameter [#mum] ");
1640 hd0D0ptNCfromBPM->SetYTitle("Entries");
1641 flistNoCutsFromB->Add(hd0D0ptNCfromBPM);
1643 strnamept.ReplaceAll("hd0D0","hMCd0D0");
1644 hMCd0D0ptNCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1645 hMCd0D0ptNCfromBPM->SetXTitle("MC Impact parameter [#mum] ");
1646 hMCd0D0ptNCfromBPM->SetYTitle("Entries");
1647 flistNoCutsFromB->Add(hMCd0D0ptNCfromBPM);
1650 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
1651 hd0D0VtxTrueptNCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1652 hd0D0VtxTrueptNCfromBPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1653 hd0D0VtxTrueptNCfromBPM->SetYTitle("Entries");
1654 flistNoCutsFromB->Add(hd0D0VtxTrueptNCfromBPM);
1657 strnamept.Append("SBMss_pt");
1660 strtitlept=titlehist;
1661 strtitlept.Append(" Side Bands, ");
1662 strtitlept+=fptbins[i];
1663 strtitlept.Append("<= pt <");
1664 strtitlept+=fptbins[i+1];
1665 strtitlept.Append(" [GeV/c]");
1667 hd0D0ptNCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1668 hd0D0ptNCfromBSB->SetXTitle("Impact parameter [#mum] ");
1669 hd0D0ptNCfromBSB->SetYTitle("Entries");
1670 flistNoCutsFromB->Add(hd0D0ptNCfromBSB);
1672 strnamept.ReplaceAll("hd0D0","hMCd0D0");
1673 hMCd0D0ptNCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1674 hMCd0D0ptNCfromBSB->SetXTitle("MC Impact parameter [#mum] ");
1675 hMCd0D0ptNCfromBSB->SetYTitle("Entries");
1676 flistNoCutsFromB->Add(hMCd0D0ptNCfromBSB);
1678 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
1679 hd0D0VtxTrueptNCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1680 hd0D0VtxTrueptNCfromBSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1681 hd0D0VtxTrueptNCfromBSB->SetYTitle("Entries");
1682 flistNoCutsFromB->Add(hd0D0VtxTrueptNCfromBSB);
1687 //############ NO CUTS FROM DSTAR HISTOGRAMS ###########
1689 //############# global properties histos #######
1691 TH2F *hCPtaVSd0d0NCfromDstar=new TH2F("hCPtaVSd0d0NCfromDstar","hCPtaVSd0d0_NoCuts_FromDStar",1000,-100000.,100000.,100,-1.,1.);
1692 TH1F *hSecVtxZNCfromDstar=new TH1F("hSecVtxZNCfromDstar","hSecVtxZ_NoCuts_FromDStar",1000,-8.,8.);
1693 TH1F *hSecVtxXNCfromDstar=new TH1F("hSecVtxXNCfromDstar","hSecVtxX_NoCuts_FromDStar",1000,-3000.,3000.);
1694 TH1F *hSecVtxYNCfromDstar=new TH1F("hSecVtxYNCfromDstar","hSecVtxY_NoCuts_FromDStar",1000,-3000.,3000.);
1695 TH2F *hSecVtxXYNCfromDstar=new TH2F("hSecVtxXYNCfromDstar","hSecVtxXY_NoCuts_FromDStar",1000,-3000.,3000.,1000,-3000.,3000.);
1696 TH1F *hSecVtxPhiNCfromDstar=new TH1F("hSecVtxPhiNCfromDstar","hSecVtxPhi_NoCuts_FromDStar",180,-180.1,180.1);
1697 TH1F *hd0singlTrackNCfromDstar=new TH1F("hd0singlTrackNCfromDstar","hd0singlTrackNoCuts_fromDstar",1000,-5000.,5000.);
1698 TH1F *hCPtaNCfromDstar=new TH1F("hCPtaNCfromDstar","hCPta_NoCuts_FromDStar",100,-1.,1.);
1699 TH1F *hd0xd0NCfromDstar=new TH1F("hd0xd0NCfromDstar","hd0xd0_NoCuts_FromDStar",1000,-100000.,100000.);
1700 TH1F *hMassTrueNCfromDstar=new TH1F("hMassTrueNCfromDstar","D^{0} MC inv. Mass No Cuts FromDStar(All momenta)",600,1.600,2.200);
1701 TH1F *hMassNCfromDstar=new TH1F("hMassNCfromDstar","D^{0} inv. Mass No Cuts FromDStar (All momenta)",600,1.600,2.200);
1702 hMassNCfromDstar->Sumw2();
1703 TH1F *hMassTrueNCfromDstarPM=new TH1F("hMassTrueNCfromDstarPM","D^{0} MC inv. Mass No Cuts FromDStar, Mass Peak. (All momenta)",600,1.600,2.200);
1704 TH1F *hMassNCfromDstarPM=new TH1F("hMassNCfromDstarPM","D^{0} inv. Mass No Cuts FromDStar (All momenta), MassPeak",600,1.600,2.200);
1705 hMassNCfromDstarPM->Sumw2();
1706 TH1F *hMassTrueNCfromDstarSB=new TH1F("hMassTrueNCfromDstarSB","D^{0} MC inv. Mass in Side Bands No Cuts FromDStar(All momenta)",600,1.600,2.200);
1707 TH1F *hMassNCfromDstarSB=new TH1F("hMassNCfromDstarSB","D^{0} inv. Mass in Side Bands No Cuts FromDStar (All momenta)",600,1.600,2.200);
1708 hMassNCfromDstarSB->Sumw2();
1710 flistNoCutsFromDstar->Add(hCPtaVSd0d0NCfromDstar);
1711 flistNoCutsFromDstar->Add(hSecVtxZNCfromDstar);
1712 flistNoCutsFromDstar->Add(hSecVtxYNCfromDstar);
1713 flistNoCutsFromDstar->Add(hSecVtxXNCfromDstar);
1714 flistNoCutsFromDstar->Add(hSecVtxXYNCfromDstar);
1715 flistNoCutsFromDstar->Add(hSecVtxPhiNCfromDstar);
1716 flistNoCutsFromDstar->Add(hd0singlTrackNCfromDstar);
1717 flistNoCutsFromDstar->Add(hCPtaNCfromDstar);
1718 flistNoCutsFromDstar->Add(hd0xd0NCfromDstar);
1719 flistNoCutsFromDstar->Add(hMassTrueNCfromDstar);
1720 flistNoCutsFromDstar->Add(hMassNCfromDstar);
1721 flistNoCutsFromDstar->Add(hMassTrueNCfromDstarPM);
1722 flistNoCutsFromDstar->Add(hMassNCfromDstarPM);
1723 flistNoCutsFromDstar->Add(hMassTrueNCfromDstarSB);
1724 flistNoCutsFromDstar->Add(hMassNCfromDstarSB);
1729 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
1730 TH1F *hdcaNCfromDstar=new TH1F("hdcaNCfromDstar","hdca_NoCuts_FromDstar",100,0.,1000.);
1731 hdcaNCfromDstar->SetXTitle("dca [#mum]");
1732 hdcaNCfromDstar->SetYTitle("Entries");
1733 TH1F *hcosthetastarNCfromDstar=new TH1F("hcosthetastarNCfromDstar","hCosThetaStar_NoCuts_FromDstar",50,-1.,1.);
1734 hcosthetastarNCfromDstar->SetXTitle("cos #theta^{*}");
1735 hcosthetastarNCfromDstar->SetYTitle("Entries");
1736 TH1F *hptD0NCfromDstar=new TH1F("hptD0NCfromDstar","D^{0} transverse momentum distribution",34,ptbinsD0arr);
1737 hptD0NCfromDstar->SetXTitle("p_{t} [GeV/c]");
1738 hptD0NCfromDstar->SetYTitle("Entries");
1739 TH1F *hptD0VsMaxPtNCfromDstar=new TH1F("hptD0VsMaxPtNCfromDstar","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
1740 TH2F *hptD0PTallsqrtNCfromDstar=new TH2F("hptD0PTallsqrtNCfromDstar","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
1741 TH2F *hptD0PTallNCfromDstar=new TH2F("hptD0PTallNCfromDstar","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
1742 TH2F *hptD0vsptBNCfromDstar=new TH2F("hptD0vsptBNCfromDstar","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1743 TH2F *hpD0vspBNCfromDstar=new TH2F("hpD0vspBNCfromDstar","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1744 TH2F *hptD0vsptcquarkNCfromDstar=new TH2F("hptD0vsptcquarkNCfromDstar","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1745 TH2F *hpD0vspcquarkNCfromDstar=new TH2F("hpD0vspcquarkNCfromDstar","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1746 flistNoCutsFromDstar->Add(hdcaNCfromDstar);
1747 flistNoCutsFromDstar->Add(hcosthetastarNCfromDstar);
1748 flistNoCutsFromDstar->Add(hptD0NCfromDstar);
1749 flistNoCutsFromDstar->Add(hptD0VsMaxPtNCfromDstar);
1750 flistNoCutsFromDstar->Add(hptD0PTallsqrtNCfromDstar);
1751 flistNoCutsFromDstar->Add(hptD0PTallNCfromDstar);
1752 flistNoCutsFromDstar->Add(hptD0vsptBNCfromDstar);
1753 flistNoCutsFromDstar->Add(hpD0vspBNCfromDstar);
1754 flistNoCutsFromDstar->Add(hptD0vsptcquarkNCfromDstar);
1755 flistNoCutsFromDstar->Add(hpD0vspcquarkNCfromDstar);
1757 TH1F *hd0zD0ptNCfromDstar;
1758 TH1F *hInvMassD0NCfromDstar,*hInvMassD0barNCfromDstar;
1759 TH2F *hInvMassPtNCfromDstar=new TH2F("hInvMassPtNCfromDstar","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
1760 THnSparseF *hSparseNCfromDstar=new THnSparseF("hSparseNCfromDstar","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
1761 hSparseNCfromDstar->SetBinEdges(0,massbins);
1762 hSparseNCfromDstar->SetBinEdges(1,massbins);
1763 hSparseNCfromDstar->SetBinEdges(2,ptbinsForNsparse);
1764 hSparseNCfromDstar->SetBinEdges(3,impparbins);
1765 hSparseNCfromDstar->SetBinEdges(4,massHypoBins);
1766 flistNoCutsFromDstar->Add(hSparseNCfromDstar);
1767 TH1F *hetaNCfromDstar;
1768 TH1F *hCosPDPBNCfromDstar;
1769 TH1F *hCosPcPDNCfromDstar;
1770 flistNoCutsFromDstar->Add(hInvMassPtNCfromDstar);
1771 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
1772 TH2F *hd0D0VSd0xd0NCfromDstarpt;
1773 TH2F *hangletracksVSd0xd0NCfromDstarpt;
1774 TH2F *hangletracksVSd0D0NCfromDstarpt;
1775 TH1F *hd0xd0NCfromDstarpt;
1777 TH2F *hTOFpidNCfromDstar=new TH2F("hTOFpidNCfromDstar","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
1778 flistNoCutsFromDstar->Add(hTOFpidNCfromDstar);
1780 for(Int_t i=0;i<fnbins;i++){
1781 namehist="hd0zD0ptNCfromDstar_pt";
1783 titlehist="d0(z) No Cuts FromDstarm ptbin=";
1785 hd0zD0ptNCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
1786 hd0zD0ptNCfromDstar->SetXTitle("d_{0}(z) [#mum]");
1787 hd0zD0ptNCfromDstar->SetYTitle("Entries");
1788 flistNoCutsFromDstar->Add(hd0zD0ptNCfromDstar);
1790 namehist="hInvMassD0NCfromDstar_pt";
1792 titlehist="Invariant Mass No Cuts FromDstar ptbin=";
1794 hInvMassD0NCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
1795 hInvMassD0NCfromDstar->SetXTitle("Invariant Mass [GeV]");
1796 hInvMassD0NCfromDstar->SetYTitle("Entries");
1797 flistNoCutsFromDstar->Add(hInvMassD0NCfromDstar);
1800 namehist="hInvMassD0barNCfromDstar_pt";
1802 titlehist="Invariant Mass D0bar No Cuts FromDstar ptbin=";
1804 hInvMassD0barNCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
1805 hInvMassD0barNCfromDstar->SetXTitle("Invariant Mass [GeV]");
1806 hInvMassD0barNCfromDstar->SetYTitle("Entries");
1807 flistNoCutsFromDstar->Add(hInvMassD0barNCfromDstar);
1811 namehist="hetaNCfromDstar_pt";
1813 titlehist="eta No Cuts FromDstar ptbin=";
1815 hetaNCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
1816 hetaNCfromDstar->SetXTitle("Pseudorapidity");
1817 hetaNCfromDstar->SetYTitle("Entries");
1818 flistNoCutsFromDstar->Add(hetaNCfromDstar);
1820 namehist="hCosPDPBNCfromDstar_pt";
1822 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
1824 hCosPDPBNCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
1825 hCosPDPBNCfromDstar->SetXTitle("Cosine between D0 momentum and B momentum");
1826 hCosPDPBNCfromDstar->SetYTitle("Entries");
1827 flistNoCutsFromDstar->Add(hCosPDPBNCfromDstar);
1829 namehist="hCosPcPDNCfromDstar_pt";
1831 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
1833 hCosPcPDNCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
1834 hCosPcPDNCfromDstar->SetXTitle("Cosine between c quark momentum and D0 momentum");
1835 hCosPcPDNCfromDstar->SetYTitle("Entries");
1836 flistNoCutsFromDstar->Add(hCosPcPDNCfromDstar);
1838 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
1839 namehist="hd0xd0NCfromDstar_pt";
1841 titlehist="d0xd0 No Cuts FromDstar ptbin=";
1843 hd0xd0NCfromDstarpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
1844 hd0xd0NCfromDstarpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
1845 hd0xd0NCfromDstarpt->SetYTitle("Entries");
1846 flistNoCutsFromDstar->Add(hd0xd0NCfromDstarpt);
1849 namehist="hd0D0VSd0xd0NCfromDstar_pt";
1851 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} No Cuts FromDstar ptbin=";
1853 hd0D0VSd0xd0NCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
1854 hd0D0VSd0xd0NCfromDstarpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
1855 hd0D0VSd0xd0NCfromDstarpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
1856 flistNoCutsFromDstar->Add(hd0D0VSd0xd0NCfromDstarpt);
1859 namehist="hangletracksVSd0xd0NCfromDstar_pt";
1861 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} No Cuts FromDstar ptbin=";
1863 hangletracksVSd0xd0NCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
1864 hangletracksVSd0xd0NCfromDstarpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
1865 hangletracksVSd0xd0NCfromDstarpt->SetYTitle(" angle between K and #p tracks [rad]");
1866 flistNoCutsFromDstar->Add(hangletracksVSd0xd0NCfromDstarpt);
1869 namehist="hangletracksVSd0D0NCfromDstar_pt";
1871 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} No Cuts FromDstar ptbin=";
1873 hangletracksVSd0D0NCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
1874 hangletracksVSd0D0NCfromDstarpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
1875 hangletracksVSd0D0NCfromDstarpt->SetYTitle(" angle between K and #p tracks [rad]");
1876 flistNoCutsFromDstar->Add(hangletracksVSd0D0NCfromDstarpt);
1879 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
1880 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1883 //########## d0 D0 histos #############
1884 TH1F *hd0D0NCfromDstPM = new TH1F("hd0D0NCfromDstarPM","D^{0} impact par. plot , No Cuts ,FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
1885 hd0D0NCfromDstPM->SetXTitle("Impact parameter [#mum]");
1886 hd0D0NCfromDstPM->SetYTitle("Entries");
1888 TH1F *hd0D0VtxTrueNCfromDstPM = new TH1F("hd0D0VtxTrueNCfromDstarPM","D^{0} impact par. w.r.t. True Vtx, No Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
1889 hd0D0VtxTrueNCfromDstPM->SetXTitle("Impact parameter [#mum]");
1890 hd0D0VtxTrueNCfromDstPM->SetYTitle("Entries");
1892 TH1F *hMCd0D0NCfromDstPM = new TH1F("hMCd0D0NCfromDstarPM","D^{0} impact par. plot, No Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
1893 hMCd0D0NCfromDstPM->SetXTitle("MC Impact parameter [#mum]");
1894 hMCd0D0NCfromDstPM->SetYTitle("Entries");
1896 TH1F *hd0D0NCfromDstSB = new TH1F("hd0D0NCfromDstarSB","D^{0} impact par. plot , No Cuts ,FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
1897 hd0D0NCfromDstSB->SetXTitle("Impact parameter [#mum]");
1898 hd0D0NCfromDstSB->SetYTitle("Entries");
1900 TH1F *hd0D0VtxTrueNCfromDstSB = new TH1F("hd0D0VtxTrueNCfromDstarSB","D^{0} impact par. w.r.t. True Vtx, No Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
1901 hd0D0VtxTrueNCfromDstSB->SetXTitle("Impact parameter [#mum]");
1902 hd0D0VtxTrueNCfromDstSB->SetYTitle("Entries");
1904 TH1F *hMCd0D0NCfromDstSB = new TH1F("hMCd0D0NCfromDstarSB","D^{0} impact par. plot, No Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
1905 hMCd0D0NCfromDstSB->SetXTitle("MC Impact parameter [#mum]");
1906 hMCd0D0NCfromDstSB->SetYTitle("Entries");
1908 flistNoCutsFromDstar->Add(hd0D0NCfromDstPM);
1909 flistNoCutsFromDstar->Add(hd0D0VtxTrueNCfromDstPM);
1910 flistNoCutsFromDstar->Add(hMCd0D0NCfromDstPM);
1911 flistNoCutsFromDstar->Add(hd0D0NCfromDstSB);
1912 flistNoCutsFromDstar->Add(hd0D0VtxTrueNCfromDstSB);
1913 flistNoCutsFromDstar->Add(hMCd0D0NCfromDstSB);
1915 TH1F *hd0D0ptNCfromDstPM;
1916 TH1F *hMCd0D0ptNCfromDstPM;
1917 TH1F *hd0D0VtxTrueptNCfromDstPM;
1918 TH1F *hd0D0ptNCfromDstSB;
1919 TH1F *hMCd0D0ptNCfromDstSB;
1920 TH1F *hd0D0VtxTrueptNCfromDstSB;
1921 namehist="hd0D0ptNCfromDstar_";
1922 titlehist="D^{0} impact par. plot, No Cuts, FromDStar, ";
1923 for(Int_t i=0;i<fnbins;i++){
1925 strnamept.Append("PkMss_pt");
1928 strtitlept=titlehist;
1929 strtitlept.Append(" Mass Peak, ");
1930 strtitlept+=fptbins[i];
1931 strtitlept.Append("<= pt <");
1932 strtitlept+=fptbins[i+1];
1933 strtitlept.Append(" [GeV/c]");
1935 hd0D0ptNCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1936 hd0D0ptNCfromDstPM->SetXTitle("Impact parameter [#mum] ");
1937 hd0D0ptNCfromDstPM->SetYTitle("Entries");
1938 flistNoCutsFromDstar->Add(hd0D0ptNCfromDstPM);
1940 strnamept.ReplaceAll("hd0D0","hMCd0D0");
1941 hMCd0D0ptNCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1942 hMCd0D0ptNCfromDstPM->SetXTitle("MC Impact parameter [#mum] ");
1943 hMCd0D0ptNCfromDstPM->SetYTitle("Entries");
1944 flistNoCutsFromDstar->Add(hMCd0D0ptNCfromDstPM);
1947 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
1948 hd0D0VtxTrueptNCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1949 hd0D0VtxTrueptNCfromDstPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1950 hd0D0VtxTrueptNCfromDstPM->SetYTitle("Entries");
1951 flistNoCutsFromDstar->Add(hd0D0VtxTrueptNCfromDstPM);
1954 strnamept.Append("SBMss_pt");
1957 strtitlept=titlehist;
1958 strtitlept.Append(" Side Bands, ");
1959 strtitlept+=fptbins[i];
1960 strtitlept.Append("<= pt <");
1961 strtitlept+=fptbins[i+1];
1962 strtitlept.Append(" [GeV/c]");
1964 hd0D0ptNCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1965 hd0D0ptNCfromDstSB->SetXTitle("Impact parameter [#mum] ");
1966 hd0D0ptNCfromDstSB->SetYTitle("Entries");
1967 flistNoCutsFromDstar->Add(hd0D0ptNCfromDstSB);
1969 strnamept.ReplaceAll("hd0D0","hMCd0D0");
1970 hMCd0D0ptNCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1971 hMCd0D0ptNCfromDstSB->SetXTitle("MC Impact parameter [#mum] ");
1972 hMCd0D0ptNCfromDstSB->SetYTitle("Entries");
1973 flistNoCutsFromDstar->Add(hMCd0D0ptNCfromDstSB);
1975 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
1976 hd0D0VtxTrueptNCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1977 hd0D0VtxTrueptNCfromDstSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1978 hd0D0VtxTrueptNCfromDstSB->SetYTitle("Entries");
1979 flistNoCutsFromDstar->Add(hd0D0VtxTrueptNCfromDstSB);
1983 //############ NO CUTS OTHER HISTOGRAMS ###########
1985 //########### global properties histos ###########
1987 TH2F *hCPtaVSd0d0NCother=new TH2F("hCPtaVSd0d0NCother","hCPtaVSd0d0_NoCuts_other",1000,-100000.,100000.,100,-1.,1.);
1988 TH1F *hSecVtxZNCother=new TH1F("hSecVtxZNCother","hSecVtxZ_NoCuts_other",1000,-8.,8.);
1989 TH1F *hSecVtxXNCother=new TH1F("hSecVtxXNCother","hSecVtxX_NoCuts_other",1000,-3000.,3000.);
1990 TH1F *hSecVtxYNCother=new TH1F("hSecVtxYNCother","hSecVtxY_NoCuts_other",1000,-3000.,3000.);
1991 TH2F *hSecVtxXYNCother=new TH2F("hSecVtxXYNCother","hSecVtxXY_NoCuts_other",1000,-3000.,3000.,1000,-3000.,3000.);
1992 TH1F *hSecVtxPhiNCother=new TH1F("hSecVtxPhiNCother","hSecVtxPhi_NoCuts_other",180,-180.1,180.1);
1993 TH1F *hd0singlTrackNCother=new TH1F("hd0singlTrackNCother","hd0singlTrackNoCuts_Other",1000,-5000.,5000.);
1994 TH1F *hCPtaNCother=new TH1F("hCPtaNCother","hCPta_NoCuts_other",100,-1.,1.);
1995 TH1F *hd0xd0NCother=new TH1F("hd0xd0NCother","hd0xd0_NoCuts_other",1000,-100000.,100000.);
1996 TH1F *hMassTrueNCother=new TH1F("hMassTrueNCother","D^{0} MC inv. Mass No Cuts other(All momenta)",600,1.600,2.200);
1997 TH1F *hMassNCother=new TH1F("hMassNCother","D^{0} inv. Mass No Cuts other (All momenta)",600,1.600,2.200);
1998 hMassNCother->Sumw2();
1999 TH1F *hMassTrueNCotherPM=new TH1F("hMassTrueNCotherPM","D^{0} MC inv. Mass No Cuts Other, Mass Peak. (All momenta)",600,1.600,2.200);
2000 TH1F *hMassNCotherPM=new TH1F("hMassNCotherPM","D^{0} inv. Mass No Cuts Other (All momenta), MassPeak",600,1.600,2.200);
2001 hMassNCotherPM->Sumw2();
2002 TH1F *hMassTrueNCotherSB=new TH1F("hMassTrueNCotherSB","D^{0} MC inv. Mass in Side Bands No Cuts other(All momenta)",600,1.600,2.200);
2003 TH1F *hMassNCotherSB=new TH1F("hMassNCotherSB","D^{0} inv. Mass in Side Bands No Cuts other (All momenta)",600,1.600,2.200);
2004 hMassNCotherSB->Sumw2();
2006 flistNoCutsOther->Add(hCPtaVSd0d0NCother);
2007 flistNoCutsOther->Add(hSecVtxZNCother);
2008 flistNoCutsOther->Add(hSecVtxYNCother);
2009 flistNoCutsOther->Add(hSecVtxXNCother);
2010 flistNoCutsOther->Add(hSecVtxXYNCother);
2011 flistNoCutsOther->Add(hSecVtxPhiNCother);
2012 flistNoCutsOther->Add(hd0singlTrackNCother);
2013 flistNoCutsOther->Add(hCPtaNCother);
2014 flistNoCutsOther->Add(hd0xd0NCother);
2015 flistNoCutsOther->Add(hMassTrueNCother);
2016 flistNoCutsOther->Add(hMassNCother);
2017 flistNoCutsOther->Add(hMassTrueNCotherPM);
2018 flistNoCutsOther->Add(hMassNCotherPM);
2019 flistNoCutsOther->Add(hMassTrueNCotherSB);
2020 flistNoCutsOther->Add(hMassNCotherSB);
2024 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
2025 TH1F *hdcaNCother=new TH1F("hdcaNCother","hdca_NoCuts_Other",100,0.,1000.);
2026 hdcaNCother->SetXTitle("dca [#mum]");
2027 hdcaNCother->SetYTitle("Entries");
2028 TH1F *hcosthetastarNCother=new TH1F("hcosthetastarNCother","hCosThetaStar_NoCuts_Other",50,-1.,1.);
2029 hcosthetastarNCother->SetXTitle("cos #theta^{*}");
2030 hcosthetastarNCother->SetYTitle("Entries");
2031 TH1F *hptD0NCother=new TH1F("hptD0NCother","D^{0} transverse momentum distribution",34,ptbinsD0arr);
2032 hptD0NCother->SetXTitle("p_{t} [GeV/c]");
2033 hptD0NCother->SetYTitle("Entries");
2034 TH1F *hptD0VsMaxPtNCother=new TH1F("hptD0VsMaxPtNCother","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
2035 TH2F *hptD0PTallsqrtNCother=new TH2F("hptD0PTallsqrtNCother","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
2036 TH2F *hptD0PTallNCother=new TH2F("hptD0PTallNCother","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
2037 TH2F *hptD0vsptBNCother=new TH2F("hptD0vsptBNCother","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2038 TH2F *hpD0vspBNCother=new TH2F("hpD0vspBNCother","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2039 TH2F *hptD0vsptcquarkNCother=new TH2F("hptD0vsptcquarkNCother","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2040 TH2F *hpD0vspcquarkNCother=new TH2F("hpD0vspcquarkNCother","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2041 flistNoCutsOther->Add(hdcaNCother);
2042 flistNoCutsOther->Add(hcosthetastarNCother);
2043 flistNoCutsOther->Add(hptD0NCother);
2044 flistNoCutsOther->Add(hptD0VsMaxPtNCother);
2045 flistNoCutsOther->Add(hptD0PTallsqrtNCother);
2046 flistNoCutsOther->Add(hptD0PTallNCother);
2047 flistNoCutsOther->Add(hptD0vsptBNCother);
2048 flistNoCutsOther->Add(hpD0vspBNCother);
2049 flistNoCutsOther->Add(hptD0vsptcquarkNCother);
2050 flistNoCutsOther->Add(hpD0vspcquarkNCother);
2052 TH1F *hd0zD0ptNCother;
2053 TH1F *hInvMassD0NCother,*hInvMassD0barNCother;
2054 TH2F *hInvMassPtNCother=new TH2F("hInvMassPtNCother","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
2055 THnSparseF *hSparseNCother=new THnSparseF("hSparseNCother","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
2056 hSparseNCother->SetBinEdges(0,massbins);
2057 hSparseNCother->SetBinEdges(1,massbins);
2058 hSparseNCother->SetBinEdges(2,ptbinsForNsparse);
2059 hSparseNCother->SetBinEdges(3,impparbins);
2060 hSparseNCother->SetBinEdges(4,massHypoBins);
2061 flistNoCutsOther->Add(hSparseNCother);
2063 TH1F *hCosPDPBNCother;
2064 TH1F *hCosPcPDNCother;
2065 flistNoCutsOther->Add(hInvMassPtNCother);
2066 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
2067 TH2F *hd0D0VSd0xd0NCotherpt;
2068 TH2F *hangletracksVSd0xd0NCotherpt;
2069 TH2F *hangletracksVSd0D0NCotherpt;
2070 TH1F *hd0xd0NCotherpt;
2072 TH2F *hTOFpidNCother=new TH2F("hTOFpidNCother","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
2073 flistNoCutsOther->Add(hTOFpidNCother);
2075 for(Int_t i=0;i<fnbins;i++){
2076 namehist="hd0zD0ptNCother_pt";
2078 titlehist="d0(z) No Cuts Otherm ptbin=";
2080 hd0zD0ptNCother=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
2081 hd0zD0ptNCother->SetXTitle("d_{0}(z) [#mum]");
2082 hd0zD0ptNCother->SetYTitle("Entries");
2083 flistNoCutsOther->Add(hd0zD0ptNCother);
2085 namehist="hInvMassD0NCother_pt";
2087 titlehist="Invariant Mass No Cuts Other ptbin=";
2089 hInvMassD0NCother=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
2090 hInvMassD0NCother->SetXTitle("Invariant Mass [GeV]");
2091 hInvMassD0NCother->SetYTitle("Entries");
2092 flistNoCutsOther->Add(hInvMassD0NCother);
2095 namehist="hInvMassD0barNCother_pt";
2097 titlehist="Invariant Mass D0bar No Cuts Other ptbin=";
2099 hInvMassD0barNCother=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
2100 hInvMassD0barNCother->SetXTitle("Invariant Mass [GeV]");
2101 hInvMassD0barNCother->SetYTitle("Entries");
2102 flistNoCutsOther->Add(hInvMassD0barNCother);
2105 namehist="hetaNCother_pt";
2107 titlehist="eta No Cuts Other ptbin=";
2109 hetaNCother=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
2110 hetaNCother->SetXTitle("Pseudorapidity");
2111 hetaNCother->SetYTitle("Entries");
2112 flistNoCutsOther->Add(hetaNCother);
2114 namehist="hCosPDPBNCother_pt";
2116 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
2118 hCosPDPBNCother=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
2119 hCosPDPBNCother->SetXTitle("Cosine between D0 momentum and B momentum");
2120 hCosPDPBNCother->SetYTitle("Entries");
2121 flistNoCutsOther->Add(hCosPDPBNCother);
2123 namehist="hCosPcPDNCother_pt";
2125 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
2127 hCosPcPDNCother=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
2128 hCosPcPDNCother->SetXTitle("Cosine between c quark momentum and D0 momentum");
2129 hCosPcPDNCother->SetYTitle("Entries");
2130 flistNoCutsOther->Add(hCosPcPDNCother);
2133 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
2134 namehist="hd0xd0NCother_pt";
2136 titlehist="d0xd0 No Cuts Other ptbin=";
2138 hd0xd0NCotherpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
2139 hd0xd0NCotherpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
2140 hd0xd0NCotherpt->SetYTitle("Entries");
2141 flistNoCutsOther->Add(hd0xd0NCotherpt);
2144 namehist="hd0D0VSd0xd0NCother_pt";
2146 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} No Cuts Other ptbin=";
2148 hd0D0VSd0xd0NCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
2149 hd0D0VSd0xd0NCotherpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
2150 hd0D0VSd0xd0NCotherpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
2151 flistNoCutsOther->Add(hd0D0VSd0xd0NCotherpt);
2154 namehist="hangletracksVSd0xd0NCother_pt";
2156 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} No Cuts Other ptbin=";
2158 hangletracksVSd0xd0NCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
2159 hangletracksVSd0xd0NCotherpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
2160 hangletracksVSd0xd0NCotherpt->SetYTitle(" angle between K and #p tracks [rad]");
2161 flistNoCutsOther->Add(hangletracksVSd0xd0NCotherpt);
2164 namehist="hangletracksVSd0D0NCother_pt";
2166 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} No Cuts Other ptbin=";
2168 hangletracksVSd0D0NCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
2169 hangletracksVSd0D0NCotherpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
2170 hangletracksVSd0D0NCotherpt->SetYTitle(" angle between K and #p tracks [rad]");
2171 flistNoCutsOther->Add(hangletracksVSd0D0NCotherpt);
2174 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
2175 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2180 //############# d0 D0 histos ###############Ã
2181 TH1F *hd0D0NCotherPM = new TH1F("hd0D0NCotherPM","D^{0} impact par. plot , No Cuts ,Other,Mass Peak (All momenta)",1000,-1000.,1000.);
2182 hd0D0NCotherPM->SetXTitle("Impact parameter [#mum]");
2183 hd0D0NCotherPM->SetYTitle("Entries");
2185 TH1F *hd0D0VtxTrueNCotherPM = new TH1F("hd0D0VtxTrueNCotherPM","D^{0} impact par. w.r.t. True Vtx, No Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
2186 hd0D0VtxTrueNCotherPM->SetXTitle("Impact parameter [#mum]");
2187 hd0D0VtxTrueNCotherPM->SetYTitle("Entries");
2189 TH1F *hMCd0D0NCotherPM = new TH1F("hMCd0D0NCotherPM","D^{0} impact par. plot, No Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
2190 hMCd0D0NCotherPM->SetXTitle("MC Impact parameter [#mum]");
2191 hMCd0D0NCotherPM->SetYTitle("Entries");
2193 TH1F *hd0D0NCotherSB = new TH1F("hd0D0NCotherSB","D^{0} impact par. plot , No Cuts ,Other,Mass Peak (All momenta)",1000,-1000.,1000.);
2194 hd0D0NCotherSB->SetXTitle("Impact parameter [#mum]");
2195 hd0D0NCotherSB->SetYTitle("Entries");
2197 TH1F *hd0D0VtxTrueNCotherSB = new TH1F("hd0D0VtxTrueNCotherSB","D^{0} impact par. w.r.t. True Vtx, No Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
2198 hd0D0VtxTrueNCotherSB->SetXTitle("Impact parameter [#mum]");
2199 hd0D0VtxTrueNCotherSB->SetYTitle("Entries");
2201 TH1F *hMCd0D0NCotherSB = new TH1F("hMCd0D0NCotherSB","D^{0} impact par. plot, No Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
2202 hMCd0D0NCotherSB->SetXTitle("MC Impact parameter [#mum]");
2203 hMCd0D0NCotherSB->SetYTitle("Entries");
2205 flistNoCutsOther->Add(hd0D0NCotherPM);
2206 flistNoCutsOther->Add(hd0D0VtxTrueNCotherPM);
2207 flistNoCutsOther->Add(hMCd0D0NCotherPM);
2208 flistNoCutsOther->Add(hd0D0NCotherSB);
2209 flistNoCutsOther->Add(hd0D0VtxTrueNCotherSB);
2210 flistNoCutsOther->Add(hMCd0D0NCotherSB);
2212 TH1F *hd0D0ptNCotherPM;
2213 TH1F *hMCd0D0ptNCotherPM;
2214 TH1F *hd0D0VtxTrueptNCotherPM;
2215 TH1F *hd0D0ptNCotherSB;
2216 TH1F *hMCd0D0ptNCotherSB;
2217 TH1F *hd0D0VtxTrueptNCotherSB;
2218 namehist="hd0D0ptNCother_";
2219 titlehist="D^{0} impact par. plot, No Cuts, Other, ";
2220 for(Int_t i=0;i<fnbins;i++){
2222 strnamept.Append("PkMss_pt");
2225 strtitlept=titlehist;
2226 strtitlept.Append(" Mass Peak, ");
2227 strtitlept+=fptbins[i];
2228 strtitlept.Append("<= pt <");
2229 strtitlept+=fptbins[i+1];
2230 strtitlept.Append(" [GeV/c]");
2232 hd0D0ptNCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2233 hd0D0ptNCotherPM->SetXTitle("Impact parameter [#mum] ");
2234 hd0D0ptNCotherPM->SetYTitle("Entries");
2235 flistNoCutsOther->Add(hd0D0ptNCotherPM);
2237 strnamept.ReplaceAll("hd0D0","hMCd0D0");
2238 hMCd0D0ptNCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2239 hMCd0D0ptNCotherPM->SetXTitle("MC Impact parameter [#mum] ");
2240 hMCd0D0ptNCotherPM->SetYTitle("Entries");
2241 flistNoCutsOther->Add(hMCd0D0ptNCotherPM);
2244 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
2245 hd0D0VtxTrueptNCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2246 hd0D0VtxTrueptNCotherPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
2247 hd0D0VtxTrueptNCotherPM->SetYTitle("Entries");
2248 flistNoCutsOther->Add(hd0D0VtxTrueptNCotherPM);
2251 strnamept.Append("SBMss_pt");
2254 strtitlept=titlehist;
2255 strtitlept.Append(" Side Bands, ");
2256 strtitlept+=fptbins[i];
2257 strtitlept.Append("<= pt <");
2258 strtitlept+=fptbins[i+1];
2259 strtitlept.Append(" [GeV/c]");
2261 hd0D0ptNCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2262 hd0D0ptNCotherSB->SetXTitle("Impact parameter [#mum] ");
2263 hd0D0ptNCotherSB->SetYTitle("Entries");
2264 flistNoCutsOther->Add(hd0D0ptNCotherSB);
2266 strnamept.ReplaceAll("hd0D0","hMCd0D0");
2267 hMCd0D0ptNCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2268 hMCd0D0ptNCotherSB->SetXTitle("MC Impact parameter [#mum] ");
2269 hMCd0D0ptNCotherSB->SetYTitle("Entries");
2270 flistNoCutsOther->Add(hMCd0D0ptNCotherSB);
2272 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
2273 hd0D0VtxTrueptNCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2274 hd0D0VtxTrueptNCotherSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
2275 hd0D0VtxTrueptNCotherSB->SetYTitle("Entries");
2276 flistNoCutsOther->Add(hd0D0VtxTrueptNCotherSB);
2280 //################################################################################################
2282 // HISTOS FOR LOOSE CUTS #
2284 //################################################################################################
2286 //############ LOOSE CUTS SIGNAL HISTOGRAMS ###############
2288 // ####### global properties histo ############
2290 TH2F *hCPtaVSd0d0LSCsign=new TH2F("hCPtaVSd0d0LSCsign","hCPtaVSd0d0_LooseCuts_Signal",1000,-100000.,100000.,100,-1.,1.);
2291 TH1F *hSecVtxZLSCsign=new TH1F("hSecVtxZLSCsign","hSecVtxZ_LooseCuts_Signal",1000,-8.,8.);
2292 TH1F *hSecVtxXLSCsign=new TH1F("hSecVtxXLSCsign","hSecVtxX_LooseCuts_Signal",1000,-3000.,3000.);
2293 TH1F *hSecVtxYLSCsign=new TH1F("hSecVtxYLSCsign","hSecVtxY_LooseCuts_Signal",1000,-3000.,3000.);
2294 TH2F *hSecVtxXYLSCsign=new TH2F("hSecVtxXYLSCsign","hSecVtxXY_LooseCuts_Signal",1000,-3000.,3000.,1000,-3000.,3000.);
2295 TH1F *hSecVtxPhiLSCsign=new TH1F("hSecVtxPhiLSCsign","hSecVtxPhi_LooseCuts_Signal",180,-180.1,180.1);
2296 TH1F *hd0singlTrackLSCsign=new TH1F("hd0singlTrackLSCsign","hd0singlTrackLooseCuts_Signal",1000,-5000.,5000.);
2297 TH1F *hCPtaLSCsign=new TH1F("hCPtaLSCsign","hCPta_LooseCuts_Signal",100,-1.,1.);
2298 TH1F *hd0xd0LSCsign=new TH1F("hd0xd0LSCsign","hd0xd0_LooseCuts_Signal",1000,-100000.,100000.);
2299 TH1F *hMassTrueLSCsign=new TH1F("hMassTrueLSCsign","D^{0} MC inv. Mass Loose Cuts Signal(All momenta)",600,1.600,2.200);
2300 TH1F *hMassLSCsign=new TH1F("hMassLSCsign","D^{0} inv. Mass Loose Cuts Signal (All momenta)",600,1.600,2.200);
2301 hMassLSCsign->Sumw2();
2302 TH1F *hMassTrueLSCsignPM=new TH1F("hMassTrueLSCsignPM","D^{0} MC inv. Mass Loose Cuts Signal, Mass Peak. (All momenta)",600,1.600,2.200);
2303 TH1F *hMassLSCsignPM=new TH1F("hMassLSCsignPM","D^{0} inv. Mass Loose Cuts Signal (All momenta), MassPeak",600,1.600,2.200);
2304 hMassLSCsignPM->Sumw2();
2305 TH1F *hMassTrueLSCsignSB=new TH1F("hMassTrueLSCsignSB","D^{0} MC inv. Mass in Side Bands Loose Cuts Signal(All momenta)",600,1.600,2.200);
2306 TH1F *hMassLSCsignSB=new TH1F("hMassLSCsignSB","D^{0} inv. Mass in Side Bands Loose Cuts Signal (All momenta)",600,1.600,2.200);
2307 hMassLSCsignSB->Sumw2();
2309 flistLsCutsSignal->Add(hCPtaVSd0d0LSCsign);
2310 flistLsCutsSignal->Add(hSecVtxZLSCsign);
2311 flistLsCutsSignal->Add(hSecVtxYLSCsign);
2312 flistLsCutsSignal->Add(hSecVtxXLSCsign);
2313 flistLsCutsSignal->Add(hSecVtxXYLSCsign);
2314 flistLsCutsSignal->Add(hSecVtxPhiLSCsign);
2315 flistLsCutsSignal->Add(hd0singlTrackLSCsign);
2316 flistLsCutsSignal->Add(hCPtaLSCsign);
2317 flistLsCutsSignal->Add(hd0xd0LSCsign);
2318 flistLsCutsSignal->Add(hMassTrueLSCsign);
2319 flistLsCutsSignal->Add(hMassLSCsign);
2320 flistLsCutsSignal->Add(hMassTrueLSCsignPM);
2321 flistLsCutsSignal->Add(hMassLSCsignPM);
2322 flistLsCutsSignal->Add(hMassTrueLSCsignSB);
2323 flistLsCutsSignal->Add(hMassLSCsignSB);
2326 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
2327 TH1F *hdcaLSCsign=new TH1F("hdcaLSCsign","hdca_LooseCuts_Sign",100,0.,1000.);
2328 hdcaLSCsign->SetXTitle("dca [#mum]");
2329 hdcaLSCsign->SetYTitle("Entries");
2330 TH1F *hcosthetastarLSCsign=new TH1F("hcosthetastarLSCsign","hCosThetaStar_LooseCuts_Sign",50,-1.,1.);
2331 hcosthetastarLSCsign->SetXTitle("cos #theta^{*}");
2332 hcosthetastarLSCsign->SetYTitle("Entries");
2333 TH1F *hptD0LSCsign=new TH1F("hptD0LSCsign","D^{0} transverse momentum distribution",34,ptbinsD0arr);
2334 hptD0LSCsign->SetXTitle("p_{t} [GeV/c]");
2335 hptD0LSCsign->SetYTitle("Entries");
2336 TH1F *hptD0VsMaxPtLSCsign=new TH1F("hptD0VsMaxPtLSCsign","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
2337 TH2F *hptD0PTallsqrtLSCsign=new TH2F("hptD0PTallsqrtLSCsign","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
2338 TH2F *hptD0PTallLSCsign=new TH2F("hptD0PTallLSCsign","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
2339 TH2F *hptD0vsptBLSCsign=new TH2F("hptD0vsptBLSCsign","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2340 TH2F *hpD0vspBLSCsign=new TH2F("hpD0vspBLSCsign","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2341 TH2F *hptD0vsptcquarkLSCsign=new TH2F("hptD0vsptcquarkLSCsign","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2342 TH2F *hpD0vspcquarkLSCsign=new TH2F("hpD0vspcquarkLSCsign","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2343 flistLsCutsSignal->Add(hdcaLSCsign);
2344 flistLsCutsSignal->Add(hcosthetastarLSCsign);
2345 flistLsCutsSignal->Add(hptD0LSCsign);
2346 flistLsCutsSignal->Add(hptD0VsMaxPtLSCsign);
2347 flistLsCutsSignal->Add(hptD0PTallsqrtLSCsign);
2348 flistLsCutsSignal->Add(hptD0PTallLSCsign);
2349 flistLsCutsSignal->Add(hptD0vsptBLSCsign);
2350 flistLsCutsSignal->Add(hpD0vspBLSCsign);
2351 flistLsCutsSignal->Add(hptD0vsptcquarkLSCsign);
2352 flistLsCutsSignal->Add(hpD0vspcquarkLSCsign);
2354 TH1F *hd0zD0ptLSCsign;
2355 TH1F *hInvMassD0LSCsign,*hInvMassD0barLSCsign;
2356 TH2F *hInvMassPtLSCsign=new TH2F("hInvMassPtLSCsign","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
2357 THnSparseF *hSparseLSCsign=new THnSparseF("hSparseLSCsign","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
2358 hSparseLSCsign->SetBinEdges(0,massbins);
2359 hSparseLSCsign->SetBinEdges(1,massbins);
2360 hSparseLSCsign->SetBinEdges(2,ptbinsForNsparse);
2361 hSparseLSCsign->SetBinEdges(3,impparbins);
2362 hSparseLSCsign->SetBinEdges(4,massHypoBins);
2363 flistLsCutsSignal->Add(hSparseLSCsign);
2365 TH1F *hCosPDPBLSCsign;
2366 TH1F *hCosPcPDLSCsign;
2367 flistLsCutsSignal->Add(hInvMassPtLSCsign);
2371 THnSparseF *hSparseCxyLxyLSCsign=new THnSparseF("hSparseCxyLxyLSCsign","Candidate Mass;massD0;Pt;CosXY;Lxy",4,nbinsSparsCxyLxy,binLowLimitSparseCxyLxy,binUpLimitSparseCxyLxy);
2372 hSparseCxyLxyLSCsign->SetBinEdges(1,ptbinlimitsCxyLxy);
2373 hSparseCxyLxyLSCsign->GetAxis(0)->SetName("mass");
2374 hSparseCxyLxyLSCsign->GetAxis(0)->SetTitle("Invariant Mass (K#pi) [GeV/c^{2}]");
2375 hSparseCxyLxyLSCsign->GetAxis(1)->SetName("pt");
2376 hSparseCxyLxyLSCsign->GetAxis(1)->SetTitle("p_{t} [GeV/c]");
2377 hSparseCxyLxyLSCsign->GetAxis(2)->SetName("CosPointXY");
2378 hSparseCxyLxyLSCsign->GetAxis(2)->SetTitle("Cos#theta_{point}^{XY}");
2379 hSparseCxyLxyLSCsign->GetAxis(3)->SetName("NormDecLengthXY");
2380 hSparseCxyLxyLSCsign->GetAxis(3)->SetTitle("Normalized XY decay length");
2382 flistLsCutsSignal->Add(hSparseCxyLxyLSCsign);
2383 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
2384 TH2F *hd0D0VSd0xd0LSCsignpt;
2385 TH2F *hangletracksVSd0xd0LSCsignpt;
2386 TH2F *hangletracksVSd0D0LSCsignpt;
2387 TH1F *hd0xd0LSCsignpt;
2388 TH1F *hPhiHistPMLSCsignpt,*hPhiHistSBLSCsignpt;
2390 TH2F *hTOFpidLSCsign=new TH2F("hTOFpidLSCsign","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
2391 flistLsCutsSignal->Add(hTOFpidLSCsign);
2393 for(Int_t i=0;i<fnbins;i++){
2395 namehist="hPhiHistPMLSCsign_pt";
2397 titlehist="Azimuthal correlation LS Cuts Sign PM ptbin=";
2399 hPhiHistPMLSCsignpt=new TH1F(namehist.Data(),titlehist.Data(),100,-3.15,3.15);
2400 hPhiHistPMLSCsignpt->Sumw2();
2401 flistLsCutsSignal->Add(hPhiHistPMLSCsignpt);
2403 namehist="hPhiHistSBLSCsign_pt";
2405 titlehist="Azimuthal correlation LS Cuts Sign SB ptbin=";
2407 hPhiHistSBLSCsignpt=new TH1F(namehist.Data(),titlehist.Data(),100,-3.15,3.15);
2408 hPhiHistSBLSCsignpt->Sumw2();
2409 flistLsCutsSignal->Add(hPhiHistSBLSCsignpt);
2413 namehist="hd0zD0ptLSCsign_pt";
2415 titlehist="d0(z) Loose Cuts Signm ptbin=";
2417 hd0zD0ptLSCsign=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
2418 hd0zD0ptLSCsign->SetXTitle("d_{0}(z) [#mum]");
2419 hd0zD0ptLSCsign->SetYTitle("Entries");
2420 flistLsCutsSignal->Add(hd0zD0ptLSCsign);
2422 namehist="hInvMassD0LSCsign_pt";
2424 titlehist="Invariant Mass Loose Cuts Sign ptbin=";
2426 hInvMassD0LSCsign=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
2427 hInvMassD0LSCsign->SetXTitle("Invariant Mass [GeV]");
2428 hInvMassD0LSCsign->SetYTitle("Entries");
2429 flistLsCutsSignal->Add(hInvMassD0LSCsign);
2432 namehist="hInvMassD0barLSCsign_pt";
2434 titlehist="Invariant Mass D0bar Loose Cuts Signal ptbin=";
2436 hInvMassD0barLSCsign=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
2437 hInvMassD0barLSCsign->SetXTitle("Invariant Mass [GeV]");
2438 hInvMassD0barLSCsign->SetYTitle("Entries");
2439 flistLsCutsSignal->Add(hInvMassD0barLSCsign);
2441 namehist="hetaLSCsign_pt";
2443 titlehist="eta Loose Cuts Sign ptbin=";
2445 hetaLSCsign=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
2446 hetaLSCsign->SetXTitle("Pseudorapidity");
2447 hetaLSCsign->SetYTitle("Entries");
2448 flistLsCutsSignal->Add(hetaLSCsign);
2450 namehist="hCosPDPBLSCsign_pt";
2452 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
2454 hCosPDPBLSCsign=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
2455 hCosPDPBLSCsign->SetXTitle("Cosine between D0 momentum and B momentum");
2456 hCosPDPBLSCsign->SetYTitle("Entries");
2457 flistLsCutsSignal->Add(hCosPDPBLSCsign);
2459 namehist="hCosPcPDLSCsign_pt";
2461 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
2463 hCosPcPDLSCsign=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
2464 hCosPcPDLSCsign->SetXTitle("Cosine between c quark momentum and D0 momentum");
2465 hCosPcPDLSCsign->SetYTitle("Entries");
2466 flistLsCutsSignal->Add(hCosPcPDLSCsign);
2469 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
2470 namehist="hd0xd0LSCsign_pt";
2472 titlehist="d0xd0 Loose Cuts Sign ptbin=";
2474 hd0xd0LSCsignpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
2475 hd0xd0LSCsignpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
2476 hd0xd0LSCsignpt->SetYTitle("Entries");
2477 flistLsCutsSignal->Add(hd0xd0LSCsignpt);
2480 namehist="hd0D0VSd0xd0LSCsign_pt";
2482 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts Sign ptbin=";
2484 hd0D0VSd0xd0LSCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
2485 hd0D0VSd0xd0LSCsignpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
2486 hd0D0VSd0xd0LSCsignpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
2487 flistLsCutsSignal->Add(hd0D0VSd0xd0LSCsignpt);
2490 namehist="hangletracksVSd0xd0LSCsign_pt";
2492 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts Sign ptbin=";
2494 hangletracksVSd0xd0LSCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
2495 hangletracksVSd0xd0LSCsignpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
2496 hangletracksVSd0xd0LSCsignpt->SetYTitle(" angle between K and #p tracks [rad]");
2497 flistLsCutsSignal->Add(hangletracksVSd0xd0LSCsignpt);
2500 namehist="hangletracksVSd0D0LSCsign_pt";
2502 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Loose Cuts Sign ptbin=";
2504 hangletracksVSd0D0LSCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
2505 hangletracksVSd0D0LSCsignpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
2506 hangletracksVSd0D0LSCsignpt->SetYTitle(" angle between K and #p tracks [rad]");
2507 flistLsCutsSignal->Add(hangletracksVSd0D0LSCsignpt);
2511 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
2512 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2515 // ####### d0 D0 histos ############
2516 TH1F *hd0D0LSCsignPM = new TH1F("hd0D0LSCsignPM","D^{0} impact par. plot , Loose Cuts ,Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
2517 hd0D0LSCsignPM->SetXTitle("Impact parameter [#mum]");
2518 hd0D0LSCsignPM->SetYTitle("Entries");
2520 TH1F *hd0D0VtxTrueLSCsignPM = new TH1F("hd0D0VtxTrueLSCsignPM","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
2521 hd0D0VtxTrueLSCsignPM->SetXTitle("Impact parameter [#mum]");
2522 hd0D0VtxTrueLSCsignPM->SetYTitle("Entries");
2524 TH1F *hMCd0D0LSCsignPM = new TH1F("hMCd0D0LSCsignPM","D^{0} impact par. plot, Loose Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
2525 hMCd0D0LSCsignPM->SetXTitle("MC Impact parameter [#mum]");
2526 hMCd0D0LSCsignPM->SetYTitle("Entries");
2528 TH1F *hd0D0LSCsignSB = new TH1F("hd0D0LSCsignSB","D^{0} impact par. plot , Loose Cuts ,Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
2529 hd0D0LSCsignSB->SetXTitle("Impact parameter [#mum]");
2530 hd0D0LSCsignSB->SetYTitle("Entries");
2532 TH1F *hd0D0VtxTrueLSCsignSB = new TH1F("hd0D0VtxTrueLSCsignSB","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
2533 hd0D0VtxTrueLSCsignSB->SetXTitle("Impact parameter [#mum]");
2534 hd0D0VtxTrueLSCsignSB->SetYTitle("Entries");
2536 TH1F *hMCd0D0LSCsignSB = new TH1F("hMCd0D0LSCsignSB","D^{0} impact par. plot, Loose Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
2537 hMCd0D0LSCsignSB->SetXTitle("MC Impact parameter [#mum]");
2538 hMCd0D0LSCsignSB->SetYTitle("Entries");
2540 flistLsCutsSignal->Add(hd0D0LSCsignPM);
2541 flistLsCutsSignal->Add(hd0D0VtxTrueLSCsignPM);
2542 flistLsCutsSignal->Add(hMCd0D0LSCsignPM);
2543 flistLsCutsSignal->Add(hd0D0LSCsignSB);
2544 flistLsCutsSignal->Add(hd0D0VtxTrueLSCsignSB);
2545 flistLsCutsSignal->Add(hMCd0D0LSCsignSB);
2547 TH1F *hd0D0ptLSCsignPM;
2548 TH1F *hMCd0D0ptLSCsignPM;
2549 TH1F *hd0D0VtxTrueptLSCsignPM;
2550 TH1F *hd0D0ptLSCsignSB;
2551 TH1F *hMCd0D0ptLSCsignSB;
2552 TH1F *hd0D0VtxTrueptLSCsignSB;
2553 namehist="hd0D0ptLSCsign_";
2554 titlehist="D^{0} impact par. plot, Loose Cuts, Signal, ";
2555 for(Int_t i=0;i<fnbins;i++){
2557 strnamept.Append("PkMss_pt");
2560 strtitlept=titlehist;
2561 strtitlept.Append(" Mass Peak, ");
2562 strtitlept+=fptbins[i];
2563 strtitlept.Append("<= pt <");
2564 strtitlept+=fptbins[i+1];
2565 strtitlept.Append(" [GeV/c]");
2567 hd0D0ptLSCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2568 hd0D0ptLSCsignPM->SetXTitle("Impact parameter [#mum] ");
2569 hd0D0ptLSCsignPM->SetYTitle("Entries");
2570 flistLsCutsSignal->Add(hd0D0ptLSCsignPM);
2572 strnamept.ReplaceAll("hd0D0","hMCd0D0");
2573 hMCd0D0ptLSCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2574 hMCd0D0ptLSCsignPM->SetXTitle("MC Impact parameter [#mum] ");
2575 hMCd0D0ptLSCsignPM->SetYTitle("Entries");
2576 flistLsCutsSignal->Add(hMCd0D0ptLSCsignPM);
2579 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
2580 hd0D0VtxTrueptLSCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2581 hd0D0VtxTrueptLSCsignPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
2582 hd0D0VtxTrueptLSCsignPM->SetYTitle("Entries");
2583 flistLsCutsSignal->Add(hd0D0VtxTrueptLSCsignPM);
2586 strnamept.Append("SBMss_pt");
2589 strtitlept=titlehist;
2590 strtitlept.Append(" Side Bands, ");
2591 strtitlept+=fptbins[i];
2592 strtitlept.Append("<= pt <");
2593 strtitlept+=fptbins[i+1];
2594 strtitlept.Append(" [GeV/c]");
2596 hd0D0ptLSCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2597 hd0D0ptLSCsignSB->SetXTitle("Impact parameter [#mum] ");
2598 hd0D0ptLSCsignSB->SetYTitle("Entries");
2599 flistLsCutsSignal->Add(hd0D0ptLSCsignSB);
2601 strnamept.ReplaceAll("hd0D0","hMCd0D0");
2602 hMCd0D0ptLSCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2603 hMCd0D0ptLSCsignSB->SetXTitle("MC Impact parameter [#mum] ");
2604 hMCd0D0ptLSCsignSB->SetYTitle("Entries");
2605 flistLsCutsSignal->Add(hMCd0D0ptLSCsignSB);
2607 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
2608 hd0D0VtxTrueptLSCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2609 hd0D0VtxTrueptLSCsignSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
2610 hd0D0VtxTrueptLSCsignSB->SetYTitle("Entries");
2611 flistLsCutsSignal->Add(hd0D0VtxTrueptLSCsignSB);
2615 //############ LOOSE CUTS BACKGROUND HISTOGRAMS ###########
2617 // ######## global properties histos #######
2618 TH2F *hCPtaVSd0d0LSCback=new TH2F("hCPtaVSd0d0LSCback","hCPtaVSd0d0_LooseCuts_Background",1000,-100000.,100000.,100,-1.,1.);
2619 TH1F *hSecVtxZLSCback=new TH1F("hSecVtxZLSCback","hSecVtxZ_LooseCuts_Background",1000,-8.,8.);
2620 TH1F *hSecVtxXLSCback=new TH1F("hSecVtxXLSCback","hSecVtxX_LooseCuts_Background",1000,-3000.,3000.);
2621 TH1F *hSecVtxYLSCback=new TH1F("hSecVtxYLSCback","hSecVtxY_LooseCuts_Background",1000,-3000.,3000.);
2622 TH2F *hSecVtxXYLSCback=new TH2F("hSecVtxXYLSCback","hSecVtxXY_LooseCuts_Background",1000,-3000.,3000.,1000,-3000.,3000.);
2623 TH1F *hSecVtxPhiLSCback=new TH1F("hSecVtxPhiLSCback","hSecVtxPhi_LooseCuts_Background",180,-180.1,180.1);
2624 TH1F *hd0singlTrackLSCback=new TH1F("hd0singlTrackLSCback","hd0singlTrackLooseCuts_Back",1000,-5000.,5000.);
2625 TH1F *hCPtaLSCback=new TH1F("hCPtaLSCback","hCPta_LooseCuts_Background",100,-1.,1.);
2626 TH1F *hd0xd0LSCback=new TH1F("hd0xd0LSCback","hd0xd0_LooseCuts_Background",1000,-100000.,100000.);
2627 TH1F *hMassTrueLSCback=new TH1F("hMassTrueLSCback","D^{0} MC inv. Mass Loose Cuts Background(All momenta)",600,1.600,2.200);
2628 TH1F *hMassLSCback=new TH1F("hMassLSCback","D^{0} inv. Mass Loose Cuts Background (All momenta)",600,1.600,2.200);
2629 hMassLSCback->Sumw2();
2630 TH1F *hMassTrueLSCbackPM=new TH1F("hMassTrueLSCbackPM","D^{0} MC inv. Mass Loose Cuts Background, Mass Peak. (All momenta)",600,1.600,2.200);
2631 TH1F *hMassLSCbackPM=new TH1F("hMassLSCbackPM","D^{0} inv. Mass Loose Cuts Background (All momenta), MassPeak",600,1.600,2.200);
2632 hMassLSCbackPM->Sumw2();
2633 TH1F *hMassTrueLSCbackSB=new TH1F("hMassTrueLSCbackSB","D^{0} MC inv. Mass in Side Bands Loose Cuts Background(All momenta)",600,1.600,2.200);
2634 TH1F *hMassLSCbackSB=new TH1F("hMassLSCbackSB","D^{0} inv. Mass in Side Bands Loose Cuts Background (All momenta)",600,1.600,2.200);
2635 hMassLSCbackSB->Sumw2();
2637 flistLsCutsBack->Add(hCPtaVSd0d0LSCback);
2638 flistLsCutsBack->Add(hSecVtxZLSCback);
2639 flistLsCutsBack->Add(hSecVtxYLSCback);
2640 flistLsCutsBack->Add(hSecVtxXLSCback);
2641 flistLsCutsBack->Add(hSecVtxXYLSCback);
2642 flistLsCutsBack->Add(hSecVtxPhiLSCback);
2643 flistLsCutsBack->Add(hd0singlTrackLSCback);
2644 flistLsCutsBack->Add(hCPtaLSCback);
2645 flistLsCutsBack->Add(hd0xd0LSCback);
2646 flistLsCutsBack->Add(hMassTrueLSCback);
2647 flistLsCutsBack->Add(hMassLSCback);
2648 flistLsCutsBack->Add(hMassTrueLSCbackPM);
2649 flistLsCutsBack->Add(hMassLSCbackPM);
2650 flistLsCutsBack->Add(hMassTrueLSCbackSB);
2651 flistLsCutsBack->Add(hMassLSCbackSB);
2660 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
2661 TH1F *hdcaLSCback=new TH1F("hdcaLSCback","hdca_LooseCuts_Backgr",100,0.,1000.);
2662 hdcaLSCback->SetXTitle("dca [#mum]");
2663 hdcaLSCback->SetYTitle("Entries");
2664 TH1F *hcosthetastarLSCback=new TH1F("hcosthetastarLSCback","hCosThetaStar_LooseCuts_Backgr",50,-1.,1.);
2665 hcosthetastarLSCback->SetXTitle("cos #theta^{*}");
2666 hcosthetastarLSCback->SetYTitle("Entries");
2667 TH1F *hptD0LSCback=new TH1F("hptD0LSCback","D^{0} transverse momentum distribution",34,ptbinsD0arr);
2668 hptD0LSCback->SetXTitle("p_{t} [GeV/c]");
2669 hptD0LSCback->SetYTitle("Entries");
2670 TH1F *hptD0VsMaxPtLSCback=new TH1F("hptD0VsMaxPtLSCback","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
2671 TH2F *hptD0PTallsqrtLSCback=new TH2F("hptD0PTallsqrtLSCback","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
2672 TH2F *hptD0PTallLSCback=new TH2F("hptD0PTallLSCback","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
2673 TH2F *hptD0vsptBLSCback=new TH2F("hptD0vsptBLSCback","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2674 TH2F *hpD0vspBLSCback=new TH2F("hpD0vspBLSCback","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2675 TH2F *hptD0vsptcquarkLSCback=new TH2F("hptD0vsptcquarkLSCback","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2676 TH2F *hpD0vspcquarkLSCback=new TH2F("hpD0vspcquarkLSCback","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2677 flistLsCutsBack->Add(hdcaLSCback);
2678 flistLsCutsBack->Add(hcosthetastarLSCback);
2679 flistLsCutsBack->Add(hptD0LSCback);
2680 flistLsCutsBack->Add(hptD0VsMaxPtLSCback);
2681 flistLsCutsBack->Add(hptD0PTallsqrtLSCback);
2682 flistLsCutsBack->Add(hptD0PTallLSCback);
2683 flistLsCutsBack->Add(hptD0vsptBLSCback);
2684 flistLsCutsBack->Add(hpD0vspBLSCback);
2685 flistLsCutsBack->Add(hptD0vsptcquarkLSCback);
2686 flistLsCutsBack->Add(hpD0vspcquarkLSCback);
2688 TH1F *hd0zD0ptLSCback;
2689 TH1F *hInvMassD0LSCback,*hInvMassD0barLSCback;
2690 TH2F *hInvMassPtLSCback=new TH2F("hInvMassPtLSCback","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
2691 THnSparseF *hSparseLSCback=new THnSparseF("hSparseLSCback","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
2692 hSparseLSCback->SetBinEdges(0,massbins);
2693 hSparseLSCback->SetBinEdges(1,massbins);
2694 hSparseLSCback->SetBinEdges(2,ptbinsForNsparse);
2695 hSparseLSCback->SetBinEdges(3,impparbins);
2696 hSparseLSCback->SetBinEdges(4,massHypoBins);
2697 flistLsCutsBack->Add(hSparseLSCback);
2699 TH1F *hCosPDPBLSCback;
2700 TH1F *hCosPcPDLSCback;
2701 flistLsCutsBack->Add(hInvMassPtLSCback);
2702 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
2703 TH2F *hd0D0VSd0xd0LSCbackpt;
2704 TH2F *hangletracksVSd0xd0LSCbackpt;
2705 TH2F *hangletracksVSd0D0LSCbackpt;
2706 TH1F *hd0xd0LSCbackpt;
2708 TH2F *hTOFpidLSCback=new TH2F("hTOFpidLSCback","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
2709 flistLsCutsBack->Add(hTOFpidLSCback);
2711 for(Int_t i=0;i<fnbins;i++){
2712 namehist="hd0zD0ptLSCback_pt";
2714 titlehist="d0(z) Loose Cuts Backgr ptbin=";
2716 hd0zD0ptLSCback=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
2717 hd0zD0ptLSCback->SetXTitle("d_{0}(z) [#mum]");
2718 hd0zD0ptLSCback->SetYTitle("Entries");
2719 flistLsCutsBack->Add(hd0zD0ptLSCback);
2721 namehist="hInvMassD0LSCback_pt";
2723 titlehist="Invariant Mass Loose Cuts Backgr ptbin=";
2725 hInvMassD0LSCback=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
2726 hInvMassD0LSCback->SetXTitle("Invariant Mass [GeV]");
2727 hInvMassD0LSCback->SetYTitle("Entries");
2728 flistLsCutsBack->Add(hInvMassD0LSCback);
2730 namehist="hInvMassD0barLSCback_pt";
2732 titlehist="Invariant Mass D0bar Loose Cuts Back ptbin=";
2734 hInvMassD0barLSCback=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
2735 hInvMassD0barLSCback->SetXTitle("Invariant Mass [GeV]");
2736 hInvMassD0barLSCback->SetYTitle("Entries");
2737 flistLsCutsBack->Add(hInvMassD0barLSCback);
2740 namehist="hetaLSCback_pt";
2742 titlehist="eta Loose Cuts Backgr ptbin=";
2744 hetaLSCback=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
2745 hetaLSCback->SetXTitle("Pseudorapidity");
2746 hetaLSCback->SetYTitle("Entries");
2747 flistLsCutsBack->Add(hetaLSCback);
2749 namehist="hCosPDPBLSCback_pt";
2751 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
2753 hCosPDPBLSCback=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
2754 hCosPDPBLSCback->SetXTitle("Cosine between D0 momentum and B momentum");
2755 hCosPDPBLSCback->SetYTitle("Entries");
2756 flistLsCutsBack->Add(hCosPDPBLSCback);
2758 namehist="hCosPcPDLSCback_pt";
2760 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
2762 hCosPcPDLSCback=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
2763 hCosPcPDLSCback->SetXTitle("Cosine between c quark momentum and D0 momentum");
2764 hCosPcPDLSCback->SetYTitle("Entries");
2765 flistLsCutsBack->Add(hCosPcPDLSCback);
2767 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
2768 namehist="hd0xd0LSCback_pt";
2770 titlehist="d0xd0 Loose Cuts Back ptbin=";
2772 hd0xd0LSCbackpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
2773 hd0xd0LSCbackpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
2774 hd0xd0LSCbackpt->SetYTitle("Entries");
2775 flistLsCutsBack->Add(hd0xd0LSCbackpt);
2778 namehist="hd0D0VSd0xd0LSCback_pt";
2780 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts Back ptbin=";
2782 hd0D0VSd0xd0LSCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
2783 hd0D0VSd0xd0LSCbackpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
2784 hd0D0VSd0xd0LSCbackpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
2785 flistLsCutsBack->Add(hd0D0VSd0xd0LSCbackpt);
2788 namehist="hangletracksVSd0xd0LSCback_pt";
2790 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts Back ptbin=";
2792 hangletracksVSd0xd0LSCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
2793 hangletracksVSd0xd0LSCbackpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
2794 hangletracksVSd0xd0LSCbackpt->SetYTitle(" angle between K and #p tracks [rad]");
2795 flistLsCutsBack->Add(hangletracksVSd0xd0LSCbackpt);
2798 namehist="hangletracksVSd0D0LSCback_pt";
2800 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Loose Cuts Back ptbin=";
2802 hangletracksVSd0D0LSCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
2803 hangletracksVSd0D0LSCbackpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
2804 hangletracksVSd0D0LSCbackpt->SetYTitle(" angle between K and #p tracks [rad]");
2805 flistLsCutsBack->Add(hangletracksVSd0D0LSCbackpt);
2808 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
2809 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2817 // ####### d0 D0 histos ############
2819 TH1F *hd0D0LSCbackPM = new TH1F("hd0D0LSCbackPM","D^{0} impact par. plot , Loose Cuts ,Background,Mass Peak (All momenta)",1000,-1000.,1000.);
2820 hd0D0LSCbackPM->SetXTitle("Impact parameter [#mum]");
2821 hd0D0LSCbackPM->SetYTitle("Entries");
2823 TH1F *hd0D0VtxTrueLSCbackPM = new TH1F("hd0D0VtxTrueLSCbackPM","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
2824 hd0D0VtxTrueLSCbackPM->SetXTitle("Impact parameter [#mum]");
2825 hd0D0VtxTrueLSCbackPM->SetYTitle("Entries");
2827 TH1F *hMCd0D0LSCbackPM = new TH1F("hMCd0D0LSCbackPM","D^{0} impact par. plot, Loose Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
2828 hMCd0D0LSCbackPM->SetXTitle("MC Impact parameter [#mum]");
2829 hMCd0D0LSCbackPM->SetYTitle("Entries");
2831 TH1F *hd0D0LSCbackSB = new TH1F("hd0D0LSCbackSB","D^{0} impact par. plot , Loose Cuts ,Background,Mass Peak (All momenta)",1000,-1000.,1000.);
2832 hd0D0LSCbackSB->SetXTitle("Impact parameter [#mum]");
2833 hd0D0LSCbackSB->SetYTitle("Entries");
2835 TH1F *hd0D0VtxTrueLSCbackSB = new TH1F("hd0D0VtxTrueLSCbackSB","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
2836 hd0D0VtxTrueLSCbackSB->SetXTitle("Impact parameter [#mum]");
2837 hd0D0VtxTrueLSCbackSB->SetYTitle("Entries");
2839 TH1F *hMCd0D0LSCbackSB = new TH1F("hMCd0D0LSCbackSB","D^{0} impact par. plot, Loose Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
2840 hMCd0D0LSCbackSB->SetXTitle("MC Impact parameter [#mum]");
2841 hMCd0D0LSCbackSB->SetYTitle("Entries");
2843 flistLsCutsBack->Add(hd0D0LSCbackPM);
2844 flistLsCutsBack->Add(hd0D0VtxTrueLSCbackPM);
2845 flistLsCutsBack->Add(hMCd0D0LSCbackPM);
2846 flistLsCutsBack->Add(hd0D0LSCbackSB);
2847 flistLsCutsBack->Add(hd0D0VtxTrueLSCbackSB);
2848 flistLsCutsBack->Add(hMCd0D0LSCbackSB);
2850 TH1F *hd0D0ptLSCbackPM;
2851 TH1F *hMCd0D0ptLSCbackPM;
2852 TH1F *hd0D0VtxTrueptLSCbackPM;
2853 TH1F *hd0D0ptLSCbackSB;
2854 TH1F *hMCd0D0ptLSCbackSB;
2855 TH1F *hd0D0VtxTrueptLSCbackSB;
2856 namehist="hd0D0ptLSCback_";
2857 titlehist="D^{0} impact par. plot, Loose Cuts, Background, ";
2858 for(Int_t i=0;i<fnbins;i++){
2860 strnamept.Append("PkMss_pt");
2863 strtitlept=titlehist;
2864 strtitlept.Append(" Mass Peak, ");
2865 strtitlept+=fptbins[i];
2866 strtitlept.Append("<= pt <");
2867 strtitlept+=fptbins[i+1];
2868 strtitlept.Append(" [GeV/c]");
2870 hd0D0ptLSCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2871 hd0D0ptLSCbackPM->SetXTitle("Impact parameter [#mum] ");
2872 hd0D0ptLSCbackPM->SetYTitle("Entries");
2873 flistLsCutsBack->Add(hd0D0ptLSCbackPM);
2875 strnamept.ReplaceAll("hd0D0","hMCd0D0");
2876 hMCd0D0ptLSCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2877 hMCd0D0ptLSCbackPM->SetXTitle("MC Impact parameter [#mum] ");
2878 hMCd0D0ptLSCbackPM->SetYTitle("Entries");
2879 flistLsCutsBack->Add(hMCd0D0ptLSCbackPM);
2882 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
2883 hd0D0VtxTrueptLSCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2884 hd0D0VtxTrueptLSCbackPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
2885 hd0D0VtxTrueptLSCbackPM->SetYTitle("Entries");
2886 flistLsCutsBack->Add(hd0D0VtxTrueptLSCbackPM);
2889 strnamept.Append("SBMss_pt");
2892 strtitlept=titlehist;
2893 strtitlept.Append(" Side Bands, ");
2894 strtitlept+=fptbins[i];
2895 strtitlept.Append("<= pt <");
2896 strtitlept+=fptbins[i+1];
2897 strtitlept.Append(" [GeV/c]");
2899 hd0D0ptLSCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2900 hd0D0ptLSCbackSB->SetXTitle("Impact parameter [#mum] ");
2901 hd0D0ptLSCbackSB->SetYTitle("Entries");
2902 flistLsCutsBack->Add(hd0D0ptLSCbackSB);
2904 strnamept.ReplaceAll("hd0D0","hMCd0D0");
2905 hMCd0D0ptLSCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2906 hMCd0D0ptLSCbackSB->SetXTitle("MC Impact parameter [#mum] ");
2907 hMCd0D0ptLSCbackSB->SetYTitle("Entries");
2908 flistLsCutsBack->Add(hMCd0D0ptLSCbackSB);
2910 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
2911 hd0D0VtxTrueptLSCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2912 hd0D0VtxTrueptLSCbackSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
2913 hd0D0VtxTrueptLSCbackSB->SetYTitle("Entries");
2914 flistLsCutsBack->Add(hd0D0VtxTrueptLSCbackSB);
2919 //############ LOOSE CUTS FROMB HISTOGRAMS ###########
2921 //####### global properties histos
2923 TH2F *hCPtaVSd0d0LSCfromB=new TH2F("hCPtaVSd0d0LSCfromB","hCPtaVSd0d0_LooseCuts_FromB",1000,-100000.,100000.,100,-1.,1.);
2924 TH1F *hSecVtxZLSCfromB=new TH1F("hSecVtxZLSCfromB","hSecVtxZ_LooseCuts_FromB",1000,-8.,8.);
2925 TH1F *hSecVtxXLSCfromB=new TH1F("hSecVtxXLSCfromB","hSecVtxX_LooseCuts_FromB",1000,-3000.,3000.);
2926 TH1F *hSecVtxYLSCfromB=new TH1F("hSecVtxYLSCfromB","hSecVtxY_LooseCuts_FromB",1000,-3000.,3000.);
2927 TH2F *hSecVtxXYLSCfromB=new TH2F("hSecVtxXYLSCfromB","hSecVtxXY_LooseCuts_FromB",1000,-3000.,3000.,1000,-3000.,3000.);
2928 TH1F *hSecVtxPhiLSCfromB=new TH1F("hSecVtxPhiLSCfromB","hSecVtxPhi_LooseCuts_FromB",180,-180.1,180.1);
2929 TH1F *hd0singlTrackLSCfromB=new TH1F("hd0singlTrackLSCfromB","hd0singlTrackLooseCuts_FromB",1000,-5000.,5000.);
2930 TH1F *hCPtaLSCfromB=new TH1F("hCPtaLSCfromB","hCPta_LooseCuts_FromB",100,-1.,1.);
2931 TH1F *hd0xd0LSCfromB=new TH1F("hd0xd0LSCfromB","hd0xd0_LooseCuts_FromB",1000,-100000.,100000.);
2932 TH1F *hMassTrueLSCfromB=new TH1F("hMassTrueLSCfromB","D^{0} MC inv. Mass Loose Cuts FromB(All momenta)",600,1.600,2.200);
2933 TH1F *hMassLSCfromB=new TH1F("hMassLSCfromB","D^{0} inv. Mass Loose Cuts FromB (All momenta)",600,1.600,2.200);
2934 hMassLSCfromB->Sumw2();
2935 TH1F *hMassTrueLSCfromBPM=new TH1F("hMassTrueLSCfromBPM","D^{0} MC inv. Mass Loose Cuts FromB, Mass Peak. (All momenta)",600,1.600,2.200);
2936 TH1F *hMassLSCfromBPM=new TH1F("hMassLSCfromBPM","D^{0} inv. Mass Loose Cuts FromB (All momenta), MassPeak",600,1.600,2.200);
2937 hMassLSCfromBPM->Sumw2();
2938 TH1F *hMassTrueLSCfromBSB=new TH1F("hMassTrueLSCfromBSB","D^{0} MC inv. Mass in Side Bands Loose Cuts FromB(All momenta)",600,1.600,2.200);
2939 TH1F *hMassLSCfromBSB=new TH1F("hMassLSCfromBSB","D^{0} inv. Mass in Side Bands Loose Cuts FromB (All momenta)",600,1.600,2.200);
2940 hMassLSCfromBSB->Sumw2();
2942 flistLsCutsFromB->Add(hCPtaVSd0d0LSCfromB);
2943 flistLsCutsFromB->Add(hSecVtxZLSCfromB);
2944 flistLsCutsFromB->Add(hSecVtxYLSCfromB);
2945 flistLsCutsFromB->Add(hSecVtxXLSCfromB);
2946 flistLsCutsFromB->Add(hSecVtxXYLSCfromB);
2947 flistLsCutsFromB->Add(hSecVtxPhiLSCfromB);
2948 flistLsCutsFromB->Add(hd0singlTrackLSCfromB);
2949 flistLsCutsFromB->Add(hCPtaLSCfromB);
2950 flistLsCutsFromB->Add(hd0xd0LSCfromB);
2951 flistLsCutsFromB->Add(hMassTrueLSCfromB);
2952 flistLsCutsFromB->Add(hMassLSCfromB);
2953 flistLsCutsFromB->Add(hMassTrueLSCfromBPM);
2954 flistLsCutsFromB->Add(hMassLSCfromBPM);
2955 flistLsCutsFromB->Add(hMassTrueLSCfromBSB);
2956 flistLsCutsFromB->Add(hMassLSCfromBSB);
2961 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
2962 TH1F *hdcaLSCfromB=new TH1F("hdcaLSCfromB","hdca_LooseCuts_FromB",100,0.,1000.);
2963 hdcaLSCfromB->SetXTitle("dca [#mum]");
2964 hdcaLSCfromB->SetYTitle("Entries");
2965 TH1F *hcosthetastarLSCfromB=new TH1F("hcosthetastarLSCfromB","hCosThetaStar_LooseCuts_FromB",50,-1.,1.);
2966 hcosthetastarLSCfromB->SetXTitle("cos #theta^{*}");
2967 hcosthetastarLSCfromB->SetYTitle("Entries");
2968 TH1F *hptD0LSCfromB=new TH1F("hptD0LSCfromB","D^{0} transverse momentum distribution",34,ptbinsD0arr);
2969 hptD0LSCfromB->SetXTitle("p_{t} [GeV/c]");
2970 hptD0LSCfromB->SetYTitle("Entries");
2971 TH1F *hptD0VsMaxPtLSCfromB=new TH1F("hptD0VsMaxPtLSCfromB","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
2972 TH2F *hptD0PTallsqrtLSCfromB=new TH2F("hptD0PTallsqrtLSCfromB","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
2973 TH2F *hptD0PTallLSCfromB=new TH2F("hptD0PTallLSCfromB","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
2974 TH2F *hptD0vsptBLSCfromB=new TH2F("hptD0vsptBLSCfromB","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2975 TH2F *hpD0vspBLSCfromB=new TH2F("hpD0vspBLSCfromB","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2976 TH2F *hptD0vsptcquarkLSCfromB=new TH2F("hptD0vsptcquarkLSCfromB","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2977 TH2F *hpD0vspcquarkLSCfromB=new TH2F("hpD0vspcquarkLSCfromB","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2978 flistLsCutsFromB->Add(hdcaLSCfromB);
2979 flistLsCutsFromB->Add(hcosthetastarLSCfromB);
2980 flistLsCutsFromB->Add(hptD0LSCfromB);
2981 flistLsCutsFromB->Add(hptD0VsMaxPtLSCfromB);
2982 flistLsCutsFromB->Add(hptD0PTallsqrtLSCfromB);
2983 flistLsCutsFromB->Add(hptD0PTallLSCfromB);
2984 flistLsCutsFromB->Add(hptD0vsptBLSCfromB);
2985 flistLsCutsFromB->Add(hpD0vspBLSCfromB);
2986 flistLsCutsFromB->Add(hptD0vsptcquarkLSCfromB);
2987 flistLsCutsFromB->Add(hpD0vspcquarkLSCfromB);
2989 TH1F *hd0zD0ptLSCfromB;
2990 TH1F *hInvMassD0LSCfromB,*hInvMassD0barLSCfromB;
2991 TH2F *hInvMassPtLSCfromB=new TH2F("hInvMassPtLSCfromB","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
2992 THnSparseF *hSparseLSCfromB=new THnSparseF("hSparseLSCfromB","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
2993 hSparseLSCfromB->SetBinEdges(0,massbins);
2994 hSparseLSCfromB->SetBinEdges(1,massbins);
2995 hSparseLSCfromB->SetBinEdges(2,ptbinsForNsparse);
2996 hSparseLSCfromB->SetBinEdges(3,impparbins);
2997 hSparseLSCfromB->SetBinEdges(4,massHypoBins);
2998 flistLsCutsFromB->Add(hSparseLSCfromB);
3001 THnSparseF *hSparseRecoLSCfromB=new THnSparseF("hSparseRecoLSCfromB","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
3002 hSparseRecoLSCfromB->SetBinEdges(0,massbins);
3003 hSparseRecoLSCfromB->SetBinEdges(1,massbins);
3004 hSparseRecoLSCfromB->SetBinEdges(2,ptbinsForNsparse);
3005 hSparseRecoLSCfromB->SetBinEdges(3,impparbins);
3006 hSparseRecoLSCfromB->SetBinEdges(4,massHypoBins);
3007 flistLsCutsFromB->Add(hSparseRecoLSCfromB);
3011 TH1F *hCosPDPBLSCfromB;
3012 TH1F *hCosPcPDLSCfromB;
3013 flistLsCutsFromB->Add(hInvMassPtLSCfromB);
3014 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
3015 TH2F *hd0D0VSd0xd0LSCfromBpt;
3016 TH2F *hangletracksVSd0xd0LSCfromBpt;
3017 TH2F *hangletracksVSd0D0LSCfromBpt;
3018 TH1F *hd0xd0LSCfromBpt;
3021 TH2F *hTOFpidLSCfromB=new TH2F("hTOFpidLSCfromB","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
3022 flistLsCutsFromB->Add(hTOFpidLSCfromB);
3024 for(Int_t i=0;i<fnbins;i++){
3025 namehist="hd0zD0ptLSCfromB_pt";
3027 titlehist="d0(z) Loose Cuts FromBm ptbin=";
3029 hd0zD0ptLSCfromB=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
3030 hd0zD0ptLSCfromB->SetXTitle("d_{0}(z) [#mum]");
3031 hd0zD0ptLSCfromB->SetYTitle("Entries");
3032 flistLsCutsFromB->Add(hd0zD0ptLSCfromB);
3034 namehist="hInvMassD0LSCfromB_pt";
3036 titlehist="Invariant Mass Loose Cuts FromB ptbin=";
3038 hInvMassD0LSCfromB=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3039 hInvMassD0LSCfromB->SetXTitle("Invariant Mass [GeV]");
3040 hInvMassD0LSCfromB->SetYTitle("Entries");
3041 flistLsCutsFromB->Add(hInvMassD0LSCfromB);
3043 namehist="hInvMassD0barLSCfromB_pt";
3045 titlehist="Invariant Mass D0bar Loose Cuts FromB ptbin=";
3047 hInvMassD0barLSCfromB=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3048 hInvMassD0barLSCfromB->SetXTitle("Invariant Mass [GeV]");
3049 hInvMassD0barLSCfromB->SetYTitle("Entries");
3050 flistLsCutsFromB->Add(hInvMassD0barLSCfromB);
3052 namehist="hetaLSCfromB_pt";
3054 titlehist="eta Loose Cuts FromB ptbin=";
3056 hetaLSCfromB=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
3057 hetaLSCfromB->SetXTitle("Pseudorapidity");
3058 hetaLSCfromB->SetYTitle("Entries");
3059 flistLsCutsFromB->Add(hetaLSCfromB);
3061 namehist="hCosPDPBLSCfromB_pt";
3063 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
3065 hCosPDPBLSCfromB=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
3066 hCosPDPBLSCfromB->SetXTitle("Cosine between D0 momentum and B momentum");
3067 hCosPDPBLSCfromB->SetYTitle("Entries");
3068 flistLsCutsFromB->Add(hCosPDPBLSCfromB);
3070 namehist="hCosPcPDLSCfromB_pt";
3072 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
3074 hCosPcPDLSCfromB=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
3075 hCosPcPDLSCfromB->SetXTitle("Cosine between c quark momentum and D0 momentum");
3076 hCosPcPDLSCfromB->SetYTitle("Entries");
3077 flistLsCutsFromB->Add(hCosPcPDLSCfromB);
3079 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
3080 namehist="hd0xd0LSCfromB_pt";
3082 titlehist="d0xd0 Loose Cuts FromB ptbin=";
3084 hd0xd0LSCfromBpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
3085 hd0xd0LSCfromBpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
3086 hd0xd0LSCfromBpt->SetYTitle("Entries");
3087 flistLsCutsFromB->Add(hd0xd0LSCfromBpt);
3090 namehist="hd0D0VSd0xd0LSCfromB_pt";
3092 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts FromB ptbin=";
3094 hd0D0VSd0xd0LSCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
3095 hd0D0VSd0xd0LSCfromBpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
3096 hd0D0VSd0xd0LSCfromBpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
3097 flistLsCutsFromB->Add(hd0D0VSd0xd0LSCfromBpt);
3100 namehist="hangletracksVSd0xd0LSCfromB_pt";
3102 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts FromB ptbin=";
3104 hangletracksVSd0xd0LSCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
3105 hangletracksVSd0xd0LSCfromBpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
3106 hangletracksVSd0xd0LSCfromBpt->SetYTitle(" angle between K and #p tracks [rad]");
3107 flistLsCutsFromB->Add(hangletracksVSd0xd0LSCfromBpt);
3110 namehist="hangletracksVSd0D0LSCfromB_pt";
3112 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Loose Cuts FromB ptbin=";
3114 hangletracksVSd0D0LSCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
3115 hangletracksVSd0D0LSCfromBpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
3116 hangletracksVSd0D0LSCfromBpt->SetYTitle(" angle between K and #p tracks [rad]");
3117 flistLsCutsFromB->Add(hangletracksVSd0D0LSCfromBpt);
3120 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
3121 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3127 // ######### d0 D0 histos ##############
3128 TH1F *hd0D0LSCfromBPM = new TH1F("hd0D0LSCfromBPM","D^{0} impact par. plot , Loose Cuts ,FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
3129 hd0D0LSCfromBPM->SetXTitle("Impact parameter [#mum]");
3130 hd0D0LSCfromBPM->SetYTitle("Entries");
3132 TH1F *hd0D0VtxTrueLSCfromBPM = new TH1F("hd0D0VtxTrueLSCfromBPM","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
3133 hd0D0VtxTrueLSCfromBPM->SetXTitle("Impact parameter [#mum]");
3134 hd0D0VtxTrueLSCfromBPM->SetYTitle("Entries");
3136 TH1F *hMCd0D0LSCfromBPM = new TH1F("hMCd0D0LSCfromBPM","D^{0} impact par. plot, Loose Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
3137 hMCd0D0LSCfromBPM->SetXTitle("MC Impact parameter [#mum]");
3138 hMCd0D0LSCfromBPM->SetYTitle("Entries");
3140 TH1F *hd0D0LSCfromBSB = new TH1F("hd0D0LSCfromBSB","D^{0} impact par. plot , Loose Cuts ,FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
3141 hd0D0LSCfromBSB->SetXTitle("Impact parameter [#mum]");
3142 hd0D0LSCfromBSB->SetYTitle("Entries");
3144 TH1F *hd0D0VtxTrueLSCfromBSB = new TH1F("hd0D0VtxTrueLSCfromBSB","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
3145 hd0D0VtxTrueLSCfromBSB->SetXTitle("Impact parameter [#mum]");
3146 hd0D0VtxTrueLSCfromBSB->SetYTitle("Entries");
3148 TH1F *hMCd0D0LSCfromBSB = new TH1F("hMCd0D0LSCfromBSB","D^{0} impact par. plot, Loose Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
3149 hMCd0D0LSCfromBSB->SetXTitle("MC Impact parameter [#mum]");
3150 hMCd0D0LSCfromBSB->SetYTitle("Entries");
3152 flistLsCutsFromB->Add(hd0D0LSCfromBPM);
3153 flistLsCutsFromB->Add(hd0D0VtxTrueLSCfromBPM);
3154 flistLsCutsFromB->Add(hMCd0D0LSCfromBPM);
3155 flistLsCutsFromB->Add(hd0D0LSCfromBSB);
3156 flistLsCutsFromB->Add(hd0D0VtxTrueLSCfromBSB);
3157 flistLsCutsFromB->Add(hMCd0D0LSCfromBSB);
3159 TH1F *hd0D0ptLSCfromBPM;
3160 TH1F *hMCd0D0ptLSCfromBPM;
3161 TH1F *hd0D0VtxTrueptLSCfromBPM;
3162 TH1F *hd0D0ptLSCfromBSB;
3163 TH1F *hMCd0D0ptLSCfromBSB;
3164 TH1F *hd0D0VtxTrueptLSCfromBSB;
3165 namehist="hd0D0ptLSCfromB_";
3166 titlehist="D^{0} impact par. plot, Loose Cuts, FromB, ";
3167 for(Int_t i=0;i<fnbins;i++){
3169 strnamept.Append("PkMss_pt");
3172 strtitlept=titlehist;
3173 strtitlept.Append(" Mass Peak, ");
3174 strtitlept+=fptbins[i];
3175 strtitlept.Append("<= pt <");
3176 strtitlept+=fptbins[i+1];
3177 strtitlept.Append(" [GeV/c]");
3179 hd0D0ptLSCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3180 hd0D0ptLSCfromBPM->SetXTitle("Impact parameter [#mum] ");
3181 hd0D0ptLSCfromBPM->SetYTitle("Entries");
3182 flistLsCutsFromB->Add(hd0D0ptLSCfromBPM);
3184 strnamept.ReplaceAll("hd0D0","hMCd0D0");
3185 hMCd0D0ptLSCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3186 hMCd0D0ptLSCfromBPM->SetXTitle("MC Impact parameter [#mum] ");
3187 hMCd0D0ptLSCfromBPM->SetYTitle("Entries");
3188 flistLsCutsFromB->Add(hMCd0D0ptLSCfromBPM);
3191 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
3192 hd0D0VtxTrueptLSCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3193 hd0D0VtxTrueptLSCfromBPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
3194 hd0D0VtxTrueptLSCfromBPM->SetYTitle("Entries");
3195 flistLsCutsFromB->Add(hd0D0VtxTrueptLSCfromBPM);
3198 strnamept.Append("SBMss_pt");
3201 strtitlept=titlehist;
3202 strtitlept.Append(" Side Bands, ");
3203 strtitlept+=fptbins[i];
3204 strtitlept.Append("<= pt <");
3205 strtitlept+=fptbins[i+1];
3206 strtitlept.Append(" [GeV/c]");
3208 hd0D0ptLSCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3209 hd0D0ptLSCfromBSB->SetXTitle("Impact parameter [#mum] ");
3210 hd0D0ptLSCfromBSB->SetYTitle("Entries");
3211 flistLsCutsFromB->Add(hd0D0ptLSCfromBSB);
3213 strnamept.ReplaceAll("hd0D0","hMCd0D0");
3214 hMCd0D0ptLSCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3215 hMCd0D0ptLSCfromBSB->SetXTitle("MC Impact parameter [#mum] ");
3216 hMCd0D0ptLSCfromBSB->SetYTitle("Entries");
3217 flistLsCutsFromB->Add(hMCd0D0ptLSCfromBSB);
3219 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
3220 hd0D0VtxTrueptLSCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3221 hd0D0VtxTrueptLSCfromBSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
3222 hd0D0VtxTrueptLSCfromBSB->SetYTitle("Entries");
3223 flistLsCutsFromB->Add(hd0D0VtxTrueptLSCfromBSB);
3228 //############ LOOSE CUTS FROM DSTAR HISTOGRAMS ###########
3230 //############## global properties histos
3231 TH2F *hCPtaVSd0d0LSCfromDstar=new TH2F("hCPtaVSd0d0LSCfromDstar","hCPtaVSd0d0_LooseCuts_FromDStar",1000,-100000.,100000.,100,-1.,1.);
3232 TH1F *hSecVtxZLSCfromDstar=new TH1F("hSecVtxZLSCfromDstar","hSecVtxZ_LooseCuts_FromDStar",1000,-8.,8.);
3233 TH1F *hSecVtxXLSCfromDstar=new TH1F("hSecVtxXLSCfromDstar","hSecVtxX_LooseCuts_FromDStar",1000,-3000.,3000.);
3234 TH1F *hSecVtxYLSCfromDstar=new TH1F("hSecVtxYLSCfromDstar","hSecVtxY_LooseCuts_FromDStar",1000,-3000.,3000.);
3235 TH2F *hSecVtxXYLSCfromDstar=new TH2F("hSecVtxXYLSCfromDstar","hSecVtxXY_LooseCuts_FromDStar",1000,-3000.,3000.,1000,-3000.,3000.);
3236 TH1F *hSecVtxPhiLSCfromDstar=new TH1F("hSecVtxPhiLSCfromDstar","hSecVtxPhi_LooseCuts_FromDStar",180,-180.1,180.1);
3237 TH1F *hd0singlTrackLSCfromDstar=new TH1F("hd0singlTrackLSCfromDstar","hd0singlTrackLooseCuts_FromDstar",1000,-5000.,5000.);
3238 TH1F *hCPtaLSCfromDstar=new TH1F("hCPtaLSCfromDstar","hCPta_LooseCuts_FromDStar",100,-1.,1.);
3239 TH1F *hd0xd0LSCfromDstar=new TH1F("hd0xd0LSCfromDstar","hd0xd0_LooseCuts_FromDStar",1000,-100000.,100000.);
3240 TH1F *hMassTrueLSCfromDstar=new TH1F("hMassTrueLSCfromDstar","D^{0} MC inv. Mass Loose Cuts FromDStar(All momenta)",600,1.600,2.200);
3241 TH1F *hMassLSCfromDstar=new TH1F("hMassLSCfromDstar","D^{0} inv. Mass Loose Cuts FromDStar (All momenta)",600,1.600,2.200);
3242 hMassLSCfromDstar->Sumw2();
3243 TH1F *hMassTrueLSCfromDstarPM=new TH1F("hMassTrueLSCfromDstarPM","D^{0} MC inv. Mass Loose Cuts FromDStar, Mass Peak. (All momenta)",600,1.600,2.200);
3244 TH1F *hMassLSCfromDstarPM=new TH1F("hMassLSCfromDstarPM","D^{0} inv. Mass Loose Cuts FromDStar (All momenta), MassPeak",600,1.600,2.200);
3245 hMassLSCfromDstarPM->Sumw2();
3246 TH1F *hMassTrueLSCfromDstarSB=new TH1F("hMassTrueLSCfromDstarSB","D^{0} MC inv. Mass in Side Bands Loose Cuts FromDStar(All momenta)",600,1.600,2.200);
3247 TH1F *hMassLSCfromDstarSB=new TH1F("hMassLSCfromDstarSB","D^{0} inv. Mass in Side Bands Loose Cuts FromDStar (All momenta)",600,1.600,2.200);
3248 hMassLSCfromDstarSB->Sumw2();
3250 flistLsCutsFromDstar->Add(hCPtaVSd0d0LSCfromDstar);
3251 flistLsCutsFromDstar->Add(hSecVtxZLSCfromDstar);
3252 flistLsCutsFromDstar->Add(hSecVtxYLSCfromDstar);
3253 flistLsCutsFromDstar->Add(hSecVtxXLSCfromDstar);
3254 flistLsCutsFromDstar->Add(hSecVtxXYLSCfromDstar);
3255 flistLsCutsFromDstar->Add(hSecVtxPhiLSCfromDstar);
3256 flistLsCutsFromDstar->Add(hd0singlTrackLSCfromDstar);
3257 flistLsCutsFromDstar->Add(hCPtaLSCfromDstar);
3258 flistLsCutsFromDstar->Add(hd0xd0LSCfromDstar);
3259 flistLsCutsFromDstar->Add(hMassTrueLSCfromDstar);
3260 flistLsCutsFromDstar->Add(hMassLSCfromDstar);
3261 flistLsCutsFromDstar->Add(hMassTrueLSCfromDstarPM);
3262 flistLsCutsFromDstar->Add(hMassLSCfromDstarPM);
3263 flistLsCutsFromDstar->Add(hMassTrueLSCfromDstarSB);
3264 flistLsCutsFromDstar->Add(hMassLSCfromDstarSB);
3272 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
3273 TH1F *hdcaLSCfromDstar=new TH1F("hdcaLSCfromDstar","hdca_LooseCuts_FromDstar",100,0.,1000.);
3274 hdcaLSCfromDstar->SetXTitle("dca [#mum]");
3275 hdcaLSCfromDstar->SetYTitle("Entries");
3276 TH1F *hcosthetastarLSCfromDstar=new TH1F("hcosthetastarLSCfromDstar","hCosThetaStar_LooseCuts_FromDstar",50,-1.,1.);
3277 hcosthetastarLSCfromDstar->SetXTitle("cos #theta^{*}");
3278 hcosthetastarLSCfromDstar->SetYTitle("Entries");
3279 TH1F *hptD0LSCfromDstar=new TH1F("hptD0LSCfromDstar","D^{0} transverse momentum distribution",34,ptbinsD0arr);
3280 hptD0LSCfromDstar->SetXTitle("p_{t} [GeV/c]");
3281 hptD0LSCfromDstar->SetYTitle("Entries");
3282 TH1F *hptD0VsMaxPtLSCfromDstar=new TH1F("hptD0VsMaxPtLSCfromDstar","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
3283 TH2F *hptD0PTallsqrtLSCfromDstar=new TH2F("hptD0PTallsqrtLSCfromDstar","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
3284 TH2F *hptD0PTallLSCfromDstar=new TH2F("hptD0PTallLSCfromDstar","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
3285 TH2F *hptD0vsptBLSCfromDstar=new TH2F("hptD0vsptBLSCfromDstar","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3286 TH2F *hpD0vspBLSCfromDstar=new TH2F("hpD0vspBLSCfromDstar","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3287 TH2F *hptD0vsptcquarkLSCfromDstar=new TH2F("hptD0vsptcquarkLSCfromDstar","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3288 TH2F *hpD0vspcquarkLSCfromDstar=new TH2F("hpD0vspcquarkLSCfromDstar","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3289 flistLsCutsFromDstar->Add(hdcaLSCfromDstar);
3290 flistLsCutsFromDstar->Add(hcosthetastarLSCfromDstar);
3291 flistLsCutsFromDstar->Add(hptD0LSCfromDstar);
3292 flistLsCutsFromDstar->Add(hptD0VsMaxPtLSCfromDstar);
3293 flistLsCutsFromDstar->Add(hptD0PTallsqrtLSCfromDstar);
3294 flistLsCutsFromDstar->Add(hptD0PTallLSCfromDstar);
3295 flistLsCutsFromDstar->Add(hptD0vsptBLSCfromDstar);
3296 flistLsCutsFromDstar->Add(hpD0vspBLSCfromDstar);
3297 flistLsCutsFromDstar->Add(hptD0vsptcquarkLSCfromDstar);
3298 flistLsCutsFromDstar->Add(hpD0vspcquarkLSCfromDstar);
3300 TH1F *hd0zD0ptLSCfromDstar;
3301 TH1F *hInvMassD0LSCfromDstar,*hInvMassD0barLSCfromDstar;
3302 TH2F *hInvMassPtLSCfromDstar=new TH2F("hInvMassPtLSCfromDstar","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
3303 THnSparseF *hSparseLSCfromDstar=new THnSparseF("hSparseLSCfromDstar","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
3304 hSparseLSCfromDstar->SetBinEdges(0,massbins);
3305 hSparseLSCfromDstar->SetBinEdges(1,massbins);
3306 hSparseLSCfromDstar->SetBinEdges(2,ptbinsForNsparse);
3307 hSparseLSCfromDstar->SetBinEdges(3,impparbins);
3308 hSparseLSCfromDstar->SetBinEdges(4,massHypoBins);
3309 flistLsCutsFromDstar->Add(hSparseLSCfromDstar);
3310 TH1F *hetaLSCfromDstar;
3311 TH1F *hCosPDPBLSCfromDstar;
3312 TH1F *hCosPcPDLSCfromDstar;
3313 flistLsCutsFromDstar->Add(hInvMassPtLSCfromDstar);
3314 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
3315 TH2F *hd0D0VSd0xd0LSCfromDstarpt;
3316 TH2F *hangletracksVSd0xd0LSCfromDstarpt;
3317 TH2F *hangletracksVSd0D0LSCfromDstarpt;
3318 TH1F *hd0xd0LSCfromDstarpt;
3320 TH2F *hTOFpidLSCfromDstar=new TH2F("hTOFpidLSCfromDstar","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
3321 flistLsCutsFromDstar->Add(hTOFpidLSCfromDstar);
3323 for(Int_t i=0;i<fnbins;i++){
3324 namehist="hd0zD0ptLSCfromDstar_pt";
3326 titlehist="d0(z) Loose Cuts FromDstarm ptbin=";
3328 hd0zD0ptLSCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
3329 hd0zD0ptLSCfromDstar->SetXTitle("d_{0}(z) [#mum]");
3330 hd0zD0ptLSCfromDstar->SetYTitle("Entries");
3331 flistLsCutsFromDstar->Add(hd0zD0ptLSCfromDstar);
3333 namehist="hInvMassD0LSCfromDstar_pt";
3335 titlehist="Invariant Mass Loose Cuts FromDstar ptbin=";
3337 hInvMassD0LSCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3338 hInvMassD0LSCfromDstar->SetXTitle("Invariant Mass [GeV]");
3339 hInvMassD0LSCfromDstar->SetYTitle("Entries");
3340 flistLsCutsFromDstar->Add(hInvMassD0LSCfromDstar);
3342 namehist="hInvMassD0barLSCfromDstar_pt";
3344 titlehist="Invariant Mass D0bar Loose Cuts FromDstar ptbin=";
3346 hInvMassD0barLSCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3347 hInvMassD0barLSCfromDstar->SetXTitle("Invariant Mass [GeV]");
3348 hInvMassD0barLSCfromDstar->SetYTitle("Entries");
3349 flistLsCutsFromDstar->Add(hInvMassD0barLSCfromDstar);
3351 namehist="hetaLSCfromDstar_pt";
3353 titlehist="eta Loose Cuts FromDstar ptbin=";
3355 hetaLSCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
3356 hetaLSCfromDstar->SetXTitle("Pseudorapidity");
3357 hetaLSCfromDstar->SetYTitle("Entries");
3358 flistLsCutsFromDstar->Add(hetaLSCfromDstar);
3360 namehist="hCosPDPBLSCfromDstar_pt";
3362 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
3364 hCosPDPBLSCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
3365 hCosPDPBLSCfromDstar->SetXTitle("Cosine between D0 momentum and B momentum");
3366 hCosPDPBLSCfromDstar->SetYTitle("Entries");
3367 flistLsCutsFromDstar->Add(hCosPDPBLSCfromDstar);
3369 namehist="hCosPcPDLSCfromDstar_pt";
3371 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
3373 hCosPcPDLSCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
3374 hCosPcPDLSCfromDstar->SetXTitle("Cosine between c quark momentum and D0 momentum");
3375 hCosPcPDLSCfromDstar->SetYTitle("Entries");
3376 flistLsCutsFromDstar->Add(hCosPcPDLSCfromDstar);
3378 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
3379 namehist="hd0xd0LSCfromDstar_pt";
3381 titlehist="d0xd0 Loose Cuts FromDstar ptbin=";
3383 hd0xd0LSCfromDstarpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
3384 hd0xd0LSCfromDstarpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
3385 hd0xd0LSCfromDstarpt->SetYTitle("Entries");
3386 flistLsCutsFromDstar->Add(hd0xd0LSCfromDstarpt);
3389 namehist="hd0D0VSd0xd0LSCfromDstar_pt";
3391 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts FromDstar ptbin=";
3393 hd0D0VSd0xd0LSCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
3394 hd0D0VSd0xd0LSCfromDstarpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
3395 hd0D0VSd0xd0LSCfromDstarpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
3396 flistLsCutsFromDstar->Add(hd0D0VSd0xd0LSCfromDstarpt);
3399 namehist="hangletracksVSd0xd0LSCfromDstar_pt";
3401 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts FromDstar ptbin=";
3403 hangletracksVSd0xd0LSCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
3404 hangletracksVSd0xd0LSCfromDstarpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
3405 hangletracksVSd0xd0LSCfromDstarpt->SetYTitle(" angle between K and #p tracks [rad]");
3406 flistLsCutsFromDstar->Add(hangletracksVSd0xd0LSCfromDstarpt);
3409 namehist="hangletracksVSd0D0LSCfromDstar_pt";
3411 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Loose Cuts FromDstar ptbin=";
3413 hangletracksVSd0D0LSCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
3414 hangletracksVSd0D0LSCfromDstarpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
3415 hangletracksVSd0D0LSCfromDstarpt->SetYTitle(" angle between K and #p tracks [rad]");
3416 flistLsCutsFromDstar->Add(hangletracksVSd0D0LSCfromDstarpt);
3420 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
3421 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3428 //########## d0 D0 histos #############
3429 TH1F *hd0D0LSCfromDstPM = new TH1F("hd0D0LSCfromDstarPM","D^{0} impact par. plot , Loose Cuts ,FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
3430 hd0D0LSCfromDstPM->SetXTitle("Impact parameter [#mum]");
3431 hd0D0LSCfromDstPM->SetYTitle("Entries");
3433 TH1F *hd0D0VtxTrueLSCfromDstPM = new TH1F("hd0D0VtxTrueLSCfromDstarPM","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
3434 hd0D0VtxTrueLSCfromDstPM->SetXTitle("Impact parameter [#mum]");
3435 hd0D0VtxTrueLSCfromDstPM->SetYTitle("Entries");
3437 TH1F *hMCd0D0LSCfromDstPM = new TH1F("hMCd0D0LSCfromDstarPM","D^{0} impact par. plot, Loose Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
3438 hMCd0D0LSCfromDstPM->SetXTitle("MC Impact parameter [#mum]");
3439 hMCd0D0LSCfromDstPM->SetYTitle("Entries");
3441 TH1F *hd0D0LSCfromDstSB = new TH1F("hd0D0LSCfromDstarSB","D^{0} impact par. plot , Loose Cuts ,FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
3442 hd0D0LSCfromDstSB->SetXTitle("Impact parameter [#mum]");
3443 hd0D0LSCfromDstSB->SetYTitle("Entries");
3445 TH1F *hd0D0VtxTrueLSCfromDstSB = new TH1F("hd0D0VtxTrueLSCfromDstarSB","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
3446 hd0D0VtxTrueLSCfromDstSB->SetXTitle("Impact parameter [#mum]");
3447 hd0D0VtxTrueLSCfromDstSB->SetYTitle("Entries");
3449 TH1F *hMCd0D0LSCfromDstSB = new TH1F("hMCd0D0LSCfromDstarSB","D^{0} impact par. plot, Loose Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
3450 hMCd0D0LSCfromDstSB->SetXTitle("MC Impact parameter [#mum]");
3451 hMCd0D0LSCfromDstSB->SetYTitle("Entries");
3453 flistLsCutsFromDstar->Add(hd0D0LSCfromDstPM);
3454 flistLsCutsFromDstar->Add(hd0D0VtxTrueLSCfromDstPM);
3455 flistLsCutsFromDstar->Add(hMCd0D0LSCfromDstPM);
3456 flistLsCutsFromDstar->Add(hd0D0LSCfromDstSB);
3457 flistLsCutsFromDstar->Add(hd0D0VtxTrueLSCfromDstSB);
3458 flistLsCutsFromDstar->Add(hMCd0D0LSCfromDstSB);
3460 TH1F *hd0D0ptLSCfromDstPM;
3461 TH1F *hMCd0D0ptLSCfromDstPM;
3462 TH1F *hd0D0VtxTrueptLSCfromDstPM;
3463 TH1F *hd0D0ptLSCfromDstSB;
3464 TH1F *hMCd0D0ptLSCfromDstSB;
3465 TH1F *hd0D0VtxTrueptLSCfromDstSB;
3466 namehist="hd0D0ptLSCfromDstar_";
3467 titlehist="D^{0} impact par. plot, Loose Cuts, FromDStar, ";
3468 for(Int_t i=0;i<fnbins;i++){
3470 strnamept.Append("PkMss_pt");
3473 strtitlept=titlehist;
3474 strtitlept.Append(" Mass Peak, ");
3475 strtitlept+=fptbins[i];
3476 strtitlept.Append("<= pt <");
3477 strtitlept+=fptbins[i+1];
3478 strtitlept.Append(" [GeV/c]");
3480 hd0D0ptLSCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3481 hd0D0ptLSCfromDstPM->SetXTitle("Impact parameter [#mum] ");
3482 hd0D0ptLSCfromDstPM->SetYTitle("Entries");
3483 flistLsCutsFromDstar->Add(hd0D0ptLSCfromDstPM);
3485 strnamept.ReplaceAll("hd0D0","hMCd0D0");
3486 hMCd0D0ptLSCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3487 hMCd0D0ptLSCfromDstPM->SetXTitle("MC Impact parameter [#mum] ");
3488 hMCd0D0ptLSCfromDstPM->SetYTitle("Entries");
3489 flistLsCutsFromDstar->Add(hMCd0D0ptLSCfromDstPM);
3492 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
3493 hd0D0VtxTrueptLSCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3494 hd0D0VtxTrueptLSCfromDstPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
3495 hd0D0VtxTrueptLSCfromDstPM->SetYTitle("Entries");
3496 flistLsCutsFromDstar->Add(hd0D0VtxTrueptLSCfromDstPM);
3499 strnamept.Append("SBMss_pt");
3502 strtitlept=titlehist;
3503 strtitlept.Append(" Side Bands, ");
3504 strtitlept+=fptbins[i];
3505 strtitlept.Append("<= pt <");
3506 strtitlept+=fptbins[i+1];
3507 strtitlept.Append(" [GeV/c]");
3509 hd0D0ptLSCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3510 hd0D0ptLSCfromDstSB->SetXTitle("Impact parameter [#mum] ");
3511 hd0D0ptLSCfromDstSB->SetYTitle("Entries");
3512 flistLsCutsFromDstar->Add(hd0D0ptLSCfromDstSB);
3514 strnamept.ReplaceAll("hd0D0","hMCd0D0");
3515 hMCd0D0ptLSCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3516 hMCd0D0ptLSCfromDstSB->SetXTitle("MC Impact parameter [#mum] ");
3517 hMCd0D0ptLSCfromDstSB->SetYTitle("Entries");
3518 flistLsCutsFromDstar->Add(hMCd0D0ptLSCfromDstSB);
3520 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
3521 hd0D0VtxTrueptLSCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3522 hd0D0VtxTrueptLSCfromDstSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
3523 hd0D0VtxTrueptLSCfromDstSB->SetYTitle("Entries");
3524 flistLsCutsFromDstar->Add(hd0D0VtxTrueptLSCfromDstSB);
3528 //############ LOOSE CUTS OTHER HISTOGRAMS ###########
3530 //########### global properties histos ###########
3532 TH2F *hCPtaVSd0d0LSCother=new TH2F("hCPtaVSd0d0LSCother","hCPtaVSd0d0_LooseCuts_other",1000,-100000.,100000.,100,-1.,1.);
3533 TH1F *hSecVtxZLSCother=new TH1F("hSecVtxZLSCother","hSecVtxZ_LooseCuts_other",1000,-8.,8.);
3534 TH1F *hSecVtxXLSCother=new TH1F("hSecVtxXLSCother","hSecVtxX_LooseCuts_other",1000,-3000.,3000.);
3535 TH1F *hSecVtxYLSCother=new TH1F("hSecVtxYLSCother","hSecVtxY_LooseCuts_other",1000,-3000.,3000.);
3536 TH2F *hSecVtxXYLSCother=new TH2F("hSecVtxXYLSCother","hSecVtxXY_LooseCuts_other",1000,-3000.,3000.,1000,-3000.,3000.);
3537 TH1F *hSecVtxPhiLSCother=new TH1F("hSecVtxPhiLSCother","hSecVtxPhi_LooseCuts_other",180,-180.1,180.1);
3538 TH1F *hd0singlTrackLSCother=new TH1F("hd0singlTrackLSCother","hd0singlTrackLooseCuts_Other",1000,-5000.,5000.);
3539 TH1F *hCPtaLSCother=new TH1F("hCPtaLSCother","hCPta_LooseCuts_other",100,-1.,1.);
3540 TH1F *hd0xd0LSCother=new TH1F("hd0xd0LSCother","hd0xd0_LooseCuts_other",1000,-100000.,100000.);
3541 TH1F *hMassTrueLSCother=new TH1F("hMassTrueLSCother","D^{0} MC inv. Mass Loose Cuts other(All momenta)",600,1.600,2.200);
3542 TH1F *hMassLSCother=new TH1F("hMassLSCother","D^{0} inv. Mass Loose Cuts other (All momenta)",600,1.600,2.200);
3543 hMassLSCother->Sumw2();
3544 TH1F *hMassTrueLSCotherPM=new TH1F("hMassTrueLSCotherPM","D^{0} MC inv. Mass Loose Cuts other, Mass Peak. (All momenta)",600,1.600,2.200);
3545 TH1F *hMassLSCotherPM=new TH1F("hMassLSCotherPM","D^{0} inv. Mass Loose Cuts other (All momenta), MassPeak",600,1.600,2.200);
3546 hMassLSCotherPM->Sumw2();
3547 TH1F *hMassTrueLSCotherSB=new TH1F("hMassTrueLSCotherSB","D^{0} MC inv. Mass in Side Bands Loose Cuts other(All momenta)",600,1.600,2.200);
3548 TH1F *hMassLSCotherSB=new TH1F("hMassLSCotherSB","D^{0} inv. Mass in Side Bands Loose Cuts other (All momenta)",600,1.600,2.200);
3549 hMassLSCotherSB->Sumw2();
3551 flistLsCutsOther->Add(hCPtaVSd0d0LSCother);
3552 flistLsCutsOther->Add(hSecVtxZLSCother);
3553 flistLsCutsOther->Add(hSecVtxYLSCother);
3554 flistLsCutsOther->Add(hSecVtxXLSCother);
3555 flistLsCutsOther->Add(hSecVtxXYLSCother);
3556 flistLsCutsOther->Add(hSecVtxPhiLSCother);
3557 flistLsCutsOther->Add(hd0singlTrackLSCother);
3558 flistLsCutsOther->Add(hCPtaLSCother);
3559 flistLsCutsOther->Add(hd0xd0LSCother);
3560 flistLsCutsOther->Add(hMassTrueLSCother);
3561 flistLsCutsOther->Add(hMassLSCother);
3562 flistLsCutsOther->Add(hMassTrueLSCotherPM);
3563 flistLsCutsOther->Add(hMassLSCotherPM);
3564 flistLsCutsOther->Add(hMassTrueLSCotherSB);
3565 flistLsCutsOther->Add(hMassLSCotherSB);
3570 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
3571 TH1F *hdcaLSCother=new TH1F("hdcaLSCother","hdca_LooseCuts_Other",100,0.,1000.);
3572 hdcaLSCother->SetXTitle("dca [#mum]");
3573 hdcaLSCother->SetYTitle("Entries");
3574 TH1F *hcosthetastarLSCother=new TH1F("hcosthetastarLSCother","hCosThetaStar_LooseCuts_Other",50,-1.,1.);
3575 hcosthetastarLSCother->SetXTitle("cos #theta^{*}");
3576 hcosthetastarLSCother->SetYTitle("Entries");
3577 TH1F *hptD0LSCother=new TH1F("hptD0LSCother","D^{0} transverse momentum distribution",34,ptbinsD0arr);
3578 hptD0LSCother->SetXTitle("p_{t} [GeV/c]");
3579 hptD0LSCother->SetYTitle("Entries");
3580 TH1F *hptD0VsMaxPtLSCother=new TH1F("hptD0VsMaxPtLSCother","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
3581 TH2F *hptD0PTallsqrtLSCother=new TH2F("hptD0PTallsqrtLSCother","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
3582 TH2F *hptD0PTallLSCother=new TH2F("hptD0PTallLSCother","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
3583 TH2F *hptD0vsptBLSCother=new TH2F("hptD0vsptBLSCother","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3584 TH2F *hpD0vspBLSCother=new TH2F("hpD0vspBLSCother","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3585 TH2F *hptD0vsptcquarkLSCother=new TH2F("hptD0vsptcquarkLSCother","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3586 TH2F *hpD0vspcquarkLSCother=new TH2F("hpD0vspcquarkLSCother","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3587 flistLsCutsOther->Add(hdcaLSCother);
3588 flistLsCutsOther->Add(hcosthetastarLSCother);
3589 flistLsCutsOther->Add(hptD0LSCother);
3590 flistLsCutsOther->Add(hptD0VsMaxPtLSCother);
3591 flistLsCutsOther->Add(hptD0PTallsqrtLSCother);
3592 flistLsCutsOther->Add(hptD0PTallLSCother);
3593 flistLsCutsOther->Add(hptD0vsptBLSCother);
3594 flistLsCutsOther->Add(hpD0vspBLSCother);
3595 flistLsCutsOther->Add(hptD0vsptcquarkLSCother);
3596 flistLsCutsOther->Add(hpD0vspcquarkLSCother);
3598 TH1F *hd0zD0ptLSCother;
3599 TH1F *hInvMassD0LSCother,*hInvMassD0barLSCother;
3600 TH2F *hInvMassPtLSCother=new TH2F("hInvMassPtLSCother","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
3601 THnSparseF *hSparseLSCother=new THnSparseF("hSparseLSCother","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
3602 hSparseLSCother->SetBinEdges(0,massbins);
3603 hSparseLSCother->SetBinEdges(1,massbins);
3604 hSparseLSCother->SetBinEdges(2,ptbinsForNsparse);
3605 hSparseLSCother->SetBinEdges(3,impparbins);
3606 hSparseLSCother->SetBinEdges(4,massHypoBins);
3607 flistLsCutsOther->Add(hSparseLSCother);
3609 TH1F *hCosPDPBLSCother;
3610 TH1F *hCosPcPDLSCother;
3611 flistLsCutsOther->Add(hInvMassPtLSCother);
3612 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
3613 TH2F *hd0D0VSd0xd0LSCotherpt;
3614 TH2F *hangletracksVSd0xd0LSCotherpt;
3615 TH2F *hangletracksVSd0D0LSCotherpt;
3616 TH1F *hd0xd0LSCotherpt;
3618 TH2F *hTOFpidLSCother=new TH2F("hTOFpidLSCother","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
3619 flistLsCutsOther->Add(hTOFpidLSCother);
3621 for(Int_t i=0;i<fnbins;i++){
3622 namehist="hd0zD0ptLSCother_pt";
3624 titlehist="d0(z) Loose Cuts Otherm ptbin=";
3626 hd0zD0ptLSCother=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
3627 hd0zD0ptLSCother->SetXTitle("d_{0}(z) [#mum]");
3628 hd0zD0ptLSCother->SetYTitle("Entries");
3629 flistLsCutsOther->Add(hd0zD0ptLSCother);
3631 namehist="hInvMassD0LSCother_pt";
3633 titlehist="Invariant Mass Loose Cuts Other ptbin=";
3635 hInvMassD0LSCother=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3636 hInvMassD0LSCother->SetXTitle("Invariant Mass [GeV]");
3637 hInvMassD0LSCother->SetYTitle("Entries");
3638 flistLsCutsOther->Add(hInvMassD0LSCother);
3640 namehist="hInvMassD0barLSCother_pt";
3642 titlehist="Invariant Mass D0bar Loose Cuts Other ptbin=";
3644 hInvMassD0barLSCother=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3645 hInvMassD0barLSCother->SetXTitle("Invariant Mass [GeV]");
3646 hInvMassD0barLSCother->SetYTitle("Entries");
3647 flistLsCutsOther->Add(hInvMassD0barLSCother);
3649 namehist="hetaLSCother_pt";
3651 titlehist="eta Loose Cuts Other ptbin=";
3653 hetaLSCother=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
3654 hetaLSCother->SetXTitle("Pseudorapidity");
3655 hetaLSCother->SetYTitle("Entries");
3656 flistLsCutsOther->Add(hetaLSCother);
3658 namehist="hCosPDPBLSCother_pt";
3660 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
3662 hCosPDPBLSCother=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
3663 hCosPDPBLSCother->SetXTitle("Cosine between D0 momentum and B momentum");
3664 hCosPDPBLSCother->SetYTitle("Entries");
3665 flistLsCutsOther->Add(hCosPDPBLSCother);
3667 namehist="hCosPcPDLSCother_pt";
3669 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
3671 hCosPcPDLSCother=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
3672 hCosPcPDLSCother->SetXTitle("Cosine between c quark momentum and D0 momentum");
3673 hCosPcPDLSCother->SetYTitle("Entries");
3674 flistLsCutsOther->Add(hCosPcPDLSCother);
3676 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
3677 namehist="hd0xd0LSCother_pt";
3679 titlehist="d0xd0 Loose Cuts Other ptbin=";
3681 hd0xd0LSCotherpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
3682 hd0xd0LSCotherpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
3683 hd0xd0LSCotherpt->SetYTitle("Entries");
3684 flistLsCutsOther->Add(hd0xd0LSCotherpt);
3687 namehist="hd0D0VSd0xd0LSCother_pt";
3689 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts Other ptbin=";
3691 hd0D0VSd0xd0LSCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
3692 hd0D0VSd0xd0LSCotherpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
3693 hd0D0VSd0xd0LSCotherpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
3694 flistLsCutsOther->Add(hd0D0VSd0xd0LSCotherpt);
3697 namehist="hangletracksVSd0xd0LSCother_pt";
3699 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts Other ptbin=";
3701 hangletracksVSd0xd0LSCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
3702 hangletracksVSd0xd0LSCotherpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
3703 hangletracksVSd0xd0LSCotherpt->SetYTitle(" angle between K and #p tracks [rad]");
3704 flistLsCutsOther->Add(hangletracksVSd0xd0LSCotherpt);
3707 namehist="hangletracksVSd0D0LSCother_pt";
3709 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Loose Cuts Other ptbin=";
3711 hangletracksVSd0D0LSCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
3712 hangletracksVSd0D0LSCotherpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
3713 hangletracksVSd0D0LSCotherpt->SetYTitle(" angle between K and #p tracks [rad]");
3714 flistLsCutsOther->Add(hangletracksVSd0D0LSCotherpt);
3718 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
3719 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3723 //############# d0 D0 histos ###############Ã
3724 TH1F *hd0D0LSCotherPM = new TH1F("hd0D0LSCotherPM","D^{0} impact par. plot , Loose Cuts ,Other,Mass Peak (All momenta)",1000,-1000.,1000.);
3725 hd0D0LSCotherPM->SetXTitle("Impact parameter [#mum]");
3726 hd0D0LSCotherPM->SetYTitle("Entries");
3728 TH1F *hd0D0VtxTrueLSCotherPM = new TH1F("hd0D0VtxTrueLSCotherPM","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
3729 hd0D0VtxTrueLSCotherPM->SetXTitle("Impact parameter [#mum]");
3730 hd0D0VtxTrueLSCotherPM->SetYTitle("Entries");
3732 TH1F *hMCd0D0LSCotherPM = new TH1F("hMCd0D0LSCotherPM","D^{0} impact par. plot, Loose Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
3733 hMCd0D0LSCotherPM->SetXTitle("MC Impact parameter [#mum]");
3734 hMCd0D0LSCotherPM->SetYTitle("Entries");
3736 TH1F *hd0D0LSCotherSB = new TH1F("hd0D0LSCotherSB","D^{0} impact par. plot , Loose Cuts ,Other,Mass Peak (All momenta)",1000,-1000.,1000.);
3737 hd0D0LSCotherSB->SetXTitle("Impact parameter [#mum]");
3738 hd0D0LSCotherSB->SetYTitle("Entries");
3740 TH1F *hd0D0VtxTrueLSCotherSB = new TH1F("hd0D0VtxTrueLSCotherSB","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
3741 hd0D0VtxTrueLSCotherSB->SetXTitle("Impact parameter [#mum]");
3742 hd0D0VtxTrueLSCotherSB->SetYTitle("Entries");
3744 TH1F *hMCd0D0LSCotherSB = new TH1F("hMCd0D0LSCotherSB","D^{0} impact par. plot, Loose Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
3745 hMCd0D0LSCotherSB->SetXTitle("MC Impact parameter [#mum]");
3746 hMCd0D0LSCotherSB->SetYTitle("Entries");
3748 flistLsCutsOther->Add(hd0D0LSCotherPM);
3749 flistLsCutsOther->Add(hd0D0VtxTrueLSCotherPM);
3750 flistLsCutsOther->Add(hMCd0D0LSCotherPM);
3751 flistLsCutsOther->Add(hd0D0LSCotherSB);
3752 flistLsCutsOther->Add(hd0D0VtxTrueLSCotherSB);
3753 flistLsCutsOther->Add(hMCd0D0LSCotherSB);
3755 TH1F *hd0D0ptLSCotherPM;
3756 TH1F *hMCd0D0ptLSCotherPM;
3757 TH1F *hd0D0VtxTrueptLSCotherPM;
3758 TH1F *hd0D0ptLSCotherSB;
3759 TH1F *hMCd0D0ptLSCotherSB;
3760 TH1F *hd0D0VtxTrueptLSCotherSB;
3761 namehist="hd0D0ptLSCother_";
3762 titlehist="D^{0} impact par. plot, Loose Cuts, Other, ";
3763 for(Int_t i=0;i<fnbins;i++){
3765 strnamept.Append("PkMss_pt");
3768 strtitlept=titlehist;
3769 strtitlept.Append(" Mass Peak, ");
3770 strtitlept+=fptbins[i];
3771 strtitlept.Append("<= pt <");
3772 strtitlept+=fptbins[i+1];
3773 strtitlept.Append(" [GeV/c]");
3775 hd0D0ptLSCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3776 hd0D0ptLSCotherPM->SetXTitle("Impact parameter [#mum] ");
3777 hd0D0ptLSCotherPM->SetYTitle("Entries");
3778 flistLsCutsOther->Add(hd0D0ptLSCotherPM);
3780 strnamept.ReplaceAll("hd0D0","hMCd0D0");
3781 hMCd0D0ptLSCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3782 hMCd0D0ptLSCotherPM->SetXTitle("MC Impact parameter [#mum] ");
3783 hMCd0D0ptLSCotherPM->SetYTitle("Entries");
3784 flistLsCutsOther->Add(hMCd0D0ptLSCotherPM);
3787 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
3788 hd0D0VtxTrueptLSCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3789 hd0D0VtxTrueptLSCotherPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
3790 hd0D0VtxTrueptLSCotherPM->SetYTitle("Entries");
3791 flistLsCutsOther->Add(hd0D0VtxTrueptLSCotherPM);
3794 strnamept.Append("SBMss_pt");
3797 strtitlept=titlehist;
3798 strtitlept.Append(" Side Bands, ");
3799 strtitlept+=fptbins[i];
3800 strtitlept.Append("<= pt <");
3801 strtitlept+=fptbins[i+1];
3802 strtitlept.Append(" [GeV/c]");
3804 hd0D0ptLSCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3805 hd0D0ptLSCotherSB->SetXTitle("Impact parameter [#mum] ");
3806 hd0D0ptLSCotherSB->SetYTitle("Entries");
3807 flistLsCutsOther->Add(hd0D0ptLSCotherSB);
3809 strnamept.ReplaceAll("hd0D0","hMCd0D0");
3810 hMCd0D0ptLSCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3811 hMCd0D0ptLSCotherSB->SetXTitle("MC Impact parameter [#mum] ");
3812 hMCd0D0ptLSCotherSB->SetYTitle("Entries");
3813 flistLsCutsOther->Add(hMCd0D0ptLSCotherSB);
3815 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
3816 hd0D0VtxTrueptLSCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3817 hd0D0VtxTrueptLSCotherSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
3818 hd0D0VtxTrueptLSCotherSB->SetYTitle("Entries");
3819 flistLsCutsOther->Add(hd0D0VtxTrueptLSCotherSB);
3822 //Printf("END OF LSCUTS HISTOS CREATION \n");
3825 //################################################################################################
3827 // HISTOS FOR TIGHT CUTS #
3829 //################################################################################################
3831 //############ TIGHT CUTS SIGNAL HISTOGRAMS ###############
3833 // ####### global properties histo ############
3835 TH2F *hCPtaVSd0d0TGHCsign=new TH2F("hCPtaVSd0d0TGHCsign","hCPtaVSd0d0_TightCuts_Signal",1000,-100000.,100000.,100,-1.,1.);
3836 TH1F *hSecVtxZTGHCsign=new TH1F("hSecVtxZTGHCsign","hSecVtxZ_TightCuts_Signal",1000,-8.,8.);
3837 TH1F *hSecVtxXTGHCsign=new TH1F("hSecVtxXTGHCsign","hSecVtxX_TightCuts_Signal",1000,-3000.,3000.);
3838 TH1F *hSecVtxYTGHCsign=new TH1F("hSecVtxYTGHCsign","hSecVtxY_TightCuts_Signal",1000,-3000.,3000.);
3839 TH2F *hSecVtxXYTGHCsign=new TH2F("hSecVtxXYTGHCsign","hSecVtxXY_TightCuts_Signal",1000,-3000.,3000.,1000,-3000.,3000.);
3840 TH1F *hSecVtxPhiTGHCsign=new TH1F("hSecVtxPhiTGHCsign","hSecVtxPhi_TightCuts_Signal",180,-180.1,180.1);
3841 TH1F *hd0singlTrackTGHCsign=new TH1F("hd0singlTrackTGHCsign","hd0singlTrackTightCuts_Signal",1000,-5000.,5000.);
3842 TH1F *hCPtaTGHCsign=new TH1F("hCPtaTGHCsign","hCPta_TightCuts_Signal",100,-1.,1.);
3843 TH1F *hd0xd0TGHCsign=new TH1F("hd0xd0TGHCsign","hd0xd0_TightCuts_Signal",1000,-100000.,100000.);
3844 TH1F *hMassTrueTGHCsign=new TH1F("hMassTrueTGHCsign","D^{0} MC inv. Mass Tight Cuts Signal(All momenta)",600,1.600,2.200);
3845 TH1F *hMassTGHCsign=new TH1F("hMassTGHCsign","D^{0} inv. Mass Tight Cuts Signal (All momenta)",600,1.600,2.200);
3846 hMassTGHCsign->Sumw2();
3847 TH1F *hMassTrueTGHCsignPM=new TH1F("hMassTrueTGHCsignPM","D^{0} MC inv. Mass Tight Cuts Signal, Mass Peak. (All momenta)",600,1.600,2.200);
3848 TH1F *hMassTGHCsignPM=new TH1F("hMassTGHCsignPM","D^{0} inv. Mass Tight Cuts Signal (All momenta), MassPeak",600,1.600,2.200);
3849 hMassTGHCsignPM->Sumw2();
3850 TH1F *hMassTrueTGHCsignSB=new TH1F("hMassTrueTGHCsignSB","D^{0} MC inv. Mass in Side Bands Tight Cuts Signal(All momenta)",600,1.600,2.200);
3851 TH1F *hMassTGHCsignSB=new TH1F("hMassTGHCsignSB","D^{0} inv. Mass in Side Bands Tight Cuts Signal (All momenta)",600,1.600,2.200);
3852 hMassTGHCsignSB->Sumw2();
3854 flistTghCutsSignal->Add(hCPtaVSd0d0TGHCsign);
3855 flistTghCutsSignal->Add(hSecVtxZTGHCsign);
3856 flistTghCutsSignal->Add(hSecVtxYTGHCsign);
3857 flistTghCutsSignal->Add(hSecVtxXTGHCsign);
3858 flistTghCutsSignal->Add(hSecVtxXYTGHCsign);
3859 flistTghCutsSignal->Add(hSecVtxPhiTGHCsign);
3860 flistTghCutsSignal->Add(hd0singlTrackTGHCsign);
3861 flistTghCutsSignal->Add(hCPtaTGHCsign);
3862 flistTghCutsSignal->Add(hd0xd0TGHCsign);
3863 flistTghCutsSignal->Add(hMassTrueTGHCsign);
3864 flistTghCutsSignal->Add(hMassTGHCsign);
3865 flistTghCutsSignal->Add(hMassTrueTGHCsignPM);
3866 flistTghCutsSignal->Add(hMassTGHCsignPM);
3867 flistTghCutsSignal->Add(hMassTrueTGHCsignSB);
3868 flistTghCutsSignal->Add(hMassTGHCsignSB);
3875 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
3876 TH1F *hdcaTGHCsign=new TH1F("hdcaTGHCsign","hdca_TightCuts_Signal",100,0.,1000.);
3877 hdcaTGHCsign->SetXTitle("dca [#mum]");
3878 hdcaTGHCsign->SetYTitle("Entries");
3879 TH1F *hcosthetastarTGHCsign=new TH1F("hcosthetastarTGHCsign","hCosThetaStar_TightCuts_Signal",50,-1.,1.);
3880 hcosthetastarTGHCsign->SetXTitle("cos #theta^{*}");
3881 hcosthetastarTGHCsign->SetYTitle("Entries");
3882 TH1F *hptD0TGHCsign=new TH1F("hptD0TGHCsign","D^{0} transverse momentum distribution",34,ptbinsD0arr);
3883 hptD0TGHCsign->SetXTitle("p_{t} [GeV/c]");
3884 hptD0TGHCsign->SetYTitle("Entries");
3885 TH1F *hptD0VsMaxPtTGHCsign=new TH1F("hptD0VsMaxPtTGHCsign","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
3886 TH2F *hptD0PTallsqrtTGHCsign=new TH2F("hptD0PTallsqrtTGHCsign","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
3887 TH2F *hptD0PTallTGHCsign=new TH2F("hptD0PTallTGHCsign","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
3888 TH2F *hptD0vsptBTGHCsign=new TH2F("hptD0vsptBTGHCsign","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3889 TH2F *hpD0vspBTGHCsign=new TH2F("hpD0vspBTGHCsign","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3890 TH2F *hptD0vsptcquarkTGHCsign=new TH2F("hptD0vsptcquarkTGHCsign","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3891 TH2F *hpD0vspcquarkTGHCsign=new TH2F("hpD0vspcquarkTGHCsign","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3892 flistTghCutsSignal->Add(hdcaTGHCsign);
3893 flistTghCutsSignal->Add(hcosthetastarTGHCsign);
3894 flistTghCutsSignal->Add(hptD0TGHCsign);
3895 flistTghCutsSignal->Add(hptD0VsMaxPtTGHCsign);
3896 flistTghCutsSignal->Add(hptD0PTallsqrtTGHCsign);
3897 flistTghCutsSignal->Add(hptD0PTallTGHCsign);
3898 flistTghCutsSignal->Add(hptD0vsptBTGHCsign);
3899 flistTghCutsSignal->Add(hpD0vspBTGHCsign);
3900 flistTghCutsSignal->Add(hptD0vsptcquarkTGHCsign);
3901 flistTghCutsSignal->Add(hpD0vspcquarkTGHCsign);
3903 TH1F *hd0zD0ptTGHCsign;
3904 TH1F *hInvMassD0TGHCsign,*hInvMassD0barTGHCsign;
3905 TH2F *hInvMassPtTGHCsign=new TH2F("hInvMassPtTGHCsign","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
3906 THnSparseF *hSparseTGHCsign=new THnSparseF("hSparseTGHCsign","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
3907 hSparseTGHCsign->SetBinEdges(0,massbins);
3908 hSparseTGHCsign->SetBinEdges(1,massbins);
3909 hSparseTGHCsign->SetBinEdges(2,ptbinsForNsparse);
3910 hSparseTGHCsign->SetBinEdges(3,impparbins);
3911 hSparseTGHCsign->SetBinEdges(4,massHypoBins);
3912 flistTghCutsSignal->Add(hSparseTGHCsign);
3915 THnSparseF *hSparseCxyLxyTGHCsign=new THnSparseF("hSparseCxyLxyTGHCsign","Candidate Mass;massD0;Pt;CosXY;Lxy",4,nbinsSparsCxyLxy,binLowLimitSparseCxyLxy,binUpLimitSparseCxyLxy);
3916 hSparseCxyLxyTGHCsign->SetBinEdges(1,ptbinlimitsCxyLxy);
3917 hSparseCxyLxyTGHCsign->GetAxis(0)->SetName("mass");
3918 hSparseCxyLxyTGHCsign->GetAxis(0)->SetTitle("Invariant Mass (K#pi) [GeV/c^{2}]");
3919 hSparseCxyLxyTGHCsign->GetAxis(1)->SetName("pt");
3920 hSparseCxyLxyTGHCsign->GetAxis(1)->SetTitle("p_{t} [GeV/c]");
3921 hSparseCxyLxyTGHCsign->GetAxis(2)->SetName("CosPointXY");
3922 hSparseCxyLxyTGHCsign->GetAxis(2)->SetTitle("Cos#theta_{point}^{XY}");
3923 hSparseCxyLxyTGHCsign->GetAxis(3)->SetName("NormDecLengthXY");
3924 hSparseCxyLxyTGHCsign->GetAxis(3)->SetTitle("Normalized XY decay length");
3927 flistTghCutsSignal->Add(hSparseCxyLxyTGHCsign);
3931 TH1F *hCosPDPBTGHCsign;
3932 TH1F *hCosPcPDTGHCsign;
3933 flistTghCutsSignal->Add(hInvMassPtTGHCsign);
3934 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
3935 TH2F *hd0D0VSd0xd0TGHCsignpt;
3936 TH2F *hangletracksVSd0xd0TGHCsignpt;
3937 TH2F *hangletracksVSd0D0TGHCsignpt;
3938 TH1F *hd0xd0TGHCsignpt;
3939 TH1F *hPhiHistPMTGHCsignpt,*hPhiHistSBTGHCsignpt;
3941 TH2F *hTOFpidTGHCsign=new TH2F("hTOFpidTGHCsign","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
3942 flistTghCutsSignal->Add(hTOFpidTGHCsign);
3944 for(Int_t i=0;i<fnbins;i++){
3945 // Printf("INSIDE FIRST LOOP FOR TIGHT CUTS HISTO CREATION %d\n", fnbins);
3946 namehist="hPhiHistPMTGHCsign_pt";
3948 titlehist="Azimuthal correlation TGH Cuts Sign PM ptbin=";
3950 hPhiHistPMTGHCsignpt=new TH1F(namehist.Data(),titlehist.Data(),100,-3.15,3.15);
3951 hPhiHistPMTGHCsignpt->Sumw2();
3952 flistTghCutsSignal->Add(hPhiHistPMTGHCsignpt);
3954 namehist="hPhiHistSBTGHCsign_pt";
3956 titlehist="Azimuthal correlation TGH Cuts Sign SB ptbin=";
3958 hPhiHistSBTGHCsignpt=new TH1F(namehist.Data(),titlehist.Data(),100,-3.15,3.15);
3959 hPhiHistSBTGHCsignpt->Sumw2();
3960 flistTghCutsSignal->Add(hPhiHistSBTGHCsignpt);
3962 namehist="hd0zD0ptTGHCsign_pt";
3964 titlehist="d0(z) Tight Cuts Signal ptbin=";
3966 hd0zD0ptTGHCsign=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
3967 hd0zD0ptTGHCsign->SetXTitle("d_{0}(z) [#mum]");
3968 hd0zD0ptTGHCsign->SetYTitle("Entries");
3969 flistTghCutsSignal->Add(hd0zD0ptTGHCsign);
3971 namehist="hInvMassD0TGHCsign_pt";
3973 titlehist="Invariant Mass Tight Cuts Signal ptbin=";
3975 hInvMassD0TGHCsign=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3976 hInvMassD0TGHCsign->SetXTitle("Invariant Mass [GeV]");
3977 hInvMassD0TGHCsign->SetYTitle("Entries");
3978 flistTghCutsSignal->Add(hInvMassD0TGHCsign);
3980 namehist="hInvMassD0barTGHCsign_pt";
3982 titlehist="Invariant Mass D0bar Tight Cuts Signal ptbin=";
3984 hInvMassD0barTGHCsign=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3985 hInvMassD0barTGHCsign->SetXTitle("Invariant Mass [GeV]");
3986 hInvMassD0barTGHCsign->SetYTitle("Entries");
3987 flistTghCutsSignal->Add(hInvMassD0barTGHCsign);
3990 namehist="hetaTGHCsign_pt";
3992 titlehist="eta Tight Cuts Signal ptbin=";
3994 hetaTGHCsign=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
3995 hetaTGHCsign->SetXTitle("Pseudorapidity");
3996 hetaTGHCsign->SetYTitle("Entries");
3997 flistTghCutsSignal->Add(hetaTGHCsign);
3999 namehist="hCosPDPBTGHCsign_pt";
4001 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
4003 hCosPDPBTGHCsign=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
4004 hCosPDPBTGHCsign->SetXTitle("Cosine between D0 momentum and B momentum");
4005 hCosPDPBTGHCsign->SetYTitle("Entries");
4006 flistTghCutsSignal->Add(hCosPDPBTGHCsign);
4008 namehist="hCosPcPDTGHCsign_pt";
4010 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
4012 hCosPcPDTGHCsign=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
4013 hCosPcPDTGHCsign->SetXTitle("Cosine between c quark momentum and D0 momentum");
4014 hCosPcPDTGHCsign->SetYTitle("Entries");
4015 flistTghCutsSignal->Add(hCosPcPDTGHCsign);
4017 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
4018 namehist="hd0xd0TGHCsign_pt";
4020 titlehist="d0xd0 Tight Cuts Signal ptbin=";
4022 hd0xd0TGHCsignpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
4023 hd0xd0TGHCsignpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
4024 hd0xd0TGHCsignpt->SetYTitle("Entries");
4025 flistTghCutsSignal->Add(hd0xd0TGHCsignpt);
4028 namehist="hd0D0VSd0xd0TGHCsign_pt";
4030 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts Signal ptbin=";
4032 hd0D0VSd0xd0TGHCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
4033 hd0D0VSd0xd0TGHCsignpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4034 hd0D0VSd0xd0TGHCsignpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
4035 flistTghCutsSignal->Add(hd0D0VSd0xd0TGHCsignpt);
4038 namehist="hangletracksVSd0xd0TGHCsign_pt";
4040 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts Signal ptbin=";
4042 hangletracksVSd0xd0TGHCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
4043 hangletracksVSd0xd0TGHCsignpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4044 hangletracksVSd0xd0TGHCsignpt->SetYTitle(" angle between K and #p tracks [rad]");
4045 flistTghCutsSignal->Add(hangletracksVSd0xd0TGHCsignpt);
4048 namehist="hangletracksVSd0D0TGHCsign_pt";
4050 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Tight Cuts Signal ptbin=";
4052 hangletracksVSd0D0TGHCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
4053 hangletracksVSd0D0TGHCsignpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
4054 hangletracksVSd0D0TGHCsignpt->SetYTitle(" angle between K and #p tracks [rad]");
4055 flistTghCutsSignal->Add(hangletracksVSd0D0TGHCsignpt);
4058 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
4059 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4068 // ####### d0 D0 histos ############
4069 TH1F *hd0D0TGHCsignPM = new TH1F("hd0D0TGHCsignPM","D^{0} impact par. plot , Tight Cuts ,Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
4070 hd0D0TGHCsignPM->SetXTitle("Impact parameter [#mum]");
4071 hd0D0TGHCsignPM->SetYTitle("Entries");
4073 TH1F *hd0D0VtxTrueTGHCsignPM = new TH1F("hd0D0VtxTrueTGHCsignPM","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
4074 hd0D0VtxTrueTGHCsignPM->SetXTitle("Impact parameter [#mum]");
4075 hd0D0VtxTrueTGHCsignPM->SetYTitle("Entries");
4077 TH1F *hMCd0D0TGHCsignPM = new TH1F("hMCd0D0TGHCsignPM","D^{0} impact par. plot, Tight Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
4078 hMCd0D0TGHCsignPM->SetXTitle("MC Impact parameter [#mum]");
4079 hMCd0D0TGHCsignPM->SetYTitle("Entries");
4081 TH1F *hd0D0TGHCsignSB = new TH1F("hd0D0TGHCsignSB","D^{0} impact par. plot , Tight Cuts ,Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
4082 hd0D0TGHCsignSB->SetXTitle("Impact parameter [#mum]");
4083 hd0D0TGHCsignSB->SetYTitle("Entries");
4085 TH1F *hd0D0VtxTrueTGHCsignSB = new TH1F("hd0D0VtxTrueTGHCsignSB","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
4086 hd0D0VtxTrueTGHCsignSB->SetXTitle("Impact parameter [#mum]");
4087 hd0D0VtxTrueTGHCsignSB->SetYTitle("Entries");
4089 TH1F *hMCd0D0TGHCsignSB = new TH1F("hMCd0D0TGHCsignSB","D^{0} impact par. plot, Tight Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
4090 hMCd0D0TGHCsignSB->SetXTitle("MC Impact parameter [#mum]");
4091 hMCd0D0TGHCsignSB->SetYTitle("Entries");
4093 flistTghCutsSignal->Add(hd0D0TGHCsignPM);
4094 flistTghCutsSignal->Add(hd0D0VtxTrueTGHCsignPM);
4095 flistTghCutsSignal->Add(hMCd0D0TGHCsignPM);
4096 flistTghCutsSignal->Add(hd0D0TGHCsignSB);
4097 flistTghCutsSignal->Add(hd0D0VtxTrueTGHCsignSB);
4098 flistTghCutsSignal->Add(hMCd0D0TGHCsignSB);
4100 TH1F *hd0D0ptTGHCsignPM;
4101 TH1F *hMCd0D0ptTGHCsignPM;
4102 TH1F *hd0D0VtxTrueptTGHCsignPM;
4103 TH1F *hd0D0ptTGHCsignSB;
4104 TH1F *hMCd0D0ptTGHCsignSB;
4105 TH1F *hd0D0VtxTrueptTGHCsignSB;
4106 namehist="hd0D0ptTGHCsign_";
4107 titlehist="D^{0} impact par. plot, Tight Cuts, Signal, ";
4108 for(Int_t i=0;i<fnbins;i++){
4110 strnamept.Append("PkMss_pt");
4113 strtitlept=titlehist;
4114 strtitlept.Append(" Mass Peak, ");
4115 strtitlept+=fptbins[i];
4116 strtitlept.Append("<= pt <");
4117 strtitlept+=fptbins[i+1];
4118 strtitlept.Append(" [GeV/c]");
4120 hd0D0ptTGHCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4121 hd0D0ptTGHCsignPM->SetXTitle("Impact parameter [#mum] ");
4122 hd0D0ptTGHCsignPM->SetYTitle("Entries");
4123 flistTghCutsSignal->Add(hd0D0ptTGHCsignPM);
4125 strnamept.ReplaceAll("hd0D0","hMCd0D0");
4126 hMCd0D0ptTGHCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4127 hMCd0D0ptTGHCsignPM->SetXTitle("MC Impact parameter [#mum] ");
4128 hMCd0D0ptTGHCsignPM->SetYTitle("Entries");
4129 flistTghCutsSignal->Add(hMCd0D0ptTGHCsignPM);
4132 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
4133 hd0D0VtxTrueptTGHCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4134 hd0D0VtxTrueptTGHCsignPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
4135 hd0D0VtxTrueptTGHCsignPM->SetYTitle("Entries");
4136 flistTghCutsSignal->Add(hd0D0VtxTrueptTGHCsignPM);
4139 strnamept.Append("SBMss_pt");
4142 strtitlept=titlehist;
4143 strtitlept.Append(" Side Bands, ");
4144 strtitlept+=fptbins[i];
4145 strtitlept.Append("<= pt <");
4146 strtitlept+=fptbins[i+1];
4147 strtitlept.Append(" [GeV/c]");
4149 hd0D0ptTGHCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4150 hd0D0ptTGHCsignSB->SetXTitle("Impact parameter [#mum] ");
4151 hd0D0ptTGHCsignSB->SetYTitle("Entries");
4152 flistTghCutsSignal->Add(hd0D0ptTGHCsignSB);
4154 strnamept.ReplaceAll("hd0D0","hMCd0D0");
4155 hMCd0D0ptTGHCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4156 hMCd0D0ptTGHCsignSB->SetXTitle("MC Impact parameter [#mum] ");
4157 hMCd0D0ptTGHCsignSB->SetYTitle("Entries");
4158 flistTghCutsSignal->Add(hMCd0D0ptTGHCsignSB);
4160 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
4161 hd0D0VtxTrueptTGHCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4162 hd0D0VtxTrueptTGHCsignSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
4163 hd0D0VtxTrueptTGHCsignSB->SetYTitle("Entries");
4164 flistTghCutsSignal->Add(hd0D0VtxTrueptTGHCsignSB);
4168 //############ TIGHT CUTS BACKGROUND HISTOGRAMS ###########
4170 // ######## global properties histos #######
4171 TH2F *hCPtaVSd0d0TGHCback=new TH2F("hCPtaVSd0d0TGHCback","hCPtaVSd0d0_TightCuts_Background",1000,-100000.,100000.,100,-1.,1.);
4172 TH1F *hSecVtxZTGHCback=new TH1F("hSecVtxZTGHCback","hSecVtxZ_TightCuts_Background",1000,-8.,8.);
4173 TH1F *hSecVtxXTGHCback=new TH1F("hSecVtxXTGHCback","hSecVtxX_TightCuts_Background",1000,-3000.,3000.);
4174 TH1F *hSecVtxYTGHCback=new TH1F("hSecVtxYTGHCback","hSecVtxY_TightCuts_Background",1000,-3000.,3000.);
4175 TH2F *hSecVtxXYTGHCback=new TH2F("hSecVtxXYTGHCback","hSecVtxXY_TightCuts_Background",1000,-3000.,3000.,1000,-3000.,3000.);
4176 TH1F *hSecVtxPhiTGHCback=new TH1F("hSecVtxPhiTGHCback","hSecVtxPhi_TightCuts_Background",180,-180.1,180.1);
4177 TH1F *hd0singlTrackTGHCback=new TH1F("hd0singlTrackTGHCback","hd0singlTrackTightCuts_Back",1000,-5000.,5000.);
4178 TH1F *hCPtaTGHCback=new TH1F("hCPtaTGHCback","hCPta_TightCuts_Background",100,-1.,1.);
4179 TH1F *hd0xd0TGHCback=new TH1F("hd0xd0TGHCback","hd0xd0_TightCuts_Background",1000,-100000.,100000.);
4180 TH1F *hMassTrueTGHCback=new TH1F("hMassTrueTGHCback","D^{0} MC inv. Mass Tight Cuts Background(All momenta)",600,1.600,2.200);
4181 TH1F *hMassTGHCback=new TH1F("hMassTGHCback","D^{0} inv. Mass Tight Cuts Background (All momenta)",600,1.600,2.200);
4182 hMassTGHCback->Sumw2();
4183 TH1F *hMassTrueTGHCbackPM=new TH1F("hMassTrueTGHCbackPM","D^{0} MC inv. Mass Tight Cuts Background, Mass Peak. (All momenta)",600,1.600,2.200);
4184 TH1F *hMassTGHCbackPM=new TH1F("hMassTGHCbackPM","D^{0} inv. Mass Tight Cuts Background (All momenta), MassPeak",600,1.600,2.200);
4185 hMassTGHCbackPM->Sumw2();
4186 TH1F *hMassTrueTGHCbackSB=new TH1F("hMassTrueTGHCbackSB","D^{0} MC inv. Mass in Side Bands Tight Cuts Backgrround(All momenta)",600,1.600,2.200);
4187 TH1F *hMassTGHCbackSB=new TH1F("hMassTGHCbackSB","D^{0} inv. Mass in Side Bands Tight Cuts Background (All momenta)",600,1.600,2.200);
4188 hMassTGHCbackSB->Sumw2();
4190 flistTghCutsBack->Add(hCPtaVSd0d0TGHCback);
4191 flistTghCutsBack->Add(hSecVtxZTGHCback);
4192 flistTghCutsBack->Add(hSecVtxYTGHCback);
4193 flistTghCutsBack->Add(hSecVtxXTGHCback);
4194 flistTghCutsBack->Add(hSecVtxXYTGHCback);
4195 flistTghCutsBack->Add(hSecVtxPhiTGHCback);
4196 flistTghCutsBack->Add(hd0singlTrackTGHCback);
4197 flistTghCutsBack->Add(hCPtaTGHCback);
4198 flistTghCutsBack->Add(hd0xd0TGHCback);
4199 flistTghCutsBack->Add(hMassTrueTGHCback);
4200 flistTghCutsBack->Add(hMassTGHCback);
4201 flistTghCutsBack->Add(hMassTrueTGHCbackPM);
4202 flistTghCutsBack->Add(hMassTGHCbackPM);
4203 flistTghCutsBack->Add(hMassTrueTGHCbackSB);
4204 flistTghCutsBack->Add(hMassTGHCbackSB);
4212 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
4213 TH1F *hdcaTGHCback=new TH1F("hdcaTGHCback","hdca_TightCuts_Backgr",100,0.,1000.);
4214 hdcaTGHCback->SetXTitle("dca [#mum]");
4215 hdcaTGHCback->SetYTitle("Entries");
4216 TH1F *hcosthetastarTGHCback=new TH1F("hcosthetastarTGHCback","hCosThetaStar_TightCuts_Backgr",50,-1.,1.);
4217 hcosthetastarTGHCback->SetXTitle("cos #theta^{*}");
4218 hcosthetastarTGHCback->SetYTitle("Entries");
4219 TH1F *hptD0TGHCback=new TH1F("hptD0TGHCback","D^{0} transverse momentum distribution",34,ptbinsD0arr);
4220 hptD0TGHCback->SetXTitle("p_{t} [GeV/c]");
4221 hptD0TGHCback->SetYTitle("Entries");
4222 TH1F *hptD0VsMaxPtTGHCback=new TH1F("hptD0VsMaxPtTGHCback","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
4223 TH2F *hptD0PTallsqrtTGHCback=new TH2F("hptD0PTallsqrtTGHCback","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
4224 TH2F *hptD0PTallTGHCback=new TH2F("hptD0PTallTGHCback","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
4225 TH2F *hptD0vsptBTGHCback=new TH2F("hptD0vsptBTGHCback","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4226 TH2F *hpD0vspBTGHCback=new TH2F("hpD0vspBTGHCback","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4227 TH2F *hptD0vsptcquarkTGHCback=new TH2F("hptD0vsptcquarkTGHCback","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4228 TH2F *hpD0vspcquarkTGHCback=new TH2F("hpD0vspcquarkTGHCback","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4229 flistTghCutsBack->Add(hdcaTGHCback);
4230 flistTghCutsBack->Add(hcosthetastarTGHCback);
4231 flistTghCutsBack->Add(hptD0TGHCback);
4232 flistTghCutsBack->Add(hptD0VsMaxPtTGHCback);
4233 flistTghCutsBack->Add(hptD0PTallsqrtTGHCback);
4234 flistTghCutsBack->Add(hptD0PTallTGHCback);
4235 flistTghCutsBack->Add(hptD0vsptBTGHCback);
4236 flistTghCutsBack->Add(hpD0vspBTGHCback);
4237 flistTghCutsBack->Add(hptD0vsptcquarkTGHCback);
4238 flistTghCutsBack->Add(hpD0vspcquarkTGHCback);
4240 TH1F *hd0zD0ptTGHCback;
4241 TH1F *hInvMassD0TGHCback,*hInvMassD0barTGHCback;
4242 TH2F *hInvMassPtTGHCback=new TH2F("hInvMassPtTGHCback","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
4243 THnSparseF *hSparseTGHCback=new THnSparseF("hSparseTGHCback","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
4244 hSparseTGHCback->SetBinEdges(0,massbins);
4245 hSparseTGHCback->SetBinEdges(1,massbins);
4246 hSparseTGHCback->SetBinEdges(2,ptbinsForNsparse);
4247 hSparseTGHCback->SetBinEdges(3,impparbins);
4248 hSparseTGHCback->SetBinEdges(4,massHypoBins);
4249 flistTghCutsBack->Add(hSparseTGHCback);
4251 TH1F *hCosPDPBTGHCback;
4252 TH1F *hCosPcPDTGHCback;
4253 flistTghCutsBack->Add(hInvMassPtTGHCback);
4254 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
4255 TH2F *hd0D0VSd0xd0TGHCbackpt;
4256 TH2F *hangletracksVSd0xd0TGHCbackpt;
4257 TH2F *hangletracksVSd0D0TGHCbackpt;
4258 TH1F *hd0xd0TGHCbackpt;
4260 TH2F *hTOFpidTGHCback=new TH2F("hTOFpidTGHCback","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
4261 flistTghCutsBack->Add(hTOFpidTGHCback);
4264 for(Int_t i=0;i<fnbins;i++){
4265 namehist="hd0zD0ptTGHCback_pt";
4267 titlehist="d0(z) Tight Cuts Backgrm ptbin=";
4269 hd0zD0ptTGHCback=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
4270 hd0zD0ptTGHCback->SetXTitle("d_{0}(z) [#mum]");
4271 hd0zD0ptTGHCback->SetYTitle("Entries");
4272 flistTghCutsBack->Add(hd0zD0ptTGHCback);
4274 namehist="hInvMassD0TGHCback_pt";
4276 titlehist="Invariant Mass Tight Cuts Backgr ptbin=";
4278 hInvMassD0TGHCback=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
4279 hInvMassD0TGHCback->SetXTitle("Invariant Mass [GeV]");
4280 hInvMassD0TGHCback->SetYTitle("Entries");
4281 flistTghCutsBack->Add(hInvMassD0TGHCback);
4283 namehist="hInvMassD0barTGHCback_pt";
4285 titlehist="Invariant Mass D0bar Tight Cuts Back ptbin=";
4287 hInvMassD0barTGHCback=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
4288 hInvMassD0barTGHCback->SetXTitle("Invariant Mass [GeV]");
4289 hInvMassD0barTGHCback->SetYTitle("Entries");
4290 flistTghCutsBack->Add(hInvMassD0barTGHCback);
4292 namehist="hetaTGHCback_pt";
4294 titlehist="eta Tight Cuts Backgr ptbin=";
4296 hetaTGHCback=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
4297 hetaTGHCback->SetXTitle("Pseudorapidity");
4298 hetaTGHCback->SetYTitle("Entries");
4299 flistTghCutsBack->Add(hetaTGHCback);
4301 namehist="hCosPDPBTGHCback_pt";
4303 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
4305 hCosPDPBTGHCback=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
4306 hCosPDPBTGHCback->SetXTitle("Cosine between D0 momentum and B momentum");
4307 hCosPDPBTGHCback->SetYTitle("Entries");
4308 flistTghCutsBack->Add(hCosPDPBTGHCback);
4310 namehist="hCosPcPDTGHCback_pt";
4312 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
4314 hCosPcPDTGHCback=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
4315 hCosPcPDTGHCback->SetXTitle("Cosine between c quark momentum and D0 momentum");
4316 hCosPcPDTGHCback->SetYTitle("Entries");
4317 flistTghCutsBack->Add(hCosPcPDTGHCback);
4319 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
4320 namehist="hd0xd0TGHCback_pt";
4322 titlehist="d0xd0 Tight Cuts Back ptbin=";
4324 hd0xd0TGHCbackpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
4325 hd0xd0TGHCbackpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
4326 hd0xd0TGHCbackpt->SetYTitle("Entries");
4327 flistTghCutsBack->Add(hd0xd0TGHCbackpt);
4330 namehist="hd0D0VSd0xd0TGHCback_pt";
4332 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts Back ptbin=";
4334 hd0D0VSd0xd0TGHCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
4335 hd0D0VSd0xd0TGHCbackpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4336 hd0D0VSd0xd0TGHCbackpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
4337 flistTghCutsBack->Add(hd0D0VSd0xd0TGHCbackpt);
4340 namehist="hangletracksVSd0xd0TGHCback_pt";
4342 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts Back ptbin=";
4344 hangletracksVSd0xd0TGHCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
4345 hangletracksVSd0xd0TGHCbackpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4346 hangletracksVSd0xd0TGHCbackpt->SetYTitle(" angle between K and #p tracks [rad]");
4347 flistTghCutsBack->Add(hangletracksVSd0xd0TGHCbackpt);
4350 namehist="hangletracksVSd0D0TGHCback_pt";
4352 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Tight Cuts Back ptbin=";
4354 hangletracksVSd0D0TGHCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
4355 hangletracksVSd0D0TGHCbackpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
4356 hangletracksVSd0D0TGHCbackpt->SetYTitle(" angle between K and #p tracks [rad]");
4357 flistTghCutsBack->Add(hangletracksVSd0D0TGHCbackpt);
4361 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
4362 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4367 // ####### d0 D0 histos ############
4369 TH1F *hd0D0TGHCbackPM = new TH1F("hd0D0TGHCbackPM","D^{0} impact par. plot , Tight Cuts ,Background,Mass Peak (All momenta)",1000,-1000.,1000.);
4370 hd0D0TGHCbackPM->SetXTitle("Impact parameter [#mum]");
4371 hd0D0TGHCbackPM->SetYTitle("Entries");
4373 TH1F *hd0D0VtxTrueTGHCbackPM = new TH1F("hd0D0VtxTrueTGHCbackPM","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
4374 hd0D0VtxTrueTGHCbackPM->SetXTitle("Impact parameter [#mum]");
4375 hd0D0VtxTrueTGHCbackPM->SetYTitle("Entries");
4377 TH1F *hMCd0D0TGHCbackPM = new TH1F("hMCd0D0TGHCbackPM","D^{0} impact par. plot, Tight Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
4378 hMCd0D0TGHCbackPM->SetXTitle("MC Impact parameter [#mum]");
4379 hMCd0D0TGHCbackPM->SetYTitle("Entries");
4381 TH1F *hd0D0TGHCbackSB = new TH1F("hd0D0TGHCbackSB","D^{0} impact par. plot , Tight Cuts ,Background,Mass Peak (All momenta)",1000,-1000.,1000.);
4382 hd0D0TGHCbackSB->SetXTitle("Impact parameter [#mum]");
4383 hd0D0TGHCbackSB->SetYTitle("Entries");
4385 TH1F *hd0D0VtxTrueTGHCbackSB = new TH1F("hd0D0VtxTrueTGHCbackSB","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
4386 hd0D0VtxTrueTGHCbackSB->SetXTitle("Impact parameter [#mum]");
4387 hd0D0VtxTrueTGHCbackSB->SetYTitle("Entries");
4389 TH1F *hMCd0D0TGHCbackSB = new TH1F("hMCd0D0TGHCbackSB","D^{0} impact par. plot, Tight Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
4390 hMCd0D0TGHCbackSB->SetXTitle("MC Impact parameter [#mum]");
4391 hMCd0D0TGHCbackSB->SetYTitle("Entries");
4393 flistTghCutsBack->Add(hd0D0TGHCbackPM);
4394 flistTghCutsBack->Add(hd0D0VtxTrueTGHCbackPM);
4395 flistTghCutsBack->Add(hMCd0D0TGHCbackPM);
4396 flistTghCutsBack->Add(hd0D0TGHCbackSB);
4397 flistTghCutsBack->Add(hd0D0VtxTrueTGHCbackSB);
4398 flistTghCutsBack->Add(hMCd0D0TGHCbackSB);
4400 TH1F *hd0D0ptTGHCbackPM;
4401 TH1F *hMCd0D0ptTGHCbackPM;
4402 TH1F *hd0D0VtxTrueptTGHCbackPM;
4403 TH1F *hd0D0ptTGHCbackSB;
4404 TH1F *hMCd0D0ptTGHCbackSB;
4405 TH1F *hd0D0VtxTrueptTGHCbackSB;
4406 namehist="hd0D0ptTGHCback_";
4407 titlehist="D^{0} impact par. plot, Tight Cuts, Background, ";
4408 for(Int_t i=0;i<fnbins;i++){
4410 strnamept.Append("PkMss_pt");
4413 strtitlept=titlehist;
4414 strtitlept.Append(" Mass Peak, ");
4415 strtitlept+=fptbins[i];
4416 strtitlept.Append("<= pt <");
4417 strtitlept+=fptbins[i+1];
4418 strtitlept.Append(" [GeV/c]");
4420 hd0D0ptTGHCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4421 hd0D0ptTGHCbackPM->SetXTitle("Impact parameter [#mum] ");
4422 hd0D0ptTGHCbackPM->SetYTitle("Entries");
4423 flistTghCutsBack->Add(hd0D0ptTGHCbackPM);
4425 strnamept.ReplaceAll("hd0D0","hMCd0D0");
4426 hMCd0D0ptTGHCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4427 hMCd0D0ptTGHCbackPM->SetXTitle("MC Impact parameter [#mum] ");
4428 hMCd0D0ptTGHCbackPM->SetYTitle("Entries");
4429 flistTghCutsBack->Add(hMCd0D0ptTGHCbackPM);
4432 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
4433 hd0D0VtxTrueptTGHCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4434 hd0D0VtxTrueptTGHCbackPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
4435 hd0D0VtxTrueptTGHCbackPM->SetYTitle("Entries");
4436 flistTghCutsBack->Add(hd0D0VtxTrueptTGHCbackPM);
4439 strnamept.Append("SBMss_pt");
4442 strtitlept=titlehist;
4443 strtitlept.Append(" Side Bands, ");
4444 strtitlept+=fptbins[i];
4445 strtitlept.Append("<= pt <");
4446 strtitlept+=fptbins[i+1];
4447 strtitlept.Append(" [GeV/c]");
4449 hd0D0ptTGHCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4450 hd0D0ptTGHCbackSB->SetXTitle("Impact parameter [#mum] ");
4451 hd0D0ptTGHCbackSB->SetYTitle("Entries");
4452 flistTghCutsBack->Add(hd0D0ptTGHCbackSB);
4454 strnamept.ReplaceAll("hd0D0","hMCd0D0");
4455 hMCd0D0ptTGHCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4456 hMCd0D0ptTGHCbackSB->SetXTitle("MC Impact parameter [#mum] ");
4457 hMCd0D0ptTGHCbackSB->SetYTitle("Entries");
4458 flistTghCutsBack->Add(hMCd0D0ptTGHCbackSB);
4460 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
4461 hd0D0VtxTrueptTGHCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4462 hd0D0VtxTrueptTGHCbackSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
4463 hd0D0VtxTrueptTGHCbackSB->SetYTitle("Entries");
4464 flistTghCutsBack->Add(hd0D0VtxTrueptTGHCbackSB);
4469 //############ TIGHT CUTS FROMB HISTOGRAMS ###########
4471 //####### global properties histos
4473 TH2F *hCPtaVSd0d0TGHCfromB=new TH2F("hCPtaVSd0d0TGHCfromB","hCPtaVSd0d0_TightCuts_FromB",1000,-100000.,100000.,100,-1.,1.);
4474 TH1F *hSecVtxZTGHCfromB=new TH1F("hSecVtxZTGHCfromB","hSecVtxZ_TightCuts_FromB",1000,-8.,8.);
4475 TH1F *hSecVtxXTGHCfromB=new TH1F("hSecVtxXTGHCfromB","hSecVtxX_TightCuts_FromB",1000,-3000.,3000.);
4476 TH1F *hSecVtxYTGHCfromB=new TH1F("hSecVtxYTGHCfromB","hSecVtxY_TightCuts_FromB",1000,-3000.,3000.);
4477 TH2F *hSecVtxXYTGHCfromB=new TH2F("hSecVtxXYTGHCfromB","hSecVtxXY_TightCuts_FromB",1000,-3000.,3000.,1000,-3000.,3000.);
4478 TH1F *hSecVtxPhiTGHCfromB=new TH1F("hSecVtxPhiTGHCfromB","hSecVtxPhi_TightCuts_FromB",180,-180.1,180.1);
4479 TH1F *hd0singlTrackTGHCfromB=new TH1F("hd0singlTrackTGHCfromB","hd0singlTrackTightCuts_FromB",1000,-5000.,5000.);
4480 TH1F *hCPtaTGHCfromB=new TH1F("hCPtaTGHCfromB","hCPta_TightCuts_FromB",100,-1.,1.);
4481 TH1F *hd0xd0TGHCfromB=new TH1F("hd0xd0TGHCfromB","hd0xd0_TightCuts_FromB",1000,-100000.,100000.);
4482 TH1F *hMassTrueTGHCfromB=new TH1F("hMassTrueTGHCfromB","D^{0} MC inv. Mass Tight Cuts FromB(All momenta)",600,1.600,2.200);
4483 TH1F *hMassTGHCfromB=new TH1F("hMassTGHCfromB","D^{0} inv. Mass Tight Cuts FromB (All momenta)",600,1.600,2.200);
4484 hMassTGHCfromB->Sumw2();
4485 TH1F *hMassTrueTGHCfromBPM=new TH1F("hMassTrueTGHCfromBPM","D^{0} MC inv. Mass Tight Cuts FromB, Mass Peak. (All momenta)",600,1.600,2.200);
4486 TH1F *hMassTGHCfromBPM=new TH1F("hMassTGHCfromBPM","D^{0} inv. Mass Tight Cuts FromB (All momenta), MassPeak",600,1.600,2.200);
4487 hMassTGHCfromBPM->Sumw2();
4488 TH1F *hMassTrueTGHCfromBSB=new TH1F("hMassTrueTGHCfromBSB","D^{0} MC inv. Mass in Side Bands Tight Cuts FromB(All momenta)",600,1.600,2.200);
4489 TH1F *hMassTGHCfromBSB=new TH1F("hMassTGHCfromBSB","D^{0} inv. Mass in Side Bands Tight Cuts FromB (All momenta)",600,1.600,2.200);
4490 hMassTGHCfromBSB->Sumw2();
4492 flistTghCutsFromB->Add(hCPtaVSd0d0TGHCfromB);
4493 flistTghCutsFromB->Add(hSecVtxZTGHCfromB);
4494 flistTghCutsFromB->Add(hSecVtxYTGHCfromB);
4495 flistTghCutsFromB->Add(hSecVtxXTGHCfromB);
4496 flistTghCutsFromB->Add(hSecVtxXYTGHCfromB);
4497 flistTghCutsFromB->Add(hSecVtxPhiTGHCfromB);
4498 flistTghCutsFromB->Add(hd0singlTrackTGHCfromB);
4499 flistTghCutsFromB->Add(hCPtaTGHCfromB);
4500 flistTghCutsFromB->Add(hd0xd0TGHCfromB);
4501 flistTghCutsFromB->Add(hMassTrueTGHCfromB);
4502 flistTghCutsFromB->Add(hMassTGHCfromB);
4503 flistTghCutsFromB->Add(hMassTrueTGHCfromBPM);
4504 flistTghCutsFromB->Add(hMassTGHCfromBPM);
4505 flistTghCutsFromB->Add(hMassTrueTGHCfromBSB);
4506 flistTghCutsFromB->Add(hMassTGHCfromBSB);
4510 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
4511 TH1F *hdcaTGHCfromB=new TH1F("hdcaTGHCfromB","hdca_TightCuts_FromB",100,0.,1000.);
4512 hdcaTGHCfromB->SetXTitle("dca [#mum]");
4513 hdcaTGHCfromB->SetYTitle("Entries");
4514 TH1F *hcosthetastarTGHCfromB=new TH1F("hcosthetastarTGHCfromB","hCosThetaStar_TightCuts_FromB",50,-1.,1.);
4515 hcosthetastarTGHCfromB->SetXTitle("cos #theta^{*}");
4516 hcosthetastarTGHCfromB->SetYTitle("Entries");
4517 TH1F *hptD0TGHCfromB=new TH1F("hptD0TGHCfromB","D^{0} transverse momentum distribution",34,ptbinsD0arr);
4518 hptD0TGHCfromB->SetXTitle("p_{t} [GeV/c]");
4519 hptD0TGHCfromB->SetYTitle("Entries");
4520 TH1F *hptD0VsMaxPtTGHCfromB=new TH1F("hptD0VsMaxPtTGHCfromB","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
4521 TH2F *hptD0PTallsqrtTGHCfromB=new TH2F("hptD0PTallsqrtTGHCfromB","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
4522 TH2F *hptD0PTallTGHCfromB=new TH2F("hptD0PTallTGHCfromB","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
4523 TH2F *hptD0vsptBTGHCfromB=new TH2F("hptD0vsptBTGHCfromB","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4524 TH2F *hpD0vspBTGHCfromB=new TH2F("hpD0vspBTGHCfromB","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4525 TH2F *hptD0vsptcquarkTGHCfromB=new TH2F("hptD0vsptcquarkTGHCfromB","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4526 TH2F *hpD0vspcquarkTGHCfromB=new TH2F("hpD0vspcquarkTGHCfromB","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4527 flistTghCutsFromB->Add(hdcaTGHCfromB);
4528 flistTghCutsFromB->Add(hcosthetastarTGHCfromB);
4529 flistTghCutsFromB->Add(hptD0TGHCfromB);
4530 flistTghCutsFromB->Add(hptD0VsMaxPtTGHCfromB);
4531 flistTghCutsFromB->Add(hptD0PTallsqrtTGHCfromB);
4532 flistTghCutsFromB->Add(hptD0PTallTGHCfromB);
4533 flistTghCutsFromB->Add(hptD0vsptBTGHCfromB);
4534 flistTghCutsFromB->Add(hpD0vspBTGHCfromB);
4535 flistTghCutsFromB->Add(hptD0vsptcquarkTGHCfromB);
4536 flistTghCutsFromB->Add(hpD0vspcquarkTGHCfromB);
4538 TH1F *hd0zD0ptTGHCfromB;
4539 TH1F *hInvMassD0TGHCfromB,*hInvMassD0barTGHCfromB;
4540 TH2F *hInvMassPtTGHCfromB=new TH2F("hInvMassPtTGHCfromB","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
4541 THnSparseF *hSparseTGHCfromB=new THnSparseF("hSparseTGHCfromB","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
4542 hSparseTGHCfromB->SetBinEdges(0,massbins);
4543 hSparseTGHCfromB->SetBinEdges(1,massbins);
4544 hSparseTGHCfromB->SetBinEdges(2,ptbinsForNsparse);
4545 hSparseTGHCfromB->SetBinEdges(3,impparbins);
4546 hSparseTGHCfromB->SetBinEdges(4,massHypoBins);
4547 flistTghCutsFromB->Add(hSparseTGHCfromB);
4550 THnSparseF *hSparseRecoTGHCfromB=new THnSparseF("hSparseRecoTGHCfromB","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
4551 hSparseRecoTGHCfromB->SetBinEdges(0,massbins);
4552 hSparseRecoTGHCfromB->SetBinEdges(1,massbins);
4553 hSparseRecoTGHCfromB->SetBinEdges(2,ptbinsForNsparse);
4554 hSparseRecoTGHCfromB->SetBinEdges(3,impparbins);
4555 hSparseRecoTGHCfromB->SetBinEdges(4,massHypoBins);
4556 flistTghCutsFromB->Add(hSparseRecoTGHCfromB);
4558 TH1F *hetaTGHCfromB;
4559 TH1F *hCosPDPBTGHCfromB;
4560 TH1F *hCosPcPDTGHCfromB;
4561 flistTghCutsFromB->Add(hInvMassPtTGHCfromB);
4562 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
4563 TH2F *hd0D0VSd0xd0TGHCfromBpt;
4564 TH2F *hangletracksVSd0xd0TGHCfromBpt;
4565 TH2F *hangletracksVSd0D0TGHCfromBpt;
4566 TH1F *hd0xd0TGHCfromBpt;
4568 TH2F *hTOFpidTGHCfromB=new TH2F("hTOFpidTGHCfromB","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
4569 flistTghCutsFromB->Add(hTOFpidTGHCfromB);
4572 for(Int_t i=0;i<fnbins;i++){
4573 namehist="hd0zD0ptTGHCfromB_pt";
4575 titlehist="d0(z) Tight Cuts FromBm ptbin=";
4577 hd0zD0ptTGHCfromB=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
4578 hd0zD0ptTGHCfromB->SetXTitle("d_{0}(z) [#mum]");
4579 hd0zD0ptTGHCfromB->SetYTitle("Entries");
4580 flistTghCutsFromB->Add(hd0zD0ptTGHCfromB);
4582 namehist="hInvMassD0TGHCfromB_pt";
4584 titlehist="Invariant Mass Tight Cuts FromB ptbin=";
4586 hInvMassD0TGHCfromB=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
4587 hInvMassD0TGHCfromB->SetXTitle("Invariant Mass [GeV]");
4588 hInvMassD0TGHCfromB->SetYTitle("Entries");
4589 flistTghCutsFromB->Add(hInvMassD0TGHCfromB);
4591 namehist="hInvMassD0barTGHCfromB_pt";
4593 titlehist="Invariant Mass D0bar Tight Cuts FromB ptbin=";
4595 hInvMassD0barTGHCfromB=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
4596 hInvMassD0barTGHCfromB->SetXTitle("Invariant Mass [GeV]");
4597 hInvMassD0barTGHCfromB->SetYTitle("Entries");
4598 flistTghCutsFromB->Add(hInvMassD0barTGHCfromB);
4600 namehist="hetaTGHCfromB_pt";
4602 titlehist="eta Tight Cuts FromB ptbin=";
4604 hetaTGHCfromB=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
4605 hetaTGHCfromB->SetXTitle("Pseudorapidity");
4606 hetaTGHCfromB->SetYTitle("Entries");
4607 flistTghCutsFromB->Add(hetaTGHCfromB);
4609 namehist="hCosPDPBTGHCfromB_pt";
4611 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
4613 hCosPDPBTGHCfromB=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
4614 hCosPDPBTGHCfromB->SetXTitle("Cosine between D0 momentum and B momentum");
4615 hCosPDPBTGHCfromB->SetYTitle("Entries");
4616 flistTghCutsFromB->Add(hCosPDPBTGHCfromB);
4618 namehist="hCosPcPDTGHCfromB_pt";
4620 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
4622 hCosPcPDTGHCfromB=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
4623 hCosPcPDTGHCfromB->SetXTitle("Cosine between c quark momentum and D0 momentum");
4624 hCosPcPDTGHCfromB->SetYTitle("Entries");
4625 flistTghCutsFromB->Add(hCosPcPDTGHCfromB);
4627 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
4628 namehist="hd0xd0TGHCfromB_pt";
4630 titlehist="d0xd0 Tight Cuts FromB ptbin=";
4632 hd0xd0TGHCfromBpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
4633 hd0xd0TGHCfromBpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
4634 hd0xd0TGHCfromBpt->SetYTitle("Entries");
4635 flistTghCutsFromB->Add(hd0xd0TGHCfromBpt);
4638 namehist="hd0D0VSd0xd0TGHCfromB_pt";
4640 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts FromB ptbin=";
4642 hd0D0VSd0xd0TGHCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
4643 hd0D0VSd0xd0TGHCfromBpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4644 hd0D0VSd0xd0TGHCfromBpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
4645 flistTghCutsFromB->Add(hd0D0VSd0xd0TGHCfromBpt);
4648 namehist="hangletracksVSd0xd0TGHCfromB_pt";
4650 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts FromB ptbin=";
4652 hangletracksVSd0xd0TGHCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
4653 hangletracksVSd0xd0TGHCfromBpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4654 hangletracksVSd0xd0TGHCfromBpt->SetYTitle(" angle between K and #p tracks [rad]");
4655 flistTghCutsFromB->Add(hangletracksVSd0xd0TGHCfromBpt);
4658 namehist="hangletracksVSd0D0TGHCfromB_pt";
4660 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Tight Cuts FromB ptbin=";
4662 hangletracksVSd0D0TGHCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
4663 hangletracksVSd0D0TGHCfromBpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
4664 hangletracksVSd0D0TGHCfromBpt->SetYTitle(" angle between K and #p tracks [rad]");
4665 flistTghCutsFromB->Add(hangletracksVSd0D0TGHCfromBpt);
4668 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
4669 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4675 // ######### d0 D0 histos ##############
4676 TH1F *hd0D0TGHCfromBPM = new TH1F("hd0D0TGHCfromBPM","D^{0} impact par. plot , Tight Cuts ,FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
4677 hd0D0TGHCfromBPM->SetXTitle("Impact parameter [#mum]");
4678 hd0D0TGHCfromBPM->SetYTitle("Entries");
4680 TH1F *hd0D0VtxTrueTGHCfromBPM = new TH1F("hd0D0VtxTrueTGHCfromBPM","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
4681 hd0D0VtxTrueTGHCfromBPM->SetXTitle("Impact parameter [#mum]");
4682 hd0D0VtxTrueTGHCfromBPM->SetYTitle("Entries");
4684 TH1F *hMCd0D0TGHCfromBPM = new TH1F("hMCd0D0TGHCfromBPM","D^{0} impact par. plot, Tight Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
4685 hMCd0D0TGHCfromBPM->SetXTitle("MC Impact parameter [#mum]");
4686 hMCd0D0TGHCfromBPM->SetYTitle("Entries");
4688 TH1F *hd0D0TGHCfromBSB = new TH1F("hd0D0TGHCfromBSB","D^{0} impact par. plot , Tight Cuts ,FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
4689 hd0D0TGHCfromBSB->SetXTitle("Impact parameter [#mum]");
4690 hd0D0TGHCfromBSB->SetYTitle("Entries");
4692 TH1F *hd0D0VtxTrueTGHCfromBSB = new TH1F("hd0D0VtxTrueTGHCfromBSB","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
4693 hd0D0VtxTrueTGHCfromBSB->SetXTitle("Impact parameter [#mum]");
4694 hd0D0VtxTrueTGHCfromBSB->SetYTitle("Entries");
4696 TH1F *hMCd0D0TGHCfromBSB = new TH1F("hMCd0D0TGHCfromBSB","D^{0} impact par. plot, Tight Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
4697 hMCd0D0TGHCfromBSB->SetXTitle("MC Impact parameter [#mum]");
4698 hMCd0D0TGHCfromBSB->SetYTitle("Entries");
4700 flistTghCutsFromB->Add(hd0D0TGHCfromBPM);
4701 flistTghCutsFromB->Add(hd0D0VtxTrueTGHCfromBPM);
4702 flistTghCutsFromB->Add(hMCd0D0TGHCfromBPM);
4703 flistTghCutsFromB->Add(hd0D0TGHCfromBSB);
4704 flistTghCutsFromB->Add(hd0D0VtxTrueTGHCfromBSB);
4705 flistTghCutsFromB->Add(hMCd0D0TGHCfromBSB);
4707 TH1F *hd0D0ptTGHCfromBPM;
4708 TH1F *hMCd0D0ptTGHCfromBPM;
4709 TH1F *hd0D0VtxTrueptTGHCfromBPM;
4710 TH1F *hd0D0ptTGHCfromBSB;
4711 TH1F *hMCd0D0ptTGHCfromBSB;
4712 TH1F *hd0D0VtxTrueptTGHCfromBSB;
4713 namehist="hd0D0ptTGHCfromB_";
4714 titlehist="D^{0} impact par. plot, Tight Cuts, FromB, ";
4715 for(Int_t i=0;i<fnbins;i++){
4717 strnamept.Append("PkMss_pt");
4720 strtitlept=titlehist;
4721 strtitlept.Append(" Mass Peak, ");
4722 strtitlept+=fptbins[i];
4723 strtitlept.Append("<= pt <");
4724 strtitlept+=fptbins[i+1];
4725 strtitlept.Append(" [GeV/c]");
4727 hd0D0ptTGHCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4728 hd0D0ptTGHCfromBPM->SetXTitle("Impact parameter [#mum] ");
4729 hd0D0ptTGHCfromBPM->SetYTitle("Entries");
4730 flistTghCutsFromB->Add(hd0D0ptTGHCfromBPM);
4732 strnamept.ReplaceAll("hd0D0","hMCd0D0");
4733 hMCd0D0ptTGHCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4734 hMCd0D0ptTGHCfromBPM->SetXTitle("MC Impact parameter [#mum] ");
4735 hMCd0D0ptTGHCfromBPM->SetYTitle("Entries");
4736 flistTghCutsFromB->Add(hMCd0D0ptTGHCfromBPM);
4739 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
4740 hd0D0VtxTrueptTGHCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4741 hd0D0VtxTrueptTGHCfromBPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
4742 hd0D0VtxTrueptTGHCfromBPM->SetYTitle("Entries");
4743 flistTghCutsFromB->Add(hd0D0VtxTrueptTGHCfromBPM);
4746 strnamept.Append("SBMss_pt");
4749 strtitlept=titlehist;
4750 strtitlept.Append(" Side Bands, ");
4751 strtitlept+=fptbins[i];
4752 strtitlept.Append("<= pt <");
4753 strtitlept+=fptbins[i+1];
4754 strtitlept.Append(" [GeV/c]");
4756 hd0D0ptTGHCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4757 hd0D0ptTGHCfromBSB->SetXTitle("Impact parameter [#mum] ");
4758 hd0D0ptTGHCfromBSB->SetYTitle("Entries");
4759 flistTghCutsFromB->Add(hd0D0ptTGHCfromBSB);
4761 strnamept.ReplaceAll("hd0D0","hMCd0D0");
4762 hMCd0D0ptTGHCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4763 hMCd0D0ptTGHCfromBSB->SetXTitle("MC Impact parameter [#mum] ");
4764 hMCd0D0ptTGHCfromBSB->SetYTitle("Entries");
4765 flistTghCutsFromB->Add(hMCd0D0ptTGHCfromBSB);
4767 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
4768 hd0D0VtxTrueptTGHCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4769 hd0D0VtxTrueptTGHCfromBSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
4770 hd0D0VtxTrueptTGHCfromBSB->SetYTitle("Entries");
4771 flistTghCutsFromB->Add(hd0D0VtxTrueptTGHCfromBSB);
4776 //############ TIGHT CUTS FROM DSTAR HISTOGRAMS ###########
4778 //############## global properties histos
4779 TH2F *hCPtaVSd0d0TGHCfromDstar=new TH2F("hCPtaVSd0d0TGHCfromDstar","hCPtaVSd0d0_TightCuts_FromDStar",1000,-100000.,100000.,100,-1.,1.);
4780 TH1F *hSecVtxZTGHCfromDstar=new TH1F("hSecVtxZTGHCfromDstar","hSecVtxZ_TightCuts_FromDStar",1000,-8.,8.);
4781 TH1F *hSecVtxXTGHCfromDstar=new TH1F("hSecVtxXTGHCfromDstar","hSecVtxX_TightCuts_FromDStar",1000,-3000.,3000.);
4782 TH1F *hSecVtxYTGHCfromDstar=new TH1F("hSecVtxYTGHCfromDstar","hSecVtxY_TightCuts_FromDStar",1000,-3000.,3000.);
4783 TH2F *hSecVtxXYTGHCfromDstar=new TH2F("hSecVtxXYTGHCfromDstar","hSecVtxXY_TightCuts_FromDStar",1000,-3000.,3000.,1000,-3000.,3000.);
4784 TH1F *hSecVtxPhiTGHCfromDstar=new TH1F("hSecVtxPhiTGHCfromDstar","hSecVtxPhi_TightCuts_FromDStar",180,-180.1,180.1);
4785 TH1F *hd0singlTrackTGHCfromDstar=new TH1F("hd0singlTrackTGHCfromDstar","hd0singlTrackTightCuts_FromDstar",1000,-5000.,5000.);
4786 TH1F *hCPtaTGHCfromDstar=new TH1F("hCPtaTGHCfromDstar","hCPta_TightCuts_FromDStar",100,-1.,1.);
4787 TH1F *hd0xd0TGHCfromDstar=new TH1F("hd0xd0TGHCfromDstar","hd0xd0_TightCuts_FromDStar",1000,-100000.,100000.);
4788 TH1F *hMassTrueTGHCfromDstar=new TH1F("hMassTrueTGHCfromDstar","D^{0} MC inv. Mass Tight Cuts FromDStar(All momenta)",600,1.600,2.200);
4789 TH1F *hMassTGHCfromDstar=new TH1F("hMassTGHCfromDstar","D^{0} inv. Mass Tight Cuts FromDStar (All momenta)",600,1.600,2.200);
4790 hMassTGHCfromDstar->Sumw2();
4791 TH1F *hMassTrueTGHCfromDstarPM=new TH1F("hMassTrueTGHCfromDstarPM","D^{0} MC inv. Mass Tight Cuts FromDStar, Mass Peak. (All momenta)",600,1.600,2.200);
4792 TH1F *hMassTGHCfromDstarPM=new TH1F("hMassTGHCfromDstarPM","D^{0} inv. Mass Tight Cuts FromDStar (All momenta), MassPeak",600,1.600,2.200);
4793 hMassTGHCfromDstarPM->Sumw2();
4794 TH1F *hMassTrueTGHCfromDstarSB=new TH1F("hMassTrueTGHCfromDstarSB","D^{0} MC inv. Mass in Side Bands Tight Cuts FromDStar(All momenta)",600,1.600,2.200);
4795 TH1F *hMassTGHCfromDstarSB=new TH1F("hMassTGHCfromDstarSB","D^{0} inv. Mass in Side Bands Tight Cuts FromDStar (All momenta)",600,1.600,2.200);
4796 hMassTGHCfromDstarSB->Sumw2();
4798 flistTghCutsFromDstar->Add(hCPtaVSd0d0TGHCfromDstar);
4799 flistTghCutsFromDstar->Add(hSecVtxZTGHCfromDstar);
4800 flistTghCutsFromDstar->Add(hSecVtxYTGHCfromDstar);
4801 flistTghCutsFromDstar->Add(hSecVtxXTGHCfromDstar);
4802 flistTghCutsFromDstar->Add(hSecVtxXYTGHCfromDstar);
4803 flistTghCutsFromDstar->Add(hSecVtxPhiTGHCfromDstar);
4804 flistTghCutsFromDstar->Add(hd0singlTrackTGHCfromDstar);
4805 flistTghCutsFromDstar->Add(hCPtaTGHCfromDstar);
4806 flistTghCutsFromDstar->Add(hd0xd0TGHCfromDstar);
4807 flistTghCutsFromDstar->Add(hMassTrueTGHCfromDstar);
4808 flistTghCutsFromDstar->Add(hMassTGHCfromDstar);
4809 flistTghCutsFromDstar->Add(hMassTrueTGHCfromDstarPM);
4810 flistTghCutsFromDstar->Add(hMassTGHCfromDstarPM);
4811 flistTghCutsFromDstar->Add(hMassTrueTGHCfromDstarSB);
4812 flistTghCutsFromDstar->Add(hMassTGHCfromDstarSB);
4818 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
4819 TH1F *hdcaTGHCfromDstar=new TH1F("hdcaTGHCfromDstar","hdca_TightCuts_FromDstar",100,0.,1000.);
4820 hdcaTGHCfromDstar->SetXTitle("dca [#mum]");
4821 hdcaTGHCfromDstar->SetYTitle("Entries");
4822 TH1F *hcosthetastarTGHCfromDstar=new TH1F("hcosthetastarTGHCfromDstar","hCosThetaStar_TightCuts_FromDstar",50,-1.,1.);
4823 hcosthetastarTGHCfromDstar->SetXTitle("cos #theta^{*}");
4824 hcosthetastarTGHCfromDstar->SetYTitle("Entries");
4825 TH1F *hptD0TGHCfromDstar=new TH1F("hptD0TGHCfromDstar","D^{0} transverse momentum distribution",34,ptbinsD0arr);
4826 hptD0TGHCfromDstar->SetXTitle("p_{t} [GeV/c]");
4827 hptD0TGHCfromDstar->SetYTitle("Entries");
4828 TH1F *hptD0VsMaxPtTGHCfromDstar=new TH1F("hptD0VsMaxPtTGHCfromDstar","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
4829 TH2F *hptD0PTallsqrtTGHCfromDstar=new TH2F("hptD0PTallsqrtTGHCfromDstar","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
4830 TH2F *hptD0PTallTGHCfromDstar=new TH2F("hptD0PTallTGHCfromDstar","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
4831 TH2F *hptD0vsptBTGHCfromDstar=new TH2F("hptD0vsptBTGHCfromDstar","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4832 TH2F *hpD0vspBTGHCfromDstar=new TH2F("hpD0vspBTGHCfromDstar","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4833 TH2F *hptD0vsptcquarkTGHCfromDstar=new TH2F("hptD0vsptcquarkTGHCfromDstar","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4834 TH2F *hpD0vspcquarkTGHCfromDstar=new TH2F("hpD0vspcquarkTGHCfromDstar","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4835 flistTghCutsFromDstar->Add(hdcaTGHCfromDstar);
4836 flistTghCutsFromDstar->Add(hcosthetastarTGHCfromDstar);
4837 flistTghCutsFromDstar->Add(hptD0TGHCfromDstar);
4838 flistTghCutsFromDstar->Add(hptD0VsMaxPtTGHCfromDstar);
4839 flistTghCutsFromDstar->Add(hptD0PTallsqrtTGHCfromDstar);
4840 flistTghCutsFromDstar->Add(hptD0PTallTGHCfromDstar);
4841 flistTghCutsFromDstar->Add(hptD0vsptBTGHCfromDstar);
4842 flistTghCutsFromDstar->Add(hpD0vspBTGHCfromDstar);
4843 flistTghCutsFromDstar->Add(hptD0vsptcquarkTGHCfromDstar);
4844 flistTghCutsFromDstar->Add(hpD0vspcquarkTGHCfromDstar);
4846 TH1F *hd0zD0ptTGHCfromDstar;
4847 TH1F *hInvMassD0TGHCfromDstar,*hInvMassD0barTGHCfromDstar;
4848 TH1F *hetaTGHCfromDstar;
4849 TH2F *hInvMassPtTGHCfromDstar=new TH2F("hInvMassPtTGHCfromDstar","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
4850 THnSparseF *hSparseTGHCfromDstar=new THnSparseF("hSparseTGHCfromDstar","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
4851 hSparseTGHCfromDstar->SetBinEdges(0,massbins);
4852 hSparseTGHCfromDstar->SetBinEdges(1,massbins);
4853 hSparseTGHCfromDstar->SetBinEdges(2,ptbinsForNsparse);
4854 hSparseTGHCfromDstar->SetBinEdges(3,impparbins);
4855 hSparseTGHCfromDstar->SetBinEdges(4,massHypoBins);
4856 flistTghCutsFromDstar->Add(hSparseTGHCfromDstar);
4857 TH1F *hCosPDPBTGHCfromDstar;
4858 TH1F *hCosPcPDTGHCfromDstar;
4859 flistTghCutsFromDstar->Add(hInvMassPtTGHCfromDstar);
4860 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
4861 TH2F *hd0D0VSd0xd0TGHCfromDstarpt;
4862 TH2F *hangletracksVSd0xd0TGHCfromDstarpt;
4863 TH2F *hangletracksVSd0D0TGHCfromDstarpt;
4864 TH1F *hd0xd0TGHCfromDstarpt;
4866 TH2F *hTOFpidTGHCfromDstar=new TH2F("hTOFpidTGHCfromDstar","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
4867 flistTghCutsFromDstar->Add(hTOFpidTGHCfromDstar);
4869 for(Int_t i=0;i<fnbins;i++){
4870 namehist="hd0zD0ptTGHCfromDstar_pt";
4872 titlehist="d0(z) Tight Cuts FromDstarm ptbin=";
4874 hd0zD0ptTGHCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
4875 hd0zD0ptTGHCfromDstar->SetXTitle("d_{0}(z) [#mum]");
4876 hd0zD0ptTGHCfromDstar->SetYTitle("Entries");
4877 flistTghCutsFromDstar->Add(hd0zD0ptTGHCfromDstar);
4879 namehist="hInvMassD0TGHCfromDstar_pt";
4881 titlehist="Invariant Mass Tight Cuts FromDstar ptbin=";
4883 hInvMassD0TGHCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
4884 hInvMassD0TGHCfromDstar->SetXTitle("Invariant Mass [GeV]");
4885 hInvMassD0TGHCfromDstar->SetYTitle("Entries");
4886 flistTghCutsFromDstar->Add(hInvMassD0TGHCfromDstar);
4888 namehist="hInvMassD0barTGHCfromDstar_pt";
4890 titlehist="Invariant Mass D0bar Tight Cuts FromDstar ptbin=";
4892 hInvMassD0barTGHCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
4893 hInvMassD0barTGHCfromDstar->SetXTitle("Invariant Mass [GeV]");
4894 hInvMassD0barTGHCfromDstar->SetYTitle("Entries");
4895 flistTghCutsFromDstar->Add(hInvMassD0barTGHCfromDstar);
4897 namehist="hetaTGHCfromDstar_pt";
4899 titlehist="eta Tight Cuts FromDstar ptbin=";
4901 hetaTGHCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
4902 hetaTGHCfromDstar->SetXTitle("Pseudorapidity");
4903 hetaTGHCfromDstar->SetYTitle("Entries");
4904 flistTghCutsFromDstar->Add(hetaTGHCfromDstar);
4906 namehist="hCosPDPBTGHCfromDstar_pt";
4908 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
4910 hCosPDPBTGHCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
4911 hCosPDPBTGHCfromDstar->SetXTitle("Cosine between D0 momentum and B momentum");
4912 hCosPDPBTGHCfromDstar->SetYTitle("Entries");
4913 flistTghCutsFromDstar->Add(hCosPDPBTGHCfromDstar);
4915 namehist="hCosPcPDTGHCfromDstar_pt";
4917 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
4919 hCosPcPDTGHCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
4920 hCosPcPDTGHCfromDstar->SetXTitle("Cosine between c quark momentum and D0 momentum");
4921 hCosPcPDTGHCfromDstar->SetYTitle("Entries");
4922 flistTghCutsFromDstar->Add(hCosPcPDTGHCfromDstar);
4924 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
4925 namehist="hd0xd0TGHCfromDstar_pt";
4927 titlehist="d0xd0 Tight Cuts FromDstar ptbin=";
4929 hd0xd0TGHCfromDstarpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
4930 hd0xd0TGHCfromDstarpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
4931 hd0xd0TGHCfromDstarpt->SetYTitle("Entries");
4932 flistTghCutsFromDstar->Add(hd0xd0TGHCfromDstarpt);
4935 namehist="hd0D0VSd0xd0TGHCfromDstar_pt";
4937 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts FromDstar ptbin=";
4939 hd0D0VSd0xd0TGHCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
4940 hd0D0VSd0xd0TGHCfromDstarpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4941 hd0D0VSd0xd0TGHCfromDstarpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
4942 flistTghCutsFromDstar->Add(hd0D0VSd0xd0TGHCfromDstarpt);
4945 namehist="hangletracksVSd0xd0TGHCfromDstar_pt";
4947 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts FromDstar ptbin=";
4949 hangletracksVSd0xd0TGHCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
4950 hangletracksVSd0xd0TGHCfromDstarpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4951 hangletracksVSd0xd0TGHCfromDstarpt->SetYTitle(" angle between K and #p tracks [rad]");
4952 flistTghCutsFromDstar->Add(hangletracksVSd0xd0TGHCfromDstarpt);
4955 namehist="hangletracksVSd0D0TGHCfromDstar_pt";
4957 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Tight Cuts FromDstar ptbin=";
4959 hangletracksVSd0D0TGHCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
4960 hangletracksVSd0D0TGHCfromDstarpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
4961 hangletracksVSd0D0TGHCfromDstarpt->SetYTitle(" angle between K and #p tracks [rad]");
4962 flistTghCutsFromDstar->Add(hangletracksVSd0D0TGHCfromDstarpt);
4966 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
4967 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4970 //########## d0 D0 histos #############
4971 TH1F *hd0D0TGHCfromDstPM = new TH1F("hd0D0TGHCfromDstarPM","D^{0} impact par. plot , Tight Cuts ,FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
4972 hd0D0TGHCfromDstPM->SetXTitle("Impact parameter [#mum]");
4973 hd0D0TGHCfromDstPM->SetYTitle("Entries");
4975 TH1F *hd0D0VtxTrueTGHCfromDstPM = new TH1F("hd0D0VtxTrueTGHCfromDstarPM","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
4976 hd0D0VtxTrueTGHCfromDstPM->SetXTitle("Impact parameter [#mum]");
4977 hd0D0VtxTrueTGHCfromDstPM->SetYTitle("Entries");
4979 TH1F *hMCd0D0TGHCfromDstPM = new TH1F("hMCd0D0TGHCfromDstarPM","D^{0} impact par. plot, Tight Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
4980 hMCd0D0TGHCfromDstPM->SetXTitle("MC Impact parameter [#mum]");
4981 hMCd0D0TGHCfromDstPM->SetYTitle("Entries");
4983 TH1F *hd0D0TGHCfromDstSB = new TH1F("hd0D0TGHCfromDstarSB","D^{0} impact par. plot , Tight Cuts ,FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
4984 hd0D0TGHCfromDstSB->SetXTitle("Impact parameter [#mum]");
4985 hd0D0TGHCfromDstSB->SetYTitle("Entries");
4987 TH1F *hd0D0VtxTrueTGHCfromDstSB = new TH1F("hd0D0VtxTrueTGHCfromDstarSB","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
4988 hd0D0VtxTrueTGHCfromDstSB->SetXTitle("Impact parameter [#mum]");
4989 hd0D0VtxTrueTGHCfromDstSB->SetYTitle("Entries");
4991 TH1F *hMCd0D0TGHCfromDstSB = new TH1F("hMCd0D0TGHCfromDstarSB","D^{0} impact par. plot, Tight Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
4992 hMCd0D0TGHCfromDstSB->SetXTitle("MC Impact parameter [#mum]");
4993 hMCd0D0TGHCfromDstSB->SetYTitle("Entries");
4995 flistTghCutsFromDstar->Add(hd0D0TGHCfromDstPM);
4996 flistTghCutsFromDstar->Add(hd0D0VtxTrueTGHCfromDstPM);
4997 flistTghCutsFromDstar->Add(hMCd0D0TGHCfromDstPM);
4998 flistTghCutsFromDstar->Add(hd0D0TGHCfromDstSB);
4999 flistTghCutsFromDstar->Add(hd0D0VtxTrueTGHCfromDstSB);
5000 flistTghCutsFromDstar->Add(hMCd0D0TGHCfromDstSB);
5002 TH1F *hd0D0ptTGHCfromDstPM;
5003 TH1F *hMCd0D0ptTGHCfromDstPM;
5004 TH1F *hd0D0VtxTrueptTGHCfromDstPM;
5005 TH1F *hd0D0ptTGHCfromDstSB;
5006 TH1F *hMCd0D0ptTGHCfromDstSB;
5007 TH1F *hd0D0VtxTrueptTGHCfromDstSB;
5008 namehist="hd0D0ptTGHCfromDstar_";
5009 titlehist="D^{0} impact par. plot, Tight Cuts, FromDStar, ";
5010 for(Int_t i=0;i<fnbins;i++){
5012 strnamept.Append("PkMss_pt");
5015 strtitlept=titlehist;
5016 strtitlept.Append(" Mass Peak, ");
5017 strtitlept+=fptbins[i];
5018 strtitlept.Append("<= pt <");
5019 strtitlept+=fptbins[i+1];
5020 strtitlept.Append(" [GeV/c]");
5022 hd0D0ptTGHCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5023 hd0D0ptTGHCfromDstPM->SetXTitle("Impact parameter [#mum] ");
5024 hd0D0ptTGHCfromDstPM->SetYTitle("Entries");
5025 flistTghCutsFromDstar->Add(hd0D0ptTGHCfromDstPM);
5027 strnamept.ReplaceAll("hd0D0","hMCd0D0");
5028 hMCd0D0ptTGHCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5029 hMCd0D0ptTGHCfromDstPM->SetXTitle("MC Impact parameter [#mum] ");
5030 hMCd0D0ptTGHCfromDstPM->SetYTitle("Entries");
5031 flistTghCutsFromDstar->Add(hMCd0D0ptTGHCfromDstPM);
5034 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
5035 hd0D0VtxTrueptTGHCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5036 hd0D0VtxTrueptTGHCfromDstPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
5037 hd0D0VtxTrueptTGHCfromDstPM->SetYTitle("Entries");
5038 flistTghCutsFromDstar->Add(hd0D0VtxTrueptTGHCfromDstPM);
5041 strnamept.Append("SBMss_pt");
5044 strtitlept=titlehist;
5045 strtitlept.Append(" Side Bands, ");
5046 strtitlept+=fptbins[i];
5047 strtitlept.Append("<= pt <");
5048 strtitlept+=fptbins[i+1];
5049 strtitlept.Append(" [GeV/c]");
5051 hd0D0ptTGHCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5052 hd0D0ptTGHCfromDstSB->SetXTitle("Impact parameter [#mum] ");
5053 hd0D0ptTGHCfromDstSB->SetYTitle("Entries");
5054 flistTghCutsFromDstar->Add(hd0D0ptTGHCfromDstSB);
5056 strnamept.ReplaceAll("hd0D0","hMCd0D0");
5057 hMCd0D0ptTGHCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5058 hMCd0D0ptTGHCfromDstSB->SetXTitle("MC Impact parameter [#mum] ");
5059 hMCd0D0ptTGHCfromDstSB->SetYTitle("Entries");
5060 flistTghCutsFromDstar->Add(hMCd0D0ptTGHCfromDstSB);
5062 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
5063 hd0D0VtxTrueptTGHCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5064 hd0D0VtxTrueptTGHCfromDstSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
5065 hd0D0VtxTrueptTGHCfromDstSB->SetYTitle("Entries");
5066 flistTghCutsFromDstar->Add(hd0D0VtxTrueptTGHCfromDstSB);
5070 //############ TIGHT CUTS OTHER HISTOGRAMS ###########
5072 //########### global properties histos ###########
5074 TH2F *hCPtaVSd0d0TGHCother=new TH2F("hCPtaVSd0d0TGHCother","hCPtaVSd0d0_TightCuts_other",1000,-100000.,100000.,100,-1.,1.);
5075 TH1F *hSecVtxZTGHCother=new TH1F("hSecVtxZTGHCother","hSecVtxZ_TightCuts_other",1000,-8.,8.);
5076 TH1F *hSecVtxXTGHCother=new TH1F("hSecVtxXTGHCother","hSecVtxX_TightCuts_other",1000,-3000.,3000.);
5077 TH1F *hSecVtxYTGHCother=new TH1F("hSecVtxYTGHCother","hSecVtxY_TightCuts_other",1000,-3000.,3000.);
5078 TH2F *hSecVtxXYTGHCother=new TH2F("hSecVtxXYTGHCother","hSecVtxXY_TightCuts_other",1000,-3000.,3000.,1000,-3000.,3000.);
5079 TH1F *hSecVtxPhiTGHCother=new TH1F("hSecVtxPhiTGHCother","hSecVtxPhi_TightCuts_other",180,-180.1,180.1);
5080 TH1F *hd0singlTrackTGHCother=new TH1F("hd0singlTrackTGHCother","hd0singlTrackTightCuts_Other",1000,-5000.,5000.);
5081 TH1F *hCPtaTGHCother=new TH1F("hCPtaTGHCother","hCPta_TightCuts_other",100,-1.,1.);
5082 TH1F *hd0xd0TGHCother=new TH1F("hd0xd0TGHCother","hd0xd0_TightCuts_other",1000,-100000.,100000.);
5083 TH1F *hMassTrueTGHCother=new TH1F("hMassTrueTGHCother","D^{0} MC inv. Mass Tight Cuts other(All momenta)",600,1.600,2.200);
5084 TH1F *hMassTGHCother=new TH1F("hMassTGHCother","D^{0} inv. Mass Tight Cuts other (All momenta)",600,1.600,2.200);
5085 hMassTGHCother->Sumw2();
5086 TH1F *hMassTrueTGHCotherPM=new TH1F("hMassTrueTGHCotherPM","D^{0} MC inv. Mass Tight Cuts other, Mass Peak. (All momenta)",600,1.600,2.200);
5087 TH1F *hMassTGHCotherPM=new TH1F("hMassTGHCotherPM","D^{0} inv. Mass Tight Cuts other (All momenta), MassPeak",600,1.600,2.200);
5088 hMassTGHCotherPM->Sumw2();
5089 TH1F *hMassTrueTGHCotherSB=new TH1F("hMassTrueTGHCotherSB","D^{0} MC inv. Mass in Side Bands Tight Cuts other(All momenta)",600,1.600,2.200);
5090 TH1F *hMassTGHCotherSB=new TH1F("hMassTGHCotherSB","D^{0} inv. Mass in Side Bands Tight Cuts other (All momenta)",600,1.600,2.200);
5091 hMassTGHCotherSB->Sumw2();
5093 flistTghCutsOther->Add(hCPtaVSd0d0TGHCother);
5094 flistTghCutsOther->Add(hSecVtxZTGHCother);
5095 flistTghCutsOther->Add(hSecVtxYTGHCother);
5096 flistTghCutsOther->Add(hSecVtxXTGHCother);
5097 flistTghCutsOther->Add(hSecVtxXYTGHCother);
5098 flistTghCutsOther->Add(hSecVtxPhiTGHCother);
5099 flistTghCutsOther->Add(hd0singlTrackTGHCother);
5100 flistTghCutsOther->Add(hCPtaTGHCother);
5101 flistTghCutsOther->Add(hd0xd0TGHCother);
5102 flistTghCutsOther->Add(hMassTrueTGHCother);
5103 flistTghCutsOther->Add(hMassTGHCother);
5104 flistTghCutsOther->Add(hMassTrueTGHCotherPM);
5105 flistTghCutsOther->Add(hMassTGHCotherPM);
5106 flistTghCutsOther->Add(hMassTrueTGHCotherSB);
5107 flistTghCutsOther->Add(hMassTGHCotherSB);
5112 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
5113 TH1F *hdcaTGHCother=new TH1F("hdcaTGHCother","hdca_TightCuts_Other",100,0.,1000.);
5114 hdcaTGHCother->SetXTitle("dca [#mum]");
5115 hdcaTGHCother->SetYTitle("Entries");
5116 TH1F *hcosthetastarTGHCother=new TH1F("hcosthetastarTGHCother","hCosThetaStar_TightCuts_Other",50,-1.,1.);
5117 hcosthetastarTGHCother->SetXTitle("cos #theta^{*}");
5118 hcosthetastarTGHCother->SetYTitle("Entries");
5119 TH1F *hptD0TGHCother=new TH1F("hptD0TGHCother","D^{0} transverse momentum distribution",34,ptbinsD0arr);
5120 hptD0TGHCother->SetXTitle("p_{t} [GeV/c]");
5121 hptD0TGHCother->SetYTitle("Entries");
5122 TH1F *hptD0VsMaxPtTGHCother=new TH1F("hptD0VsMaxPtTGHCother","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
5123 TH2F *hptD0PTallsqrtTGHCother=new TH2F("hptD0PTallsqrtTGHCother","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
5124 TH2F *hptD0PTallTGHCother=new TH2F("hptD0PTallTGHCother","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
5125 TH2F *hptD0vsptBTGHCother=new TH2F("hptD0vsptBTGHCother","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
5126 TH2F *hpD0vspBTGHCother=new TH2F("hpD0vspBTGHCother","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
5127 TH2F *hptD0vsptcquarkTGHCother=new TH2F("hptD0vsptcquarkTGHCother","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
5128 TH2F *hpD0vspcquarkTGHCother=new TH2F("hpD0vspcquarkTGHCother","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
5129 flistTghCutsOther->Add(hdcaTGHCother);
5130 flistTghCutsOther->Add(hcosthetastarTGHCother);
5131 flistTghCutsOther->Add(hptD0TGHCother);
5132 flistTghCutsOther->Add(hptD0VsMaxPtTGHCother);
5133 flistTghCutsOther->Add(hptD0PTallsqrtTGHCother);
5134 flistTghCutsOther->Add(hptD0PTallTGHCother);
5135 flistTghCutsOther->Add(hptD0vsptBTGHCother);
5136 flistTghCutsOther->Add(hpD0vspBTGHCother);
5137 flistTghCutsOther->Add(hptD0vsptcquarkTGHCother);
5138 flistTghCutsOther->Add(hpD0vspcquarkTGHCother);
5140 TH1F *hd0zD0ptTGHCother;
5141 TH1F *hInvMassD0TGHCother,*hInvMassD0barTGHCother;
5142 TH2F *hInvMassPtTGHCother=new TH2F("hInvMassPtTGHCother","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
5143 THnSparseF *hSparseTGHCother=new THnSparseF("hSparseTGHCother","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
5144 hSparseTGHCother->SetBinEdges(0,massbins);
5145 hSparseTGHCother->SetBinEdges(1,massbins);
5146 hSparseTGHCother->SetBinEdges(2,ptbinsForNsparse);
5147 hSparseTGHCother->SetBinEdges(3,impparbins);
5148 hSparseTGHCother->SetBinEdges(4,massHypoBins);
5149 flistTghCutsOther->Add(hSparseTGHCother);
5150 TH1F *hetaTGHCother;
5151 TH1F *hCosPDPBTGHCother;
5152 TH1F *hCosPcPDTGHCother;
5153 flistTghCutsOther->Add(hInvMassPtTGHCother);
5154 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
5155 TH2F *hd0D0VSd0xd0TGHCotherpt;
5156 TH2F *hangletracksVSd0xd0TGHCotherpt;
5157 TH2F *hangletracksVSd0D0TGHCotherpt;
5158 TH1F *hd0xd0TGHCotherpt;
5160 TH2F *hTOFpidTGHCother=new TH2F("hTOFpidTGHCother","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
5161 flistTghCutsOther->Add(hTOFpidTGHCother);
5163 for(Int_t i=0;i<fnbins;i++){
5164 namehist="hd0zD0ptTGHCother_pt";
5166 titlehist="d0(z) Tight Cuts Otherm ptbin=";
5168 hd0zD0ptTGHCother=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
5169 hd0zD0ptTGHCother->SetXTitle("d_{0}(z) [#mum]");
5170 hd0zD0ptTGHCother->SetYTitle("Entries");
5171 flistTghCutsOther->Add(hd0zD0ptTGHCother);
5173 namehist="hInvMassD0TGHCother_pt";
5175 titlehist="Invariant Mass Tight Cuts Other ptbin=";
5177 hInvMassD0TGHCother=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
5178 hInvMassD0TGHCother->SetXTitle("Invariant Mass [GeV]");
5179 hInvMassD0TGHCother->SetYTitle("Entries");
5180 flistTghCutsOther->Add(hInvMassD0TGHCother);
5182 namehist="hInvMassD0barTGHCother_pt";
5184 titlehist="Invariant Mass D0bar Tight Cuts Other ptbin=";
5186 hInvMassD0barTGHCother=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
5187 hInvMassD0barTGHCother->SetXTitle("Invariant Mass [GeV]");
5188 hInvMassD0barTGHCother->SetYTitle("Entries");
5189 flistTghCutsOther->Add(hInvMassD0barTGHCother);
5191 namehist="hetaTGHCother_pt";
5193 titlehist="eta Tight Cuts Other ptbin=";
5195 hetaTGHCother=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
5196 hetaTGHCother->SetXTitle("Pseudorapidity");
5197 hetaTGHCother->SetYTitle("Entries");
5198 flistTghCutsOther->Add(hetaTGHCother);
5200 namehist="hCosPDPBTGHCother_pt";
5202 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
5204 hCosPDPBTGHCother=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
5205 hCosPDPBTGHCother->SetXTitle("Cosine between D0 momentum and B momentum");
5206 hCosPDPBTGHCother->SetYTitle("Entries");
5207 flistTghCutsOther->Add(hCosPDPBTGHCother);
5209 namehist="hCosPcPDTGHCother_pt";
5211 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
5213 hCosPcPDTGHCother=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
5214 hCosPcPDTGHCother->SetXTitle("Cosine between c quark momentum and D0 momentum");
5215 hCosPcPDTGHCother->SetYTitle("Entries");
5216 flistTghCutsOther->Add(hCosPcPDTGHCother);
5218 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
5219 namehist="hd0xd0TGHCother_pt";
5221 titlehist="d0xd0 Tight Cuts Other ptbin=";
5223 hd0xd0TGHCotherpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
5224 hd0xd0TGHCotherpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
5225 hd0xd0TGHCotherpt->SetYTitle("Entries");
5226 flistTghCutsOther->Add(hd0xd0TGHCotherpt);
5229 namehist="hd0D0VSd0xd0TGHCother_pt";
5231 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts Other ptbin=";
5233 hd0D0VSd0xd0TGHCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
5234 hd0D0VSd0xd0TGHCotherpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
5235 hd0D0VSd0xd0TGHCotherpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
5236 flistTghCutsOther->Add(hd0D0VSd0xd0TGHCotherpt);
5239 namehist="hangletracksVSd0xd0TGHCother_pt";
5241 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts Other ptbin=";
5243 hangletracksVSd0xd0TGHCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
5244 hangletracksVSd0xd0TGHCotherpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
5245 hangletracksVSd0xd0TGHCotherpt->SetYTitle(" angle between K and #p tracks [rad]");
5246 flistTghCutsOther->Add(hangletracksVSd0xd0TGHCotherpt);
5249 namehist="hangletracksVSd0D0TGHCother_pt";
5251 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Tight Cuts Other ptbin=";
5253 hangletracksVSd0D0TGHCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
5254 hangletracksVSd0D0TGHCotherpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
5255 hangletracksVSd0D0TGHCotherpt->SetYTitle(" angle between K and #p tracks [rad]");
5256 flistTghCutsOther->Add(hangletracksVSd0D0TGHCotherpt);
5259 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
5260 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5266 //############# d0 D0 histos ###############Ã
5267 TH1F *hd0D0TGHCotherPM = new TH1F("hd0D0TGHCotherPM","D^{0} impact par. plot , Tight Cuts ,Other,Mass Peak (All momenta)",1000,-1000.,1000.);
5268 hd0D0TGHCotherPM->SetXTitle("Impact parameter [#mum]");
5269 hd0D0TGHCotherPM->SetYTitle("Entries");
5271 TH1F *hd0D0VtxTrueTGHCotherPM = new TH1F("hd0D0VtxTrueTGHCotherPM","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
5272 hd0D0VtxTrueTGHCotherPM->SetXTitle("Impact parameter [#mum]");
5273 hd0D0VtxTrueTGHCotherPM->SetYTitle("Entries");
5275 TH1F *hMCd0D0TGHCotherPM = new TH1F("hMCd0D0TGHCotherPM","D^{0} impact par. plot, Tight Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
5276 hMCd0D0TGHCotherPM->SetXTitle("MC Impact parameter [#mum]");
5277 hMCd0D0TGHCotherPM->SetYTitle("Entries");
5279 TH1F *hd0D0TGHCotherSB = new TH1F("hd0D0TGHCotherSB","D^{0} impact par. plot , Tight Cuts ,Other,Mass Peak (All momenta)",1000,-1000.,1000.);
5280 hd0D0TGHCotherSB->SetXTitle("Impact parameter [#mum]");
5281 hd0D0TGHCotherSB->SetYTitle("Entries");
5283 TH1F *hd0D0VtxTrueTGHCotherSB = new TH1F("hd0D0VtxTrueTGHCotherSB","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
5284 hd0D0VtxTrueTGHCotherSB->SetXTitle("Impact parameter [#mum]");
5285 hd0D0VtxTrueTGHCotherSB->SetYTitle("Entries");
5287 TH1F *hMCd0D0TGHCotherSB = new TH1F("hMCd0D0TGHCotherSB","D^{0} impact par. plot, Tight Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
5288 hMCd0D0TGHCotherSB->SetXTitle("MC Impact parameter [#mum]");
5289 hMCd0D0TGHCotherSB->SetYTitle("Entries");
5291 flistTghCutsOther->Add(hd0D0TGHCotherPM);
5292 flistTghCutsOther->Add(hd0D0VtxTrueTGHCotherPM);
5293 flistTghCutsOther->Add(hMCd0D0TGHCotherPM);
5294 flistTghCutsOther->Add(hd0D0TGHCotherSB);
5295 flistTghCutsOther->Add(hd0D0VtxTrueTGHCotherSB);
5296 flistTghCutsOther->Add(hMCd0D0TGHCotherSB);
5298 TH1F *hd0D0ptTGHCotherPM;
5299 TH1F *hMCd0D0ptTGHCotherPM;
5300 TH1F *hd0D0VtxTrueptTGHCotherPM;
5301 TH1F *hd0D0ptTGHCotherSB;
5302 TH1F *hMCd0D0ptTGHCotherSB;
5303 TH1F *hd0D0VtxTrueptTGHCotherSB;
5304 namehist="hd0D0ptTGHCother_";
5305 titlehist="D^{0} impact par. plot, Tight Cuts, Other, ";
5306 for(Int_t i=0;i<fnbins;i++){
5308 strnamept.Append("PkMss_pt");
5311 strtitlept=titlehist;
5312 strtitlept.Append(" Mass Peak, ");
5313 strtitlept+=fptbins[i];
5314 strtitlept.Append("<= pt <");
5315 strtitlept+=fptbins[i+1];
5316 strtitlept.Append(" [GeV/c]");
5318 hd0D0ptTGHCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5319 hd0D0ptTGHCotherPM->SetXTitle("Impact parameter [#mum] ");
5320 hd0D0ptTGHCotherPM->SetYTitle("Entries");
5321 flistTghCutsOther->Add(hd0D0ptTGHCotherPM);
5323 strnamept.ReplaceAll("hd0D0","hMCd0D0");
5324 hMCd0D0ptTGHCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5325 hMCd0D0ptTGHCotherPM->SetXTitle("MC Impact parameter [#mum] ");
5326 hMCd0D0ptTGHCotherPM->SetYTitle("Entries");
5327 flistTghCutsOther->Add(hMCd0D0ptTGHCotherPM);
5330 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
5331 hd0D0VtxTrueptTGHCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5332 hd0D0VtxTrueptTGHCotherPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
5333 hd0D0VtxTrueptTGHCotherPM->SetYTitle("Entries");
5334 flistTghCutsOther->Add(hd0D0VtxTrueptTGHCotherPM);
5337 strnamept.Append("SBMss_pt");
5340 strtitlept=titlehist;
5341 strtitlept.Append(" Side Bands, ");
5342 strtitlept+=fptbins[i];
5343 strtitlept.Append("<= pt <");
5344 strtitlept+=fptbins[i+1];
5345 strtitlept.Append(" [GeV/c]");
5347 hd0D0ptTGHCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5348 hd0D0ptTGHCotherSB->SetXTitle("Impact parameter [#mum] ");
5349 hd0D0ptTGHCotherSB->SetYTitle("Entries");
5350 flistTghCutsOther->Add(hd0D0ptTGHCotherSB);
5352 strnamept.ReplaceAll("hd0D0","hMCd0D0");
5353 hMCd0D0ptTGHCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5354 hMCd0D0ptTGHCotherSB->SetXTitle("MC Impact parameter [#mum] ");
5355 hMCd0D0ptTGHCotherSB->SetYTitle("Entries");
5356 flistTghCutsOther->Add(hMCd0D0ptTGHCotherSB);
5358 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
5359 hd0D0VtxTrueptTGHCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5360 hd0D0VtxTrueptTGHCotherSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
5361 hd0D0VtxTrueptTGHCotherSB->SetYTitle("Entries");
5362 flistTghCutsOther->Add(hd0D0VtxTrueptTGHCotherSB);
5364 Printf("AFTER DATA HISTOS CREATION \n");
5366 delete ptbinlimitsCxyLxy;
5369 PostData(1,fNentries);
5370 PostData(2,fSignalType);
5371 PostData(3,fSignalTypeLsCuts);
5372 PostData(4,fSignalTypeTghCuts);
5373 PostData(5,fCounter);
5374 PostData(6,flistMCproperties);
5375 PostData(7,flistNoCutsSignal);
5376 PostData(8,flistNoCutsBack);
5377 PostData(9,flistNoCutsFromB);
5378 PostData(10,flistNoCutsFromDstar);
5379 PostData(11,flistNoCutsOther);
5380 PostData(12,flistLsCutsSignal);
5381 PostData(13,flistLsCutsBack);
5382 PostData(14,flistLsCutsFromB);
5383 PostData(15,flistLsCutsFromDstar);
5384 PostData(16,flistLsCutsOther);
5385 PostData(17,flistTghCutsSignal);
5386 PostData(18,flistTghCutsBack);
5387 PostData(19,flistTghCutsFromB);
5388 PostData(20,flistTghCutsFromDstar);
5389 PostData(21,flistTghCutsOther);
5399 //________________________________________________________________________
5400 void AliAnalysisTaskSECharmFraction::UserExec(Option_t */*option*/)
5402 // Execute analysis for current event:
5403 // heavy flavor candidates association to MC truth
5405 AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
5407 Printf("ERROR: aod not available");
5410 TClonesArray *arrayD0toKpi=NULL;
5411 if(!aod && AODEvent() && IsStandardAOD()) {
5412 // In case there is an AOD handler writing a standard AOD, use the AOD
5413 // event in memory rather than the input (ESD) event.
5414 aod = dynamic_cast<AliAODEvent*> (AODEvent());
5415 // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
5416 // have to taken from the AOD event hold by the AliAODExtension
5417 AliAODHandler* aodHandler = (AliAODHandler*)
5418 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
5420 if(aodHandler->GetExtensions()) {
5421 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
5422 AliAODEvent* aodFromExt = ext->GetAOD();
5424 // load 2Prong Like Sign
5425 arrayD0toKpi =(TClonesArray*)aodFromExt->GetList()->FindObject("LikeSign2Prong");
5427 Printf("AliAnalysisTaskSECharmFraction::UserExec: LikeSign branch not found!\n");
5432 // load D0->Kpi candidates
5433 arrayD0toKpi = (TClonesArray*)aodFromExt->GetList()->FindObject("D0toKpi");
5435 Printf("AliAnalysisTaskSECharmFraction::UserExec: D0toKpi branch not found!\n");
5442 // load 2Prong Like Sign
5443 arrayD0toKpi =(TClonesArray*)aod->GetList()->FindObject("LikeSign2Prong");
5445 Printf("AliAnalysisTaskSECharmFraction::UserExec: LikeSign branch not found!\n");
5450 // load D0->Kpi candidates
5451 arrayD0toKpi = (TClonesArray*)aod->GetList()->FindObject("D0toKpi");
5453 Printf("AliAnalysisTaskSECharmFraction::UserExec: D0toKpi branch not found!\n");
5461 printf("AliAnalysisTaskSECharmFraction::UserExec: input branch not found!\n");
5465 //histogram filled with 1 for every AOD
5467 fCounter->StoreEvent(aod,fCutsLoose,fReadMC);
5469 // trigger class for PbPb C0SMH-B-NOPF-ALLNOTRD, C0SMH-B-NOPF-ALL
5470 // TString trigclass=aod->GetFiredTriggerClasses();
5471 // if(trigclass.Contains("C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains("C0SMH-B-NOPF-ALL")) fNentries->Fill(14);
5473 Int_t nSelectedloose=0, nSelectedtight=0;
5475 Bool_t isEventSelTGHT=kTRUE,isEventSelLOOSE=kTRUE;
5476 if(!fskipEventSelection){
5477 if(!fCutsTight->IsEventSelected(aod)){
5478 isEventSelTGHT=kFALSE;
5479 if(fCutsTight->GetWhyRejection()==1){
5480 // rejected for pileup
5483 if(fCutsTight->GetWhyRejection()==6){
5484 // |prim Vtx Zspd| > acceptable
5491 if(!fCutsLoose->IsEventSelected(aod)){
5492 isEventSelLOOSE=kFALSE;
5493 if(fCutsLoose->GetWhyRejection()==1){
5494 // rejected for pileup
5498 if(fCutsLoose->GetWhyRejection()==6){
5499 // |prim Vtx Z| > acceptable
5500 fNentries->Fill(11);
5507 if(!(isEventSelTGHT||isEventSelLOOSE)){
5508 PostData(1,fNentries);
5513 fCutsTight->SetupPID(aod);
5514 // SHOULD ADD RECOMPUTATION OF PRIMARY VERTEX DONE AT THE BEGINNING OF IS EVENT SELECTED??
5518 // fix for temporary bug in ESDfilter
5519 // the AODs with null vertex pointer didn't pass the PhysSel
5520 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001){
5521 if(isEventSelTGHT)fNentries->Fill(19);
5522 if(isEventSelLOOSE)fNentries->Fill(20);
5523 PostData(1,fNentries);
5526 // AOD primary vertex
5527 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
5528 TString primTitle = vtx1->GetTitle();
5529 if(primTitle.Contains("VertexerTracks") && vtx1->GetNContributors()>0) {
5531 if(isEventSelTGHT)fNentries->Fill(3);
5532 if(isEventSelLOOSE)fNentries->Fill(10);
5535 PostData(1,fNentries);
5538 if(fskipEventSelection){
5539 //check z of the primary vertex for the cases in which the z vtx > maximum
5540 if(TMath::Abs(vtx1->GetZ())>fZvtxUpgr){
5542 fNentries->Fill(11);
5543 PostData(1,fNentries);
5551 // FILL n-tracks counter
5552 if(isEventSelTGHT)fNentries->Fill(5,aod->GetNumberOfTracks());
5553 if(isEventSelLOOSE)fNentries->Fill(12,aod->GetNumberOfTracks());
5556 Bool_t aziListIsFilled=kFALSE;
5557 Double_t azilist[30000];
5558 Int_t trkIDlist[30000],nprim=0;
5561 for(Int_t ephi=0;ephi<30000;ephi++){
5562 azilist[ephi]=-999.;
5563 trkIDlist[ephi]=-999;
5565 //aziListIsFilled=kFALSE;
5571 TClonesArray *arrayMC=0x0;
5572 AliAODMCHeader *aodmcHeader=0x0;
5573 Double_t vtxTrue[3];
5577 // load MC particles
5579 (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
5581 Printf("AliAnalysisTaskSECharmFraction::UserExec: MC particles branch not found!\n");
5586 (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
5588 Printf("AliAnalysisTaskSECharmFraction::UserExec: MC header branch not found!\n");
5591 // MC primary vertex
5592 aodmcHeader->GetVertex(vtxTrue);
5593 // FILL HISTOS FOR D0 mesons, c quarks and D0 from B properties
5594 FillHistoMCproperties(arrayMC);
5599 //Printf("There are %d tracks in this event", aod->GetNumberOfTracks());
5600 // Int_t nTotHF=0,nTotDstar=0,nTot3Prong=0;
5601 Int_t nTotD0toKpi=0;
5602 Int_t okd0tight,okd0bartight,okd0loose,okd0barloose,okd0tightnopid,okd0bartightnopid;
5603 Bool_t defaultNC=kTRUE;
5604 Bool_t isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,isSideBand;
5605 Bool_t isinacceptance;
5606 Int_t signallevel=-1;
5608 // const Int_t nptbins=10;
5609 Double_t invMassD0,invMassD0bar,ptD0,massmumtrue;
5612 AliAODRecoDecayHF *aodDMC=0x0;// to be used to create a fake true sec vertex
5613 // make trkIDtoEntry register (temporary)
5615 if(fFastAnalysis<1){
5616 Int_t trkIDtoEntry[100000];
5622 for(Int_t it=0;it<aod->GetNumberOfTracks();it++) {
5623 AliAODTrack *track = aod->GetTrack(it);
5624 fptAll+=track->Pt();
5625 fptAllSq+=track->Pt()*track->Pt();
5626 if(track->Pt()>fptMax[0]){
5627 fptMax[2]=fptMax[1];
5628 fptMax[1]=fptMax[0];
5629 fptMax[0]=track->Pt();
5631 else if(track->Pt()>fptMax[1]){
5632 fptMax[2]=fptMax[1];
5633 fptMax[1]=track->Pt();
5635 else if(track->Pt()>fptMax[2])fptMax[2]=track->Pt();
5636 if(track->GetID()<0) {
5637 if(isEventSelTGHT)fNentries->Fill(19);
5638 if(isEventSelLOOSE)fNentries->Fill(20);
5639 //printf("Track ID <0, id= %d\n",track->GetID());
5640 PostData(1,fNentries);
5643 trkIDtoEntry[track->GetID()]=it;
5647 // loop over D0->Kpi candidates
5648 Int_t nD0toKpi = arrayD0toKpi->GetEntriesFast();
5649 nTotD0toKpi += nD0toKpi;
5650 // fille D0 candidate counter
5651 if(isEventSelTGHT)fNentries->Fill(6,nD0toKpi);
5652 if(isEventSelLOOSE)fNentries->Fill(13,nD0toKpi);
5654 // cout<<"Number of D0->Kpi: "<<nD0toKpi<<endl;
5656 for (Int_t iD0toKpi = 0; iD0toKpi < nD0toKpi; iD0toKpi++) {
5657 if(aodDMC!=0x0)delete aodDMC;
5662 isSideBandD0=kFALSE;
5663 isSideBandD0bar=kFALSE;
5665 isinacceptance=kTRUE;
5669 okd0bartightnopid=0;
5677 AliAODRecoDecayHF2Prong *d = (AliAODRecoDecayHF2Prong*)arrayD0toKpi->UncheckedAt(iD0toKpi);
5678 if(fcheckD0Bit&&(!d->HasSelectionBit(AliRDHFCutsD0toKpi::kD0toKpiCuts)))continue;
5680 // Bool_t unsetvtx=kFALSE;
5681 // if(!d->GetOwnPrimaryVtx()) {
5682 // d->SetOwnPrimaryVtx(vtx1); // needed to compute all variables
5687 //recalculate vertex w/o daughters
5688 AliAODVertex *origownvtx=0x0;
5689 if(fCleanCandOwnVtx){
5690 if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
5691 if(!fCutsTight->RecalcOwnPrimaryVtx(d,aod)) defaultNC=kFALSE;
5696 // ############ MISALIGN HERE: TEMPORARY SOLUTION ##########
5697 // d->Misalign("resC");
5700 //############# SIGNALLEVEL DESCRIPTION #####################
5701 // TO BE CONSIDERED WITH GREAT CARE, only =0 and =1 (and MC selection when possible) are reliable
5702 // For the other signallevel numbers the order in which cut are applied is relevant
5703 // signallevel =0,1: is selected as signal,is signal (MC)
5704 // from 2 to 20: MC information
5705 // from 21 to 29: "detector" selection (acceptance, pt, refits)
5706 // 21: acceptance, eta (N.B. before 24 May was signallevel=9)
5707 // 22: isinfiducialacceptance
5708 // 23: single track p
5709 // 25: ITS cluster selection
5712 // 28: no (TOF||TPC) pid information (no kTOFpid,kTOFout,kTIME,kTPCpid,...)
5714 // from 30 to 39: PID selection
5715 // 31: no Kaon compatible tracks found between daughters
5716 // 32: no Kaon identified tracks found (strong sel. at low momenta)
5717 // 33: both mass hypotheses are rejected
5718 // from 40 to 45: standard cut selection
5719 // from 45 to 49: special cut signal kinematic selection
5721 // from 50 to 60: special cut selection
5722 // 51: Nvtx contributors
5723 // 52: angle between tracks
5724 // 53: vtx not reconstructed when excludind daughters
5725 // 54: track not propagated to dca when the vtx is recalculated
5726 // 55: single track normalized impact par.
5727 // 56: normalized d0xd0
5728 // 57: d0xd0 cut with vtx on the fly
5729 // 58,59: cut normalized decay lenght and decay lenght
5730 //####### DATA SELECTION ####################################
5732 // ######## CHECK FOR ACCEPTANCE ##########
5734 ptbin=fCutsTight->PtBin(ptD0);
5735 // Double_t relangle=d->ProngsRelAngle(0,1);
5736 // UPV: HERE TO CHANGE WITH:
5737 // isinacceptance = (TMath::Abs(d->EtaProng(0))<fAcceptanceCuts[0]&&TMath::Abs(d->EtaProng(1))<fAcceptanceCuts[0]); //eta acceptance
5739 // INVESTIGATE SIGNAL TYPE : ACCESS TO MC INFORMATION
5741 if(fselectForUpgrade){
5743 Int_t generator=0;// adding per track: -1 hijing; 0-pythiaHF; 2-the rest --> -2= pure hijing -> back ok (but check identity); 0= phytia,pythia-> ok for checking signal; reject the rest: -1 (Hij,pyt), 1 (hij, rest), 2 (pythia,rest) ,4 (rest,rest)
5744 for(Int_t jp=0;jp<2;jp++){
5745 AliAODTrack *daughA=(AliAODTrack*)d->GetDaughter(0);
5746 fVertUtil->GetTrackPrimaryGenerator(daughA,aodmcHeader,arrayMC,nameGen);
5747 if(nameGen.Contains("ijing")){
5750 else if(!nameGen.Contains("pythia")){
5755 Int_t pdgdaughters[2]={211,321};
5756 Int_t labMum=d->MatchToMC(421,arrayMC,2,pdgdaughters);
5757 if(labMum<0)signallevel=-1;
5758 else signallevel=-2;
5760 else if (generator==0){
5761 aodDMC=GetD0toKPiSignalType(d,arrayMC,signallevel,massmumtrue,vtxTrue);
5766 if(fVertUtil->IsCandidateInjected(d,aodmcHeader,arrayMC)){
5767 // Printf("The candidate is injected and generator is : %d",generator);
5770 // Printf("The candidate is not injected and generator is : %d",generator);
5774 aodDMC=GetD0toKPiSignalType(d,arrayMC,signallevel,massmumtrue,vtxTrue);
5778 // ACCOUNT FOR ETA & ITS CLUSTER SELECTION
5779 if(fFastAnalysis<1){ // ALREADY DONE BY AliRDHFCutsD0ToKPi selection
5780 isinacceptance=fCutsTight->AreDaughtersSelected(d);
5781 if(!isinacceptance)signallevel=21;
5783 if(!fCutsTight->IsInFiducialAcceptance(ptD0,d->Y(421))){
5784 isinacceptance=kFALSE;
5791 //###################################################################################
5793 // ################ SPECIAL ADDITIONAL CUTS FOR SIGNAL SEARCH #######################
5794 // UPV: ITS CLUSTER SELECTION ALREADY DONE , COUNT THEM THE SAME
5796 Int_t nlayers=0,nSPD=0,nSSD=0;
5798 if(fFastAnalysis<1){
5799 for(Int_t idg=0;idg<d->GetNDaughters();idg++){
5801 AliAODTrack *dgTrack = (AliAODTrack*)d->GetDaughter(idg);
5802 if(TESTBIT(dgTrack->GetITSClusterMap(),5)){
5806 if(TESTBIT(dgTrack->GetITSClusterMap(),4)){
5810 if(TESTBIT(dgTrack->GetITSClusterMap(),3))nlayers++;
5811 if(TESTBIT(dgTrack->GetITSClusterMap(),2))nlayers++;
5812 if(TESTBIT(dgTrack->GetITSClusterMap(),1)){
5816 if(TESTBIT(dgTrack->GetITSClusterMap(),0)){
5824 // ######## NOW SELECTION ##########
5825 if(dgTrack->Pt()<0.5){
5826 // ########## k-Both selection ##############
5827 if(nlayers<5)signallevel=25;
5828 if(nSPD<2)signallevel=25;
5830 else if(dgTrack->Pt()<1.){
5831 // ########## 4 its clust (1 SSD,1 SPD) && k-Any selection ##############
5832 if(nlayers<4)signallevel=25;
5833 if(nSSD<1)signallevel=25;
5834 if(nSPD<1)signallevel=25;
5837 // ########## 3 its clust (1 SPD, 1 SSD) && k-Any selection ##########
5838 if(nlayers<3)signallevel=25;
5839 if(nSSD<1)signallevel=25;
5840 if(nSPD<1)signallevel=25;
5848 //########### END OF SPECIAL CUTS ######################
5850 //###############################################################
5853 // Check tighter cuts w/o PID:
5855 // Int_t ncont=vtx1->GetNContributors();
5856 if(fFastAnalysis<1)if(vtx1->GetNContributors()<1)signallevel=51;
5858 if(defaultNC&&fFastAnalysis<1&&fNtrMaxforVtx<2)defaultNC=SpecialSelD0(d,nVtx);// No More in USE!
5859 if(isEventSelTGHT&&defaultNC){
5860 Bool_t iscutusingpid=fCutsTight->GetIsUsePID();
5861 fCutsTight->SetUsePID(kFALSE);
5862 Int_t isSelectedTightNoPid=fCutsTight->IsSelected(d,AliRDHFCuts::kAll,aod);
5863 switch(isSelectedTightNoPid){
5865 okd0tightnopid=kFALSE;
5866 okd0bartightnopid=kFALSE;
5869 okd0tightnopid=kTRUE;
5870 okd0bartightnopid=kFALSE;
5873 okd0tightnopid=kFALSE;
5874 okd0bartightnopid=kTRUE;
5877 okd0tightnopid=kTRUE;
5878 okd0bartightnopid=kTRUE;
5881 okd0tightnopid=kTRUE;
5882 okd0bartightnopid=kTRUE;
5887 // signallevel=fCutsTight->GetSelectionStep();
5888 fSignalType->Fill(signallevel);
5893 // ######### SPECIAL SELECTION PID ##############
5894 fCutsTight->SetUsePID(iscutusingpid);
5895 if(okd0tightnopid||okd0bartightnopid){
5896 Int_t isSelectedPid=fCutsTight->IsSelected(d,AliRDHFCuts::kPID,aod);
5897 Int_t isSelectedTight=fCutsTight->CombineSelectionLevels(3,isSelectedTightNoPid,isSelectedPid);
5898 switch(isSelectedTight){
5901 okd0bartight=kFALSE;
5905 okd0bartight=kFALSE;
5923 fSignalType->Fill(signallevel);
5929 if(isEventSelLOOSE&&defaultNC){
5930 // CHECK LOOSER CUTS
5931 //ptbin=SetStandardCuts(ptD0,flargeInvMassCut);
5933 // d->SelectD0(fCutsLoose->GetD0toKpiCuts(),okd0loose,okd0barloose);
5934 Int_t isSelectedLoose=fCutsLoose->IsSelected(d,AliRDHFCuts::kAll,aod);
5935 switch(isSelectedLoose){
5938 okd0barloose=kFALSE;
5942 okd0barloose=kFALSE;
5961 //NO CUTS Case: force okD0 and okD0bar = kTRUE
5962 // special cuts are applied also in the "NO Cuts" case
5965 // SPECIAL modification:
5966 // IMPORTANT!!!!!! ONLY FOR TEMPORARY CONVENIENCE
5967 // IF fusePID is kTRUE, NO CUTS BECOMES NO PID case with tight cuts (fill signal histos when 30<=signallevel<40 )!!!!!!!!!!
5968 if((!fusePID)&&isEventSelTGHT){
5969 okd0tightnopid=defaultNC;
5970 okd0bartightnopid=defaultNC;
5973 if(okd0loose||okd0barloose||okd0tight||okd0bartight||okd0tightnopid||okd0bartightnopid){
5974 //######## INVARIANT MASS SELECTION ###############
5975 CheckInvMassD0(d,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar);
5976 if((isSideBandD0||isSideBandD0bar)){
5977 if(!(isPeakD0||isPeakD0bar))isSideBand=kTRUE; //(isSideBand no more used in the following, can remove it)
5978 else {// AVOID TO CONSIDER IN THE SIDEBAND THOSE CANDIDATES FOR WHICH 1 MASS HYPOTHESIS IS IN THE PEAK REGION
5980 isSideBandD0=kFALSE;
5981 isSideBandD0bar=kFALSE;
5984 if(fFastAnalysis<2){
5985 if(!aziListIsFilled){
5986 FillAziList(aod,azilist,trkIDlist,nprim);
5987 aziListIsFilled=kTRUE;
5990 if(signallevel==1||signallevel==0){
5992 FillAziHistos(d,flistNoCutsSignal,ptbin,azilist,trkIDlist,nprim,okd0tightnopid,okd0bartightnopid,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar);
5993 FillAziHistos(d,flistTghCutsSignal,ptbin,azilist,trkIDlist,nprim,okd0tight,okd0bartight,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar);
5994 FillAziHistos(d,flistLsCutsSignal,ptbin,azilist,trkIDlist,nprim,okd0loose,okd0barloose,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar);
6000 if(((isPeakD0&&okd0tight)||(isPeakD0bar&&okd0bartight))&&isinacceptance)fSignalTypeTghCuts->Fill(signallevel);
6001 if(((isPeakD0&&okd0loose)||(isPeakD0bar&&okd0barloose))&&isinacceptance)fSignalTypeLsCuts->Fill(signallevel);
6006 //################### FILL HISTOS ########################
6007 //################################################################
6009 //######## improvement: SPEED HERE CAN BE IMPROVED: CALCULATE ONCE AND FOR ALL
6010 // CANDIDATE VARIABLES
6013 if(signallevel==1||signallevel==0)FillHistos(d,flistNoCutsSignal,ptbin,okd0tightnopid,okd0bartightnopid,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue); // else if(fusePID&&signallevel>=30&&signallevel<40)FillHistos(d,flistNoCutsSignal,ptbin,okd0tightnopid,okd0bartightnopid,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);// OLD LINE, COULD BE REMOVED
6014 else if(signallevel==2)FillHistos(d,flistNoCutsFromDstar,ptbin,okd0tightnopid,okd0bartightnopid,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
6015 else if(signallevel==3||signallevel==4)FillHistos(d,flistNoCutsFromB,ptbin,okd0tightnopid,okd0bartightnopid,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
6016 else if(signallevel==-1||signallevel==7||signallevel==8||signallevel==10||signallevel==11)FillHistos(d,flistNoCutsBack,ptbin,okd0tightnopid,okd0bartightnopid,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
6017 else if(signallevel==5||signallevel==6)FillHistos(d,flistNoCutsOther,ptbin,okd0tightnopid,okd0bartightnopid,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
6022 if(okd0loose||okd0barloose)fNentries->Fill(14);
6024 if(signallevel==1||signallevel==0)FillHistos(d,flistLsCutsSignal,ptbin,okd0loose,okd0barloose,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
6025 else if(signallevel==2)FillHistos(d,flistLsCutsFromDstar,ptbin,okd0loose,okd0barloose,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
6026 else if(signallevel==3||signallevel==4)FillHistos(d,flistLsCutsFromB,ptbin,okd0loose,okd0barloose,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
6027 else if(signallevel==-1||signallevel==7||signallevel==8||signallevel==10||signallevel==11)FillHistos(d,flistLsCutsBack,ptbin,okd0loose,okd0barloose,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
6028 else if(signallevel==5||signallevel==6)FillHistos(d,flistLsCutsOther,ptbin,okd0loose,okd0barloose,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
6031 if(okd0tight||okd0bartight){
6036 if(signallevel==1||signallevel==0)FillHistos(d,flistTghCutsSignal,ptbin,okd0tight,okd0bartight,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
6037 else if(signallevel==2)FillHistos(d,flistTghCutsFromDstar,ptbin,okd0tight,okd0bartight,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
6038 else if(signallevel==3||signallevel==4)FillHistos(d,flistTghCutsFromB,ptbin,okd0tight,okd0bartight,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
6039 else if(signallevel==-1||signallevel==7||signallevel==8||signallevel==10||signallevel==11)FillHistos(d,flistTghCutsBack,ptbin,okd0tight,okd0bartight,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
6040 else if(signallevel==5||signallevel==6)FillHistos(d,flistTghCutsOther,ptbin,okd0tight,okd0bartight,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
6043 // ######## PRINTING INFO FOR D0-like candidate
6045 if(nSPD==2&&ptD0>2.){
6046 if((okd0tight&&TMath::Abs(invMassD0-1.864)<0.01)||(okd0bartight&&TMath::Abs(invMassD0bar-1.864)<0.01)){
6047 //printf("INFO FOR DRAWING: \n pt: %f \n Rapidity: %f \n Period Number: %d \n Run Number: %d \n BunchCrossNumb: %d \n OrbitNumber: %d \n",ptD0,d->Y(421),aod->GetPeriodNumber(),aod->GetRunNumber(),aod->GetBunchCrossNumber(),aod->GetOrbitNumber());
6048 //printf("PrimVtx NContributors: %d \n Prongs Rel Angle: %f \n \n",ncont,relangle);
6056 if(fCleanCandOwnVtx)fCutsTight->CleanOwnPrimaryVtx(d,aod,origownvtx);
6059 // if(unsetvtx) d->UnsetOwnPrimaryVtx();
6064 fCounter->StoreCandidates(aod,nSelectedloose,kTRUE);
6065 fCounter->StoreCandidates(aod,nSelectedtight,kFALSE);
6068 // ####################### POST OUTPUT TLIST DATA #########################
6069 // ####### histo for #AOD entries already posted
6070 PostData(1,fNentries);
6071 PostData(2,fSignalType);
6072 PostData(3,fSignalTypeLsCuts);
6073 PostData(4,fSignalTypeTghCuts);
6074 PostData(5,fCounter);
6075 PostData(6,flistMCproperties);
6076 PostData(7,flistNoCutsSignal);
6077 PostData(8,flistNoCutsBack);
6078 PostData(9,flistNoCutsFromB);
6079 PostData(10,flistNoCutsFromDstar);
6080 PostData(11,flistNoCutsOther);
6081 PostData(12,flistLsCutsSignal);
6082 PostData(13,flistLsCutsBack);
6083 PostData(14,flistLsCutsFromB);
6084 PostData(15,flistLsCutsFromDstar);
6085 PostData(16,flistLsCutsOther);
6086 PostData(17,flistTghCutsSignal);
6087 PostData(18,flistTghCutsBack);
6088 PostData(19,flistTghCutsFromB);
6089 PostData(20,flistTghCutsFromDstar);
6090 PostData(21,flistTghCutsOther);
6097 //_________________________________________
6098 Int_t AliAnalysisTaskSECharmFraction::SetStandardCuts(Float_t *&ptbinlimits){
6100 // creating cuts for D0 -> Kpi
6103 Printf("Using Default Cuts as set in AliAnalysisTaskSECharmFraction \n");
6104 // const Double_t ptmin = 0.1;
6105 const Double_t ptmax = 9999.;
6106 const Int_t nptbins =13;
6107 const Int_t nvars=9;
6111 delete fCutsTight;fCutsTight=NULL;
6114 delete fCutsLoose;fCutsLoose=NULL;
6118 fCutsTight = new AliRDHFCutsD0toKpi();
6119 fCutsTight->SetName("D0toKpiCutsStandard");
6120 fCutsTight->SetTitle("Standard Cuts for D0 analysis");
6122 fCutsLoose = new AliRDHFCutsD0toKpi();
6123 fCutsLoose->SetName("D0toKpiCutsLoose");
6124 fCutsLoose->SetTitle("Loose Cuts for D0 analysis");
6127 fCutsTight->SetMinVtxContr(1);
6128 fCutsLoose->SetMinVtxContr(1);
6130 // TRACKS ON SINGLE TRACKS
6131 AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
6132 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
6133 esdTrackCuts->SetRequireTPCRefit(kTRUE);
6134 esdTrackCuts->SetRequireITSRefit(kTRUE);
6135 // esdTrackCuts->SetMinNClustersITS(4);
6136 esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
6137 esdTrackCuts->SetMinDCAToVertexXY(0.);
6138 esdTrackCuts->SetEtaRange(-0.8,0.8);
6139 esdTrackCuts->SetPtRange(0.3,1.e10);
6142 fCutsTight->AddTrackCuts(esdTrackCuts);
6143 fCutsLoose->AddTrackCuts(esdTrackCuts);
6147 Float_t ptbins[nptbins+1];
6163 fCutsTight->SetGlobalIndex(nvars,nptbins);
6164 fCutsLoose->SetGlobalIndex(nvars,nptbins);
6165 fCutsTight->SetPtBins(nptbins+1,ptbins);
6166 fCutsLoose->SetPtBins(nptbins+1,ptbins);
6168 /* Float_t cutsArrayD0toKpiStand_1[9]={0.200,300.*1E-4,0.8,0.3,0.3,1000.*1E-4,1000.*1E-4,-35000.*1E-8,0.7}; // pt<1
6169 Float_t cutsArrayD0toKpiStand_2[9]={0.200,200.*1E-4,0.8,0.4,0.4,1000.*1E-4,1000.*1E-4,-30000.*1E-8,0.8}; // 1<=pt<2
6170 Float_t cutsArrayD0toKpiStand_3[9]={0.200,200.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-26000.*1E-8,0.94}; // 2<=pt<3
6171 Float_t cutsArrayD0toKpiStand_4[9]={0.200,200.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-15000.*1E-8,0.88}; // 3<=pt<5
6172 Float_t cutsArrayD0toKpiStand_5[9]={0.200,150.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-10000.*1E-8,0.9}; // 5<=pt<8
6173 Float_t cutsArrayD0toKpiStand_6[9]={0.200,150.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-10000.*1E-8,0.9}; // 8<pt<12
6174 Float_t cutsArrayD0toKpiStand_7[9]={0.200,150.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-10000.*1E-8,0.9}; // pt>12
6177 const Int_t nvary=3;
6178 Float_t varyd0xd0[nptbins][nvary]={{-35000.*1E-8,-40000.*1E-8,-50000.*1E-8},/* pt<0.5*/
6179 {-35000.*1E-8,-40000.*1E-8,-50000.*1E-8},/* 0.5<pt<1*/
6180 {-25000.*1E-8,-32000.*1E-8,-38000.*1E-8},/* 1<pt<2 */
6181 {-22000.*1E-8,-26000.*1E-8,-30000.*1E-8},/* 2<pt<3 */
6182 {-12000.*1E-8,-15000.*1E-8,-20000.*1E-8},/* 3<pt<4 */
6183 {-12000.*1E-8,-15000.*1E-8,-20000.*1E-8},/* 4<pt<5 */
6184 {-5000.*1E-8,-10000.*1E-8,-15000.*1E-8},/* 5<pt<6 */
6185 {-5000.*1E-8,-10000.*1E-8,-15000.*1E-8},/* 6<pt<8 */
6186 {-0.*1E-8,-10000.*1E-8,-12000.*1E-8},/* 8<pt<12 */
6187 {5000.*1E-8,-5000.*1E-8,-10000.*1E-8},/* 12<pt<16 */
6188 {5000.*1E-8,-5000.*1E-8,-10000.*1E-8},/* 16<pt<20 */
6189 {5000.*1E-8,-5000.*1E-8,-10000.*1E-8},/* 20<pt<24 */
6190 {5000.*1E-8,-5000.*1E-8,-10000.*1E-8}};/* pt>24 */
6193 Float_t varyCosPoint[nptbins][nvary]={{0.75,0.80,0.85},/* 0<pt<0.5 */
6194 {0.75,0.80,0.85},/* 0.5<pt<1*/
6195 {0.75,0.80,0.85},/* 1<pt<2 */
6196 {0.92,0.94,0.95},/* 2<pt<3 */
6197 {0.85,0.88,0.91},/* 3<pt<4 */
6198 {0.85,0.88,0.91},/* 4<pt<5 */
6199 {0.88,0.90,0.92},/* 5<pt<6 */
6200 {0.88,0.90,0.92},/* 6<pt<8 */
6201 {0.85,0.90,0.92},/* 8<pt<12 */
6202 {0.85,0.90,0.92},/* 12<pt<16 */
6203 {0.8,0.85,0.9},/* 16<pt<20 */
6204 {0.8,0.85,0.9},/* 20<pt<24 */
6205 {0.75,0.82,0.9}};/* pt>24 */
6209 if(varycuts==-1){//DEFAULT CUTS
6211 varyd0xd0[9][1]=-10000.*1E-8;
6212 varyd0xd0[10][1]=-10000.*1E-8;
6213 varyd0xd0[11][1]=-10000.*1E-8;
6214 varyd0xd0[12][1]=-10000.*1E-8;
6216 Int_t vcd0xd0=varycuts/10;
6217 Int_t vccospoint=varycuts%10;
6218 // ######################## STAND VARY CUTS ###########################################
6219 Float_t cutsMatrixD0toKpiStand[nptbins][nvars]={{0.400,300.*1E-4,0.8,0.3,0.3,1000.*1E-4,1000.*1E-4,varyd0xd0[0][vcd0xd0],varyCosPoint[0][vccospoint]},/* 0<pt<0.5*/
6220 {0.400,300.*1E-4,0.8,0.3,0.3,1000.*1E-4,1000.*1E-4,varyd0xd0[1][vcd0xd0],varyCosPoint[1][vccospoint]},/* 0.5<pt<1*/
6221 {0.400,300.*1E-4,0.8,0.4,0.4,1000.*1E-4,1000.*1E-4,varyd0xd0[2][vcd0xd0],varyCosPoint[2][vccospoint]},/* 1<pt<2 */
6222 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,varyd0xd0[3][vcd0xd0],varyCosPoint[3][vccospoint]},/* 2<pt<3 */
6223 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,varyd0xd0[4][vcd0xd0],varyCosPoint[4][vccospoint]},/* 3<pt<4 */
6224 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,varyd0xd0[5][vcd0xd0],varyCosPoint[5][vccospoint]},/* 4<pt<5*/
6225 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,varyd0xd0[6][vcd0xd0],varyCosPoint[6][vccospoint]},/* 5<pt<6 */
6226 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,varyd0xd0[7][vcd0xd0],varyCosPoint[7][vccospoint]},/* 6<pt<8 */
6227 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,varyd0xd0[8][vcd0xd0],varyCosPoint[8][vccospoint]},/* 8<pt<12 */
6228 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,varyd0xd0[9][vcd0xd0],varyCosPoint[9][vccospoint]},/*12< pt <16*/
6229 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,varyd0xd0[10][vcd0xd0],varyCosPoint[10][vccospoint]}, /*16< pt <20*/
6230 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,varyd0xd0[11][vcd0xd0],varyCosPoint[11][vccospoint]}, /*20< pt <24*/
6231 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,varyd0xd0[12][vcd0xd0],varyCosPoint[12][vccospoint]}
6234 Float_t cutsMatrixD0toKpiLoose[nptbins][nvars]={{0.400,300.*1E-4,0.8,0.3,0.3,1000.*1E-4,1000.*1E-4,-35000.*1E-8,0.73},/* pt<0.5*/
6235 {0.400,300.*1E-4,0.8,0.3,0.3,1000.*1E-4,1000.*1E-4,-35000.*1E-8,0.73},/* 0.5<pt<1*/
6236 {0.400,300.*1E-4,0.8,0.4,0.4,1000.*1E-4,1000.*1E-4,-25000.*1E-8,0.75},/* 1<pt<2 */
6237 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-15000.*1E-8,0.8},/* 2<pt<3 */
6238 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-8000.*1E-8,0.85},/* 3<pt<4 */
6239 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-8000.*1E-8,0.85},/* 4<pt<5 */
6240 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-8000.*1E-8,0.85},/* 5<pt<6 */
6241 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-8000.*1E-8,0.85},/* 6<pt<8 */
6242 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-5000.*1E-8,0.85},/* 8<pt<12 */
6243 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-0.*1E-8,0.85},/* 12<pt<16 */
6244 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,0.*1E-8,0.85},/* 16<pt<20 */
6245 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,0.*1E-8,0.85},/* 20<pt<24 */
6246 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,0.*1E-8,0.85}};/* pt>24 */
6249 //CREATE TRANSPOSE MATRIX...REVERSE INDICES as required by AliRDHFCuts
6250 Float_t **cutsMatrixTransposeStand=new Float_t*[nvars];
6251 for(Int_t iv=0;iv<nvars;iv++)cutsMatrixTransposeStand[iv]=new Float_t[nptbins];
6252 Float_t **cutsMatrixTransposeLoose=new Float_t*[nvars];
6253 for(Int_t iv=0;iv<nvars;iv++)cutsMatrixTransposeLoose[iv]=new Float_t[nptbins];
6255 for (Int_t ibin=0;ibin<nptbins;ibin++){
6256 for (Int_t ivar = 0; ivar<nvars; ivar++){
6257 cutsMatrixTransposeStand[ivar][ibin]=cutsMatrixD0toKpiStand[ibin][ivar];
6258 cutsMatrixTransposeLoose[ivar][ibin]=cutsMatrixD0toKpiLoose[ibin][ivar];
6259 //printf("cutsMatrixD0toKpi[%d][%d] = %f\n",ibin, ivar,cutsMatrixD0toKpiStand[ibin][ivar]);
6265 fCutsTight->SetCuts(nvars,nptbins,cutsMatrixTransposeStand);
6266 fCutsLoose->SetCuts(nvars,nptbins,cutsMatrixTransposeLoose);
6269 for (Int_t ivar = 0; ivar<nvars; ivar++){
6270 delete [] cutsMatrixTransposeStand[ivar];
6271 delete [] cutsMatrixTransposeLoose[ivar];
6273 delete [] cutsMatrixTransposeStand;
6274 cutsMatrixTransposeStand=NULL;
6275 delete [] cutsMatrixTransposeLoose;
6276 cutsMatrixTransposeLoose=NULL;
6280 fCutsTight->SetUseSpecialCuts(kTRUE);
6281 fCutsLoose->SetUseSpecialCuts(kTRUE);
6282 fCutsTight->SetRemoveDaughtersFromPrim(kTRUE);
6283 fCutsLoose->SetRemoveDaughtersFromPrim(kTRUE);
6285 AliAODPidHF* pidObj=new AliAODPidHF();
6286 //pidObj->SetName("pid4D0");
6288 const Int_t nlims=2;
6289 Double_t plims[nlims]={0.6,0.8}; //TPC limits in momentum [GeV/c]
6290 Bool_t compat=kTRUE; //effective only for this mode
6292 Double_t sigmas[5]={2.,1.,0.,3.,0.}; //to be checked and to be modified with new implementation of setters by Rossella
6293 pidObj->SetAsym(asym);// if you want to use the asymmetric bands in TPC
6294 pidObj->SetMatch(mode);
6295 pidObj->SetPLimit(plims,nlims);
6296 pidObj->SetSigma(sigmas);
6297 pidObj->SetCompat(compat);
6298 pidObj->SetTPC(kTRUE);
6299 pidObj->SetTOF(kTRUE);
6301 fCutsTight->SetPidHF(pidObj);
6302 fCutsLoose->SetPidHF(pidObj);
6303 delete pidObj; pidObj=NULL;
6304 fCutsTight->SetUsePID(kTRUE);
6305 fCutsLoose->SetUsePID(kTRUE);
6307 fCutsTight->SetUseDefaultPID(kFALSE);
6308 fCutsLoose->SetUseDefaultPID(kFALSE);
6310 // PILE UP REJECTION
6311 fCutsTight->SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
6312 fCutsLoose->SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
6315 fCutsTight->PrintAll();
6323 //_________________________________________
6324 Int_t AliAnalysisTaskSECharmFraction::SetStandardCuts(Double_t pt,Double_t invMassCut){
6325 // UPV: this should set the cut object
6328 // TEMPORARY: to be change in :
6330 // if pt < standardptbin[j+1]
6334 // the way the cuts are set is for further development
6335 // (to be interfaced with AliAnalsysTaskSETuneCuts)
6338 // 0 = inv. mass half width [GeV]
6343 // 5 = d0K [cm] upper limit!
6344 // 6 = d0Pi [cm] upper limit!
6346 // 8 = cosThetaPoint
6351 /*//#######################################################################
6352 //###########################################################################
6353 // STANDARD SETS OF CUTS ("tight"~PPR like; commented loose are more stringent than "tight")
6354 // #########################################################################
6356 if(pt>0. && pt<=1.) {
6358 fCutsTight->SetD0toKpiCuts(invMassCut,0.04,0.8,0.5,0.5,0.05,0.05,-0.0002,0.5);
6359 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.04,0.8,0.5,0.5,0.05,0.05,-0.00025,0.7);
6360 fCutsLoose->SetD0toKpiCuts(invMassCut,0.04,0.8,0.3,0.3,1.,1.,-0.0002,0.7);
6362 if(pt>1. && pt<=2.) {
6364 fCutsTight->SetD0toKpiCuts(invMassCut,0.03,0.8,0.6,0.6,0.05,0.05,-0.0002,0.6);
6365 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6366 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.3,0.3,1.,1.,-0.0001,0.7);
6367 //printf("I'm in the bin %d\n",ptbin);
6369 if(pt>2. && pt<=3.) {
6371 fCutsTight->SetD0toKpiCuts(invMassCut,0.03,0.8,0.6,0.6,0.05,0.05,-0.0002,0.6);
6372 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6373 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.3,0.3,1.,1.,-0.0001,0.7);
6374 //printf("I'm in the bin %d\n",ptbin);
6376 if(pt>3. && pt<=5.){
6378 fCutsTight->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.0001,0.8);
6379 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.8);
6380 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.4,0.4,1.,1.,-0.0001,0.75);
6381 //printf("I'm in the bin %d\n",ptbin);
6385 fCutsTight->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00005,0.8);
6386 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.9);
6387 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.5,0.5,1.,1.,-0.00005,0.75);
6390 //############################################################################
6395 /* //#######################################################################
6396 //################# VARY CUTS for d0xd0 STUDY ##########################
6398 if(pt>0. && pt<=1.) {
6400 fCutsTight->SetD0toKpiCuts(invMassCut,0.04,0.8,0.5,0.5,0.05,0.05,-0.0002,0.5);
6401 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.04,0.8,0.5,0.5,0.05,0.05,-0.00025,0.7);
6402 fCutsLoose->SetD0toKpiCuts(invMassCut,0.04,0.8,0.3,0.3,1.,1.,-0.0002,0.7);
6404 if(pt>1. && pt<=2.) {
6406 fCutsTight->SetD0toKpiCuts(invMassCut,0.03,0.8,0.6,0.6,0.05,0.05,0.2,0.6);
6407 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6408 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.3,0.3,1.,1.,-0.0001,0.1);
6409 //printf("I'm in the bin %d\n",ptbin);
6411 if(pt>2. && pt<=3.) {
6413 fCutsTight->SetD0toKpiCuts(invMassCut,0.03,0.8,0.6,0.6,0.05,0.05,0.2,0.6);
6414 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6415 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.3,0.3,1.,1.,-0.0001,0.1);
6416 //printf("I'm in the bin %d\n",ptbin);
6418 if(pt>3. && pt<=5.){
6420 fCutsTight->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,0.2,0.8);
6421 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.8);
6422 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.3,0.4,0.4,1.,1.,-0.0001,0.1);
6423 //printf("I'm in the bin %d\n",ptbin);
6427 fCutsTight->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,0.2,0.8);
6428 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.9);
6429 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.5,0.5,1.,1.,-0.00005,0.1);
6432 // #################################################################
6435 //##########################################################################
6436 //################## CUTS with d0xd0 cut released #########################
6437 //### and TGHC cuts d0K and d0Pi to 0.1 instead of 0.05
6438 //### USED FOR PHDthesis
6439 //##########################################################################
6441 /* if(pt>0. && pt<=1.) {
6443 fCutsTight->SetD0toKpiCuts(invMassCut,0.04,0.8,0.5,0.5,0.1,0.1,-0.000,0.5);
6444 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.04,0.8,0.5,0.5,0.05,0.05,-0.00025,0.7);
6445 fCutsLoose->SetD0toKpiCuts(invMassCut,0.04,0.8,0.3,0.3,1.,1.,-0.000,0.7);
6447 if(pt>1. && pt<=2.) {
6449 fCutsTight->SetD0toKpiCuts(invMassCut,0.03,0.8,0.6,0.6,0.1,0.1,-0.000,0.6);
6450 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6451 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.4,0.4,1.,1.,-0.0000,0.7);
6452 //printf("I'm in the bin %d\n",ptbin);
6454 if(pt>2. && pt<=3.) {
6456 fCutsTight->SetD0toKpiCuts(invMassCut,0.03,0.8,0.6,0.6,0.1,0.1,-0.000,0.6);
6457 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6458 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.4,0.4,1.,1.,-0.000,0.7);
6459 //printf("I'm in the bin %d\n",ptbin);
6461 if(pt>3. && pt<=5.){
6463 fCutsTight->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.1,0.1,-0.000,0.8);
6464 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.8);
6465 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.5,0.5,1.,1.,-0.000,0.75);
6466 //printf("I'm in the bin %d\n",ptbin);
6470 fCutsTight->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.1,0.1,-0.0000,0.8);
6471 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.9);
6472 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.5,0.5,1.,1.,-0.0000,0.75);
6480 //########## LOOKING FOR SIGNAL #####################
6482 if(pt>0. && pt<=1.) {
6484 fCutsTight->SetD0toKpiCuts(5*invMassCut,0.03,0.8,0.3,0.3,0.1,0.1,-0.00035,0.7);
6485 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.04,0.8,0.5,0.5,0.05,0.05,-0.00025,0.7);
6486 fCutsLoose->SetD0toKpiCuts(5*invMassCut,0.04,0.8,0.3,0.3,0.1,0.1,-0.00025,0.7);
6488 if(pt>1. && pt<=2.) {
6490 fCutsTight->SetD0toKpiCuts(5*invMassCut,0.02,0.8,0.4,0.4,0.1,0.1,-0.00035,0.8);
6491 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6492 fCutsLoose->SetD0toKpiCuts(5*invMassCut,0.03,0.8,0.3,0.3,0.1,0.1,-0.0025,0.75);
6493 //printf("I'm in the bin %d\n",ptbin);
6495 if(pt>2. && pt<=3.) {
6497 fCutsTight->SetD0toKpiCuts(5*invMassCut,0.02,0.8,0.7,0.7,0.1,0.1,-0.00026,0.94);
6498 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6499 fCutsLoose->SetD0toKpiCuts(5*invMassCut,0.02,0.8,0.7,0.7,0.1,0.1,-0.0002,0.92);
6500 //printf("I'm in the bin %d\n",ptbin);
6502 if(pt>3. && pt<=5.){
6504 fCutsTight->SetD0toKpiCuts(5*invMassCut,0.02,0.8,0.7,0.7,0.1,0.1,-0.00015,0.88);
6505 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.8);
6506 fCutsLoose->SetD0toKpiCuts(5*invMassCut,0.02,0.8,0.7,0.7,0.1,0.1,-0.00015,0.9);
6507 //printf("I'm in the bin %d\n",ptbin);
6511 fCutsTight->SetD0toKpiCuts(5*invMassCut,0.015,0.8,0.7,0.7,0.1,0.1,-0.0001,0.9);
6512 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.9);
6513 fCutsLoose->SetD0toKpiCuts(5*invMassCut,0.02,0.8,0.7,0.7,0.1,0.1,-0.0000,0.88);
6517 fCutsTight->SetD0toKpiCuts(5*invMassCut,0.015,0.8,0.7,0.7,0.1,0.1,-0.0001,0.9);
6518 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.9);
6519 fCutsLoose->SetD0toKpiCuts(5*invMassCut,0.015,0.8,0.7,0.7,0.1,0.1,-0.0005,0.88);
6524 printf("AliAnalysisTaskSECharmFraction::Obsolete method! Parameters pt=%f,invmasscut=%f not used \n",pt,invMassCut);
6529 //__________________________________________________________
6530 void AliAnalysisTaskSECharmFraction::CheckInvMassD0(AliAODRecoDecayHF2Prong *d,Double_t &invMassD0,Double_t &invMassD0bar,Bool_t &isPeakD0,Bool_t &isPeakD0bar,Bool_t &isSideBandD0,Bool_t &isSideBandD0bar){
6531 //Check wheter the candidate inv. mass is compatible with signal or sideband inv. mass selection
6533 d->InvMassD0(invMassD0,invMassD0bar);
6535 if(TMath::Abs(invMassD0-fmD0PDG)<fsignalInvMassCut)isPeakD0=kTRUE;
6536 if(TMath::Abs(invMassD0bar-fmD0PDG)<fsignalInvMassCut)isPeakD0bar=kTRUE;
6537 //CHECK if ISSIDEBAND: no constraint is present between signal region definition and side band definition
6538 // ######## TO BE CHANGED the distinction between sidebandD0 and sidebandD0bar is meaningless
6539 // and it is present only for side band region study (see which inv mass has the D0(D0bar)
6540 // in case the D0bar(D0) is in the sideband) #######
6541 if(TMath::Abs(invMassD0-fmD0PDG)>fsidebandInvMassCut&&TMath::Abs(invMassD0-fmD0PDG)<fsidebandInvMassCut+fsidebandInvMassWindow){
6544 if(TMath::Abs(invMassD0bar-fmD0PDG)>fsidebandInvMassCut&&TMath::Abs(invMassD0bar-fmD0PDG)<fsidebandInvMassCut+fsidebandInvMassWindow){
6545 isSideBandD0bar=kTRUE;
6551 //__________________________________________________________________
6552 AliAODRecoDecayHF* AliAnalysisTaskSECharmFraction::GetD0toKPiSignalType(const AliAODRecoDecayHF2Prong *d,TClonesArray *arrayMC,Int_t &signaltype,Double_t &massMumTrue,Double_t *primaryVtx){
6553 //THIS METHOD CHECK THE TYPE OF SIGNAL/BACKGROUND THE CANDIDATE IS.
6554 // IF (!AND ONLY IF) THE TWO DAUGHTERS COME FROM A COMMONE MOTHER A FAKE TRUE SECONDARY VERTEX IS CONSTRUCTED (aodDMC)
6556 // THE FOLLOWING SCHEME IS ADOPTED: signaltype is set to
6557 // 1:signal (D0 prompt); 2: signal D0 from Dstar; 3: D0 fromB 4: D0 from Dstar fromB
6558 // then background categories: -1: one or both daughters is a fake track
6559 // 5: both daughters come from a D meson != D0
6560 // 6: both daughters come from a D0->4prongs
6561 // 7: both daughetrs are primaries
6562 // 8: generic background (can include one of the previous if desired)
6563 // 9: daughters out of acceptance
6564 // 10: pathologic cases (not clear)
6565 // 11: end of the method without output
6566 // 12: different result than MatchToMC method
6568 AliAODMCParticle *mum1=0x0;
6569 AliAODMCParticle *b1=0x0,*b2=0x0;
6570 AliAODMCParticle *grandmoth1=0x0;
6572 AliAODRecoDecayHF *aodDMC=0x0;
6573 Int_t pdgdaughters[2]={211,321};
6574 Int_t labMum=d->MatchToMC(421,arrayMC,2,pdgdaughters);
6586 // get daughter AOD tracks
6587 AliAODTrack *trk0 = (AliAODTrack*)d->GetDaughter(0);
6588 AliAODTrack *trk1 = (AliAODTrack*)d->GetDaughter(1);
6590 if(trk0==0x0||trk1==0x0){
6591 AliDebug(2,"null daughter tracks \n");
6597 if(trk0->GetLabel()<0||trk1->GetLabel()<0){
6598 AliDebug(2,"Fake tracks? \n");
6603 b1=(AliAODMCParticle*)arrayMC->At(trk0->GetLabel());
6604 b2=(AliAODMCParticle*)arrayMC->At(trk1->GetLabel());
6605 mum1=(AliAODMCParticle*)arrayMC->At(labMum);
6606 massMumTrue=mum1->GetCalcMass();
6607 aodDMC=ConstructFakeTrueSecVtx(b1,b2,mum1,primaryVtx);
6614 Bool_t isfromDstar=kFALSE;
6616 if(mum1->GetMother()>=0){
6617 grandmoth1=(AliAODMCParticle*)arrayMC->At(mum1->GetMother());
6618 if(TMath::Abs(grandmoth1->GetPdgCode())==413||TMath::Abs(grandmoth1->GetPdgCode())==423)isfromDstar=kTRUE;// D0 COMING FROM A D*
6621 Int_t origin=CheckOrigin(arrayMC,mum1);
6623 if(isfromDstar)signaltype=2;
6628 if(isfromDstar)signaltype=4;
6632 else if(origin==-1){
6636 else if(origin==-2){
6641 signaltype=11;// JUST FOR SAFETY: SHOULD NEVER REACH THIS POINT
6646 //_________________________________________________________________________________________________
6647 Int_t AliAnalysisTaskSECharmFraction::CheckOrigin(const TClonesArray* arrayMC, const AliAODMCParticle *mcPartCandidate) const {
6649 // checking whether the mother of the particles come from a charm or a bottom quark
6652 Int_t pdgGranma = 0;
6654 mother = mcPartCandidate->GetMother();
6656 Int_t abspdgGranma =0;
6657 Bool_t isFromB=kFALSE;
6658 Bool_t isQuarkFound=kFALSE;
6661 AliAODMCParticle* mcGranma = dynamic_cast<AliAODMCParticle*>(arrayMC->At(mother));
6663 pdgGranma = mcGranma->GetPdgCode();
6664 abspdgGranma = TMath::Abs(pdgGranma);
6665 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
6668 if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
6669 mother = mcGranma->GetMother();
6671 AliError("Failed casting the mother particle!");
6676 if(!isQuarkFound)return -1;
6677 if(isFromB) return 5;
6681 //__________________________________________________
6682 AliAODRecoDecayHF* AliAnalysisTaskSECharmFraction::GetD0toKPiSignalTypeObsolete(const AliAODRecoDecayHF2Prong *d,TClonesArray *arrayMC,Int_t &signaltype,Double_t &massMumTrue,Double_t *primaryVtx){// OBSOLETE METHOD!!!!!
6683 //THIS METHOD CHECK THE TYPE OF SIGNAL/BACKGROUND THE CANDIDATE IS.
6684 // IF (!AND ONLY IF) THE TWO DAUGHTERS COME FROM A COMMONE MOTHER A FAKE TRUE SECONDARY VERTEX IS CONSTRUCTED (aodDMC)
6686 // THE FOLLOWING SCHEME IS ADOPTED: signaltype is set to
6687 // 1:signal (D0 prompt); 2: signal D0 from Dstar; 3: D0 fromB 4: D0 from Dstar fromB
6688 // then background categories: -1: one or both daughters is a fake track
6689 // 5: both daughters come from a D meson != D0
6690 // 6: both daughters come from a D0->4prongs
6691 // 7: both daughetrs are primaries
6692 // 8: generic background (can include one of the previous if desired)
6693 // 9: daughters out of acceptance
6694 // 10: pathologic cases (not clear)
6695 // 11: end of the method without output
6696 // 12: different result than MatchToMC method
6698 AliAODMCParticle *mum1=0x0;
6699 AliAODMCParticle *b1=0x0,*b2=0x0;
6700 AliAODMCParticle *grandmoth1=0x0;
6703 Int_t pdgmum,dglabels[2],matchtoMC;
6704 Int_t pdgdaughters[2]={211,321};
6705 // get daughter AOD tracks
6706 AliAODTrack *trk0 = (AliAODTrack*)d->GetDaughter(0);
6707 AliAODTrack *trk1 = (AliAODTrack*)d->GetDaughter(1);
6708 AliAODRecoDecayHF *aodDMC=0x0;
6709 if(trk0==0x0||trk1==0x0){
6710 AliDebug(2,"Delete tracks I AM \n");
6716 dglabels[0]=trk0->GetLabel();
6717 dglabels[1]=trk1->GetLabel();
6718 if(dglabels[0]<0||dglabels[1]<0){
6719 AliDebug(2,"HERE I AM \n");
6727 // printf("Before entering the MC checks \n");
6729 b1=(AliAODMCParticle*)arrayMC->At(trk0->GetLabel());
6730 b2=(AliAODMCParticle*)arrayMC->At(trk1->GetLabel());
6732 //Tracks with no mother ??? FAKE DECAY VERTEX
6736 if(b1->GetMother()<0||b2->GetMother()<0){
6737 //Tracks with no mother ??? FAKE DECAY VERTEX
6742 mum1=(AliAODMCParticle*)arrayMC->At(b1->GetMother());
6743 // mum2=(AliAODMCParticle*)arrayMC->At(b2->GetMother());//FOR FURTHER USE
6745 if(b1->GetMother()!=b2->GetMother()){
6746 //Check the label of the mother is the same
6753 massMumTrue=mum1->GetCalcMass();
6755 matchtoMC=d->MatchToMC(421,arrayMC,2,pdgdaughters);
6756 aodDMC=ConstructFakeTrueSecVtx(b1,b2,mum1,primaryVtx);
6763 // if((mum1->GetPdgCode()!=mum2->GetPdgCode()))continue; //Check the mother is the same particle
6764 // printf("Particle codes: tr1: %d, tr2: %d, mum1: %d, mum 2: %d \n",b1->GetPdgCode(),b2->GetPdgCode(),mum1->GetPdgCode(),mum2->GetPdgCode());
6765 if(!((TMath::Abs(b1->GetPdgCode())==321&&TMath::Abs(b1->GetPdgCode())!=211)||(TMath::Abs(b1->GetPdgCode())==211&&TMath::Abs(b1->GetPdgCode()!=321)))){
6766 // Not a Kaon and a Pion
6772 pdgmum=mum1->GetPdgCode();
6773 if(TMath::Abs(pdgmum)!=421){
6774 if(TMath::Abs(pdgmum)==411||TMath::Abs(pdgmum)==431||TMath::Abs(pdgmum)==443){
6775 // IT IS A SECONDARY VERTEX FROM CHARM BUT NOT A D0
6786 if(mum1->GetDaughter(1)-mum1->GetDaughter(0)+1!=2){
6787 // from D0 but NOT A 2 PRONG DECAY
6793 if(mum1->GetMother()<0){
6794 // A particle coming from nothing
6799 Bool_t isfromDstar=kFALSE;
6800 // matchtoMC=d->MatchToMC(421,arrayMC,2,pdgdaughters);
6801 grandmoth1=(AliAODMCParticle*)arrayMC->At(mum1->GetMother());
6802 if(TMath::Abs(grandmoth1->GetPdgCode())==413||TMath::Abs(grandmoth1->GetPdgCode())==423)isfromDstar=kTRUE;// D0 COMING FROM A D0*
6805 //CHECK FOR CABIBBO SUPPRESSED DECAY
6806 Int_t isCabibSup=0,pdgKaon;
6808 pdgKaon=b1->GetPdgCode();
6809 if(TMath::Abs(pdgKaon)!=321)pdgKaon=b2->GetPdgCode();
6810 if(pdgmum>0&&pdgKaon>0)isCabibSup=1;
6811 if(pdgmum<0&&pdgKaon<0)isCabibSup=1;
6817 // if(fcheckMCD0){//THIS CHECK IS NEEDED TO AVOID POSSIBLE FAILURE IN THE SECOND WHILE, FOR DEBUGGING
6818 while(TMath::Abs(grandmoth1->GetPdgCode())!=4&&TMath::Abs(grandmoth1->GetPdgCode())!=5){
6819 if(grandmoth1->GetMother()<0){
6820 //### THE FOLLOWING IN CASE OF DEBUGGING ##########Ã
6821 /*printf("mother=-1, pdgcode: %d \n",grandmoth1->GetPdgCode());
6822 Int_t son=grandmoth1->GetDaughter(0);
6823 sonpart=(AliAODMCParticle*)arrayMC->At(son);
6824 while(TMath::Abs(sonpart->GetPdgCode())!=421){
6825 printf("mother=-1, pdgcode: %d \n",sonpart->GetPdgCode());
6827 sonpart=(AliAODMCParticle*)arrayMC->At(son);
6833 grandmoth1=(AliAODMCParticle*)arrayMC->At(grandmoth1->GetMother());
6836 if(TMath::Abs(grandmoth1->GetPdgCode())==4){
6839 if(isfromDstar)signaltype=2;
6849 else if(TMath::Abs(grandmoth1->GetPdgCode())==5){
6851 if(isfromDstar)signaltype=4;
6862 signaltype=11;// JUST FOR SAFETY: SHOULD NEVER REACH THIS POINT
6867 //___________________________________
6868 AliAODRecoDecayHF* AliAnalysisTaskSECharmFraction::ConstructFakeTrueSecVtx(const AliAODMCParticle *b1, const AliAODMCParticle *b2, const AliAODMCParticle *mum,Double_t *primaryVtxTrue){
6869 // CONSTRUCT A FAKE TRUE SECONDARY VERTEX (aodDMC)
6870 //!!!NOTE THAT ONLY ONE MOTHER IS CONSIDERED: THE METHOD REQUIRES THE DAUGHTERS COME FROM THE SAME MOTHER !!
6871 if(b1==0x0||b2==0x0)return 0x0;
6872 if(mum==0x0)return 0x0;
6873 Double_t pD[3],xD[3],pXtrTrue[2],pYtrTrue[2],pZtrTrue[2],xtr1[3],xtr2[3];
6874 Int_t charge[2]={0,0};
6875 if(b1->Charge()==-1)charge[0]=1;
6877 if(b2->Charge()==-1){
6878 //printf("Same charges for prongs \n");
6879 if(!fLikeSign)return 0x0;
6884 pXtrTrue[charge[0]]=b1->Px();
6885 pYtrTrue[charge[0]]=b1->Py();
6886 pZtrTrue[charge[0]]=b1->Pz();
6887 if(!b1->XvYvZv(xtr1)){
6891 pXtrTrue[charge[1]]=b2->Px();
6892 pYtrTrue[charge[1]]=b2->Py();
6893 pZtrTrue[charge[1]]=b2->Pz();
6895 if(!mum->PxPyPz(pD)){
6896 //printf("!D from B:Get momentum failed \n");
6899 if(!mum->XvYvZv(xD)){
6900 //printf("!D from B:Get position failed \n");
6903 /* ############ THIS HAPPENS FROM TIME TO TIME: NUMERIC PROBLEM KNOWN #################
6904 if(pXtrTrue[0]+pXtrTrue[1]!=pD[0]){
6908 if(!b2->XvYvZv(xtr2)){
6911 Double_t d0dummy[2]={0.,0.};//TEMPORARY : dummy d0 for AliAODRecoDeay constructor
6912 AliAODRecoDecayHF* aodDMC=new AliAODRecoDecayHF(primaryVtxTrue,xD,2,0,pXtrTrue,pYtrTrue,pZtrTrue,d0dummy);
6914 /* ######## THE FOLLOWINF FOR DEBUGGING ############
6915 Printf("testing the Fake vertex: SecVtxX: %f, Px: %f, Py: %f, Pz:%f \n ",aodDMC->GetSecVtxX(),aodDMC->Px(),aodDMC->Py(),aodDMC->Pz());
6916 Printf("pD: x=%f, y=%f,z=%f\n",pD[0],pD[1],pD[2]);
6917 Printf("Daughters :px1:%f, px2:%f \n",pXtrTrue[0],pXtrTrue[1]);
6918 Printf("Daughters :py1:%f, py2:%f \n",pYtrTrue[0],pYtrTrue[1]);
6919 Printf("Daughters :pz1:%f, pz2:%f \n",pZtrTrue[0],pZtrTrue[1]);
6920 Printf("Mother pdg: %d",mum->GetPdgCode());
6921 Printf("Impact Par Prod: %f\n",aodDMC->ImpParXY());
6927 //________________________________________________________
6928 Bool_t AliAnalysisTaskSECharmFraction::FillHistos(AliAODRecoDecayHF2Prong *d,TList *&list,Int_t ptbin,Int_t okD0,Int_t okD0bar,Double_t invMassD0,Double_t invMassD0bar,Bool_t isPeakD0,Bool_t isPeakD0bar,Bool_t isSideBandD0,Bool_t isSideBandD0bar,Double_t massmumtrue,AliAODRecoDecayHF *aodDMC,Double_t *vtxTrue){//FILL THE HISTOGRAMS: TAKE THE HISTOS FROM THE list NAME
6931 if((!okD0)&&(!okD0bar))return kTRUE;
6932 if(ptbin==-1)return kTRUE;
6933 // flistNoCutsSignal->Add(hptD0NCsign);
6934 // flistNoCutsSignal->Add(hptD0VsMaxPtNCsign);
6935 // flistNoCutsSignal->Add(hptD0PTallsqrtNCsign);
6936 // flistNoCutsSignal->Add(hptD0PTallNCsign);
6938 // %%%%%% TO BE DONE
6939 // flistNoCutsSignal->Add(hptD0vsptBNCsign);
6940 // flistNoCutsSignal->Add(hpD0vspBNCsign);
6941 //flistNoCutsSignal->Add(hptD0vsptcquarkNCsign);
6942 //flistNoCutsSignal->Add(hpD0vspcquarkNCsign);
6943 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%
6944 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6947 //hd0zD0ptLSCsign_pt
6948 //hInvMassD0LSCsign_pt
6951 // %%% TO BE DONE %%
6952 //hCosPDPBLSCsign_pt
6953 //hCosPcPDLSCsign_pt
6955 Double_t pt=d->Pt();
6956 Double_t impparxy=d->ImpParXY()*10000.;
6960 // ######### Get Standard label for hist in tlist ###############
6961 TString namehist=list->GetName(),str;
6962 namehist.ReplaceAll("list","");
6964 // ######### Global properties histos #################
6965 // ####### take care: only for candidates which pass the cuts !! not for side band ########
6966 if(fFastAnalysis<2){
6967 if((isPeakD0&&okD0)||(isPeakD0bar&&okD0bar)){
6969 str.Append(namehist.Data());
6970 ((TH1F*)list->FindObject(str.Data()))->Fill(1e8*d->Prodd0d0(),d->CosPointingAngle());
6973 str.Append(namehist.Data());
6974 ((TH1F*)list->FindObject(str.Data()))->Fill(d->GetSecVtxZ());
6977 str.Append(namehist.Data());
6978 ((TH1F*)list->FindObject(str.Data()))->Fill(d->GetSecVtxX()*10000.);
6981 str.Append(namehist.Data());
6982 ((TH1F*)list->FindObject(str.Data()))->Fill(d->GetSecVtxY()*10000.);
6985 str.Append(namehist.Data());
6986 ((TH2F*)list->FindObject(str.Data()))->Fill(d->GetSecVtxX()*10000.,d->GetSecVtxY()*10000.);
6989 str.Append(namehist.Data());
6990 ((TH1F*)list->FindObject(str.Data()))->Fill(TMath::ATan2(d->GetSecVtxY()*10000.,d->GetSecVtxX()*10000.)*TMath::RadToDeg());
6993 str="hd0singlTrack";
6994 str.Append(namehist.Data());
6995 ((TH1F*)list->FindObject(str.Data()))->Fill(d->Getd0Prong(0)*10000.);
6996 ((TH1F*)list->FindObject(str.Data()))->Fill(d->Getd0Prong(1)*10000.);
6999 str.Append(namehist.Data());
7000 ((TH1F*)list->FindObject(str.Data()))->Fill(d->CosPointingAngle());
7003 str.Append(namehist.Data());
7004 ((TH1F*)list->FindObject(str.Data()))->Fill(1e8*d->Prodd0d0());
7006 //%%%%%%%% NEW HISTO %%%%%%%%%%
7008 str.Append(namehist.Data());
7009 ((TH1F*)list->FindObject(str.Data()))->Fill(1e4*d->GetDCA());
7011 str="hcosthetastar";
7012 str.Append(namehist.Data());
7013 if(okD0)((TH1F*)list->FindObject(str.Data()))->Fill(d->CosThetaStarD0());
7014 if(okD0bar)((TH1F*)list->FindObject(str.Data()))->Fill(d->CosThetaStarD0bar());
7017 str.Append(namehist.Data());
7018 ((TH1F*)list->FindObject(str.Data()))->Fill(pt);
7021 str.Append(namehist.Data());
7023 if(d->PtProng(1)>d->PtProng(0))pr=1;
7024 if(d->PtProng(pr)<fptMax[0]) ((TH1F*)list->FindObject(str.Data()))->Fill(pt-fptMax[0]);
7025 else if(d->PtProng(TMath::Abs(pr-1))<fptMax[1])((TH1F*)list->FindObject(str.Data()))->Fill(pt-fptMax[1]);
7026 else ((TH1F*)list->FindObject(str.Data()))->Fill(pt-fptMax[2]);
7029 str="hptD0PTallsqrt";
7030 str.Append(namehist.Data());
7031 Double_t sumsqrpt=fptAllSq-d->PtProng(1)*d->PtProng(1)-d->PtProng(0)*d->PtProng(0);
7032 if(sumsqrpt>0.)((TH1F*)list->FindObject(str.Data()))->Fill(pt,TMath::Sqrt(sumsqrpt));
7035 str.Append(namehist.Data());
7036 ((TH1F*)list->FindObject(str.Data()))->Fill(pt,fptAll-d->PtProng(1)-d->PtProng(0));
7040 str.Append(namehist.Data());
7043 if(d->GetPrimaryVtx()!=0x0)((TH1F*)list->FindObject(str.Data()))->Fill(1e4*(d->Zv()-d->GetPrimaryVtx()->GetZ()));
7046 str.Append(namehist.Data());
7049 ((TH1F*)list->FindObject(str.Data()))->Fill(d->Eta());
7051 // OTHER NEW ADDITIONAL HISTOS
7054 str.Append(namehist.Data());
7057 //printf("Hist name: %s \n",str.Data());
7058 ((TH1F*)list->FindObject(str.Data()))->Fill(1e8*d->Prodd0d0());
7062 str.Append(namehist.Data());
7065 //printf("Hist name: %s \n",str.Data());
7066 ((TH2F*)list->FindObject(str.Data()))->Fill(1e8*d->Prodd0d0(),impparxy);
7069 str="hangletracksVSd0xd0";
7070 str.Append(namehist.Data());
7073 //printf("Hist name: %s \n",str.Data());
7074 ((TH2F*)list->FindObject(str.Data()))->Fill(1e8*d->Prodd0d0(),d->ProngsRelAngle(0,1));
7076 str="hangletracksVSd0D0";
7077 str.Append(namehist.Data());
7080 // printf("Hist name: %s \n",str.Data());
7081 ((TH2F*)list->FindObject(str.Data()))->Fill(impparxy,d->ProngsRelAngle(0,1));
7082 // ####################################################
7086 // ######### Invariant mass histos #################
7087 if(fFastAnalysis<1){
7089 str.Append(namehist.Data());
7090 ((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0);
7091 ((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0bar);
7094 if(isPeakD0||isPeakD0bar){
7096 str.Append(namehist.Data());
7098 if(isPeakD0&&okD0)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0);
7099 if(isPeakD0bar&&okD0bar)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0bar);
7103 // The Following is a NEW HISTO
7105 str.Append(namehist.Data());
7108 if(okD0)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0);
7109 if((!fsplitMassD0D0bar)&&okD0bar)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0bar);
7110 str="hInvMassD0bar";
7111 str.Append(namehist.Data());
7114 if(fsplitMassD0D0bar&&okD0bar)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0bar);
7117 // FILLING OF THE SPARSE HISTO
7118 if(fFastAnalysis<=2){ // ONLY IF NOT VERY FAST ANALYSIS
7120 str.Append(namehist.Data());
7122 Double_t point[5]={invMassD0,invMassD0bar,pt,impparxy,0.};
7123 if(okD0&&okD0bar)point[4]=3.5;
7124 else if(okD0)point[4]=1.5;
7125 else if(okD0bar)point[4]=2.5;
7126 if(fReadMC&&aodDMC!=0x0&&namehist.Contains("fromB")){
7127 point[3]=aodDMC->ImpParXY()*10000.;
7129 ((THnSparseF*)list->FindObject(str.Data()))->Fill(point);
7130 if(fReadMC&&aodDMC!=0x0&&namehist.Contains("fromB")){
7133 str.Append(namehist.Data());
7134 ((THnSparseF*)list->FindObject(str.Data()))->Fill(point);
7139 str.Append(namehist.Data());
7140 if(okD0)((TH2F*)list->FindObject(str.Data()))->Fill(invMassD0,pt);
7141 if(okD0bar)((TH2F*)list->FindObject(str.Data()))->Fill(invMassD0bar,pt);
7148 if(fFastAnalysis<=3&&namehist.Contains("sign")){
7149 str="hSparseCxyLxy";
7150 str.Append(namehist.Data());
7151 Double_t nLxy=d->NormalizedDecayLengthXY();
7152 Double_t cosPxy=TMath::Abs(d->CosPointingAngleXY());
7153 Double_t point[4]={invMassD0,pt,cosPxy,nLxy};
7155 // printf("Listname: %s, Here the histo : %p \n",namehist.Data(),((THnSparseF*)list->FindObject(str.Data())));
7156 ((THnSparseF*)list->FindObject(str.Data()))->Fill(point);
7158 point[0]=invMassD0bar;
7160 ((THnSparseF*)list->FindObject(str.Data()))->Fill(point);
7166 /* if(isPeakD0||isPeakD0bar){
7168 str.Append(namehist.Data());
7170 if(isPeakD0&&okD0)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0);
7171 if(isPeakD0bar&&okD0bar)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0bar);
7172 // The Following is a NEW HISTO
7174 str.Append(namehist.Data());
7177 if(isPeakD0&&okD0)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0);
7178 if(isPeakD0bar&&okD0bar)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0bar);
7180 if(fFastAnalysis<2){
7181 if(isSideBandD0||isSideBandD0bar){
7183 str.Append(namehist.Data());
7185 if(okD0)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0);
7186 if(okD0bar)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0bar);
7193 str.Append(namehist.Data());
7194 ((TH1F*)list->FindObject(str.Data()))->Fill(massmumtrue);
7196 if(isPeakD0||isPeakD0bar){
7198 str.Append(namehist.Data());
7200 ((TH1F*)list->FindObject(str.Data()))->Fill(massmumtrue);
7202 if(isSideBandD0||isSideBandD0bar){
7204 str.Append(namehist.Data());
7206 ((TH1F*)list->FindObject(str.Data()))->Fill(massmumtrue);
7211 // ################ D0 Impact Parameter Histos #####################
7212 if(isPeakD0||isPeakD0bar){
7215 str.Append(namehist.Data());
7218 // WE COUNT TWICE A CANDIDATE UNDER THE INV MASS PEAK BOTH AS a D0 and a D0bar (if selected) for DATA ONLY
7219 // THIS BECAUSE WE SUBTRACT a "BACKGROUND" AMOUNT ESTIMATED USING THE INV MASS FIT INFORMATION
7220 // WHICH SHOULD ACCOUNT FOR REFLECTIONS
7222 ((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
7224 if(isPeakD0bar&&okD0bar){
7225 ((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
7229 if((isPeakD0&&okD0)||(isPeakD0bar&&okD0bar))((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
7233 str.Append(namehist.Data());
7234 str.Append("_PkMss_pt");
7237 // WE COUNT TWICE A CANDIDATE UNDER THE INV MASS PEAK BOTH AS a D0 and a D0bar (if selected) for DATA ONLY
7238 // THIS BECAUSE WE SUBTRACT a "BACKGROUND" AMOUNT ESTIMATED USING THE INV MASS FIT INFORMATION
7239 // WHICH SHOULD ACCOUNT FOR REFLECTIONS
7241 ((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
7243 if(isPeakD0bar&&okD0bar){
7244 ((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
7248 if((isPeakD0&&okD0)||(isPeakD0bar&&okD0bar))((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
7252 if(fReadMC&&vtxTrue){
7253 // ONLY AN HISTO FOR QA: WE DO NOT CONSIDER THE IMPACT PARAMETER FOR EACH MASS HYPOTHESIS
7255 str.Append(namehist.Data());
7257 ((TH1F*)list->FindObject(str.Data()))->Fill(d->AliAODRecoDecay::ImpParXY(vtxTrue)*10000.);
7259 str="hd0D0VtxTruept";
7260 str.Append(namehist.Data());
7261 str.Append("_PkMss_pt");
7263 ((TH1F*)list->FindObject(str.Data()))->Fill(d->AliAODRecoDecay::ImpParXY(vtxTrue)*10000.);
7266 if(fReadMC&&aodDMC!=0x0){
7267 // WE NEED JUST THE SHAPE: AVOID TAKING THE IMPACT PAR FOR EACH MASS HYPO PASSING THE CUTS
7268 // aodDMC->Print("");
7269 //aodDMC->ImpParXY();
7270 // aodDMC->Print("");
7272 str.Append(namehist.Data());
7274 ((TH1F*)list->FindObject(str.Data()))->Fill(aodDMC->ImpParXY()*10000.);
7277 str.Append(namehist.Data());
7278 str.Append("_PkMss_pt");
7280 ((TH1F*)list->FindObject(str.Data()))->Fill(aodDMC->ImpParXY()*10000.);
7283 else if(isSideBandD0||isSideBandD0bar){
7284 // WE ASSUME THE IMPACT PARAMETER DISTRIBUION FOR BACKGROUND(SIDEBANDS) CANDIDATES
7285 // IS NOT CORRELATED TO THE INVARIANT MASSES. THEREFORE WE JUST TAKE ONE TIME
7286 // THE IMPACT PARAMETER AND NOT ONE FOR EACH MASS HYPOTHESIS PASSING THE CUTS
7289 str.Append(namehist.Data());
7291 ((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
7294 str.Append(namehist.Data());
7295 str.Append("_SBMss_pt");
7297 ((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
7300 if(fReadMC&&vtxTrue){
7302 str.Append(namehist.Data());
7304 ((TH1F*)list->FindObject(str.Data()))->Fill(d->AliAODRecoDecay::ImpParXY(vtxTrue)*10000.);
7306 str="hd0D0VtxTruept";
7307 str.Append(namehist.Data());
7308 str.Append("_SBMss_pt");
7310 ((TH1F*)list->FindObject(str.Data()))->Fill(d->AliAODRecoDecay::ImpParXY(vtxTrue)*10000.);
7314 if(fReadMC&&aodDMC!=0x0){
7316 str.Append(namehist.Data());
7318 ((TH1F*)list->FindObject(str.Data()))->Fill(aodDMC->ImpParXY()*10000.);
7321 str.Append(namehist.Data());
7322 str.Append("_SBMss_pt");
7324 ((TH1F*)list->FindObject(str.Data()))->Fill(aodDMC->ImpParXY()*10000.);
7333 void AliAnalysisTaskSECharmFraction::FillHistoMCproperties(TClonesArray *arrayMC){
7334 //#############################################################
7335 // HERE LOOK AT global properties of D0 mesons, c quarks and B
7337 //#############################################################
7338 Double_t pxyzMum[3],pxyzDaught[3],cosOpenAngle=-1.1,ptmum,ptdaught;
7339 Int_t ncdaught=0,cquarksMC=0,nD0all=0,nD0FromB=0,nBdaught=0,nD0bquark=0,nD0bMeson=0,nD0bBaryon=0;
7340 for (Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++) {
7341 AliAODMCParticle* mcPart = dynamic_cast<AliAODMCParticle*>(arrayMC->At(iPart));
7343 AliWarning("Particle not found in tree, skipping");
7346 if (TMath::Abs(mcPart->GetPdgCode()) == 4){
7348 mcPart->PxPyPz(pxyzMum);
7351 ((TH1F*)flistMCproperties->FindObject("hMCcquarkAllPt"))->Fill(ptmum);
7352 ((TH1F*)flistMCproperties->FindObject("hMCcquarkAllEta"))->Fill(mcPart->Eta());
7353 ((TH1F*)flistMCproperties->FindObject("hMCcquarkAllEnergy"))->Fill(mcPart->E());
7354 //NOW LOOK FOR A D0 among cquark daughters
7355 ncdaught=mcPart->GetDaughter(1)-mcPart->GetDaughter(0)+1;
7356 ((TH1F*)flistMCproperties->FindObject("hMCcquarkNdaught"))->Fill(ncdaught);
7358 for(Int_t iDaught=mcPart->GetDaughter(0);iDaught<mcPart->GetDaughter(1);iDaught++){
7359 AliAODMCParticle* mcPartD0 = dynamic_cast<AliAODMCParticle*>(arrayMC->At(iDaught));
7360 if(mcPartD0==0x0)continue;
7361 if(TMath::Abs(mcPartD0->GetPdgCode()) == 421){
7362 // a D0 coming from a c quark
7363 mcPartD0->PxPyPz(pxyzDaught);
7364 ptdaught=mcPartD0->Pt();
7365 ((TH1F*)flistMCproperties->FindObject("hMCD0fromcPt"))->Fill(ptdaught);
7366 ((TH1F*)flistMCproperties->FindObject("hMCD0fromcEta"))->Fill(mcPartD0->Eta());
7367 ((TH1F*)flistMCproperties->FindObject("hMCD0fromcEnergy"))->Fill(mcPartD0->E());
7368 // ##############################################################################################
7369 // Compare D0 momentum and c quarks:
7370 // NB: here ALL D0 are considered, also those not decaying in KPi !!!
7371 // ##############################################################################################
7372 ((TH2F*)flistMCproperties->FindObject("hMCD0VscquarkPt"))->Fill(mcPart->Pt(),mcPartD0->Pt());
7373 ((TH2F*)flistMCproperties->FindObject("hMCD0VscquarkEnergy"))->Fill(mcPart->E(),mcPartD0->E());
7374 ((TH1F*)flistMCproperties->FindObject("hMCD0deltacquarkEnergy"))->Fill(mcPartD0->E()/mcPart->E());
7375 ((TH1F*)flistMCproperties->FindObject("hMCD0EnergyVsAvcquarkDaughtEn"))->Fill((mcPartD0->E()-(mcPart->E()/ncdaught))/mcPart->E());
7376 //calculate open angle
7377 if((pxyzMum[0]!=0.||pxyzMum[1]!=0.||pxyzMum[2]!=0.)&&(pxyzDaught[0]!=0.||pxyzDaught[1]!=0.||pxyzDaught[2]!=0.))cosOpenAngle=(pxyzDaught[0]*pxyzMum[0]+pxyzDaught[1]*pxyzMum[1]+pxyzDaught[2]*pxyzMum[2])/(TMath::Sqrt(pxyzDaught[0]*pxyzDaught[0]+pxyzDaught[1]*pxyzDaught[1]+pxyzDaught[2]*pxyzDaught[2])*TMath::Sqrt(pxyzDaught[0]*pxyzDaught[0]+pxyzDaught[1]*pxyzDaught[1]+pxyzDaught[2]*pxyzDaught[2]));
7378 ((TH1F*)flistMCproperties->FindObject("hMCD0cquarkAngle"))->Fill(cosOpenAngle);
7379 ((TH2F*)flistMCproperties->FindObject("hMCD0cquarkAngleEnergy"))->Fill(mcPart->E(),cosOpenAngle);
7385 // NOW LOOK FOR D0 not coming from cquarks
7386 if (TMath::Abs(mcPart->GetPdgCode()) == 421){
7388 if(mcPart->GetMother()<0)continue;
7389 AliAODMCParticle* mcD0Parent = dynamic_cast<AliAODMCParticle*>(arrayMC->At(mcPart->GetMother()));
7390 if(mcD0Parent==0x0)continue;
7391 Bool_t notfound=kFALSE,bMeson=kFALSE,bBaryon=kFALSE;
7393 while(TMath::Abs(mcD0Parent->GetPdgCode())!=4&&TMath::Abs(mcD0Parent->GetPdgCode())!=5){
7394 if(500<TMath::Abs(mcD0Parent->GetPdgCode())%10000&&TMath::Abs(mcD0Parent->GetPdgCode())<600){
7398 else if (5000<TMath::Abs(mcD0Parent->GetPdgCode())&&TMath::Abs(mcD0Parent->GetPdgCode())<6000){
7402 if(mcD0Parent->GetMother()==0x0){
7406 if(mcD0Parent->GetMother()<0){
7410 mcD0Parent=dynamic_cast<AliAODMCParticle*>(arrayMC->At(mcD0Parent->GetMother()));
7411 if(mcD0Parent==0x0) break;
7414 if(mcD0Parent==0x0)continue;
7415 if(notfound)continue;
7416 if(TMath::Abs(mcD0Parent->GetPdgCode())==4)continue;//D0 from c quarks already counted
7417 ((TH1F*)flistMCproperties->FindObject("hMCfromBpdgB"))->Fill(TMath::Abs(mcD0Parent->GetPdgCode()));
7418 if(bBaryon)nD0bBaryon++;
7419 else if(bMeson)nD0bMeson++;
7422 mcD0Parent->PxPyPz(pxyzMum);
7423 ptmum=mcD0Parent->Pt();
7424 ((TH1F*)flistMCproperties->FindObject("hMCBhadrPt"))->Fill(ptmum);
7425 ((TH1F*)flistMCproperties->FindObject("hMCBhadrEta"))->Fill(mcD0Parent->Eta());
7426 ((TH1F*)flistMCproperties->FindObject("hMCBhadrEnergy"))->Fill(mcD0Parent->E());
7428 nBdaught=mcD0Parent->GetDaughter(1)-mcD0Parent->GetDaughter(0)+1;
7429 ((TH1F*)flistMCproperties->FindObject("hMCBhadrNdaught"))->Fill(nBdaught);
7432 // Now take properties of this D0 coming from a B
7433 mcPart->PxPyPz(pxyzDaught);
7434 ptdaught=mcPart->Pt();
7435 ((TH1F*)flistMCproperties->FindObject("hMCD0fromBPt"))->Fill(ptdaught);
7436 ((TH1F*)flistMCproperties->FindObject("hMCD0fromBEta"))->Fill(mcPart->Eta());
7437 ((TH1F*)flistMCproperties->FindObject("hMCD0fromBEnergy"))->Fill(mcPart->E());
7438 // ##############################################################################################
7439 // Compare D0 momentum and b hadron:
7440 // NB: here ALL D0 are considered, also those not decaying in KPi !!!
7441 // ##############################################################################################
7442 ((TH2F*)flistMCproperties->FindObject("hMCD0VsBhadrPt"))->Fill(mcD0Parent->Pt(),mcPart->Pt());
7443 ((TH2F*)flistMCproperties->FindObject("hMCD0VsBhadrEnergy"))->Fill(mcD0Parent->E(),mcPart->E());
7444 ((TH1F*)flistMCproperties->FindObject("hMCD0deltaBhadrEnergy"))->Fill(mcPart->E()/mcD0Parent->E());
7445 ((TH1F*)flistMCproperties->FindObject("hMCD0EnergyVsAvBDaughtEn"))->Fill((mcPart->E()-(mcD0Parent->E()/nBdaught))/mcD0Parent->E());
7446 //calculate open angle
7447 if((pxyzMum[0]!=0.||pxyzMum[1]!=0.||pxyzMum[2]!=0.)&&(pxyzDaught[0]!=0.||pxyzDaught[1]!=0.||pxyzDaught[2]!=0.))cosOpenAngle=(pxyzDaught[0]*pxyzMum[0]+pxyzDaught[1]*pxyzMum[1]+pxyzDaught[2]*pxyzMum[2])/(TMath::Sqrt(pxyzDaught[0]*pxyzDaught[0]+pxyzDaught[1]*pxyzDaught[1]+pxyzDaught[2]*pxyzDaught[2])*TMath::Sqrt(pxyzDaught[0]*pxyzDaught[0]+pxyzDaught[1]*pxyzDaught[1]+pxyzDaught[2]*pxyzDaught[2]));
7448 ((TH1F*)flistMCproperties->FindObject("hMCD0BhadrAngle"))->Fill(cosOpenAngle);
7449 ((TH2F*)flistMCproperties->FindObject("hMCD0BhadrAngleEnergy"))->Fill(mcPart->E(),cosOpenAngle);
7452 ((TH1F*)flistMCproperties->FindObject("hMCPartFound"))->Fill(1,cquarksMC);
7453 ((TH1F*)flistMCproperties->FindObject("hMCPartFound"))->Fill(2,nD0all);
7454 ((TH1F*)flistMCproperties->FindObject("hMCPartFound"))->Fill(3,nD0FromB);
7455 ((TH1F*)flistMCproperties->FindObject("hMCPartFound"))->Fill(4,nD0bMeson);
7456 ((TH1F*)flistMCproperties->FindObject("hMCPartFound"))->Fill(5,nD0bBaryon);
7461 void AliAnalysisTaskSECharmFraction::SetPtBins(Int_t nbins,const Float_t *ptbins){
7462 if((fptbins)!=0x0)delete fptbins;
7463 fnbins=nbins;fptbins=new Float_t[fnbins];
7464 memcpy(fptbins,ptbins,fnbins*sizeof(Float_t));
7468 void AliAnalysisTaskSECharmFraction::SetStandardMassSelection(){
7469 //SET THE DEFAULT VALUES FOR INVARIANT MASS SELECTION
7472 SetSignalInvMassCut();
7473 SetLargeInvMassCut();
7474 SetSideBandInvMassCut();
7475 SetSideBandInvMassWindow();
7478 // HERE FOR SEARCH FOR SIGNAL
7479 SetSignalInvMassCut();
7480 SetLargeInvMassCut();
7481 SetSideBandInvMassCut();
7482 SetSideBandInvMassWindow();
7486 Bool_t AliAnalysisTaskSECharmFraction::SpecialSelD0(AliAODRecoDecayHF2Prong *d,Int_t &nusedforVtx){
7488 AliAODTrack *trk0 = (AliAODTrack*)d->GetDaughter(0);
7489 AliAODTrack *trk1 = (AliAODTrack*)d->GetDaughter(1);
7491 if(trk0->GetUsedForPrimVtxFit())nusedforVtx++;
7492 if(trk1->GetUsedForPrimVtxFit())nusedforVtx++;
7493 if(nusedforVtx>fNtrMaxforVtx)return kFALSE;
7495 if(TMath::Abs(d->Getd0Prong(1)) < -99999. ||
7496 TMath::Abs(d->Getd0Prong(0)) < -99999.) return kFALSE;
7503 AliAODVertex* AliAnalysisTaskSECharmFraction::GetPrimaryVtxSkipped(AliAODEvent *aodev,AliAODRecoDecayHF2Prong *d){
7504 //Calculate the primary vertex w/o the daughter tracks of the candidate
7506 AliESDVertex *vertexESD=0x0;
7507 AliAODVertex *vertexAOD=0x0;
7508 AliVertexerTracks *vertexer = new AliVertexerTracks(aodev->GetMagneticField());
7511 Int_t nTrksToSkip=2;
7512 AliAODTrack *dgTrack = (AliAODTrack*)d->GetDaughter(0);
7513 skipped[0]=dgTrack->GetID();
7514 dgTrack = (AliAODTrack*)d->GetDaughter(1);
7515 skipped[1]=dgTrack->GetID();
7519 vertexer->SetSkipTracks(nTrksToSkip,skipped);
7520 vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(aodev);
7521 vertexer->SetMinClusters(4);
7522 if(!vertexESD) return vertexAOD;
7523 if(vertexESD->GetNContributors()<=0) {
7524 AliDebug(2,"vertexing failed");
7525 delete vertexESD; vertexESD=NULL;
7529 delete vertexer; vertexer=NULL;
7532 // convert to AliAODVertex
7533 Double_t pos[3],cov[6],chi2perNDF;
7534 vertexESD->GetXYZ(pos); // position
7535 vertexESD->GetCovMatrix(cov); //covariance matrix
7536 chi2perNDF = vertexESD->GetChi2toNDF();
7537 delete vertexESD; vertexESD=NULL;
7539 vertexAOD = new AliAODVertex(pos,cov,chi2perNDF);
7546 Bool_t AliAnalysisTaskSECharmFraction::FillAziList(AliAODEvent *aod,Double_t azilist[30000],Int_t trkIDlist[30000],Int_t &nprim)const{
7547 Int_t ntracks=aod->GetNumberOfTracks();
7554 for(Int_t it=0;it<ntracks;it++) {
7555 AliAODTrack *track = aod->GetTrack(it);
7557 if(track->IsPrimaryCandidate()){
7558 if(track->Pt()>ptmin){
7560 azilist[nprim]=track->Phi();
7561 trkIDlist[nprim]=track->GetID();
7570 void AliAnalysisTaskSECharmFraction::FillAziHistos(AliAODRecoDecayHF2Prong *d,TList *&list,Int_t ptbin,Double_t azilist[30000],Int_t trkIDlist[30000],Int_t nprim,Int_t okD0,Int_t okD0bar,Bool_t isPeakD0,Bool_t isPeakD0bar,Bool_t isSideBandD0,Bool_t isSideBandD0bar)const{
7572 if((!okD0)&&(!okD0bar))return;
7573 if(ptbin==-1)return;
7574 TString namehist=list->GetName(),str;
7575 namehist.ReplaceAll("list","");
7576 // Double_t ptD=d->Pt();
7579 if(isPeakD0||isPeakD0bar)str.Append("PM");
7580 else if(isSideBandD0||isSideBandD0bar)str.Append("SB");
7582 str.Append(namehist.Data());
7587 dtr=(AliAODTrack*)d->GetDaughter(0);
7588 Int_t id1=dtr->GetID();
7589 dtr=(AliAODTrack*)d->GetDaughter(1);
7590 Int_t id2=dtr->GetID();
7592 Double_t phi=d->Phi();
7593 Double_t weight=1./nprim;
7595 for(Int_t j=0;j<nprim;j++){
7596 if(trkIDlist[j]!=id1&&trkIDlist[j]!=id2){
7598 if(azi>TMath::Pi())azi-=2.*TMath::Pi();
7599 else if(azi<-TMath::Pi())azi+=2.*TMath::Pi();
7601 ((TH1F*)list->FindObject(str.Data()))->Fill(azi,weight);
7616 void AliAnalysisTaskSECharmFraction::Terminate(const Option_t*){
7617 //TERMINATE METHOD: NOTHING TO DO