]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/vertexingHF/AliAnalysisTaskSECharmFraction.cxx
correct correction file name for LHC11d period
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAnalysisTaskSECharmFraction.cxx
CommitLineData
624c07ab 1/**************************************************************************
2 * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/////////////////////////////////////////////////////////////
17//
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
21//
d39e8f99 22// Author: Andrea Rossi, andrea.rossi@pd.infn.it
624c07ab 23/////////////////////////////////////////////////////////////
24
ac4c229c 25
624c07ab 26#include <TH1F.h>
27#include <TH2F.h>
d39e8f99 28#include <THnSparse.h>
624c07ab 29#include <TDatabasePDG.h>
30#include <TMath.h>
31#include <TROOT.h>
624c07ab 32#include "AliAODEvent.h"
624c07ab 33#include "AliAODRecoDecayHF2Prong.h"
34#include "AliAODRecoDecayHF.h"
35#include "AliAODRecoDecay.h"
e047b348 36#include "AliAnalysisDataSlot.h"
37#include "AliAnalysisDataContainer.h"
624c07ab 38#include "AliAODTrack.h"
e047b348 39#include "AliAODHandler.h"
40#include "AliESDtrack.h"
624c07ab 41#include "AliAODVertex.h"
e047b348 42#include "AliESDVertex.h"
43#include "AliVertexerTracks.h"
624c07ab 44#include "AliAODMCParticle.h"
e047b348 45#include "AliAODPid.h"
46#include "AliTPCPIDResponse.h"
624c07ab 47#include "AliAODMCHeader.h"
ac4c229c 48#include "AliAnalysisVertexingHF.h"
624c07ab 49#include "AliAnalysisTaskSECharmFraction.h"
e047b348 50#include "AliRDHFCutsD0toKpi.h"
51#include "AliAODInputHandler.h"
52#include "AliAnalysisManager.h"
bd0c851a 53#include "AliNormalizationCounter.h"
ac4c229c 54
55class TCanvas;
56class TTree;
57class TChain;
ac4c229c 58class AliAnalysisTaskSE;
59
60
624c07ab 61ClassImp(AliAnalysisTaskSECharmFraction)
62
63//________________________________________________________________________
64 AliAnalysisTaskSECharmFraction::AliAnalysisTaskSECharmFraction()
65 : AliAnalysisTaskSE(),
e047b348 66 fCutsLoose(0),
67 fCutsTight(0),
d39e8f99 68 fFastAnalysis(1),
bf74e6db 69 fReadMC(kFALSE),
cc3209fb 70 fsplitMassD0D0bar(kTRUE),
e047b348 71 fLikeSign(kFALSE),
72 fusePID(kTRUE),
624c07ab 73 fmD0PDG(),
e047b348 74 fnbins(1),
624c07ab 75 fptbins(0),
e047b348 76 fNtrMaxforVtx(-1),
77 fptAll(),
78 fptAllSq(),
79 fptMax(),
c387e585 80 fAcceptanceCuts(),
624c07ab 81 fsignalInvMassCut(),
82 flargeInvMassCut(),
83 fsidebandInvMassCut(),
84 fsidebandInvMassWindow(),
85 fUseMC(kTRUE),
77ed0cdb 86 fCleanCandOwnVtx(kFALSE),
624c07ab 87 fNentries(0),
88 fSignalType(0),
89 fSignalTypeLsCuts(0),
90 fSignalTypeTghCuts(0),
bd0c851a 91 fCounter(0),
e047b348 92 flistMCproperties(0),
ac4c229c 93 flistNoCutsSignal(0),
94 flistNoCutsBack(0),
95 flistNoCutsFromB(0),
96 flistNoCutsFromDstar(0),
97 flistNoCutsOther(0),
98 flistLsCutsSignal(0),
99 flistLsCutsBack(0),
100 flistLsCutsFromB(0),
101 flistLsCutsFromDstar(0),
102 flistLsCutsOther(0),
103 flistTghCutsSignal(0),
104 flistTghCutsBack(0),
105 flistTghCutsFromB(0),
106 flistTghCutsFromDstar(0),
107 flistTghCutsOther(0)
624c07ab 108
109{
110 //Default constructor
111}
112//________________________________________________________________________
113 AliAnalysisTaskSECharmFraction::AliAnalysisTaskSECharmFraction(const char *name)
114 : AliAnalysisTaskSE(name),
e047b348 115 fCutsLoose(0x0),
116 fCutsTight(0x0),
d39e8f99 117 fFastAnalysis(1),
bf74e6db 118 fReadMC(kFALSE),
cc3209fb 119 fsplitMassD0D0bar(kTRUE),
e047b348 120 fLikeSign(kFALSE),
121 fusePID(kTRUE),
624c07ab 122 fmD0PDG(),
e047b348 123 fnbins(1),
624c07ab 124 fptbins(0),
e047b348 125 fNtrMaxforVtx(-1),
126 fptAll(),
127 fptAllSq(),
128 fptMax(),
c387e585 129 fAcceptanceCuts(),
e047b348 130 fsignalInvMassCut(-1.),
131 flargeInvMassCut(-1.),
132 fsidebandInvMassCut(-1.),
133 fsidebandInvMassWindow(-1.),
134 fUseMC(kFALSE),
77ed0cdb 135 fCleanCandOwnVtx(kFALSE),
624c07ab 136 fNentries(0),
137 fSignalType(0),
138 fSignalTypeLsCuts(0),
139 fSignalTypeTghCuts(0),
bd0c851a 140 fCounter(0),
e047b348 141 flistMCproperties(0),
ac4c229c 142 flistNoCutsSignal(0),
143 flistNoCutsBack(0),
144 flistNoCutsFromB(0),
145 flistNoCutsFromDstar(0),
146 flistNoCutsOther(0),
147 flistLsCutsSignal(0),
148 flistLsCutsBack(0),
149 flistLsCutsFromB(0),
150 flistLsCutsFromDstar(0),
151 flistLsCutsOther(0),
152 flistTghCutsSignal(0),
153 flistTghCutsBack(0),
154 flistTghCutsFromB(0),
155 flistTghCutsFromDstar(0),
156 flistTghCutsOther(0)
624c07ab 157
158{
159 // Constructor
160
161 // Define input and output slots here
162 // Input slot #0 works with a TChain
163 // Output slot #0 writes into a TH1 container
164
165 //Standard pt bin
e047b348 166 fnbins=SetStandardCuts(fptbins);// THIS TO SET NBINS AND BINNING
167
624c07ab 168 DefineOutput(1, TH1F::Class());
169 DefineOutput(2, TH1F::Class());
170 DefineOutput(3, TH1F::Class());
171 DefineOutput(4, TH1F::Class());
bd0c851a 172 DefineOutput(5, AliNormalizationCounter::Class());
173
174 for(Int_t j=6;j<22;j++){
624c07ab 175 DefineOutput(j, TList::Class());
176 }
177
e047b348 178 // Output slot for the Cut Objects
e047b348 179 DefineOutput(22,AliRDHFCutsD0toKpi::Class()); //My private output
bd0c851a 180 DefineOutput(23,AliRDHFCutsD0toKpi::Class()); //My private output
624c07ab 181
182}
183
184
e047b348 185AliAnalysisTaskSECharmFraction::AliAnalysisTaskSECharmFraction(const char *name,AliRDHFCutsD0toKpi *cutsA,AliRDHFCutsD0toKpi *cutsB)
624c07ab 186 : AliAnalysisTaskSE(name),
e047b348 187 fCutsLoose(0),
188 fCutsTight(0),
d39e8f99 189 fFastAnalysis(1),
bf74e6db 190 fReadMC(kFALSE),
cc3209fb 191 fsplitMassD0D0bar(kTRUE),
e047b348 192 fLikeSign(kFALSE),
193 fusePID(kTRUE),
624c07ab 194 fmD0PDG(),
e047b348 195 fnbins(1),
624c07ab 196 fptbins(0),
e047b348 197 fNtrMaxforVtx(-1),
198 fptAll(),
199 fptAllSq(),
200 fptMax(),
c387e585 201 fAcceptanceCuts(),
e047b348 202 fsignalInvMassCut(-1.),
203 flargeInvMassCut(-1.),
204 fsidebandInvMassCut(-1.),
205 fsidebandInvMassWindow(-1.),
206 fUseMC(kFALSE),
77ed0cdb 207 fCleanCandOwnVtx(kFALSE),
624c07ab 208 fNentries(0),
209 fSignalType(0),
210 fSignalTypeLsCuts(0),
211 fSignalTypeTghCuts(0),
bd0c851a 212 fCounter(0),
e047b348 213 flistMCproperties(0),
ac4c229c 214 flistNoCutsSignal(0),
215 flistNoCutsBack(0),
216 flistNoCutsFromB(0),
217 flistNoCutsFromDstar(0),
218 flistNoCutsOther(0),
219 flistLsCutsSignal(0),
220 flistLsCutsBack(0),
221 flistLsCutsFromB(0),
222 flistLsCutsFromDstar(0),
223 flistLsCutsOther(0),
224 flistTghCutsSignal(0),
225 flistTghCutsBack(0),
226 flistTghCutsFromB(0),
227 flistTghCutsFromDstar(0),
228 flistTghCutsOther(0)
624c07ab 229{
230 // Constructor
d39e8f99 231 if(fCutsTight){
232 delete fCutsTight;fCutsTight=NULL;
233 }
234 if(fCutsLoose){
235 delete fCutsLoose;fCutsLoose=NULL;
236 }
e047b348 237
238 //Check consistency between sets of cuts:
239 if(cutsA->GetNPtBins()!=cutsB->GetNPtBins()){
240 printf("Different number of pt bins between the two sets of cuts: SWITCH TO STANDARD CUTS \n");
241 fnbins=SetStandardCuts(fptbins);
242 }
243 else{
244 fCutsTight=new AliRDHFCutsD0toKpi(*cutsA);
245 fCutsLoose=new AliRDHFCutsD0toKpi(*cutsB);
246 for(Int_t j=0;j<cutsA->GetNPtBins();j++){
247 if(TMath::Abs(cutsA->GetPtBinLimits()[j]-cutsB->GetPtBinLimits()[j])>1.e-7){
248 printf("Different pt bin limits in the two set of cuts: use the first as reference \n");
249 fCutsLoose->SetPtBins(cutsA->GetNPtBins(),cutsA->GetPtBinLimits());
250 break;
251 }
252 }
253 SetPtBins(fCutsTight->GetNPtBins(),fCutsTight->GetPtBinLimits());
254 }
624c07ab 255
624c07ab 256 // Output slot #0 writes into a TH1 container
257 DefineOutput(1, TH1F::Class());
258 DefineOutput(2, TH1F::Class());
259 DefineOutput(3, TH1F::Class());
260 DefineOutput(4, TH1F::Class());
bd0c851a 261 DefineOutput(5, AliNormalizationCounter::Class());
262
263 for(Int_t j=6;j<22;j++){
624c07ab 264
265 DefineOutput(j, TList::Class());
266 }
e047b348 267 // Output slot for the Cut Objects
e047b348 268 DefineOutput(22,AliRDHFCutsD0toKpi::Class()); //My private output
bd0c851a 269 DefineOutput(23,AliRDHFCutsD0toKpi::Class()); //My private output
624c07ab 270
271}
272
273//________________________________________________________________________
274AliAnalysisTaskSECharmFraction::~AliAnalysisTaskSECharmFraction()
275{ //Destructor
276
d39e8f99 277 if (fCutsTight) {
e047b348 278 delete fCutsTight;
279 fCutsTight = 0;
624c07ab 280 }
d39e8f99 281 if (fCutsLoose) {
e047b348 282 delete fCutsLoose;
283 fCutsLoose = 0;
624c07ab 284 }
ac4c229c 285 if(fptbins){
286 delete fptbins;
287 fptbins =0;
288 }
c387e585 289 /* if(fAcceptanceCuts){
ac4c229c 290 delete fAcceptanceCuts;
291 fAcceptanceCuts=0;
c387e585 292 }*/
624c07ab 293 if (fNentries) {
294 delete fNentries;
295 fNentries = 0;
296 }
297 if (fSignalType) {
298 delete fSignalType;
299 fSignalType = 0;
300 }
301 if (fSignalTypeLsCuts) {
302 delete fSignalTypeLsCuts;
303 fSignalTypeLsCuts = 0;
304 }
305 if (fSignalTypeTghCuts) {
306 delete fSignalTypeTghCuts;
307 fSignalTypeTghCuts = 0;
308 }
bd0c851a 309
310 if (fCounter) {
311 delete fCounter;
312 fCounter = 0;
313 }
314
e047b348 315 if(flistMCproperties){
d39e8f99 316 flistMCproperties->Delete();
e047b348 317 delete flistMCproperties;
318 flistMCproperties=0;
bd0c851a 319 }
320
ac4c229c 321 if(flistNoCutsSignal){
d39e8f99 322 flistNoCutsSignal->Delete();
ac4c229c 323 delete flistNoCutsSignal;
324 flistNoCutsSignal=0;
624c07ab 325 }
ac4c229c 326 if(flistNoCutsBack){
d39e8f99 327 flistNoCutsBack->Delete();
ac4c229c 328 delete flistNoCutsBack;
329 flistNoCutsBack=0;
624c07ab 330 }
ac4c229c 331 if(flistNoCutsFromB){
d39e8f99 332 flistNoCutsFromB->Delete();
ac4c229c 333 delete flistNoCutsFromB;
334 flistNoCutsFromB=0;
624c07ab 335 }
ac4c229c 336 if(flistNoCutsFromDstar){
d39e8f99 337 flistNoCutsFromDstar->Delete();
ac4c229c 338 delete flistNoCutsFromDstar;
339 flistNoCutsFromDstar=0;
624c07ab 340 }
ac4c229c 341 if(flistNoCutsOther){
d39e8f99 342 flistNoCutsOther->Delete();
ac4c229c 343 delete flistNoCutsOther;
344 flistNoCutsOther=0;
624c07ab 345 }
346
ac4c229c 347 if(flistLsCutsSignal){
d39e8f99 348 flistLsCutsSignal->Delete();
ac4c229c 349 delete flistLsCutsSignal;
350 flistLsCutsSignal=0;
624c07ab 351 }
ac4c229c 352 if(flistLsCutsBack){
d39e8f99 353 flistLsCutsBack->Delete();
ac4c229c 354 delete flistLsCutsBack;
355 flistLsCutsBack=0;
624c07ab 356 }
ac4c229c 357 if(flistLsCutsFromB){
d39e8f99 358 flistLsCutsFromB->Delete();
ac4c229c 359 delete flistLsCutsFromB;
360 flistLsCutsFromB=0;
624c07ab 361 }
ac4c229c 362 if(flistLsCutsFromDstar){
d39e8f99 363 flistLsCutsFromDstar->Delete();
ac4c229c 364 delete flistLsCutsFromDstar;
365 flistLsCutsFromDstar=0;
624c07ab 366 }
ac4c229c 367 if(flistLsCutsOther){
d39e8f99 368 flistLsCutsOther->Delete();
ac4c229c 369 delete flistLsCutsOther;
370 flistLsCutsOther=0;
624c07ab 371 }
372
ac4c229c 373 if(flistTghCutsSignal){
d39e8f99 374 flistTghCutsSignal->Delete();
ac4c229c 375 delete flistTghCutsSignal;
376 flistTghCutsSignal=0;
624c07ab 377 }
ac4c229c 378 if(flistTghCutsBack){
d39e8f99 379 flistTghCutsBack->Delete();
ac4c229c 380 delete flistTghCutsBack;
381 flistTghCutsBack=0;
624c07ab 382 }
ac4c229c 383 if(flistTghCutsFromB){
d39e8f99 384 flistTghCutsFromB->Delete();
ac4c229c 385 delete flistTghCutsFromB;
386 flistTghCutsFromB=0;
624c07ab 387 }
ac4c229c 388 if(flistTghCutsFromDstar){
d39e8f99 389 flistTghCutsFromDstar->Delete();
ac4c229c 390 delete flistTghCutsFromDstar;
391 flistTghCutsFromDstar=0;
624c07ab 392 }
ac4c229c 393 if(flistTghCutsOther){
d39e8f99 394 flistTghCutsOther->Delete();
ac4c229c 395 delete flistTghCutsOther;
396 flistTghCutsOther=0;
624c07ab 397 }
398
399
400}
401
402
403//________________________________________________________________________
404void AliAnalysisTaskSECharmFraction::Init()
405{
406 // Initialization
407
408 if(fDebug > 1) printf("AnalysisTaskSED0Mass::Init() \n");
409 fmD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
410
e047b348 411 // gROOT->LoadMacro("$ALICE_ROOT/PWG3/vertexingHF/ConfigVertexingHF.C");
412 // gROOT->LoadMacro("$ALICE_ROOT/PWG3/vertexingHF/D0fromBSetCuts.C");
413 // 2 sets of dedicated cuts: fCutsTight is assumed as the standard cut object
624c07ab 414
e047b348 415 // SetAcceptanceCut();
416 if(fNtrMaxforVtx<0)SetNMaxTrForVtx(3); //DEFAULT : NO SELECTION
417 if(fsignalInvMassCut<0.||flargeInvMassCut<0.||fsidebandInvMassCut<0.||fsidebandInvMassWindow<0.){
418 printf("AliAnalysisTaskSECharmFraction: Not All info for mass selection provided: switch to default values \n");
419 SetStandardMassSelection();
624c07ab 420 }
e047b348 421
422 AliRDHFCutsD0toKpi* copyfCutsTight=new AliRDHFCutsD0toKpi(*fCutsTight);
a9f921f5 423 const char* nameoutputTight=GetOutputSlot(22)->GetContainer()->GetName();
e047b348 424 copyfCutsTight->SetName(nameoutputTight);
425 AliRDHFCutsD0toKpi* copyfCutsLoose=new AliRDHFCutsD0toKpi(*fCutsLoose);
a9f921f5 426 const char* nameoutputLoose=GetOutputSlot(23)->GetContainer()->GetName();
e047b348 427 copyfCutsLoose->SetName(nameoutputLoose);
77ed0cdb 428
e047b348 429 // Post the data
bd0c851a 430 PostData(22,copyfCutsTight);
431 PostData(23,copyfCutsLoose);
e047b348 432
77ed0cdb 433
434 fCleanCandOwnVtx=kFALSE;
435 if(fCutsTight->GetIsPrimaryWithoutDaughters()^fCutsLoose->GetIsPrimaryWithoutDaughters()) {
436 printf("Two cut objects have different selection for primary vertex recalculation w/o daughters:\n Dangerous for variable drawing!! \n");
437 }
438 else{
439 if(fCutsTight->GetIsPrimaryWithoutDaughters()){
440 fCleanCandOwnVtx=kTRUE;
441 fCutsTight->SetRemoveDaughtersFromPrim(kFALSE);
442 fCutsLoose->SetRemoveDaughtersFromPrim(kFALSE);
443 }
444 }
445
446
447
448
624c07ab 449 return;
450}
451
452//________________________________________________________________________
453void AliAnalysisTaskSECharmFraction::UserCreateOutputObjects()
454{
455 // Create histograms
456 // Called once
c387e585 457
458 // ################ NAMING SCHEME ###################################
459 // LISTS NAMING SCHEME
460 // "list" + cut selection string + MC selection string
461 // cut strings: "NC" =nocuts, "LSC"= loose cuts, "TGHC"= tight cuts
462 // MC sel. strings: "sign"= D0 from c quark
463 // "fromDstar" = D0 from Dstar from c quark
464 // "fromB"= D0from B decay (->from b quark) + D0from Dstar from B
465 // "back"= backgroun, generic except the cas "other"
466 // "other"= background case for candidates made of a pion and a kaon coming from the same D0 (in 4 prong) or from D+
467 //
468 // HISTS NAMING SCHEME
469 //
470 // "h" + specific name + cut selection string + MC selection string + (InvMass region string) + (pt string)
471 //
472 // cut selection strings = those for lists
473 // MC selection strings = those for lists
474 // inv mass region strings : "PM" or "SB" for global properties and pt integrated histos
475 // "_PkMss" or "_SBMss" for impact par. pt dependent histos
476 // pt string : "_pt" + integer number of ptbin
477 //
478 //###################################################################
624c07ab 479
480 TString namehist;
481 TString titlehist;
482 TString strnamept,strtitlept;
e047b348 483 Printf("INSIDE USER CREATE \n");
d39e8f99 484
77ed0cdb 485 // fNentries=new TH1F("nentriesChFr", "Look at the number of entries! = number of AODs", 2,1.,2.);
486
487 fNentries=new TH1F("nentriesChFr", "Analyzed sample properties", 21,-0.5,20.5);
d39e8f99 488
489 fNentries->GetXaxis()->SetBinLabel(1,"nEventsAnal");
77ed0cdb 490
491 fNentries->GetXaxis()->SetBinLabel(2,"nEvTGHTsel");
492 fNentries->GetXaxis()->SetBinLabel(3,"nEvTGHTPile-up Rej");
493 fNentries->GetXaxis()->SetBinLabel(4,"nEvTGHTGoodVtxS");
494 fNentries->GetXaxis()->SetBinLabel(5,"nEvTGHTRejVtxZ");
495 fNentries->GetXaxis()->SetBinLabel(6,"nTracksTGHTEv");
496 fNentries->GetXaxis()->SetBinLabel(7,"nCandTGHTEv");
497 fNentries->GetXaxis()->SetBinLabel(8,"nCandSelTGHTEv");
498 fNentries->GetXaxis()->SetBinLabel(20,"nUnexpErrorTGHT");
499
500 fNentries->GetXaxis()->SetBinLabel(9,"nEvLSsel");
501 fNentries->GetXaxis()->SetBinLabel(10,"nEvLSPile-up Rej");
502 fNentries->GetXaxis()->SetBinLabel(11,"nEvLSGoodVtxS");
503 fNentries->GetXaxis()->SetBinLabel(12,"nEvLSRejVtxZ");
504 fNentries->GetXaxis()->SetBinLabel(13,"nTracksLSEv");
505 fNentries->GetXaxis()->SetBinLabel(14,"nCandLSEv");
506 fNentries->GetXaxis()->SetBinLabel(15,"nCandSelLSEv");
507 fNentries->GetXaxis()->SetBinLabel(21,"nUnexpErrorTGHT");
508
509 /* ----------------- NOT ACTIVATED YET ------------------
510 fNentries->GetXaxis()->SetBinLabel(5,"ptbin = -1");
511 fNentries->GetXaxis()->SetBinLabel(6,"no daughter");
512 fNentries->GetXaxis()->SetBinLabel(7,"nCandSel(Tr)");
513 fNentries->GetXaxis()->SetBinLabel(8,"PID=0");
514 fNentries->GetXaxis()->SetBinLabel(9,"PID=1");
515 fNentries->GetXaxis()->SetBinLabel(10,"PID=2");
516 fNentries->GetXaxis()->SetBinLabel(11,"PID=3");
517 fNentries->GetXaxis()->SetBinLabel(12,"K");
518 fNentries->GetXaxis()->SetBinLabel(13,"Lambda");
519 fNentries->GetXaxis()->SetBinLabel(14,"Pile-up Rej");
520 fNentries->GetXaxis()->SetBinLabel(15,"N. of 0SMH");
521 */
522
d39e8f99 523 fNentries->GetXaxis()->SetNdivisions(1,kFALSE);
524
e047b348 525 fSignalType=new TH1F("hsignaltype", "Histo for type of MC signal", 61,-1.,60.);
526 fSignalTypeLsCuts=new TH1F("hsignaltypeLsCuts", "Histo for type of MC signal with loose cuts", 61,-1.,60.);
527 fSignalTypeTghCuts=new TH1F("hsignaltypeTghCuts", "Histo for type of MC signal with tight cuts", 61,-1.,60.);
624c07ab 528
bd0c851a 529
a9f921f5 530
bd0c851a 531 fCounter = new AliNormalizationCounter(Form("%s",GetOutputSlot(5)->GetContainer()->GetName()));
a9f921f5 532
624c07ab 533 //########## DEFINE THE TLISTS ##################
e047b348 534 flistMCproperties=new TList();
535 flistMCproperties->SetOwner();
536 flistMCproperties->SetName("listMCproperties");
537
ac4c229c 538 flistNoCutsSignal = new TList();
539 flistNoCutsSignal->SetOwner();
540 flistNoCutsSignal->SetName("listNCsign");
624c07ab 541
ac4c229c 542 flistNoCutsBack = new TList();
543 flistNoCutsBack->SetOwner();
544 flistNoCutsBack->SetName("listNCback");
624c07ab 545
ac4c229c 546 flistNoCutsFromB = new TList();
547 flistNoCutsFromB->SetOwner();
548 flistNoCutsFromB->SetName("listNCfromB");
624c07ab 549
ac4c229c 550 flistNoCutsFromDstar = new TList();
551 flistNoCutsFromDstar->SetOwner();
552 flistNoCutsFromDstar->SetName("listNCfromDstar");
624c07ab 553
ac4c229c 554 flistNoCutsOther = new TList();
555 flistNoCutsOther->SetOwner();
556 flistNoCutsOther->SetName("listNCother");
624c07ab 557
558
ac4c229c 559 flistLsCutsSignal = new TList();
560 flistLsCutsSignal->SetOwner();
561 flistLsCutsSignal->SetName("listLSCsign");
624c07ab 562
ac4c229c 563 flistLsCutsBack = new TList();
564 flistLsCutsBack->SetOwner();
565 flistLsCutsBack->SetName("listLSCback");
624c07ab 566
ac4c229c 567 flistLsCutsFromB = new TList();
568 flistLsCutsFromB->SetOwner();
569 flistLsCutsFromB->SetName("listLSCfromB");
624c07ab 570
ac4c229c 571 flistLsCutsFromDstar = new TList();
572 flistLsCutsFromDstar->SetOwner();
573 flistLsCutsFromDstar->SetName("listLSCfromDstar");
624c07ab 574
ac4c229c 575 flistLsCutsOther = new TList();
576 flistLsCutsOther->SetOwner();
577 flistLsCutsOther->SetName("listLSCother");
624c07ab 578
579
ac4c229c 580 flistTghCutsSignal = new TList();
581 flistTghCutsSignal->SetOwner();
582 flistTghCutsSignal->SetName("listTGHCsign");
624c07ab 583
ac4c229c 584 flistTghCutsBack = new TList();
585 flistTghCutsBack->SetOwner();
586 flistTghCutsBack->SetName("listTGHCback");
624c07ab 587
ac4c229c 588 flistTghCutsFromB = new TList();
589 flistTghCutsFromB->SetOwner();
590 flistTghCutsFromB->SetName("listTGHCfromB");
624c07ab 591
ac4c229c 592 flistTghCutsFromDstar = new TList();
593 flistTghCutsFromDstar->SetOwner();
594 flistTghCutsFromDstar->SetName("listTGHCfromDstar");
624c07ab 595
ac4c229c 596 flistTghCutsOther = new TList();
597 flistTghCutsOther->SetOwner();
598 flistTghCutsOther->SetName("listTGHCother");
624c07ab 599
600
601
e047b348 602 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.};
603 Float_t dumbinning[201];
604 for(Int_t j=0;j<201;j++){
605 dumbinning[j]=(Float_t)j*0.5;
606 }
d39e8f99 607
608 // DEFINE EDGES FOR SPARSE HISTOS
609 const Int_t nPtbinsForSparse=91;//nuber of edges, -1 to get number of bins
610 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
611 Double_t pT=0;
612 Double_t massbins[186],impparbins[401];
613 Double_t massHypoBins[4]={1.,2.,3.,4.};
614 Int_t nbinsSparse[5]={185,185,nPtbinsForSparse-1,400,3};
615 for(Int_t nBins=0;nBins<nPtbinsForSparse;nBins++){
616 ptbinsForNsparse[nBins]=pT;
617 if(pT<8.)pT+=0.2;
618 else if(pT<20)pT+=0.5;
619 else if(pT<40)pT+=1;
620 else if(pT<70)pT+=5.;
621 }
622 for(Int_t nBins=0;nBins<186;nBins++){
623 massbins[nBins]=1.680+nBins*(2.050-1.680)/185.;
624 }
625 for(Int_t nBins=0;nBins<401;nBins++){
626 impparbins[nBins]=-1000+nBins*(2000.)/400.;
627 }
628
629
a9f921f5 630 // Lxy and CosPointXY study
631 Int_t nbinsSparsCxyLxy[4]={84,fCutsTight->GetNPtBins(),10,25};
632 Double_t binLowLimitSparseCxyLxy[4]={1.680,fCutsTight->GetPtBinLimits()[0],0.99,0.};// Use OverFlow/UnderFlow to get other cases
633 Double_t binUpLimitSparseCxyLxy[4]={2.100,fCutsTight->GetPtBinLimits()[fCutsTight->GetNPtBins()],1.,50.};
d2027626 634 Double_t *ptbinlimitsCxyLxy=new Double_t[fCutsTight->GetNPtBins()+1];
a9f921f5 635 for(Int_t nBins=0;nBins<=fCutsTight->GetNPtBins();nBins++){
636 ptbinlimitsCxyLxy[nBins]=fCutsTight->GetPtBinLimits()[nBins];
637 }
638
d39e8f99 639
e047b348 640 //################################################################################################
641 // #
642 // HISTO FOR MC PROPERTIES OF D0, c quarks and B mesons #
643 // #
644 //################################################################################################
645 TH1F *hMCcquarkAllPt=new TH1F("hMCcquarkAllPt","c quark Pt (all cquarks produced)",34,ptbinsD0arr);
646 TH1F *hMCcquarkAllEta=new TH1F("hMCcquarkAllEta","c quark Eta (all cquarks produced)",50,-3.,3.);
647 TH1F *hMCcquarkAllEnergy=new TH1F("hMCcquarkAllEnergy","c quark Pt (all cquarks produced)",200,0.,100.);
648 TH1F *hMCcquarkNdaught=new TH1F("hMCcquarkNdaught","N cquark daughters (all cquarks produced)",100,0.,100.);
649 TH1F *hMCD0fromcPt=new TH1F("hMCD0fromcPt","D0 from c Pt",34,ptbinsD0arr);
650 TH1F *hMCD0fromcEta=new TH1F("hMCD0fromcEta","D0 from c Eta",50,-3.,3.);
651 TH1F *hMCD0fromcEnergy=new TH1F("hMCD0fromcEnergy","D0 from c Energy",200,0.,100.);
652
653 TH2F *hMCD0VscquarkPt=new TH2F("hMCD0VscquarkPt","D0 pt Vs cquark pt",34,ptbinsD0arr,34,ptbinsD0arr);
654 TH2F *hMCD0VscquarkEnergy=new TH2F("hMCD0VscquarkEnergy","D0 Energy Vs cquark Energy",200,0.,50.,200,0.,50.);
655 TH1F *hMCD0deltacquarkEnergy=new TH1F("hMCD0deltacquarkEnergy","Fractional D0 Energy w.r.t. cquark Energy",20,0.,1.);
656 TH1F *hMCD0EnergyVsAvcquarkDaughtEn=new TH1F("hMCD0EnergyVsAvcquarkDaughtEn","#Delta(E^{D^0}-E_{avg})/E_{cquark}",40,-1.,1.);
657 TH1F *hMCD0cquarkAngle=new TH1F("hMCD0cquarkAngle","cosine of the angle between D0 and c quark particle",40,-1.,1.);
658 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.);
659
660 TH1I *hMCfromBpdgB=new TH1I("hMCfromBpdgB","hMCfromBpdgB",10000,0.,10000);
661 TH1F *hMCBhadrPt=new TH1F("hMCBhadrPt","B hadr Pt",34,ptbinsD0arr);
662 TH1F *hMCBhadrEta=new TH1F("hMCBhadrEta","B hadr Eta",50,-3.,3.);
663 TH1F *hMCBhadrEnergy=new TH1F("hMCBhadrEnergy","B hadr Pt",200,0.,100.);
664 TH1F *hMCBhadrNdaught=new TH1F("hMCBhadrNdaught","N Bhadr daughters",100,0.,100.);
665 TH1F *hMCD0fromBPt=new TH1F("hMCD0fromBPt","D0 from B Pt",34,ptbinsD0arr);
666 TH1F *hMCD0fromBEta=new TH1F("hMCD0fromBEta","D0 from B Eta",50,-3.,3.);
667 TH1F *hMCD0fromBEnergy=new TH1F("hMCD0fromBEnergy","D0 from B Energy",200,0.,100.);
668
669 TH2F *hMCD0VsBhadrPt=new TH2F("hMCD0VsBhadrPt","D0 pt Vs Bhadr pt",34,ptbinsD0arr,34,ptbinsD0arr);
670 TH2F *hMCD0VsBhadrEnergy=new TH2F("hMCD0VsBhadrEnergy","D0 Energy Vs Bhadr Energy",200,0.,50.,200,0.,50.);
671 TH1F *hMCD0deltaBhadrEnergy=new TH1F("hMCD0deltaBhadrEnergy","Fractional D0 Energy w.r.t. Bhadr Energy",20,0.,1.);
672 TH1F *hMCD0EnergyVsAvBDaughtEn=new TH1F("hMCD0EnergyVsAvBDaughtEn","#Delta(E^{D^0}-E_{avg})/E_{Bahdr}",40,-1.,1.);
673 TH1F *hMCD0BhadrAngle=new TH1F("hMCD0BhadrAngle","cosine of the angle between D0 and Bhadr particle",40,-1.,1.);
674 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.);
675
676 TH1I *hMCPartFound=new TH1I("hMCPartFound","1=c,2=D0,3=fromBall,4=fromBmeson,5=fromBbaryon",6,0,6);
677
678
679 flistMCproperties->Add(hMCcquarkAllPt);
680 flistMCproperties->Add(hMCcquarkAllEta);
681 flistMCproperties->Add(hMCcquarkAllEnergy);
682 flistMCproperties->Add(hMCcquarkNdaught);
683 flistMCproperties->Add(hMCD0fromcPt);
684 flistMCproperties->Add(hMCD0fromcEta);
685 flistMCproperties->Add(hMCD0fromcEnergy);
686 flistMCproperties->Add(hMCD0VscquarkPt);
687 flistMCproperties->Add(hMCD0VscquarkEnergy);
688 flistMCproperties->Add(hMCD0deltacquarkEnergy);
689 flistMCproperties->Add(hMCD0EnergyVsAvcquarkDaughtEn);
690 flistMCproperties->Add(hMCD0cquarkAngle);
691 flistMCproperties->Add(hMCD0cquarkAngleEnergy);
692
693 flistMCproperties->Add(hMCfromBpdgB);
694 flistMCproperties->Add(hMCBhadrPt);
695 flistMCproperties->Add(hMCBhadrEta);
696 flistMCproperties->Add(hMCBhadrEnergy);
697 flistMCproperties->Add(hMCBhadrNdaught);
698 flistMCproperties->Add(hMCD0fromBPt);
699 flistMCproperties->Add(hMCD0fromBEta);
700 flistMCproperties->Add(hMCD0fromBEnergy);
701 flistMCproperties->Add(hMCD0VsBhadrPt);
702 flistMCproperties->Add(hMCD0VsBhadrEnergy);
703 flistMCproperties->Add(hMCD0deltaBhadrEnergy);
704 flistMCproperties->Add(hMCD0EnergyVsAvBDaughtEn);
705 flistMCproperties->Add(hMCD0BhadrAngle);
706 flistMCproperties->Add(hMCD0BhadrAngleEnergy);
707 flistMCproperties->Add(hMCPartFound);
624c07ab 708
709 //################################################################################################
710 // #
711 // HISTOS FOR NO CUTS CASE #
712 // #
713 //################################################################################################
e047b348 714 Printf("AFTER MC HISTOS \n");
624c07ab 715
716 //############ NO CUTS SIGNAL HISTOGRAMS ###############
717 //
718 // ####### global properties histo ############
719
e047b348 720 TH2F *hCPtaVSd0d0NCsign=new TH2F("hCPtaVSd0d0NCsign","hCPtaVSd0d0_NoCuts_Signal",1000,-100000.,100000.,100,-1.,1.);
ac4c229c 721 TH1F *hSecVtxZNCsign=new TH1F("hSecVtxZNCsign","hSecVtxZ_NoCuts_Signal",1000,-8.,8.);
722 TH1F *hSecVtxXNCsign=new TH1F("hSecVtxXNCsign","hSecVtxX_NoCuts_Signal",1000,-3000.,3000.);
723 TH1F *hSecVtxYNCsign=new TH1F("hSecVtxYNCsign","hSecVtxY_NoCuts_Signal",1000,-3000.,3000.);
724 TH2F *hSecVtxXYNCsign=new TH2F("hSecVtxXYNCsign","hSecVtxXY_NoCuts_Signal",1000,-3000.,3000.,1000,-3000.,3000.);
725 TH1F *hSecVtxPhiNCsign=new TH1F("hSecVtxPhiNCsign","hSecVtxPhi_NoCuts_Signal",180,-180.1,180.1);
e047b348 726 TH1F *hd0singlTrackNCsign=new TH1F("hd0singlTrackNCsign","hd0singlTrackNoCuts_Signal",1000,-5000.,5000.);
727 TH1F *hCPtaNCsign=new TH1F("hCPtaNCsign","hCPta_NoCuts_Signal",100,-1.,1.);
ac4c229c 728 TH1F *hd0xd0NCsign=new TH1F("hd0xd0NCsign","hd0xd0_NoCuts_Signal",1000,-100000.,100000.);
729 TH1F *hMassTrueNCsign=new TH1F("hMassTrueNCsign","D^{0} MC inv. Mass No Cuts Signal(All momenta)",600,1.600,2.200);
730 TH1F *hMassNCsign=new TH1F("hMassNCsign","D^{0} inv. Mass No Cuts Signal (All momenta)",600,1.600,2.200);
731 hMassNCsign->Sumw2();
732 TH1F *hMassTrueNCsignPM=new TH1F("hMassTrueNCsignPM","D^{0} MC inv. Mass No Cuts Signal, Mass Peak. (All momenta)",600,1.600,2.200);
733 TH1F *hMassNCsignPM=new TH1F("hMassNCsignPM","D^{0} inv. Mass No Cuts Signal (All momenta), MassPeak",600,1.600,2.200);
734 hMassNCsignPM->Sumw2();
735
736 TH1F *hMassTrueNCsignSB=new TH1F("hMassTrueNCsignSB","D^{0} MC inv. Mass in Side Bands No Cuts Signal(All momenta)",600,1.600,2.200);
737 TH1F *hMassNCsignSB=new TH1F("hMassNCsignSB","D^{0} inv. Mass in Side Bands No Cuts Signal (All momenta)",600,1.600,2.200);
738 hMassNCsignSB->Sumw2();
739
740 flistNoCutsSignal->Add(hCPtaVSd0d0NCsign);
741 flistNoCutsSignal->Add(hSecVtxZNCsign);
742 flistNoCutsSignal->Add(hSecVtxYNCsign);
743 flistNoCutsSignal->Add(hSecVtxXNCsign);
744 flistNoCutsSignal->Add(hSecVtxXYNCsign);
745 flistNoCutsSignal->Add(hSecVtxPhiNCsign);
e047b348 746 flistNoCutsSignal->Add(hd0singlTrackNCsign);
ac4c229c 747 flistNoCutsSignal->Add(hCPtaNCsign);
748 flistNoCutsSignal->Add(hd0xd0NCsign);
749 flistNoCutsSignal->Add(hMassTrueNCsign);
750 flistNoCutsSignal->Add(hMassNCsign);
751 flistNoCutsSignal->Add(hMassTrueNCsignPM);
752 flistNoCutsSignal->Add(hMassNCsignPM);
753 flistNoCutsSignal->Add(hMassTrueNCsignSB);
754 flistNoCutsSignal->Add(hMassNCsignSB);
e047b348 755
756 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
757 TH1F *hdcaNCsign=new TH1F("hdcaNCsign","hdca_NoCuts_Signal",100,0.,1000.);
758 hdcaNCsign->SetXTitle("dca [#mum]");
759 hdcaNCsign->SetYTitle("Entries");
760 TH1F *hcosthetastarNCsign=new TH1F("hcosthetastarNCsign","hCosThetaStar_NoCuts_Signal",50,-1.,1.);
761 hcosthetastarNCsign->SetXTitle("cos #theta^{*}");
762 hcosthetastarNCsign->SetYTitle("Entries");
763 TH1F *hptD0NCsign=new TH1F("hptD0NCsign","D^{0} transverse momentum distribution",34,ptbinsD0arr);
764 hptD0NCsign->SetXTitle("p_{t} [GeV/c]");
765 hptD0NCsign->SetYTitle("Entries");
766 TH1F *hptD0VsMaxPtNCsign=new TH1F("hptD0VsMaxPtNCsign","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
767 TH2F *hptD0PTallsqrtNCsign=new TH2F("hptD0PTallsqrtNCsign","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
768 TH2F *hptD0PTallNCsign=new TH2F("hptD0PTallNCsign","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
769 TH2F *hptD0vsptBNCsign=new TH2F("hptD0vsptBNCsign","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
770 TH2F *hpD0vspBNCsign=new TH2F("hpD0vspBNCsign","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
771 TH2F *hptD0vsptcquarkNCsign=new TH2F("hptD0vsptcquarkNCsign","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
772 TH2F *hpD0vspcquarkNCsign=new TH2F("hpD0vspcquarkNCsign","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
773 flistNoCutsSignal->Add(hdcaNCsign);
774 flistNoCutsSignal->Add(hcosthetastarNCsign);
775 flistNoCutsSignal->Add(hptD0NCsign);
776 flistNoCutsSignal->Add(hptD0VsMaxPtNCsign);
777 flistNoCutsSignal->Add(hptD0PTallsqrtNCsign);
778 flistNoCutsSignal->Add(hptD0PTallNCsign);
779 flistNoCutsSignal->Add(hptD0vsptBNCsign);
780 flistNoCutsSignal->Add(hpD0vspBNCsign);
781 flistNoCutsSignal->Add(hptD0vsptcquarkNCsign);
782 flistNoCutsSignal->Add(hpD0vspcquarkNCsign);
783
784 TH1F *hd0zD0ptNCsign;
cc3209fb 785 TH1F *hInvMassD0NCsign,*hInvMassD0barNCsign;
e047b348 786 TH2F *hInvMassPtNCsign=new TH2F("hInvMassPtNCsign","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
787 flistNoCutsSignal->Add(hInvMassPtNCsign);
d39e8f99 788 THnSparseF *hSparseNCsign=new THnSparseF("hSparseNCsign","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
789 hSparseNCsign->SetBinEdges(0,massbins);
790 hSparseNCsign->SetBinEdges(1,massbins);
791 hSparseNCsign->SetBinEdges(2,ptbinsForNsparse);
792 hSparseNCsign->SetBinEdges(3,impparbins);
793 hSparseNCsign->SetBinEdges(4,massHypoBins);
794 flistNoCutsSignal->Add(hSparseNCsign);
a9f921f5 795
796
797
798
799 THnSparseF *hSparseCxyLxyNCsign=new THnSparseF("hSparseCxyLxyNCsign","Candidate Mass;massD0;Pt;CosXY;Lxy",4,nbinsSparsCxyLxy,binLowLimitSparseCxyLxy,binUpLimitSparseCxyLxy);
800 hSparseCxyLxyNCsign->SetBinEdges(1,ptbinlimitsCxyLxy);
801 hSparseCxyLxyNCsign->GetAxis(0)->SetName("mass");
802 hSparseCxyLxyNCsign->GetAxis(0)->SetTitle("Invariant Mass (K#pi) [GeV/c^{2}]");
803 hSparseCxyLxyNCsign->GetAxis(1)->SetName("pt");
804 hSparseCxyLxyNCsign->GetAxis(1)->SetTitle("p_{t} [GeV/c]");
805 hSparseCxyLxyNCsign->GetAxis(2)->SetName("CosPointXY");
806 hSparseCxyLxyNCsign->GetAxis(2)->SetTitle("Cos#theta_{point}^{XY}");
807 hSparseCxyLxyNCsign->GetAxis(3)->SetName("NormDecLengthXY");
808 hSparseCxyLxyNCsign->GetAxis(3)->SetTitle("Normalized XY decay length");
809
810 flistNoCutsSignal->Add(hSparseCxyLxyNCsign);
811
d39e8f99 812
813
e047b348 814 TH1F *hetaNCsign;
815 TH1F *hCosPDPBNCsign;
816 TH1F *hCosPcPDNCsign;
817 // ADDITIONAL HISTOS
818 TH2F *hd0D0VSd0xd0NCsignpt;
819 TH2F *hangletracksVSd0xd0NCsignpt;
820 TH2F *hangletracksVSd0D0NCsignpt;
821 TH1F *hd0xd0NCsignpt;
77ed0cdb 822 // AZIMUHAL HISTOS
823 TH1F *hPhiHistPMNCsignpt,*hPhiHistSBNCsignpt;
e047b348 824
77ed0cdb 825
e047b348 826 TH2F *hTOFpidNCsign=new TH2F("hTOFpidNCsign","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
827 flistNoCutsSignal->Add(hTOFpidNCsign);
828
77ed0cdb 829
830
e047b348 831 //##################
832 for(Int_t i=0;i<fnbins;i++){
833 //Printf("INSIDE HISTOS CREATION LOOP: %d \n",fnbins);
77ed0cdb 834
835 namehist="hPhiHistPMNCsign_pt";
836 namehist+=i;
837 titlehist="Azimuthal correlation No Cuts Sign PM ptbin=";
838 titlehist+=i;
839 hPhiHistPMNCsignpt=new TH1F(namehist.Data(),titlehist.Data(),100,-3.15,3.15);
840 hPhiHistPMNCsignpt->Sumw2();
841 flistNoCutsSignal->Add(hPhiHistPMNCsignpt);
842
843 namehist="hPhiHistSBNCsign_pt";
844 namehist+=i;
845 titlehist="Azimuthal correlation No Cuts Sign SB ptbin=";
846 titlehist+=i;
847 hPhiHistSBNCsignpt=new TH1F(namehist.Data(),titlehist.Data(),100,-3.15,3.15);
848 hPhiHistSBNCsignpt->Sumw2();
849 flistNoCutsSignal->Add(hPhiHistSBNCsignpt);
850
851
e047b348 852 namehist="hd0zD0ptNCsign_pt";
853 namehist+=i;
854 titlehist="d0(z) No Cuts Signalm ptbin=";
855 titlehist+=i;
856 hd0zD0ptNCsign=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
857 hd0zD0ptNCsign->SetXTitle("d_{0}(z) [#mum]");
858 hd0zD0ptNCsign->SetYTitle("Entries");
859 flistNoCutsSignal->Add(hd0zD0ptNCsign);
860
cc3209fb 861 namehist="hInvMassD0NCsign_pt";
e047b348 862 namehist+=i;
cc3209fb 863 titlehist="Invariant Mass D0 No Cuts Signal ptbin=";
e047b348 864 titlehist+=i;
cc3209fb 865 hInvMassD0NCsign=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
866 hInvMassD0NCsign->SetXTitle("Invariant Mass [GeV]");
867 hInvMassD0NCsign->SetYTitle("Entries");
868 flistNoCutsSignal->Add(hInvMassD0NCsign);
869
870
871 namehist="hInvMassD0barNCsign_pt";
872 namehist+=i;
873 titlehist="Invariant Mass D0bar No Cuts Signal ptbin=";
874 titlehist+=i;
875 hInvMassD0barNCsign=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
876 hInvMassD0barNCsign->SetXTitle("Invariant Mass [GeV]");
877 hInvMassD0barNCsign->SetYTitle("Entries");
878 flistNoCutsSignal->Add(hInvMassD0barNCsign);
879
e047b348 880
881 namehist="hetaNCsign_pt";
882 namehist+=i;
883 titlehist="eta No Cuts Signal ptbin=";
884 titlehist+=i;
885 hetaNCsign=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
886 hetaNCsign->SetXTitle("Pseudorapidity");
887 hetaNCsign->SetYTitle("Entries");
888 flistNoCutsSignal->Add(hetaNCsign);
889
890 namehist="hCosPDPBNCsign_pt";
891 namehist+=i;
892 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
893 titlehist+=i;
894 hCosPDPBNCsign=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
895 hCosPDPBNCsign->SetXTitle("Cosine between D0 momentum and B momentum");
896 hCosPDPBNCsign->SetYTitle("Entries");
897 flistNoCutsSignal->Add(hCosPDPBNCsign);
898
899 namehist="hCosPcPDNCsign_pt";
900 namehist+=i;
901 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
902 titlehist+=i;
903 hCosPcPDNCsign=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
904 hCosPcPDNCsign->SetXTitle("Cosine between c quark momentum and D0 momentum");
905 hCosPcPDNCsign->SetYTitle("Entries");
906 flistNoCutsSignal->Add(hCosPcPDNCsign);
907
908
909 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
910 namehist="hd0xd0NCsign_pt";
911 namehist+=i;
912 titlehist="d0xd0 No Cuts Signal ptbin=";
913 titlehist+=i;
914 hd0xd0NCsignpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
915 hd0xd0NCsignpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
916 hd0xd0NCsignpt->SetYTitle("Entries");
917 flistNoCutsSignal->Add(hd0xd0NCsignpt);
918
919
920 namehist="hd0D0VSd0xd0NCsign_pt";
921 namehist+=i;
922 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} No Cuts Signal ptbin=";
923 titlehist+=i;
924 hd0D0VSd0xd0NCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
925 hd0D0VSd0xd0NCsignpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
926 hd0D0VSd0xd0NCsignpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
927 flistNoCutsSignal->Add(hd0D0VSd0xd0NCsignpt);
928
929
930 namehist="hangletracksVSd0xd0NCsign_pt";
931 namehist+=i;
932 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} No Cuts Signal ptbin=";
933 titlehist+=i;
934 hangletracksVSd0xd0NCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
935 hangletracksVSd0xd0NCsignpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
936 hangletracksVSd0xd0NCsignpt->SetYTitle(" angle between K and #p tracks [rad]");
937 flistNoCutsSignal->Add(hangletracksVSd0xd0NCsignpt);
938
939
940 namehist="hangletracksVSd0D0NCsign_pt";
941 namehist+=i;
942 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} No Cuts Signal ptbin=";
943 titlehist+=i;
944 hangletracksVSd0D0NCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
945 hangletracksVSd0D0NCsignpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
946 hangletracksVSd0D0NCsignpt->SetYTitle(" angle between K and #p tracks [rad]");
947 flistNoCutsSignal->Add(hangletracksVSd0D0NCsignpt);
948
949 }
950 Printf("AFTER LOOP HISTOS CREATION \n");
951 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
952 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
624c07ab 953
954 // ####### d0 D0 histos ############
ac4c229c 955 TH1F *hd0D0NCsignPM = new TH1F("hd0D0NCsignPM","D^{0} impact par. plot , No Cuts ,Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
956 hd0D0NCsignPM->SetXTitle("Impact parameter [#mum]");
957 hd0D0NCsignPM->SetYTitle("Entries");
958
959 TH1F *hd0D0VtxTrueNCsignPM = new TH1F("hd0D0VtxTrueNCsignPM","D^{0} impact par. w.r.t. True Vtx, No Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
960 hd0D0VtxTrueNCsignPM->SetXTitle("Impact parameter [#mum]");
961 hd0D0VtxTrueNCsignPM->SetYTitle("Entries");
962
963 TH1F *hMCd0D0NCsignPM = new TH1F("hMCd0D0NCsignPM","D^{0} impact par. plot, No Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
964 hMCd0D0NCsignPM->SetXTitle("MC Impact parameter [#mum]");
965 hMCd0D0NCsignPM->SetYTitle("Entries");
966
967 TH1F *hd0D0NCsignSB = new TH1F("hd0D0NCsignSB","D^{0} impact par. plot , No Cuts ,Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
968 hd0D0NCsignSB->SetXTitle("Impact parameter [#mum]");
969 hd0D0NCsignSB->SetYTitle("Entries");
970
971 TH1F *hd0D0VtxTrueNCsignSB = new TH1F("hd0D0VtxTrueNCsignSB","D^{0} impact par. w.r.t. True Vtx, No Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
972 hd0D0VtxTrueNCsignSB->SetXTitle("Impact parameter [#mum]");
973 hd0D0VtxTrueNCsignSB->SetYTitle("Entries");
974
975 TH1F *hMCd0D0NCsignSB = new TH1F("hMCd0D0NCsignSB","D^{0} impact par. plot, No Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
976 hMCd0D0NCsignSB->SetXTitle("MC Impact parameter [#mum]");
977 hMCd0D0NCsignSB->SetYTitle("Entries");
978
979 flistNoCutsSignal->Add(hd0D0NCsignPM);
980 flistNoCutsSignal->Add(hd0D0VtxTrueNCsignPM);
981 flistNoCutsSignal->Add(hMCd0D0NCsignPM);
982 flistNoCutsSignal->Add(hd0D0NCsignSB);
983 flistNoCutsSignal->Add(hd0D0VtxTrueNCsignSB);
984 flistNoCutsSignal->Add(hMCd0D0NCsignSB);
985
e047b348 986 TH1F *hd0D0ptNCsignPM;
987 TH1F *hMCd0D0ptNCsignPM;
988 TH1F *hd0D0VtxTrueptNCsignPM;
989 TH1F *hd0D0ptNCsignSB;
990 TH1F *hMCd0D0ptNCsignSB;
991 TH1F *hd0D0VtxTrueptNCsignSB;
ac4c229c 992 namehist="hd0D0ptNCsign_";
624c07ab 993 titlehist="D^{0} impact par. plot, No Cuts, Signal, ";
994 for(Int_t i=0;i<fnbins;i++){
d39e8f99 995 //Printf("IN HISTOS CREATION USING PTBINS VALUES for NAMES \n");
624c07ab 996 strnamept=namehist;
997 strnamept.Append("PkMss_pt");
998 strnamept+=i;
999
1000 strtitlept=titlehist;
1001 strtitlept.Append(" Mass Peak, ");
e047b348 1002
624c07ab 1003 strtitlept+=fptbins[i];
d39e8f99 1004 //Printf("IN HISTOS CREATION USING PTBINS VALUES for NAMES %d: %f\n",i,fptbins[i]);
624c07ab 1005 strtitlept.Append("<= pt <");
1006 strtitlept+=fptbins[i+1];
1007 strtitlept.Append(" [GeV/c]");
1008
e047b348 1009 hd0D0ptNCsignPM= new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1010 hd0D0ptNCsignPM->SetXTitle("Impact parameter [#mum] ");
1011 hd0D0ptNCsignPM->SetYTitle("Entries");
1012 flistNoCutsSignal->Add(hd0D0ptNCsignPM);
624c07ab 1013
1014 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 1015 hMCd0D0ptNCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1016 hMCd0D0ptNCsignPM->SetXTitle("MC Impact parameter [#mum] ");
1017 hMCd0D0ptNCsignPM->SetYTitle("Entries");
1018 flistNoCutsSignal->Add(hMCd0D0ptNCsignPM);
624c07ab 1019
1020
1021 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 1022 hd0D0VtxTrueptNCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1023 hd0D0VtxTrueptNCsignPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1024 hd0D0VtxTrueptNCsignPM->SetYTitle("Entries");
1025 flistNoCutsSignal->Add(hd0D0VtxTrueptNCsignPM);
624c07ab 1026
1027 strnamept=namehist;
1028 strnamept.Append("SBMss_pt");
1029 strnamept+=i;
1030
1031 strtitlept=titlehist;
1032 strtitlept.Append(" Side Bands, ");
1033 strtitlept+=fptbins[i];
1034 strtitlept.Append("<= pt <");
1035 strtitlept+=fptbins[i+1];
1036 strtitlept.Append(" [GeV/c]");
1037
e047b348 1038 hd0D0ptNCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1039 hd0D0ptNCsignSB->SetXTitle("Impact parameter [#mum] ");
1040 hd0D0ptNCsignSB->SetYTitle("Entries");
1041 flistNoCutsSignal->Add(hd0D0ptNCsignSB);
624c07ab 1042
1043 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 1044 hMCd0D0ptNCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1045 hMCd0D0ptNCsignSB->SetXTitle("MC Impact parameter [#mum] ");
1046 hMCd0D0ptNCsignSB->SetYTitle("Entries");
1047 flistNoCutsSignal->Add(hMCd0D0ptNCsignSB);
624c07ab 1048
1049 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 1050 hd0D0VtxTrueptNCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1051 hd0D0VtxTrueptNCsignSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1052 hd0D0VtxTrueptNCsignSB->SetYTitle("Entries");
1053 flistNoCutsSignal->Add(hd0D0VtxTrueptNCsignSB);
624c07ab 1054 }
1055
d39e8f99 1056 //Printf("AFTER SIGNAL HISTOS CREATION for NOCUTS\n");
e047b348 1057
624c07ab 1058
1059 //############ NO CUTS BACKGROUND HISTOGRAMS ###########
1060 //
1061 // ######## global properties histos #######
e047b348 1062 TH2F *hCPtaVSd0d0NCback=new TH2F("hCPtaVSd0d0NCback","hCPtaVSd0d0_NoCuts_Background",1000,-100000.,100000.,100,-1.,1.);
ac4c229c 1063 TH1F *hSecVtxZNCback=new TH1F("hSecVtxZNCback","hSecVtxZ_NoCuts_Background",1000,-8.,8.);
1064 TH1F *hSecVtxXNCback=new TH1F("hSecVtxXNCback","hSecVtxX_NoCuts_Background",1000,-3000.,3000.);
1065 TH1F *hSecVtxYNCback=new TH1F("hSecVtxYNCback","hSecVtxY_NoCuts_Background",1000,-3000.,3000.);
1066 TH2F *hSecVtxXYNCback=new TH2F("hSecVtxXYNCback","hSecVtxXY_NoCuts_Background",1000,-3000.,3000.,1000,-3000.,3000.);
1067 TH1F *hSecVtxPhiNCback=new TH1F("hSecVtxPhiNCback","hSecVtxPhi_NoCuts_Background",180,-180.1,180.1);
e047b348 1068 TH1F *hd0singlTrackNCback=new TH1F("hd0singlTrackNCback","hd0singlTrackNoCuts_Back",1000,-5000.,5000.);
1069 TH1F *hCPtaNCback=new TH1F("hCPtaNCback","hCPta_NoCuts_Background",100,-1.,1.);
ac4c229c 1070 TH1F *hd0xd0NCback=new TH1F("hd0xd0NCback","hd0xd0_NoCuts_Background",1000,-100000.,100000.);
1071 TH1F *hMassTrueNCback=new TH1F("hMassTrueNCback","D^{0} MC inv. Mass No Cuts Background(All momenta)",600,1.600,2.200);
1072 TH1F *hMassNCback=new TH1F("hMassNCback","D^{0} inv. Mass No Cuts Background (All momenta)",600,1.600,2.200);
1073 hMassNCback->Sumw2();
1074 TH1F *hMassTrueNCbackPM=new TH1F("hMassTrueNCbackPM","D^{0} MC inv. Mass No Cuts Background, Mass Peak. (All momenta)",600,1.600,2.200);
1075 TH1F *hMassNCbackPM=new TH1F("hMassNCbackPM","D^{0} inv. Mass No Cuts Background (All momenta), MassPeak",600,1.600,2.200);
1076 hMassNCbackPM->Sumw2();
1077 TH1F *hMassTrueNCbackSB=new TH1F("hMassTrueNCbackSB","D^{0} MC inv. Mass in Side Bands No Cuts Background(All momenta)",600,1.600,2.200);
1078 TH1F *hMassNCbackSB=new TH1F("hMassNCbackSB","D^{0} inv. Mass in Side Bands No Cuts Background (All momenta)",600,1.600,2.200);
1079 hMassNCbackSB->Sumw2();
1080
1081 flistNoCutsBack->Add(hCPtaVSd0d0NCback);
1082 flistNoCutsBack->Add(hSecVtxZNCback);
1083 flistNoCutsBack->Add(hSecVtxYNCback);
1084 flistNoCutsBack->Add(hSecVtxXNCback);
1085 flistNoCutsBack->Add(hSecVtxXYNCback);
1086 flistNoCutsBack->Add(hSecVtxPhiNCback);
e047b348 1087 flistNoCutsBack->Add(hd0singlTrackNCback);
ac4c229c 1088 flistNoCutsBack->Add(hCPtaNCback);
1089 flistNoCutsBack->Add(hd0xd0NCback);
1090 flistNoCutsBack->Add(hMassTrueNCback);
1091 flistNoCutsBack->Add(hMassNCback);
1092 flistNoCutsBack->Add(hMassTrueNCbackPM);
1093 flistNoCutsBack->Add(hMassNCbackPM);
1094 flistNoCutsBack->Add(hMassTrueNCbackSB);
1095 flistNoCutsBack->Add(hMassNCbackSB);
624c07ab 1096
1097
e047b348 1098 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
1099 TH1F *hdcaNCback=new TH1F("hdcaNCback","hdca_NoCuts_Backgr",100,0.,1000.);
1100 hdcaNCback->SetXTitle("dca [#mum]");
1101 hdcaNCback->SetYTitle("Entries");
1102 TH1F *hcosthetastarNCback=new TH1F("hcosthetastarNCback","hCosThetaStar_NoCuts_Backgr",50,-1.,1.);
1103 hcosthetastarNCback->SetXTitle("cos #theta^{*}");
1104 hcosthetastarNCback->SetYTitle("Entries");
1105 TH1F *hptD0NCback=new TH1F("hptD0NCback","D^{0} transverse momentum distribution",34,ptbinsD0arr);
1106 hptD0NCback->SetXTitle("p_{t} [GeV/c]");
1107 hptD0NCback->SetYTitle("Entries");
1108 TH1F *hptD0VsMaxPtNCback=new TH1F("hptD0VsMaxPtNCback","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
1109 TH2F *hptD0PTallsqrtNCback=new TH2F("hptD0PTallsqrtNCback","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
1110 TH2F *hptD0PTallNCback=new TH2F("hptD0PTallNCback","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
1111 TH2F *hptD0vsptBNCback=new TH2F("hptD0vsptBNCback","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1112 TH2F *hpD0vspBNCback=new TH2F("hpD0vspBNCback","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1113 TH2F *hptD0vsptcquarkNCback=new TH2F("hptD0vsptcquarkNCback","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1114 TH2F *hpD0vspcquarkNCback=new TH2F("hpD0vspcquarkNCback","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1115 flistNoCutsBack->Add(hdcaNCback);
1116 flistNoCutsBack->Add(hcosthetastarNCback);
1117 flistNoCutsBack->Add(hptD0NCback);
1118 flistNoCutsBack->Add(hptD0VsMaxPtNCback);
1119 flistNoCutsBack->Add(hptD0PTallsqrtNCback);
1120 flistNoCutsBack->Add(hptD0PTallNCback);
1121 flistNoCutsBack->Add(hptD0vsptBNCback);
1122 flistNoCutsBack->Add(hpD0vspBNCback);
1123 flistNoCutsBack->Add(hptD0vsptcquarkNCback);
1124 flistNoCutsBack->Add(hpD0vspcquarkNCback);
1125
1126 TH1F *hd0zD0ptNCback;
cc3209fb 1127 TH1F *hInvMassD0NCback,*hInvMassD0barNCback;
e047b348 1128 TH2F *hInvMassPtNCback=new TH2F("hInvMassPtNCback","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
d39e8f99 1129 THnSparseF *hSparseNCback=new THnSparseF("hSparseNCback","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
1130 hSparseNCback->SetBinEdges(0,massbins);
1131 hSparseNCback->SetBinEdges(1,massbins);
1132 hSparseNCback->SetBinEdges(2,ptbinsForNsparse);
1133 hSparseNCback->SetBinEdges(3,impparbins);
1134 hSparseNCback->SetBinEdges(4,massHypoBins);
1135 flistNoCutsBack->Add(hSparseNCback);
1136
e047b348 1137 TH1F *hetaNCback;
1138 TH1F *hCosPDPBNCback;
1139 TH1F *hCosPcPDNCback;
1140 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
1141 TH2F *hd0D0VSd0xd0NCbackpt;
1142 TH2F *hangletracksVSd0xd0NCbackpt;
1143 TH2F *hangletracksVSd0D0NCbackpt;
1144 TH1F *hd0xd0NCbackpt;
1145 flistNoCutsBack->Add(hInvMassPtNCback);
1146
1147 TH2F *hTOFpidNCback=new TH2F("hTOFpidNCback","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
1148 flistNoCutsBack->Add(hTOFpidNCback);
1149
1150 for(Int_t i=0;i<fnbins;i++){
1151 namehist="hd0zD0ptNCback_pt";
1152 namehist+=i;
1153 titlehist="d0(z) No Cuts Backgrm ptbin=";
1154 titlehist+=i;
1155 hd0zD0ptNCback=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
1156 hd0zD0ptNCback->SetXTitle("d_{0}(z) [#mum]");
1157 hd0zD0ptNCback->SetYTitle("Entries");
1158 flistNoCutsBack->Add(hd0zD0ptNCback);
1159
cc3209fb 1160 namehist="hInvMassD0NCback_pt";
e047b348 1161 namehist+=i;
1162 titlehist="Invariant Mass No Cuts Backgr ptbin=";
1163 titlehist+=i;
cc3209fb 1164 hInvMassD0NCback=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
1165 hInvMassD0NCback->SetXTitle("Invariant Mass [GeV]");
1166 hInvMassD0NCback->SetYTitle("Entries");
1167 flistNoCutsBack->Add(hInvMassD0NCback);
1168
1169
1170 namehist="hInvMassD0barNCback_pt";
1171 namehist+=i;
1172 titlehist="Invariant Mass D0bar No Cuts Back ptbin=";
1173 titlehist+=i;
1174 hInvMassD0barNCback=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
1175 hInvMassD0barNCback->SetXTitle("Invariant Mass [GeV]");
1176 hInvMassD0barNCback->SetYTitle("Entries");
1177 flistNoCutsBack->Add(hInvMassD0barNCback);
1178
e047b348 1179
1180 namehist="hetaNCback_pt";
1181 namehist+=i;
1182 titlehist="eta No Cuts Backgr ptbin=";
1183 titlehist+=i;
1184 hetaNCback=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
1185 hetaNCback->SetXTitle("Pseudorapidity");
1186 hetaNCback->SetYTitle("Entries");
1187 flistNoCutsBack->Add(hetaNCback);
1188
1189 namehist="hCosPDPBNCback_pt";
1190 namehist+=i;
1191 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
1192 titlehist+=i;
1193 hCosPDPBNCback=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
1194 hCosPDPBNCback->SetXTitle("Cosine between D0 momentum and B momentum");
1195 hCosPDPBNCback->SetYTitle("Entries");
1196 flistNoCutsBack->Add(hCosPDPBNCback);
1197
1198 namehist="hCosPcPDNCback_pt";
1199 namehist+=i;
1200 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
1201 titlehist+=i;
1202 hCosPcPDNCback=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
1203 hCosPcPDNCback->SetXTitle("Cosine between c quark momentum and D0 momentum");
1204 hCosPcPDNCback->SetYTitle("Entries");
1205 flistNoCutsBack->Add(hCosPcPDNCback);
1206
1207
1208 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
1209 namehist="hd0xd0NCback_pt";
1210 namehist+=i;
1211 titlehist="d0xd0 No Cuts Background ptbin=";
1212 titlehist+=i;
1213 hd0xd0NCbackpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
1214 hd0xd0NCbackpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
1215 hd0xd0NCbackpt->SetYTitle("Entries");
1216 flistNoCutsBack->Add(hd0xd0NCbackpt);
1217
1218
1219 namehist="hd0D0VSd0xd0NCback_pt";
1220 namehist+=i;
1221 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} No Cuts Back ptbin=";
1222 titlehist+=i;
1223 hd0D0VSd0xd0NCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
1224 hd0D0VSd0xd0NCbackpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
1225 hd0D0VSd0xd0NCbackpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
1226 flistNoCutsBack->Add(hd0D0VSd0xd0NCbackpt);
1227
1228
1229 namehist="hangletracksVSd0xd0NCback_pt";
1230 namehist+=i;
1231 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} No Cuts Back ptbin=";
1232 titlehist+=i;
1233 hangletracksVSd0xd0NCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
1234 hangletracksVSd0xd0NCbackpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
1235 hangletracksVSd0xd0NCbackpt->SetYTitle(" angle between K and #p tracks [rad]");
1236 flistNoCutsBack->Add(hangletracksVSd0xd0NCbackpt);
1237
1238
1239 namehist="hangletracksVSd0D0NCback_pt";
1240 namehist+=i;
1241 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} No Cuts Back ptbin=";
1242 titlehist+=i;
1243 hangletracksVSd0D0NCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
1244 hangletracksVSd0D0NCbackpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
1245 hangletracksVSd0D0NCbackpt->SetYTitle(" angle between K and #p tracks [rad]");
1246 flistNoCutsBack->Add(hangletracksVSd0D0NCbackpt);
1247
1248
1249
1250 }
1251 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
1252 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1253
1254
1255
624c07ab 1256 // ####### d0 D0 histos ############
1257
ac4c229c 1258 TH1F *hd0D0NCbackPM = new TH1F("hd0D0NCbackPM","D^{0} impact par. plot , No Cuts ,Background,Mass Peak (All momenta)",1000,-1000.,1000.);
1259 hd0D0NCbackPM->SetXTitle("Impact parameter [#mum]");
1260 hd0D0NCbackPM->SetYTitle("Entries");
1261
1262 TH1F *hd0D0VtxTrueNCbackPM = new TH1F("hd0D0VtxTrueNCbackPM","D^{0} impact par. w.r.t. True Vtx, No Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
1263 hd0D0VtxTrueNCbackPM->SetXTitle("Impact parameter [#mum]");
1264 hd0D0VtxTrueNCbackPM->SetYTitle("Entries");
1265
1266 TH1F *hMCd0D0NCbackPM = new TH1F("hMCd0D0NCbackPM","D^{0} impact par. plot, No Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
1267 hMCd0D0NCbackPM->SetXTitle("MC Impact parameter [#mum]");
1268 hMCd0D0NCbackPM->SetYTitle("Entries");
1269
1270 TH1F *hd0D0NCbackSB = new TH1F("hd0D0NCbackSB","D^{0} impact par. plot , No Cuts ,Background,Mass Peak (All momenta)",1000,-1000.,1000.);
1271 hd0D0NCbackSB->SetXTitle("Impact parameter [#mum]");
1272 hd0D0NCbackSB->SetYTitle("Entries");
1273
1274 TH1F *hd0D0VtxTrueNCbackSB = new TH1F("hd0D0VtxTrueNCbackSB","D^{0} impact par. w.r.t. True Vtx, No Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
1275 hd0D0VtxTrueNCbackSB->SetXTitle("Impact parameter [#mum]");
1276 hd0D0VtxTrueNCbackSB->SetYTitle("Entries");
1277
1278 TH1F *hMCd0D0NCbackSB = new TH1F("hMCd0D0NCbackSB","D^{0} impact par. plot, No Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
1279 hMCd0D0NCbackSB->SetXTitle("MC Impact parameter [#mum]");
1280 hMCd0D0NCbackSB->SetYTitle("Entries");
1281
1282 flistNoCutsBack->Add(hd0D0NCbackPM);
1283 flistNoCutsBack->Add(hd0D0VtxTrueNCbackPM);
1284 flistNoCutsBack->Add(hMCd0D0NCbackPM);
1285 flistNoCutsBack->Add(hd0D0NCbackSB);
1286 flistNoCutsBack->Add(hd0D0VtxTrueNCbackSB);
1287 flistNoCutsBack->Add(hMCd0D0NCbackSB);
1288
e047b348 1289 TH1F *hd0D0ptNCbackPM;
1290 TH1F *hMCd0D0ptNCbackPM;
1291 TH1F *hd0D0VtxTrueptNCbackPM;
1292 TH1F *hd0D0ptNCbackSB;
1293 TH1F *hMCd0D0ptNCbackSB;
1294 TH1F *hd0D0VtxTrueptNCbackSB;
ac4c229c 1295 namehist="hd0D0ptNCback_";
624c07ab 1296 titlehist="D^{0} impact par. plot, No Cuts, Background, ";
1297 for(Int_t i=0;i<fnbins;i++){
1298 strnamept=namehist;
1299 strnamept.Append("PkMss_pt");
1300 strnamept+=i;
1301
1302 strtitlept=titlehist;
1303 strtitlept.Append(" Mass Peak, ");
1304 strtitlept+=fptbins[i];
1305 strtitlept.Append("<= pt <");
1306 strtitlept+=fptbins[i+1];
1307 strtitlept.Append(" [GeV/c]");
1308
e047b348 1309 hd0D0ptNCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1310 hd0D0ptNCbackPM->SetXTitle("Impact parameter [#mum] ");
1311 hd0D0ptNCbackPM->SetYTitle("Entries");
1312 flistNoCutsBack->Add(hd0D0ptNCbackPM);
624c07ab 1313
1314 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 1315 hMCd0D0ptNCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1316 hMCd0D0ptNCbackPM->SetXTitle("MC Impact parameter [#mum] ");
1317 hMCd0D0ptNCbackPM->SetYTitle("Entries");
1318 flistNoCutsBack->Add(hMCd0D0ptNCbackPM);
624c07ab 1319
1320
1321 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 1322 hd0D0VtxTrueptNCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1323 hd0D0VtxTrueptNCbackPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1324 hd0D0VtxTrueptNCbackPM->SetYTitle("Entries");
1325 flistNoCutsBack->Add(hd0D0VtxTrueptNCbackPM);
624c07ab 1326
1327 strnamept=namehist;
1328 strnamept.Append("SBMss_pt");
1329 strnamept+=i;
1330
1331 strtitlept=titlehist;
1332 strtitlept.Append(" Side Bands, ");
1333 strtitlept+=fptbins[i];
1334 strtitlept.Append("<= pt <");
1335 strtitlept+=fptbins[i+1];
1336 strtitlept.Append(" [GeV/c]");
1337
e047b348 1338 hd0D0ptNCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1339 hd0D0ptNCbackSB->SetXTitle("Impact parameter [#mum] ");
1340 hd0D0ptNCbackSB->SetYTitle("Entries");
1341 flistNoCutsBack->Add(hd0D0ptNCbackSB);
624c07ab 1342
1343 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 1344 hMCd0D0ptNCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1345 hMCd0D0ptNCbackSB->SetXTitle("MC Impact parameter [#mum] ");
1346 hMCd0D0ptNCbackSB->SetYTitle("Entries");
1347 flistNoCutsBack->Add(hMCd0D0ptNCbackSB);
624c07ab 1348
1349 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 1350 hd0D0VtxTrueptNCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1351 hd0D0VtxTrueptNCbackSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1352 hd0D0VtxTrueptNCbackSB->SetYTitle("Entries");
1353 flistNoCutsBack->Add(hd0D0VtxTrueptNCbackSB);
624c07ab 1354 }
1355
1356
1357
1358 //############ NO CUTS FROMB HISTOGRAMS ###########
1359 //
1360 //####### global properties histos
1361
e047b348 1362 TH2F *hCPtaVSd0d0NCfromB=new TH2F("hCPtaVSd0d0NCfromB","hCPtaVSd0d0_NoCuts_FromB",1000,-100000.,100000.,100,-1.,1.);
ac4c229c 1363 TH1F *hSecVtxZNCfromB=new TH1F("hSecVtxZNCfromB","hSecVtxZ_NoCuts_FromB",1000,-8.,8.);
1364 TH1F *hSecVtxXNCfromB=new TH1F("hSecVtxXNCfromB","hSecVtxX_NoCuts_FromB",1000,-3000.,3000.);
1365 TH1F *hSecVtxYNCfromB=new TH1F("hSecVtxYNCfromB","hSecVtxY_NoCuts_FromB",1000,-3000.,3000.);
1366 TH2F *hSecVtxXYNCfromB=new TH2F("hSecVtxXYNCfromB","hSecVtxXY_NoCuts_FromB",1000,-3000.,3000.,1000,-3000.,3000.);
1367 TH1F *hSecVtxPhiNCfromB=new TH1F("hSecVtxPhiNCfromB","hSecVtxPhi_NoCuts_FromB",180,-180.1,180.1);
e047b348 1368 TH1F *hd0singlTrackNCfromB=new TH1F("hd0singlTrackNCfromB","hd0singlTrackNoCuts_FromB",1000,-5000.,5000.);
1369 TH1F *hCPtaNCfromB=new TH1F("hCPtaNCfromB","hCPta_NoCuts_FromB",100,-1.,1.);
ac4c229c 1370 TH1F *hd0xd0NCfromB=new TH1F("hd0xd0NCfromB","hd0xd0_NoCuts_FromB",1000,-100000.,100000.);
1371 TH1F *hMassTrueNCfromB=new TH1F("hMassTrueNCfromB","D^{0} MC inv. Mass No Cuts FromB(All momenta)",600,1.600,2.200);
1372 TH1F *hMassNCfromB=new TH1F("hMassNCfromB","D^{0} inv. Mass No Cuts FromB (All momenta)",600,1.600,2.200);
1373 hMassNCfromB->Sumw2();
1374 TH1F *hMassTrueNCfromBPM=new TH1F("hMassTrueNCfromBPM","D^{0} MC inv. Mass No Cuts FromB, Mass Peak. (All momenta)",600,1.600,2.200);
1375 TH1F *hMassNCfromBPM=new TH1F("hMassNCfromBPM","D^{0} inv. Mass No Cuts FromB (All momenta), MassPeak",600,1.600,2.200);
1376 hMassNCfromB->Sumw2();
1377 TH1F *hMassTrueNCfromBSB=new TH1F("hMassTrueNCfromBSB","D^{0} MC inv. Mass in Side Bands No Cuts FromB(All momenta)",600,1.600,2.200);
1378 TH1F *hMassNCfromBSB=new TH1F("hMassNCfromBSB","D^{0} inv. Mass in Side Bands No Cuts FromB (All momenta)",600,1.600,2.200);
1379 hMassNCfromBSB->Sumw2();
1380
1381 flistNoCutsFromB->Add(hCPtaVSd0d0NCfromB);
1382 flistNoCutsFromB->Add(hSecVtxZNCfromB);
1383 flistNoCutsFromB->Add(hSecVtxYNCfromB);
1384 flistNoCutsFromB->Add(hSecVtxXNCfromB);
1385 flistNoCutsFromB->Add(hSecVtxXYNCfromB);
1386 flistNoCutsFromB->Add(hSecVtxPhiNCfromB);
e047b348 1387 flistNoCutsFromB->Add(hd0singlTrackNCfromB);
ac4c229c 1388 flistNoCutsFromB->Add(hCPtaNCfromB);
1389 flistNoCutsFromB->Add(hd0xd0NCfromB);
1390 flistNoCutsFromB->Add(hMassTrueNCfromB);
1391 flistNoCutsFromB->Add(hMassNCfromB);
1392 flistNoCutsFromB->Add(hMassTrueNCfromBPM);
1393 flistNoCutsFromB->Add(hMassNCfromBPM);
1394 flistNoCutsFromB->Add(hMassTrueNCfromBSB);
1395 flistNoCutsFromB->Add(hMassNCfromBSB);
624c07ab 1396
e047b348 1397
1398
1399
1400
1401 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
1402 TH1F *hdcaNCfromB=new TH1F("hdcaNCfromB","hdca_NoCuts_FromB",100,0.,1000.);
1403 hdcaNCfromB->SetXTitle("dca [#mum]");
1404 hdcaNCfromB->SetYTitle("Entries");
1405 TH1F *hcosthetastarNCfromB=new TH1F("hcosthetastarNCfromB","hCosThetaStar_NoCuts_FromB",50,-1.,1.);
1406 hcosthetastarNCfromB->SetXTitle("cos #theta^{*}");
1407 hcosthetastarNCfromB->SetYTitle("Entries");
1408 TH1F *hptD0NCfromB=new TH1F("hptD0NCfromB","D^{0} transverse momentum distribution",34,ptbinsD0arr);
1409 hptD0NCfromB->SetXTitle("p_{t} [GeV/c]");
1410 hptD0NCfromB->SetYTitle("Entries");
1411 TH1F *hptD0VsMaxPtNCfromB=new TH1F("hptD0VsMaxPtNCfromB","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
1412 TH2F *hptD0PTallsqrtNCfromB=new TH2F("hptD0PTallsqrtNCfromB","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
1413 TH2F *hptD0PTallNCfromB=new TH2F("hptD0PTallNCfromB","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
1414 TH2F *hptD0vsptBNCfromB=new TH2F("hptD0vsptBNCfromB","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1415 TH2F *hpD0vspBNCfromB=new TH2F("hpD0vspBNCfromB","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1416 TH2F *hptD0vsptcquarkNCfromB=new TH2F("hptD0vsptcquarkNCfromB","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1417 TH2F *hpD0vspcquarkNCfromB=new TH2F("hpD0vspcquarkNCfromB","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1418 flistNoCutsFromB->Add(hdcaNCfromB);
1419 flistNoCutsFromB->Add(hcosthetastarNCfromB);
1420 flistNoCutsFromB->Add(hptD0NCfromB);
1421 flistNoCutsFromB->Add(hptD0VsMaxPtNCfromB);
1422 flistNoCutsFromB->Add(hptD0PTallsqrtNCfromB);
1423 flistNoCutsFromB->Add(hptD0PTallNCfromB);
1424 flistNoCutsFromB->Add(hptD0vsptBNCfromB);
1425 flistNoCutsFromB->Add(hpD0vspBNCfromB);
1426 flistNoCutsFromB->Add(hptD0vsptcquarkNCfromB);
1427 flistNoCutsFromB->Add(hpD0vspcquarkNCfromB);
1428
1429 TH1F *hd0zD0ptNCfromB;
cc3209fb 1430 TH1F *hInvMassD0NCfromB,*hInvMassD0barNCfromB;
e047b348 1431 TH2F *hInvMassPtNCfromB=new TH2F("hInvMassPtNCfromB","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
a3b80030 1432 THnSparseF *hSparseNCfromB=new THnSparseF("hSparseNCfromB","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
d39e8f99 1433 hSparseNCfromB->SetBinEdges(0,massbins);
1434 hSparseNCfromB->SetBinEdges(1,massbins);
1435 hSparseNCfromB->SetBinEdges(2,ptbinsForNsparse);
1436 hSparseNCfromB->SetBinEdges(3,impparbins);
1437 hSparseNCfromB->SetBinEdges(4,massHypoBins);
1438 flistNoCutsFromB->Add(hSparseNCfromB);
1439
a3b80030 1440
1441
1442 THnSparseF *hSparseRecoNCfromB=new THnSparseF("hSparseRecoNCfromB","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
1443 hSparseRecoNCfromB->SetBinEdges(0,massbins);
1444 hSparseRecoNCfromB->SetBinEdges(1,massbins);
1445 hSparseRecoNCfromB->SetBinEdges(2,ptbinsForNsparse);
1446 hSparseRecoNCfromB->SetBinEdges(3,impparbins);
1447 hSparseRecoNCfromB->SetBinEdges(4,massHypoBins);
1448 flistNoCutsFromB->Add(hSparseRecoNCfromB);
1449
1450
e047b348 1451 TH1F *hetaNCfromB;
1452 TH1F *hCosPDPBNCfromB;
1453 TH1F *hCosPcPDNCfromB;
1454
1455 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
1456 TH2F *hd0D0VSd0xd0NCfromBpt;
1457 TH2F *hangletracksVSd0xd0NCfromBpt;
1458 TH2F *hangletracksVSd0D0NCfromBpt;
1459 TH1F *hd0xd0NCfromBpt;
1460 flistNoCutsFromB->Add(hInvMassPtNCfromB);
1461
1462 TH2F *hTOFpidNCfromB=new TH2F("hTOFpidNCfromB","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
1463 flistNoCutsFromB->Add(hTOFpidNCfromB);
1464
1465 for(Int_t i=0;i<fnbins;i++){
1466 namehist="hd0zD0ptNCfromB_pt";
1467 namehist+=i;
1468 titlehist="d0(z) No Cuts FromB ptbin=";
1469 titlehist+=i;
1470 hd0zD0ptNCfromB=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
1471 hd0zD0ptNCfromB->SetXTitle("d_{0}(z) [#mum]");
1472 hd0zD0ptNCfromB->SetYTitle("Entries");
1473 flistNoCutsFromB->Add(hd0zD0ptNCfromB);
1474
cc3209fb 1475 namehist="hInvMassD0NCfromB_pt";
e047b348 1476 namehist+=i;
1477 titlehist="Invariant Mass No Cuts FromB ptbin=";
1478 titlehist+=i;
cc3209fb 1479 hInvMassD0NCfromB=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
1480 hInvMassD0NCfromB->SetXTitle("Invariant Mass [GeV]");
1481 hInvMassD0NCfromB->SetYTitle("Entries");
1482 flistNoCutsFromB->Add(hInvMassD0NCfromB);
1483
1484
1485 namehist="hInvMassD0barNCfromB_pt";
1486 namehist+=i;
1487 titlehist="Invariant Mass D0bar No Cuts FromB ptbin=";
1488 titlehist+=i;
1489 hInvMassD0barNCfromB=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
1490 hInvMassD0barNCfromB->SetXTitle("Invariant Mass [GeV]");
1491 hInvMassD0barNCfromB->SetYTitle("Entries");
1492 flistNoCutsFromB->Add(hInvMassD0barNCfromB);
1493
1494
e047b348 1495
1496 namehist="hetaNCfromB_pt";
1497 namehist+=i;
1498 titlehist="eta No Cuts FromB ptbin=";
1499 titlehist+=i;
1500 hetaNCfromB=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
1501 hetaNCfromB->SetXTitle("Pseudorapidity");
1502 hetaNCfromB->SetYTitle("Entries");
1503 flistNoCutsFromB->Add(hetaNCfromB);
1504
1505 namehist="hCosPDPBNCfromB_pt";
1506 namehist+=i;
1507 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
1508 titlehist+=i;
1509 hCosPDPBNCfromB=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
1510 hCosPDPBNCfromB->SetXTitle("Cosine between D0 momentum and B momentum");
1511 hCosPDPBNCfromB->SetYTitle("Entries");
1512 flistNoCutsFromB->Add(hCosPDPBNCfromB);
1513
1514 namehist="hCosPcPDNCfromB_pt";
1515 namehist+=i;
1516 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
1517 titlehist+=i;
1518 hCosPcPDNCfromB=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
1519 hCosPcPDNCfromB->SetXTitle("Cosine between c quark momentum and D0 momentum");
1520 hCosPcPDNCfromB->SetYTitle("Entries");
1521 flistNoCutsFromB->Add(hCosPcPDNCfromB);
1522
1523// %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
1524 namehist="hd0xd0NCfromB_pt";
1525 namehist+=i;
1526 titlehist="d0xd0 No Cuts FromB ptbin=";
1527 titlehist+=i;
1528 hd0xd0NCfromBpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
1529 hd0xd0NCfromBpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
1530 hd0xd0NCfromBpt->SetYTitle("Entries");
1531 flistNoCutsFromB->Add(hd0xd0NCfromBpt);
1532
1533
1534 namehist="hd0D0VSd0xd0NCfromB_pt";
1535 namehist+=i;
1536 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} No Cuts FromB ptbin=";
1537 titlehist+=i;
1538 hd0D0VSd0xd0NCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
1539 hd0D0VSd0xd0NCfromBpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
1540 hd0D0VSd0xd0NCfromBpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
1541 flistNoCutsFromB->Add(hd0D0VSd0xd0NCfromBpt);
1542
1543
1544 namehist="hangletracksVSd0xd0NCfromB_pt";
1545 namehist+=i;
1546 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} No Cuts FromB ptbin=";
1547 titlehist+=i;
1548 hangletracksVSd0xd0NCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
1549 hangletracksVSd0xd0NCfromBpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
1550 hangletracksVSd0xd0NCfromBpt->SetYTitle(" angle between K and #p tracks [rad]");
1551 flistNoCutsFromB->Add(hangletracksVSd0xd0NCfromBpt);
1552
1553
1554 namehist="hangletracksVSd0D0NCfromB_pt";
1555 namehist+=i;
1556 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} No Cuts FromB ptbin=";
1557 titlehist+=i;
1558 hangletracksVSd0D0NCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
1559 hangletracksVSd0D0NCfromBpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
1560 hangletracksVSd0D0NCfromBpt->SetYTitle(" angle between K and #p tracks [rad]");
1561 flistNoCutsFromB->Add(hangletracksVSd0D0NCfromBpt);
1562
1563
1564 }
1565 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
1566 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1567
1568
1569
624c07ab 1570 // ######### d0 D0 histos ##############
ac4c229c 1571 TH1F *hd0D0NCfromBPM = new TH1F("hd0D0NCfromBPM","D^{0} impact par. plot , No Cuts ,FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
1572 hd0D0NCfromBPM->SetXTitle("Impact parameter [#mum]");
1573 hd0D0NCfromBPM->SetYTitle("Entries");
1574
1575 TH1F *hd0D0VtxTrueNCfromBPM = new TH1F("hd0D0VtxTrueNCfromBPM","D^{0} impact par. w.r.t. True Vtx, No Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
1576 hd0D0VtxTrueNCfromBPM->SetXTitle("Impact parameter [#mum]");
1577 hd0D0VtxTrueNCfromBPM->SetYTitle("Entries");
1578
1579 TH1F *hMCd0D0NCfromBPM = new TH1F("hMCd0D0NCfromBPM","D^{0} impact par. plot, No Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
1580 hMCd0D0NCfromBPM->SetXTitle("MC Impact parameter [#mum]");
1581 hMCd0D0NCfromBPM->SetYTitle("Entries");
1582
1583 TH1F *hd0D0NCfromBSB = new TH1F("hd0D0NCfromBSB","D^{0} impact par. plot , No Cuts ,FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
1584 hd0D0NCfromBSB->SetXTitle("Impact parameter [#mum]");
1585 hd0D0NCfromBSB->SetYTitle("Entries");
1586
1587 TH1F *hd0D0VtxTrueNCfromBSB = new TH1F("hd0D0VtxTrueNCfromBSB","D^{0} impact par. w.r.t. True Vtx, No Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
1588 hd0D0VtxTrueNCfromBSB->SetXTitle("Impact parameter [#mum]");
1589 hd0D0VtxTrueNCfromBSB->SetYTitle("Entries");
1590
1591 TH1F *hMCd0D0NCfromBSB = new TH1F("hMCd0D0NCfromBSB","D^{0} impact par. plot, No Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
1592 hMCd0D0NCfromBSB->SetXTitle("MC Impact parameter [#mum]");
1593 hMCd0D0NCfromBSB->SetYTitle("Entries");
1594
1595 flistNoCutsFromB->Add(hd0D0NCfromBPM);
1596 flistNoCutsFromB->Add(hd0D0VtxTrueNCfromBPM);
1597 flistNoCutsFromB->Add(hMCd0D0NCfromBPM);
1598 flistNoCutsFromB->Add(hd0D0NCfromBSB);
1599 flistNoCutsFromB->Add(hd0D0VtxTrueNCfromBSB);
1600 flistNoCutsFromB->Add(hMCd0D0NCfromBSB);
1601
e047b348 1602 TH1F *hd0D0ptNCfromBPM;
1603 TH1F *hMCd0D0ptNCfromBPM;
1604 TH1F *hd0D0VtxTrueptNCfromBPM;
1605 TH1F *hd0D0ptNCfromBSB;
1606 TH1F *hMCd0D0ptNCfromBSB;
1607 TH1F *hd0D0VtxTrueptNCfromBSB;
ac4c229c 1608 namehist="hd0D0ptNCfromB_";
624c07ab 1609 titlehist="D^{0} impact par. plot, No Cuts, FromB, ";
1610 for(Int_t i=0;i<fnbins;i++){
1611 strnamept=namehist;
1612 strnamept.Append("PkMss_pt");
1613 strnamept+=i;
1614
1615 strtitlept=titlehist;
1616 strtitlept.Append(" Mass Peak, ");
1617 strtitlept+=fptbins[i];
1618 strtitlept.Append("<= pt <");
1619 strtitlept+=fptbins[i+1];
1620 strtitlept.Append(" [GeV/c]");
1621
e047b348 1622 hd0D0ptNCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1623 hd0D0ptNCfromBPM->SetXTitle("Impact parameter [#mum] ");
1624 hd0D0ptNCfromBPM->SetYTitle("Entries");
1625 flistNoCutsFromB->Add(hd0D0ptNCfromBPM);
624c07ab 1626
1627 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 1628 hMCd0D0ptNCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1629 hMCd0D0ptNCfromBPM->SetXTitle("MC Impact parameter [#mum] ");
1630 hMCd0D0ptNCfromBPM->SetYTitle("Entries");
1631 flistNoCutsFromB->Add(hMCd0D0ptNCfromBPM);
624c07ab 1632
1633
1634 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 1635 hd0D0VtxTrueptNCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1636 hd0D0VtxTrueptNCfromBPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1637 hd0D0VtxTrueptNCfromBPM->SetYTitle("Entries");
1638 flistNoCutsFromB->Add(hd0D0VtxTrueptNCfromBPM);
624c07ab 1639
1640 strnamept=namehist;
1641 strnamept.Append("SBMss_pt");
1642 strnamept+=i;
1643
1644 strtitlept=titlehist;
1645 strtitlept.Append(" Side Bands, ");
1646 strtitlept+=fptbins[i];
1647 strtitlept.Append("<= pt <");
1648 strtitlept+=fptbins[i+1];
1649 strtitlept.Append(" [GeV/c]");
1650
e047b348 1651 hd0D0ptNCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1652 hd0D0ptNCfromBSB->SetXTitle("Impact parameter [#mum] ");
1653 hd0D0ptNCfromBSB->SetYTitle("Entries");
1654 flistNoCutsFromB->Add(hd0D0ptNCfromBSB);
624c07ab 1655
1656 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 1657 hMCd0D0ptNCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1658 hMCd0D0ptNCfromBSB->SetXTitle("MC Impact parameter [#mum] ");
1659 hMCd0D0ptNCfromBSB->SetYTitle("Entries");
1660 flistNoCutsFromB->Add(hMCd0D0ptNCfromBSB);
624c07ab 1661
1662 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 1663 hd0D0VtxTrueptNCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1664 hd0D0VtxTrueptNCfromBSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1665 hd0D0VtxTrueptNCfromBSB->SetYTitle("Entries");
1666 flistNoCutsFromB->Add(hd0D0VtxTrueptNCfromBSB);
624c07ab 1667 }
1668
1669
1670
1671 //############ NO CUTS FROM DSTAR HISTOGRAMS ###########
1672 //
1673 //############# global properties histos #######
1674
e047b348 1675 TH2F *hCPtaVSd0d0NCfromDstar=new TH2F("hCPtaVSd0d0NCfromDstar","hCPtaVSd0d0_NoCuts_FromDStar",1000,-100000.,100000.,100,-1.,1.);
ac4c229c 1676 TH1F *hSecVtxZNCfromDstar=new TH1F("hSecVtxZNCfromDstar","hSecVtxZ_NoCuts_FromDStar",1000,-8.,8.);
1677 TH1F *hSecVtxXNCfromDstar=new TH1F("hSecVtxXNCfromDstar","hSecVtxX_NoCuts_FromDStar",1000,-3000.,3000.);
1678 TH1F *hSecVtxYNCfromDstar=new TH1F("hSecVtxYNCfromDstar","hSecVtxY_NoCuts_FromDStar",1000,-3000.,3000.);
1679 TH2F *hSecVtxXYNCfromDstar=new TH2F("hSecVtxXYNCfromDstar","hSecVtxXY_NoCuts_FromDStar",1000,-3000.,3000.,1000,-3000.,3000.);
1680 TH1F *hSecVtxPhiNCfromDstar=new TH1F("hSecVtxPhiNCfromDstar","hSecVtxPhi_NoCuts_FromDStar",180,-180.1,180.1);
e047b348 1681 TH1F *hd0singlTrackNCfromDstar=new TH1F("hd0singlTrackNCfromDstar","hd0singlTrackNoCuts_fromDstar",1000,-5000.,5000.);
1682 TH1F *hCPtaNCfromDstar=new TH1F("hCPtaNCfromDstar","hCPta_NoCuts_FromDStar",100,-1.,1.);
ac4c229c 1683 TH1F *hd0xd0NCfromDstar=new TH1F("hd0xd0NCfromDstar","hd0xd0_NoCuts_FromDStar",1000,-100000.,100000.);
1684 TH1F *hMassTrueNCfromDstar=new TH1F("hMassTrueNCfromDstar","D^{0} MC inv. Mass No Cuts FromDStar(All momenta)",600,1.600,2.200);
1685 TH1F *hMassNCfromDstar=new TH1F("hMassNCfromDstar","D^{0} inv. Mass No Cuts FromDStar (All momenta)",600,1.600,2.200);
1686 hMassNCfromDstar->Sumw2();
1687 TH1F *hMassTrueNCfromDstarPM=new TH1F("hMassTrueNCfromDstarPM","D^{0} MC inv. Mass No Cuts FromDStar, Mass Peak. (All momenta)",600,1.600,2.200);
1688 TH1F *hMassNCfromDstarPM=new TH1F("hMassNCfromDstarPM","D^{0} inv. Mass No Cuts FromDStar (All momenta), MassPeak",600,1.600,2.200);
1689 hMassNCfromDstarPM->Sumw2();
1690 TH1F *hMassTrueNCfromDstarSB=new TH1F("hMassTrueNCfromDstarSB","D^{0} MC inv. Mass in Side Bands No Cuts FromDStar(All momenta)",600,1.600,2.200);
1691 TH1F *hMassNCfromDstarSB=new TH1F("hMassNCfromDstarSB","D^{0} inv. Mass in Side Bands No Cuts FromDStar (All momenta)",600,1.600,2.200);
1692 hMassNCfromDstarSB->Sumw2();
1693
1694 flistNoCutsFromDstar->Add(hCPtaVSd0d0NCfromDstar);
1695 flistNoCutsFromDstar->Add(hSecVtxZNCfromDstar);
1696 flistNoCutsFromDstar->Add(hSecVtxYNCfromDstar);
1697 flistNoCutsFromDstar->Add(hSecVtxXNCfromDstar);
1698 flistNoCutsFromDstar->Add(hSecVtxXYNCfromDstar);
1699 flistNoCutsFromDstar->Add(hSecVtxPhiNCfromDstar);
e047b348 1700 flistNoCutsFromDstar->Add(hd0singlTrackNCfromDstar);
ac4c229c 1701 flistNoCutsFromDstar->Add(hCPtaNCfromDstar);
1702 flistNoCutsFromDstar->Add(hd0xd0NCfromDstar);
1703 flistNoCutsFromDstar->Add(hMassTrueNCfromDstar);
1704 flistNoCutsFromDstar->Add(hMassNCfromDstar);
1705 flistNoCutsFromDstar->Add(hMassTrueNCfromDstarPM);
1706 flistNoCutsFromDstar->Add(hMassNCfromDstarPM);
1707 flistNoCutsFromDstar->Add(hMassTrueNCfromDstarSB);
1708 flistNoCutsFromDstar->Add(hMassNCfromDstarSB);
624c07ab 1709
e047b348 1710
1711
1712
1713//%%% NEW HISTOS %%%%%%%%%%%%%%%%
1714 TH1F *hdcaNCfromDstar=new TH1F("hdcaNCfromDstar","hdca_NoCuts_FromDstar",100,0.,1000.);
1715 hdcaNCfromDstar->SetXTitle("dca [#mum]");
1716 hdcaNCfromDstar->SetYTitle("Entries");
1717 TH1F *hcosthetastarNCfromDstar=new TH1F("hcosthetastarNCfromDstar","hCosThetaStar_NoCuts_FromDstar",50,-1.,1.);
1718 hcosthetastarNCfromDstar->SetXTitle("cos #theta^{*}");
1719 hcosthetastarNCfromDstar->SetYTitle("Entries");
1720 TH1F *hptD0NCfromDstar=new TH1F("hptD0NCfromDstar","D^{0} transverse momentum distribution",34,ptbinsD0arr);
1721 hptD0NCfromDstar->SetXTitle("p_{t} [GeV/c]");
1722 hptD0NCfromDstar->SetYTitle("Entries");
1723 TH1F *hptD0VsMaxPtNCfromDstar=new TH1F("hptD0VsMaxPtNCfromDstar","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
1724 TH2F *hptD0PTallsqrtNCfromDstar=new TH2F("hptD0PTallsqrtNCfromDstar","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
1725 TH2F *hptD0PTallNCfromDstar=new TH2F("hptD0PTallNCfromDstar","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
1726 TH2F *hptD0vsptBNCfromDstar=new TH2F("hptD0vsptBNCfromDstar","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1727 TH2F *hpD0vspBNCfromDstar=new TH2F("hpD0vspBNCfromDstar","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1728 TH2F *hptD0vsptcquarkNCfromDstar=new TH2F("hptD0vsptcquarkNCfromDstar","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1729 TH2F *hpD0vspcquarkNCfromDstar=new TH2F("hpD0vspcquarkNCfromDstar","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
1730 flistNoCutsFromDstar->Add(hdcaNCfromDstar);
1731 flistNoCutsFromDstar->Add(hcosthetastarNCfromDstar);
1732 flistNoCutsFromDstar->Add(hptD0NCfromDstar);
1733 flistNoCutsFromDstar->Add(hptD0VsMaxPtNCfromDstar);
1734 flistNoCutsFromDstar->Add(hptD0PTallsqrtNCfromDstar);
1735 flistNoCutsFromDstar->Add(hptD0PTallNCfromDstar);
1736 flistNoCutsFromDstar->Add(hptD0vsptBNCfromDstar);
1737 flistNoCutsFromDstar->Add(hpD0vspBNCfromDstar);
1738 flistNoCutsFromDstar->Add(hptD0vsptcquarkNCfromDstar);
1739 flistNoCutsFromDstar->Add(hpD0vspcquarkNCfromDstar);
1740
1741 TH1F *hd0zD0ptNCfromDstar;
cc3209fb 1742 TH1F *hInvMassD0NCfromDstar,*hInvMassD0barNCfromDstar;
e047b348 1743 TH2F *hInvMassPtNCfromDstar=new TH2F("hInvMassPtNCfromDstar","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
d39e8f99 1744 THnSparseF *hSparseNCfromDstar=new THnSparseF("hSparseNCfromDstar","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
1745 hSparseNCfromDstar->SetBinEdges(0,massbins);
1746 hSparseNCfromDstar->SetBinEdges(1,massbins);
1747 hSparseNCfromDstar->SetBinEdges(2,ptbinsForNsparse);
1748 hSparseNCfromDstar->SetBinEdges(3,impparbins);
1749 hSparseNCfromDstar->SetBinEdges(4,massHypoBins);
1750 flistNoCutsFromDstar->Add(hSparseNCfromDstar);
e047b348 1751 TH1F *hetaNCfromDstar;
1752 TH1F *hCosPDPBNCfromDstar;
1753 TH1F *hCosPcPDNCfromDstar;
1754 flistNoCutsFromDstar->Add(hInvMassPtNCfromDstar);
1755 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
1756 TH2F *hd0D0VSd0xd0NCfromDstarpt;
1757 TH2F *hangletracksVSd0xd0NCfromDstarpt;
1758 TH2F *hangletracksVSd0D0NCfromDstarpt;
1759 TH1F *hd0xd0NCfromDstarpt;
1760
1761 TH2F *hTOFpidNCfromDstar=new TH2F("hTOFpidNCfromDstar","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
1762 flistNoCutsFromDstar->Add(hTOFpidNCfromDstar);
1763
1764 for(Int_t i=0;i<fnbins;i++){
1765 namehist="hd0zD0ptNCfromDstar_pt";
1766 namehist+=i;
1767 titlehist="d0(z) No Cuts FromDstarm ptbin=";
1768 titlehist+=i;
1769 hd0zD0ptNCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
1770 hd0zD0ptNCfromDstar->SetXTitle("d_{0}(z) [#mum]");
1771 hd0zD0ptNCfromDstar->SetYTitle("Entries");
1772 flistNoCutsFromDstar->Add(hd0zD0ptNCfromDstar);
1773
cc3209fb 1774 namehist="hInvMassD0NCfromDstar_pt";
e047b348 1775 namehist+=i;
1776 titlehist="Invariant Mass No Cuts FromDstar ptbin=";
1777 titlehist+=i;
cc3209fb 1778 hInvMassD0NCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
1779 hInvMassD0NCfromDstar->SetXTitle("Invariant Mass [GeV]");
1780 hInvMassD0NCfromDstar->SetYTitle("Entries");
1781 flistNoCutsFromDstar->Add(hInvMassD0NCfromDstar);
1782
1783
1784 namehist="hInvMassD0barNCfromDstar_pt";
1785 namehist+=i;
1786 titlehist="Invariant Mass D0bar No Cuts FromDstar ptbin=";
1787 titlehist+=i;
1788 hInvMassD0barNCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
1789 hInvMassD0barNCfromDstar->SetXTitle("Invariant Mass [GeV]");
1790 hInvMassD0barNCfromDstar->SetYTitle("Entries");
1791 flistNoCutsFromDstar->Add(hInvMassD0barNCfromDstar);
1792
1793
e047b348 1794
1795 namehist="hetaNCfromDstar_pt";
1796 namehist+=i;
1797 titlehist="eta No Cuts FromDstar ptbin=";
1798 titlehist+=i;
1799 hetaNCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
1800 hetaNCfromDstar->SetXTitle("Pseudorapidity");
1801 hetaNCfromDstar->SetYTitle("Entries");
1802 flistNoCutsFromDstar->Add(hetaNCfromDstar);
1803
1804 namehist="hCosPDPBNCfromDstar_pt";
1805 namehist+=i;
1806 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
1807 titlehist+=i;
1808 hCosPDPBNCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
1809 hCosPDPBNCfromDstar->SetXTitle("Cosine between D0 momentum and B momentum");
1810 hCosPDPBNCfromDstar->SetYTitle("Entries");
1811 flistNoCutsFromDstar->Add(hCosPDPBNCfromDstar);
1812
1813 namehist="hCosPcPDNCfromDstar_pt";
1814 namehist+=i;
1815 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
1816 titlehist+=i;
1817 hCosPcPDNCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
1818 hCosPcPDNCfromDstar->SetXTitle("Cosine between c quark momentum and D0 momentum");
1819 hCosPcPDNCfromDstar->SetYTitle("Entries");
1820 flistNoCutsFromDstar->Add(hCosPcPDNCfromDstar);
1821
1822 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
1823 namehist="hd0xd0NCfromDstar_pt";
1824 namehist+=i;
1825 titlehist="d0xd0 No Cuts FromDstar ptbin=";
1826 titlehist+=i;
1827 hd0xd0NCfromDstarpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
1828 hd0xd0NCfromDstarpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
1829 hd0xd0NCfromDstarpt->SetYTitle("Entries");
1830 flistNoCutsFromDstar->Add(hd0xd0NCfromDstarpt);
1831
1832
1833 namehist="hd0D0VSd0xd0NCfromDstar_pt";
1834 namehist+=i;
1835 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} No Cuts FromDstar ptbin=";
1836 titlehist+=i;
1837 hd0D0VSd0xd0NCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
1838 hd0D0VSd0xd0NCfromDstarpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
1839 hd0D0VSd0xd0NCfromDstarpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
1840 flistNoCutsFromDstar->Add(hd0D0VSd0xd0NCfromDstarpt);
1841
1842
1843 namehist="hangletracksVSd0xd0NCfromDstar_pt";
1844 namehist+=i;
1845 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} No Cuts FromDstar ptbin=";
1846 titlehist+=i;
1847 hangletracksVSd0xd0NCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
1848 hangletracksVSd0xd0NCfromDstarpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
1849 hangletracksVSd0xd0NCfromDstarpt->SetYTitle(" angle between K and #p tracks [rad]");
1850 flistNoCutsFromDstar->Add(hangletracksVSd0xd0NCfromDstarpt);
1851
1852
1853 namehist="hangletracksVSd0D0NCfromDstar_pt";
1854 namehist+=i;
1855 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} No Cuts FromDstar ptbin=";
1856 titlehist+=i;
1857 hangletracksVSd0D0NCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
1858 hangletracksVSd0D0NCfromDstarpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
1859 hangletracksVSd0D0NCfromDstarpt->SetYTitle(" angle between K and #p tracks [rad]");
1860 flistNoCutsFromDstar->Add(hangletracksVSd0D0NCfromDstarpt);
1861
1862 }
1863 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
1864 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1865
1866
624c07ab 1867 //########## d0 D0 histos #############
ac4c229c 1868 TH1F *hd0D0NCfromDstPM = new TH1F("hd0D0NCfromDstarPM","D^{0} impact par. plot , No Cuts ,FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
1869 hd0D0NCfromDstPM->SetXTitle("Impact parameter [#mum]");
1870 hd0D0NCfromDstPM->SetYTitle("Entries");
1871
1872 TH1F *hd0D0VtxTrueNCfromDstPM = new TH1F("hd0D0VtxTrueNCfromDstarPM","D^{0} impact par. w.r.t. True Vtx, No Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
1873 hd0D0VtxTrueNCfromDstPM->SetXTitle("Impact parameter [#mum]");
1874 hd0D0VtxTrueNCfromDstPM->SetYTitle("Entries");
1875
1876 TH1F *hMCd0D0NCfromDstPM = new TH1F("hMCd0D0NCfromDstarPM","D^{0} impact par. plot, No Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
1877 hMCd0D0NCfromDstPM->SetXTitle("MC Impact parameter [#mum]");
1878 hMCd0D0NCfromDstPM->SetYTitle("Entries");
1879
1880 TH1F *hd0D0NCfromDstSB = new TH1F("hd0D0NCfromDstarSB","D^{0} impact par. plot , No Cuts ,FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
1881 hd0D0NCfromDstSB->SetXTitle("Impact parameter [#mum]");
1882 hd0D0NCfromDstSB->SetYTitle("Entries");
1883
1884 TH1F *hd0D0VtxTrueNCfromDstSB = new TH1F("hd0D0VtxTrueNCfromDstarSB","D^{0} impact par. w.r.t. True Vtx, No Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
1885 hd0D0VtxTrueNCfromDstSB->SetXTitle("Impact parameter [#mum]");
1886 hd0D0VtxTrueNCfromDstSB->SetYTitle("Entries");
1887
1888 TH1F *hMCd0D0NCfromDstSB = new TH1F("hMCd0D0NCfromDstarSB","D^{0} impact par. plot, No Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
1889 hMCd0D0NCfromDstSB->SetXTitle("MC Impact parameter [#mum]");
1890 hMCd0D0NCfromDstSB->SetYTitle("Entries");
1891
1892 flistNoCutsFromDstar->Add(hd0D0NCfromDstPM);
1893 flistNoCutsFromDstar->Add(hd0D0VtxTrueNCfromDstPM);
1894 flistNoCutsFromDstar->Add(hMCd0D0NCfromDstPM);
1895 flistNoCutsFromDstar->Add(hd0D0NCfromDstSB);
1896 flistNoCutsFromDstar->Add(hd0D0VtxTrueNCfromDstSB);
1897 flistNoCutsFromDstar->Add(hMCd0D0NCfromDstSB);
1898
e047b348 1899 TH1F *hd0D0ptNCfromDstPM;
1900 TH1F *hMCd0D0ptNCfromDstPM;
1901 TH1F *hd0D0VtxTrueptNCfromDstPM;
1902 TH1F *hd0D0ptNCfromDstSB;
1903 TH1F *hMCd0D0ptNCfromDstSB;
1904 TH1F *hd0D0VtxTrueptNCfromDstSB;
ac4c229c 1905 namehist="hd0D0ptNCfromDstar_";
624c07ab 1906 titlehist="D^{0} impact par. plot, No Cuts, FromDStar, ";
1907 for(Int_t i=0;i<fnbins;i++){
1908 strnamept=namehist;
1909 strnamept.Append("PkMss_pt");
1910 strnamept+=i;
1911
1912 strtitlept=titlehist;
1913 strtitlept.Append(" Mass Peak, ");
1914 strtitlept+=fptbins[i];
1915 strtitlept.Append("<= pt <");
1916 strtitlept+=fptbins[i+1];
1917 strtitlept.Append(" [GeV/c]");
1918
e047b348 1919 hd0D0ptNCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1920 hd0D0ptNCfromDstPM->SetXTitle("Impact parameter [#mum] ");
1921 hd0D0ptNCfromDstPM->SetYTitle("Entries");
1922 flistNoCutsFromDstar->Add(hd0D0ptNCfromDstPM);
624c07ab 1923
1924 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 1925 hMCd0D0ptNCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1926 hMCd0D0ptNCfromDstPM->SetXTitle("MC Impact parameter [#mum] ");
1927 hMCd0D0ptNCfromDstPM->SetYTitle("Entries");
1928 flistNoCutsFromDstar->Add(hMCd0D0ptNCfromDstPM);
624c07ab 1929
1930
1931 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 1932 hd0D0VtxTrueptNCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1933 hd0D0VtxTrueptNCfromDstPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1934 hd0D0VtxTrueptNCfromDstPM->SetYTitle("Entries");
1935 flistNoCutsFromDstar->Add(hd0D0VtxTrueptNCfromDstPM);
624c07ab 1936
1937 strnamept=namehist;
1938 strnamept.Append("SBMss_pt");
1939 strnamept+=i;
1940
1941 strtitlept=titlehist;
1942 strtitlept.Append(" Side Bands, ");
1943 strtitlept+=fptbins[i];
1944 strtitlept.Append("<= pt <");
1945 strtitlept+=fptbins[i+1];
1946 strtitlept.Append(" [GeV/c]");
1947
e047b348 1948 hd0D0ptNCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1949 hd0D0ptNCfromDstSB->SetXTitle("Impact parameter [#mum] ");
1950 hd0D0ptNCfromDstSB->SetYTitle("Entries");
1951 flistNoCutsFromDstar->Add(hd0D0ptNCfromDstSB);
624c07ab 1952
1953 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 1954 hMCd0D0ptNCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1955 hMCd0D0ptNCfromDstSB->SetXTitle("MC Impact parameter [#mum] ");
1956 hMCd0D0ptNCfromDstSB->SetYTitle("Entries");
1957 flistNoCutsFromDstar->Add(hMCd0D0ptNCfromDstSB);
624c07ab 1958
1959 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 1960 hd0D0VtxTrueptNCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
1961 hd0D0VtxTrueptNCfromDstSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
1962 hd0D0VtxTrueptNCfromDstSB->SetYTitle("Entries");
1963 flistNoCutsFromDstar->Add(hd0D0VtxTrueptNCfromDstSB);
624c07ab 1964 }
1965
1966
1967 //############ NO CUTS OTHER HISTOGRAMS ###########
1968 //
1969 //########### global properties histos ###########
1970
e047b348 1971 TH2F *hCPtaVSd0d0NCother=new TH2F("hCPtaVSd0d0NCother","hCPtaVSd0d0_NoCuts_other",1000,-100000.,100000.,100,-1.,1.);
ac4c229c 1972 TH1F *hSecVtxZNCother=new TH1F("hSecVtxZNCother","hSecVtxZ_NoCuts_other",1000,-8.,8.);
1973 TH1F *hSecVtxXNCother=new TH1F("hSecVtxXNCother","hSecVtxX_NoCuts_other",1000,-3000.,3000.);
1974 TH1F *hSecVtxYNCother=new TH1F("hSecVtxYNCother","hSecVtxY_NoCuts_other",1000,-3000.,3000.);
1975 TH2F *hSecVtxXYNCother=new TH2F("hSecVtxXYNCother","hSecVtxXY_NoCuts_other",1000,-3000.,3000.,1000,-3000.,3000.);
1976 TH1F *hSecVtxPhiNCother=new TH1F("hSecVtxPhiNCother","hSecVtxPhi_NoCuts_other",180,-180.1,180.1);
e047b348 1977 TH1F *hd0singlTrackNCother=new TH1F("hd0singlTrackNCother","hd0singlTrackNoCuts_Other",1000,-5000.,5000.);
1978 TH1F *hCPtaNCother=new TH1F("hCPtaNCother","hCPta_NoCuts_other",100,-1.,1.);
ac4c229c 1979 TH1F *hd0xd0NCother=new TH1F("hd0xd0NCother","hd0xd0_NoCuts_other",1000,-100000.,100000.);
1980 TH1F *hMassTrueNCother=new TH1F("hMassTrueNCother","D^{0} MC inv. Mass No Cuts other(All momenta)",600,1.600,2.200);
1981 TH1F *hMassNCother=new TH1F("hMassNCother","D^{0} inv. Mass No Cuts other (All momenta)",600,1.600,2.200);
1982 hMassNCother->Sumw2();
1983 TH1F *hMassTrueNCotherPM=new TH1F("hMassTrueNCotherPM","D^{0} MC inv. Mass No Cuts Other, Mass Peak. (All momenta)",600,1.600,2.200);
1984 TH1F *hMassNCotherPM=new TH1F("hMassNCotherPM","D^{0} inv. Mass No Cuts Other (All momenta), MassPeak",600,1.600,2.200);
1985 hMassNCotherPM->Sumw2();
1986 TH1F *hMassTrueNCotherSB=new TH1F("hMassTrueNCotherSB","D^{0} MC inv. Mass in Side Bands No Cuts other(All momenta)",600,1.600,2.200);
1987 TH1F *hMassNCotherSB=new TH1F("hMassNCotherSB","D^{0} inv. Mass in Side Bands No Cuts other (All momenta)",600,1.600,2.200);
1988 hMassNCotherSB->Sumw2();
1989
1990 flistNoCutsOther->Add(hCPtaVSd0d0NCother);
1991 flistNoCutsOther->Add(hSecVtxZNCother);
1992 flistNoCutsOther->Add(hSecVtxYNCother);
1993 flistNoCutsOther->Add(hSecVtxXNCother);
1994 flistNoCutsOther->Add(hSecVtxXYNCother);
1995 flistNoCutsOther->Add(hSecVtxPhiNCother);
e047b348 1996 flistNoCutsOther->Add(hd0singlTrackNCother);
ac4c229c 1997 flistNoCutsOther->Add(hCPtaNCother);
1998 flistNoCutsOther->Add(hd0xd0NCother);
1999 flistNoCutsOther->Add(hMassTrueNCother);
2000 flistNoCutsOther->Add(hMassNCother);
2001 flistNoCutsOther->Add(hMassTrueNCotherPM);
2002 flistNoCutsOther->Add(hMassNCotherPM);
2003 flistNoCutsOther->Add(hMassTrueNCotherSB);
2004 flistNoCutsOther->Add(hMassNCotherSB);
624c07ab 2005
e047b348 2006
2007
2008 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
2009 TH1F *hdcaNCother=new TH1F("hdcaNCother","hdca_NoCuts_Other",100,0.,1000.);
2010 hdcaNCother->SetXTitle("dca [#mum]");
2011 hdcaNCother->SetYTitle("Entries");
2012 TH1F *hcosthetastarNCother=new TH1F("hcosthetastarNCother","hCosThetaStar_NoCuts_Other",50,-1.,1.);
2013 hcosthetastarNCother->SetXTitle("cos #theta^{*}");
2014 hcosthetastarNCother->SetYTitle("Entries");
2015 TH1F *hptD0NCother=new TH1F("hptD0NCother","D^{0} transverse momentum distribution",34,ptbinsD0arr);
2016 hptD0NCother->SetXTitle("p_{t} [GeV/c]");
2017 hptD0NCother->SetYTitle("Entries");
2018 TH1F *hptD0VsMaxPtNCother=new TH1F("hptD0VsMaxPtNCother","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
2019 TH2F *hptD0PTallsqrtNCother=new TH2F("hptD0PTallsqrtNCother","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
2020 TH2F *hptD0PTallNCother=new TH2F("hptD0PTallNCother","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
2021 TH2F *hptD0vsptBNCother=new TH2F("hptD0vsptBNCother","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2022 TH2F *hpD0vspBNCother=new TH2F("hpD0vspBNCother","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2023 TH2F *hptD0vsptcquarkNCother=new TH2F("hptD0vsptcquarkNCother","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2024 TH2F *hpD0vspcquarkNCother=new TH2F("hpD0vspcquarkNCother","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2025 flistNoCutsOther->Add(hdcaNCother);
2026 flistNoCutsOther->Add(hcosthetastarNCother);
2027 flistNoCutsOther->Add(hptD0NCother);
2028 flistNoCutsOther->Add(hptD0VsMaxPtNCother);
2029 flistNoCutsOther->Add(hptD0PTallsqrtNCother);
2030 flistNoCutsOther->Add(hptD0PTallNCother);
2031 flistNoCutsOther->Add(hptD0vsptBNCother);
2032 flistNoCutsOther->Add(hpD0vspBNCother);
2033 flistNoCutsOther->Add(hptD0vsptcquarkNCother);
2034 flistNoCutsOther->Add(hpD0vspcquarkNCother);
2035
2036 TH1F *hd0zD0ptNCother;
cc3209fb 2037 TH1F *hInvMassD0NCother,*hInvMassD0barNCother;
e047b348 2038 TH2F *hInvMassPtNCother=new TH2F("hInvMassPtNCother","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
d39e8f99 2039 THnSparseF *hSparseNCother=new THnSparseF("hSparseNCother","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
2040 hSparseNCother->SetBinEdges(0,massbins);
2041 hSparseNCother->SetBinEdges(1,massbins);
2042 hSparseNCother->SetBinEdges(2,ptbinsForNsparse);
2043 hSparseNCother->SetBinEdges(3,impparbins);
2044 hSparseNCother->SetBinEdges(4,massHypoBins);
2045 flistNoCutsOther->Add(hSparseNCother);
e047b348 2046 TH1F *hetaNCother;
2047 TH1F *hCosPDPBNCother;
2048 TH1F *hCosPcPDNCother;
2049 flistNoCutsOther->Add(hInvMassPtNCother);
2050 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
2051 TH2F *hd0D0VSd0xd0NCotherpt;
2052 TH2F *hangletracksVSd0xd0NCotherpt;
2053 TH2F *hangletracksVSd0D0NCotherpt;
2054 TH1F *hd0xd0NCotherpt;
2055
2056 TH2F *hTOFpidNCother=new TH2F("hTOFpidNCother","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
2057 flistNoCutsOther->Add(hTOFpidNCother);
2058
2059 for(Int_t i=0;i<fnbins;i++){
2060 namehist="hd0zD0ptNCother_pt";
2061 namehist+=i;
2062 titlehist="d0(z) No Cuts Otherm ptbin=";
2063 titlehist+=i;
2064 hd0zD0ptNCother=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
2065 hd0zD0ptNCother->SetXTitle("d_{0}(z) [#mum]");
2066 hd0zD0ptNCother->SetYTitle("Entries");
2067 flistNoCutsOther->Add(hd0zD0ptNCother);
2068
cc3209fb 2069 namehist="hInvMassD0NCother_pt";
e047b348 2070 namehist+=i;
2071 titlehist="Invariant Mass No Cuts Other ptbin=";
2072 titlehist+=i;
cc3209fb 2073 hInvMassD0NCother=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
2074 hInvMassD0NCother->SetXTitle("Invariant Mass [GeV]");
2075 hInvMassD0NCother->SetYTitle("Entries");
2076 flistNoCutsOther->Add(hInvMassD0NCother);
2077
2078
2079 namehist="hInvMassD0barNCother_pt";
2080 namehist+=i;
2081 titlehist="Invariant Mass D0bar No Cuts Other ptbin=";
2082 titlehist+=i;
2083 hInvMassD0barNCother=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
2084 hInvMassD0barNCother->SetXTitle("Invariant Mass [GeV]");
2085 hInvMassD0barNCother->SetYTitle("Entries");
2086 flistNoCutsOther->Add(hInvMassD0barNCother);
2087
e047b348 2088
2089 namehist="hetaNCother_pt";
2090 namehist+=i;
2091 titlehist="eta No Cuts Other ptbin=";
2092 titlehist+=i;
2093 hetaNCother=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
2094 hetaNCother->SetXTitle("Pseudorapidity");
2095 hetaNCother->SetYTitle("Entries");
2096 flistNoCutsOther->Add(hetaNCother);
2097
2098 namehist="hCosPDPBNCother_pt";
2099 namehist+=i;
2100 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
2101 titlehist+=i;
2102 hCosPDPBNCother=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
2103 hCosPDPBNCother->SetXTitle("Cosine between D0 momentum and B momentum");
2104 hCosPDPBNCother->SetYTitle("Entries");
2105 flistNoCutsOther->Add(hCosPDPBNCother);
2106
2107 namehist="hCosPcPDNCother_pt";
2108 namehist+=i;
2109 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
2110 titlehist+=i;
2111 hCosPcPDNCother=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
2112 hCosPcPDNCother->SetXTitle("Cosine between c quark momentum and D0 momentum");
2113 hCosPcPDNCother->SetYTitle("Entries");
2114 flistNoCutsOther->Add(hCosPcPDNCother);
2115
2116
2117 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
2118 namehist="hd0xd0NCother_pt";
2119 namehist+=i;
2120 titlehist="d0xd0 No Cuts Other ptbin=";
2121 titlehist+=i;
2122 hd0xd0NCotherpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
2123 hd0xd0NCotherpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
2124 hd0xd0NCotherpt->SetYTitle("Entries");
2125 flistNoCutsOther->Add(hd0xd0NCotherpt);
2126
2127
2128 namehist="hd0D0VSd0xd0NCother_pt";
2129 namehist+=i;
2130 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} No Cuts Other ptbin=";
2131 titlehist+=i;
2132 hd0D0VSd0xd0NCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
2133 hd0D0VSd0xd0NCotherpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
2134 hd0D0VSd0xd0NCotherpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
2135 flistNoCutsOther->Add(hd0D0VSd0xd0NCotherpt);
2136
2137
2138 namehist="hangletracksVSd0xd0NCother_pt";
2139 namehist+=i;
2140 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} No Cuts Other ptbin=";
2141 titlehist+=i;
2142 hangletracksVSd0xd0NCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
2143 hangletracksVSd0xd0NCotherpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
2144 hangletracksVSd0xd0NCotherpt->SetYTitle(" angle between K and #p tracks [rad]");
2145 flistNoCutsOther->Add(hangletracksVSd0xd0NCotherpt);
2146
2147
2148 namehist="hangletracksVSd0D0NCother_pt";
2149 namehist+=i;
2150 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} No Cuts Other ptbin=";
2151 titlehist+=i;
2152 hangletracksVSd0D0NCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
2153 hangletracksVSd0D0NCotherpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
2154 hangletracksVSd0D0NCotherpt->SetYTitle(" angle between K and #p tracks [rad]");
2155 flistNoCutsOther->Add(hangletracksVSd0D0NCotherpt);
2156
2157 }
2158 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
2159 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2160
2161
2162
2163
624c07ab 2164 //############# d0 D0 histos ###############à
ac4c229c 2165 TH1F *hd0D0NCotherPM = new TH1F("hd0D0NCotherPM","D^{0} impact par. plot , No Cuts ,Other,Mass Peak (All momenta)",1000,-1000.,1000.);
2166 hd0D0NCotherPM->SetXTitle("Impact parameter [#mum]");
2167 hd0D0NCotherPM->SetYTitle("Entries");
2168
2169 TH1F *hd0D0VtxTrueNCotherPM = new TH1F("hd0D0VtxTrueNCotherPM","D^{0} impact par. w.r.t. True Vtx, No Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
2170 hd0D0VtxTrueNCotherPM->SetXTitle("Impact parameter [#mum]");
2171 hd0D0VtxTrueNCotherPM->SetYTitle("Entries");
2172
2173 TH1F *hMCd0D0NCotherPM = new TH1F("hMCd0D0NCotherPM","D^{0} impact par. plot, No Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
2174 hMCd0D0NCotherPM->SetXTitle("MC Impact parameter [#mum]");
2175 hMCd0D0NCotherPM->SetYTitle("Entries");
2176
2177 TH1F *hd0D0NCotherSB = new TH1F("hd0D0NCotherSB","D^{0} impact par. plot , No Cuts ,Other,Mass Peak (All momenta)",1000,-1000.,1000.);
2178 hd0D0NCotherSB->SetXTitle("Impact parameter [#mum]");
2179 hd0D0NCotherSB->SetYTitle("Entries");
2180
2181 TH1F *hd0D0VtxTrueNCotherSB = new TH1F("hd0D0VtxTrueNCotherSB","D^{0} impact par. w.r.t. True Vtx, No Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
2182 hd0D0VtxTrueNCotherSB->SetXTitle("Impact parameter [#mum]");
2183 hd0D0VtxTrueNCotherSB->SetYTitle("Entries");
2184
2185 TH1F *hMCd0D0NCotherSB = new TH1F("hMCd0D0NCotherSB","D^{0} impact par. plot, No Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
2186 hMCd0D0NCotherSB->SetXTitle("MC Impact parameter [#mum]");
2187 hMCd0D0NCotherSB->SetYTitle("Entries");
2188
2189 flistNoCutsOther->Add(hd0D0NCotherPM);
2190 flistNoCutsOther->Add(hd0D0VtxTrueNCotherPM);
2191 flistNoCutsOther->Add(hMCd0D0NCotherPM);
2192 flistNoCutsOther->Add(hd0D0NCotherSB);
2193 flistNoCutsOther->Add(hd0D0VtxTrueNCotherSB);
2194 flistNoCutsOther->Add(hMCd0D0NCotherSB);
2195
e047b348 2196 TH1F *hd0D0ptNCotherPM;
2197 TH1F *hMCd0D0ptNCotherPM;
2198 TH1F *hd0D0VtxTrueptNCotherPM;
2199 TH1F *hd0D0ptNCotherSB;
2200 TH1F *hMCd0D0ptNCotherSB;
2201 TH1F *hd0D0VtxTrueptNCotherSB;
ac4c229c 2202 namehist="hd0D0ptNCother_";
624c07ab 2203 titlehist="D^{0} impact par. plot, No Cuts, Other, ";
2204 for(Int_t i=0;i<fnbins;i++){
2205 strnamept=namehist;
2206 strnamept.Append("PkMss_pt");
2207 strnamept+=i;
2208
2209 strtitlept=titlehist;
2210 strtitlept.Append(" Mass Peak, ");
2211 strtitlept+=fptbins[i];
2212 strtitlept.Append("<= pt <");
2213 strtitlept+=fptbins[i+1];
2214 strtitlept.Append(" [GeV/c]");
2215
e047b348 2216 hd0D0ptNCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2217 hd0D0ptNCotherPM->SetXTitle("Impact parameter [#mum] ");
2218 hd0D0ptNCotherPM->SetYTitle("Entries");
2219 flistNoCutsOther->Add(hd0D0ptNCotherPM);
624c07ab 2220
2221 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 2222 hMCd0D0ptNCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2223 hMCd0D0ptNCotherPM->SetXTitle("MC Impact parameter [#mum] ");
2224 hMCd0D0ptNCotherPM->SetYTitle("Entries");
2225 flistNoCutsOther->Add(hMCd0D0ptNCotherPM);
624c07ab 2226
2227
2228 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 2229 hd0D0VtxTrueptNCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2230 hd0D0VtxTrueptNCotherPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
2231 hd0D0VtxTrueptNCotherPM->SetYTitle("Entries");
2232 flistNoCutsOther->Add(hd0D0VtxTrueptNCotherPM);
624c07ab 2233
2234 strnamept=namehist;
2235 strnamept.Append("SBMss_pt");
2236 strnamept+=i;
2237
2238 strtitlept=titlehist;
2239 strtitlept.Append(" Side Bands, ");
2240 strtitlept+=fptbins[i];
2241 strtitlept.Append("<= pt <");
2242 strtitlept+=fptbins[i+1];
2243 strtitlept.Append(" [GeV/c]");
2244
e047b348 2245 hd0D0ptNCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2246 hd0D0ptNCotherSB->SetXTitle("Impact parameter [#mum] ");
2247 hd0D0ptNCotherSB->SetYTitle("Entries");
2248 flistNoCutsOther->Add(hd0D0ptNCotherSB);
624c07ab 2249
2250 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 2251 hMCd0D0ptNCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2252 hMCd0D0ptNCotherSB->SetXTitle("MC Impact parameter [#mum] ");
2253 hMCd0D0ptNCotherSB->SetYTitle("Entries");
2254 flistNoCutsOther->Add(hMCd0D0ptNCotherSB);
624c07ab 2255
2256 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 2257 hd0D0VtxTrueptNCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2258 hd0D0VtxTrueptNCotherSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
2259 hd0D0VtxTrueptNCotherSB->SetYTitle("Entries");
2260 flistNoCutsOther->Add(hd0D0VtxTrueptNCotherSB);
624c07ab 2261 }
2262
2263
2264 //################################################################################################
2265 // #
2266 // HISTOS FOR LOOSE CUTS #
2267 // #
2268 //################################################################################################
2269
2270 //############ LOOSE CUTS SIGNAL HISTOGRAMS ###############
2271 //
2272 // ####### global properties histo ############
2273
e047b348 2274 TH2F *hCPtaVSd0d0LSCsign=new TH2F("hCPtaVSd0d0LSCsign","hCPtaVSd0d0_LooseCuts_Signal",1000,-100000.,100000.,100,-1.,1.);
ac4c229c 2275 TH1F *hSecVtxZLSCsign=new TH1F("hSecVtxZLSCsign","hSecVtxZ_LooseCuts_Signal",1000,-8.,8.);
2276 TH1F *hSecVtxXLSCsign=new TH1F("hSecVtxXLSCsign","hSecVtxX_LooseCuts_Signal",1000,-3000.,3000.);
2277 TH1F *hSecVtxYLSCsign=new TH1F("hSecVtxYLSCsign","hSecVtxY_LooseCuts_Signal",1000,-3000.,3000.);
2278 TH2F *hSecVtxXYLSCsign=new TH2F("hSecVtxXYLSCsign","hSecVtxXY_LooseCuts_Signal",1000,-3000.,3000.,1000,-3000.,3000.);
2279 TH1F *hSecVtxPhiLSCsign=new TH1F("hSecVtxPhiLSCsign","hSecVtxPhi_LooseCuts_Signal",180,-180.1,180.1);
e047b348 2280 TH1F *hd0singlTrackLSCsign=new TH1F("hd0singlTrackLSCsign","hd0singlTrackLooseCuts_Signal",1000,-5000.,5000.);
2281 TH1F *hCPtaLSCsign=new TH1F("hCPtaLSCsign","hCPta_LooseCuts_Signal",100,-1.,1.);
ac4c229c 2282 TH1F *hd0xd0LSCsign=new TH1F("hd0xd0LSCsign","hd0xd0_LooseCuts_Signal",1000,-100000.,100000.);
2283 TH1F *hMassTrueLSCsign=new TH1F("hMassTrueLSCsign","D^{0} MC inv. Mass Loose Cuts Signal(All momenta)",600,1.600,2.200);
2284 TH1F *hMassLSCsign=new TH1F("hMassLSCsign","D^{0} inv. Mass Loose Cuts Signal (All momenta)",600,1.600,2.200);
2285 hMassLSCsign->Sumw2();
2286 TH1F *hMassTrueLSCsignPM=new TH1F("hMassTrueLSCsignPM","D^{0} MC inv. Mass Loose Cuts Signal, Mass Peak. (All momenta)",600,1.600,2.200);
2287 TH1F *hMassLSCsignPM=new TH1F("hMassLSCsignPM","D^{0} inv. Mass Loose Cuts Signal (All momenta), MassPeak",600,1.600,2.200);
2288 hMassLSCsignPM->Sumw2();
2289 TH1F *hMassTrueLSCsignSB=new TH1F("hMassTrueLSCsignSB","D^{0} MC inv. Mass in Side Bands Loose Cuts Signal(All momenta)",600,1.600,2.200);
2290 TH1F *hMassLSCsignSB=new TH1F("hMassLSCsignSB","D^{0} inv. Mass in Side Bands Loose Cuts Signal (All momenta)",600,1.600,2.200);
2291 hMassLSCsignSB->Sumw2();
2292
2293 flistLsCutsSignal->Add(hCPtaVSd0d0LSCsign);
2294 flistLsCutsSignal->Add(hSecVtxZLSCsign);
2295 flistLsCutsSignal->Add(hSecVtxYLSCsign);
2296 flistLsCutsSignal->Add(hSecVtxXLSCsign);
2297 flistLsCutsSignal->Add(hSecVtxXYLSCsign);
2298 flistLsCutsSignal->Add(hSecVtxPhiLSCsign);
e047b348 2299 flistLsCutsSignal->Add(hd0singlTrackLSCsign);
ac4c229c 2300 flistLsCutsSignal->Add(hCPtaLSCsign);
2301 flistLsCutsSignal->Add(hd0xd0LSCsign);
2302 flistLsCutsSignal->Add(hMassTrueLSCsign);
2303 flistLsCutsSignal->Add(hMassLSCsign);
2304 flistLsCutsSignal->Add(hMassTrueLSCsignPM);
2305 flistLsCutsSignal->Add(hMassLSCsignPM);
2306 flistLsCutsSignal->Add(hMassTrueLSCsignSB);
2307 flistLsCutsSignal->Add(hMassLSCsignSB);
624c07ab 2308
e047b348 2309
2310 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
2311 TH1F *hdcaLSCsign=new TH1F("hdcaLSCsign","hdca_LooseCuts_Sign",100,0.,1000.);
2312 hdcaLSCsign->SetXTitle("dca [#mum]");
2313 hdcaLSCsign->SetYTitle("Entries");
2314 TH1F *hcosthetastarLSCsign=new TH1F("hcosthetastarLSCsign","hCosThetaStar_LooseCuts_Sign",50,-1.,1.);
2315 hcosthetastarLSCsign->SetXTitle("cos #theta^{*}");
2316 hcosthetastarLSCsign->SetYTitle("Entries");
2317 TH1F *hptD0LSCsign=new TH1F("hptD0LSCsign","D^{0} transverse momentum distribution",34,ptbinsD0arr);
2318 hptD0LSCsign->SetXTitle("p_{t} [GeV/c]");
2319 hptD0LSCsign->SetYTitle("Entries");
2320 TH1F *hptD0VsMaxPtLSCsign=new TH1F("hptD0VsMaxPtLSCsign","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
2321 TH2F *hptD0PTallsqrtLSCsign=new TH2F("hptD0PTallsqrtLSCsign","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
2322 TH2F *hptD0PTallLSCsign=new TH2F("hptD0PTallLSCsign","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
2323 TH2F *hptD0vsptBLSCsign=new TH2F("hptD0vsptBLSCsign","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2324 TH2F *hpD0vspBLSCsign=new TH2F("hpD0vspBLSCsign","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2325 TH2F *hptD0vsptcquarkLSCsign=new TH2F("hptD0vsptcquarkLSCsign","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2326 TH2F *hpD0vspcquarkLSCsign=new TH2F("hpD0vspcquarkLSCsign","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2327 flistLsCutsSignal->Add(hdcaLSCsign);
2328 flistLsCutsSignal->Add(hcosthetastarLSCsign);
2329 flistLsCutsSignal->Add(hptD0LSCsign);
2330 flistLsCutsSignal->Add(hptD0VsMaxPtLSCsign);
2331 flistLsCutsSignal->Add(hptD0PTallsqrtLSCsign);
2332 flistLsCutsSignal->Add(hptD0PTallLSCsign);
2333 flistLsCutsSignal->Add(hptD0vsptBLSCsign);
2334 flistLsCutsSignal->Add(hpD0vspBLSCsign);
2335 flistLsCutsSignal->Add(hptD0vsptcquarkLSCsign);
2336 flistLsCutsSignal->Add(hpD0vspcquarkLSCsign);
2337
2338 TH1F *hd0zD0ptLSCsign;
cc3209fb 2339 TH1F *hInvMassD0LSCsign,*hInvMassD0barLSCsign;
e047b348 2340 TH2F *hInvMassPtLSCsign=new TH2F("hInvMassPtLSCsign","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
d39e8f99 2341 THnSparseF *hSparseLSCsign=new THnSparseF("hSparseLSCsign","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
2342 hSparseLSCsign->SetBinEdges(0,massbins);
2343 hSparseLSCsign->SetBinEdges(1,massbins);
2344 hSparseLSCsign->SetBinEdges(2,ptbinsForNsparse);
2345 hSparseLSCsign->SetBinEdges(3,impparbins);
2346 hSparseLSCsign->SetBinEdges(4,massHypoBins);
2347 flistLsCutsSignal->Add(hSparseLSCsign);
e047b348 2348 TH1F *hetaLSCsign;
2349 TH1F *hCosPDPBLSCsign;
2350 TH1F *hCosPcPDLSCsign;
2351 flistLsCutsSignal->Add(hInvMassPtLSCsign);
2352
a9f921f5 2353
2354
2355 THnSparseF *hSparseCxyLxyLSCsign=new THnSparseF("hSparseCxyLxyLSCsign","Candidate Mass;massD0;Pt;CosXY;Lxy",4,nbinsSparsCxyLxy,binLowLimitSparseCxyLxy,binUpLimitSparseCxyLxy);
2356 hSparseCxyLxyLSCsign->SetBinEdges(1,ptbinlimitsCxyLxy);
2357 hSparseCxyLxyLSCsign->GetAxis(0)->SetName("mass");
2358 hSparseCxyLxyLSCsign->GetAxis(0)->SetTitle("Invariant Mass (K#pi) [GeV/c^{2}]");
2359 hSparseCxyLxyLSCsign->GetAxis(1)->SetName("pt");
2360 hSparseCxyLxyLSCsign->GetAxis(1)->SetTitle("p_{t} [GeV/c]");
2361 hSparseCxyLxyLSCsign->GetAxis(2)->SetName("CosPointXY");
2362 hSparseCxyLxyLSCsign->GetAxis(2)->SetTitle("Cos#theta_{point}^{XY}");
2363 hSparseCxyLxyLSCsign->GetAxis(3)->SetName("NormDecLengthXY");
2364 hSparseCxyLxyLSCsign->GetAxis(3)->SetTitle("Normalized XY decay length");
2365
2366 flistLsCutsSignal->Add(hSparseCxyLxyLSCsign);
e047b348 2367 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
2368 TH2F *hd0D0VSd0xd0LSCsignpt;
2369 TH2F *hangletracksVSd0xd0LSCsignpt;
2370 TH2F *hangletracksVSd0D0LSCsignpt;
2371 TH1F *hd0xd0LSCsignpt;
77ed0cdb 2372 TH1F *hPhiHistPMLSCsignpt,*hPhiHistSBLSCsignpt;
e047b348 2373
2374 TH2F *hTOFpidLSCsign=new TH2F("hTOFpidLSCsign","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
2375 flistLsCutsSignal->Add(hTOFpidLSCsign);
2376
2377 for(Int_t i=0;i<fnbins;i++){
77ed0cdb 2378
2379 namehist="hPhiHistPMLSCsign_pt";
2380 namehist+=i;
2381 titlehist="Azimuthal correlation LS Cuts Sign PM ptbin=";
2382 titlehist+=i;
2383 hPhiHistPMLSCsignpt=new TH1F(namehist.Data(),titlehist.Data(),100,-3.15,3.15);
2384 hPhiHistPMLSCsignpt->Sumw2();
2385 flistLsCutsSignal->Add(hPhiHistPMLSCsignpt);
2386
2387 namehist="hPhiHistSBLSCsign_pt";
2388 namehist+=i;
2389 titlehist="Azimuthal correlation LS Cuts Sign SB ptbin=";
2390 titlehist+=i;
2391 hPhiHistSBLSCsignpt=new TH1F(namehist.Data(),titlehist.Data(),100,-3.15,3.15);
2392 hPhiHistSBLSCsignpt->Sumw2();
2393 flistLsCutsSignal->Add(hPhiHistSBLSCsignpt);
2394
2395
2396
e047b348 2397 namehist="hd0zD0ptLSCsign_pt";
2398 namehist+=i;
2399 titlehist="d0(z) Loose Cuts Signm ptbin=";
2400 titlehist+=i;
2401 hd0zD0ptLSCsign=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
2402 hd0zD0ptLSCsign->SetXTitle("d_{0}(z) [#mum]");
2403 hd0zD0ptLSCsign->SetYTitle("Entries");
2404 flistLsCutsSignal->Add(hd0zD0ptLSCsign);
2405
cc3209fb 2406 namehist="hInvMassD0LSCsign_pt";
e047b348 2407 namehist+=i;
2408 titlehist="Invariant Mass Loose Cuts Sign ptbin=";
2409 titlehist+=i;
cc3209fb 2410 hInvMassD0LSCsign=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
2411 hInvMassD0LSCsign->SetXTitle("Invariant Mass [GeV]");
2412 hInvMassD0LSCsign->SetYTitle("Entries");
2413 flistLsCutsSignal->Add(hInvMassD0LSCsign);
2414
2415
2416 namehist="hInvMassD0barLSCsign_pt";
2417 namehist+=i;
d39e8f99 2418 titlehist="Invariant Mass D0bar Loose Cuts Signal ptbin=";
cc3209fb 2419 titlehist+=i;
2420 hInvMassD0barLSCsign=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
2421 hInvMassD0barLSCsign->SetXTitle("Invariant Mass [GeV]");
2422 hInvMassD0barLSCsign->SetYTitle("Entries");
2423 flistLsCutsSignal->Add(hInvMassD0barLSCsign);
e047b348 2424
2425 namehist="hetaLSCsign_pt";
2426 namehist+=i;
2427 titlehist="eta Loose Cuts Sign ptbin=";
2428 titlehist+=i;
2429 hetaLSCsign=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
2430 hetaLSCsign->SetXTitle("Pseudorapidity");
2431 hetaLSCsign->SetYTitle("Entries");
2432 flistLsCutsSignal->Add(hetaLSCsign);
2433
2434 namehist="hCosPDPBLSCsign_pt";
2435 namehist+=i;
2436 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
2437 titlehist+=i;
2438 hCosPDPBLSCsign=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
2439 hCosPDPBLSCsign->SetXTitle("Cosine between D0 momentum and B momentum");
2440 hCosPDPBLSCsign->SetYTitle("Entries");
2441 flistLsCutsSignal->Add(hCosPDPBLSCsign);
2442
2443 namehist="hCosPcPDLSCsign_pt";
2444 namehist+=i;
2445 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
2446 titlehist+=i;
2447 hCosPcPDLSCsign=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
2448 hCosPcPDLSCsign->SetXTitle("Cosine between c quark momentum and D0 momentum");
2449 hCosPcPDLSCsign->SetYTitle("Entries");
2450 flistLsCutsSignal->Add(hCosPcPDLSCsign);
2451
2452
2453 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
2454 namehist="hd0xd0LSCsign_pt";
2455 namehist+=i;
2456 titlehist="d0xd0 Loose Cuts Sign ptbin=";
2457 titlehist+=i;
2458 hd0xd0LSCsignpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
2459 hd0xd0LSCsignpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
2460 hd0xd0LSCsignpt->SetYTitle("Entries");
2461 flistLsCutsSignal->Add(hd0xd0LSCsignpt);
2462
2463
2464 namehist="hd0D0VSd0xd0LSCsign_pt";
2465 namehist+=i;
2466 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts Sign ptbin=";
2467 titlehist+=i;
2468 hd0D0VSd0xd0LSCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
2469 hd0D0VSd0xd0LSCsignpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
2470 hd0D0VSd0xd0LSCsignpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
2471 flistLsCutsSignal->Add(hd0D0VSd0xd0LSCsignpt);
2472
2473
2474 namehist="hangletracksVSd0xd0LSCsign_pt";
2475 namehist+=i;
2476 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts Sign ptbin=";
2477 titlehist+=i;
2478 hangletracksVSd0xd0LSCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
2479 hangletracksVSd0xd0LSCsignpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
2480 hangletracksVSd0xd0LSCsignpt->SetYTitle(" angle between K and #p tracks [rad]");
2481 flistLsCutsSignal->Add(hangletracksVSd0xd0LSCsignpt);
2482
2483
2484 namehist="hangletracksVSd0D0LSCsign_pt";
2485 namehist+=i;
2486 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Loose Cuts Sign ptbin=";
2487 titlehist+=i;
2488 hangletracksVSd0D0LSCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
2489 hangletracksVSd0D0LSCsignpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
2490 hangletracksVSd0D0LSCsignpt->SetYTitle(" angle between K and #p tracks [rad]");
2491 flistLsCutsSignal->Add(hangletracksVSd0D0LSCsignpt);
2492
2493
2494 }
2495 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
2496 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2497
2498
624c07ab 2499 // ####### d0 D0 histos ############
ac4c229c 2500 TH1F *hd0D0LSCsignPM = new TH1F("hd0D0LSCsignPM","D^{0} impact par. plot , Loose Cuts ,Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
2501 hd0D0LSCsignPM->SetXTitle("Impact parameter [#mum]");
2502 hd0D0LSCsignPM->SetYTitle("Entries");
2503
2504 TH1F *hd0D0VtxTrueLSCsignPM = new TH1F("hd0D0VtxTrueLSCsignPM","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
2505 hd0D0VtxTrueLSCsignPM->SetXTitle("Impact parameter [#mum]");
2506 hd0D0VtxTrueLSCsignPM->SetYTitle("Entries");
2507
2508 TH1F *hMCd0D0LSCsignPM = new TH1F("hMCd0D0LSCsignPM","D^{0} impact par. plot, Loose Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
2509 hMCd0D0LSCsignPM->SetXTitle("MC Impact parameter [#mum]");
2510 hMCd0D0LSCsignPM->SetYTitle("Entries");
2511
2512 TH1F *hd0D0LSCsignSB = new TH1F("hd0D0LSCsignSB","D^{0} impact par. plot , Loose Cuts ,Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
2513 hd0D0LSCsignSB->SetXTitle("Impact parameter [#mum]");
2514 hd0D0LSCsignSB->SetYTitle("Entries");
2515
2516 TH1F *hd0D0VtxTrueLSCsignSB = new TH1F("hd0D0VtxTrueLSCsignSB","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
2517 hd0D0VtxTrueLSCsignSB->SetXTitle("Impact parameter [#mum]");
2518 hd0D0VtxTrueLSCsignSB->SetYTitle("Entries");
2519
2520 TH1F *hMCd0D0LSCsignSB = new TH1F("hMCd0D0LSCsignSB","D^{0} impact par. plot, Loose Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
2521 hMCd0D0LSCsignSB->SetXTitle("MC Impact parameter [#mum]");
2522 hMCd0D0LSCsignSB->SetYTitle("Entries");
2523
2524 flistLsCutsSignal->Add(hd0D0LSCsignPM);
2525 flistLsCutsSignal->Add(hd0D0VtxTrueLSCsignPM);
2526 flistLsCutsSignal->Add(hMCd0D0LSCsignPM);
2527 flistLsCutsSignal->Add(hd0D0LSCsignSB);
2528 flistLsCutsSignal->Add(hd0D0VtxTrueLSCsignSB);
2529 flistLsCutsSignal->Add(hMCd0D0LSCsignSB);
2530
e047b348 2531 TH1F *hd0D0ptLSCsignPM;
2532 TH1F *hMCd0D0ptLSCsignPM;
2533 TH1F *hd0D0VtxTrueptLSCsignPM;
2534 TH1F *hd0D0ptLSCsignSB;
2535 TH1F *hMCd0D0ptLSCsignSB;
2536 TH1F *hd0D0VtxTrueptLSCsignSB;
ac4c229c 2537 namehist="hd0D0ptLSCsign_";
624c07ab 2538 titlehist="D^{0} impact par. plot, Loose Cuts, Signal, ";
2539 for(Int_t i=0;i<fnbins;i++){
2540 strnamept=namehist;
2541 strnamept.Append("PkMss_pt");
2542 strnamept+=i;
2543
2544 strtitlept=titlehist;
2545 strtitlept.Append(" Mass Peak, ");
2546 strtitlept+=fptbins[i];
2547 strtitlept.Append("<= pt <");
2548 strtitlept+=fptbins[i+1];
2549 strtitlept.Append(" [GeV/c]");
2550
e047b348 2551 hd0D0ptLSCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2552 hd0D0ptLSCsignPM->SetXTitle("Impact parameter [#mum] ");
2553 hd0D0ptLSCsignPM->SetYTitle("Entries");
2554 flistLsCutsSignal->Add(hd0D0ptLSCsignPM);
624c07ab 2555
2556 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 2557 hMCd0D0ptLSCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2558 hMCd0D0ptLSCsignPM->SetXTitle("MC Impact parameter [#mum] ");
2559 hMCd0D0ptLSCsignPM->SetYTitle("Entries");
2560 flistLsCutsSignal->Add(hMCd0D0ptLSCsignPM);
624c07ab 2561
2562
2563 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 2564 hd0D0VtxTrueptLSCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2565 hd0D0VtxTrueptLSCsignPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
2566 hd0D0VtxTrueptLSCsignPM->SetYTitle("Entries");
2567 flistLsCutsSignal->Add(hd0D0VtxTrueptLSCsignPM);
624c07ab 2568
2569 strnamept=namehist;
2570 strnamept.Append("SBMss_pt");
2571 strnamept+=i;
2572
2573 strtitlept=titlehist;
2574 strtitlept.Append(" Side Bands, ");
2575 strtitlept+=fptbins[i];
2576 strtitlept.Append("<= pt <");
2577 strtitlept+=fptbins[i+1];
2578 strtitlept.Append(" [GeV/c]");
2579
e047b348 2580 hd0D0ptLSCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2581 hd0D0ptLSCsignSB->SetXTitle("Impact parameter [#mum] ");
2582 hd0D0ptLSCsignSB->SetYTitle("Entries");
2583 flistLsCutsSignal->Add(hd0D0ptLSCsignSB);
624c07ab 2584
2585 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 2586 hMCd0D0ptLSCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2587 hMCd0D0ptLSCsignSB->SetXTitle("MC Impact parameter [#mum] ");
2588 hMCd0D0ptLSCsignSB->SetYTitle("Entries");
2589 flistLsCutsSignal->Add(hMCd0D0ptLSCsignSB);
624c07ab 2590
2591 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 2592 hd0D0VtxTrueptLSCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2593 hd0D0VtxTrueptLSCsignSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
2594 hd0D0VtxTrueptLSCsignSB->SetYTitle("Entries");
2595 flistLsCutsSignal->Add(hd0D0VtxTrueptLSCsignSB);
624c07ab 2596 }
2597
2598
2599 //############ LOOSE CUTS BACKGROUND HISTOGRAMS ###########
2600 //
2601 // ######## global properties histos #######
e047b348 2602 TH2F *hCPtaVSd0d0LSCback=new TH2F("hCPtaVSd0d0LSCback","hCPtaVSd0d0_LooseCuts_Background",1000,-100000.,100000.,100,-1.,1.);
ac4c229c 2603 TH1F *hSecVtxZLSCback=new TH1F("hSecVtxZLSCback","hSecVtxZ_LooseCuts_Background",1000,-8.,8.);
2604 TH1F *hSecVtxXLSCback=new TH1F("hSecVtxXLSCback","hSecVtxX_LooseCuts_Background",1000,-3000.,3000.);
2605 TH1F *hSecVtxYLSCback=new TH1F("hSecVtxYLSCback","hSecVtxY_LooseCuts_Background",1000,-3000.,3000.);
2606 TH2F *hSecVtxXYLSCback=new TH2F("hSecVtxXYLSCback","hSecVtxXY_LooseCuts_Background",1000,-3000.,3000.,1000,-3000.,3000.);
2607 TH1F *hSecVtxPhiLSCback=new TH1F("hSecVtxPhiLSCback","hSecVtxPhi_LooseCuts_Background",180,-180.1,180.1);
e047b348 2608 TH1F *hd0singlTrackLSCback=new TH1F("hd0singlTrackLSCback","hd0singlTrackLooseCuts_Back",1000,-5000.,5000.);
2609 TH1F *hCPtaLSCback=new TH1F("hCPtaLSCback","hCPta_LooseCuts_Background",100,-1.,1.);
ac4c229c 2610 TH1F *hd0xd0LSCback=new TH1F("hd0xd0LSCback","hd0xd0_LooseCuts_Background",1000,-100000.,100000.);
2611 TH1F *hMassTrueLSCback=new TH1F("hMassTrueLSCback","D^{0} MC inv. Mass Loose Cuts Background(All momenta)",600,1.600,2.200);
2612 TH1F *hMassLSCback=new TH1F("hMassLSCback","D^{0} inv. Mass Loose Cuts Background (All momenta)",600,1.600,2.200);
2613 hMassLSCback->Sumw2();
2614 TH1F *hMassTrueLSCbackPM=new TH1F("hMassTrueLSCbackPM","D^{0} MC inv. Mass Loose Cuts Background, Mass Peak. (All momenta)",600,1.600,2.200);
2615 TH1F *hMassLSCbackPM=new TH1F("hMassLSCbackPM","D^{0} inv. Mass Loose Cuts Background (All momenta), MassPeak",600,1.600,2.200);
2616 hMassLSCbackPM->Sumw2();
2617 TH1F *hMassTrueLSCbackSB=new TH1F("hMassTrueLSCbackSB","D^{0} MC inv. Mass in Side Bands Loose Cuts Background(All momenta)",600,1.600,2.200);
2618 TH1F *hMassLSCbackSB=new TH1F("hMassLSCbackSB","D^{0} inv. Mass in Side Bands Loose Cuts Background (All momenta)",600,1.600,2.200);
2619 hMassLSCbackSB->Sumw2();
2620
2621 flistLsCutsBack->Add(hCPtaVSd0d0LSCback);
2622 flistLsCutsBack->Add(hSecVtxZLSCback);
2623 flistLsCutsBack->Add(hSecVtxYLSCback);
2624 flistLsCutsBack->Add(hSecVtxXLSCback);
2625 flistLsCutsBack->Add(hSecVtxXYLSCback);
2626 flistLsCutsBack->Add(hSecVtxPhiLSCback);
e047b348 2627 flistLsCutsBack->Add(hd0singlTrackLSCback);
ac4c229c 2628 flistLsCutsBack->Add(hCPtaLSCback);
2629 flistLsCutsBack->Add(hd0xd0LSCback);
2630 flistLsCutsBack->Add(hMassTrueLSCback);
2631 flistLsCutsBack->Add(hMassLSCback);
2632 flistLsCutsBack->Add(hMassTrueLSCbackPM);
2633 flistLsCutsBack->Add(hMassLSCbackPM);
2634 flistLsCutsBack->Add(hMassTrueLSCbackSB);
2635 flistLsCutsBack->Add(hMassLSCbackSB);
624c07ab 2636
2637
e047b348 2638
2639
2640
2641
2642
2643
2644 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
2645 TH1F *hdcaLSCback=new TH1F("hdcaLSCback","hdca_LooseCuts_Backgr",100,0.,1000.);
2646 hdcaLSCback->SetXTitle("dca [#mum]");
2647 hdcaLSCback->SetYTitle("Entries");
2648 TH1F *hcosthetastarLSCback=new TH1F("hcosthetastarLSCback","hCosThetaStar_LooseCuts_Backgr",50,-1.,1.);
2649 hcosthetastarLSCback->SetXTitle("cos #theta^{*}");
2650 hcosthetastarLSCback->SetYTitle("Entries");
2651 TH1F *hptD0LSCback=new TH1F("hptD0LSCback","D^{0} transverse momentum distribution",34,ptbinsD0arr);
2652 hptD0LSCback->SetXTitle("p_{t} [GeV/c]");
2653 hptD0LSCback->SetYTitle("Entries");
2654 TH1F *hptD0VsMaxPtLSCback=new TH1F("hptD0VsMaxPtLSCback","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
2655 TH2F *hptD0PTallsqrtLSCback=new TH2F("hptD0PTallsqrtLSCback","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
2656 TH2F *hptD0PTallLSCback=new TH2F("hptD0PTallLSCback","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
2657 TH2F *hptD0vsptBLSCback=new TH2F("hptD0vsptBLSCback","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2658 TH2F *hpD0vspBLSCback=new TH2F("hpD0vspBLSCback","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2659 TH2F *hptD0vsptcquarkLSCback=new TH2F("hptD0vsptcquarkLSCback","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2660 TH2F *hpD0vspcquarkLSCback=new TH2F("hpD0vspcquarkLSCback","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2661 flistLsCutsBack->Add(hdcaLSCback);
2662 flistLsCutsBack->Add(hcosthetastarLSCback);
2663 flistLsCutsBack->Add(hptD0LSCback);
2664 flistLsCutsBack->Add(hptD0VsMaxPtLSCback);
2665 flistLsCutsBack->Add(hptD0PTallsqrtLSCback);
2666 flistLsCutsBack->Add(hptD0PTallLSCback);
2667 flistLsCutsBack->Add(hptD0vsptBLSCback);
2668 flistLsCutsBack->Add(hpD0vspBLSCback);
2669 flistLsCutsBack->Add(hptD0vsptcquarkLSCback);
2670 flistLsCutsBack->Add(hpD0vspcquarkLSCback);
2671
2672 TH1F *hd0zD0ptLSCback;
cc3209fb 2673 TH1F *hInvMassD0LSCback,*hInvMassD0barLSCback;
e047b348 2674 TH2F *hInvMassPtLSCback=new TH2F("hInvMassPtLSCback","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
d39e8f99 2675 THnSparseF *hSparseLSCback=new THnSparseF("hSparseLSCback","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
2676 hSparseLSCback->SetBinEdges(0,massbins);
2677 hSparseLSCback->SetBinEdges(1,massbins);
2678 hSparseLSCback->SetBinEdges(2,ptbinsForNsparse);
2679 hSparseLSCback->SetBinEdges(3,impparbins);
2680 hSparseLSCback->SetBinEdges(4,massHypoBins);
2681 flistLsCutsBack->Add(hSparseLSCback);
e047b348 2682 TH1F *hetaLSCback;
2683 TH1F *hCosPDPBLSCback;
2684 TH1F *hCosPcPDLSCback;
2685 flistLsCutsBack->Add(hInvMassPtLSCback);
2686 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
2687 TH2F *hd0D0VSd0xd0LSCbackpt;
2688 TH2F *hangletracksVSd0xd0LSCbackpt;
2689 TH2F *hangletracksVSd0D0LSCbackpt;
2690 TH1F *hd0xd0LSCbackpt;
2691
2692 TH2F *hTOFpidLSCback=new TH2F("hTOFpidLSCback","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
2693 flistLsCutsBack->Add(hTOFpidLSCback);
2694
2695 for(Int_t i=0;i<fnbins;i++){
2696 namehist="hd0zD0ptLSCback_pt";
2697 namehist+=i;
2698 titlehist="d0(z) Loose Cuts Backgr ptbin=";
2699 titlehist+=i;
2700 hd0zD0ptLSCback=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
2701 hd0zD0ptLSCback->SetXTitle("d_{0}(z) [#mum]");
2702 hd0zD0ptLSCback->SetYTitle("Entries");
2703 flistLsCutsBack->Add(hd0zD0ptLSCback);
2704
cc3209fb 2705 namehist="hInvMassD0LSCback_pt";
e047b348 2706 namehist+=i;
2707 titlehist="Invariant Mass Loose Cuts Backgr ptbin=";
2708 titlehist+=i;
cc3209fb 2709 hInvMassD0LSCback=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
2710 hInvMassD0LSCback->SetXTitle("Invariant Mass [GeV]");
2711 hInvMassD0LSCback->SetYTitle("Entries");
2712 flistLsCutsBack->Add(hInvMassD0LSCback);
2713
2714 namehist="hInvMassD0barLSCback_pt";
2715 namehist+=i;
d39e8f99 2716 titlehist="Invariant Mass D0bar Loose Cuts Back ptbin=";
cc3209fb 2717 titlehist+=i;
2718 hInvMassD0barLSCback=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
2719 hInvMassD0barLSCback->SetXTitle("Invariant Mass [GeV]");
2720 hInvMassD0barLSCback->SetYTitle("Entries");
2721 flistLsCutsBack->Add(hInvMassD0barLSCback);
2722
e047b348 2723
2724 namehist="hetaLSCback_pt";
2725 namehist+=i;
2726 titlehist="eta Loose Cuts Backgr ptbin=";
2727 titlehist+=i;
2728 hetaLSCback=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
2729 hetaLSCback->SetXTitle("Pseudorapidity");
2730 hetaLSCback->SetYTitle("Entries");
2731 flistLsCutsBack->Add(hetaLSCback);
2732
2733 namehist="hCosPDPBLSCback_pt";
2734 namehist+=i;
2735 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
2736 titlehist+=i;
2737 hCosPDPBLSCback=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
2738 hCosPDPBLSCback->SetXTitle("Cosine between D0 momentum and B momentum");
2739 hCosPDPBLSCback->SetYTitle("Entries");
2740 flistLsCutsBack->Add(hCosPDPBLSCback);
2741
2742 namehist="hCosPcPDLSCback_pt";
2743 namehist+=i;
2744 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
2745 titlehist+=i;
2746 hCosPcPDLSCback=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
2747 hCosPcPDLSCback->SetXTitle("Cosine between c quark momentum and D0 momentum");
2748 hCosPcPDLSCback->SetYTitle("Entries");
2749 flistLsCutsBack->Add(hCosPcPDLSCback);
2750
2751 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
2752 namehist="hd0xd0LSCback_pt";
2753 namehist+=i;
2754 titlehist="d0xd0 Loose Cuts Back ptbin=";
2755 titlehist+=i;
2756 hd0xd0LSCbackpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
2757 hd0xd0LSCbackpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
2758 hd0xd0LSCbackpt->SetYTitle("Entries");
2759 flistLsCutsBack->Add(hd0xd0LSCbackpt);
2760
2761
2762 namehist="hd0D0VSd0xd0LSCback_pt";
2763 namehist+=i;
2764 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts Back ptbin=";
2765 titlehist+=i;
2766 hd0D0VSd0xd0LSCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
2767 hd0D0VSd0xd0LSCbackpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
2768 hd0D0VSd0xd0LSCbackpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
2769 flistLsCutsBack->Add(hd0D0VSd0xd0LSCbackpt);
2770
2771
2772 namehist="hangletracksVSd0xd0LSCback_pt";
2773 namehist+=i;
2774 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts Back ptbin=";
2775 titlehist+=i;
2776 hangletracksVSd0xd0LSCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
2777 hangletracksVSd0xd0LSCbackpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
2778 hangletracksVSd0xd0LSCbackpt->SetYTitle(" angle between K and #p tracks [rad]");
2779 flistLsCutsBack->Add(hangletracksVSd0xd0LSCbackpt);
2780
2781
2782 namehist="hangletracksVSd0D0LSCback_pt";
2783 namehist+=i;
2784 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Loose Cuts Back ptbin=";
2785 titlehist+=i;
2786 hangletracksVSd0D0LSCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
2787 hangletracksVSd0D0LSCbackpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
2788 hangletracksVSd0D0LSCbackpt->SetYTitle(" angle between K and #p tracks [rad]");
2789 flistLsCutsBack->Add(hangletracksVSd0D0LSCbackpt);
2790
2791 }
2792 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
2793 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2794
2795
2796
2797
2798
2799
2800
624c07ab 2801 // ####### d0 D0 histos ############
2802
ac4c229c 2803 TH1F *hd0D0LSCbackPM = new TH1F("hd0D0LSCbackPM","D^{0} impact par. plot , Loose Cuts ,Background,Mass Peak (All momenta)",1000,-1000.,1000.);
2804 hd0D0LSCbackPM->SetXTitle("Impact parameter [#mum]");
2805 hd0D0LSCbackPM->SetYTitle("Entries");
2806
2807 TH1F *hd0D0VtxTrueLSCbackPM = new TH1F("hd0D0VtxTrueLSCbackPM","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
2808 hd0D0VtxTrueLSCbackPM->SetXTitle("Impact parameter [#mum]");
2809 hd0D0VtxTrueLSCbackPM->SetYTitle("Entries");
2810
2811 TH1F *hMCd0D0LSCbackPM = new TH1F("hMCd0D0LSCbackPM","D^{0} impact par. plot, Loose Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
2812 hMCd0D0LSCbackPM->SetXTitle("MC Impact parameter [#mum]");
2813 hMCd0D0LSCbackPM->SetYTitle("Entries");
2814
2815 TH1F *hd0D0LSCbackSB = new TH1F("hd0D0LSCbackSB","D^{0} impact par. plot , Loose Cuts ,Background,Mass Peak (All momenta)",1000,-1000.,1000.);
2816 hd0D0LSCbackSB->SetXTitle("Impact parameter [#mum]");
2817 hd0D0LSCbackSB->SetYTitle("Entries");
2818
2819 TH1F *hd0D0VtxTrueLSCbackSB = new TH1F("hd0D0VtxTrueLSCbackSB","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
2820 hd0D0VtxTrueLSCbackSB->SetXTitle("Impact parameter [#mum]");
2821 hd0D0VtxTrueLSCbackSB->SetYTitle("Entries");
2822
2823 TH1F *hMCd0D0LSCbackSB = new TH1F("hMCd0D0LSCbackSB","D^{0} impact par. plot, Loose Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
2824 hMCd0D0LSCbackSB->SetXTitle("MC Impact parameter [#mum]");
2825 hMCd0D0LSCbackSB->SetYTitle("Entries");
2826
2827 flistLsCutsBack->Add(hd0D0LSCbackPM);
2828 flistLsCutsBack->Add(hd0D0VtxTrueLSCbackPM);
2829 flistLsCutsBack->Add(hMCd0D0LSCbackPM);
2830 flistLsCutsBack->Add(hd0D0LSCbackSB);
2831 flistLsCutsBack->Add(hd0D0VtxTrueLSCbackSB);
2832 flistLsCutsBack->Add(hMCd0D0LSCbackSB);
2833
e047b348 2834 TH1F *hd0D0ptLSCbackPM;
2835 TH1F *hMCd0D0ptLSCbackPM;
2836 TH1F *hd0D0VtxTrueptLSCbackPM;
2837 TH1F *hd0D0ptLSCbackSB;
2838 TH1F *hMCd0D0ptLSCbackSB;
2839 TH1F *hd0D0VtxTrueptLSCbackSB;
ac4c229c 2840 namehist="hd0D0ptLSCback_";
624c07ab 2841 titlehist="D^{0} impact par. plot, Loose Cuts, Background, ";
2842 for(Int_t i=0;i<fnbins;i++){
2843 strnamept=namehist;
2844 strnamept.Append("PkMss_pt");
2845 strnamept+=i;
2846
2847 strtitlept=titlehist;
2848 strtitlept.Append(" Mass Peak, ");
2849 strtitlept+=fptbins[i];
2850 strtitlept.Append("<= pt <");
2851 strtitlept+=fptbins[i+1];
2852 strtitlept.Append(" [GeV/c]");
2853
e047b348 2854 hd0D0ptLSCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2855 hd0D0ptLSCbackPM->SetXTitle("Impact parameter [#mum] ");
2856 hd0D0ptLSCbackPM->SetYTitle("Entries");
2857 flistLsCutsBack->Add(hd0D0ptLSCbackPM);
624c07ab 2858
2859 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 2860 hMCd0D0ptLSCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2861 hMCd0D0ptLSCbackPM->SetXTitle("MC Impact parameter [#mum] ");
2862 hMCd0D0ptLSCbackPM->SetYTitle("Entries");
2863 flistLsCutsBack->Add(hMCd0D0ptLSCbackPM);
624c07ab 2864
2865
2866 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 2867 hd0D0VtxTrueptLSCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2868 hd0D0VtxTrueptLSCbackPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
2869 hd0D0VtxTrueptLSCbackPM->SetYTitle("Entries");
2870 flistLsCutsBack->Add(hd0D0VtxTrueptLSCbackPM);
624c07ab 2871
2872 strnamept=namehist;
2873 strnamept.Append("SBMss_pt");
2874 strnamept+=i;
2875
2876 strtitlept=titlehist;
2877 strtitlept.Append(" Side Bands, ");
2878 strtitlept+=fptbins[i];
2879 strtitlept.Append("<= pt <");
2880 strtitlept+=fptbins[i+1];
2881 strtitlept.Append(" [GeV/c]");
2882
e047b348 2883 hd0D0ptLSCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2884 hd0D0ptLSCbackSB->SetXTitle("Impact parameter [#mum] ");
2885 hd0D0ptLSCbackSB->SetYTitle("Entries");
2886 flistLsCutsBack->Add(hd0D0ptLSCbackSB);
624c07ab 2887
2888 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 2889 hMCd0D0ptLSCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2890 hMCd0D0ptLSCbackSB->SetXTitle("MC Impact parameter [#mum] ");
2891 hMCd0D0ptLSCbackSB->SetYTitle("Entries");
2892 flistLsCutsBack->Add(hMCd0D0ptLSCbackSB);
624c07ab 2893
2894 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 2895 hd0D0VtxTrueptLSCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
2896 hd0D0VtxTrueptLSCbackSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
2897 hd0D0VtxTrueptLSCbackSB->SetYTitle("Entries");
2898 flistLsCutsBack->Add(hd0D0VtxTrueptLSCbackSB);
624c07ab 2899 }
2900
2901
2902
2903 //############ LOOSE CUTS FROMB HISTOGRAMS ###########
2904 //
2905 //####### global properties histos
2906
e047b348 2907 TH2F *hCPtaVSd0d0LSCfromB=new TH2F("hCPtaVSd0d0LSCfromB","hCPtaVSd0d0_LooseCuts_FromB",1000,-100000.,100000.,100,-1.,1.);
ac4c229c 2908 TH1F *hSecVtxZLSCfromB=new TH1F("hSecVtxZLSCfromB","hSecVtxZ_LooseCuts_FromB",1000,-8.,8.);
2909 TH1F *hSecVtxXLSCfromB=new TH1F("hSecVtxXLSCfromB","hSecVtxX_LooseCuts_FromB",1000,-3000.,3000.);
2910 TH1F *hSecVtxYLSCfromB=new TH1F("hSecVtxYLSCfromB","hSecVtxY_LooseCuts_FromB",1000,-3000.,3000.);
2911 TH2F *hSecVtxXYLSCfromB=new TH2F("hSecVtxXYLSCfromB","hSecVtxXY_LooseCuts_FromB",1000,-3000.,3000.,1000,-3000.,3000.);
2912 TH1F *hSecVtxPhiLSCfromB=new TH1F("hSecVtxPhiLSCfromB","hSecVtxPhi_LooseCuts_FromB",180,-180.1,180.1);
e047b348 2913 TH1F *hd0singlTrackLSCfromB=new TH1F("hd0singlTrackLSCfromB","hd0singlTrackLooseCuts_FromB",1000,-5000.,5000.);
2914 TH1F *hCPtaLSCfromB=new TH1F("hCPtaLSCfromB","hCPta_LooseCuts_FromB",100,-1.,1.);
ac4c229c 2915 TH1F *hd0xd0LSCfromB=new TH1F("hd0xd0LSCfromB","hd0xd0_LooseCuts_FromB",1000,-100000.,100000.);
2916 TH1F *hMassTrueLSCfromB=new TH1F("hMassTrueLSCfromB","D^{0} MC inv. Mass Loose Cuts FromB(All momenta)",600,1.600,2.200);
2917 TH1F *hMassLSCfromB=new TH1F("hMassLSCfromB","D^{0} inv. Mass Loose Cuts FromB (All momenta)",600,1.600,2.200);
2918 hMassLSCfromB->Sumw2();
2919 TH1F *hMassTrueLSCfromBPM=new TH1F("hMassTrueLSCfromBPM","D^{0} MC inv. Mass Loose Cuts FromB, Mass Peak. (All momenta)",600,1.600,2.200);
2920 TH1F *hMassLSCfromBPM=new TH1F("hMassLSCfromBPM","D^{0} inv. Mass Loose Cuts FromB (All momenta), MassPeak",600,1.600,2.200);
2921 hMassLSCfromBPM->Sumw2();
2922 TH1F *hMassTrueLSCfromBSB=new TH1F("hMassTrueLSCfromBSB","D^{0} MC inv. Mass in Side Bands Loose Cuts FromB(All momenta)",600,1.600,2.200);
2923 TH1F *hMassLSCfromBSB=new TH1F("hMassLSCfromBSB","D^{0} inv. Mass in Side Bands Loose Cuts FromB (All momenta)",600,1.600,2.200);
2924 hMassLSCfromBSB->Sumw2();
2925
2926 flistLsCutsFromB->Add(hCPtaVSd0d0LSCfromB);
2927 flistLsCutsFromB->Add(hSecVtxZLSCfromB);
2928 flistLsCutsFromB->Add(hSecVtxYLSCfromB);
2929 flistLsCutsFromB->Add(hSecVtxXLSCfromB);
2930 flistLsCutsFromB->Add(hSecVtxXYLSCfromB);
2931 flistLsCutsFromB->Add(hSecVtxPhiLSCfromB);
e047b348 2932 flistLsCutsFromB->Add(hd0singlTrackLSCfromB);
ac4c229c 2933 flistLsCutsFromB->Add(hCPtaLSCfromB);
2934 flistLsCutsFromB->Add(hd0xd0LSCfromB);
2935 flistLsCutsFromB->Add(hMassTrueLSCfromB);
2936 flistLsCutsFromB->Add(hMassLSCfromB);
2937 flistLsCutsFromB->Add(hMassTrueLSCfromBPM);
2938 flistLsCutsFromB->Add(hMassLSCfromBPM);
2939 flistLsCutsFromB->Add(hMassTrueLSCfromBSB);
2940 flistLsCutsFromB->Add(hMassLSCfromBSB);
624c07ab 2941
e047b348 2942
2943
2944
2945 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
2946 TH1F *hdcaLSCfromB=new TH1F("hdcaLSCfromB","hdca_LooseCuts_FromB",100,0.,1000.);
2947 hdcaLSCfromB->SetXTitle("dca [#mum]");
2948 hdcaLSCfromB->SetYTitle("Entries");
2949 TH1F *hcosthetastarLSCfromB=new TH1F("hcosthetastarLSCfromB","hCosThetaStar_LooseCuts_FromB",50,-1.,1.);
2950 hcosthetastarLSCfromB->SetXTitle("cos #theta^{*}");
2951 hcosthetastarLSCfromB->SetYTitle("Entries");
2952 TH1F *hptD0LSCfromB=new TH1F("hptD0LSCfromB","D^{0} transverse momentum distribution",34,ptbinsD0arr);
2953 hptD0LSCfromB->SetXTitle("p_{t} [GeV/c]");
2954 hptD0LSCfromB->SetYTitle("Entries");
2955 TH1F *hptD0VsMaxPtLSCfromB=new TH1F("hptD0VsMaxPtLSCfromB","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
2956 TH2F *hptD0PTallsqrtLSCfromB=new TH2F("hptD0PTallsqrtLSCfromB","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
2957 TH2F *hptD0PTallLSCfromB=new TH2F("hptD0PTallLSCfromB","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
2958 TH2F *hptD0vsptBLSCfromB=new TH2F("hptD0vsptBLSCfromB","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2959 TH2F *hpD0vspBLSCfromB=new TH2F("hpD0vspBLSCfromB","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2960 TH2F *hptD0vsptcquarkLSCfromB=new TH2F("hptD0vsptcquarkLSCfromB","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2961 TH2F *hpD0vspcquarkLSCfromB=new TH2F("hpD0vspcquarkLSCfromB","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
2962 flistLsCutsFromB->Add(hdcaLSCfromB);
2963 flistLsCutsFromB->Add(hcosthetastarLSCfromB);
2964 flistLsCutsFromB->Add(hptD0LSCfromB);
2965 flistLsCutsFromB->Add(hptD0VsMaxPtLSCfromB);
2966 flistLsCutsFromB->Add(hptD0PTallsqrtLSCfromB);
2967 flistLsCutsFromB->Add(hptD0PTallLSCfromB);
2968 flistLsCutsFromB->Add(hptD0vsptBLSCfromB);
2969 flistLsCutsFromB->Add(hpD0vspBLSCfromB);
2970 flistLsCutsFromB->Add(hptD0vsptcquarkLSCfromB);
2971 flistLsCutsFromB->Add(hpD0vspcquarkLSCfromB);
2972
2973 TH1F *hd0zD0ptLSCfromB;
cc3209fb 2974 TH1F *hInvMassD0LSCfromB,*hInvMassD0barLSCfromB;
e047b348 2975 TH2F *hInvMassPtLSCfromB=new TH2F("hInvMassPtLSCfromB","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
d39e8f99 2976 THnSparseF *hSparseLSCfromB=new THnSparseF("hSparseLSCfromB","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
2977 hSparseLSCfromB->SetBinEdges(0,massbins);
2978 hSparseLSCfromB->SetBinEdges(1,massbins);
2979 hSparseLSCfromB->SetBinEdges(2,ptbinsForNsparse);
2980 hSparseLSCfromB->SetBinEdges(3,impparbins);
2981 hSparseLSCfromB->SetBinEdges(4,massHypoBins);
2982 flistLsCutsFromB->Add(hSparseLSCfromB);
a3b80030 2983
2984
2985 THnSparseF *hSparseRecoLSCfromB=new THnSparseF("hSparseRecoLSCfromB","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
2986 hSparseRecoLSCfromB->SetBinEdges(0,massbins);
2987 hSparseRecoLSCfromB->SetBinEdges(1,massbins);
2988 hSparseRecoLSCfromB->SetBinEdges(2,ptbinsForNsparse);
2989 hSparseRecoLSCfromB->SetBinEdges(3,impparbins);
2990 hSparseRecoLSCfromB->SetBinEdges(4,massHypoBins);
2991 flistLsCutsFromB->Add(hSparseRecoLSCfromB);
2992
2993
e047b348 2994 TH1F *hetaLSCfromB;
2995 TH1F *hCosPDPBLSCfromB;
2996 TH1F *hCosPcPDLSCfromB;
2997 flistLsCutsFromB->Add(hInvMassPtLSCfromB);
2998 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
2999 TH2F *hd0D0VSd0xd0LSCfromBpt;
3000 TH2F *hangletracksVSd0xd0LSCfromBpt;
3001 TH2F *hangletracksVSd0D0LSCfromBpt;
3002 TH1F *hd0xd0LSCfromBpt;
3003
3004
3005 TH2F *hTOFpidLSCfromB=new TH2F("hTOFpidLSCfromB","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
3006 flistLsCutsFromB->Add(hTOFpidLSCfromB);
3007
3008 for(Int_t i=0;i<fnbins;i++){
3009 namehist="hd0zD0ptLSCfromB_pt";
3010 namehist+=i;
3011 titlehist="d0(z) Loose Cuts FromBm ptbin=";
3012 titlehist+=i;
3013 hd0zD0ptLSCfromB=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
3014 hd0zD0ptLSCfromB->SetXTitle("d_{0}(z) [#mum]");
3015 hd0zD0ptLSCfromB->SetYTitle("Entries");
3016 flistLsCutsFromB->Add(hd0zD0ptLSCfromB);
3017
cc3209fb 3018 namehist="hInvMassD0LSCfromB_pt";
e047b348 3019 namehist+=i;
3020 titlehist="Invariant Mass Loose Cuts FromB ptbin=";
3021 titlehist+=i;
cc3209fb 3022 hInvMassD0LSCfromB=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3023 hInvMassD0LSCfromB->SetXTitle("Invariant Mass [GeV]");
3024 hInvMassD0LSCfromB->SetYTitle("Entries");
3025 flistLsCutsFromB->Add(hInvMassD0LSCfromB);
3026
3027 namehist="hInvMassD0barLSCfromB_pt";
3028 namehist+=i;
d39e8f99 3029 titlehist="Invariant Mass D0bar Loose Cuts FromB ptbin=";
cc3209fb 3030 titlehist+=i;
3031 hInvMassD0barLSCfromB=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3032 hInvMassD0barLSCfromB->SetXTitle("Invariant Mass [GeV]");
3033 hInvMassD0barLSCfromB->SetYTitle("Entries");
3034 flistLsCutsFromB->Add(hInvMassD0barLSCfromB);
e047b348 3035
3036 namehist="hetaLSCfromB_pt";
3037 namehist+=i;
3038 titlehist="eta Loose Cuts FromB ptbin=";
3039 titlehist+=i;
3040 hetaLSCfromB=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
3041 hetaLSCfromB->SetXTitle("Pseudorapidity");
3042 hetaLSCfromB->SetYTitle("Entries");
3043 flistLsCutsFromB->Add(hetaLSCfromB);
3044
3045 namehist="hCosPDPBLSCfromB_pt";
3046 namehist+=i;
3047 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
3048 titlehist+=i;
3049 hCosPDPBLSCfromB=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
3050 hCosPDPBLSCfromB->SetXTitle("Cosine between D0 momentum and B momentum");
3051 hCosPDPBLSCfromB->SetYTitle("Entries");
3052 flistLsCutsFromB->Add(hCosPDPBLSCfromB);
3053
3054 namehist="hCosPcPDLSCfromB_pt";
3055 namehist+=i;
3056 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
3057 titlehist+=i;
3058 hCosPcPDLSCfromB=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
3059 hCosPcPDLSCfromB->SetXTitle("Cosine between c quark momentum and D0 momentum");
3060 hCosPcPDLSCfromB->SetYTitle("Entries");
3061 flistLsCutsFromB->Add(hCosPcPDLSCfromB);
3062
3063 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
3064 namehist="hd0xd0LSCfromB_pt";
3065 namehist+=i;
3066 titlehist="d0xd0 Loose Cuts FromB ptbin=";
3067 titlehist+=i;
3068 hd0xd0LSCfromBpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
3069 hd0xd0LSCfromBpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
3070 hd0xd0LSCfromBpt->SetYTitle("Entries");
3071 flistLsCutsFromB->Add(hd0xd0LSCfromBpt);
3072
3073
3074 namehist="hd0D0VSd0xd0LSCfromB_pt";
3075 namehist+=i;
3076 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts FromB ptbin=";
3077 titlehist+=i;
3078 hd0D0VSd0xd0LSCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
3079 hd0D0VSd0xd0LSCfromBpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
3080 hd0D0VSd0xd0LSCfromBpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
3081 flistLsCutsFromB->Add(hd0D0VSd0xd0LSCfromBpt);
3082
3083
3084 namehist="hangletracksVSd0xd0LSCfromB_pt";
3085 namehist+=i;
3086 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts FromB ptbin=";
3087 titlehist+=i;
3088 hangletracksVSd0xd0LSCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
3089 hangletracksVSd0xd0LSCfromBpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
3090 hangletracksVSd0xd0LSCfromBpt->SetYTitle(" angle between K and #p tracks [rad]");
3091 flistLsCutsFromB->Add(hangletracksVSd0xd0LSCfromBpt);
3092
3093
3094 namehist="hangletracksVSd0D0LSCfromB_pt";
3095 namehist+=i;
3096 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Loose Cuts FromB ptbin=";
3097 titlehist+=i;
3098 hangletracksVSd0D0LSCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
3099 hangletracksVSd0D0LSCfromBpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
3100 hangletracksVSd0D0LSCfromBpt->SetYTitle(" angle between K and #p tracks [rad]");
3101 flistLsCutsFromB->Add(hangletracksVSd0D0LSCfromBpt);
3102
3103 }
3104 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
3105 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3106
3107
3108
3109
3110
624c07ab 3111 // ######### d0 D0 histos ##############
ac4c229c 3112 TH1F *hd0D0LSCfromBPM = new TH1F("hd0D0LSCfromBPM","D^{0} impact par. plot , Loose Cuts ,FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
3113 hd0D0LSCfromBPM->SetXTitle("Impact parameter [#mum]");
3114 hd0D0LSCfromBPM->SetYTitle("Entries");
3115
3116 TH1F *hd0D0VtxTrueLSCfromBPM = new TH1F("hd0D0VtxTrueLSCfromBPM","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
3117 hd0D0VtxTrueLSCfromBPM->SetXTitle("Impact parameter [#mum]");
3118 hd0D0VtxTrueLSCfromBPM->SetYTitle("Entries");
3119
3120 TH1F *hMCd0D0LSCfromBPM = new TH1F("hMCd0D0LSCfromBPM","D^{0} impact par. plot, Loose Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
3121 hMCd0D0LSCfromBPM->SetXTitle("MC Impact parameter [#mum]");
3122 hMCd0D0LSCfromBPM->SetYTitle("Entries");
3123
3124 TH1F *hd0D0LSCfromBSB = new TH1F("hd0D0LSCfromBSB","D^{0} impact par. plot , Loose Cuts ,FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
3125 hd0D0LSCfromBSB->SetXTitle("Impact parameter [#mum]");
3126 hd0D0LSCfromBSB->SetYTitle("Entries");
3127
3128 TH1F *hd0D0VtxTrueLSCfromBSB = new TH1F("hd0D0VtxTrueLSCfromBSB","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
3129 hd0D0VtxTrueLSCfromBSB->SetXTitle("Impact parameter [#mum]");
3130 hd0D0VtxTrueLSCfromBSB->SetYTitle("Entries");
3131
3132 TH1F *hMCd0D0LSCfromBSB = new TH1F("hMCd0D0LSCfromBSB","D^{0} impact par. plot, Loose Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
3133 hMCd0D0LSCfromBSB->SetXTitle("MC Impact parameter [#mum]");
3134 hMCd0D0LSCfromBSB->SetYTitle("Entries");
3135
3136 flistLsCutsFromB->Add(hd0D0LSCfromBPM);
3137 flistLsCutsFromB->Add(hd0D0VtxTrueLSCfromBPM);
3138 flistLsCutsFromB->Add(hMCd0D0LSCfromBPM);
3139 flistLsCutsFromB->Add(hd0D0LSCfromBSB);
3140 flistLsCutsFromB->Add(hd0D0VtxTrueLSCfromBSB);
3141 flistLsCutsFromB->Add(hMCd0D0LSCfromBSB);
3142
e047b348 3143 TH1F *hd0D0ptLSCfromBPM;
3144 TH1F *hMCd0D0ptLSCfromBPM;
3145 TH1F *hd0D0VtxTrueptLSCfromBPM;
3146 TH1F *hd0D0ptLSCfromBSB;
3147 TH1F *hMCd0D0ptLSCfromBSB;
3148 TH1F *hd0D0VtxTrueptLSCfromBSB;
ac4c229c 3149 namehist="hd0D0ptLSCfromB_";
624c07ab 3150 titlehist="D^{0} impact par. plot, Loose Cuts, FromB, ";
3151 for(Int_t i=0;i<fnbins;i++){
3152 strnamept=namehist;
3153 strnamept.Append("PkMss_pt");
3154 strnamept+=i;
3155
3156 strtitlept=titlehist;
3157 strtitlept.Append(" Mass Peak, ");
3158 strtitlept+=fptbins[i];
3159 strtitlept.Append("<= pt <");
3160 strtitlept+=fptbins[i+1];
3161 strtitlept.Append(" [GeV/c]");
3162
e047b348 3163 hd0D0ptLSCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3164 hd0D0ptLSCfromBPM->SetXTitle("Impact parameter [#mum] ");
3165 hd0D0ptLSCfromBPM->SetYTitle("Entries");
3166 flistLsCutsFromB->Add(hd0D0ptLSCfromBPM);
624c07ab 3167
3168 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 3169 hMCd0D0ptLSCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3170 hMCd0D0ptLSCfromBPM->SetXTitle("MC Impact parameter [#mum] ");
3171 hMCd0D0ptLSCfromBPM->SetYTitle("Entries");
3172 flistLsCutsFromB->Add(hMCd0D0ptLSCfromBPM);
624c07ab 3173
3174
3175 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 3176 hd0D0VtxTrueptLSCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3177 hd0D0VtxTrueptLSCfromBPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
3178 hd0D0VtxTrueptLSCfromBPM->SetYTitle("Entries");
3179 flistLsCutsFromB->Add(hd0D0VtxTrueptLSCfromBPM);
624c07ab 3180
3181 strnamept=namehist;
3182 strnamept.Append("SBMss_pt");
3183 strnamept+=i;
3184
3185 strtitlept=titlehist;
3186 strtitlept.Append(" Side Bands, ");
3187 strtitlept+=fptbins[i];
3188 strtitlept.Append("<= pt <");
3189 strtitlept+=fptbins[i+1];
3190 strtitlept.Append(" [GeV/c]");
3191
e047b348 3192 hd0D0ptLSCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3193 hd0D0ptLSCfromBSB->SetXTitle("Impact parameter [#mum] ");
3194 hd0D0ptLSCfromBSB->SetYTitle("Entries");
3195 flistLsCutsFromB->Add(hd0D0ptLSCfromBSB);
624c07ab 3196
3197 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 3198 hMCd0D0ptLSCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3199 hMCd0D0ptLSCfromBSB->SetXTitle("MC Impact parameter [#mum] ");
3200 hMCd0D0ptLSCfromBSB->SetYTitle("Entries");
3201 flistLsCutsFromB->Add(hMCd0D0ptLSCfromBSB);
624c07ab 3202
3203 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 3204 hd0D0VtxTrueptLSCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3205 hd0D0VtxTrueptLSCfromBSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
3206 hd0D0VtxTrueptLSCfromBSB->SetYTitle("Entries");
3207 flistLsCutsFromB->Add(hd0D0VtxTrueptLSCfromBSB);
624c07ab 3208 }
3209
3210
3211
3212 //############ LOOSE CUTS FROM DSTAR HISTOGRAMS ###########
3213 //
3214 //############## global properties histos
e047b348 3215 TH2F *hCPtaVSd0d0LSCfromDstar=new TH2F("hCPtaVSd0d0LSCfromDstar","hCPtaVSd0d0_LooseCuts_FromDStar",1000,-100000.,100000.,100,-1.,1.);
ac4c229c 3216 TH1F *hSecVtxZLSCfromDstar=new TH1F("hSecVtxZLSCfromDstar","hSecVtxZ_LooseCuts_FromDStar",1000,-8.,8.);
3217 TH1F *hSecVtxXLSCfromDstar=new TH1F("hSecVtxXLSCfromDstar","hSecVtxX_LooseCuts_FromDStar",1000,-3000.,3000.);
3218 TH1F *hSecVtxYLSCfromDstar=new TH1F("hSecVtxYLSCfromDstar","hSecVtxY_LooseCuts_FromDStar",1000,-3000.,3000.);
3219 TH2F *hSecVtxXYLSCfromDstar=new TH2F("hSecVtxXYLSCfromDstar","hSecVtxXY_LooseCuts_FromDStar",1000,-3000.,3000.,1000,-3000.,3000.);
3220 TH1F *hSecVtxPhiLSCfromDstar=new TH1F("hSecVtxPhiLSCfromDstar","hSecVtxPhi_LooseCuts_FromDStar",180,-180.1,180.1);
e047b348 3221 TH1F *hd0singlTrackLSCfromDstar=new TH1F("hd0singlTrackLSCfromDstar","hd0singlTrackLooseCuts_FromDstar",1000,-5000.,5000.);
3222 TH1F *hCPtaLSCfromDstar=new TH1F("hCPtaLSCfromDstar","hCPta_LooseCuts_FromDStar",100,-1.,1.);
ac4c229c 3223 TH1F *hd0xd0LSCfromDstar=new TH1F("hd0xd0LSCfromDstar","hd0xd0_LooseCuts_FromDStar",1000,-100000.,100000.);
3224 TH1F *hMassTrueLSCfromDstar=new TH1F("hMassTrueLSCfromDstar","D^{0} MC inv. Mass Loose Cuts FromDStar(All momenta)",600,1.600,2.200);
3225 TH1F *hMassLSCfromDstar=new TH1F("hMassLSCfromDstar","D^{0} inv. Mass Loose Cuts FromDStar (All momenta)",600,1.600,2.200);
3226 hMassLSCfromDstar->Sumw2();
3227 TH1F *hMassTrueLSCfromDstarPM=new TH1F("hMassTrueLSCfromDstarPM","D^{0} MC inv. Mass Loose Cuts FromDStar, Mass Peak. (All momenta)",600,1.600,2.200);
3228 TH1F *hMassLSCfromDstarPM=new TH1F("hMassLSCfromDstarPM","D^{0} inv. Mass Loose Cuts FromDStar (All momenta), MassPeak",600,1.600,2.200);
3229 hMassLSCfromDstarPM->Sumw2();
3230 TH1F *hMassTrueLSCfromDstarSB=new TH1F("hMassTrueLSCfromDstarSB","D^{0} MC inv. Mass in Side Bands Loose Cuts FromDStar(All momenta)",600,1.600,2.200);
3231 TH1F *hMassLSCfromDstarSB=new TH1F("hMassLSCfromDstarSB","D^{0} inv. Mass in Side Bands Loose Cuts FromDStar (All momenta)",600,1.600,2.200);
3232 hMassLSCfromDstarSB->Sumw2();
3233
3234 flistLsCutsFromDstar->Add(hCPtaVSd0d0LSCfromDstar);
3235 flistLsCutsFromDstar->Add(hSecVtxZLSCfromDstar);
3236 flistLsCutsFromDstar->Add(hSecVtxYLSCfromDstar);
3237 flistLsCutsFromDstar->Add(hSecVtxXLSCfromDstar);
3238 flistLsCutsFromDstar->Add(hSecVtxXYLSCfromDstar);
3239 flistLsCutsFromDstar->Add(hSecVtxPhiLSCfromDstar);
e047b348 3240 flistLsCutsFromDstar->Add(hd0singlTrackLSCfromDstar);
ac4c229c 3241 flistLsCutsFromDstar->Add(hCPtaLSCfromDstar);
3242 flistLsCutsFromDstar->Add(hd0xd0LSCfromDstar);
3243 flistLsCutsFromDstar->Add(hMassTrueLSCfromDstar);
3244 flistLsCutsFromDstar->Add(hMassLSCfromDstar);
e047b348 3245 flistLsCutsFromDstar->Add(hMassTrueLSCfromDstarPM);
ac4c229c 3246 flistLsCutsFromDstar->Add(hMassLSCfromDstarPM);
3247 flistLsCutsFromDstar->Add(hMassTrueLSCfromDstarSB);
3248 flistLsCutsFromDstar->Add(hMassLSCfromDstarSB);
624c07ab 3249
e047b348 3250
3251
3252
3253
3254
3255
3256 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
3257 TH1F *hdcaLSCfromDstar=new TH1F("hdcaLSCfromDstar","hdca_LooseCuts_FromDstar",100,0.,1000.);
3258 hdcaLSCfromDstar->SetXTitle("dca [#mum]");
3259 hdcaLSCfromDstar->SetYTitle("Entries");
3260 TH1F *hcosthetastarLSCfromDstar=new TH1F("hcosthetastarLSCfromDstar","hCosThetaStar_LooseCuts_FromDstar",50,-1.,1.);
3261 hcosthetastarLSCfromDstar->SetXTitle("cos #theta^{*}");
3262 hcosthetastarLSCfromDstar->SetYTitle("Entries");
3263 TH1F *hptD0LSCfromDstar=new TH1F("hptD0LSCfromDstar","D^{0} transverse momentum distribution",34,ptbinsD0arr);
3264 hptD0LSCfromDstar->SetXTitle("p_{t} [GeV/c]");
3265 hptD0LSCfromDstar->SetYTitle("Entries");
3266 TH1F *hptD0VsMaxPtLSCfromDstar=new TH1F("hptD0VsMaxPtLSCfromDstar","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
3267 TH2F *hptD0PTallsqrtLSCfromDstar=new TH2F("hptD0PTallsqrtLSCfromDstar","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
3268 TH2F *hptD0PTallLSCfromDstar=new TH2F("hptD0PTallLSCfromDstar","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
3269 TH2F *hptD0vsptBLSCfromDstar=new TH2F("hptD0vsptBLSCfromDstar","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3270 TH2F *hpD0vspBLSCfromDstar=new TH2F("hpD0vspBLSCfromDstar","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3271 TH2F *hptD0vsptcquarkLSCfromDstar=new TH2F("hptD0vsptcquarkLSCfromDstar","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3272 TH2F *hpD0vspcquarkLSCfromDstar=new TH2F("hpD0vspcquarkLSCfromDstar","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3273 flistLsCutsFromDstar->Add(hdcaLSCfromDstar);
3274 flistLsCutsFromDstar->Add(hcosthetastarLSCfromDstar);
3275 flistLsCutsFromDstar->Add(hptD0LSCfromDstar);
3276 flistLsCutsFromDstar->Add(hptD0VsMaxPtLSCfromDstar);
3277 flistLsCutsFromDstar->Add(hptD0PTallsqrtLSCfromDstar);
3278 flistLsCutsFromDstar->Add(hptD0PTallLSCfromDstar);
3279 flistLsCutsFromDstar->Add(hptD0vsptBLSCfromDstar);
3280 flistLsCutsFromDstar->Add(hpD0vspBLSCfromDstar);
3281 flistLsCutsFromDstar->Add(hptD0vsptcquarkLSCfromDstar);
3282 flistLsCutsFromDstar->Add(hpD0vspcquarkLSCfromDstar);
3283
3284 TH1F *hd0zD0ptLSCfromDstar;
cc3209fb 3285 TH1F *hInvMassD0LSCfromDstar,*hInvMassD0barLSCfromDstar;
e047b348 3286 TH2F *hInvMassPtLSCfromDstar=new TH2F("hInvMassPtLSCfromDstar","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
d39e8f99 3287 THnSparseF *hSparseLSCfromDstar=new THnSparseF("hSparseLSCfromDstar","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
3288 hSparseLSCfromDstar->SetBinEdges(0,massbins);
3289 hSparseLSCfromDstar->SetBinEdges(1,massbins);
3290 hSparseLSCfromDstar->SetBinEdges(2,ptbinsForNsparse);
3291 hSparseLSCfromDstar->SetBinEdges(3,impparbins);
3292 hSparseLSCfromDstar->SetBinEdges(4,massHypoBins);
3293 flistLsCutsFromDstar->Add(hSparseLSCfromDstar);
e047b348 3294 TH1F *hetaLSCfromDstar;
3295 TH1F *hCosPDPBLSCfromDstar;
3296 TH1F *hCosPcPDLSCfromDstar;
3297 flistLsCutsFromDstar->Add(hInvMassPtLSCfromDstar);
3298 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
3299 TH2F *hd0D0VSd0xd0LSCfromDstarpt;
3300 TH2F *hangletracksVSd0xd0LSCfromDstarpt;
3301 TH2F *hangletracksVSd0D0LSCfromDstarpt;
3302 TH1F *hd0xd0LSCfromDstarpt;
3303
3304 TH2F *hTOFpidLSCfromDstar=new TH2F("hTOFpidLSCfromDstar","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
3305 flistLsCutsFromDstar->Add(hTOFpidLSCfromDstar);
3306
3307 for(Int_t i=0;i<fnbins;i++){
3308 namehist="hd0zD0ptLSCfromDstar_pt";
3309 namehist+=i;
3310 titlehist="d0(z) Loose Cuts FromDstarm ptbin=";
3311 titlehist+=i;
3312 hd0zD0ptLSCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
3313 hd0zD0ptLSCfromDstar->SetXTitle("d_{0}(z) [#mum]");
3314 hd0zD0ptLSCfromDstar->SetYTitle("Entries");
3315 flistLsCutsFromDstar->Add(hd0zD0ptLSCfromDstar);
3316
cc3209fb 3317 namehist="hInvMassD0LSCfromDstar_pt";
e047b348 3318 namehist+=i;
3319 titlehist="Invariant Mass Loose Cuts FromDstar ptbin=";
3320 titlehist+=i;
cc3209fb 3321 hInvMassD0LSCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3322 hInvMassD0LSCfromDstar->SetXTitle("Invariant Mass [GeV]");
3323 hInvMassD0LSCfromDstar->SetYTitle("Entries");
3324 flistLsCutsFromDstar->Add(hInvMassD0LSCfromDstar);
3325
3326 namehist="hInvMassD0barLSCfromDstar_pt";
3327 namehist+=i;
d39e8f99 3328 titlehist="Invariant Mass D0bar Loose Cuts FromDstar ptbin=";
cc3209fb 3329 titlehist+=i;
3330 hInvMassD0barLSCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3331 hInvMassD0barLSCfromDstar->SetXTitle("Invariant Mass [GeV]");
3332 hInvMassD0barLSCfromDstar->SetYTitle("Entries");
3333 flistLsCutsFromDstar->Add(hInvMassD0barLSCfromDstar);
e047b348 3334
3335 namehist="hetaLSCfromDstar_pt";
3336 namehist+=i;
3337 titlehist="eta Loose Cuts FromDstar ptbin=";
3338 titlehist+=i;
3339 hetaLSCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
3340 hetaLSCfromDstar->SetXTitle("Pseudorapidity");
3341 hetaLSCfromDstar->SetYTitle("Entries");
3342 flistLsCutsFromDstar->Add(hetaLSCfromDstar);
3343
3344 namehist="hCosPDPBLSCfromDstar_pt";
3345 namehist+=i;
3346 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
3347 titlehist+=i;
3348 hCosPDPBLSCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
3349 hCosPDPBLSCfromDstar->SetXTitle("Cosine between D0 momentum and B momentum");
3350 hCosPDPBLSCfromDstar->SetYTitle("Entries");
3351 flistLsCutsFromDstar->Add(hCosPDPBLSCfromDstar);
3352
3353 namehist="hCosPcPDLSCfromDstar_pt";
3354 namehist+=i;
3355 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
3356 titlehist+=i;
3357 hCosPcPDLSCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
3358 hCosPcPDLSCfromDstar->SetXTitle("Cosine between c quark momentum and D0 momentum");
3359 hCosPcPDLSCfromDstar->SetYTitle("Entries");
3360 flistLsCutsFromDstar->Add(hCosPcPDLSCfromDstar);
3361
3362 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
3363 namehist="hd0xd0LSCfromDstar_pt";
3364 namehist+=i;
3365 titlehist="d0xd0 Loose Cuts FromDstar ptbin=";
3366 titlehist+=i;
3367 hd0xd0LSCfromDstarpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
3368 hd0xd0LSCfromDstarpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
3369 hd0xd0LSCfromDstarpt->SetYTitle("Entries");
3370 flistLsCutsFromDstar->Add(hd0xd0LSCfromDstarpt);
3371
3372
3373 namehist="hd0D0VSd0xd0LSCfromDstar_pt";
3374 namehist+=i;
3375 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts FromDstar ptbin=";
3376 titlehist+=i;
3377 hd0D0VSd0xd0LSCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
3378 hd0D0VSd0xd0LSCfromDstarpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
3379 hd0D0VSd0xd0LSCfromDstarpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
3380 flistLsCutsFromDstar->Add(hd0D0VSd0xd0LSCfromDstarpt);
3381
3382
3383 namehist="hangletracksVSd0xd0LSCfromDstar_pt";
3384 namehist+=i;
3385 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts FromDstar ptbin=";
3386 titlehist+=i;
3387 hangletracksVSd0xd0LSCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
3388 hangletracksVSd0xd0LSCfromDstarpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
3389 hangletracksVSd0xd0LSCfromDstarpt->SetYTitle(" angle between K and #p tracks [rad]");
3390 flistLsCutsFromDstar->Add(hangletracksVSd0xd0LSCfromDstarpt);
3391
3392
3393 namehist="hangletracksVSd0D0LSCfromDstar_pt";
3394 namehist+=i;
3395 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Loose Cuts FromDstar ptbin=";
3396 titlehist+=i;
3397 hangletracksVSd0D0LSCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
3398 hangletracksVSd0D0LSCfromDstarpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
3399 hangletracksVSd0D0LSCfromDstarpt->SetYTitle(" angle between K and #p tracks [rad]");
3400 flistLsCutsFromDstar->Add(hangletracksVSd0D0LSCfromDstarpt);
3401
3402
3403 }
3404 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
3405 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3406
3407
3408
3409
3410
3411
624c07ab 3412 //########## d0 D0 histos #############
ac4c229c 3413 TH1F *hd0D0LSCfromDstPM = new TH1F("hd0D0LSCfromDstarPM","D^{0} impact par. plot , Loose Cuts ,FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
3414 hd0D0LSCfromDstPM->SetXTitle("Impact parameter [#mum]");
3415 hd0D0LSCfromDstPM->SetYTitle("Entries");
3416
3417 TH1F *hd0D0VtxTrueLSCfromDstPM = new TH1F("hd0D0VtxTrueLSCfromDstarPM","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
3418 hd0D0VtxTrueLSCfromDstPM->SetXTitle("Impact parameter [#mum]");
3419 hd0D0VtxTrueLSCfromDstPM->SetYTitle("Entries");
3420
3421 TH1F *hMCd0D0LSCfromDstPM = new TH1F("hMCd0D0LSCfromDstarPM","D^{0} impact par. plot, Loose Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
3422 hMCd0D0LSCfromDstPM->SetXTitle("MC Impact parameter [#mum]");
3423 hMCd0D0LSCfromDstPM->SetYTitle("Entries");
3424
3425 TH1F *hd0D0LSCfromDstSB = new TH1F("hd0D0LSCfromDstarSB","D^{0} impact par. plot , Loose Cuts ,FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
3426 hd0D0LSCfromDstSB->SetXTitle("Impact parameter [#mum]");
3427 hd0D0LSCfromDstSB->SetYTitle("Entries");
3428
3429 TH1F *hd0D0VtxTrueLSCfromDstSB = new TH1F("hd0D0VtxTrueLSCfromDstarSB","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
3430 hd0D0VtxTrueLSCfromDstSB->SetXTitle("Impact parameter [#mum]");
3431 hd0D0VtxTrueLSCfromDstSB->SetYTitle("Entries");
3432
3433 TH1F *hMCd0D0LSCfromDstSB = new TH1F("hMCd0D0LSCfromDstarSB","D^{0} impact par. plot, Loose Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
3434 hMCd0D0LSCfromDstSB->SetXTitle("MC Impact parameter [#mum]");
3435 hMCd0D0LSCfromDstSB->SetYTitle("Entries");
3436
3437 flistLsCutsFromDstar->Add(hd0D0LSCfromDstPM);
3438 flistLsCutsFromDstar->Add(hd0D0VtxTrueLSCfromDstPM);
3439 flistLsCutsFromDstar->Add(hMCd0D0LSCfromDstPM);
3440 flistLsCutsFromDstar->Add(hd0D0LSCfromDstSB);
3441 flistLsCutsFromDstar->Add(hd0D0VtxTrueLSCfromDstSB);
3442 flistLsCutsFromDstar->Add(hMCd0D0LSCfromDstSB);
3443
e047b348 3444 TH1F *hd0D0ptLSCfromDstPM;
3445 TH1F *hMCd0D0ptLSCfromDstPM;
3446 TH1F *hd0D0VtxTrueptLSCfromDstPM;
3447 TH1F *hd0D0ptLSCfromDstSB;
3448 TH1F *hMCd0D0ptLSCfromDstSB;
3449 TH1F *hd0D0VtxTrueptLSCfromDstSB;
ac4c229c 3450 namehist="hd0D0ptLSCfromDstar_";
624c07ab 3451 titlehist="D^{0} impact par. plot, Loose Cuts, FromDStar, ";
3452 for(Int_t i=0;i<fnbins;i++){
3453 strnamept=namehist;
3454 strnamept.Append("PkMss_pt");
3455 strnamept+=i;
3456
3457 strtitlept=titlehist;
3458 strtitlept.Append(" Mass Peak, ");
3459 strtitlept+=fptbins[i];
3460 strtitlept.Append("<= pt <");
3461 strtitlept+=fptbins[i+1];
3462 strtitlept.Append(" [GeV/c]");
3463
e047b348 3464 hd0D0ptLSCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3465 hd0D0ptLSCfromDstPM->SetXTitle("Impact parameter [#mum] ");
3466 hd0D0ptLSCfromDstPM->SetYTitle("Entries");
3467 flistLsCutsFromDstar->Add(hd0D0ptLSCfromDstPM);
624c07ab 3468
3469 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 3470 hMCd0D0ptLSCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3471 hMCd0D0ptLSCfromDstPM->SetXTitle("MC Impact parameter [#mum] ");
3472 hMCd0D0ptLSCfromDstPM->SetYTitle("Entries");
3473 flistLsCutsFromDstar->Add(hMCd0D0ptLSCfromDstPM);
624c07ab 3474
3475
3476 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 3477 hd0D0VtxTrueptLSCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3478 hd0D0VtxTrueptLSCfromDstPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
3479 hd0D0VtxTrueptLSCfromDstPM->SetYTitle("Entries");
3480 flistLsCutsFromDstar->Add(hd0D0VtxTrueptLSCfromDstPM);
624c07ab 3481
3482 strnamept=namehist;
3483 strnamept.Append("SBMss_pt");
3484 strnamept+=i;
3485
3486 strtitlept=titlehist;
3487 strtitlept.Append(" Side Bands, ");
3488 strtitlept+=fptbins[i];
3489 strtitlept.Append("<= pt <");
3490 strtitlept+=fptbins[i+1];
3491 strtitlept.Append(" [GeV/c]");
3492
e047b348 3493 hd0D0ptLSCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3494 hd0D0ptLSCfromDstSB->SetXTitle("Impact parameter [#mum] ");
3495 hd0D0ptLSCfromDstSB->SetYTitle("Entries");
3496 flistLsCutsFromDstar->Add(hd0D0ptLSCfromDstSB);
624c07ab 3497
3498 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 3499 hMCd0D0ptLSCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3500 hMCd0D0ptLSCfromDstSB->SetXTitle("MC Impact parameter [#mum] ");
3501 hMCd0D0ptLSCfromDstSB->SetYTitle("Entries");
3502 flistLsCutsFromDstar->Add(hMCd0D0ptLSCfromDstSB);
624c07ab 3503
3504 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 3505 hd0D0VtxTrueptLSCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3506 hd0D0VtxTrueptLSCfromDstSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
3507 hd0D0VtxTrueptLSCfromDstSB->SetYTitle("Entries");
3508 flistLsCutsFromDstar->Add(hd0D0VtxTrueptLSCfromDstSB);
624c07ab 3509 }
3510
3511
3512 //############ LOOSE CUTS OTHER HISTOGRAMS ###########
3513 //
3514 //########### global properties histos ###########
3515
e047b348 3516 TH2F *hCPtaVSd0d0LSCother=new TH2F("hCPtaVSd0d0LSCother","hCPtaVSd0d0_LooseCuts_other",1000,-100000.,100000.,100,-1.,1.);
ac4c229c 3517 TH1F *hSecVtxZLSCother=new TH1F("hSecVtxZLSCother","hSecVtxZ_LooseCuts_other",1000,-8.,8.);
3518 TH1F *hSecVtxXLSCother=new TH1F("hSecVtxXLSCother","hSecVtxX_LooseCuts_other",1000,-3000.,3000.);
3519 TH1F *hSecVtxYLSCother=new TH1F("hSecVtxYLSCother","hSecVtxY_LooseCuts_other",1000,-3000.,3000.);
3520 TH2F *hSecVtxXYLSCother=new TH2F("hSecVtxXYLSCother","hSecVtxXY_LooseCuts_other",1000,-3000.,3000.,1000,-3000.,3000.);
3521 TH1F *hSecVtxPhiLSCother=new TH1F("hSecVtxPhiLSCother","hSecVtxPhi_LooseCuts_other",180,-180.1,180.1);
e047b348 3522 TH1F *hd0singlTrackLSCother=new TH1F("hd0singlTrackLSCother","hd0singlTrackLooseCuts_Other",1000,-5000.,5000.);
3523 TH1F *hCPtaLSCother=new TH1F("hCPtaLSCother","hCPta_LooseCuts_other",100,-1.,1.);
ac4c229c 3524 TH1F *hd0xd0LSCother=new TH1F("hd0xd0LSCother","hd0xd0_LooseCuts_other",1000,-100000.,100000.);
3525 TH1F *hMassTrueLSCother=new TH1F("hMassTrueLSCother","D^{0} MC inv. Mass Loose Cuts other(All momenta)",600,1.600,2.200);
3526 TH1F *hMassLSCother=new TH1F("hMassLSCother","D^{0} inv. Mass Loose Cuts other (All momenta)",600,1.600,2.200);
3527 hMassLSCother->Sumw2();
3528 TH1F *hMassTrueLSCotherPM=new TH1F("hMassTrueLSCotherPM","D^{0} MC inv. Mass Loose Cuts other, Mass Peak. (All momenta)",600,1.600,2.200);
3529 TH1F *hMassLSCotherPM=new TH1F("hMassLSCotherPM","D^{0} inv. Mass Loose Cuts other (All momenta), MassPeak",600,1.600,2.200);
3530 hMassLSCotherPM->Sumw2();
3531 TH1F *hMassTrueLSCotherSB=new TH1F("hMassTrueLSCotherSB","D^{0} MC inv. Mass in Side Bands Loose Cuts other(All momenta)",600,1.600,2.200);
3532 TH1F *hMassLSCotherSB=new TH1F("hMassLSCotherSB","D^{0} inv. Mass in Side Bands Loose Cuts other (All momenta)",600,1.600,2.200);
3533 hMassLSCotherSB->Sumw2();
3534
3535 flistLsCutsOther->Add(hCPtaVSd0d0LSCother);
3536 flistLsCutsOther->Add(hSecVtxZLSCother);
3537 flistLsCutsOther->Add(hSecVtxYLSCother);
3538 flistLsCutsOther->Add(hSecVtxXLSCother);
3539 flistLsCutsOther->Add(hSecVtxXYLSCother);
3540 flistLsCutsOther->Add(hSecVtxPhiLSCother);
e047b348 3541 flistLsCutsOther->Add(hd0singlTrackLSCother);
ac4c229c 3542 flistLsCutsOther->Add(hCPtaLSCother);
3543 flistLsCutsOther->Add(hd0xd0LSCother);
3544 flistLsCutsOther->Add(hMassTrueLSCother);
3545 flistLsCutsOther->Add(hMassLSCother);
3546 flistLsCutsOther->Add(hMassTrueLSCotherPM);
3547 flistLsCutsOther->Add(hMassLSCotherPM);
3548 flistLsCutsOther->Add(hMassTrueLSCotherSB);
3549 flistLsCutsOther->Add(hMassLSCotherSB);
624c07ab 3550
e047b348 3551
3552
3553
3554 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
3555 TH1F *hdcaLSCother=new TH1F("hdcaLSCother","hdca_LooseCuts_Other",100,0.,1000.);
3556 hdcaLSCother->SetXTitle("dca [#mum]");
3557 hdcaLSCother->SetYTitle("Entries");
3558 TH1F *hcosthetastarLSCother=new TH1F("hcosthetastarLSCother","hCosThetaStar_LooseCuts_Other",50,-1.,1.);
3559 hcosthetastarLSCother->SetXTitle("cos #theta^{*}");
3560 hcosthetastarLSCother->SetYTitle("Entries");
3561 TH1F *hptD0LSCother=new TH1F("hptD0LSCother","D^{0} transverse momentum distribution",34,ptbinsD0arr);
3562 hptD0LSCother->SetXTitle("p_{t} [GeV/c]");
3563 hptD0LSCother->SetYTitle("Entries");
3564 TH1F *hptD0VsMaxPtLSCother=new TH1F("hptD0VsMaxPtLSCother","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
3565 TH2F *hptD0PTallsqrtLSCother=new TH2F("hptD0PTallsqrtLSCother","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
3566 TH2F *hptD0PTallLSCother=new TH2F("hptD0PTallLSCother","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
3567 TH2F *hptD0vsptBLSCother=new TH2F("hptD0vsptBLSCother","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3568 TH2F *hpD0vspBLSCother=new TH2F("hpD0vspBLSCother","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3569 TH2F *hptD0vsptcquarkLSCother=new TH2F("hptD0vsptcquarkLSCother","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3570 TH2F *hpD0vspcquarkLSCother=new TH2F("hpD0vspcquarkLSCother","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3571 flistLsCutsOther->Add(hdcaLSCother);
3572 flistLsCutsOther->Add(hcosthetastarLSCother);
3573 flistLsCutsOther->Add(hptD0LSCother);
3574 flistLsCutsOther->Add(hptD0VsMaxPtLSCother);
3575 flistLsCutsOther->Add(hptD0PTallsqrtLSCother);
3576 flistLsCutsOther->Add(hptD0PTallLSCother);
3577 flistLsCutsOther->Add(hptD0vsptBLSCother);
3578 flistLsCutsOther->Add(hpD0vspBLSCother);
3579 flistLsCutsOther->Add(hptD0vsptcquarkLSCother);
3580 flistLsCutsOther->Add(hpD0vspcquarkLSCother);
3581
3582 TH1F *hd0zD0ptLSCother;
cc3209fb 3583 TH1F *hInvMassD0LSCother,*hInvMassD0barLSCother;
e047b348 3584 TH2F *hInvMassPtLSCother=new TH2F("hInvMassPtLSCother","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
d39e8f99 3585 THnSparseF *hSparseLSCother=new THnSparseF("hSparseLSCother","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
3586 hSparseLSCother->SetBinEdges(0,massbins);
3587 hSparseLSCother->SetBinEdges(1,massbins);
3588 hSparseLSCother->SetBinEdges(2,ptbinsForNsparse);
3589 hSparseLSCother->SetBinEdges(3,impparbins);
3590 hSparseLSCother->SetBinEdges(4,massHypoBins);
3591 flistLsCutsOther->Add(hSparseLSCother);
e047b348 3592 TH1F *hetaLSCother;
3593 TH1F *hCosPDPBLSCother;
3594 TH1F *hCosPcPDLSCother;
3595 flistLsCutsOther->Add(hInvMassPtLSCother);
3596 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
3597 TH2F *hd0D0VSd0xd0LSCotherpt;
3598 TH2F *hangletracksVSd0xd0LSCotherpt;
3599 TH2F *hangletracksVSd0D0LSCotherpt;
3600 TH1F *hd0xd0LSCotherpt;
3601
3602 TH2F *hTOFpidLSCother=new TH2F("hTOFpidLSCother","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
3603 flistLsCutsOther->Add(hTOFpidLSCother);
3604
3605 for(Int_t i=0;i<fnbins;i++){
3606 namehist="hd0zD0ptLSCother_pt";
3607 namehist+=i;
3608 titlehist="d0(z) Loose Cuts Otherm ptbin=";
3609 titlehist+=i;
3610 hd0zD0ptLSCother=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
3611 hd0zD0ptLSCother->SetXTitle("d_{0}(z) [#mum]");
3612 hd0zD0ptLSCother->SetYTitle("Entries");
3613 flistLsCutsOther->Add(hd0zD0ptLSCother);
3614
cc3209fb 3615 namehist="hInvMassD0LSCother_pt";
e047b348 3616 namehist+=i;
3617 titlehist="Invariant Mass Loose Cuts Other ptbin=";
3618 titlehist+=i;
cc3209fb 3619 hInvMassD0LSCother=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3620 hInvMassD0LSCother->SetXTitle("Invariant Mass [GeV]");
3621 hInvMassD0LSCother->SetYTitle("Entries");
3622 flistLsCutsOther->Add(hInvMassD0LSCother);
3623
3624 namehist="hInvMassD0barLSCother_pt";
3625 namehist+=i;
d39e8f99 3626 titlehist="Invariant Mass D0bar Loose Cuts Other ptbin=";
cc3209fb 3627 titlehist+=i;
3628 hInvMassD0barLSCother=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3629 hInvMassD0barLSCother->SetXTitle("Invariant Mass [GeV]");
3630 hInvMassD0barLSCother->SetYTitle("Entries");
3631 flistLsCutsOther->Add(hInvMassD0barLSCother);
e047b348 3632
3633 namehist="hetaLSCother_pt";
3634 namehist+=i;
3635 titlehist="eta Loose Cuts Other ptbin=";
3636 titlehist+=i;
3637 hetaLSCother=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
3638 hetaLSCother->SetXTitle("Pseudorapidity");
3639 hetaLSCother->SetYTitle("Entries");
3640 flistLsCutsOther->Add(hetaLSCother);
3641
3642 namehist="hCosPDPBLSCother_pt";
3643 namehist+=i;
3644 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
3645 titlehist+=i;
3646 hCosPDPBLSCother=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
3647 hCosPDPBLSCother->SetXTitle("Cosine between D0 momentum and B momentum");
3648 hCosPDPBLSCother->SetYTitle("Entries");
3649 flistLsCutsOther->Add(hCosPDPBLSCother);
3650
3651 namehist="hCosPcPDLSCother_pt";
3652 namehist+=i;
3653 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
3654 titlehist+=i;
3655 hCosPcPDLSCother=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
3656 hCosPcPDLSCother->SetXTitle("Cosine between c quark momentum and D0 momentum");
3657 hCosPcPDLSCother->SetYTitle("Entries");
3658 flistLsCutsOther->Add(hCosPcPDLSCother);
3659
3660 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
3661 namehist="hd0xd0LSCother_pt";
3662 namehist+=i;
3663 titlehist="d0xd0 Loose Cuts Other ptbin=";
3664 titlehist+=i;
3665 hd0xd0LSCotherpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
3666 hd0xd0LSCotherpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
3667 hd0xd0LSCotherpt->SetYTitle("Entries");
3668 flistLsCutsOther->Add(hd0xd0LSCotherpt);
3669
3670
3671 namehist="hd0D0VSd0xd0LSCother_pt";
3672 namehist+=i;
3673 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts Other ptbin=";
3674 titlehist+=i;
3675 hd0D0VSd0xd0LSCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
3676 hd0D0VSd0xd0LSCotherpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
3677 hd0D0VSd0xd0LSCotherpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
3678 flistLsCutsOther->Add(hd0D0VSd0xd0LSCotherpt);
3679
3680
3681 namehist="hangletracksVSd0xd0LSCother_pt";
3682 namehist+=i;
3683 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Loose Cuts Other ptbin=";
3684 titlehist+=i;
3685 hangletracksVSd0xd0LSCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
3686 hangletracksVSd0xd0LSCotherpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
3687 hangletracksVSd0xd0LSCotherpt->SetYTitle(" angle between K and #p tracks [rad]");
3688 flistLsCutsOther->Add(hangletracksVSd0xd0LSCotherpt);
3689
3690
3691 namehist="hangletracksVSd0D0LSCother_pt";
3692 namehist+=i;
3693 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Loose Cuts Other ptbin=";
3694 titlehist+=i;
3695 hangletracksVSd0D0LSCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
3696 hangletracksVSd0D0LSCotherpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
3697 hangletracksVSd0D0LSCotherpt->SetYTitle(" angle between K and #p tracks [rad]");
3698 flistLsCutsOther->Add(hangletracksVSd0D0LSCotherpt);
3699
3700
3701 }
3702 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
3703 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3704
3705
3706
624c07ab 3707 //############# d0 D0 histos ###############à
ac4c229c 3708 TH1F *hd0D0LSCotherPM = new TH1F("hd0D0LSCotherPM","D^{0} impact par. plot , Loose Cuts ,Other,Mass Peak (All momenta)",1000,-1000.,1000.);
3709 hd0D0LSCotherPM->SetXTitle("Impact parameter [#mum]");
3710 hd0D0LSCotherPM->SetYTitle("Entries");
3711
3712 TH1F *hd0D0VtxTrueLSCotherPM = new TH1F("hd0D0VtxTrueLSCotherPM","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
3713 hd0D0VtxTrueLSCotherPM->SetXTitle("Impact parameter [#mum]");
3714 hd0D0VtxTrueLSCotherPM->SetYTitle("Entries");
3715
3716 TH1F *hMCd0D0LSCotherPM = new TH1F("hMCd0D0LSCotherPM","D^{0} impact par. plot, Loose Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
3717 hMCd0D0LSCotherPM->SetXTitle("MC Impact parameter [#mum]");
3718 hMCd0D0LSCotherPM->SetYTitle("Entries");
3719
3720 TH1F *hd0D0LSCotherSB = new TH1F("hd0D0LSCotherSB","D^{0} impact par. plot , Loose Cuts ,Other,Mass Peak (All momenta)",1000,-1000.,1000.);
3721 hd0D0LSCotherSB->SetXTitle("Impact parameter [#mum]");
3722 hd0D0LSCotherSB->SetYTitle("Entries");
3723
3724 TH1F *hd0D0VtxTrueLSCotherSB = new TH1F("hd0D0VtxTrueLSCotherSB","D^{0} impact par. w.r.t. True Vtx, Loose Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
3725 hd0D0VtxTrueLSCotherSB->SetXTitle("Impact parameter [#mum]");
3726 hd0D0VtxTrueLSCotherSB->SetYTitle("Entries");
3727
3728 TH1F *hMCd0D0LSCotherSB = new TH1F("hMCd0D0LSCotherSB","D^{0} impact par. plot, Loose Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
3729 hMCd0D0LSCotherSB->SetXTitle("MC Impact parameter [#mum]");
3730 hMCd0D0LSCotherSB->SetYTitle("Entries");
3731
3732 flistLsCutsOther->Add(hd0D0LSCotherPM);
3733 flistLsCutsOther->Add(hd0D0VtxTrueLSCotherPM);
3734 flistLsCutsOther->Add(hMCd0D0LSCotherPM);
3735 flistLsCutsOther->Add(hd0D0LSCotherSB);
3736 flistLsCutsOther->Add(hd0D0VtxTrueLSCotherSB);
3737 flistLsCutsOther->Add(hMCd0D0LSCotherSB);
3738
e047b348 3739 TH1F *hd0D0ptLSCotherPM;
3740 TH1F *hMCd0D0ptLSCotherPM;
3741 TH1F *hd0D0VtxTrueptLSCotherPM;
3742 TH1F *hd0D0ptLSCotherSB;
3743 TH1F *hMCd0D0ptLSCotherSB;
3744 TH1F *hd0D0VtxTrueptLSCotherSB;
ac4c229c 3745 namehist="hd0D0ptLSCother_";
624c07ab 3746 titlehist="D^{0} impact par. plot, Loose Cuts, Other, ";
3747 for(Int_t i=0;i<fnbins;i++){
3748 strnamept=namehist;
3749 strnamept.Append("PkMss_pt");
3750 strnamept+=i;
3751
3752 strtitlept=titlehist;
3753 strtitlept.Append(" Mass Peak, ");
3754 strtitlept+=fptbins[i];
3755 strtitlept.Append("<= pt <");
3756 strtitlept+=fptbins[i+1];
3757 strtitlept.Append(" [GeV/c]");
3758
e047b348 3759 hd0D0ptLSCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3760 hd0D0ptLSCotherPM->SetXTitle("Impact parameter [#mum] ");
3761 hd0D0ptLSCotherPM->SetYTitle("Entries");
3762 flistLsCutsOther->Add(hd0D0ptLSCotherPM);
624c07ab 3763
3764 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 3765 hMCd0D0ptLSCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3766 hMCd0D0ptLSCotherPM->SetXTitle("MC Impact parameter [#mum] ");
3767 hMCd0D0ptLSCotherPM->SetYTitle("Entries");
3768 flistLsCutsOther->Add(hMCd0D0ptLSCotherPM);
624c07ab 3769
3770
3771 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 3772 hd0D0VtxTrueptLSCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3773 hd0D0VtxTrueptLSCotherPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
3774 hd0D0VtxTrueptLSCotherPM->SetYTitle("Entries");
3775 flistLsCutsOther->Add(hd0D0VtxTrueptLSCotherPM);
624c07ab 3776
3777 strnamept=namehist;
3778 strnamept.Append("SBMss_pt");
3779 strnamept+=i;
3780
3781 strtitlept=titlehist;
3782 strtitlept.Append(" Side Bands, ");
3783 strtitlept+=fptbins[i];
3784 strtitlept.Append("<= pt <");
3785 strtitlept+=fptbins[i+1];
3786 strtitlept.Append(" [GeV/c]");
3787
e047b348 3788 hd0D0ptLSCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3789 hd0D0ptLSCotherSB->SetXTitle("Impact parameter [#mum] ");
3790 hd0D0ptLSCotherSB->SetYTitle("Entries");
3791 flistLsCutsOther->Add(hd0D0ptLSCotherSB);
624c07ab 3792
3793 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 3794 hMCd0D0ptLSCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3795 hMCd0D0ptLSCotherSB->SetXTitle("MC Impact parameter [#mum] ");
3796 hMCd0D0ptLSCotherSB->SetYTitle("Entries");
3797 flistLsCutsOther->Add(hMCd0D0ptLSCotherSB);
624c07ab 3798
3799 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 3800 hd0D0VtxTrueptLSCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
3801 hd0D0VtxTrueptLSCotherSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
3802 hd0D0VtxTrueptLSCotherSB->SetYTitle("Entries");
3803 flistLsCutsOther->Add(hd0D0VtxTrueptLSCotherSB);
624c07ab 3804 }
3805
d39e8f99 3806 //Printf("END OF LSCUTS HISTOS CREATION \n");
624c07ab 3807
3808
3809 //################################################################################################
3810 // #
3811 // HISTOS FOR TIGHT CUTS #
3812 // #
3813 //################################################################################################
3814
3815 //############ TIGHT CUTS SIGNAL HISTOGRAMS ###############
3816 //
3817 // ####### global properties histo ############
3818
e047b348 3819 TH2F *hCPtaVSd0d0TGHCsign=new TH2F("hCPtaVSd0d0TGHCsign","hCPtaVSd0d0_TightCuts_Signal",1000,-100000.,100000.,100,-1.,1.);
ac4c229c 3820 TH1F *hSecVtxZTGHCsign=new TH1F("hSecVtxZTGHCsign","hSecVtxZ_TightCuts_Signal",1000,-8.,8.);
3821 TH1F *hSecVtxXTGHCsign=new TH1F("hSecVtxXTGHCsign","hSecVtxX_TightCuts_Signal",1000,-3000.,3000.);
3822 TH1F *hSecVtxYTGHCsign=new TH1F("hSecVtxYTGHCsign","hSecVtxY_TightCuts_Signal",1000,-3000.,3000.);
3823 TH2F *hSecVtxXYTGHCsign=new TH2F("hSecVtxXYTGHCsign","hSecVtxXY_TightCuts_Signal",1000,-3000.,3000.,1000,-3000.,3000.);
3824 TH1F *hSecVtxPhiTGHCsign=new TH1F("hSecVtxPhiTGHCsign","hSecVtxPhi_TightCuts_Signal",180,-180.1,180.1);
e047b348 3825 TH1F *hd0singlTrackTGHCsign=new TH1F("hd0singlTrackTGHCsign","hd0singlTrackTightCuts_Signal",1000,-5000.,5000.);
3826 TH1F *hCPtaTGHCsign=new TH1F("hCPtaTGHCsign","hCPta_TightCuts_Signal",100,-1.,1.);
ac4c229c 3827 TH1F *hd0xd0TGHCsign=new TH1F("hd0xd0TGHCsign","hd0xd0_TightCuts_Signal",1000,-100000.,100000.);
3828 TH1F *hMassTrueTGHCsign=new TH1F("hMassTrueTGHCsign","D^{0} MC inv. Mass Tight Cuts Signal(All momenta)",600,1.600,2.200);
3829 TH1F *hMassTGHCsign=new TH1F("hMassTGHCsign","D^{0} inv. Mass Tight Cuts Signal (All momenta)",600,1.600,2.200);
3830 hMassTGHCsign->Sumw2();
3831 TH1F *hMassTrueTGHCsignPM=new TH1F("hMassTrueTGHCsignPM","D^{0} MC inv. Mass Tight Cuts Signal, Mass Peak. (All momenta)",600,1.600,2.200);
3832 TH1F *hMassTGHCsignPM=new TH1F("hMassTGHCsignPM","D^{0} inv. Mass Tight Cuts Signal (All momenta), MassPeak",600,1.600,2.200);
3833 hMassTGHCsignPM->Sumw2();
3834 TH1F *hMassTrueTGHCsignSB=new TH1F("hMassTrueTGHCsignSB","D^{0} MC inv. Mass in Side Bands Tight Cuts Signal(All momenta)",600,1.600,2.200);
3835 TH1F *hMassTGHCsignSB=new TH1F("hMassTGHCsignSB","D^{0} inv. Mass in Side Bands Tight Cuts Signal (All momenta)",600,1.600,2.200);
3836 hMassTGHCsignSB->Sumw2();
3837
3838 flistTghCutsSignal->Add(hCPtaVSd0d0TGHCsign);
3839 flistTghCutsSignal->Add(hSecVtxZTGHCsign);
3840 flistTghCutsSignal->Add(hSecVtxYTGHCsign);
3841 flistTghCutsSignal->Add(hSecVtxXTGHCsign);
3842 flistTghCutsSignal->Add(hSecVtxXYTGHCsign);
3843 flistTghCutsSignal->Add(hSecVtxPhiTGHCsign);
e047b348 3844 flistTghCutsSignal->Add(hd0singlTrackTGHCsign);
ac4c229c 3845 flistTghCutsSignal->Add(hCPtaTGHCsign);
3846 flistTghCutsSignal->Add(hd0xd0TGHCsign);
3847 flistTghCutsSignal->Add(hMassTrueTGHCsign);
3848 flistTghCutsSignal->Add(hMassTGHCsign);
3849 flistTghCutsSignal->Add(hMassTrueTGHCsignPM);
3850 flistTghCutsSignal->Add(hMassTGHCsignPM);
3851 flistTghCutsSignal->Add(hMassTrueTGHCsignSB);
3852 flistTghCutsSignal->Add(hMassTGHCsignSB);
624c07ab 3853
e047b348 3854
3855
3856
3857
3858
3859 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
3860 TH1F *hdcaTGHCsign=new TH1F("hdcaTGHCsign","hdca_TightCuts_Signal",100,0.,1000.);
3861 hdcaTGHCsign->SetXTitle("dca [#mum]");
3862 hdcaTGHCsign->SetYTitle("Entries");
3863 TH1F *hcosthetastarTGHCsign=new TH1F("hcosthetastarTGHCsign","hCosThetaStar_TightCuts_Signal",50,-1.,1.);
3864 hcosthetastarTGHCsign->SetXTitle("cos #theta^{*}");
3865 hcosthetastarTGHCsign->SetYTitle("Entries");
3866 TH1F *hptD0TGHCsign=new TH1F("hptD0TGHCsign","D^{0} transverse momentum distribution",34,ptbinsD0arr);
3867 hptD0TGHCsign->SetXTitle("p_{t} [GeV/c]");
3868 hptD0TGHCsign->SetYTitle("Entries");
3869 TH1F *hptD0VsMaxPtTGHCsign=new TH1F("hptD0VsMaxPtTGHCsign","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
3870 TH2F *hptD0PTallsqrtTGHCsign=new TH2F("hptD0PTallsqrtTGHCsign","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
3871 TH2F *hptD0PTallTGHCsign=new TH2F("hptD0PTallTGHCsign","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
3872 TH2F *hptD0vsptBTGHCsign=new TH2F("hptD0vsptBTGHCsign","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3873 TH2F *hpD0vspBTGHCsign=new TH2F("hpD0vspBTGHCsign","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3874 TH2F *hptD0vsptcquarkTGHCsign=new TH2F("hptD0vsptcquarkTGHCsign","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3875 TH2F *hpD0vspcquarkTGHCsign=new TH2F("hpD0vspcquarkTGHCsign","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
3876 flistTghCutsSignal->Add(hdcaTGHCsign);
3877 flistTghCutsSignal->Add(hcosthetastarTGHCsign);
3878 flistTghCutsSignal->Add(hptD0TGHCsign);
3879 flistTghCutsSignal->Add(hptD0VsMaxPtTGHCsign);
3880 flistTghCutsSignal->Add(hptD0PTallsqrtTGHCsign);
3881 flistTghCutsSignal->Add(hptD0PTallTGHCsign);
3882 flistTghCutsSignal->Add(hptD0vsptBTGHCsign);
3883 flistTghCutsSignal->Add(hpD0vspBTGHCsign);
3884 flistTghCutsSignal->Add(hptD0vsptcquarkTGHCsign);
3885 flistTghCutsSignal->Add(hpD0vspcquarkTGHCsign);
3886
3887 TH1F *hd0zD0ptTGHCsign;
cc3209fb 3888 TH1F *hInvMassD0TGHCsign,*hInvMassD0barTGHCsign;
e047b348 3889 TH2F *hInvMassPtTGHCsign=new TH2F("hInvMassPtTGHCsign","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
d39e8f99 3890 THnSparseF *hSparseTGHCsign=new THnSparseF("hSparseTGHCsign","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
3891 hSparseTGHCsign->SetBinEdges(0,massbins);
3892 hSparseTGHCsign->SetBinEdges(1,massbins);
3893 hSparseTGHCsign->SetBinEdges(2,ptbinsForNsparse);
3894 hSparseTGHCsign->SetBinEdges(3,impparbins);
3895 hSparseTGHCsign->SetBinEdges(4,massHypoBins);
3896 flistTghCutsSignal->Add(hSparseTGHCsign);
a9f921f5 3897
a3b80030 3898 THnSparseF *hSparseRecoTGHCfromB=new THnSparseF("hSparseRecoTGHCfromB","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
3899 hSparseRecoTGHCfromB->SetBinEdges(0,massbins);
3900 hSparseRecoTGHCfromB->SetBinEdges(1,massbins);
3901 hSparseRecoTGHCfromB->SetBinEdges(2,ptbinsForNsparse);
3902 hSparseRecoTGHCfromB->SetBinEdges(3,impparbins);
3903 hSparseRecoTGHCfromB->SetBinEdges(4,massHypoBins);
3904 flistTghCutsFromB->Add(hSparseRecoTGHCfromB);
3905
a9f921f5 3906
3907
3908 THnSparseF *hSparseCxyLxyTGHCsign=new THnSparseF("hSparseCxyLxyTGHCsign","Candidate Mass;massD0;Pt;CosXY;Lxy",4,nbinsSparsCxyLxy,binLowLimitSparseCxyLxy,binUpLimitSparseCxyLxy);
3909 hSparseCxyLxyTGHCsign->SetBinEdges(1,ptbinlimitsCxyLxy);
3910 hSparseCxyLxyTGHCsign->GetAxis(0)->SetName("mass");
3911 hSparseCxyLxyTGHCsign->GetAxis(0)->SetTitle("Invariant Mass (K#pi) [GeV/c^{2}]");
3912 hSparseCxyLxyTGHCsign->GetAxis(1)->SetName("pt");
3913 hSparseCxyLxyTGHCsign->GetAxis(1)->SetTitle("p_{t} [GeV/c]");
3914 hSparseCxyLxyTGHCsign->GetAxis(2)->SetName("CosPointXY");
3915 hSparseCxyLxyTGHCsign->GetAxis(2)->SetTitle("Cos#theta_{point}^{XY}");
3916 hSparseCxyLxyTGHCsign->GetAxis(3)->SetName("NormDecLengthXY");
3917 hSparseCxyLxyTGHCsign->GetAxis(3)->SetTitle("Normalized XY decay length");
3918
3919
3920 flistTghCutsSignal->Add(hSparseCxyLxyTGHCsign);
3921
3922
e047b348 3923 TH1F *hetaTGHCsign;
3924 TH1F *hCosPDPBTGHCsign;
3925 TH1F *hCosPcPDTGHCsign;
3926 flistTghCutsSignal->Add(hInvMassPtTGHCsign);
3927// %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
3928 TH2F *hd0D0VSd0xd0TGHCsignpt;
3929 TH2F *hangletracksVSd0xd0TGHCsignpt;
3930 TH2F *hangletracksVSd0D0TGHCsignpt;
3931 TH1F *hd0xd0TGHCsignpt;
77ed0cdb 3932 TH1F *hPhiHistPMTGHCsignpt,*hPhiHistSBTGHCsignpt;
e047b348 3933
3934 TH2F *hTOFpidTGHCsign=new TH2F("hTOFpidTGHCsign","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
3935 flistTghCutsSignal->Add(hTOFpidTGHCsign);
3936
3937 for(Int_t i=0;i<fnbins;i++){
d39e8f99 3938 // Printf("INSIDE FIRST LOOP FOR TIGHT CUTS HISTO CREATION %d\n", fnbins);
77ed0cdb 3939 namehist="hPhiHistPMTGHCsign_pt";
3940 namehist+=i;
3941 titlehist="Azimuthal correlation TGH Cuts Sign PM ptbin=";
3942 titlehist+=i;
3943 hPhiHistPMTGHCsignpt=new TH1F(namehist.Data(),titlehist.Data(),100,-3.15,3.15);
3944 hPhiHistPMTGHCsignpt->Sumw2();
3945 flistTghCutsSignal->Add(hPhiHistPMTGHCsignpt);
3946
3947 namehist="hPhiHistSBTGHCsign_pt";
3948 namehist+=i;
3949 titlehist="Azimuthal correlation TGH Cuts Sign SB ptbin=";
3950 titlehist+=i;
3951 hPhiHistSBTGHCsignpt=new TH1F(namehist.Data(),titlehist.Data(),100,-3.15,3.15);
3952 hPhiHistSBTGHCsignpt->Sumw2();
3953 flistTghCutsSignal->Add(hPhiHistSBTGHCsignpt);
3954
e047b348 3955 namehist="hd0zD0ptTGHCsign_pt";
3956 namehist+=i;
3957 titlehist="d0(z) Tight Cuts Signal ptbin=";
3958 titlehist+=i;
3959 hd0zD0ptTGHCsign=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
3960 hd0zD0ptTGHCsign->SetXTitle("d_{0}(z) [#mum]");
3961 hd0zD0ptTGHCsign->SetYTitle("Entries");
3962 flistTghCutsSignal->Add(hd0zD0ptTGHCsign);
3963
cc3209fb 3964 namehist="hInvMassD0TGHCsign_pt";
e047b348 3965 namehist+=i;
3966 titlehist="Invariant Mass Tight Cuts Signal ptbin=";
3967 titlehist+=i;
cc3209fb 3968 hInvMassD0TGHCsign=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3969 hInvMassD0TGHCsign->SetXTitle("Invariant Mass [GeV]");
3970 hInvMassD0TGHCsign->SetYTitle("Entries");
3971 flistTghCutsSignal->Add(hInvMassD0TGHCsign);
3972
3973 namehist="hInvMassD0barTGHCsign_pt";
3974 namehist+=i;
d39e8f99 3975 titlehist="Invariant Mass D0bar Tight Cuts Signal ptbin=";
cc3209fb 3976 titlehist+=i;
3977 hInvMassD0barTGHCsign=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
3978 hInvMassD0barTGHCsign->SetXTitle("Invariant Mass [GeV]");
3979 hInvMassD0barTGHCsign->SetYTitle("Entries");
3980 flistTghCutsSignal->Add(hInvMassD0barTGHCsign);
3981
e047b348 3982
3983 namehist="hetaTGHCsign_pt";
3984 namehist+=i;
3985 titlehist="eta Tight Cuts Signal ptbin=";
3986 titlehist+=i;
3987 hetaTGHCsign=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
3988 hetaTGHCsign->SetXTitle("Pseudorapidity");
3989 hetaTGHCsign->SetYTitle("Entries");
3990 flistTghCutsSignal->Add(hetaTGHCsign);
3991
3992 namehist="hCosPDPBTGHCsign_pt";
3993 namehist+=i;
3994 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
3995 titlehist+=i;
3996 hCosPDPBTGHCsign=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
3997 hCosPDPBTGHCsign->SetXTitle("Cosine between D0 momentum and B momentum");
3998 hCosPDPBTGHCsign->SetYTitle("Entries");
3999 flistTghCutsSignal->Add(hCosPDPBTGHCsign);
4000
4001 namehist="hCosPcPDTGHCsign_pt";
4002 namehist+=i;
4003 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
4004 titlehist+=i;
4005 hCosPcPDTGHCsign=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
4006 hCosPcPDTGHCsign->SetXTitle("Cosine between c quark momentum and D0 momentum");
4007 hCosPcPDTGHCsign->SetYTitle("Entries");
4008 flistTghCutsSignal->Add(hCosPcPDTGHCsign);
4009
4010 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
4011 namehist="hd0xd0TGHCsign_pt";
4012 namehist+=i;
4013 titlehist="d0xd0 Tight Cuts Signal ptbin=";
4014 titlehist+=i;
4015 hd0xd0TGHCsignpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
4016 hd0xd0TGHCsignpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
4017 hd0xd0TGHCsignpt->SetYTitle("Entries");
4018 flistTghCutsSignal->Add(hd0xd0TGHCsignpt);
4019
4020
4021 namehist="hd0D0VSd0xd0TGHCsign_pt";
4022 namehist+=i;
4023 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts Signal ptbin=";
4024 titlehist+=i;
4025 hd0D0VSd0xd0TGHCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
4026 hd0D0VSd0xd0TGHCsignpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4027 hd0D0VSd0xd0TGHCsignpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
4028 flistTghCutsSignal->Add(hd0D0VSd0xd0TGHCsignpt);
4029
4030
4031 namehist="hangletracksVSd0xd0TGHCsign_pt";
4032 namehist+=i;
4033 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts Signal ptbin=";
4034 titlehist+=i;
4035 hangletracksVSd0xd0TGHCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
4036 hangletracksVSd0xd0TGHCsignpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4037 hangletracksVSd0xd0TGHCsignpt->SetYTitle(" angle between K and #p tracks [rad]");
4038 flistTghCutsSignal->Add(hangletracksVSd0xd0TGHCsignpt);
4039
4040
4041 namehist="hangletracksVSd0D0TGHCsign_pt";
4042 namehist+=i;
4043 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Tight Cuts Signal ptbin=";
4044 titlehist+=i;
4045 hangletracksVSd0D0TGHCsignpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
4046 hangletracksVSd0D0TGHCsignpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
4047 hangletracksVSd0D0TGHCsignpt->SetYTitle(" angle between K and #p tracks [rad]");
4048 flistTghCutsSignal->Add(hangletracksVSd0D0TGHCsignpt);
4049
4050 }
4051 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
4052 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4053
4054
4055
4056
4057
4058
4059
4060
624c07ab 4061 // ####### d0 D0 histos ############
ac4c229c 4062 TH1F *hd0D0TGHCsignPM = new TH1F("hd0D0TGHCsignPM","D^{0} impact par. plot , Tight Cuts ,Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
4063 hd0D0TGHCsignPM->SetXTitle("Impact parameter [#mum]");
4064 hd0D0TGHCsignPM->SetYTitle("Entries");
4065
4066 TH1F *hd0D0VtxTrueTGHCsignPM = new TH1F("hd0D0VtxTrueTGHCsignPM","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
4067 hd0D0VtxTrueTGHCsignPM->SetXTitle("Impact parameter [#mum]");
4068 hd0D0VtxTrueTGHCsignPM->SetYTitle("Entries");
4069
4070 TH1F *hMCd0D0TGHCsignPM = new TH1F("hMCd0D0TGHCsignPM","D^{0} impact par. plot, Tight Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
4071 hMCd0D0TGHCsignPM->SetXTitle("MC Impact parameter [#mum]");
4072 hMCd0D0TGHCsignPM->SetYTitle("Entries");
4073
4074 TH1F *hd0D0TGHCsignSB = new TH1F("hd0D0TGHCsignSB","D^{0} impact par. plot , Tight Cuts ,Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
4075 hd0D0TGHCsignSB->SetXTitle("Impact parameter [#mum]");
4076 hd0D0TGHCsignSB->SetYTitle("Entries");
4077
4078 TH1F *hd0D0VtxTrueTGHCsignSB = new TH1F("hd0D0VtxTrueTGHCsignSB","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
4079 hd0D0VtxTrueTGHCsignSB->SetXTitle("Impact parameter [#mum]");
4080 hd0D0VtxTrueTGHCsignSB->SetYTitle("Entries");
4081
4082 TH1F *hMCd0D0TGHCsignSB = new TH1F("hMCd0D0TGHCsignSB","D^{0} impact par. plot, Tight Cuts, Signal,Mass Peak (All momenta)",1000,-1000.,1000.);
4083 hMCd0D0TGHCsignSB->SetXTitle("MC Impact parameter [#mum]");
4084 hMCd0D0TGHCsignSB->SetYTitle("Entries");
4085
4086 flistTghCutsSignal->Add(hd0D0TGHCsignPM);
4087 flistTghCutsSignal->Add(hd0D0VtxTrueTGHCsignPM);
4088 flistTghCutsSignal->Add(hMCd0D0TGHCsignPM);
4089 flistTghCutsSignal->Add(hd0D0TGHCsignSB);
4090 flistTghCutsSignal->Add(hd0D0VtxTrueTGHCsignSB);
4091 flistTghCutsSignal->Add(hMCd0D0TGHCsignSB);
4092
e047b348 4093 TH1F *hd0D0ptTGHCsignPM;
4094 TH1F *hMCd0D0ptTGHCsignPM;
4095 TH1F *hd0D0VtxTrueptTGHCsignPM;
4096 TH1F *hd0D0ptTGHCsignSB;
4097 TH1F *hMCd0D0ptTGHCsignSB;
4098 TH1F *hd0D0VtxTrueptTGHCsignSB;
ac4c229c 4099 namehist="hd0D0ptTGHCsign_";
624c07ab 4100 titlehist="D^{0} impact par. plot, Tight Cuts, Signal, ";
4101 for(Int_t i=0;i<fnbins;i++){
4102 strnamept=namehist;
4103 strnamept.Append("PkMss_pt");
4104 strnamept+=i;
4105
4106 strtitlept=titlehist;
4107 strtitlept.Append(" Mass Peak, ");
4108 strtitlept+=fptbins[i];
4109 strtitlept.Append("<= pt <");
4110 strtitlept+=fptbins[i+1];
4111 strtitlept.Append(" [GeV/c]");
4112
e047b348 4113 hd0D0ptTGHCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4114 hd0D0ptTGHCsignPM->SetXTitle("Impact parameter [#mum] ");
4115 hd0D0ptTGHCsignPM->SetYTitle("Entries");
4116 flistTghCutsSignal->Add(hd0D0ptTGHCsignPM);
624c07ab 4117
4118 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 4119 hMCd0D0ptTGHCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4120 hMCd0D0ptTGHCsignPM->SetXTitle("MC Impact parameter [#mum] ");
4121 hMCd0D0ptTGHCsignPM->SetYTitle("Entries");
4122 flistTghCutsSignal->Add(hMCd0D0ptTGHCsignPM);
624c07ab 4123
4124
4125 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 4126 hd0D0VtxTrueptTGHCsignPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4127 hd0D0VtxTrueptTGHCsignPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
4128 hd0D0VtxTrueptTGHCsignPM->SetYTitle("Entries");
4129 flistTghCutsSignal->Add(hd0D0VtxTrueptTGHCsignPM);
624c07ab 4130
4131 strnamept=namehist;
4132 strnamept.Append("SBMss_pt");
4133 strnamept+=i;
4134
4135 strtitlept=titlehist;
4136 strtitlept.Append(" Side Bands, ");
4137 strtitlept+=fptbins[i];
4138 strtitlept.Append("<= pt <");
4139 strtitlept+=fptbins[i+1];
4140 strtitlept.Append(" [GeV/c]");
4141
e047b348 4142 hd0D0ptTGHCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4143 hd0D0ptTGHCsignSB->SetXTitle("Impact parameter [#mum] ");
4144 hd0D0ptTGHCsignSB->SetYTitle("Entries");
4145 flistTghCutsSignal->Add(hd0D0ptTGHCsignSB);
624c07ab 4146
4147 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 4148 hMCd0D0ptTGHCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4149 hMCd0D0ptTGHCsignSB->SetXTitle("MC Impact parameter [#mum] ");
4150 hMCd0D0ptTGHCsignSB->SetYTitle("Entries");
4151 flistTghCutsSignal->Add(hMCd0D0ptTGHCsignSB);
624c07ab 4152
4153 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 4154 hd0D0VtxTrueptTGHCsignSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4155 hd0D0VtxTrueptTGHCsignSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
4156 hd0D0VtxTrueptTGHCsignSB->SetYTitle("Entries");
4157 flistTghCutsSignal->Add(hd0D0VtxTrueptTGHCsignSB);
624c07ab 4158 }
4159
4160
4161 //############ TIGHT CUTS BACKGROUND HISTOGRAMS ###########
4162 //
4163 // ######## global properties histos #######
e047b348 4164 TH2F *hCPtaVSd0d0TGHCback=new TH2F("hCPtaVSd0d0TGHCback","hCPtaVSd0d0_TightCuts_Background",1000,-100000.,100000.,100,-1.,1.);
ac4c229c 4165 TH1F *hSecVtxZTGHCback=new TH1F("hSecVtxZTGHCback","hSecVtxZ_TightCuts_Background",1000,-8.,8.);
4166 TH1F *hSecVtxXTGHCback=new TH1F("hSecVtxXTGHCback","hSecVtxX_TightCuts_Background",1000,-3000.,3000.);
4167 TH1F *hSecVtxYTGHCback=new TH1F("hSecVtxYTGHCback","hSecVtxY_TightCuts_Background",1000,-3000.,3000.);
4168 TH2F *hSecVtxXYTGHCback=new TH2F("hSecVtxXYTGHCback","hSecVtxXY_TightCuts_Background",1000,-3000.,3000.,1000,-3000.,3000.);
4169 TH1F *hSecVtxPhiTGHCback=new TH1F("hSecVtxPhiTGHCback","hSecVtxPhi_TightCuts_Background",180,-180.1,180.1);
e047b348 4170 TH1F *hd0singlTrackTGHCback=new TH1F("hd0singlTrackTGHCback","hd0singlTrackTightCuts_Back",1000,-5000.,5000.);
4171 TH1F *hCPtaTGHCback=new TH1F("hCPtaTGHCback","hCPta_TightCuts_Background",100,-1.,1.);
ac4c229c 4172 TH1F *hd0xd0TGHCback=new TH1F("hd0xd0TGHCback","hd0xd0_TightCuts_Background",1000,-100000.,100000.);
4173 TH1F *hMassTrueTGHCback=new TH1F("hMassTrueTGHCback","D^{0} MC inv. Mass Tight Cuts Background(All momenta)",600,1.600,2.200);
4174 TH1F *hMassTGHCback=new TH1F("hMassTGHCback","D^{0} inv. Mass Tight Cuts Background (All momenta)",600,1.600,2.200);
4175 hMassTGHCback->Sumw2();
4176 TH1F *hMassTrueTGHCbackPM=new TH1F("hMassTrueTGHCbackPM","D^{0} MC inv. Mass Tight Cuts Background, Mass Peak. (All momenta)",600,1.600,2.200);
4177 TH1F *hMassTGHCbackPM=new TH1F("hMassTGHCbackPM","D^{0} inv. Mass Tight Cuts Background (All momenta), MassPeak",600,1.600,2.200);
4178 hMassTGHCbackPM->Sumw2();
4179 TH1F *hMassTrueTGHCbackSB=new TH1F("hMassTrueTGHCbackSB","D^{0} MC inv. Mass in Side Bands Tight Cuts Backgrround(All momenta)",600,1.600,2.200);
4180 TH1F *hMassTGHCbackSB=new TH1F("hMassTGHCbackSB","D^{0} inv. Mass in Side Bands Tight Cuts Background (All momenta)",600,1.600,2.200);
4181 hMassTGHCbackSB->Sumw2();
4182
4183 flistTghCutsBack->Add(hCPtaVSd0d0TGHCback);
4184 flistTghCutsBack->Add(hSecVtxZTGHCback);
4185 flistTghCutsBack->Add(hSecVtxYTGHCback);
4186 flistTghCutsBack->Add(hSecVtxXTGHCback);
4187 flistTghCutsBack->Add(hSecVtxXYTGHCback);
4188 flistTghCutsBack->Add(hSecVtxPhiTGHCback);
e047b348 4189 flistTghCutsBack->Add(hd0singlTrackTGHCback);
ac4c229c 4190 flistTghCutsBack->Add(hCPtaTGHCback);
4191 flistTghCutsBack->Add(hd0xd0TGHCback);
4192 flistTghCutsBack->Add(hMassTrueTGHCback);
4193 flistTghCutsBack->Add(hMassTGHCback);
4194 flistTghCutsBack->Add(hMassTrueTGHCbackPM);
4195 flistTghCutsBack->Add(hMassTGHCbackPM);
4196 flistTghCutsBack->Add(hMassTrueTGHCbackSB);
4197 flistTghCutsBack->Add(hMassTGHCbackSB);
624c07ab 4198
4199
e047b348 4200
4201
4202
4203
4204
4205 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
4206 TH1F *hdcaTGHCback=new TH1F("hdcaTGHCback","hdca_TightCuts_Backgr",100,0.,1000.);
4207 hdcaTGHCback->SetXTitle("dca [#mum]");
4208 hdcaTGHCback->SetYTitle("Entries");
4209 TH1F *hcosthetastarTGHCback=new TH1F("hcosthetastarTGHCback","hCosThetaStar_TightCuts_Backgr",50,-1.,1.);
4210 hcosthetastarTGHCback->SetXTitle("cos #theta^{*}");
4211 hcosthetastarTGHCback->SetYTitle("Entries");
4212 TH1F *hptD0TGHCback=new TH1F("hptD0TGHCback","D^{0} transverse momentum distribution",34,ptbinsD0arr);
4213 hptD0TGHCback->SetXTitle("p_{t} [GeV/c]");
4214 hptD0TGHCback->SetYTitle("Entries");
4215 TH1F *hptD0VsMaxPtTGHCback=new TH1F("hptD0VsMaxPtTGHCback","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
4216 TH2F *hptD0PTallsqrtTGHCback=new TH2F("hptD0PTallsqrtTGHCback","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
4217 TH2F *hptD0PTallTGHCback=new TH2F("hptD0PTallTGHCback","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
4218 TH2F *hptD0vsptBTGHCback=new TH2F("hptD0vsptBTGHCback","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4219 TH2F *hpD0vspBTGHCback=new TH2F("hpD0vspBTGHCback","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4220 TH2F *hptD0vsptcquarkTGHCback=new TH2F("hptD0vsptcquarkTGHCback","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4221 TH2F *hpD0vspcquarkTGHCback=new TH2F("hpD0vspcquarkTGHCback","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4222 flistTghCutsBack->Add(hdcaTGHCback);
4223 flistTghCutsBack->Add(hcosthetastarTGHCback);
4224 flistTghCutsBack->Add(hptD0TGHCback);
4225 flistTghCutsBack->Add(hptD0VsMaxPtTGHCback);
4226 flistTghCutsBack->Add(hptD0PTallsqrtTGHCback);
4227 flistTghCutsBack->Add(hptD0PTallTGHCback);
4228 flistTghCutsBack->Add(hptD0vsptBTGHCback);
4229 flistTghCutsBack->Add(hpD0vspBTGHCback);
4230 flistTghCutsBack->Add(hptD0vsptcquarkTGHCback);
4231 flistTghCutsBack->Add(hpD0vspcquarkTGHCback);
4232
4233 TH1F *hd0zD0ptTGHCback;
cc3209fb 4234 TH1F *hInvMassD0TGHCback,*hInvMassD0barTGHCback;
e047b348 4235 TH2F *hInvMassPtTGHCback=new TH2F("hInvMassPtTGHCback","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
d39e8f99 4236 THnSparseF *hSparseTGHCback=new THnSparseF("hSparseTGHCback","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
4237 hSparseTGHCback->SetBinEdges(0,massbins);
4238 hSparseTGHCback->SetBinEdges(1,massbins);
4239 hSparseTGHCback->SetBinEdges(2,ptbinsForNsparse);
4240 hSparseTGHCback->SetBinEdges(3,impparbins);
4241 hSparseTGHCback->SetBinEdges(4,massHypoBins);
4242 flistTghCutsBack->Add(hSparseTGHCback);
e047b348 4243 TH1F *hetaTGHCback;
4244 TH1F *hCosPDPBTGHCback;
4245 TH1F *hCosPcPDTGHCback;
4246 flistTghCutsBack->Add(hInvMassPtTGHCback);
4247// %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
4248 TH2F *hd0D0VSd0xd0TGHCbackpt;
4249 TH2F *hangletracksVSd0xd0TGHCbackpt;
4250 TH2F *hangletracksVSd0D0TGHCbackpt;
4251 TH1F *hd0xd0TGHCbackpt;
4252
4253 TH2F *hTOFpidTGHCback=new TH2F("hTOFpidTGHCback","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
4254 flistTghCutsBack->Add(hTOFpidTGHCback);
4255
4256
4257 for(Int_t i=0;i<fnbins;i++){
4258 namehist="hd0zD0ptTGHCback_pt";
4259 namehist+=i;
4260 titlehist="d0(z) Tight Cuts Backgrm ptbin=";
4261 titlehist+=i;
4262 hd0zD0ptTGHCback=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
4263 hd0zD0ptTGHCback->SetXTitle("d_{0}(z) [#mum]");
4264 hd0zD0ptTGHCback->SetYTitle("Entries");
4265 flistTghCutsBack->Add(hd0zD0ptTGHCback);
4266
cc3209fb 4267 namehist="hInvMassD0TGHCback_pt";
e047b348 4268 namehist+=i;
4269 titlehist="Invariant Mass Tight Cuts Backgr ptbin=";
4270 titlehist+=i;
cc3209fb 4271 hInvMassD0TGHCback=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
4272 hInvMassD0TGHCback->SetXTitle("Invariant Mass [GeV]");
4273 hInvMassD0TGHCback->SetYTitle("Entries");
4274 flistTghCutsBack->Add(hInvMassD0TGHCback);
4275
4276 namehist="hInvMassD0barTGHCback_pt";
4277 namehist+=i;
d39e8f99 4278 titlehist="Invariant Mass D0bar Tight Cuts Back ptbin=";
cc3209fb 4279 titlehist+=i;
4280 hInvMassD0barTGHCback=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
4281 hInvMassD0barTGHCback->SetXTitle("Invariant Mass [GeV]");
4282 hInvMassD0barTGHCback->SetYTitle("Entries");
4283 flistTghCutsBack->Add(hInvMassD0barTGHCback);
e047b348 4284
4285 namehist="hetaTGHCback_pt";
4286 namehist+=i;
4287 titlehist="eta Tight Cuts Backgr ptbin=";
4288 titlehist+=i;
4289 hetaTGHCback=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
4290 hetaTGHCback->SetXTitle("Pseudorapidity");
4291 hetaTGHCback->SetYTitle("Entries");
4292 flistTghCutsBack->Add(hetaTGHCback);
4293
4294 namehist="hCosPDPBTGHCback_pt";
4295 namehist+=i;
4296 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
4297 titlehist+=i;
4298 hCosPDPBTGHCback=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
4299 hCosPDPBTGHCback->SetXTitle("Cosine between D0 momentum and B momentum");
4300 hCosPDPBTGHCback->SetYTitle("Entries");
4301 flistTghCutsBack->Add(hCosPDPBTGHCback);
4302
4303 namehist="hCosPcPDTGHCback_pt";
4304 namehist+=i;
4305 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
4306 titlehist+=i;
4307 hCosPcPDTGHCback=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
4308 hCosPcPDTGHCback->SetXTitle("Cosine between c quark momentum and D0 momentum");
4309 hCosPcPDTGHCback->SetYTitle("Entries");
4310 flistTghCutsBack->Add(hCosPcPDTGHCback);
4311
4312 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
4313 namehist="hd0xd0TGHCback_pt";
4314 namehist+=i;
4315 titlehist="d0xd0 Tight Cuts Back ptbin=";
4316 titlehist+=i;
4317 hd0xd0TGHCbackpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
4318 hd0xd0TGHCbackpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
4319 hd0xd0TGHCbackpt->SetYTitle("Entries");
4320 flistTghCutsBack->Add(hd0xd0TGHCbackpt);
4321
4322
4323 namehist="hd0D0VSd0xd0TGHCback_pt";
4324 namehist+=i;
4325 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts Back ptbin=";
4326 titlehist+=i;
4327 hd0D0VSd0xd0TGHCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
4328 hd0D0VSd0xd0TGHCbackpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4329 hd0D0VSd0xd0TGHCbackpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
4330 flistTghCutsBack->Add(hd0D0VSd0xd0TGHCbackpt);
4331
4332
4333 namehist="hangletracksVSd0xd0TGHCback_pt";
4334 namehist+=i;
4335 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts Back ptbin=";
4336 titlehist+=i;
4337 hangletracksVSd0xd0TGHCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
4338 hangletracksVSd0xd0TGHCbackpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4339 hangletracksVSd0xd0TGHCbackpt->SetYTitle(" angle between K and #p tracks [rad]");
4340 flistTghCutsBack->Add(hangletracksVSd0xd0TGHCbackpt);
4341
4342
4343 namehist="hangletracksVSd0D0TGHCback_pt";
4344 namehist+=i;
4345 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Tight Cuts Back ptbin=";
4346 titlehist+=i;
4347 hangletracksVSd0D0TGHCbackpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
4348 hangletracksVSd0D0TGHCbackpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
4349 hangletracksVSd0D0TGHCbackpt->SetYTitle(" angle between K and #p tracks [rad]");
4350 flistTghCutsBack->Add(hangletracksVSd0D0TGHCbackpt);
4351
4352
4353 }
4354 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
4355 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4356
4357
4358
4359
624c07ab 4360 // ####### d0 D0 histos ############
4361
ac4c229c 4362 TH1F *hd0D0TGHCbackPM = new TH1F("hd0D0TGHCbackPM","D^{0} impact par. plot , Tight Cuts ,Background,Mass Peak (All momenta)",1000,-1000.,1000.);
4363 hd0D0TGHCbackPM->SetXTitle("Impact parameter [#mum]");
4364 hd0D0TGHCbackPM->SetYTitle("Entries");
4365
4366 TH1F *hd0D0VtxTrueTGHCbackPM = new TH1F("hd0D0VtxTrueTGHCbackPM","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
4367 hd0D0VtxTrueTGHCbackPM->SetXTitle("Impact parameter [#mum]");
4368 hd0D0VtxTrueTGHCbackPM->SetYTitle("Entries");
4369
4370 TH1F *hMCd0D0TGHCbackPM = new TH1F("hMCd0D0TGHCbackPM","D^{0} impact par. plot, Tight Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
4371 hMCd0D0TGHCbackPM->SetXTitle("MC Impact parameter [#mum]");
4372 hMCd0D0TGHCbackPM->SetYTitle("Entries");
4373
4374 TH1F *hd0D0TGHCbackSB = new TH1F("hd0D0TGHCbackSB","D^{0} impact par. plot , Tight Cuts ,Background,Mass Peak (All momenta)",1000,-1000.,1000.);
4375 hd0D0TGHCbackSB->SetXTitle("Impact parameter [#mum]");
4376 hd0D0TGHCbackSB->SetYTitle("Entries");
4377
4378 TH1F *hd0D0VtxTrueTGHCbackSB = new TH1F("hd0D0VtxTrueTGHCbackSB","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
4379 hd0D0VtxTrueTGHCbackSB->SetXTitle("Impact parameter [#mum]");
4380 hd0D0VtxTrueTGHCbackSB->SetYTitle("Entries");
4381
4382 TH1F *hMCd0D0TGHCbackSB = new TH1F("hMCd0D0TGHCbackSB","D^{0} impact par. plot, Tight Cuts, Background,Mass Peak (All momenta)",1000,-1000.,1000.);
4383 hMCd0D0TGHCbackSB->SetXTitle("MC Impact parameter [#mum]");
4384 hMCd0D0TGHCbackSB->SetYTitle("Entries");
4385
4386 flistTghCutsBack->Add(hd0D0TGHCbackPM);
4387 flistTghCutsBack->Add(hd0D0VtxTrueTGHCbackPM);
4388 flistTghCutsBack->Add(hMCd0D0TGHCbackPM);
4389 flistTghCutsBack->Add(hd0D0TGHCbackSB);
4390 flistTghCutsBack->Add(hd0D0VtxTrueTGHCbackSB);
4391 flistTghCutsBack->Add(hMCd0D0TGHCbackSB);
4392
e047b348 4393 TH1F *hd0D0ptTGHCbackPM;
4394 TH1F *hMCd0D0ptTGHCbackPM;
4395 TH1F *hd0D0VtxTrueptTGHCbackPM;
4396 TH1F *hd0D0ptTGHCbackSB;
4397 TH1F *hMCd0D0ptTGHCbackSB;
4398 TH1F *hd0D0VtxTrueptTGHCbackSB;
ac4c229c 4399 namehist="hd0D0ptTGHCback_";
624c07ab 4400 titlehist="D^{0} impact par. plot, Tight Cuts, Background, ";
4401 for(Int_t i=0;i<fnbins;i++){
4402 strnamept=namehist;
4403 strnamept.Append("PkMss_pt");
4404 strnamept+=i;
4405
4406 strtitlept=titlehist;
4407 strtitlept.Append(" Mass Peak, ");
4408 strtitlept+=fptbins[i];
4409 strtitlept.Append("<= pt <");
4410 strtitlept+=fptbins[i+1];
4411 strtitlept.Append(" [GeV/c]");
4412
e047b348 4413 hd0D0ptTGHCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4414 hd0D0ptTGHCbackPM->SetXTitle("Impact parameter [#mum] ");
4415 hd0D0ptTGHCbackPM->SetYTitle("Entries");
4416 flistTghCutsBack->Add(hd0D0ptTGHCbackPM);
624c07ab 4417
4418 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 4419 hMCd0D0ptTGHCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4420 hMCd0D0ptTGHCbackPM->SetXTitle("MC Impact parameter [#mum] ");
4421 hMCd0D0ptTGHCbackPM->SetYTitle("Entries");
4422 flistTghCutsBack->Add(hMCd0D0ptTGHCbackPM);
624c07ab 4423
4424
4425 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 4426 hd0D0VtxTrueptTGHCbackPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4427 hd0D0VtxTrueptTGHCbackPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
4428 hd0D0VtxTrueptTGHCbackPM->SetYTitle("Entries");
4429 flistTghCutsBack->Add(hd0D0VtxTrueptTGHCbackPM);
624c07ab 4430
4431 strnamept=namehist;
4432 strnamept.Append("SBMss_pt");
4433 strnamept+=i;
4434
4435 strtitlept=titlehist;
4436 strtitlept.Append(" Side Bands, ");
4437 strtitlept+=fptbins[i];
4438 strtitlept.Append("<= pt <");
4439 strtitlept+=fptbins[i+1];
4440 strtitlept.Append(" [GeV/c]");
4441
e047b348 4442 hd0D0ptTGHCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4443 hd0D0ptTGHCbackSB->SetXTitle("Impact parameter [#mum] ");
4444 hd0D0ptTGHCbackSB->SetYTitle("Entries");
4445 flistTghCutsBack->Add(hd0D0ptTGHCbackSB);
624c07ab 4446
4447 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 4448 hMCd0D0ptTGHCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4449 hMCd0D0ptTGHCbackSB->SetXTitle("MC Impact parameter [#mum] ");
4450 hMCd0D0ptTGHCbackSB->SetYTitle("Entries");
4451 flistTghCutsBack->Add(hMCd0D0ptTGHCbackSB);
624c07ab 4452
4453 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 4454 hd0D0VtxTrueptTGHCbackSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4455 hd0D0VtxTrueptTGHCbackSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
4456 hd0D0VtxTrueptTGHCbackSB->SetYTitle("Entries");
4457 flistTghCutsBack->Add(hd0D0VtxTrueptTGHCbackSB);
624c07ab 4458 }
4459
4460
4461
4462 //############ TIGHT CUTS FROMB HISTOGRAMS ###########
4463 //
4464 //####### global properties histos
4465
e047b348 4466 TH2F *hCPtaVSd0d0TGHCfromB=new TH2F("hCPtaVSd0d0TGHCfromB","hCPtaVSd0d0_TightCuts_FromB",1000,-100000.,100000.,100,-1.,1.);
ac4c229c 4467 TH1F *hSecVtxZTGHCfromB=new TH1F("hSecVtxZTGHCfromB","hSecVtxZ_TightCuts_FromB",1000,-8.,8.);
4468 TH1F *hSecVtxXTGHCfromB=new TH1F("hSecVtxXTGHCfromB","hSecVtxX_TightCuts_FromB",1000,-3000.,3000.);
4469 TH1F *hSecVtxYTGHCfromB=new TH1F("hSecVtxYTGHCfromB","hSecVtxY_TightCuts_FromB",1000,-3000.,3000.);
4470 TH2F *hSecVtxXYTGHCfromB=new TH2F("hSecVtxXYTGHCfromB","hSecVtxXY_TightCuts_FromB",1000,-3000.,3000.,1000,-3000.,3000.);
4471 TH1F *hSecVtxPhiTGHCfromB=new TH1F("hSecVtxPhiTGHCfromB","hSecVtxPhi_TightCuts_FromB",180,-180.1,180.1);
e047b348 4472 TH1F *hd0singlTrackTGHCfromB=new TH1F("hd0singlTrackTGHCfromB","hd0singlTrackTightCuts_FromB",1000,-5000.,5000.);
4473 TH1F *hCPtaTGHCfromB=new TH1F("hCPtaTGHCfromB","hCPta_TightCuts_FromB",100,-1.,1.);
ac4c229c 4474 TH1F *hd0xd0TGHCfromB=new TH1F("hd0xd0TGHCfromB","hd0xd0_TightCuts_FromB",1000,-100000.,100000.);
4475 TH1F *hMassTrueTGHCfromB=new TH1F("hMassTrueTGHCfromB","D^{0} MC inv. Mass Tight Cuts FromB(All momenta)",600,1.600,2.200);
4476 TH1F *hMassTGHCfromB=new TH1F("hMassTGHCfromB","D^{0} inv. Mass Tight Cuts FromB (All momenta)",600,1.600,2.200);
4477 hMassTGHCfromB->Sumw2();
4478 TH1F *hMassTrueTGHCfromBPM=new TH1F("hMassTrueTGHCfromBPM","D^{0} MC inv. Mass Tight Cuts FromB, Mass Peak. (All momenta)",600,1.600,2.200);
4479 TH1F *hMassTGHCfromBPM=new TH1F("hMassTGHCfromBPM","D^{0} inv. Mass Tight Cuts FromB (All momenta), MassPeak",600,1.600,2.200);
4480 hMassTGHCfromBPM->Sumw2();
4481 TH1F *hMassTrueTGHCfromBSB=new TH1F("hMassTrueTGHCfromBSB","D^{0} MC inv. Mass in Side Bands Tight Cuts FromB(All momenta)",600,1.600,2.200);
4482 TH1F *hMassTGHCfromBSB=new TH1F("hMassTGHCfromBSB","D^{0} inv. Mass in Side Bands Tight Cuts FromB (All momenta)",600,1.600,2.200);
4483 hMassTGHCfromBSB->Sumw2();
4484
4485 flistTghCutsFromB->Add(hCPtaVSd0d0TGHCfromB);
4486 flistTghCutsFromB->Add(hSecVtxZTGHCfromB);
4487 flistTghCutsFromB->Add(hSecVtxYTGHCfromB);
4488 flistTghCutsFromB->Add(hSecVtxXTGHCfromB);
4489 flistTghCutsFromB->Add(hSecVtxXYTGHCfromB);
4490 flistTghCutsFromB->Add(hSecVtxPhiTGHCfromB);
e047b348 4491 flistTghCutsFromB->Add(hd0singlTrackTGHCfromB);
ac4c229c 4492 flistTghCutsFromB->Add(hCPtaTGHCfromB);
4493 flistTghCutsFromB->Add(hd0xd0TGHCfromB);
4494 flistTghCutsFromB->Add(hMassTrueTGHCfromB);
4495 flistTghCutsFromB->Add(hMassTGHCfromB);
4496 flistTghCutsFromB->Add(hMassTrueTGHCfromBPM);
4497 flistTghCutsFromB->Add(hMassTGHCfromBPM);
4498 flistTghCutsFromB->Add(hMassTrueTGHCfromBSB);
4499 flistTghCutsFromB->Add(hMassTGHCfromBSB);
624c07ab 4500
ac4c229c 4501
ac4c229c 4502
e047b348 4503 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
4504 TH1F *hdcaTGHCfromB=new TH1F("hdcaTGHCfromB","hdca_TightCuts_FromB",100,0.,1000.);
4505 hdcaTGHCfromB->SetXTitle("dca [#mum]");
4506 hdcaTGHCfromB->SetYTitle("Entries");
4507 TH1F *hcosthetastarTGHCfromB=new TH1F("hcosthetastarTGHCfromB","hCosThetaStar_TightCuts_FromB",50,-1.,1.);
4508 hcosthetastarTGHCfromB->SetXTitle("cos #theta^{*}");
4509 hcosthetastarTGHCfromB->SetYTitle("Entries");
4510 TH1F *hptD0TGHCfromB=new TH1F("hptD0TGHCfromB","D^{0} transverse momentum distribution",34,ptbinsD0arr);
4511 hptD0TGHCfromB->SetXTitle("p_{t} [GeV/c]");
4512 hptD0TGHCfromB->SetYTitle("Entries");
4513 TH1F *hptD0VsMaxPtTGHCfromB=new TH1F("hptD0VsMaxPtTGHCfromB","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
4514 TH2F *hptD0PTallsqrtTGHCfromB=new TH2F("hptD0PTallsqrtTGHCfromB","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
4515 TH2F *hptD0PTallTGHCfromB=new TH2F("hptD0PTallTGHCfromB","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
4516 TH2F *hptD0vsptBTGHCfromB=new TH2F("hptD0vsptBTGHCfromB","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4517 TH2F *hpD0vspBTGHCfromB=new TH2F("hpD0vspBTGHCfromB","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4518 TH2F *hptD0vsptcquarkTGHCfromB=new TH2F("hptD0vsptcquarkTGHCfromB","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4519 TH2F *hpD0vspcquarkTGHCfromB=new TH2F("hpD0vspcquarkTGHCfromB","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4520 flistTghCutsFromB->Add(hdcaTGHCfromB);
4521 flistTghCutsFromB->Add(hcosthetastarTGHCfromB);
4522 flistTghCutsFromB->Add(hptD0TGHCfromB);
4523 flistTghCutsFromB->Add(hptD0VsMaxPtTGHCfromB);
4524 flistTghCutsFromB->Add(hptD0PTallsqrtTGHCfromB);
4525 flistTghCutsFromB->Add(hptD0PTallTGHCfromB);
4526 flistTghCutsFromB->Add(hptD0vsptBTGHCfromB);
4527 flistTghCutsFromB->Add(hpD0vspBTGHCfromB);
4528 flistTghCutsFromB->Add(hptD0vsptcquarkTGHCfromB);
4529 flistTghCutsFromB->Add(hpD0vspcquarkTGHCfromB);
4530
4531 TH1F *hd0zD0ptTGHCfromB;
cc3209fb 4532 TH1F *hInvMassD0TGHCfromB,*hInvMassD0barTGHCfromB;
e047b348 4533 TH2F *hInvMassPtTGHCfromB=new TH2F("hInvMassPtTGHCfromB","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
d39e8f99 4534 THnSparseF *hSparseTGHCfromB=new THnSparseF("hSparseTGHCfromB","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
4535 hSparseTGHCfromB->SetBinEdges(0,massbins);
4536 hSparseTGHCfromB->SetBinEdges(1,massbins);
4537 hSparseTGHCfromB->SetBinEdges(2,ptbinsForNsparse);
4538 hSparseTGHCfromB->SetBinEdges(3,impparbins);
4539 hSparseTGHCfromB->SetBinEdges(4,massHypoBins);
4540 flistTghCutsFromB->Add(hSparseTGHCfromB);
e047b348 4541 TH1F *hetaTGHCfromB;
4542 TH1F *hCosPDPBTGHCfromB;
4543 TH1F *hCosPcPDTGHCfromB;
4544 flistTghCutsFromB->Add(hInvMassPtTGHCfromB);
4545// %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
4546 TH2F *hd0D0VSd0xd0TGHCfromBpt;
4547 TH2F *hangletracksVSd0xd0TGHCfromBpt;
4548 TH2F *hangletracksVSd0D0TGHCfromBpt;
4549 TH1F *hd0xd0TGHCfromBpt;
4550
4551 TH2F *hTOFpidTGHCfromB=new TH2F("hTOFpidTGHCfromB","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
4552 flistTghCutsFromB->Add(hTOFpidTGHCfromB);
ac4c229c 4553
e047b348 4554
4555 for(Int_t i=0;i<fnbins;i++){
4556 namehist="hd0zD0ptTGHCfromB_pt";
4557 namehist+=i;
4558 titlehist="d0(z) Tight Cuts FromBm ptbin=";
4559 titlehist+=i;
4560 hd0zD0ptTGHCfromB=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
4561 hd0zD0ptTGHCfromB->SetXTitle("d_{0}(z) [#mum]");
4562 hd0zD0ptTGHCfromB->SetYTitle("Entries");
4563 flistTghCutsFromB->Add(hd0zD0ptTGHCfromB);
4564
cc3209fb 4565 namehist="hInvMassD0TGHCfromB_pt";
e047b348 4566 namehist+=i;
4567 titlehist="Invariant Mass Tight Cuts FromB ptbin=";
4568 titlehist+=i;
cc3209fb 4569 hInvMassD0TGHCfromB=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
4570 hInvMassD0TGHCfromB->SetXTitle("Invariant Mass [GeV]");
4571 hInvMassD0TGHCfromB->SetYTitle("Entries");
4572 flistTghCutsFromB->Add(hInvMassD0TGHCfromB);
4573
4574 namehist="hInvMassD0barTGHCfromB_pt";
4575 namehist+=i;
d39e8f99 4576 titlehist="Invariant Mass D0bar Tight Cuts FromB ptbin=";
cc3209fb 4577 titlehist+=i;
4578 hInvMassD0barTGHCfromB=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
4579 hInvMassD0barTGHCfromB->SetXTitle("Invariant Mass [GeV]");
4580 hInvMassD0barTGHCfromB->SetYTitle("Entries");
4581 flistTghCutsFromB->Add(hInvMassD0barTGHCfromB);
e047b348 4582
4583 namehist="hetaTGHCfromB_pt";
4584 namehist+=i;
4585 titlehist="eta Tight Cuts FromB ptbin=";
4586 titlehist+=i;
4587 hetaTGHCfromB=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
4588 hetaTGHCfromB->SetXTitle("Pseudorapidity");
4589 hetaTGHCfromB->SetYTitle("Entries");
4590 flistTghCutsFromB->Add(hetaTGHCfromB);
4591
4592 namehist="hCosPDPBTGHCfromB_pt";
4593 namehist+=i;
4594 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
4595 titlehist+=i;
4596 hCosPDPBTGHCfromB=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
4597 hCosPDPBTGHCfromB->SetXTitle("Cosine between D0 momentum and B momentum");
4598 hCosPDPBTGHCfromB->SetYTitle("Entries");
4599 flistTghCutsFromB->Add(hCosPDPBTGHCfromB);
4600
4601 namehist="hCosPcPDTGHCfromB_pt";
4602 namehist+=i;
4603 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
4604 titlehist+=i;
4605 hCosPcPDTGHCfromB=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
4606 hCosPcPDTGHCfromB->SetXTitle("Cosine between c quark momentum and D0 momentum");
4607 hCosPcPDTGHCfromB->SetYTitle("Entries");
4608 flistTghCutsFromB->Add(hCosPcPDTGHCfromB);
4609
4610// %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
4611 namehist="hd0xd0TGHCfromB_pt";
4612 namehist+=i;
4613 titlehist="d0xd0 Tight Cuts FromB ptbin=";
4614 titlehist+=i;
4615 hd0xd0TGHCfromBpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
4616 hd0xd0TGHCfromBpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
4617 hd0xd0TGHCfromBpt->SetYTitle("Entries");
4618 flistTghCutsFromB->Add(hd0xd0TGHCfromBpt);
4619
4620
4621 namehist="hd0D0VSd0xd0TGHCfromB_pt";
4622 namehist+=i;
4623 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts FromB ptbin=";
4624 titlehist+=i;
4625 hd0D0VSd0xd0TGHCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
4626 hd0D0VSd0xd0TGHCfromBpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4627 hd0D0VSd0xd0TGHCfromBpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
4628 flistTghCutsFromB->Add(hd0D0VSd0xd0TGHCfromBpt);
4629
4630
4631 namehist="hangletracksVSd0xd0TGHCfromB_pt";
4632 namehist+=i;
4633 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts FromB ptbin=";
4634 titlehist+=i;
4635 hangletracksVSd0xd0TGHCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
4636 hangletracksVSd0xd0TGHCfromBpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4637 hangletracksVSd0xd0TGHCfromBpt->SetYTitle(" angle between K and #p tracks [rad]");
4638 flistTghCutsFromB->Add(hangletracksVSd0xd0TGHCfromBpt);
4639
4640
4641 namehist="hangletracksVSd0D0TGHCfromB_pt";
4642 namehist+=i;
4643 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Tight Cuts FromB ptbin=";
4644 titlehist+=i;
4645 hangletracksVSd0D0TGHCfromBpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
4646 hangletracksVSd0D0TGHCfromBpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
4647 hangletracksVSd0D0TGHCfromBpt->SetYTitle(" angle between K and #p tracks [rad]");
4648 flistTghCutsFromB->Add(hangletracksVSd0D0TGHCfromBpt);
4649
4650 }
4651 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
4652 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4653
4654
4655
4656
4657
4658 // ######### d0 D0 histos ##############
4659 TH1F *hd0D0TGHCfromBPM = new TH1F("hd0D0TGHCfromBPM","D^{0} impact par. plot , Tight Cuts ,FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
4660 hd0D0TGHCfromBPM->SetXTitle("Impact parameter [#mum]");
4661 hd0D0TGHCfromBPM->SetYTitle("Entries");
4662
4663 TH1F *hd0D0VtxTrueTGHCfromBPM = new TH1F("hd0D0VtxTrueTGHCfromBPM","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
4664 hd0D0VtxTrueTGHCfromBPM->SetXTitle("Impact parameter [#mum]");
4665 hd0D0VtxTrueTGHCfromBPM->SetYTitle("Entries");
4666
4667 TH1F *hMCd0D0TGHCfromBPM = new TH1F("hMCd0D0TGHCfromBPM","D^{0} impact par. plot, Tight Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
4668 hMCd0D0TGHCfromBPM->SetXTitle("MC Impact parameter [#mum]");
4669 hMCd0D0TGHCfromBPM->SetYTitle("Entries");
4670
4671 TH1F *hd0D0TGHCfromBSB = new TH1F("hd0D0TGHCfromBSB","D^{0} impact par. plot , Tight Cuts ,FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
ac4c229c 4672 hd0D0TGHCfromBSB->SetXTitle("Impact parameter [#mum]");
4673 hd0D0TGHCfromBSB->SetYTitle("Entries");
4674
4675 TH1F *hd0D0VtxTrueTGHCfromBSB = new TH1F("hd0D0VtxTrueTGHCfromBSB","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
4676 hd0D0VtxTrueTGHCfromBSB->SetXTitle("Impact parameter [#mum]");
4677 hd0D0VtxTrueTGHCfromBSB->SetYTitle("Entries");
4678
4679 TH1F *hMCd0D0TGHCfromBSB = new TH1F("hMCd0D0TGHCfromBSB","D^{0} impact par. plot, Tight Cuts, FromB,Mass Peak (All momenta)",1000,-1000.,1000.);
4680 hMCd0D0TGHCfromBSB->SetXTitle("MC Impact parameter [#mum]");
4681 hMCd0D0TGHCfromBSB->SetYTitle("Entries");
4682
4683 flistTghCutsFromB->Add(hd0D0TGHCfromBPM);
4684 flistTghCutsFromB->Add(hd0D0VtxTrueTGHCfromBPM);
4685 flistTghCutsFromB->Add(hMCd0D0TGHCfromBPM);
4686 flistTghCutsFromB->Add(hd0D0TGHCfromBSB);
4687 flistTghCutsFromB->Add(hd0D0VtxTrueTGHCfromBSB);
4688 flistTghCutsFromB->Add(hMCd0D0TGHCfromBSB);
4689
e047b348 4690 TH1F *hd0D0ptTGHCfromBPM;
4691 TH1F *hMCd0D0ptTGHCfromBPM;
4692 TH1F *hd0D0VtxTrueptTGHCfromBPM;
4693 TH1F *hd0D0ptTGHCfromBSB;
4694 TH1F *hMCd0D0ptTGHCfromBSB;
4695 TH1F *hd0D0VtxTrueptTGHCfromBSB;
ac4c229c 4696 namehist="hd0D0ptTGHCfromB_";
624c07ab 4697 titlehist="D^{0} impact par. plot, Tight Cuts, FromB, ";
4698 for(Int_t i=0;i<fnbins;i++){
4699 strnamept=namehist;
4700 strnamept.Append("PkMss_pt");
4701 strnamept+=i;
4702
4703 strtitlept=titlehist;
4704 strtitlept.Append(" Mass Peak, ");
4705 strtitlept+=fptbins[i];
4706 strtitlept.Append("<= pt <");
4707 strtitlept+=fptbins[i+1];
4708 strtitlept.Append(" [GeV/c]");
4709
e047b348 4710 hd0D0ptTGHCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4711 hd0D0ptTGHCfromBPM->SetXTitle("Impact parameter [#mum] ");
4712 hd0D0ptTGHCfromBPM->SetYTitle("Entries");
4713 flistTghCutsFromB->Add(hd0D0ptTGHCfromBPM);
624c07ab 4714
4715 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 4716 hMCd0D0ptTGHCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4717 hMCd0D0ptTGHCfromBPM->SetXTitle("MC Impact parameter [#mum] ");
4718 hMCd0D0ptTGHCfromBPM->SetYTitle("Entries");
4719 flistTghCutsFromB->Add(hMCd0D0ptTGHCfromBPM);
624c07ab 4720
4721
4722 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 4723 hd0D0VtxTrueptTGHCfromBPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4724 hd0D0VtxTrueptTGHCfromBPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
4725 hd0D0VtxTrueptTGHCfromBPM->SetYTitle("Entries");
4726 flistTghCutsFromB->Add(hd0D0VtxTrueptTGHCfromBPM);
624c07ab 4727
4728 strnamept=namehist;
4729 strnamept.Append("SBMss_pt");
4730 strnamept+=i;
4731
4732 strtitlept=titlehist;
4733 strtitlept.Append(" Side Bands, ");
4734 strtitlept+=fptbins[i];
4735 strtitlept.Append("<= pt <");
4736 strtitlept+=fptbins[i+1];
4737 strtitlept.Append(" [GeV/c]");
4738
e047b348 4739 hd0D0ptTGHCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4740 hd0D0ptTGHCfromBSB->SetXTitle("Impact parameter [#mum] ");
4741 hd0D0ptTGHCfromBSB->SetYTitle("Entries");
4742 flistTghCutsFromB->Add(hd0D0ptTGHCfromBSB);
624c07ab 4743
4744 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 4745 hMCd0D0ptTGHCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4746 hMCd0D0ptTGHCfromBSB->SetXTitle("MC Impact parameter [#mum] ");
4747 hMCd0D0ptTGHCfromBSB->SetYTitle("Entries");
4748 flistTghCutsFromB->Add(hMCd0D0ptTGHCfromBSB);
624c07ab 4749
4750 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 4751 hd0D0VtxTrueptTGHCfromBSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
4752 hd0D0VtxTrueptTGHCfromBSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
4753 hd0D0VtxTrueptTGHCfromBSB->SetYTitle("Entries");
4754 flistTghCutsFromB->Add(hd0D0VtxTrueptTGHCfromBSB);
624c07ab 4755 }
4756
4757
4758
4759 //############ TIGHT CUTS FROM DSTAR HISTOGRAMS ###########
4760 //
4761 //############## global properties histos
e047b348 4762 TH2F *hCPtaVSd0d0TGHCfromDstar=new TH2F("hCPtaVSd0d0TGHCfromDstar","hCPtaVSd0d0_TightCuts_FromDStar",1000,-100000.,100000.,100,-1.,1.);
ac4c229c 4763 TH1F *hSecVtxZTGHCfromDstar=new TH1F("hSecVtxZTGHCfromDstar","hSecVtxZ_TightCuts_FromDStar",1000,-8.,8.);
4764 TH1F *hSecVtxXTGHCfromDstar=new TH1F("hSecVtxXTGHCfromDstar","hSecVtxX_TightCuts_FromDStar",1000,-3000.,3000.);
4765 TH1F *hSecVtxYTGHCfromDstar=new TH1F("hSecVtxYTGHCfromDstar","hSecVtxY_TightCuts_FromDStar",1000,-3000.,3000.);
4766 TH2F *hSecVtxXYTGHCfromDstar=new TH2F("hSecVtxXYTGHCfromDstar","hSecVtxXY_TightCuts_FromDStar",1000,-3000.,3000.,1000,-3000.,3000.);
4767 TH1F *hSecVtxPhiTGHCfromDstar=new TH1F("hSecVtxPhiTGHCfromDstar","hSecVtxPhi_TightCuts_FromDStar",180,-180.1,180.1);
e047b348 4768 TH1F *hd0singlTrackTGHCfromDstar=new TH1F("hd0singlTrackTGHCfromDstar","hd0singlTrackTightCuts_FromDstar",1000,-5000.,5000.);
4769 TH1F *hCPtaTGHCfromDstar=new TH1F("hCPtaTGHCfromDstar","hCPta_TightCuts_FromDStar",100,-1.,1.);
ac4c229c 4770 TH1F *hd0xd0TGHCfromDstar=new TH1F("hd0xd0TGHCfromDstar","hd0xd0_TightCuts_FromDStar",1000,-100000.,100000.);
4771 TH1F *hMassTrueTGHCfromDstar=new TH1F("hMassTrueTGHCfromDstar","D^{0} MC inv. Mass Tight Cuts FromDStar(All momenta)",600,1.600,2.200);
4772 TH1F *hMassTGHCfromDstar=new TH1F("hMassTGHCfromDstar","D^{0} inv. Mass Tight Cuts FromDStar (All momenta)",600,1.600,2.200);
4773 hMassTGHCfromDstar->Sumw2();
4774 TH1F *hMassTrueTGHCfromDstarPM=new TH1F("hMassTrueTGHCfromDstarPM","D^{0} MC inv. Mass Tight Cuts FromDStar, Mass Peak. (All momenta)",600,1.600,2.200);
4775 TH1F *hMassTGHCfromDstarPM=new TH1F("hMassTGHCfromDstarPM","D^{0} inv. Mass Tight Cuts FromDStar (All momenta), MassPeak",600,1.600,2.200);
4776 hMassTGHCfromDstarPM->Sumw2();
4777 TH1F *hMassTrueTGHCfromDstarSB=new TH1F("hMassTrueTGHCfromDstarSB","D^{0} MC inv. Mass in Side Bands Tight Cuts FromDStar(All momenta)",600,1.600,2.200);
4778 TH1F *hMassTGHCfromDstarSB=new TH1F("hMassTGHCfromDstarSB","D^{0} inv. Mass in Side Bands Tight Cuts FromDStar (All momenta)",600,1.600,2.200);
4779 hMassTGHCfromDstarSB->Sumw2();
4780
4781 flistTghCutsFromDstar->Add(hCPtaVSd0d0TGHCfromDstar);
4782 flistTghCutsFromDstar->Add(hSecVtxZTGHCfromDstar);
4783 flistTghCutsFromDstar->Add(hSecVtxYTGHCfromDstar);
4784 flistTghCutsFromDstar->Add(hSecVtxXTGHCfromDstar);
4785 flistTghCutsFromDstar->Add(hSecVtxXYTGHCfromDstar);
4786 flistTghCutsFromDstar->Add(hSecVtxPhiTGHCfromDstar);
e047b348 4787 flistTghCutsFromDstar->Add(hd0singlTrackTGHCfromDstar);
ac4c229c 4788 flistTghCutsFromDstar->Add(hCPtaTGHCfromDstar);
4789 flistTghCutsFromDstar->Add(hd0xd0TGHCfromDstar);
4790 flistTghCutsFromDstar->Add(hMassTrueTGHCfromDstar);
4791 flistTghCutsFromDstar->Add(hMassTGHCfromDstar);
4792 flistTghCutsFromDstar->Add(hMassTrueTGHCfromDstarPM);
4793 flistTghCutsFromDstar->Add(hMassTGHCfromDstarPM);
4794 flistTghCutsFromDstar->Add(hMassTrueTGHCfromDstarSB);
4795 flistTghCutsFromDstar->Add(hMassTGHCfromDstarSB);
624c07ab 4796
e047b348 4797
4798
4799
4800
4801 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
4802 TH1F *hdcaTGHCfromDstar=new TH1F("hdcaTGHCfromDstar","hdca_TightCuts_FromDstar",100,0.,1000.);
4803 hdcaTGHCfromDstar->SetXTitle("dca [#mum]");
4804 hdcaTGHCfromDstar->SetYTitle("Entries");
4805 TH1F *hcosthetastarTGHCfromDstar=new TH1F("hcosthetastarTGHCfromDstar","hCosThetaStar_TightCuts_FromDstar",50,-1.,1.);
4806 hcosthetastarTGHCfromDstar->SetXTitle("cos #theta^{*}");
4807 hcosthetastarTGHCfromDstar->SetYTitle("Entries");
4808 TH1F *hptD0TGHCfromDstar=new TH1F("hptD0TGHCfromDstar","D^{0} transverse momentum distribution",34,ptbinsD0arr);
4809 hptD0TGHCfromDstar->SetXTitle("p_{t} [GeV/c]");
4810 hptD0TGHCfromDstar->SetYTitle("Entries");
4811 TH1F *hptD0VsMaxPtTGHCfromDstar=new TH1F("hptD0VsMaxPtTGHCfromDstar","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
4812 TH2F *hptD0PTallsqrtTGHCfromDstar=new TH2F("hptD0PTallsqrtTGHCfromDstar","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
4813 TH2F *hptD0PTallTGHCfromDstar=new TH2F("hptD0PTallTGHCfromDstar","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
4814 TH2F *hptD0vsptBTGHCfromDstar=new TH2F("hptD0vsptBTGHCfromDstar","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4815 TH2F *hpD0vspBTGHCfromDstar=new TH2F("hpD0vspBTGHCfromDstar","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4816 TH2F *hptD0vsptcquarkTGHCfromDstar=new TH2F("hptD0vsptcquarkTGHCfromDstar","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4817 TH2F *hpD0vspcquarkTGHCfromDstar=new TH2F("hpD0vspcquarkTGHCfromDstar","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
4818 flistTghCutsFromDstar->Add(hdcaTGHCfromDstar);
4819 flistTghCutsFromDstar->Add(hcosthetastarTGHCfromDstar);
4820 flistTghCutsFromDstar->Add(hptD0TGHCfromDstar);
4821 flistTghCutsFromDstar->Add(hptD0VsMaxPtTGHCfromDstar);
4822 flistTghCutsFromDstar->Add(hptD0PTallsqrtTGHCfromDstar);
4823 flistTghCutsFromDstar->Add(hptD0PTallTGHCfromDstar);
4824 flistTghCutsFromDstar->Add(hptD0vsptBTGHCfromDstar);
4825 flistTghCutsFromDstar->Add(hpD0vspBTGHCfromDstar);
4826 flistTghCutsFromDstar->Add(hptD0vsptcquarkTGHCfromDstar);
4827 flistTghCutsFromDstar->Add(hpD0vspcquarkTGHCfromDstar);
4828
4829 TH1F *hd0zD0ptTGHCfromDstar;
cc3209fb 4830 TH1F *hInvMassD0TGHCfromDstar,*hInvMassD0barTGHCfromDstar;
e047b348 4831 TH1F *hetaTGHCfromDstar;
4832 TH2F *hInvMassPtTGHCfromDstar=new TH2F("hInvMassPtTGHCfromDstar","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
d39e8f99 4833 THnSparseF *hSparseTGHCfromDstar=new THnSparseF("hSparseTGHCfromDstar","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
4834 hSparseTGHCfromDstar->SetBinEdges(0,massbins);
4835 hSparseTGHCfromDstar->SetBinEdges(1,massbins);
4836 hSparseTGHCfromDstar->SetBinEdges(2,ptbinsForNsparse);
4837 hSparseTGHCfromDstar->SetBinEdges(3,impparbins);
4838 hSparseTGHCfromDstar->SetBinEdges(4,massHypoBins);
4839 flistTghCutsFromDstar->Add(hSparseTGHCfromDstar);
e047b348 4840 TH1F *hCosPDPBTGHCfromDstar;
4841 TH1F *hCosPcPDTGHCfromDstar;
4842 flistTghCutsFromDstar->Add(hInvMassPtTGHCfromDstar);
4843// %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
4844 TH2F *hd0D0VSd0xd0TGHCfromDstarpt;
4845 TH2F *hangletracksVSd0xd0TGHCfromDstarpt;
4846 TH2F *hangletracksVSd0D0TGHCfromDstarpt;
4847 TH1F *hd0xd0TGHCfromDstarpt;
4848
4849 TH2F *hTOFpidTGHCfromDstar=new TH2F("hTOFpidTGHCfromDstar","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
4850 flistTghCutsFromDstar->Add(hTOFpidTGHCfromDstar);
4851
4852 for(Int_t i=0;i<fnbins;i++){
4853 namehist="hd0zD0ptTGHCfromDstar_pt";
4854 namehist+=i;
4855 titlehist="d0(z) Tight Cuts FromDstarm ptbin=";
4856 titlehist+=i;
4857 hd0zD0ptTGHCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
4858 hd0zD0ptTGHCfromDstar->SetXTitle("d_{0}(z) [#mum]");
4859 hd0zD0ptTGHCfromDstar->SetYTitle("Entries");
4860 flistTghCutsFromDstar->Add(hd0zD0ptTGHCfromDstar);
4861
cc3209fb 4862 namehist="hInvMassD0TGHCfromDstar_pt";
e047b348 4863 namehist+=i;
4864 titlehist="Invariant Mass Tight Cuts FromDstar ptbin=";
4865 titlehist+=i;
cc3209fb 4866 hInvMassD0TGHCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
4867 hInvMassD0TGHCfromDstar->SetXTitle("Invariant Mass [GeV]");
4868 hInvMassD0TGHCfromDstar->SetYTitle("Entries");
4869 flistTghCutsFromDstar->Add(hInvMassD0TGHCfromDstar);
4870
4871 namehist="hInvMassD0barTGHCfromDstar_pt";
4872 namehist+=i;
d39e8f99 4873 titlehist="Invariant Mass D0bar Tight Cuts FromDstar ptbin=";
cc3209fb 4874 titlehist+=i;
4875 hInvMassD0barTGHCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
4876 hInvMassD0barTGHCfromDstar->SetXTitle("Invariant Mass [GeV]");
4877 hInvMassD0barTGHCfromDstar->SetYTitle("Entries");
4878 flistTghCutsFromDstar->Add(hInvMassD0barTGHCfromDstar);
e047b348 4879
4880 namehist="hetaTGHCfromDstar_pt";
4881 namehist+=i;
4882 titlehist="eta Tight Cuts FromDstar ptbin=";
4883 titlehist+=i;
4884 hetaTGHCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
4885 hetaTGHCfromDstar->SetXTitle("Pseudorapidity");
4886 hetaTGHCfromDstar->SetYTitle("Entries");
4887 flistTghCutsFromDstar->Add(hetaTGHCfromDstar);
4888
4889 namehist="hCosPDPBTGHCfromDstar_pt";
4890 namehist+=i;
4891 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
4892 titlehist+=i;
4893 hCosPDPBTGHCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
4894 hCosPDPBTGHCfromDstar->SetXTitle("Cosine between D0 momentum and B momentum");
4895 hCosPDPBTGHCfromDstar->SetYTitle("Entries");
4896 flistTghCutsFromDstar->Add(hCosPDPBTGHCfromDstar);
4897
4898 namehist="hCosPcPDTGHCfromDstar_pt";
4899 namehist+=i;
4900 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
4901 titlehist+=i;
4902 hCosPcPDTGHCfromDstar=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
4903 hCosPcPDTGHCfromDstar->SetXTitle("Cosine between c quark momentum and D0 momentum");
4904 hCosPcPDTGHCfromDstar->SetYTitle("Entries");
4905 flistTghCutsFromDstar->Add(hCosPcPDTGHCfromDstar);
4906
4907 // %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
4908 namehist="hd0xd0TGHCfromDstar_pt";
4909 namehist+=i;
4910 titlehist="d0xd0 Tight Cuts FromDstar ptbin=";
4911 titlehist+=i;
4912 hd0xd0TGHCfromDstarpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
4913 hd0xd0TGHCfromDstarpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
4914 hd0xd0TGHCfromDstarpt->SetYTitle("Entries");
4915 flistTghCutsFromDstar->Add(hd0xd0TGHCfromDstarpt);
4916
4917
4918 namehist="hd0D0VSd0xd0TGHCfromDstar_pt";
4919 namehist+=i;
4920 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts FromDstar ptbin=";
4921 titlehist+=i;
4922 hd0D0VSd0xd0TGHCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
4923 hd0D0VSd0xd0TGHCfromDstarpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4924 hd0D0VSd0xd0TGHCfromDstarpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
4925 flistTghCutsFromDstar->Add(hd0D0VSd0xd0TGHCfromDstarpt);
4926
4927
4928 namehist="hangletracksVSd0xd0TGHCfromDstar_pt";
4929 namehist+=i;
4930 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts FromDstar ptbin=";
4931 titlehist+=i;
4932 hangletracksVSd0xd0TGHCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
4933 hangletracksVSd0xd0TGHCfromDstarpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
4934 hangletracksVSd0xd0TGHCfromDstarpt->SetYTitle(" angle between K and #p tracks [rad]");
4935 flistTghCutsFromDstar->Add(hangletracksVSd0xd0TGHCfromDstarpt);
4936
4937
4938 namehist="hangletracksVSd0D0TGHCfromDstar_pt";
4939 namehist+=i;
4940 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Tight Cuts FromDstar ptbin=";
4941 titlehist+=i;
4942 hangletracksVSd0D0TGHCfromDstarpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
4943 hangletracksVSd0D0TGHCfromDstarpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
4944 hangletracksVSd0D0TGHCfromDstarpt->SetYTitle(" angle between K and #p tracks [rad]");
4945 flistTghCutsFromDstar->Add(hangletracksVSd0D0TGHCfromDstarpt);
4946
4947
4948 }
4949 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
4950 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4951
4952
624c07ab 4953 //########## d0 D0 histos #############
ac4c229c 4954 TH1F *hd0D0TGHCfromDstPM = new TH1F("hd0D0TGHCfromDstarPM","D^{0} impact par. plot , Tight Cuts ,FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
4955 hd0D0TGHCfromDstPM->SetXTitle("Impact parameter [#mum]");
4956 hd0D0TGHCfromDstPM->SetYTitle("Entries");
4957
4958 TH1F *hd0D0VtxTrueTGHCfromDstPM = new TH1F("hd0D0VtxTrueTGHCfromDstarPM","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
4959 hd0D0VtxTrueTGHCfromDstPM->SetXTitle("Impact parameter [#mum]");
4960 hd0D0VtxTrueTGHCfromDstPM->SetYTitle("Entries");
4961
4962 TH1F *hMCd0D0TGHCfromDstPM = new TH1F("hMCd0D0TGHCfromDstarPM","D^{0} impact par. plot, Tight Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
4963 hMCd0D0TGHCfromDstPM->SetXTitle("MC Impact parameter [#mum]");
4964 hMCd0D0TGHCfromDstPM->SetYTitle("Entries");
4965
4966 TH1F *hd0D0TGHCfromDstSB = new TH1F("hd0D0TGHCfromDstarSB","D^{0} impact par. plot , Tight Cuts ,FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
4967 hd0D0TGHCfromDstSB->SetXTitle("Impact parameter [#mum]");
4968 hd0D0TGHCfromDstSB->SetYTitle("Entries");
4969
4970 TH1F *hd0D0VtxTrueTGHCfromDstSB = new TH1F("hd0D0VtxTrueTGHCfromDstarSB","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
4971 hd0D0VtxTrueTGHCfromDstSB->SetXTitle("Impact parameter [#mum]");
4972 hd0D0VtxTrueTGHCfromDstSB->SetYTitle("Entries");
4973
4974 TH1F *hMCd0D0TGHCfromDstSB = new TH1F("hMCd0D0TGHCfromDstarSB","D^{0} impact par. plot, Tight Cuts, FromDStar,Mass Peak (All momenta)",1000,-1000.,1000.);
4975 hMCd0D0TGHCfromDstSB->SetXTitle("MC Impact parameter [#mum]");
4976 hMCd0D0TGHCfromDstSB->SetYTitle("Entries");
4977
4978 flistTghCutsFromDstar->Add(hd0D0TGHCfromDstPM);
4979 flistTghCutsFromDstar->Add(hd0D0VtxTrueTGHCfromDstPM);
4980 flistTghCutsFromDstar->Add(hMCd0D0TGHCfromDstPM);
4981 flistTghCutsFromDstar->Add(hd0D0TGHCfromDstSB);
4982 flistTghCutsFromDstar->Add(hd0D0VtxTrueTGHCfromDstSB);
4983 flistTghCutsFromDstar->Add(hMCd0D0TGHCfromDstSB);
4984
e047b348 4985 TH1F *hd0D0ptTGHCfromDstPM;
4986 TH1F *hMCd0D0ptTGHCfromDstPM;
4987 TH1F *hd0D0VtxTrueptTGHCfromDstPM;
4988 TH1F *hd0D0ptTGHCfromDstSB;
4989 TH1F *hMCd0D0ptTGHCfromDstSB;
4990 TH1F *hd0D0VtxTrueptTGHCfromDstSB;
ac4c229c 4991 namehist="hd0D0ptTGHCfromDstar_";
624c07ab 4992 titlehist="D^{0} impact par. plot, Tight Cuts, FromDStar, ";
4993 for(Int_t i=0;i<fnbins;i++){
4994 strnamept=namehist;
4995 strnamept.Append("PkMss_pt");
4996 strnamept+=i;
4997
4998 strtitlept=titlehist;
4999 strtitlept.Append(" Mass Peak, ");
5000 strtitlept+=fptbins[i];
5001 strtitlept.Append("<= pt <");
5002 strtitlept+=fptbins[i+1];
5003 strtitlept.Append(" [GeV/c]");
5004
e047b348 5005 hd0D0ptTGHCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5006 hd0D0ptTGHCfromDstPM->SetXTitle("Impact parameter [#mum] ");
5007 hd0D0ptTGHCfromDstPM->SetYTitle("Entries");
5008 flistTghCutsFromDstar->Add(hd0D0ptTGHCfromDstPM);
624c07ab 5009
5010 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 5011 hMCd0D0ptTGHCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5012 hMCd0D0ptTGHCfromDstPM->SetXTitle("MC Impact parameter [#mum] ");
5013 hMCd0D0ptTGHCfromDstPM->SetYTitle("Entries");
5014 flistTghCutsFromDstar->Add(hMCd0D0ptTGHCfromDstPM);
624c07ab 5015
5016
5017 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 5018 hd0D0VtxTrueptTGHCfromDstPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5019 hd0D0VtxTrueptTGHCfromDstPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
5020 hd0D0VtxTrueptTGHCfromDstPM->SetYTitle("Entries");
5021 flistTghCutsFromDstar->Add(hd0D0VtxTrueptTGHCfromDstPM);
624c07ab 5022
5023 strnamept=namehist;
5024 strnamept.Append("SBMss_pt");
5025 strnamept+=i;
5026
5027 strtitlept=titlehist;
5028 strtitlept.Append(" Side Bands, ");
5029 strtitlept+=fptbins[i];
5030 strtitlept.Append("<= pt <");
5031 strtitlept+=fptbins[i+1];
5032 strtitlept.Append(" [GeV/c]");
5033
e047b348 5034 hd0D0ptTGHCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5035 hd0D0ptTGHCfromDstSB->SetXTitle("Impact parameter [#mum] ");
5036 hd0D0ptTGHCfromDstSB->SetYTitle("Entries");
5037 flistTghCutsFromDstar->Add(hd0D0ptTGHCfromDstSB);
624c07ab 5038
5039 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 5040 hMCd0D0ptTGHCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5041 hMCd0D0ptTGHCfromDstSB->SetXTitle("MC Impact parameter [#mum] ");
5042 hMCd0D0ptTGHCfromDstSB->SetYTitle("Entries");
5043 flistTghCutsFromDstar->Add(hMCd0D0ptTGHCfromDstSB);
624c07ab 5044
5045 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 5046 hd0D0VtxTrueptTGHCfromDstSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5047 hd0D0VtxTrueptTGHCfromDstSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
5048 hd0D0VtxTrueptTGHCfromDstSB->SetYTitle("Entries");
5049 flistTghCutsFromDstar->Add(hd0D0VtxTrueptTGHCfromDstSB);
624c07ab 5050 }
5051
5052
5053 //############ TIGHT CUTS OTHER HISTOGRAMS ###########
5054 //
5055 //########### global properties histos ###########
5056
e047b348 5057 TH2F *hCPtaVSd0d0TGHCother=new TH2F("hCPtaVSd0d0TGHCother","hCPtaVSd0d0_TightCuts_other",1000,-100000.,100000.,100,-1.,1.);
ac4c229c 5058 TH1F *hSecVtxZTGHCother=new TH1F("hSecVtxZTGHCother","hSecVtxZ_TightCuts_other",1000,-8.,8.);
5059 TH1F *hSecVtxXTGHCother=new TH1F("hSecVtxXTGHCother","hSecVtxX_TightCuts_other",1000,-3000.,3000.);
5060 TH1F *hSecVtxYTGHCother=new TH1F("hSecVtxYTGHCother","hSecVtxY_TightCuts_other",1000,-3000.,3000.);
5061 TH2F *hSecVtxXYTGHCother=new TH2F("hSecVtxXYTGHCother","hSecVtxXY_TightCuts_other",1000,-3000.,3000.,1000,-3000.,3000.);
5062 TH1F *hSecVtxPhiTGHCother=new TH1F("hSecVtxPhiTGHCother","hSecVtxPhi_TightCuts_other",180,-180.1,180.1);
e047b348 5063 TH1F *hd0singlTrackTGHCother=new TH1F("hd0singlTrackTGHCother","hd0singlTrackTightCuts_Other",1000,-5000.,5000.);
5064 TH1F *hCPtaTGHCother=new TH1F("hCPtaTGHCother","hCPta_TightCuts_other",100,-1.,1.);
ac4c229c 5065 TH1F *hd0xd0TGHCother=new TH1F("hd0xd0TGHCother","hd0xd0_TightCuts_other",1000,-100000.,100000.);
5066 TH1F *hMassTrueTGHCother=new TH1F("hMassTrueTGHCother","D^{0} MC inv. Mass Tight Cuts other(All momenta)",600,1.600,2.200);
5067 TH1F *hMassTGHCother=new TH1F("hMassTGHCother","D^{0} inv. Mass Tight Cuts other (All momenta)",600,1.600,2.200);
5068 hMassTGHCother->Sumw2();
5069 TH1F *hMassTrueTGHCotherPM=new TH1F("hMassTrueTGHCotherPM","D^{0} MC inv. Mass Tight Cuts other, Mass Peak. (All momenta)",600,1.600,2.200);
5070 TH1F *hMassTGHCotherPM=new TH1F("hMassTGHCotherPM","D^{0} inv. Mass Tight Cuts other (All momenta), MassPeak",600,1.600,2.200);
5071 hMassTGHCotherPM->Sumw2();
5072 TH1F *hMassTrueTGHCotherSB=new TH1F("hMassTrueTGHCotherSB","D^{0} MC inv. Mass in Side Bands Tight Cuts other(All momenta)",600,1.600,2.200);
5073 TH1F *hMassTGHCotherSB=new TH1F("hMassTGHCotherSB","D^{0} inv. Mass in Side Bands Tight Cuts other (All momenta)",600,1.600,2.200);
5074 hMassTGHCotherSB->Sumw2();
5075
5076 flistTghCutsOther->Add(hCPtaVSd0d0TGHCother);
5077 flistTghCutsOther->Add(hSecVtxZTGHCother);
5078 flistTghCutsOther->Add(hSecVtxYTGHCother);
5079 flistTghCutsOther->Add(hSecVtxXTGHCother);
5080 flistTghCutsOther->Add(hSecVtxXYTGHCother);
5081 flistTghCutsOther->Add(hSecVtxPhiTGHCother);
e047b348 5082 flistTghCutsOther->Add(hd0singlTrackTGHCother);
ac4c229c 5083 flistTghCutsOther->Add(hCPtaTGHCother);
5084 flistTghCutsOther->Add(hd0xd0TGHCother);
5085 flistTghCutsOther->Add(hMassTrueTGHCother);
5086 flistTghCutsOther->Add(hMassTGHCother);
5087 flistTghCutsOther->Add(hMassTrueTGHCotherPM);
5088 flistTghCutsOther->Add(hMassTGHCotherPM);
5089 flistTghCutsOther->Add(hMassTrueTGHCotherSB);
5090 flistTghCutsOther->Add(hMassTGHCotherSB);
624c07ab 5091
e047b348 5092
5093
5094
5095 //%%% NEW HISTOS %%%%%%%%%%%%%%%%
5096 TH1F *hdcaTGHCother=new TH1F("hdcaTGHCother","hdca_TightCuts_Other",100,0.,1000.);
5097 hdcaTGHCother->SetXTitle("dca [#mum]");
5098 hdcaTGHCother->SetYTitle("Entries");
5099 TH1F *hcosthetastarTGHCother=new TH1F("hcosthetastarTGHCother","hCosThetaStar_TightCuts_Other",50,-1.,1.);
5100 hcosthetastarTGHCother->SetXTitle("cos #theta^{*}");
5101 hcosthetastarTGHCother->SetYTitle("Entries");
5102 TH1F *hptD0TGHCother=new TH1F("hptD0TGHCother","D^{0} transverse momentum distribution",34,ptbinsD0arr);
5103 hptD0TGHCother->SetXTitle("p_{t} [GeV/c]");
5104 hptD0TGHCother->SetYTitle("Entries");
5105 TH1F *hptD0VsMaxPtTGHCother=new TH1F("hptD0VsMaxPtTGHCother","Difference between D^{0} pt and highest (or second) pt",400,-50.,50.);
5106 TH2F *hptD0PTallsqrtTGHCother=new TH2F("hptD0PTallsqrtTGHCother","D^{0} pt Vs Sqrt(Sum pt square)",34,ptbinsD0arr,200,dumbinning);
5107 TH2F *hptD0PTallTGHCother=new TH2F("hptD0PTallTGHCother","D^{0} pt Vs Sum pt ",34,ptbinsD0arr,200,dumbinning);
5108 TH2F *hptD0vsptBTGHCother=new TH2F("hptD0vsptBTGHCother","D^{0} pt Vs B pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
5109 TH2F *hpD0vspBTGHCother=new TH2F("hpD0vspBTGHCother","D^{0} tot momentum Vs B tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
5110 TH2F *hptD0vsptcquarkTGHCother=new TH2F("hptD0vsptcquarkTGHCother","D^{0} pt Vs cquark pt distribution",34,ptbinsD0arr,34,ptbinsD0arr);
5111 TH2F *hpD0vspcquarkTGHCother=new TH2F("hpD0vspcquarkTGHCother","D^{0} tot momentum Vs cquark tot momentum distribution",34,ptbinsD0arr,34,ptbinsD0arr);
5112 flistTghCutsOther->Add(hdcaTGHCother);
5113 flistTghCutsOther->Add(hcosthetastarTGHCother);
5114 flistTghCutsOther->Add(hptD0TGHCother);
5115 flistTghCutsOther->Add(hptD0VsMaxPtTGHCother);
5116 flistTghCutsOther->Add(hptD0PTallsqrtTGHCother);
5117 flistTghCutsOther->Add(hptD0PTallTGHCother);
5118 flistTghCutsOther->Add(hptD0vsptBTGHCother);
5119 flistTghCutsOther->Add(hpD0vspBTGHCother);
5120 flistTghCutsOther->Add(hptD0vsptcquarkTGHCother);
5121 flistTghCutsOther->Add(hpD0vspcquarkTGHCother);
5122
5123 TH1F *hd0zD0ptTGHCother;
cc3209fb 5124 TH1F *hInvMassD0TGHCother,*hInvMassD0barTGHCother;
e047b348 5125 TH2F *hInvMassPtTGHCother=new TH2F("hInvMassPtTGHCother","Candidate p_{t} Vs invariant mass",330,1.700,2.030,200,0.,20.);
d39e8f99 5126 THnSparseF *hSparseTGHCother=new THnSparseF("hSparseTGHCother","Candidate Masses, pt, Imp Par;massD0;massD0bar;pt;impactpar;selcase",5,nbinsSparse);
5127 hSparseTGHCother->SetBinEdges(0,massbins);
5128 hSparseTGHCother->SetBinEdges(1,massbins);
5129 hSparseTGHCother->SetBinEdges(2,ptbinsForNsparse);
5130 hSparseTGHCother->SetBinEdges(3,impparbins);
5131 hSparseTGHCother->SetBinEdges(4,massHypoBins);
5132 flistTghCutsOther->Add(hSparseTGHCother);
e047b348 5133 TH1F *hetaTGHCother;
5134 TH1F *hCosPDPBTGHCother;
5135 TH1F *hCosPcPDTGHCother;
5136 flistTghCutsOther->Add(hInvMassPtTGHCother);
5137// %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
5138 TH2F *hd0D0VSd0xd0TGHCotherpt;
5139 TH2F *hangletracksVSd0xd0TGHCotherpt;
5140 TH2F *hangletracksVSd0D0TGHCotherpt;
5141 TH1F *hd0xd0TGHCotherpt;
5142
5143 TH2F *hTOFpidTGHCother=new TH2F("hTOFpidTGHCother","TOF time VS momentum",10,0.,4.,50,-50000.,50000.);
5144 flistTghCutsOther->Add(hTOFpidTGHCother);
5145
5146 for(Int_t i=0;i<fnbins;i++){
5147 namehist="hd0zD0ptTGHCother_pt";
5148 namehist+=i;
5149 titlehist="d0(z) Tight Cuts Otherm ptbin=";
5150 titlehist+=i;
5151 hd0zD0ptTGHCother=new TH1F(namehist.Data(),titlehist.Data(),1000,-3000,3000.);
5152 hd0zD0ptTGHCother->SetXTitle("d_{0}(z) [#mum]");
5153 hd0zD0ptTGHCother->SetYTitle("Entries");
5154 flistTghCutsOther->Add(hd0zD0ptTGHCother);
5155
cc3209fb 5156 namehist="hInvMassD0TGHCother_pt";
e047b348 5157 namehist+=i;
5158 titlehist="Invariant Mass Tight Cuts Other ptbin=";
5159 titlehist+=i;
cc3209fb 5160 hInvMassD0TGHCother=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
5161 hInvMassD0TGHCother->SetXTitle("Invariant Mass [GeV]");
5162 hInvMassD0TGHCother->SetYTitle("Entries");
5163 flistTghCutsOther->Add(hInvMassD0TGHCother);
5164
5165 namehist="hInvMassD0barTGHCother_pt";
5166 namehist+=i;
d39e8f99 5167 titlehist="Invariant Mass D0bar Tight Cuts Other ptbin=";
cc3209fb 5168 titlehist+=i;
5169 hInvMassD0barTGHCother=new TH1F(namehist.Data(),titlehist.Data(),600,1.600,2.200);
5170 hInvMassD0barTGHCother->SetXTitle("Invariant Mass [GeV]");
5171 hInvMassD0barTGHCother->SetYTitle("Entries");
5172 flistTghCutsOther->Add(hInvMassD0barTGHCother);
e047b348 5173
5174 namehist="hetaTGHCother_pt";
5175 namehist+=i;
5176 titlehist="eta Tight Cuts Other ptbin=";
5177 titlehist+=i;
5178 hetaTGHCother=new TH1F(namehist.Data(),titlehist.Data(),100,-3.,3.);
5179 hetaTGHCother->SetXTitle("Pseudorapidity");
5180 hetaTGHCother->SetYTitle("Entries");
5181 flistTghCutsOther->Add(hetaTGHCother);
5182
5183 namehist="hCosPDPBTGHCother_pt";
5184 namehist+=i;
5185 titlehist="Cosine between D0 momentum and B momentum, ptbin=";
5186 titlehist+=i;
5187 hCosPDPBTGHCother=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
5188 hCosPDPBTGHCother->SetXTitle("Cosine between D0 momentum and B momentum");
5189 hCosPDPBTGHCother->SetYTitle("Entries");
5190 flistTghCutsOther->Add(hCosPDPBTGHCother);
5191
5192 namehist="hCosPcPDTGHCother_pt";
5193 namehist+=i;
5194 titlehist="Cosine between cquark momentum and D0 momentum, ptbin=";
5195 titlehist+=i;
5196 hCosPcPDTGHCother=new TH1F(namehist.Data(),titlehist.Data(),50,-1.,1.);
5197 hCosPcPDTGHCother->SetXTitle("Cosine between c quark momentum and D0 momentum");
5198 hCosPcPDTGHCother->SetYTitle("Entries");
5199 flistTghCutsOther->Add(hCosPcPDTGHCother);
5200
5201// %%%%%%%%%%% HERE THE ADDITIONAL HISTS %%%%%%%%%%%%%%%%%
5202 namehist="hd0xd0TGHCother_pt";
5203 namehist+=i;
5204 titlehist="d0xd0 Tight Cuts Other ptbin=";
5205 titlehist+=i;
5206 hd0xd0TGHCotherpt=new TH1F(namehist.Data(),titlehist.Data(),1000,-50000.,10000.);
5207 hd0xd0TGHCotherpt->SetXTitle("d_{0}^{K}xd_{0}^{#pi} [#mum^2]");
5208 hd0xd0TGHCotherpt->SetYTitle("Entries");
5209 flistTghCutsOther->Add(hd0xd0TGHCotherpt);
5210
5211
5212 namehist="hd0D0VSd0xd0TGHCother_pt";
5213 namehist+=i;
5214 titlehist="d_{0}^{D^{0}} Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts Other ptbin=";
5215 titlehist+=i;
5216 hd0D0VSd0xd0TGHCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,100,-300,300);
5217 hd0D0VSd0xd0TGHCotherpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
5218 hd0D0VSd0xd0TGHCotherpt->SetYTitle(" d_{0}^{D^{0}} [#mum]");
5219 flistTghCutsOther->Add(hd0D0VSd0xd0TGHCotherpt);
5220
5221
5222 namehist="hangletracksVSd0xd0TGHCother_pt";
5223 namehist+=i;
5224 titlehist="Angle between K and #pi tracks Vs d_{0}^{K}xd_{0}^{#pi} Tight Cuts Other ptbin=";
5225 titlehist+=i;
5226 hangletracksVSd0xd0TGHCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-50000.,30000.,40,-0.1,3.24);
5227 hangletracksVSd0xd0TGHCotherpt->SetXTitle(" d_{0}^{K}xd_{0}^{#pi} [#mum]");
5228 hangletracksVSd0xd0TGHCotherpt->SetYTitle(" angle between K and #p tracks [rad]");
5229 flistTghCutsOther->Add(hangletracksVSd0xd0TGHCotherpt);
5230
5231
5232 namehist="hangletracksVSd0D0TGHCother_pt";
5233 namehist+=i;
5234 titlehist="Angle between K and #pi tracks Vs d_{0}^{D^{0}} Tight Cuts Other ptbin=";
5235 titlehist+=i;
5236 hangletracksVSd0D0TGHCotherpt=new TH2F(namehist.Data(),titlehist.Data(),200,-400.,400.,40,-0.12,3.24);
5237 hangletracksVSd0D0TGHCotherpt->SetXTitle(" d_{0}^{D^{0}} [#mum]");
5238 hangletracksVSd0D0TGHCotherpt->SetYTitle(" angle between K and #p tracks [rad]");
5239 flistTghCutsOther->Add(hangletracksVSd0D0TGHCotherpt);
5240
5241 }
5242 // %%%%%%%% END OF NEW HISTOS %%%%%%%%%%%%%
5243 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5244
5245
5246
5247
5248
624c07ab 5249 //############# d0 D0 histos ###############à
ac4c229c 5250 TH1F *hd0D0TGHCotherPM = new TH1F("hd0D0TGHCotherPM","D^{0} impact par. plot , Tight Cuts ,Other,Mass Peak (All momenta)",1000,-1000.,1000.);
5251 hd0D0TGHCotherPM->SetXTitle("Impact parameter [#mum]");
5252 hd0D0TGHCotherPM->SetYTitle("Entries");
5253
5254 TH1F *hd0D0VtxTrueTGHCotherPM = new TH1F("hd0D0VtxTrueTGHCotherPM","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
5255 hd0D0VtxTrueTGHCotherPM->SetXTitle("Impact parameter [#mum]");
5256 hd0D0VtxTrueTGHCotherPM->SetYTitle("Entries");
5257
5258 TH1F *hMCd0D0TGHCotherPM = new TH1F("hMCd0D0TGHCotherPM","D^{0} impact par. plot, Tight Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
5259 hMCd0D0TGHCotherPM->SetXTitle("MC Impact parameter [#mum]");
5260 hMCd0D0TGHCotherPM->SetYTitle("Entries");
5261
5262 TH1F *hd0D0TGHCotherSB = new TH1F("hd0D0TGHCotherSB","D^{0} impact par. plot , Tight Cuts ,Other,Mass Peak (All momenta)",1000,-1000.,1000.);
5263 hd0D0TGHCotherSB->SetXTitle("Impact parameter [#mum]");
5264 hd0D0TGHCotherSB->SetYTitle("Entries");
5265
5266 TH1F *hd0D0VtxTrueTGHCotherSB = new TH1F("hd0D0VtxTrueTGHCotherSB","D^{0} impact par. w.r.t. True Vtx, Tight Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
5267 hd0D0VtxTrueTGHCotherSB->SetXTitle("Impact parameter [#mum]");
5268 hd0D0VtxTrueTGHCotherSB->SetYTitle("Entries");
5269
5270 TH1F *hMCd0D0TGHCotherSB = new TH1F("hMCd0D0TGHCotherSB","D^{0} impact par. plot, Tight Cuts, Other,Mass Peak (All momenta)",1000,-1000.,1000.);
5271 hMCd0D0TGHCotherSB->SetXTitle("MC Impact parameter [#mum]");
5272 hMCd0D0TGHCotherSB->SetYTitle("Entries");
5273
5274 flistTghCutsOther->Add(hd0D0TGHCotherPM);
5275 flistTghCutsOther->Add(hd0D0VtxTrueTGHCotherPM);
5276 flistTghCutsOther->Add(hMCd0D0TGHCotherPM);
5277 flistTghCutsOther->Add(hd0D0TGHCotherSB);
5278 flistTghCutsOther->Add(hd0D0VtxTrueTGHCotherSB);
5279 flistTghCutsOther->Add(hMCd0D0TGHCotherSB);
5280
e047b348 5281 TH1F *hd0D0ptTGHCotherPM;
5282 TH1F *hMCd0D0ptTGHCotherPM;
5283 TH1F *hd0D0VtxTrueptTGHCotherPM;
5284 TH1F *hd0D0ptTGHCotherSB;
5285 TH1F *hMCd0D0ptTGHCotherSB;
5286 TH1F *hd0D0VtxTrueptTGHCotherSB;
ac4c229c 5287 namehist="hd0D0ptTGHCother_";
624c07ab 5288 titlehist="D^{0} impact par. plot, Tight Cuts, Other, ";
5289 for(Int_t i=0;i<fnbins;i++){
5290 strnamept=namehist;
5291 strnamept.Append("PkMss_pt");
5292 strnamept+=i;
5293
5294 strtitlept=titlehist;
5295 strtitlept.Append(" Mass Peak, ");
5296 strtitlept+=fptbins[i];
5297 strtitlept.Append("<= pt <");
5298 strtitlept+=fptbins[i+1];
5299 strtitlept.Append(" [GeV/c]");
5300
e047b348 5301 hd0D0ptTGHCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5302 hd0D0ptTGHCotherPM->SetXTitle("Impact parameter [#mum] ");
5303 hd0D0ptTGHCotherPM->SetYTitle("Entries");
5304 flistTghCutsOther->Add(hd0D0ptTGHCotherPM);
624c07ab 5305
5306 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 5307 hMCd0D0ptTGHCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5308 hMCd0D0ptTGHCotherPM->SetXTitle("MC Impact parameter [#mum] ");
5309 hMCd0D0ptTGHCotherPM->SetYTitle("Entries");
5310 flistTghCutsOther->Add(hMCd0D0ptTGHCotherPM);
624c07ab 5311
5312
5313 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 5314 hd0D0VtxTrueptTGHCotherPM = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5315 hd0D0VtxTrueptTGHCotherPM->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
5316 hd0D0VtxTrueptTGHCotherPM->SetYTitle("Entries");
5317 flistTghCutsOther->Add(hd0D0VtxTrueptTGHCotherPM);
624c07ab 5318
5319 strnamept=namehist;
5320 strnamept.Append("SBMss_pt");
5321 strnamept+=i;
5322
5323 strtitlept=titlehist;
5324 strtitlept.Append(" Side Bands, ");
5325 strtitlept+=fptbins[i];
5326 strtitlept.Append("<= pt <");
5327 strtitlept+=fptbins[i+1];
5328 strtitlept.Append(" [GeV/c]");
5329
e047b348 5330 hd0D0ptTGHCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5331 hd0D0ptTGHCotherSB->SetXTitle("Impact parameter [#mum] ");
5332 hd0D0ptTGHCotherSB->SetYTitle("Entries");
5333 flistTghCutsOther->Add(hd0D0ptTGHCotherSB);
624c07ab 5334
5335 strnamept.ReplaceAll("hd0D0","hMCd0D0");
e047b348 5336 hMCd0D0ptTGHCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5337 hMCd0D0ptTGHCotherSB->SetXTitle("MC Impact parameter [#mum] ");
5338 hMCd0D0ptTGHCotherSB->SetYTitle("Entries");
5339 flistTghCutsOther->Add(hMCd0D0ptTGHCotherSB);
624c07ab 5340
5341 strnamept.ReplaceAll("hMCd0D0","hd0D0VtxTrue");
e047b348 5342 hd0D0VtxTrueptTGHCotherSB = new TH1F(strnamept.Data(),strtitlept.Data(),1000,-1000.,1000.);
5343 hd0D0VtxTrueptTGHCotherSB->SetXTitle("Impact parameter w.r.t. True Vtx [#mum] ");
5344 hd0D0VtxTrueptTGHCotherSB->SetYTitle("Entries");
5345 flistTghCutsOther->Add(hd0D0VtxTrueptTGHCotherSB);
624c07ab 5346 }
e047b348 5347 Printf("AFTER DATA HISTOS CREATION \n");
d2027626 5348
5349 delete ptbinlimitsCxyLxy;
cb665049 5350
5351
5352 PostData(1,fNentries);
5353 PostData(2,fSignalType);
5354 PostData(3,fSignalTypeLsCuts);
5355 PostData(4,fSignalTypeTghCuts);
5356 PostData(5,fCounter);
5357 PostData(6,flistMCproperties);
5358 PostData(7,flistNoCutsSignal);
5359 PostData(8,flistNoCutsBack);
5360 PostData(9,flistNoCutsFromB);
5361 PostData(10,flistNoCutsFromDstar);
5362 PostData(11,flistNoCutsOther);
5363 PostData(12,flistLsCutsSignal);
5364 PostData(13,flistLsCutsBack);
5365 PostData(14,flistLsCutsFromB);
5366 PostData(15,flistLsCutsFromDstar);
5367 PostData(16,flistLsCutsOther);
5368 PostData(17,flistTghCutsSignal);
5369 PostData(18,flistTghCutsBack);
5370 PostData(19,flistTghCutsFromB);
5371 PostData(20,flistTghCutsFromDstar);
5372 PostData(21,flistTghCutsOther);
5373
d2027626 5374 return;
5375
624c07ab 5376}
5377
a9f921f5 5378
5379
5380
5381
624c07ab 5382//________________________________________________________________________
5383void AliAnalysisTaskSECharmFraction::UserExec(Option_t */*option*/)
5384{
5385 // Execute analysis for current event:
5386 // heavy flavor candidates association to MC truth
5387
5388 AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
e047b348 5389 if (!aod) {
5390 Printf("ERROR: aod not available");
5391 return;
5392 }
5393 TClonesArray *arrayD0toKpi;
b557eb43 5394 if(!aod && AODEvent() && IsStandardAOD()) {
5395 // In case there is an AOD handler writing a standard AOD, use the AOD
5396 // event in memory rather than the input (ESD) event.
5397 aod = dynamic_cast<AliAODEvent*> (AODEvent());
5398 // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
5399 // have to taken from the AOD event hold by the AliAODExtension
5400 AliAODHandler* aodHandler = (AliAODHandler*)
5401 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
e047b348 5402
b557eb43 5403 if(aodHandler->GetExtensions()) {
5404 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
e047b348 5405 AliAODEvent* aodFromExt = ext->GetAOD();
5406 if(fLikeSign){
5407 // load 2Prong Like Sign
5408 arrayD0toKpi =(TClonesArray*)aodFromExt->GetList()->FindObject("LikeSign2Prong");
5409 if(!arrayD0toKpi) {
5410 Printf("AliAnalysisTaskSECharmFraction::UserExec: LikeSign branch not found!\n");
5411 return;
5412 }
5413 }
5414 else {
5415 // load D0->Kpi candidates
5416 arrayD0toKpi = (TClonesArray*)aodFromExt->GetList()->FindObject("D0toKpi");
5417 if(!arrayD0toKpi) {
5418 Printf("AliAnalysisTaskSECharmFraction::UserExec: D0toKpi branch not found!\n");
5419 return;
5420 }
5421 }
b557eb43 5422 }
5423 } else {
e047b348 5424 if(fLikeSign){
5425 // load 2Prong Like Sign
5426 arrayD0toKpi =(TClonesArray*)aod->GetList()->FindObject("LikeSign2Prong");
5427 if(!arrayD0toKpi) {
5428 Printf("AliAnalysisTaskSECharmFraction::UserExec: LikeSign branch not found!\n");
5429 return;
5430 }
5431 }
5432 else {
5433 // load D0->Kpi candidates
5434 arrayD0toKpi = (TClonesArray*)aod->GetList()->FindObject("D0toKpi");
5435 if(!arrayD0toKpi) {
5436 Printf("AliAnalysisTaskSECharmFraction::UserExec: D0toKpi branch not found!\n");
5437 return;
5438 }
5439 }
b557eb43 5440 }
8931c313 5441
e047b348 5442
624c07ab 5443 if(!arrayD0toKpi) {
e047b348 5444 printf("AliAnalysisTaskSECharmFraction::UserExec: input branch not found!\n");
624c07ab 5445 return;
5446 }
7c23877d 5447
d39e8f99 5448 //histogram filled with 1 for every AOD
5449 fNentries->Fill(0);
1879baec 5450 fCounter->StoreEvent(aod,fCutsLoose,fReadMC);
d39e8f99 5451
5452 // trigger class for PbPb C0SMH-B-NOPF-ALLNOTRD, C0SMH-B-NOPF-ALL
5453 // TString trigclass=aod->GetFiredTriggerClasses();
5454 // if(trigclass.Contains("C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains("C0SMH-B-NOPF-ALL")) fNentries->Fill(14);
bd0c851a 5455
5456 Int_t nSelectedloose=0, nSelectedtight=0;
5457
d39e8f99 5458 Bool_t isEventSelTGHT=kTRUE,isEventSelLOOSE=kTRUE;
5459 if(!fCutsTight->IsEventSelected(aod)){
5460 isEventSelTGHT=kFALSE;
5461 if(fCutsTight->GetWhyRejection()==1){
5462 // rejected for pileup
77ed0cdb 5463 fNentries->Fill(2);
5464 }
5465 if(fCutsTight->GetWhyRejection()==6){
5466 // |prim Vtx Zspd| > acceptable
5467 fNentries->Fill(4);
d39e8f99 5468 }
5469 }
77ed0cdb 5470 else {
5471 fNentries->Fill(1);
5472 }
d39e8f99 5473 if(!fCutsLoose->IsEventSelected(aod)){
5474 isEventSelLOOSE=kFALSE;
5475 if(fCutsLoose->GetWhyRejection()==1){
5476 // rejected for pileup
77ed0cdb 5477 fNentries->Fill(9);
5478
5479 }
5480 if(fCutsLoose->GetWhyRejection()==6){
5481 // |prim Vtx Z| > acceptable
5482 fNentries->Fill(11);
d39e8f99 5483 }
5484 }
77ed0cdb 5485 else {
5486 fNentries->Fill(8);
5487 }
d39e8f99 5488
5489 if(!(isEventSelTGHT||isEventSelLOOSE)){
5490 PostData(1,fNentries);
5491 return;
5492 }
e047b348 5493 // fix for temporary bug in ESDfilter
7c23877d 5494 // the AODs with null vertex pointer didn't pass the PhysSel
77ed0cdb 5495 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001){
5496 if(isEventSelTGHT)fNentries->Fill(19);
5497 if(isEventSelLOOSE)fNentries->Fill(20);
5498 PostData(1,fNentries);
5499 return;
5500 }
624c07ab 5501 // AOD primary vertex
5502 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
d39e8f99 5503 TString primTitle = vtx1->GetTitle();
77ed0cdb 5504 if(primTitle.Contains("VertexerTracks") && vtx1->GetNContributors()>0) {
5505
5506 if(isEventSelTGHT)fNentries->Fill(3);
5507 if(isEventSelLOOSE)fNentries->Fill(10);
d39e8f99 5508 }
5509 else {
5510 PostData(1,fNentries);
5511 return;
5512
5513 }
5514
77ed0cdb 5515 // FILL n-tracks counter
5516 if(isEventSelTGHT)fNentries->Fill(5,aod->GetNumberOfTracks());
5517 if(isEventSelLOOSE)fNentries->Fill(12,aod->GetNumberOfTracks());
5518
5519
5520 Bool_t aziListIsFilled=kFALSE;
5521 Double_t azilist[30000];
5522 Int_t trkIDlist[30000],nprim=0;
5523
5524
5525 for(Int_t ephi=0;ephi<30000;ephi++){
5526 azilist[ephi]=-999.;
5527 trkIDlist[ephi]=-999;
5528 }
5529 //aziListIsFilled=kFALSE;
5530
5531
5532
5533
d39e8f99 5534
e047b348 5535 TClonesArray *arrayMC=0x0;
5536 AliAODMCHeader *aodmcHeader=0x0;
624c07ab 5537 Double_t vtxTrue[3];
77ed0cdb 5538
5539
bf74e6db 5540 if(fReadMC){
5541 // load MC particles
5542 arrayMC =
5543 (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
5544 if(!arrayMC) {
5545 Printf("AliAnalysisTaskSECharmFraction::UserExec: MC particles branch not found!\n");
5546 return;
5547 }
bf74e6db 5548 // load MC header
5549 aodmcHeader =
5550 (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
5551 if(!aodmcHeader) {
5552 Printf("AliAnalysisTaskSECharmFraction::UserExec: MC header branch not found!\n");
5553 return;
5554 }
bf74e6db 5555 // MC primary vertex
5556 aodmcHeader->GetVertex(vtxTrue);
e047b348 5557 // FILL HISTOS FOR D0 mesons, c quarks and D0 from B properties
5558 FillHistoMCproperties(arrayMC);
624c07ab 5559 }
d39e8f99 5560
e047b348 5561
624c07ab 5562
5563 //Printf("There are %d tracks in this event", aod->GetNumberOfTracks());
5564 // Int_t nTotHF=0,nTotDstar=0,nTot3Prong=0;
5565 Int_t nTotD0toKpi=0;
e047b348 5566 Int_t okd0tight,okd0bartight,okd0loose,okd0barloose,okd0tightnopid,okd0bartightnopid;
77ed0cdb 5567 Bool_t defaultNC=kTRUE;
624c07ab 5568 Bool_t isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,isSideBand;
ac4c229c 5569 Bool_t isinacceptance;
624c07ab 5570 Int_t signallevel=-1;
e047b348 5571 Int_t ptbin,nVtx;
624c07ab 5572 // const Int_t nptbins=10;
5573 Double_t invMassD0,invMassD0bar,ptD0,massmumtrue;
5574
5575
e047b348 5576 AliAODRecoDecayHF *aodDMC=0x0;// to be used to create a fake true sec vertex
77ed0cdb 5577 // make trkIDtoEntry register (temporary)
5578
5579 if(fFastAnalysis<1){
5580 Int_t trkIDtoEntry[100000];
5581 fptAll=0.;
5582 fptAllSq=0.;
5583 fptMax[0]=0.;
5584 fptMax[1]=0.;
5585 fptMax[2]=0.;
5586 for(Int_t it=0;it<aod->GetNumberOfTracks();it++) {
5587 AliAODTrack *track = aod->GetTrack(it);
5588 fptAll+=track->Pt();
5589 fptAllSq+=track->Pt()*track->Pt();
5590 if(track->Pt()>fptMax[0]){
5591 fptMax[2]=fptMax[1];
5592 fptMax[1]=fptMax[0];
5593 fptMax[0]=track->Pt();
5594 }
5595 else if(track->Pt()>fptMax[1]){
5596 fptMax[2]=fptMax[1];
5597 fptMax[1]=track->Pt();
5598 }
5599 else if(track->Pt()>fptMax[2])fptMax[2]=track->Pt();
5600 if(track->GetID()<0) {
5601 if(isEventSelTGHT)fNentries->Fill(19);
5602 if(isEventSelLOOSE)fNentries->Fill(20);
5603 //printf("Track ID <0, id= %d\n",track->GetID());
5604 PostData(1,fNentries);
5605 return;
5606 }
5607 trkIDtoEntry[track->GetID()]=it;
624c07ab 5608 }
624c07ab 5609 }
e047b348 5610
624c07ab 5611 // loop over D0->Kpi candidates
5612 Int_t nD0toKpi = arrayD0toKpi->GetEntriesFast();
5613 nTotD0toKpi += nD0toKpi;
77ed0cdb 5614 // fille D0 candidate counter
5615 if(isEventSelTGHT)fNentries->Fill(6,nD0toKpi);
5616 if(isEventSelLOOSE)fNentries->Fill(13,nD0toKpi);
5617
624c07ab 5618 // cout<<"Number of D0->Kpi: "<<nD0toKpi<<endl;
5619
5620 for (Int_t iD0toKpi = 0; iD0toKpi < nD0toKpi; iD0toKpi++) {
e047b348 5621 if(aodDMC!=0x0)delete aodDMC;
624c07ab 5622
77ed0cdb 5623 defaultNC=kTRUE;
624c07ab 5624 isPeakD0=kFALSE;
5625 isPeakD0bar=kFALSE;
5626 isSideBandD0=kFALSE;
5627 isSideBandD0bar=kFALSE;
5628 isSideBand=kFALSE;
c387e585 5629 isinacceptance=kFALSE;
ac4c229c 5630 okd0tight=0;
5631 okd0bartight=0;
e047b348 5632 okd0tightnopid=0;
5633 okd0bartightnopid=0;
ac4c229c 5634 okd0loose=0;
5635 okd0barloose=0;
624c07ab 5636
5637 signallevel=-1;
5638
5639
5640 AliAODRecoDecayHF2Prong *d = (AliAODRecoDecayHF2Prong*)arrayD0toKpi->UncheckedAt(iD0toKpi);
77ed0cdb 5641 // Bool_t unsetvtx=kFALSE;
5642// if(!d->GetOwnPrimaryVtx()) {
5643// d->SetOwnPrimaryVtx(vtx1); // needed to compute all variables
5644// unsetvtx=kTRUE;
5645// }
5646
5647 //recalculate vertex w/o daughters
5648 AliAODVertex *origownvtx=0x0;
5649 if(fCleanCandOwnVtx){
5650 if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
5651 if(!fCutsTight->RecalcOwnPrimaryVtx(d,aod)) defaultNC=kFALSE;
624c07ab 5652
77ed0cdb 5653 }
5654
5655
5656 // ############ MISALIGN HERE: TEMPORARY SOLUTION ##########
5657 // d->Misalign("resC");
5658
624c07ab 5659
e047b348 5660 //############# SIGNALLEVEL DESCRIPTION #####################
5661 // TO BE CONSIDERED WITH GREAT CARE, only =0 and =1 (and MC selection when possible) are reliable
5662 // For the other signallevel numbers the order in which cut are applied is relevant
5663 // signallevel =0,1: is selected as signal,is signal (MC)
5664 // from 2 to 20: MC information
5665 // from 21 to 29: "detector" selection (acceptance, pt, refits)
5666 // 21: acceptance, eta (N.B. before 24 May was signallevel=9)
5667 // 22: isinfiducialacceptance
5668 // 23: single track p
5669 // 25: ITS cluster selection
5670 // 26: TPC refit
5671 // 27: ITS refit
5672 // 28: no (TOF||TPC) pid information (no kTOFpid,kTOFout,kTIME,kTPCpid,...)
5673 //
5674 // from 30 to 39: PID selection
5675 // 31: no Kaon compatible tracks found between daughters
5676 // 32: no Kaon identified tracks found (strong sel. at low momenta)
5677 // 33: both mass hypotheses are rejected
5678 // from 40 to 45: standard cut selection
5679 // from 45 to 49: special cut signal kinematic selection
5680 // 46: pstar cut
5681 // from 50 to 60: special cut selection
5682 // 51: Nvtx contributors
5683 // 52: angle between tracks
5684 // 53: vtx not reconstructed when excludind daughters
5685 // 54: track not propagated to dca when the vtx is recalculated
5686 // 55: single track normalized impact par.
5687 // 56: normalized d0xd0
5688 // 57: d0xd0 cut with vtx on the fly
5689 // 58,59: cut normalized decay lenght and decay lenght
ac4c229c 5690 //####### DATA SELECTION ####################################
5691 //
5692 // ######## CHECK FOR ACCEPTANCE ##########
5693 ptD0=d->Pt();
e047b348 5694 ptbin=fCutsTight->PtBin(ptD0);
d39e8f99 5695 // Double_t relangle=d->ProngsRelAngle(0,1);
e047b348 5696 // UPV: HERE TO CHANGE WITH:
5697 // isinacceptance = (TMath::Abs(d->EtaProng(0))<fAcceptanceCuts[0]&&TMath::Abs(d->EtaProng(1))<fAcceptanceCuts[0]); //eta acceptance
d39e8f99 5698
624c07ab 5699 // INVESTIGATE SIGNAL TYPE : ACCESS TO MC INFORMATION
bf74e6db 5700 if(fReadMC){
5701 aodDMC=GetD0toKPiSignalType(d,arrayMC,signallevel,massmumtrue,vtxTrue);
5702 }
5703 else signallevel=0;
e047b348 5704 // ACCOUNT FOR ETA & ITS CLUSTER SELECTION
d39e8f99 5705 if(fFastAnalysis<1){ // ALREADY DONE BY AliRDHFCutsD0ToKPi selection
5706 isinacceptance=fCutsTight->AreDaughtersSelected(d);
5707 if(!isinacceptance)signallevel=21;
5708 }
e047b348 5709 if(!fCutsTight->IsInFiducialAcceptance(ptD0,d->Y(421))){
5710 isinacceptance=kFALSE;
5711 signallevel=22;
5712 }
bd0c851a 5713 else{
5714 nSelectedloose++;
5715 }
e047b348 5716
5717 //###################################################################################
5718 //
5719 // ################ SPECIAL ADDITIONAL CUTS FOR SIGNAL SEARCH #######################
5720 // UPV: ITS CLUSTER SELECTION ALREADY DONE , COUNT THEM THE SAME
5721 //
5722 Int_t nlayers=0,nSPD=0,nSSD=0;
5723 Bool_t spd1=kFALSE;
d39e8f99 5724 if(fFastAnalysis<1){
5725 for(Int_t idg=0;idg<d->GetNDaughters();idg++){
5726
5727 AliAODTrack *dgTrack = (AliAODTrack*)d->GetDaughter(idg);
5728 if(TESTBIT(dgTrack->GetITSClusterMap(),5)){
5729 nlayers++;
5730 nSSD++;
5731 }
e047b348 5732 if(TESTBIT(dgTrack->GetITSClusterMap(),4)){
5733 nlayers++;
5734 nSSD++;
5735 }
5736 if(TESTBIT(dgTrack->GetITSClusterMap(),3))nlayers++;
5737 if(TESTBIT(dgTrack->GetITSClusterMap(),2))nlayers++;
5738 if(TESTBIT(dgTrack->GetITSClusterMap(),1)){
5739 nlayers++;
5740 nSPD++;
5741 }
5742 if(TESTBIT(dgTrack->GetITSClusterMap(),0)){
5743 nlayers++;
5744 nSPD++;
5745 spd1=kTRUE;
5746 }
d39e8f99 5747 }
e047b348 5748 }
d39e8f99 5749 /*
e047b348 5750 // ######## NOW SELECTION ##########
5751 if(dgTrack->Pt()<0.5){
5752 // ########## k-Both selection ##############
5753 if(nlayers<5)signallevel=25;
5754 if(nSPD<2)signallevel=25;
5755 }
5756 else if(dgTrack->Pt()<1.){
5757 // ########## 4 its clust (1 SSD,1 SPD) && k-Any selection ##############
5758 if(nlayers<4)signallevel=25;
5759 if(nSSD<1)signallevel=25;
5760 if(nSPD<1)signallevel=25;
5761 }
5762 else{
5763 // ########## 3 its clust (1 SPD, 1 SSD) && k-Any selection ##########
5764 if(nlayers<3)signallevel=25;
5765 if(nSSD<1)signallevel=25;
5766 if(nSPD<1)signallevel=25;
5767 }
5768 }
5769 */
5770
5771
5772
e047b348 5773
e047b348 5774 //########### END OF SPECIAL CUTS ######################
5775 //
5776 //###############################################################
5777
5778 // NOW APPLY CUTS
5779 // Check tighter cuts w/o PID:
5780 //
d39e8f99 5781 // Int_t ncont=vtx1->GetNContributors();
77ed0cdb 5782 if(fFastAnalysis<1)if(vtx1->GetNContributors()<1)signallevel=51;
5783
5784 if(defaultNC&&fFastAnalysis<1&&fNtrMaxforVtx<2)defaultNC=SpecialSelD0(d,nVtx);// No More in USE!
5785 if(isEventSelTGHT&&defaultNC){
d39e8f99 5786 Bool_t iscutusingpid=fCutsTight->GetIsUsePID();
5787 fCutsTight->SetUsePID(kFALSE);
5788 Int_t isSelectedTightNoPid=fCutsTight->IsSelected(d,AliRDHFCuts::kAll,aod);
5789 switch(isSelectedTightNoPid){
5790 case 0:
5791 okd0tightnopid=kFALSE;
5792 okd0bartightnopid=kFALSE;
5793 break;
5794 case 1:
5795 okd0tightnopid=kTRUE;
5796 okd0bartightnopid=kFALSE;
5797 break;
5798 case 2:
5799 okd0tightnopid=kFALSE;
5800 okd0bartightnopid=kTRUE;
5801 break;
5802 case 3:
5803 okd0tightnopid=kTRUE;
5804 okd0bartightnopid=kTRUE;
5805 break;
5806 default:
5807 okd0tightnopid=kTRUE;
5808 okd0bartightnopid=kTRUE;
5809 break;
5810 }
5811
77ed0cdb 5812
d39e8f99 5813 // signallevel=fCutsTight->GetSelectionStep();
5814 fSignalType->Fill(signallevel);
5815
e047b348 5816
d39e8f99 5817
5818
5819 // ######### SPECIAL SELECTION PID ##############
5820 fCutsTight->SetUsePID(iscutusingpid);
77ed0cdb 5821 if(okd0tightnopid||okd0bartightnopid){
5822 Int_t isSelectedPid=fCutsTight->IsSelected(d,AliRDHFCuts::kPID,aod);
5823 Int_t isSelectedTight=fCutsTight->CombineSelectionLevels(3,isSelectedTightNoPid,isSelectedPid);
5824 switch(isSelectedTight){
5825 case 0:
5826 okd0tight=kFALSE;
5827 okd0bartight=kFALSE;
5828 break;
5829 case 1:
5830 okd0tight=kTRUE;
5831 okd0bartight=kFALSE;
5832 break;
5833 case 2:
5834 okd0tight=kFALSE;
5835 okd0bartight=kTRUE;
5836 break;
5837 case 3:
5838 okd0tight=kTRUE;
5839 okd0bartight=kTRUE;
5840 break;
5841 default:
5842 okd0tight=kTRUE;
5843 okd0bartight=kTRUE;
5844 break;
5845 }
d39e8f99 5846 }
5847 }
5848 else{
5849 fSignalType->Fill(signallevel);
e047b348 5850 }
77ed0cdb 5851
624c07ab 5852
77ed0cdb 5853
624c07ab 5854
77ed0cdb 5855 if(isEventSelLOOSE&&defaultNC){
d39e8f99 5856 // CHECK LOOSER CUTS
5857 //ptbin=SetStandardCuts(ptD0,flargeInvMassCut);
5858
5859 // d->SelectD0(fCutsLoose->GetD0toKpiCuts(),okd0loose,okd0barloose);
5860 Int_t isSelectedLoose=fCutsLoose->IsSelected(d,AliRDHFCuts::kAll,aod);
5861 switch(isSelectedLoose){
5862 case 0:
5863 okd0loose=kFALSE;
5864 okd0barloose=kFALSE;
5865 break;
5866 case 1:
5867 okd0loose=kTRUE;
5868 okd0barloose=kFALSE;
5869 break;
5870 case 2:
5871 okd0loose=kFALSE;
5872 okd0barloose=kTRUE;
e047b348 5873 break;
d39e8f99 5874 case 3:
5875 okd0loose=kTRUE;
5876 okd0barloose=kTRUE;
5877 break;
5878 default:
5879 okd0loose=kTRUE;
5880 okd0barloose=kTRUE;
5881 break;
5882 }
77ed0cdb 5883
e047b348 5884 }
5885
5886
624c07ab 5887 //NO CUTS Case: force okD0 and okD0bar = kTRUE
e047b348 5888 // special cuts are applied also in the "NO Cuts" case
5889 //
5890 //
5891 // SPECIAL modification:
5892 // IMPORTANT!!!!!! ONLY FOR TEMPORARY CONVENIENCE
5893 // IF fusePID is kTRUE, NO CUTS BECOMES NO PID case with tight cuts (fill signal histos when 30<=signallevel<40 )!!!!!!!!!!
d39e8f99 5894 if((!fusePID)&&isEventSelTGHT){
e047b348 5895 okd0tightnopid=defaultNC;
5896 okd0bartightnopid=defaultNC;
5897 }
77ed0cdb 5898
5899 if(okd0loose||okd0barloose||okd0tight||okd0bartight||okd0tightnopid||okd0bartightnopid){
5900 //######## INVARIANT MASS SELECTION ###############
5901 CheckInvMassD0(d,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar);
5902 if((isSideBandD0||isSideBandD0bar)){
5903 if(!(isPeakD0||isPeakD0bar))isSideBand=kTRUE; //(isSideBand no more used in the following, can remove it)
5904 else {// AVOID TO CONSIDER IN THE SIDEBAND THOSE CANDIDATES FOR WHICH 1 MASS HYPOTHESIS IS IN THE PEAK REGION
5905 isSideBand=kFALSE;
5906 isSideBandD0=kFALSE;
5907 isSideBandD0bar=kFALSE;
5908 }
5909 }
cb665049 5910 if(fFastAnalysis<2){
77ed0cdb 5911 if(!aziListIsFilled){
5912 FillAziList(aod,azilist,trkIDlist,nprim);
5913 aziListIsFilled=kTRUE;
5914 }
5915
cb665049 5916 if(signallevel==1||signallevel==0){
5917 if(nprim!=0){
5918 FillAziHistos(d,flistNoCutsSignal,ptbin,azilist,trkIDlist,nprim,okd0tightnopid,okd0bartightnopid,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar);
5919 FillAziHistos(d,flistTghCutsSignal,ptbin,azilist,trkIDlist,nprim,okd0tight,okd0bartight,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar);
5920 FillAziHistos(d,flistLsCutsSignal,ptbin,azilist,trkIDlist,nprim,okd0loose,okd0barloose,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar);
5921 }
77ed0cdb 5922 }
5923
5924 }
5925 }
5926 if(((isPeakD0&&okd0tight)||(isPeakD0bar&&okd0bartight))&&isinacceptance)fSignalTypeTghCuts->Fill(signallevel);
5927 if(((isPeakD0&&okd0loose)||(isPeakD0bar&&okd0barloose))&&isinacceptance)fSignalTypeLsCuts->Fill(signallevel);
5928
5929
5930
5931
5932 //################### FILL HISTOS ########################
5933 //################################################################
5934 //
5935 //######## improvement: SPEED HERE CAN BE IMPROVED: CALCULATE ONCE AND FOR ALL
5936 // CANDIDATE VARIABLES
5937
5938
d39e8f99 5939 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
5940 else if(signallevel==2)FillHistos(d,flistNoCutsFromDstar,ptbin,okd0tightnopid,okd0bartightnopid,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
5941 else if(signallevel==3||signallevel==4)FillHistos(d,flistNoCutsFromB,ptbin,okd0tightnopid,okd0bartightnopid,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
a3b80030 5942 else if(signallevel==-1||signallevel==7||signallevel==8||signallevel==10||signallevel==9||signallevel==11)FillHistos(d,flistNoCutsBack,ptbin,okd0tightnopid,okd0bartightnopid,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
d39e8f99 5943 else if(signallevel==5||signallevel==6)FillHistos(d,flistNoCutsOther,ptbin,okd0tightnopid,okd0bartightnopid,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
e047b348 5944
624c07ab 5945
e047b348 5946
624c07ab 5947 //LOOSE CUTS Case
77ed0cdb 5948 if(okd0loose||okd0barloose)fNentries->Fill(14);
5949
d39e8f99 5950 if(signallevel==1||signallevel==0)FillHistos(d,flistLsCutsSignal,ptbin,okd0loose,okd0barloose,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
5951 else if(signallevel==2)FillHistos(d,flistLsCutsFromDstar,ptbin,okd0loose,okd0barloose,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
5952 else if(signallevel==3||signallevel==4)FillHistos(d,flistLsCutsFromB,ptbin,okd0loose,okd0barloose,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
a3b80030 5953 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);
d39e8f99 5954 else if(signallevel==5||signallevel==6)FillHistos(d,flistLsCutsOther,ptbin,okd0loose,okd0barloose,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
624c07ab 5955
5956 //TIGHT CUTS Case
bd0c851a 5957 if(okd0tight||okd0bartight){
5958 fNentries->Fill(7);
5959 nSelectedtight++;
5960 }
5961
d39e8f99 5962 if(signallevel==1||signallevel==0)FillHistos(d,flistTghCutsSignal,ptbin,okd0tight,okd0bartight,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
5963 else if(signallevel==2)FillHistos(d,flistTghCutsFromDstar,ptbin,okd0tight,okd0bartight,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
5964 else if(signallevel==3||signallevel==4)FillHistos(d,flistTghCutsFromB,ptbin,okd0tight,okd0bartight,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
a3b80030 5965 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);
d39e8f99 5966 else if(signallevel==5||signallevel==6)FillHistos(d,flistTghCutsOther,ptbin,okd0tight,okd0bartight,invMassD0,invMassD0bar,isPeakD0,isPeakD0bar,isSideBandD0,isSideBandD0bar,massmumtrue,aodDMC,vtxTrue);
ac4c229c 5967
e047b348 5968
5969 // ######## PRINTING INFO FOR D0-like candidate
5970
5971 if(nSPD==2&&ptD0>2.){
5972 if((okd0tight&&TMath::Abs(invMassD0-1.864)<0.01)||(okd0bartight&&TMath::Abs(invMassD0bar-1.864)<0.01)){
d39e8f99 5973 //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());
5974 //printf("PrimVtx NContributors: %d \n Prongs Rel Angle: %f \n \n",ncont,relangle);
e047b348 5975 }
5976 }
5977 if(aodDMC!=0x0){
624c07ab 5978 delete aodDMC;
e047b348 5979 aodDMC=0x0;
624c07ab 5980 }
ac4c229c 5981
77ed0cdb 5982 if(fCleanCandOwnVtx)fCutsTight->CleanOwnPrimaryVtx(d,aod,origownvtx);
5983
5984
5985 // if(unsetvtx) d->UnsetOwnPrimaryVtx();
ac4c229c 5986
624c07ab 5987 }
bd0c851a 5988
5989
5990 fCounter->StoreCandidates(aod,nSelectedloose,kTRUE);
5991 fCounter->StoreCandidates(aod,nSelectedtight,kFALSE);
5992
c387e585 5993
624c07ab 5994 // ####################### POST OUTPUT TLIST DATA #########################
5995 // ####### histo for #AOD entries already posted
d39e8f99 5996 PostData(1,fNentries);
624c07ab 5997 PostData(2,fSignalType);
5998 PostData(3,fSignalTypeLsCuts);
5999 PostData(4,fSignalTypeTghCuts);
bd0c851a 6000 PostData(5,fCounter);
6001 PostData(6,flistMCproperties);
6002 PostData(7,flistNoCutsSignal);
6003 PostData(8,flistNoCutsBack);
6004 PostData(9,flistNoCutsFromB);
6005 PostData(10,flistNoCutsFromDstar);
6006 PostData(11,flistNoCutsOther);
6007 PostData(12,flistLsCutsSignal);
6008 PostData(13,flistLsCutsBack);
6009 PostData(14,flistLsCutsFromB);
6010 PostData(15,flistLsCutsFromDstar);
6011 PostData(16,flistLsCutsOther);
6012 PostData(17,flistTghCutsSignal);
6013 PostData(18,flistTghCutsBack);
6014 PostData(19,flistTghCutsFromB);
6015 PostData(20,flistTghCutsFromDstar);
6016 PostData(21,flistTghCutsOther);
624c07ab 6017
6018 return;
6019}
e047b348 6020
cc3209fb 6021
6022
6023//_________________________________________
6024Int_t AliAnalysisTaskSECharmFraction::SetStandardCuts(Float_t *&ptbinlimits){
6025 //
6026 // creating cuts for D0 -> Kpi
6027 //
d39e8f99 6028
6029 Printf("Using Default Cuts as set in AliAnalysisTaskSECharmFraction \n");
cc3209fb 6030 // const Double_t ptmin = 0.1;
6031 const Double_t ptmax = 9999.;
6032 const Int_t nptbins =13;
6033 const Int_t nvars=9;
6034 Int_t varycuts=-1;
6035
e047b348 6036 if(fCutsTight){
6037 delete fCutsTight;fCutsTight=NULL;
6038 }
6039 if(fCutsLoose){
6040 delete fCutsLoose;fCutsLoose=NULL;
6041 }
cc3209fb 6042
6043
e047b348 6044 fCutsTight = new AliRDHFCutsD0toKpi();
6045 fCutsTight->SetName("D0toKpiCutsStandard");
6046 fCutsTight->SetTitle("Standard Cuts for D0 analysis");
6047
6048 fCutsLoose = new AliRDHFCutsD0toKpi();
6049 fCutsLoose->SetName("D0toKpiCutsLoose");
6050 fCutsLoose->SetTitle("Loose Cuts for D0 analysis");
6051
6052 // EVENT CUTS
cc3209fb 6053 fCutsTight->SetMinVtxContr(1);
6054 fCutsLoose->SetMinVtxContr(1);
6055
e047b348 6056 // TRACKS ON SINGLE TRACKS
6057 AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
6058 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
6059 esdTrackCuts->SetRequireTPCRefit(kTRUE);
6060 esdTrackCuts->SetRequireITSRefit(kTRUE);
cc3209fb 6061 // esdTrackCuts->SetMinNClustersITS(4);
e047b348 6062 esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
6063 esdTrackCuts->SetMinDCAToVertexXY(0.);
6064 esdTrackCuts->SetEtaRange(-0.8,0.8);
6065 esdTrackCuts->SetPtRange(0.3,1.e10);
6066
cc3209fb 6067
e047b348 6068 fCutsTight->AddTrackCuts(esdTrackCuts);
cc3209fb 6069 fCutsLoose->AddTrackCuts(esdTrackCuts);
e047b348 6070
6071
cc3209fb 6072
6073 Float_t ptbins[nptbins+1];
6074 ptbins[0]=0.;
6075 ptbins[1]=0.5;
6076 ptbins[2]=1.;
6077 ptbins[3]=2.;
6078 ptbins[4]=3.;
6079 ptbins[5]=4.;
6080 ptbins[6]=5.;
6081 ptbins[7]=6.;
6082 ptbins[8]=8.;
6083 ptbins[9]=12.;
6084 ptbins[10]=16.;
6085 ptbins[11]=20.;
6086 ptbins[12]=24.;
6087 ptbins[13]=ptmax;
6088
6089 fCutsTight->SetGlobalIndex(nvars,nptbins);
6090 fCutsLoose->SetGlobalIndex(nvars,nptbins);
e047b348 6091 fCutsTight->SetPtBins(nptbins+1,ptbins);
6092 fCutsLoose->SetPtBins(nptbins+1,ptbins);
6093
cc3209fb 6094 /* 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
6095 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
6096 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
6097 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
6098 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
6099 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
6100 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
e047b348 6101 */
cc3209fb 6102
6103 const Int_t nvary=3;
6104 Float_t varyd0xd0[nptbins][nvary]={{-35000.*1E-8,-40000.*1E-8,-50000.*1E-8},/* pt<0.5*/
6105 {-35000.*1E-8,-40000.*1E-8,-50000.*1E-8},/* 0.5<pt<1*/
6106 {-25000.*1E-8,-32000.*1E-8,-38000.*1E-8},/* 1<pt<2 */
6107 {-22000.*1E-8,-26000.*1E-8,-30000.*1E-8},/* 2<pt<3 */
6108 {-12000.*1E-8,-15000.*1E-8,-20000.*1E-8},/* 3<pt<4 */
6109 {-12000.*1E-8,-15000.*1E-8,-20000.*1E-8},/* 4<pt<5 */
6110 {-5000.*1E-8,-10000.*1E-8,-15000.*1E-8},/* 5<pt<6 */
6111 {-5000.*1E-8,-10000.*1E-8,-15000.*1E-8},/* 6<pt<8 */
6112 {-0.*1E-8,-10000.*1E-8,-12000.*1E-8},/* 8<pt<12 */
6113 {5000.*1E-8,-5000.*1E-8,-10000.*1E-8},/* 12<pt<16 */
6114 {5000.*1E-8,-5000.*1E-8,-10000.*1E-8},/* 16<pt<20 */
6115 {5000.*1E-8,-5000.*1E-8,-10000.*1E-8},/* 20<pt<24 */
6116 {5000.*1E-8,-5000.*1E-8,-10000.*1E-8}};/* pt>24 */
6117
6118
6119 Float_t varyCosPoint[nptbins][nvary]={{0.75,0.80,0.85},/* 0<pt<0.5 */
6120 {0.75,0.80,0.85},/* 0.5<pt<1*/
6121 {0.75,0.80,0.85},/* 1<pt<2 */
6122 {0.92,0.94,0.95},/* 2<pt<3 */
6123 {0.85,0.88,0.91},/* 3<pt<4 */
6124 {0.85,0.88,0.91},/* 4<pt<5 */
6125 {0.88,0.90,0.92},/* 5<pt<6 */
6126 {0.88,0.90,0.92},/* 6<pt<8 */
6127 {0.85,0.90,0.92},/* 8<pt<12 */
6128 {0.85,0.90,0.92},/* 12<pt<16 */
6129 {0.8,0.85,0.9},/* 16<pt<20 */
6130 {0.8,0.85,0.9},/* 20<pt<24 */
6131 {0.75,0.82,0.9}};/* pt>24 */
e047b348 6132
e047b348 6133
cc3209fb 6134
6135 if(varycuts==-1){//DEFAULT CUTS
6136 varycuts=11;
6137 varyd0xd0[9][1]=-10000.*1E-8;
6138 varyd0xd0[10][1]=-10000.*1E-8;
6139 varyd0xd0[11][1]=-10000.*1E-8;
6140 varyd0xd0[12][1]=-10000.*1E-8;
6141 }
6142 Int_t vcd0xd0=varycuts/10;
6143 Int_t vccospoint=varycuts%10;
6144 // ######################## STAND VARY CUTS ###########################################
6145 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*/
6146 {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*/
6147 {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 */
6148 {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 */
6149 {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 */
6150 {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*/
6151 {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 */
6152 {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 */
6153 {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 */
6154 {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*/
6155 {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*/
6156 {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*/
6157 {0.400,250.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,varyd0xd0[12][vcd0xd0],varyCosPoint[12][vccospoint]}
6158 };/* pt > 24*/
6159
6160 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*/
6161 {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*/
6162 {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 */
6163 {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 */
6164 {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 */
6165 {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 */
6166 {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 */
6167 {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 */
6168 {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 */
6169 {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 */
6170 {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 */
6171 {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 */
6172 {0.400,300.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,0.*1E-8,0.85}};/* pt>24 */
6173
6174
6175 //CREATE TRANSPOSE MATRIX...REVERSE INDICES as required by AliRDHFCuts
6176 Float_t **cutsMatrixTransposeStand=new Float_t*[nvars];
6177 for(Int_t iv=0;iv<nvars;iv++)cutsMatrixTransposeStand[iv]=new Float_t[nptbins];
6178 Float_t **cutsMatrixTransposeLoose=new Float_t*[nvars];
6179 for(Int_t iv=0;iv<nvars;iv++)cutsMatrixTransposeLoose[iv]=new Float_t[nptbins];
6180
6181 for (Int_t ibin=0;ibin<nptbins;ibin++){
6182 for (Int_t ivar = 0; ivar<nvars; ivar++){
6183 cutsMatrixTransposeStand[ivar][ibin]=cutsMatrixD0toKpiStand[ibin][ivar];
6184 cutsMatrixTransposeLoose[ivar][ibin]=cutsMatrixD0toKpiLoose[ibin][ivar];
6185 //printf("cutsMatrixD0toKpi[%d][%d] = %f\n",ibin, ivar,cutsMatrixD0toKpiStand[ibin][ivar]);
6186 }
6187 }
6188
e047b348 6189
e047b348 6190
cc3209fb 6191 fCutsTight->SetCuts(nvars,nptbins,cutsMatrixTransposeStand);
6192 fCutsLoose->SetCuts(nvars,nptbins,cutsMatrixTransposeLoose);
6193
d39e8f99 6194
e11ae259 6195 for (Int_t ivar = 0; ivar<nvars; ivar++){
6196 delete [] cutsMatrixTransposeStand[ivar];
6197 delete [] cutsMatrixTransposeLoose[ivar];
6198 }
6199 delete [] cutsMatrixTransposeStand;
6200 cutsMatrixTransposeStand=NULL;
6201 delete [] cutsMatrixTransposeLoose;
6202 cutsMatrixTransposeLoose=NULL;
6203
d39e8f99 6204
6205
cc3209fb 6206 fCutsTight->SetUseSpecialCuts(kTRUE);
6207 fCutsLoose->SetUseSpecialCuts(kTRUE);
6208 fCutsTight->SetRemoveDaughtersFromPrim(kTRUE);
6209 fCutsLoose->SetRemoveDaughtersFromPrim(kTRUE);
6210 // PID SETTINGS
6211 AliAODPidHF* pidObj=new AliAODPidHF();
6212 //pidObj->SetName("pid4D0");
6213 Int_t mode=1;
6214 const Int_t nlims=2;
6215 Double_t plims[nlims]={0.6,0.8}; //TPC limits in momentum [GeV/c]
6216 Bool_t compat=kTRUE; //effective only for this mode
6217 Bool_t asym=kTRUE;
6218 Double_t sigmas[5]={2.,1.,0.,3.,0.}; //to be checked and to be modified with new implementation of setters by Rossella
6219 pidObj->SetAsym(asym);// if you want to use the asymmetric bands in TPC
6220 pidObj->SetMatch(mode);
6221 pidObj->SetPLimit(plims,nlims);
6222 pidObj->SetSigma(sigmas);
6223 pidObj->SetCompat(compat);
6224 pidObj->SetTPC(kTRUE);
6225 pidObj->SetTOF(kTRUE);
6226
6227 fCutsTight->SetPidHF(pidObj);
6228 fCutsLoose->SetPidHF(pidObj);
e11ae259 6229 delete pidObj; pidObj=NULL;
cc3209fb 6230 fCutsTight->SetUsePID(kTRUE);
6231 fCutsLoose->SetUsePID(kTRUE);
6232
6233 fCutsTight->SetUseDefaultPID(kFALSE);
6234 fCutsLoose->SetUseDefaultPID(kFALSE);
6235
6236 // PILE UP REJECTION
6237 fCutsTight->SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
6238 fCutsLoose->SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
6239
6240 ptbinlimits=ptbins;
6241 fCutsTight->PrintAll();
6242
d39e8f99 6243
cc3209fb 6244 return nptbins;
6245
e047b348 6246}
624c07ab 6247
cc3209fb 6248
624c07ab 6249//_________________________________________
6250Int_t AliAnalysisTaskSECharmFraction::SetStandardCuts(Double_t pt,Double_t invMassCut){
e047b348 6251 // UPV: this should set the cut object
6252
624c07ab 6253 //#############
6254 // TEMPORARY: to be change in :
6255 // for(j<nptbins)
6256 // if pt < standardptbin[j+1]
6257 // SetCuts, bin=j
6258 // break
6259 //
6260 // the way the cuts are set is for further development
6261 // (to be interfaced with AliAnalsysTaskSETuneCuts)
c387e585 6262 //
6263 // Cuts:
6264 // 0 = inv. mass half width [GeV]
6265 // 1 = dca [cm]
6266 // 2 = cosThetaStar
6267 // 3 = pTK [GeV/c]
6268 // 4 = pTPi [GeV/c]
6269 // 5 = d0K [cm] upper limit!
6270 // 6 = d0Pi [cm] upper limit!
6271 // 7 = d0d0 [cm^2]
e047b348 6272 // 8 = cosThetaPoint
6273 Int_t ptbin=-1;
6274
6275
c387e585 6276
e047b348 6277 /*//#######################################################################
6278 //###########################################################################
6279 // STANDARD SETS OF CUTS ("tight"~PPR like; commented loose are more stringent than "tight")
6280 // #########################################################################
624c07ab 6281 Int_t ptbin=-1;
e047b348 6282 if(pt>0. && pt<=1.) {
6283 ptbin=0;
6284 fCutsTight->SetD0toKpiCuts(invMassCut,0.04,0.8,0.5,0.5,0.05,0.05,-0.0002,0.5);
6285 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.04,0.8,0.5,0.5,0.05,0.05,-0.00025,0.7);
6286 fCutsLoose->SetD0toKpiCuts(invMassCut,0.04,0.8,0.3,0.3,1.,1.,-0.0002,0.7);
6287 }
6288 if(pt>1. && pt<=2.) {
624c07ab 6289 ptbin=1;
e047b348 6290 fCutsTight->SetD0toKpiCuts(invMassCut,0.03,0.8,0.6,0.6,0.05,0.05,-0.0002,0.6);
6291 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6292 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.3,0.3,1.,1.,-0.0001,0.7);
624c07ab 6293 //printf("I'm in the bin %d\n",ptbin);
6294 }
e047b348 6295 if(pt>2. && pt<=3.) {
624c07ab 6296 ptbin=2;
e047b348 6297 fCutsTight->SetD0toKpiCuts(invMassCut,0.03,0.8,0.6,0.6,0.05,0.05,-0.0002,0.6);
6298 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6299 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.3,0.3,1.,1.,-0.0001,0.7);
6300 //printf("I'm in the bin %d\n",ptbin);
6301 }
6302 if(pt>3. && pt<=5.){
6303 ptbin=3;
6304 fCutsTight->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.0001,0.8);
6305 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.8);
6306 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.4,0.4,1.,1.,-0.0001,0.75);
624c07ab 6307 //printf("I'm in the bin %d\n",ptbin);
6308 }
6309 if(pt>5.){
e047b348 6310 ptbin=4;
6311 fCutsTight->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00005,0.8);
6312 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.9);
6313 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.5,0.5,1.,1.,-0.00005,0.75);
6314 }//if(pt>5)
6315 return ptbin;
6316 //############################################################################
6317 */
6318
6319
6320
6321 /* //#######################################################################
6322 //################# VARY CUTS for d0xd0 STUDY ##########################
6323
6324if(pt>0. && pt<=1.) {
6325 ptbin=0;
6326 fCutsTight->SetD0toKpiCuts(invMassCut,0.04,0.8,0.5,0.5,0.05,0.05,-0.0002,0.5);
6327 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.04,0.8,0.5,0.5,0.05,0.05,-0.00025,0.7);
6328 fCutsLoose->SetD0toKpiCuts(invMassCut,0.04,0.8,0.3,0.3,1.,1.,-0.0002,0.7);
6329 }
6330 if(pt>1. && pt<=2.) {
6331 ptbin=1;
6332 fCutsTight->SetD0toKpiCuts(invMassCut,0.03,0.8,0.6,0.6,0.05,0.05,0.2,0.6);
6333 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6334 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.3,0.3,1.,1.,-0.0001,0.1);
6335 //printf("I'm in the bin %d\n",ptbin);
6336 }
6337 if(pt>2. && pt<=3.) {
6338 ptbin=2;
6339 fCutsTight->SetD0toKpiCuts(invMassCut,0.03,0.8,0.6,0.6,0.05,0.05,0.2,0.6);
6340 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6341 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.3,0.3,1.,1.,-0.0001,0.1);
6342 //printf("I'm in the bin %d\n",ptbin);
6343 }
6344 if(pt>3. && pt<=5.){
6345 ptbin=3;
6346 fCutsTight->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,0.2,0.8);
6347 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.8);
6348 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.3,0.4,0.4,1.,1.,-0.0001,0.1);
6349 //printf("I'm in the bin %d\n",ptbin);
6350 }
6351 if(pt>5.){
6352 ptbin=4;
6353 fCutsTight->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,0.2,0.8);
6354 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.9);
6355 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.5,0.5,1.,1.,-0.00005,0.1);
6356 }//if(pt>5)
6357 return ptbin;
6358 // #################################################################
6359 */
6360
6361 //##########################################################################
6362 //################## CUTS with d0xd0 cut released #########################
6363 //### and TGHC cuts d0K and d0Pi to 0.1 instead of 0.05
6364 //### USED FOR PHDthesis
6365 //##########################################################################
6366
6367 /* if(pt>0. && pt<=1.) {
6368 ptbin=0;
6369 fCutsTight->SetD0toKpiCuts(invMassCut,0.04,0.8,0.5,0.5,0.1,0.1,-0.000,0.5);
6370 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.04,0.8,0.5,0.5,0.05,0.05,-0.00025,0.7);
6371 fCutsLoose->SetD0toKpiCuts(invMassCut,0.04,0.8,0.3,0.3,1.,1.,-0.000,0.7);
6372 }
6373 if(pt>1. && pt<=2.) {
6374 ptbin=1;
6375 fCutsTight->SetD0toKpiCuts(invMassCut,0.03,0.8,0.6,0.6,0.1,0.1,-0.000,0.6);
6376 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6377 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.4,0.4,1.,1.,-0.0000,0.7);
6378 //printf("I'm in the bin %d\n",ptbin);
6379 }
6380 if(pt>2. && pt<=3.) {
6381 ptbin=2;
6382 fCutsTight->SetD0toKpiCuts(invMassCut,0.03,0.8,0.6,0.6,0.1,0.1,-0.000,0.6);
6383 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6384 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.4,0.4,1.,1.,-0.000,0.7);
6385 //printf("I'm in the bin %d\n",ptbin);
6386 }
6387 if(pt>3. && pt<=5.){
6388 ptbin=3;
6389 fCutsTight->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.1,0.1,-0.000,0.8);
6390 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.8);
6391 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.5,0.5,1.,1.,-0.000,0.75);
6392 //printf("I'm in the bin %d\n",ptbin);
6393 }
6394 if(pt>5.){
6395 ptbin=4;
6396 fCutsTight->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.1,0.1,-0.0000,0.8);
6397 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.9);
6398 fCutsLoose->SetD0toKpiCuts(invMassCut,0.03,0.8,0.5,0.5,1.,1.,-0.0000,0.75);
6399 }//if(pt>5)
6400 return ptbin;
6401 */
6402
6403
6404
6405
6406 //########## LOOKING FOR SIGNAL #####################
6407 /*
6408 if(pt>0. && pt<=1.) {
6409 ptbin=0;
6410 fCutsTight->SetD0toKpiCuts(5*invMassCut,0.03,0.8,0.3,0.3,0.1,0.1,-0.00035,0.7);
6411 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.04,0.8,0.5,0.5,0.05,0.05,-0.00025,0.7);
6412 fCutsLoose->SetD0toKpiCuts(5*invMassCut,0.04,0.8,0.3,0.3,0.1,0.1,-0.00025,0.7);
6413 }
6414 if(pt>1. && pt<=2.) {
6415 ptbin=1;
6416 fCutsTight->SetD0toKpiCuts(5*invMassCut,0.02,0.8,0.4,0.4,0.1,0.1,-0.00035,0.8);
6417 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6418 fCutsLoose->SetD0toKpiCuts(5*invMassCut,0.03,0.8,0.3,0.3,0.1,0.1,-0.0025,0.75);
6419 //printf("I'm in the bin %d\n",ptbin);
6420 }
6421 if(pt>2. && pt<=3.) {
6422 ptbin=2;
6423 fCutsTight->SetD0toKpiCuts(5*invMassCut,0.02,0.8,0.7,0.7,0.1,0.1,-0.00026,0.94);
6424 //fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,1,1,-0.00025,0.8);
6425 fCutsLoose->SetD0toKpiCuts(5*invMassCut,0.02,0.8,0.7,0.7,0.1,0.1,-0.0002,0.92);
6426 //printf("I'm in the bin %d\n",ptbin);
6427 }
6428 if(pt>3. && pt<=5.){
6429 ptbin=3;
6430 fCutsTight->SetD0toKpiCuts(5*invMassCut,0.02,0.8,0.7,0.7,0.1,0.1,-0.00015,0.88);
6431 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.8);
6432 fCutsLoose->SetD0toKpiCuts(5*invMassCut,0.02,0.8,0.7,0.7,0.1,0.1,-0.00015,0.9);
6433 //printf("I'm in the bin %d\n",ptbin);
6434 }
6435 if(pt>5.&& pt<=8.){
6436 ptbin=4;
6437 fCutsTight->SetD0toKpiCuts(5*invMassCut,0.015,0.8,0.7,0.7,0.1,0.1,-0.0001,0.9);
6438 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.9);
6439 fCutsLoose->SetD0toKpiCuts(5*invMassCut,0.02,0.8,0.7,0.7,0.1,0.1,-0.0000,0.88);
6440 }//if(pt>5)
6441 if(pt>8.&&pt<=12.){
6442 ptbin=5;
6443 fCutsTight->SetD0toKpiCuts(5*invMassCut,0.015,0.8,0.7,0.7,0.1,0.1,-0.0001,0.9);
6444 // fCutsLoose->SetD0toKpiCuts(invMassCut,0.02,0.8,0.7,0.7,0.05,0.05,-0.00015,0.9);
6445 fCutsLoose->SetD0toKpiCuts(5*invMassCut,0.015,0.8,0.7,0.7,0.1,0.1,-0.0005,0.88);
624c07ab 6446 }//if(pt>5)
e047b348 6447
624c07ab 6448 return ptbin;
e047b348 6449 */
6450 printf("AliAnalysisTaskSECharmFraction::Obsolete method! Parameters pt=%f,invmasscut=%f not used \n",pt,invMassCut);
6451 return ptbin;
6452
624c07ab 6453}
6454
6455//__________________________________________________________
6456void AliAnalysisTaskSECharmFraction::CheckInvMassD0(AliAODRecoDecayHF2Prong *d,Double_t &invMassD0,Double_t &invMassD0bar,Bool_t &isPeakD0,Bool_t &isPeakD0bar,Bool_t &isSideBandD0,Bool_t &isSideBandD0bar){
6457 //Check wheter the candidate inv. mass is compatible with signal or sideband inv. mass selection
6458
6459 d->InvMassD0(invMassD0,invMassD0bar);
6460 //CHECK if ISPEAK
6461 if(TMath::Abs(invMassD0-fmD0PDG)<fsignalInvMassCut)isPeakD0=kTRUE;
6462 if(TMath::Abs(invMassD0bar-fmD0PDG)<fsignalInvMassCut)isPeakD0bar=kTRUE;
6463 //CHECK if ISSIDEBAND: no constraint is present between signal region definition and side band definition
6464 // ######## TO BE CHANGED the distinction between sidebandD0 and sidebandD0bar is meaningless
6465 // and it is present only for side band region study (see which inv mass has the D0(D0bar)
6466 // in case the D0bar(D0) is in the sideband) #######
6467 if(TMath::Abs(invMassD0-fmD0PDG)>fsidebandInvMassCut&&TMath::Abs(invMassD0-fmD0PDG)<fsidebandInvMassCut+fsidebandInvMassWindow){
6468 isSideBandD0=kTRUE;
6469 }
6470 if(TMath::Abs(invMassD0bar-fmD0PDG)>fsidebandInvMassCut&&TMath::Abs(invMassD0bar-fmD0PDG)<fsidebandInvMassCut+fsidebandInvMassWindow){
6471 isSideBandD0bar=kTRUE;
6472 }
6473
6474}
6475
6476
a3b80030 6477//__________________________________________________________________
ac4c229c 6478AliAODRecoDecayHF* AliAnalysisTaskSECharmFraction::GetD0toKPiSignalType(const AliAODRecoDecayHF2Prong *d,TClonesArray *arrayMC,Int_t &signaltype,Double_t &massMumTrue,Double_t *primaryVtx){
624c07ab 6479 //THIS METHOD CHECK THE TYPE OF SIGNAL/BACKGROUND THE CANDIDATE IS.
6480 // IF (!AND ONLY IF) THE TWO DAUGHTERS COME FROM A COMMONE MOTHER A FAKE TRUE SECONDARY VERTEX IS CONSTRUCTED (aodDMC)
6481 //
6482 // THE FOLLOWING SCHEME IS ADOPTED: signaltype is set to
e047b348 6483 // 1:signal (D0 prompt); 2: signal D0 from Dstar; 3: D0 fromB 4: D0 from Dstar fromB
6484 // then background categories: -1: one or both daughters is a fake track
6485 // 5: both daughters come from a D meson != D0
6486 // 6: both daughters come from a D0->4prongs
6487 // 7: both daughetrs are primaries
6488 // 8: generic background (can include one of the previous if desired)
6489 // 9: daughters out of acceptance
6490 // 10: pathologic cases (not clear)
6491 // 11: end of the method without output
6492 // 12: different result than MatchToMC method
6493
a3b80030 6494 AliAODMCParticle *mum1=0x0;
6495 AliAODMCParticle *b1=0x0,*b2=0x0;
6496 AliAODMCParticle *grandmoth1=0x0;
6497 massMumTrue=-1;
6498 AliAODRecoDecayHF *aodDMC=0x0;
6499 Int_t pdgdaughters[2]={211,321};
6500 Int_t labMum=d->MatchToMC(421,arrayMC,2,pdgdaughters);
6501 if(labMum==-1){
6502 signaltype=-1;
6503 return aodDMC;
6504 }
6505
6506 // get daughter AOD tracks
6507 AliAODTrack *trk0 = (AliAODTrack*)d->GetDaughter(0);
6508 AliAODTrack *trk1 = (AliAODTrack*)d->GetDaughter(1);
6509
6510 if(trk0==0x0||trk1==0x0){
6511 AliDebug(2,"Delete tracks I AM \n");
6512
6513 signaltype=-1;
6514 return aodDMC;
6515
6516 }
6517
6518 b1=(AliAODMCParticle*)arrayMC->At(trk0->GetLabel());
6519 b2=(AliAODMCParticle*)arrayMC->At(trk1->GetLabel());
6520 mum1=(AliAODMCParticle*)arrayMC->At(labMum);
6521 massMumTrue=mum1->GetCalcMass();
6522 aodDMC=ConstructFakeTrueSecVtx(b1,b2,mum1,primaryVtx);
6523
6524 if(aodDMC==0x0){
6525 signaltype=10;
6526 return aodDMC;
6527 }
6528
6529 Bool_t isfromDstar=kFALSE;
6530 grandmoth1=(AliAODMCParticle*)arrayMC->At(mum1->GetMother());
6531 if(TMath::Abs(grandmoth1->GetPdgCode())==413||TMath::Abs(grandmoth1->GetPdgCode())==423)isfromDstar=kTRUE;// D0 COMING FROM A D0*
6532
6533 Int_t origin=CheckOrigin(arrayMC,mum1);
6534 if(origin==4){
6535 if(isfromDstar)signaltype=2;
6536 else signaltype=1;
6537 return aodDMC;
6538 }
6539 else if(origin==5){
6540 if(isfromDstar)signaltype=4;
6541 else signaltype=3;
6542 return aodDMC;
6543 }
6544 else if(origin==-1){
6545 signaltype=11;
6546 return aodDMC;
6547 }
6548 else if(origin==-2){
6549 signaltype=-1;
6550 return aodDMC;
6551 }
6552
6553 signaltype=11;// JUST FOR SAFETY: SHOULD NEVER REACH THIS POINT
6554 return aodDMC;
6555
6556}
6557
6558//_________________________________________________________________________________________________
6559Int_t AliAnalysisTaskSECharmFraction::CheckOrigin(const TClonesArray* arrayMC, const AliAODMCParticle *mcPartCandidate) const {
6560 //
6561 // checking whether the mother of the particles come from a charm or a bottom quark
6562 //
6563
6564 Int_t pdgGranma = 0;
6565 Int_t mother = 0;
6566 mother = mcPartCandidate->GetMother();
6567
6568 Int_t abspdgGranma =0;
6569 Bool_t isFromB=kFALSE;
6570 Bool_t isQuarkFound=kFALSE;
6571 while (mother >0 ){
6572
6573 AliAODMCParticle* mcGranma = dynamic_cast<AliAODMCParticle*>(arrayMC->At(mother));
6574 if (mcGranma){
6575 pdgGranma = mcGranma->GetPdgCode();
6576 abspdgGranma = TMath::Abs(pdgGranma);
6577 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
6578 isFromB=kTRUE;
6579 }
6580 if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
6581 mother = mcGranma->GetMother();
6582 }else{
6583 AliError("Failed casting the mother particle!");
6584 return -2;
6585 }
6586 }
6587
6588 if(!isQuarkFound)return -1;
6589 if(isFromB) return 5;
6590 else return 4;
6591}
6592
6593//__________________________________________________
6594AliAODRecoDecayHF* AliAnalysisTaskSECharmFraction::GetD0toKPiSignalTypeObsolete(const AliAODRecoDecayHF2Prong *d,TClonesArray *arrayMC,Int_t &signaltype,Double_t &massMumTrue,Double_t *primaryVtx){// OBSOLETE METHOD!!!!!
6595 //THIS METHOD CHECK THE TYPE OF SIGNAL/BACKGROUND THE CANDIDATE IS.
6596 // IF (!AND ONLY IF) THE TWO DAUGHTERS COME FROM A COMMONE MOTHER A FAKE TRUE SECONDARY VERTEX IS CONSTRUCTED (aodDMC)
6597 //
6598 // THE FOLLOWING SCHEME IS ADOPTED: signaltype is set to
6599 // 1:signal (D0 prompt); 2: signal D0 from Dstar; 3: D0 fromB 4: D0 from Dstar fromB
6600 // then background categories: -1: one or both daughters is a fake track
6601 // 5: both daughters come from a D meson != D0
6602 // 6: both daughters come from a D0->4prongs
6603 // 7: both daughetrs are primaries
6604 // 8: generic background (can include one of the previous if desired)
6605 // 9: daughters out of acceptance
6606 // 10: pathologic cases (not clear)
6607 // 11: end of the method without output
6608 // 12: different result than MatchToMC method
6609
e047b348 6610 AliAODMCParticle *mum1=0x0;
6611 AliAODMCParticle *b1=0x0,*b2=0x0;
6612 AliAODMCParticle *grandmoth1=0x0;
624c07ab 6613 massMumTrue=-1;
6614
6615 Int_t pdgmum,dglabels[2],matchtoMC;
6616 Int_t pdgdaughters[2]={211,321};
6617 // get daughter AOD tracks
6618 AliAODTrack *trk0 = (AliAODTrack*)d->GetDaughter(0);
6619 AliAODTrack *trk1 = (AliAODTrack*)d->GetDaughter(1);
e047b348 6620 AliAODRecoDecayHF *aodDMC=0x0;
6621 if(trk0==0x0||trk1==0x0){
624c07ab 6622 AliDebug(2,"Delete tracks I AM \n");
6623
6624 signaltype=-1;
6625 return aodDMC;
6626
6627 }
6628 dglabels[0]=trk0->GetLabel();
6629 dglabels[1]=trk1->GetLabel();
e047b348 6630 if(dglabels[0]<0||dglabels[1]<0){
624c07ab 6631 AliDebug(2,"HERE I AM \n");
6632
6633 //fake tracks
6634
7eb5a89e 6635 signaltype=-1;
624c07ab 6636 return aodDMC;
6637
6638 }
6639 // printf("Before entering the MC checks \n");
6640
6641 b1=(AliAODMCParticle*)arrayMC->At(trk0->GetLabel());
6642 b2=(AliAODMCParticle*)arrayMC->At(trk1->GetLabel());
e047b348 6643 if(!b1||!b2){
6644 //Tracks with no mother ??? FAKE DECAY VERTEX
43e4f69a 6645 signaltype=10;
6646 return aodDMC;
6647 }
43e4f69a 6648 if(b1->GetMother()<0||b2->GetMother()<0){
e047b348 6649 //Tracks with no mother ??? FAKE DECAY VERTEX
624c07ab 6650 signaltype=10;
6651 return aodDMC;
6652 }
6653
6654 mum1=(AliAODMCParticle*)arrayMC->At(b1->GetMother());
6655 // mum2=(AliAODMCParticle*)arrayMC->At(b2->GetMother());//FOR FURTHER USE
6656
6657 if(b1->GetMother()!=b2->GetMother()){
6658 //Check the label of the mother is the same
6659 // NOT SAME MOTHER
6660
6661
6662 signaltype=8;
6663 return aodDMC;
6664 }
6665 massMumTrue=mum1->GetCalcMass();
6666
6667 matchtoMC=d->MatchToMC(421,arrayMC,2,pdgdaughters);
6668 aodDMC=ConstructFakeTrueSecVtx(b1,b2,mum1,primaryVtx);
6669
e047b348 6670 if(aodDMC==0x0){
624c07ab 6671 signaltype=10;
6672 return aodDMC;
6673 }
6674
6675 // if((mum1->GetPdgCode()!=mum2->GetPdgCode()))continue; //Check the mother is the same particle
6676 // printf("Particle codes: tr1: %d, tr2: %d, mum1: %d, mum 2: %d \n",b1->GetPdgCode(),b2->GetPdgCode(),mum1->GetPdgCode(),mum2->GetPdgCode());
6677 if(!((TMath::Abs(b1->GetPdgCode())==321&&TMath::Abs(b1->GetPdgCode())!=211)||(TMath::Abs(b1->GetPdgCode())==211&&TMath::Abs(b1->GetPdgCode()!=321)))){
6678 // Not a Kaon and a Pion
6679
6680 signaltype=8;
6681 return aodDMC;
6682 }
6683
6684 pdgmum=mum1->GetPdgCode();
6685 if(TMath::Abs(pdgmum)!=421){
6686 if(TMath::Abs(pdgmum)==411||TMath::Abs(pdgmum)==431||TMath::Abs(pdgmum)==443){
6687 // IT IS A SECONDARY VERTEX FROM CHARM BUT NOT A D0
6688
6689 signaltype=5;
6690 return aodDMC;
6691 }
6692 else {
6693 signaltype=8;
6694 return aodDMC;
6695 }
6696 }
6697
6698 if(mum1->GetDaughter(1)-mum1->GetDaughter(0)+1!=2){
6699 // from D0 but NOT A 2 PRONG DECAY
6700 signaltype=6;
6701 return aodDMC;
6702
6703 }
6704
43e4f69a 6705 if(mum1->GetMother()<0){
624c07ab 6706 // A particle coming from nothing
6707 signaltype=10;
6708 return aodDMC;
c387e585 6709
624c07ab 6710 }
7eb5a89e 6711 Bool_t isfromDstar=kFALSE;
6712 // matchtoMC=d->MatchToMC(421,arrayMC,2,pdgdaughters);
624c07ab 6713 grandmoth1=(AliAODMCParticle*)arrayMC->At(mum1->GetMother());
7eb5a89e 6714 if(TMath::Abs(grandmoth1->GetPdgCode())==413||TMath::Abs(grandmoth1->GetPdgCode())==423)isfromDstar=kTRUE;// D0 COMING FROM A D0*
6715
c387e585 6716 /*
6717 //CHECK FOR CABIBBO SUPPRESSED DECAY
6718 Int_t isCabibSup=0,pdgKaon;
6719
6720 pdgKaon=b1->GetPdgCode();
6721 if(TMath::Abs(pdgKaon)!=321)pdgKaon=b2->GetPdgCode();
6722 if(pdgmum>0&&pdgKaon>0)isCabibSup=1;
6723 if(pdgmum<0&&pdgKaon<0)isCabibSup=1;
6724 if(isCabibSup){
6725 signaltype=0;
6726 return aodDMC;
6727 }
6728 */
624c07ab 6729 // if(fcheckMCD0){//THIS CHECK IS NEEDED TO AVOID POSSIBLE FAILURE IN THE SECOND WHILE, FOR DEBUGGING
6730 while(TMath::Abs(grandmoth1->GetPdgCode())!=4&&TMath::Abs(grandmoth1->GetPdgCode())!=5){
43e4f69a 6731 if(grandmoth1->GetMother()<0){
624c07ab 6732 //### THE FOLLOWING IN CASE OF DEBUGGING ##########à
6733 /*printf("mother=-1, pdgcode: %d \n",grandmoth1->GetPdgCode());
6734 Int_t son=grandmoth1->GetDaughter(0);
6735 sonpart=(AliAODMCParticle*)arrayMC->At(son);
6736 while(TMath::Abs(sonpart->GetPdgCode())!=421){
6737 printf("mother=-1, pdgcode: %d \n",sonpart->GetPdgCode());
6738 son++;
6739 sonpart=(AliAODMCParticle*)arrayMC->At(son);
6740 }*/
6741
6742 signaltype=10;
6743 return aodDMC;
6744 }
6745 grandmoth1=(AliAODMCParticle*)arrayMC->At(grandmoth1->GetMother());
6746 }
6747
6748 if(TMath::Abs(grandmoth1->GetPdgCode())==4){
6749 if(matchtoMC!=-1){
7eb5a89e 6750
6751 if(isfromDstar)signaltype=2;
6752 else signaltype=1;
624c07ab 6753 return aodDMC;
6754 }
6755 else {
6756 signaltype=12;
6757 return aodDMC;
7eb5a89e 6758
624c07ab 6759 }
6760 }
6761 else if(TMath::Abs(grandmoth1->GetPdgCode())==5){
6762 if(matchtoMC!=-1){
7eb5a89e 6763 if(isfromDstar)signaltype=4;
6764 else signaltype=3;
624c07ab 6765 return aodDMC;
6766
6767 }
6768 else {
6769
6770 signaltype=12;
6771 return aodDMC;
6772 }
6773 }
6774 signaltype=11;// JUST FOR SAFETY: SHOULD NEVER REACH THIS POINT
6775 return aodDMC;
6776 // return 11;
6777}
6778
6779//___________________________________
ac4c229c 6780AliAODRecoDecayHF* AliAnalysisTaskSECharmFraction::ConstructFakeTrueSecVtx(const AliAODMCParticle *b1, const AliAODMCParticle *b2, const AliAODMCParticle *mum,Double_t *primaryVtxTrue){
624c07ab 6781 // CONSTRUCT A FAKE TRUE SECONDARY VERTEX (aodDMC)
6782 //!!!NOTE THAT ONLY ONE MOTHER IS CONSIDERED: THE METHOD REQUIRES THE DAUGHTERS COME FROM THE SAME MOTHER !!
e047b348 6783 if(b1==0x0||b2==0x0)return 0x0;
6784 if(mum==0x0)return 0x0;
624c07ab 6785 Double_t pD[3],xD[3],pXtrTrue[2],pYtrTrue[2],pZtrTrue[2],xtr1[3],xtr2[3];
6786 Int_t charge[2]={0,0};
6787 if(b1->Charge()==-1)charge[0]=1;
6788 else {
6789 if(b2->Charge()==-1){
6790 //printf("Same charges for prongs \n");
e047b348 6791 if(!fLikeSign)return 0x0;
624c07ab 6792 }
6793 charge[1]=1;
6794 }
6795
6796 pXtrTrue[charge[0]]=b1->Px();
6797 pYtrTrue[charge[0]]=b1->Py();
6798 pZtrTrue[charge[0]]=b1->Pz();
6799 if(!b1->XvYvZv(xtr1)){
e047b348 6800 return 0x0;
624c07ab 6801 }
6802
6803 pXtrTrue[charge[1]]=b2->Px();
6804 pYtrTrue[charge[1]]=b2->Py();
6805 pZtrTrue[charge[1]]=b2->Pz();
6806
6807 if(!mum->PxPyPz(pD)){
6808 //printf("!D from B:Get momentum failed \n");
e047b348 6809 return 0x0;
624c07ab 6810 }
6811 if(!mum->XvYvZv(xD)){
6812 //printf("!D from B:Get position failed \n");
e047b348 6813 return 0x0;
624c07ab 6814 }
6815 /* ############ THIS HAPPENS FROM TIME TO TIME: NUMERIC PROBLEM KNOWN #################
6816 if(pXtrTrue[0]+pXtrTrue[1]!=pD[0]){
6817 }*/
6818
6819
6820 if(!b2->XvYvZv(xtr2)){
e047b348 6821 return 0x0;
624c07ab 6822 }
6823 Double_t d0dummy[2]={0.,0.};//TEMPORARY : dummy d0 for AliAODRecoDeay constructor
6824 AliAODRecoDecayHF* aodDMC=new AliAODRecoDecayHF(primaryVtxTrue,xD,2,0,pXtrTrue,pYtrTrue,pZtrTrue,d0dummy);
6825
6826 /* ######## THE FOLLOWINF FOR DEBUGGING ############
6827 Printf("testing the Fake vertex: SecVtxX: %f, Px: %f, Py: %f, Pz:%f \n ",aodDMC->GetSecVtxX(),aodDMC->Px(),aodDMC->Py(),aodDMC->Pz());
6828 Printf("pD: x=%f, y=%f,z=%f\n",pD[0],pD[1],pD[2]);
6829 Printf("Daughters :px1:%f, px2:%f \n",pXtrTrue[0],pXtrTrue[1]);
6830 Printf("Daughters :py1:%f, py2:%f \n",pYtrTrue[0],pYtrTrue[1]);
6831 Printf("Daughters :pz1:%f, pz2:%f \n",pZtrTrue[0],pZtrTrue[1]);
6832 Printf("Mother pdg: %d",mum->GetPdgCode());
6833 Printf("Impact Par Prod: %f\n",aodDMC->ImpParXY());
6834 */
6835
6836 return aodDMC;
6837}
6838
6839//________________________________________________________
d39e8f99 6840Bool_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
ac4c229c 6841
624c07ab 6842
6843 if((!okD0)&&(!okD0bar))return kTRUE;
e047b348 6844 if(ptbin==-1)return kTRUE;
6845 // flistNoCutsSignal->Add(hptD0NCsign);
6846 // flistNoCutsSignal->Add(hptD0VsMaxPtNCsign);
6847 // flistNoCutsSignal->Add(hptD0PTallsqrtNCsign);
6848 // flistNoCutsSignal->Add(hptD0PTallNCsign);
6849
6850 // %%%%%% TO BE DONE
6851 // flistNoCutsSignal->Add(hptD0vsptBNCsign);
6852 // flistNoCutsSignal->Add(hpD0vspBNCsign);
6853 //flistNoCutsSignal->Add(hptD0vsptcquarkNCsign);
6854 //flistNoCutsSignal->Add(hpD0vspcquarkNCsign);
6855 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%
6856 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
624c07ab 6857
e047b348 6858 // DONE
6859 //hd0zD0ptLSCsign_pt
cc3209fb 6860 //hInvMassD0LSCsign_pt
e047b348 6861 //hetaLSCsign_pt
6862 //
6863 // %%% TO BE DONE %%
6864 //hCosPDPBLSCsign_pt
6865 //hCosPcPDLSCsign_pt
6866
d39e8f99 6867 Double_t pt=d->Pt();
6868 Double_t impparxy=d->ImpParXY()*10000.;
e047b348 6869
6870
6871
624c07ab 6872 // ######### Get Standard label for hist in tlist ###############
6873 TString namehist=list->GetName(),str;
6874 namehist.ReplaceAll("list","");
6875
6876 // ######### Global properties histos #################
ac4c229c 6877 // ####### take care: only for candidates which pass the cuts !! not for side band ########
d39e8f99 6878 if(fFastAnalysis<2){
6879 if((isPeakD0&&okD0)||(isPeakD0bar&&okD0bar)){
6880 str="hCPtaVSd0d0";
6881 str.Append(namehist.Data());
6882 ((TH1F*)list->FindObject(str.Data()))->Fill(1e8*d->Prodd0d0(),d->CosPointingAngle());
6883
6884 str="hSecVtxZ";
6885 str.Append(namehist.Data());
6886 ((TH1F*)list->FindObject(str.Data()))->Fill(d->GetSecVtxZ());
6887
6888 str="hSecVtxX";
6889 str.Append(namehist.Data());
6890 ((TH1F*)list->FindObject(str.Data()))->Fill(d->GetSecVtxX()*10000.);
6891
6892 str="hSecVtxY";
6893 str.Append(namehist.Data());
6894 ((TH1F*)list->FindObject(str.Data()))->Fill(d->GetSecVtxY()*10000.);
6895
6896 str="hSecVtxXY";
6897 str.Append(namehist.Data());
6898 ((TH2F*)list->FindObject(str.Data()))->Fill(d->GetSecVtxX()*10000.,d->GetSecVtxY()*10000.);
6899
6900 str="hSecVtxPhi";
6901 str.Append(namehist.Data());
6902 ((TH1F*)list->FindObject(str.Data()))->Fill(TMath::ATan2(d->GetSecVtxY()*10000.,d->GetSecVtxX()*10000.)*TMath::RadToDeg());
6903
6904
6905 str="hd0singlTrack";
6906 str.Append(namehist.Data());
6907 ((TH1F*)list->FindObject(str.Data()))->Fill(d->Getd0Prong(0)*10000.);
6908 ((TH1F*)list->FindObject(str.Data()))->Fill(d->Getd0Prong(1)*10000.);
6909
6910 str="hCPta";
6911 str.Append(namehist.Data());
6912 ((TH1F*)list->FindObject(str.Data()))->Fill(d->CosPointingAngle());
6913
6914 str="hd0xd0";
6915 str.Append(namehist.Data());
6916 ((TH1F*)list->FindObject(str.Data()))->Fill(1e8*d->Prodd0d0());
6917
6918 //%%%%%%%% NEW HISTO %%%%%%%%%%
6919 str="hdca";
6920 str.Append(namehist.Data());
6921 ((TH1F*)list->FindObject(str.Data()))->Fill(1e4*d->GetDCA());
6922
6923 str="hcosthetastar";
6924 str.Append(namehist.Data());
6925 if(okD0)((TH1F*)list->FindObject(str.Data()))->Fill(d->CosThetaStarD0());
6926 if(okD0bar)((TH1F*)list->FindObject(str.Data()))->Fill(d->CosThetaStarD0bar());
6927
6928 str="hptD0";
6929 str.Append(namehist.Data());
6930 ((TH1F*)list->FindObject(str.Data()))->Fill(pt);
6931
6932 str="hptD0VsMaxPt";
6933 str.Append(namehist.Data());
6934 Int_t pr=0;
6935 if(d->PtProng(1)>d->PtProng(0))pr=1;
6936 if(d->PtProng(pr)<fptMax[0]) ((TH1F*)list->FindObject(str.Data()))->Fill(pt-fptMax[0]);
6937 else if(d->PtProng(TMath::Abs(pr-1))<fptMax[1])((TH1F*)list->FindObject(str.Data()))->Fill(pt-fptMax[1]);
6938 else ((TH1F*)list->FindObject(str.Data()))->Fill(pt-fptMax[2]);
6939
6940
6941 str="hptD0PTallsqrt";
6942 str.Append(namehist.Data());
6943 Double_t sumsqrpt=fptAllSq-d->PtProng(1)*d->PtProng(1)-d->PtProng(0)*d->PtProng(0);
6944 if(sumsqrpt>0.)((TH1F*)list->FindObject(str.Data()))->Fill(pt,TMath::Sqrt(sumsqrpt));
6945
6946 str="hptD0PTall";
6947 str.Append(namehist.Data());
6948 ((TH1F*)list->FindObject(str.Data()))->Fill(pt,fptAll-d->PtProng(1)-d->PtProng(0));
6949
6950
6951 str="hd0zD0pt";
6952 str.Append(namehist.Data());
6953 str.Append("_pt");
6954 str+=ptbin;
6955 if(d->GetPrimaryVtx()!=0x0)((TH1F*)list->FindObject(str.Data()))->Fill(1e4*(d->Zv()-d->GetPrimaryVtx()->GetZ()));
6956
6957 str="heta";
6958 str.Append(namehist.Data());
6959 str.Append("_pt");
6960 str+=ptbin;
77ed0cdb 6961 ((TH1F*)list->FindObject(str.Data()))->Fill(d->Eta());
d39e8f99 6962
6963 // OTHER NEW ADDITIONAL HISTOS
6964
6965 str="hd0xd0";
6966 str.Append(namehist.Data());
6967 str.Append("_pt");
6968 str+=ptbin;
6969 //printf("Hist name: %s \n",str.Data());
6970 ((TH1F*)list->FindObject(str.Data()))->Fill(1e8*d->Prodd0d0());
6971
6972
6973 str="hd0D0VSd0xd0";
6974 str.Append(namehist.Data());
6975 str.Append("_pt");
6976 str+=ptbin;
6977 //printf("Hist name: %s \n",str.Data());
6978 ((TH2F*)list->FindObject(str.Data()))->Fill(1e8*d->Prodd0d0(),impparxy);
6979
6980
6981 str="hangletracksVSd0xd0";
6982 str.Append(namehist.Data());
6983 str.Append("_pt");
6984 str+=ptbin;
6985 //printf("Hist name: %s \n",str.Data());
6986 ((TH2F*)list->FindObject(str.Data()))->Fill(1e8*d->Prodd0d0(),d->ProngsRelAngle(0,1));
6987
6988 str="hangletracksVSd0D0";
6989 str.Append(namehist.Data());
6990 str.Append("_pt");
6991 str+=ptbin;
6992 // printf("Hist name: %s \n",str.Data());
6993 ((TH2F*)list->FindObject(str.Data()))->Fill(impparxy,d->ProngsRelAngle(0,1));
e047b348 6994 // ####################################################
d39e8f99 6995 }
e047b348 6996 }
ac4c229c 6997
6998 // ######### Invariant mass histos #################
77ed0cdb 6999 if(fFastAnalysis<1){
ac4c229c 7000 str="hMass";
7001 str.Append(namehist.Data());
77ed0cdb 7002 ((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0);
7003 ((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0bar);
7004
7005
7006 if(isPeakD0||isPeakD0bar){
7007 str="hMass";
7008 str.Append(namehist.Data());
7009 str.Append("PM");
7010 if(isPeakD0&&okD0)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0);
7011 if(isPeakD0bar&&okD0bar)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0bar);
7012 }
ac4c229c 7013 }
77ed0cdb 7014
cc3209fb 7015 // The Following is a NEW HISTO
7016 str="hInvMassD0";
e047b348 7017 str.Append(namehist.Data());
7018 str.Append("_pt");
7019 str+=ptbin;
7020 if(okD0)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0);
cc3209fb 7021 if((!fsplitMassD0D0bar)&&okD0bar)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0bar);
7022 str="hInvMassD0bar";
7023 str.Append(namehist.Data());
7024 str.Append("_pt");
7025 str+=ptbin;
7026 if(fsplitMassD0D0bar&&okD0bar)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0bar);
7027
e047b348 7028
d39e8f99 7029 // FILLING OF THE SPARSE HISTO
a9f921f5 7030 if(fFastAnalysis<=2){ // ONLY IF NOT VERY FAST ANALYSIS
d39e8f99 7031 str="hSparse";
7032 str.Append(namehist.Data());
a9f921f5 7033
d39e8f99 7034 Double_t point[5]={invMassD0,invMassD0bar,pt,impparxy,0.};
7035 if(okD0&&okD0bar)point[4]=3.5;
7036 else if(okD0)point[4]=1.5;
7037 else if(okD0bar)point[4]=2.5;
a3b80030 7038 if(fReadMC&&aodDMC!=0x0&&namehist.Contains("fromB")){
7039 point[3]=aodDMC->ImpParXY()*10000.;
7040 }
d39e8f99 7041 ((THnSparseF*)list->FindObject(str.Data()))->Fill(point);
a3b80030 7042 if(fReadMC&&aodDMC!=0x0&&namehist.Contains("fromB")){
7043 point[3]=impparxy;
7044 str="hSparseReco";
7045 str.Append(namehist.Data());
7046 ((THnSparseF*)list->FindObject(str.Data()))->Fill(point);
7047 }
7048
d39e8f99 7049
7050 str="hInvMassPt";
7051 str.Append(namehist.Data());
7052 if(okD0)((TH2F*)list->FindObject(str.Data()))->Fill(invMassD0,pt);
7053 if(okD0bar)((TH2F*)list->FindObject(str.Data()))->Fill(invMassD0bar,pt);
e047b348 7054
d39e8f99 7055 }
a9f921f5 7056
7057
7058
7059
7060 if(fFastAnalysis<=3&&namehist.Contains("sign")){
7061 str="hSparseCxyLxy";
7062 str.Append(namehist.Data());
7063 Double_t nLxy=d->NormalizedDecayLengthXY()*d->P()/pt;
7064 Double_t cosPxy=TMath::Abs(d->CosPointingAngleXY());
7065 Double_t point[4]={invMassD0,pt,cosPxy,nLxy};
7066 if(okD0){
7067 // printf("Listname: %s, Here the histo : %p \n",namehist.Data(),((THnSparseF*)list->FindObject(str.Data())));
7068 ((THnSparseF*)list->FindObject(str.Data()))->Fill(point);
7069 }
7070 point[0]=invMassD0bar;
7071 if(okD0bar){
7072 ((THnSparseF*)list->FindObject(str.Data()))->Fill(point);
7073 }
7074 }
7075
7076
7077
e047b348 7078 /* if(isPeakD0||isPeakD0bar){
7079 str="hMass";
7080 str.Append(namehist.Data());
7081 str.Append("PM");
7082 if(isPeakD0&&okD0)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0);
7083 if(isPeakD0bar&&okD0bar)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0bar);
7084 // The Following is a NEW HISTO
cc3209fb 7085 str="hInvMassD0";
e047b348 7086 str.Append(namehist.Data());
7087 str.Append("_pt");
7088 str+=ptbin;
7089 if(isPeakD0&&okD0)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0);
7090 if(isPeakD0bar&&okD0bar)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0bar);
7091 }*/
77ed0cdb 7092 if(fFastAnalysis<2){
7093 if(isSideBandD0||isSideBandD0bar){
7094 str="hMass";
7095 str.Append(namehist.Data());
7096 str.Append("SB");
7097 if(okD0)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0);
7098 if(okD0bar)((TH1F*)list->FindObject(str.Data()))->Fill(invMassD0bar);
7099 }
ac4c229c 7100 }
77ed0cdb 7101
bf74e6db 7102 if(fReadMC){
7103 if(massmumtrue>0.){
ac4c229c 7104 str="hMassTrue";
7105 str.Append(namehist.Data());
ac4c229c 7106 ((TH1F*)list->FindObject(str.Data()))->Fill(massmumtrue);
bf74e6db 7107
7108 if(isPeakD0||isPeakD0bar){
7109 str="hMassTrue";
7110 str.Append(namehist.Data());
7111 str.Append("PM");
7112 ((TH1F*)list->FindObject(str.Data()))->Fill(massmumtrue);
7113 }
d39e8f99 7114 if(isSideBandD0||isSideBandD0bar){
bf74e6db 7115 str="hMassTrue";
7116 str.Append(namehist.Data());
7117 str.Append("SB");
7118 ((TH1F*)list->FindObject(str.Data()))->Fill(massmumtrue);
7119 }
ac4c229c 7120 }
7121 }
77ed0cdb 7122
7123 // ################ D0 Impact Parameter Histos #####################
d39e8f99 7124 if(isPeakD0||isPeakD0bar){
7125
ac4c229c 7126 str="hd0D0";
7127 str.Append(namehist.Data());
7128 str.Append("PM");
d39e8f99 7129 if(!fReadMC){
7130 // WE COUNT TWICE A CANDIDATE UNDER THE INV MASS PEAK BOTH AS a D0 and a D0bar (if selected) for DATA ONLY
7131 // THIS BECAUSE WE SUBTRACT a "BACKGROUND" AMOUNT ESTIMATED USING THE INV MASS FIT INFORMATION
7132 // WHICH SHOULD ACCOUNT FOR REFLECTIONS
7133 if(isPeakD0&&okD0){
7134 ((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
7135 }
7136 if(isPeakD0bar&&okD0bar){
7137 ((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
7138 }
7139 }
7140 else {
7141 if((isPeakD0&&okD0)||(isPeakD0bar&&okD0bar))((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
7142 }
ac4c229c 7143
7144 str="hd0D0pt";
7145 str.Append(namehist.Data());
7146 str.Append("_PkMss_pt");
d39e8f99 7147 str+=ptbin;
7148 if(!fReadMC){
7149 // WE COUNT TWICE A CANDIDATE UNDER THE INV MASS PEAK BOTH AS a D0 and a D0bar (if selected) for DATA ONLY
7150 // THIS BECAUSE WE SUBTRACT a "BACKGROUND" AMOUNT ESTIMATED USING THE INV MASS FIT INFORMATION
7151 // WHICH SHOULD ACCOUNT FOR REFLECTIONS
7152 if(isPeakD0&&okD0){
7153 ((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
7154 }
7155 if(isPeakD0bar&&okD0bar){
7156 ((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
7157 }
7158 }
7159 else {
7160 if((isPeakD0&&okD0)||(isPeakD0bar&&okD0bar))((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
7161 }
7162
ac4c229c 7163
e047b348 7164 if(fReadMC&&vtxTrue){
d39e8f99 7165 // ONLY AN HISTO FOR QA: WE DO NOT CONSIDER THE IMPACT PARAMETER FOR EACH MASS HYPOTHESIS
ac4c229c 7166 str="hd0D0VtxTrue";
7167 str.Append(namehist.Data());
7168 str.Append("PM");
7169 ((TH1F*)list->FindObject(str.Data()))->Fill(d->AliAODRecoDecay::ImpParXY(vtxTrue)*10000.);
7170
7171 str="hd0D0VtxTruept";
7172 str.Append(namehist.Data());
7173 str.Append("_PkMss_pt");
7174 str+=ptbin;
7175 ((TH1F*)list->FindObject(str.Data()))->Fill(d->AliAODRecoDecay::ImpParXY(vtxTrue)*10000.);
7176 }
7177
e047b348 7178 if(fReadMC&&aodDMC!=0x0){
d39e8f99 7179 // WE NEED JUST THE SHAPE: AVOID TAKING THE IMPACT PAR FOR EACH MASS HYPO PASSING THE CUTS
7180 // aodDMC->Print("");
a9f921f5 7181 //aodDMC->ImpParXY();
d39e8f99 7182 // aodDMC->Print("");
ac4c229c 7183 str="hMCd0D0";
7184 str.Append(namehist.Data());
7185 str.Append("PM");
7186 ((TH1F*)list->FindObject(str.Data()))->Fill(aodDMC->ImpParXY()*10000.);
7187
7188 str="hMCd0D0pt";
7189 str.Append(namehist.Data());
7190 str.Append("_PkMss_pt");
7191 str+=ptbin;
7192 ((TH1F*)list->FindObject(str.Data()))->Fill(aodDMC->ImpParXY()*10000.);
d39e8f99 7193 }
7194 }
7195 else if(isSideBandD0||isSideBandD0bar){
7196 // WE ASSUME THE IMPACT PARAMETER DISTRIBUION FOR BACKGROUND(SIDEBANDS) CANDIDATES
7197 // IS NOT CORRELATED TO THE INVARIANT MASSES. THEREFORE WE JUST TAKE ONE TIME
7198 // THE IMPACT PARAMETER AND NOT ONE FOR EACH MASS HYPOTHESIS PASSING THE CUTS
7199
ac4c229c 7200 str="hd0D0";
7201 str.Append(namehist.Data());
7202 str.Append("SB");
d39e8f99 7203 ((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
ac4c229c 7204
7205 str="hd0D0pt";
7206 str.Append(namehist.Data());
7207 str.Append("_SBMss_pt");
7208 str+=ptbin;
d39e8f99 7209 ((TH1F*)list->FindObject(str.Data()))->Fill(impparxy);
ac4c229c 7210
7211
bf74e6db 7212 if(fReadMC&&vtxTrue){
ac4c229c 7213 str="hd0D0VtxTrue";
7214 str.Append(namehist.Data());
7215 str.Append("SB");
7216 ((TH1F*)list->FindObject(str.Data()))->Fill(d->AliAODRecoDecay::ImpParXY(vtxTrue)*10000.);
7217
7218 str="hd0D0VtxTruept";
7219 str.Append(namehist.Data());
7220 str.Append("_SBMss_pt");
7221 str+=ptbin;
7222 ((TH1F*)list->FindObject(str.Data()))->Fill(d->AliAODRecoDecay::ImpParXY(vtxTrue)*10000.);
7223
7224 }
7225
e047b348 7226 if(fReadMC&&aodDMC!=0x0){
ac4c229c 7227 str="hMCd0D0";
7228 str.Append(namehist.Data());
7229 str.Append("SB");
7230 ((TH1F*)list->FindObject(str.Data()))->Fill(aodDMC->ImpParXY()*10000.);
7231
7232 str="hMCd0D0pt";
7233 str.Append(namehist.Data());
7234 str.Append("_SBMss_pt");
7235 str+=ptbin;
7236 ((TH1F*)list->FindObject(str.Data()))->Fill(aodDMC->ImpParXY()*10000.);
7237 }
7238
7239 }
624c07ab 7240
7241 return kTRUE;
7242}
7243
ac4c229c 7244
e047b348 7245 void AliAnalysisTaskSECharmFraction::FillHistoMCproperties(TClonesArray *arrayMC){
7246 //#############################################################
7247 // HERE LOOK AT global properties of D0 mesons, c quarks and B
7248 //
7249 //#############################################################
7250 Double_t pxyzMum[3],pxyzDaught[3],cosOpenAngle=-1.1,ptmum,ptdaught;
7251 Int_t ncdaught=0,cquarksMC=0,nD0all=0,nD0FromB=0,nBdaught=0,nD0bquark=0,nD0bMeson=0,nD0bBaryon=0;
7252 for (Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++) {
7253 AliAODMCParticle* mcPart = dynamic_cast<AliAODMCParticle*>(arrayMC->At(iPart));
7254 if (!mcPart) {
7255 AliWarning("Particle not found in tree, skipping");
7256 continue;
7257 }
7258 if (TMath::Abs(mcPart->GetPdgCode()) == 4){
7259 cquarksMC++;
7260 mcPart->PxPyPz(pxyzMum);
7261 ptmum=mcPart->Pt();
7262
7263 ((TH1F*)flistMCproperties->FindObject("hMCcquarkAllPt"))->Fill(ptmum);
7264 ((TH1F*)flistMCproperties->FindObject("hMCcquarkAllEta"))->Fill(mcPart->Eta());
7265 ((TH1F*)flistMCproperties->FindObject("hMCcquarkAllEnergy"))->Fill(mcPart->E());
7266 //NOW LOOK FOR A D0 among cquark daughters
7267 ncdaught=mcPart->GetDaughter(1)-mcPart->GetDaughter(0)+1;
7268 ((TH1F*)flistMCproperties->FindObject("hMCcquarkNdaught"))->Fill(ncdaught);
7269 if(ncdaught>1){
7270 for(Int_t iDaught=mcPart->GetDaughter(0);iDaught<mcPart->GetDaughter(1);iDaught++){
7271 AliAODMCParticle* mcPartD0 = dynamic_cast<AliAODMCParticle*>(arrayMC->At(iDaught));
d39e8f99 7272 if(mcPartD0==0x0)continue;
e047b348 7273 if(TMath::Abs(mcPartD0->GetPdgCode()) == 421){
7274 // a D0 coming from a c quark
7275 mcPartD0->PxPyPz(pxyzDaught);
7276 ptdaught=mcPartD0->Pt();
7277 ((TH1F*)flistMCproperties->FindObject("hMCD0fromcPt"))->Fill(ptdaught);
7278 ((TH1F*)flistMCproperties->FindObject("hMCD0fromcEta"))->Fill(mcPartD0->Eta());
7279 ((TH1F*)flistMCproperties->FindObject("hMCD0fromcEnergy"))->Fill(mcPartD0->E());
7280 // ##############################################################################################
7281 // Compare D0 momentum and c quarks:
7282 // NB: here ALL D0 are considered, also those not decaying in KPi !!!
7283 // ##############################################################################################
7284 ((TH2F*)flistMCproperties->FindObject("hMCD0VscquarkPt"))->Fill(mcPart->Pt(),mcPartD0->Pt());
7285 ((TH2F*)flistMCproperties->FindObject("hMCD0VscquarkEnergy"))->Fill(mcPart->E(),mcPartD0->E());
7286 ((TH1F*)flistMCproperties->FindObject("hMCD0deltacquarkEnergy"))->Fill(mcPartD0->E()/mcPart->E());
7287 ((TH1F*)flistMCproperties->FindObject("hMCD0EnergyVsAvcquarkDaughtEn"))->Fill((mcPartD0->E()-(mcPart->E()/ncdaught))/mcPart->E());
7288 //calculate open angle
7289 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]));
7290 ((TH1F*)flistMCproperties->FindObject("hMCD0cquarkAngle"))->Fill(cosOpenAngle);
7291 ((TH2F*)flistMCproperties->FindObject("hMCD0cquarkAngleEnergy"))->Fill(mcPart->E(),cosOpenAngle);
7292 }
7293 }
7294 }
7295 }
7296
7297 // NOW LOOK FOR D0 not coming from cquarks
7298 if (TMath::Abs(mcPart->GetPdgCode()) == 421){
7299 nD0all++;
7300 if(mcPart->GetMother()<0)continue;
7301 AliAODMCParticle* mcD0Parent = dynamic_cast<AliAODMCParticle*>(arrayMC->At(mcPart->GetMother()));
77ed0cdb 7302 if(mcD0Parent==0x0)continue;
e047b348 7303 Bool_t notfound=kFALSE,bMeson=kFALSE,bBaryon=kFALSE;
7304 //CheckOrigin
a9f921f5 7305 while(TMath::Abs(mcD0Parent->GetPdgCode())!=4&&TMath::Abs(mcD0Parent->GetPdgCode())!=5){
e047b348 7306 if(500<TMath::Abs(mcD0Parent->GetPdgCode())%10000&&TMath::Abs(mcD0Parent->GetPdgCode())<600){
7307 bMeson=kTRUE;
7308 break;
7309 }
7310 else if (5000<TMath::Abs(mcD0Parent->GetPdgCode())&&TMath::Abs(mcD0Parent->GetPdgCode())<6000){
7311 bBaryon=kTRUE;
7312 break;
7313 }
d2027626 7314 if(mcD0Parent->GetMother()==0x0){
7315 notfound=kTRUE;
7316 break;
7317 };
e047b348 7318 if(mcD0Parent->GetMother()<0){
7319 notfound=kTRUE;
7320 break;
7321 }
7322 mcD0Parent=dynamic_cast<AliAODMCParticle*>(arrayMC->At(mcD0Parent->GetMother()));
d8bb6701 7323 if(mcD0Parent==0x0) break;
e047b348 7324 }
ffb1a4af 7325
7326 if(mcD0Parent==0x0)continue;
a9f921f5 7327 if(notfound)continue;
e047b348 7328 if(TMath::Abs(mcD0Parent->GetPdgCode())==4)continue;//D0 from c quarks already counted
7329 ((TH1F*)flistMCproperties->FindObject("hMCfromBpdgB"))->Fill(TMath::Abs(mcD0Parent->GetPdgCode()));
7330 if(bBaryon)nD0bBaryon++;
7331 else if(bMeson)nD0bMeson++;
7332 else nD0bquark++;
7333 nD0FromB++;
7334 mcD0Parent->PxPyPz(pxyzMum);
7335 ptmum=mcD0Parent->Pt();
7336 ((TH1F*)flistMCproperties->FindObject("hMCBhadrPt"))->Fill(ptmum);
7337 ((TH1F*)flistMCproperties->FindObject("hMCBhadrEta"))->Fill(mcD0Parent->Eta());
7338 ((TH1F*)flistMCproperties->FindObject("hMCBhadrEnergy"))->Fill(mcD0Parent->E());
7339
7340 nBdaught=mcD0Parent->GetDaughter(1)-mcD0Parent->GetDaughter(0)+1;
7341 ((TH1F*)flistMCproperties->FindObject("hMCBhadrNdaught"))->Fill(nBdaught);
7342
7343
7344 // Now take properties of this D0 coming from a B
7345 mcPart->PxPyPz(pxyzDaught);
7346 ptdaught=mcPart->Pt();
7347 ((TH1F*)flistMCproperties->FindObject("hMCD0fromBPt"))->Fill(ptdaught);
7348 ((TH1F*)flistMCproperties->FindObject("hMCD0fromBEta"))->Fill(mcPart->Eta());
7349 ((TH1F*)flistMCproperties->FindObject("hMCD0fromBEnergy"))->Fill(mcPart->E());
7350 // ##############################################################################################
7351 // Compare D0 momentum and b hadron:
7352 // NB: here ALL D0 are considered, also those not decaying in KPi !!!
7353 // ##############################################################################################
7354 ((TH2F*)flistMCproperties->FindObject("hMCD0VsBhadrPt"))->Fill(mcD0Parent->Pt(),mcPart->Pt());
7355 ((TH2F*)flistMCproperties->FindObject("hMCD0VsBhadrEnergy"))->Fill(mcD0Parent->E(),mcPart->E());
7356 ((TH1F*)flistMCproperties->FindObject("hMCD0deltaBhadrEnergy"))->Fill(mcPart->E()/mcD0Parent->E());
7357 ((TH1F*)flistMCproperties->FindObject("hMCD0EnergyVsAvBDaughtEn"))->Fill((mcPart->E()-(mcD0Parent->E()/nBdaught))/mcD0Parent->E());
7358 //calculate open angle
7359 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]));
7360 ((TH1F*)flistMCproperties->FindObject("hMCD0BhadrAngle"))->Fill(cosOpenAngle);
7361 ((TH2F*)flistMCproperties->FindObject("hMCD0BhadrAngleEnergy"))->Fill(mcPart->E(),cosOpenAngle);
7362 }
7363 }
7364 ((TH1F*)flistMCproperties->FindObject("hMCPartFound"))->Fill(1,cquarksMC);
7365 ((TH1F*)flistMCproperties->FindObject("hMCPartFound"))->Fill(2,nD0all);
7366 ((TH1F*)flistMCproperties->FindObject("hMCPartFound"))->Fill(3,nD0FromB);
7367 ((TH1F*)flistMCproperties->FindObject("hMCPartFound"))->Fill(4,nD0bMeson);
7368 ((TH1F*)flistMCproperties->FindObject("hMCPartFound"))->Fill(5,nD0bBaryon);
7369
7370 }
7371
7372
7373void AliAnalysisTaskSECharmFraction::SetPtBins(Int_t nbins,const Float_t *ptbins){
7374 if((fptbins)!=0x0)delete fptbins;
7375 fnbins=nbins;fptbins=new Float_t[fnbins];
7376 memcpy(fptbins,ptbins,fnbins*sizeof(Float_t));
ac4c229c 7377 return;
7378}
7379
7380void AliAnalysisTaskSECharmFraction::SetStandardMassSelection(){
7381 //SET THE DEFAULT VALUES FOR INVARIANT MASS SELECTION
e047b348 7382
7383 /*HERE DEFAULT
7384 SetSignalInvMassCut();
7385 SetLargeInvMassCut();
7386 SetSideBandInvMassCut();
7387 SetSideBandInvMassWindow();
7388 */
7389
7390 // HERE FOR SEARCH FOR SIGNAL
ac4c229c 7391 SetSignalInvMassCut();
7392 SetLargeInvMassCut();
7393 SetSideBandInvMassCut();
7394 SetSideBandInvMassWindow();
7395 return;
e047b348 7396}
7397
7398Bool_t AliAnalysisTaskSECharmFraction::SpecialSelD0(AliAODRecoDecayHF2Prong *d,Int_t &nusedforVtx){
7399
7400 AliAODTrack *trk0 = (AliAODTrack*)d->GetDaughter(0);
7401 AliAODTrack *trk1 = (AliAODTrack*)d->GetDaughter(1);
7402 nusedforVtx=0;
7403 if(trk0->GetUsedForPrimVtxFit())nusedforVtx++;
7404 if(trk1->GetUsedForPrimVtxFit())nusedforVtx++;
7405 if(nusedforVtx>fNtrMaxforVtx)return kFALSE;
7406
7407 if(TMath::Abs(d->Getd0Prong(1)) < -99999. ||
7408 TMath::Abs(d->Getd0Prong(0)) < -99999.) return kFALSE;
7409
7410 return kTRUE;
7411}
7412
7413
7414
7415AliAODVertex* AliAnalysisTaskSECharmFraction::GetPrimaryVtxSkipped(AliAODEvent *aodev,AliAODRecoDecayHF2Prong *d){
7416 //Calculate the primary vertex w/o the daughter tracks of the candidate
7417
7418 AliESDVertex *vertexESD=0x0;
7419 AliAODVertex *vertexAOD=0x0;
7420 AliVertexerTracks *vertexer = new AliVertexerTracks(aodev->GetMagneticField());
7421
7422 Int_t skipped[2];
7423 Int_t nTrksToSkip=2;
7424 AliAODTrack *dgTrack = (AliAODTrack*)d->GetDaughter(0);
7425 skipped[0]=dgTrack->GetID();
7426 dgTrack = (AliAODTrack*)d->GetDaughter(1);
7427 skipped[1]=dgTrack->GetID();
7428
7429
7430 //
7431 vertexer->SetSkipTracks(nTrksToSkip,skipped);
7432 vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(aodev);
7433 vertexer->SetMinClusters(4);
7434 if(!vertexESD) return vertexAOD;
7435 if(vertexESD->GetNContributors()<=0) {
7436 AliDebug(2,"vertexing failed");
7437 delete vertexESD; vertexESD=NULL;
7438 return vertexAOD;
ac4c229c 7439 }
e047b348 7440
7441 delete vertexer; vertexer=NULL;
7442
7443
7444 // convert to AliAODVertex
7445 Double_t pos[3],cov[6],chi2perNDF;
7446 vertexESD->GetXYZ(pos); // position
7447 vertexESD->GetCovMatrix(cov); //covariance matrix
7448 chi2perNDF = vertexESD->GetChi2toNDF();
7449 delete vertexESD; vertexESD=NULL;
7450
7451 vertexAOD = new AliAODVertex(pos,cov,chi2perNDF);
7452 return vertexAOD;
7453
7454}
ac4c229c 7455
7456
77ed0cdb 7457
7458 Bool_t AliAnalysisTaskSECharmFraction::FillAziList(AliAODEvent *aod,Double_t azilist[30000],Int_t trkIDlist[30000],Int_t &nprim)const{
7459 Int_t ntracks=aod->GetNumberOfTracks();
7460 Double_t ptmin=1.;
7461 if(ntracks>30000){
7462 nprim=1;
7463 return kFALSE;
7464 }
7465 nprim=0;
7466 for(Int_t it=0;it<ntracks;it++) {
7467 AliAODTrack *track = aod->GetTrack(it);
7468
7469 if(track->IsPrimaryCandidate()){
7470 if(track->Pt()>ptmin){
7471
7472 azilist[nprim]=track->Phi();
7473 trkIDlist[nprim]=track->GetID();
7474 nprim++;
7475 }
7476 }
7477 }
7478 return kTRUE;
7479 }
7480
7481
7482 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{
7483
7484 if((!okD0)&&(!okD0bar))return;
7485 if(ptbin==-1)return;
7486 TString namehist=list->GetName(),str;
7487 namehist.ReplaceAll("list","");
7488 // Double_t ptD=d->Pt();
7489
7490 str="hPhiHist";
7491 if(isPeakD0||isPeakD0bar)str.Append("PM");
7492 else if(isSideBandD0||isSideBandD0bar)str.Append("SB");
7493 else return;
7494 str.Append(namehist.Data());
7495 str.Append("_pt");
7496 str+=ptbin;
7497
7498 AliAODTrack *dtr;
7499 dtr=(AliAODTrack*)d->GetDaughter(0);
7500 Int_t id1=dtr->GetID();
7501 dtr=(AliAODTrack*)d->GetDaughter(1);
7502 Int_t id2=dtr->GetID();
7503
7504 Double_t phi=d->Phi();
7505 Double_t weight=1./nprim;
7506 Double_t azi;
7507 for(Int_t j=0;j<nprim;j++){
7508 if(trkIDlist[j]!=id1&&trkIDlist[j]!=id2){
7509 azi=azilist[j]-phi;
7510 if(azi>TMath::Pi())azi-=2.*TMath::Pi();
7511 else if(azi<-TMath::Pi())azi+=2.*TMath::Pi();
7512
7513 ((TH1F*)list->FindObject(str.Data()))->Fill(azi,weight);
7514 }
7515 }
7516
7517
7518 }
7519
7520
7521
7522
7523
7524
7525
7526
7527
624c07ab 7528void AliAnalysisTaskSECharmFraction::Terminate(const Option_t*){
7529 //TERMINATE METHOD: NOTHING TO DO
7530
7531
a9f921f5 7532
624c07ab 7533}