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