25 #include "AliKFVertex.h" 26 #include "AliAODTrack.h" 27 #include "AliESDtrack.h" 28 #include "AliAnalysisManager.h" 29 #include "AliInputEventHandler.h" 30 #include "AliMCEventHandler.h" 31 #include "AliAODHandler.h" 32 #include "AliPIDResponse.h" 35 #include "AliMCEvent.h" 37 #include "TObjString.h" 38 #include "AliAODEvent.h" 39 #include "AliESDEvent.h" 40 #include "AliCentrality.h" 43 #include "TDatabasePDG.h" 44 #include "AliAODMCParticle.h" 59 "DegreesForRotationMethod",
77 AliAnalysisCuts(name,title),
79 fCaloPhotonCuts(NULL),
83 fHistoMesonCuts(NULL),
84 fHistoMesonBGCuts(NULL),
85 fHistoDCAGGMesonBefore(NULL),
86 fHistoDCAZMesonPrimVtxBefore(NULL),
87 fHistoDCARMesonPrimVtxBefore(NULL),
88 fHistoDCAGGMesonAfter(NULL),
89 fHistoDCAZMesonPrimVtxAfter(NULL),
90 fHistoDCARMesonPrimVtxAfter(NULL),
91 fHistoInvMassBefore(NULL),
92 fHistoInvMassAfter(NULL),
101 fAlphaMinCutMeson(0),
103 fRapidityCutMeson(1),
108 fDCAGammaGammaCut(1000),
109 fDCAZMesonPrimVtxCut(1000),
110 fDCARMesonPrimVtxCut(1000),
112 fMaxOpanCutMeson(TMath::Pi()),
113 fSidebandMixingLow(0.180),
114 fSidebandMixingHigh(0.300),
115 fSidebandMixingLeftLow(0.05),
116 fSidebandMixingLeftHigh(0.100),
117 fSidebandMixingRightLow(0.180),
118 fSidebandMixingRightHigh(0.300),
119 fOpeningAngle(0.005),
122 fIsMergedClusterCut(0),
123 fSelectionWindowCut(-1),
124 fNDegreeRotationPMForBG(0),
125 fNumberOfBGEvents(0),
126 fElectronLabelArraySize(500),
127 fElectronLabelArray(NULL),
128 fBackgroundHandler(0),
129 fDoLightOutput(kFALSE),
131 fEnableMassCut(kFALSE),
132 fAcceptMesonMass(kTRUE),
133 fUseRotationMethodInBG(kFALSE),
134 fUsePtmaxMethodForBG(kFALSE),
136 fDoBGProbability(kFALSE),
137 fDoConvCaloMixing(kFALSE),
138 fDoSectorMixing(kFALSE),
139 fDoSectorJetMixing(kFALSE),
140 fDoSphericityMixing(kFALSE),
141 fUseTrackMultiplicityForBG(kFALSE),
142 fEnableMinOpeningAngleCut(kTRUE),
143 fEnableOneCellDistCut(kFALSE),
144 fDoToCloseV0sCut(kFALSE),
145 fDoSharedElecCut(kFALSE),
146 fUseMCPSmearing(kFALSE),
147 fAlphaPtDepCut(kFALSE),
148 fDCAGammaGammaCutOn(kFALSE),
149 fDCAZMesonPrimVtxCutOn(kFALSE),
150 fDCARMesonPrimVtxCutOn(kFALSE),
151 fMinOpanPtDepCut(kFALSE),
152 fMaxOpanPtDepCut(kFALSE),
153 fBackgroundUseSideband(kFALSE),
154 fBackgroundUseSidebandBothSides(kFALSE),
155 fBackgroundUseLikeSign(kFALSE),
156 fDoJetAnalysis(kFALSE),
163 fBrem =
new TF1(
"fBrem",
"pow(-log(x),[0]/log(2.0)-1.0)/TMath::Gamma([0]/log(2.0))",0.00001,0.999999999);
166 fBrem->SetNpx(100000);
172 AliAnalysisCuts(ref),
302 TH1::AddDirectory(kFALSE);
413 TH1::AddDirectory(kTRUE);
421 if(!mcEvent)
return kFALSE;
423 if(fMCMother->GetPdgCode()==111 || fMCMother->GetPdgCode()==221 || fMCMother->GetPdgCode()==331 ){
424 if(fMCMother->R()>
fMaxR)
return kFALSE;
427 if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
428 rapidity=8.-fRapidityShift;
430 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
440 if(fMCMother->GetNDaughters()!=2)
return kFALSE;
442 for(
Int_t i=0;i<2;i++){
443 if(fMCMother->GetDaughter(i) < 0)
return kFALSE;
444 TParticle *MDaughter=mcEvent->Particle(fMCMother->GetDaughter(i));
446 if(MDaughter->GetPdgCode()!=22)
return kFALSE;
462 if(!AODMCArray)
return kFALSE;
464 if(MCMother->GetPdgCode()==111 || MCMother->GetPdgCode()==221 || MCMother->GetPdgCode()==331 ){
465 Double_t rMeson = sqrt( (MCMother->Xv()*MCMother->Xv()) + (MCMother->Yv()*MCMother->Yv()) ) ;
466 if(rMeson>
fMaxR)
return kFALSE;
469 if(MCMother->E() - MCMother->Pz() == 0 || MCMother->E() + MCMother->Pz() == 0){
470 rapidity=8.-fRapidityShift;
472 rapidity = 0.5*(TMath::Log((MCMother->E()+MCMother->Pz()) / (MCMother->E()-MCMother->Pz())))-fRapidityShift;
482 if(MCMother->GetNDaughters()!=2)
return kFALSE;
484 for(
Int_t i=0;i<2;i++){
485 AliAODMCParticle *MDaughter=
static_cast<AliAODMCParticle*
>(AODMCArray->At(MCMother->GetDaughter(i)));
487 if(MDaughter->GetPdgCode()!=22)
return kFALSE;
504 if( !mcEvent )
return kFALSE;
506 if( fMCMother->GetPdgCode() != 111 && fMCMother->GetPdgCode() != 221 && fMCMother->GetPdgCode() != 331)
return kFALSE;
508 if( fMCMother->R()>
fMaxR )
return kFALSE;
512 if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
513 rapidity=8.-fRapidityShift;
516 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
526 if( fMCMother->GetNDaughters() != 3 )
return kFALSE;
528 TParticle *positron = 0x0;
529 TParticle *electron = 0x0;
530 TParticle *gamma = 0x0;
532 for(
Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
533 if(index < 0)
continue;
534 TParticle* temp = (TParticle*)mcEvent->Particle( index );
536 switch( temp->GetPdgCode() ) {
539 labelpositron = index;
543 labelelectron = index;
552 if( positron && electron && gamma)
return kTRUE;
562 if( !AODMCArray )
return kFALSE;
564 if( fMCMother->GetPdgCode() != 111 && fMCMother->GetPdgCode() != 221 && fMCMother->GetPdgCode() != 331 )
return kFALSE;
566 Double_t rMeson = sqrt( (fMCMother->Xv()*fMCMother->Xv()) + (fMCMother->Yv()*fMCMother->Yv()) ) ;
567 if(rMeson>
fMaxR)
return kFALSE;
571 if( fMCMother->E() - fMCMother->Pz() == 0 || fMCMother->E() + fMCMother->Pz() == 0 ){
572 rapidity=8.-fRapidityShift;
575 rapidity = 0.5*(TMath::Log((fMCMother->E()+fMCMother->Pz()) / (fMCMother->E()-fMCMother->Pz())))-fRapidityShift;
585 if( fMCMother->GetNDaughters() != 3 )
return kFALSE;
587 AliAODMCParticle *positron = 0x0;
588 AliAODMCParticle *electron = 0x0;
589 AliAODMCParticle *gamma = 0x0;
591 for(
Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
592 if(index < 0)
continue;
593 AliAODMCParticle* temp =
static_cast<AliAODMCParticle*
>(AODMCArray->At(index));
596 switch( temp->GetPdgCode() ) {
599 labelpositron = index;
603 labelelectron = index;
612 if( positron && electron && gamma)
return kTRUE;
622 if( !mcEvent )
return kFALSE;
624 if( fMCMother->GetPdgCode() != 221 )
return kFALSE;
626 if( fMCMother->R()>
fMaxR )
return kFALSE;
630 if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
631 rapidity=8.-fRapidityShift;
634 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
644 if( fMCMother->GetNDaughters() != 3 )
return kFALSE;
646 TParticle *posPion = 0x0;
647 TParticle *negPion = 0x0;
648 TParticle *gamma = 0x0;
650 for(
Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
651 if(index < 0)
continue;
652 TParticle* temp = (TParticle*)mcEvent->Particle( index );
654 switch( temp->GetPdgCode() ) {
657 labelPosPion = index;
661 labelNegPion = index;
670 if( posPion && negPion && gamma)
return kTRUE;
680 if( !AODMCArray )
return kFALSE;
682 if( fMCMother->GetPdgCode() != 221 )
return kFALSE;
684 Double_t rMeson = sqrt( (fMCMother->Xv()*fMCMother->Xv()) + (fMCMother->Yv()*fMCMother->Yv()) ) ;
685 if(rMeson>
fMaxR)
return kFALSE;
689 if( fMCMother->E() - fMCMother->Pz() == 0 || fMCMother->E() + fMCMother->Pz() == 0 ){
690 rapidity=8.-fRapidityShift;
693 rapidity = 0.5*(TMath::Log((fMCMother->E()+fMCMother->Pz()) / (fMCMother->E()-fMCMother->Pz())))-fRapidityShift;
703 if( fMCMother->GetNDaughters() != 3 )
return kFALSE;
705 AliAODMCParticle *posPion = 0x0;
706 AliAODMCParticle *negPion = 0x0;
707 AliAODMCParticle *gamma = 0x0;
709 for(
Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
710 if(index < 0)
continue;
711 AliAODMCParticle* temp =
static_cast<AliAODMCParticle*
>(AODMCArray->At(index));
713 switch( temp->GetPdgCode() ) {
716 labelPosPion = index;
720 labelNegPion = index;
729 if( posPion && negPion && gamma)
return kTRUE;
739 if( !mcEvent )
return kFALSE;
741 if( !(fMCMother->GetPdgCode() == 331 ) )
return kFALSE;
743 if( fMCMother->R()>
fMaxR )
return kFALSE;
747 if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
748 rapidity=8.-fRapidityShift;
751 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
761 if( fMCMother->GetNDaughters() != 3 )
return kFALSE;
763 TParticle *posPion = 0x0;
764 TParticle *negPion = 0x0;
765 TParticle *etaMeson = 0x0;
768 for(
Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
769 if(index < 0)
continue;
770 TParticle* temp = (TParticle*)mcEvent->Particle( index );
772 switch( temp->GetPdgCode() ) {
775 labelPosPion = index;
779 labelNegPion = index;
783 labelEtaMeson = index;
788 if( posPion && negPion && etaMeson )
return kTRUE;
797 if( !AODMCArray )
return kFALSE;
799 if( !(fMCMother->GetPdgCode() == 331 ) )
return kFALSE;
801 Double_t rMeson = sqrt( (fMCMother->Xv()*fMCMother->Xv()) + (fMCMother->Yv()*fMCMother->Yv()) ) ;
802 if( rMeson >
fMaxR )
return kFALSE;
806 if( fMCMother->E() - fMCMother->Pz() == 0 || fMCMother->E() + fMCMother->Pz() == 0 ){
807 rapidity=8.-fRapidityShift;
810 rapidity = 0.5*(TMath::Log((fMCMother->E()+fMCMother->Pz()) / (fMCMother->E()-fMCMother->Pz())))-fRapidityShift;
820 if( fMCMother->GetNDaughters() != 3 )
return kFALSE;
822 AliAODMCParticle *posPion = 0x0;
823 AliAODMCParticle *negPion = 0x0;
824 AliAODMCParticle *etaMeson = 0x0;
827 for(
Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
828 if(index < 0)
continue;
829 AliAODMCParticle* temp =
static_cast<AliAODMCParticle*
>(AODMCArray->At(index));
831 switch( temp->GetPdgCode() ) {
834 labelPosPion = index;
838 labelNegPion = index;
842 labelEtaMeson = index;
847 if( posPion && negPion && etaMeson )
return kTRUE;
856 if( !mcEvent )
return kFALSE;
858 if( !(fMCMother->GetPdgCode() == 221 || fMCMother->GetPdgCode() == 223 || fMCMother->GetPdgCode() == 421) )
return kFALSE;
860 if( fMCMother->R()>
fMaxR )
return kFALSE;
864 if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
865 rapidity=8.-fRapidityShift;
868 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
878 if( fMCMother->GetNDaughters() != 3 )
return kFALSE;
880 TParticle *posPion = 0x0;
881 TParticle *negPion = 0x0;
882 TParticle *neutPion = 0x0;
885 for(
Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
886 if(index < 0)
continue;
887 TParticle* temp = (TParticle*)mcEvent->Particle( index );
889 switch( temp->GetPdgCode() ) {
892 labelPosPion = index;
896 labelNegPion = index;
900 labelNeutPion = index;
905 if( posPion && negPion && neutPion )
return kTRUE;
915 if( !AODMCArray )
return kFALSE;
917 if( !(fMCMother->GetPdgCode() == 221 || fMCMother->GetPdgCode() == 223 || fMCMother->GetPdgCode() == 421) )
return kFALSE;
919 Double_t rMeson = sqrt( (fMCMother->Xv()*fMCMother->Xv()) + (fMCMother->Yv()*fMCMother->Yv()) ) ;
920 if( rMeson >
fMaxR )
return kFALSE;
924 if( fMCMother->E() - fMCMother->Pz() == 0 || fMCMother->E() + fMCMother->Pz() == 0 ){
925 rapidity=8.-fRapidityShift;
928 rapidity = 0.5*(TMath::Log((fMCMother->E()+fMCMother->Pz()) / (fMCMother->E()-fMCMother->Pz())))-fRapidityShift;
938 if( fMCMother->GetNDaughters() != 3 )
return kFALSE;
940 AliAODMCParticle *posPion = 0x0;
941 AliAODMCParticle *negPion = 0x0;
942 AliAODMCParticle *neutPion = 0x0;
945 for(
Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
946 if(index < 0)
continue;
947 AliAODMCParticle* temp =
static_cast<AliAODMCParticle*
>(AODMCArray->At(index));
949 switch( temp->GetPdgCode() ) {
952 labelPosPion = index;
956 labelNegPion = index;
960 labelNeutPion = index;
965 if( posPion && negPion && neutPion )
return kTRUE;
973 if(!mcEvent)
return kFALSE;
975 if(fMCMother->GetPdgCode()!=223)
return kFALSE;
979 if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
980 rapidity=8.-fRapidityShift;
983 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
992 if(fMCMother->GetNDaughters()!=2)
return kFALSE;
994 TParticle *gamma = 0x0;
995 TParticle *pi0 = 0x0;
997 for(
Int_t index = fMCMother->GetFirstDaughter();index <= fMCMother->GetLastDaughter();index++){
998 if(index < 0)
continue;
999 TParticle *temp = (TParticle*)mcEvent->Particle(index);
1000 switch(temp->GetPdgCode()){
1007 labelNeutPion = index;
1012 if(gamma && pi0)
return kTRUE;
1021 if(!AODMCArray)
return kFALSE;
1023 if(fMCMother->GetPdgCode()!=223)
return kFALSE;
1027 if(fMCMother->E() - fMCMother->Pz() == 0 || fMCMother->E() + fMCMother->Pz() == 0){
1028 rapidity=8.-fRapidityShift;
1031 rapidity = 0.5*(TMath::Log((fMCMother->E()+fMCMother->Pz()) / (fMCMother->E()-fMCMother->Pz())))-fRapidityShift;
1040 if(fMCMother->GetNDaughters()!=2)
return kFALSE;
1042 AliAODMCParticle *gamma = 0x0;
1043 AliAODMCParticle *pi0 = 0x0;
1045 for(
Int_t index = fMCMother->GetFirstDaughter();index <= fMCMother->GetLastDaughter();index++){
1046 if(index < 0)
continue;
1047 AliAODMCParticle* temp =
static_cast<AliAODMCParticle*
>(AODMCArray->At(index));
1048 switch(temp->GetPdgCode()){
1055 labelNeutPion = index;
1060 if(gamma && pi0)
return kTRUE;
1068 if(!DoPiZeroAngleCut)
return kTRUE;
1070 Double_t PiZeroGammaAngle = pi0->Angle(gamma->Vect());
1073 if(PiZeroGammaAngle > lowerFactor * maxfit->Eval(omegaPt) && PiZeroGammaAngle < upperFactor * maxfit->Eval(omegaPt))
return kTRUE;
1083 if(!mcEvent)
return kFALSE;
1087 if(fMCMother->GetPdgCode()==10441 || fMCMother->GetPdgCode()==10443 || fMCMother->GetPdgCode()==445 ){
1088 if(fMCMother->R()>
fMaxR)
return kFALSE;
1091 if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
1092 rapidity=8.-fRapidityShift;
1095 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
1105 if(fMCMother->GetNDaughters()!=2)
return kFALSE;
1107 TParticle *jpsi = 0x0;
1108 TParticle *gamma = 0x0;
1109 TParticle *positron = 0x0;
1110 TParticle *electron = 0x0;
1114 for(
Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
1115 if(index < 0)
continue;
1116 TParticle* temp = (TParticle*)mcEvent->Particle( index );
1118 switch( temp->GetPdgCode() ) {
1125 labelgammaChiC = index;
1130 if ( !jpsi || ! gamma)
return kFALSE;
1131 if(jpsi->GetNDaughters()!=2)
return kFALSE;
1134 for(
Int_t index= jpsi->GetFirstDaughter();index<= jpsi->GetLastDaughter();index++){
1135 if(index < 0)
continue;
1136 TParticle* temp = (TParticle*)mcEvent->Particle( index );
1137 switch( temp->GetPdgCode() ) {
1140 labelelectronChiC = index;
1144 labelpositronChiC = index;
1148 if( !electron || !positron)
return kFALSE;
1149 if( positron && electron && gamma)
return kTRUE;
1159 if(!AODMCArray)
return kFALSE;
1163 if(fMCMother->GetPdgCode()==10441 || fMCMother->GetPdgCode()==10443 || fMCMother->GetPdgCode()==445 ){
1164 Double_t rMeson = sqrt( (fMCMother->Xv()*fMCMother->Xv()) + (fMCMother->Yv()*fMCMother->Yv()) ) ;
1165 if( rMeson >
fMaxR )
return kFALSE;
1168 if(fMCMother->E() - fMCMother->Pz() == 0 || fMCMother->E() + fMCMother->Pz() == 0){
1169 rapidity=8.-fRapidityShift;
1172 rapidity = 0.5*(TMath::Log((fMCMother->E()+fMCMother->Pz()) / (fMCMother->E()-fMCMother->Pz())))-fRapidityShift;
1182 if(fMCMother->GetNDaughters()!=2)
return kFALSE;
1184 AliAODMCParticle *jpsi = 0x0;
1185 AliAODMCParticle *gamma = 0x0;
1186 AliAODMCParticle *positron = 0x0;
1187 AliAODMCParticle *electron = 0x0;
1191 for(
Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
1192 if(index < 0)
continue;
1193 AliAODMCParticle* temp =
static_cast<AliAODMCParticle*
>(AODMCArray->At(index));
1195 switch( temp->GetPdgCode() ) {
1202 labelgammaChiC = index;
1207 if ( !jpsi || ! gamma)
return kFALSE;
1208 if(jpsi->GetNDaughters()!=2)
return kFALSE;
1211 for(
Int_t index= jpsi->GetFirstDaughter();index<= jpsi->GetLastDaughter();index++){
1212 if(index < 0)
continue;
1213 AliAODMCParticle* temp =
static_cast<AliAODMCParticle*
>(AODMCArray->At(index));
1214 switch( temp->GetPdgCode() ) {
1217 labelelectronChiC = index;
1221 labelpositronChiC = index;
1225 if( !electron || !positron)
return kFALSE;
1226 if( positron && electron && gamma)
return kTRUE;
1245 if(hist)hist->Fill(cutIndex, pi0->Pt());
1249 if((pi0->E()+pi0->Pz())/(pi0->E()-pi0->Pz())<=0){
1250 if(hist)hist->Fill(cutIndex, pi0->Pt());
1252 if (!IsSignal)cout <<
"undefined rapidity" << endl;
1259 if(hist)hist->Fill(cutIndex, pi0->Pt());
1272 if (pi0->M() > massMax || pi0->M() < massMin ){
1273 if(hist)hist->Fill(cutIndex, pi0->Pt());
1280 if(hist)hist->Fill(cutIndex, pi0->Pt());
1289 if(hist)hist->Fill(cutIndex, pi0->Pt());
1297 if(hist)hist->Fill(cutIndex, pi0->Pt());
1305 if(hist)hist->Fill(cutIndex, pi0->Pt());
1315 if(hist)hist->Fill(cutIndex, pi0->Pt());
1322 if(hist)hist->Fill(cutIndex, pi0->Pt());
1335 if(hist)hist->Fill(cutIndex, pi0->Pt());
1343 if(hist)hist->Fill(cutIndex, pi0->Pt());
1353 if(hist)hist->Fill(cutIndex, pi0->Pt());
1367 if(hist)hist->Fill(cutIndex, pi0->Pt());
1373 if(hist)hist->Fill(cutIndex, pi0->Pt());
1398 if(analysisCutSelection.Length()!=
kNCuts) {
1399 AliError(Form(
"Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(),
kNCuts));
1402 if(!analysisCutSelection.IsAlnum()){
1403 AliError(
"Cut selection is not alphanumeric");
1407 TString analysisCutSelectionLowerCase = Form(
"%s",analysisCutSelection.Data());
1408 analysisCutSelectionLowerCase.ToLower();
1409 const char *cutSelection = analysisCutSelectionLowerCase.Data();
1410 #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0' 1434 }
else return kFALSE;
1441 }
else return kFALSE;
1447 }
else return kFALSE;
1455 }
else return kFALSE;
1461 }
else return kFALSE;
1468 }
else return kFALSE;
1475 }
else return kFALSE;
1482 }
else return kFALSE;
1489 }
else return kFALSE;
1496 }
else return kFALSE;
1503 }
else return kFALSE;
1509 }
else return kFALSE;
1515 }
else return kFALSE;
1521 }
else return kFALSE;
1527 }
else return kFALSE;
1533 }
else return kFALSE;
1539 }
else return kFALSE;
1546 }
else return kFALSE;
1549 cout <<
"Error:: Cut id out of range"<< endl;
1553 cout <<
"Error:: Cut id " << cutID <<
" not recognized "<< endl;
1570 printf(
"\nMeson cutnumber \n");
1572 printf(
"%d",
fCuts[ic]);
1576 printf(
"Meson cuts \n");
1581 else printf(
"\t alpha pT-dep cut active\n");
1588 printf(
"\t Meson selection energy dependent\n\n");
1597 else printf(
"\t Min theta_{open} pT-dep cut active\n");
1599 else printf(
"\t Max theta_{open} pT-dep cut active\n");
1600 printf(
"\t Running mode for cutselection (0 std, 2 PCM-Calo): %d\n",
fMode);
1602 printf(
"Meson BG settings \n");
1604 printf(
"\t No BG estimation \n");
1638 cout<<
"Warning: Meson kind not defined"<<mesonKind<<endl;
1681 cout<<
"Warning: pT cut not defined"<<PtCut<<endl;
1690 switch(selectionCut){
1812 cout<<
"Warning: SelectionCut not defined "<<selectionCut<<endl;
1853 cout<<
"Warning: SelectionCut merged not defined "<<selectionCut<<endl;
1890 aSigmaHigh = 0.0012;
1893 mass = aMass + bMass*e;
1895 if (e < switchSigma){
1896 sigma = aSigmaLow + bSigmaLow*e;
1898 sigma = aSigmaHigh + bSigmaHigh*e;
1900 return mass + nSigma*
sigma;
1912 aSigmaHigh = 0.0023;
1913 bSigmaHigh = 6.7e-4;
1916 if (e < switchMass){
1917 mass = aMassLow + bMassLow*e;
1919 mass = aMassHigh + bMassHigh*e;
1922 if (e < switchSigma){
1923 sigma = aSigmaLow + bSigmaLow*e;
1925 sigma = aSigmaHigh + bSigmaHigh*e;
1927 return mass + nSigma*
sigma;
1936 aSigmaHigh = 0.0012;
1939 mass = aMass + bMass*e;
1941 if (e < switchSigma){
1942 sigma = aSigmaLow + bSigmaLow*e;
1944 sigma = aSigmaHigh + bSigmaHigh*e;
1946 return mass + nSigma*
sigma;
1958 aSigmaHigh = 0.0023;
1959 bSigmaHigh = 6.7e-4;
1962 if (e < switchMass){
1963 mass = aMassLow + bMassLow*e;
1965 mass = aMassHigh + bMassHigh*e;
1968 if (e < switchSigma){
1969 sigma = aSigmaLow + bSigmaLow*e;
1971 sigma = aSigmaHigh + bSigmaHigh*e;
1973 return mass + nSigma*
sigma;
1982 aSigmaHigh = 0.0012;
1985 mass = aMass + bMass*e;
1987 if (e < switchSigma){
1988 sigma = aSigmaLow + bSigmaLow*e;
1990 sigma = aSigmaHigh + bSigmaHigh*e;
1992 return mass + nSigma*
sigma;
2004 aSigmaHigh = 0.0023;
2005 bSigmaHigh = 6.7e-4;
2008 if (e < switchMass){
2009 mass = aMassLow + bMassLow*e;
2011 mass = aMassHigh + bMassHigh*e;
2014 if (e < switchSigma){
2015 sigma = aSigmaLow + bSigmaLow*e;
2017 sigma = aSigmaHigh + bSigmaHigh*e;
2019 return mass + nSigma*
sigma;
2067 aSigmaHigh = 0.0012;
2070 mass = aMass + bMass*e;
2072 if (e < switchSigma){
2073 sigma = aSigmaLow + bSigmaLow*e;
2075 sigma = aSigmaHigh + bSigmaHigh*e;
2078 return mass - nSigma*
sigma;
2090 aSigmaHigh = 0.0023;
2091 bSigmaHigh = 6.7e-4;
2094 if (e < switchMass){
2095 mass = aMassLow + bMassLow*e;
2097 mass = aMassHigh + bMassHigh*e;
2100 if (e < switchSigma){
2101 sigma = aSigmaLow + bSigmaLow*e;
2103 sigma = aSigmaHigh + bSigmaHigh*e;
2107 return mass - nSigma*
sigma;
2116 aSigmaHigh = 0.0012;
2119 mass = aMass + bMass*e;
2121 if (e < switchSigma){
2122 sigma = aSigmaLow + bSigmaLow*e;
2124 sigma = aSigmaHigh + bSigmaHigh*e;
2127 return mass - nSigma*
sigma;
2139 aSigmaHigh = 0.0023;
2140 bSigmaHigh = 6.7e-4;
2143 if (e < switchMass){
2144 mass = aMassLow + bMassLow*e;
2146 mass = aMassHigh + bMassHigh*e;
2149 if (e < switchSigma){
2150 sigma = aSigmaLow + bSigmaLow*e;
2152 sigma = aSigmaHigh + bSigmaHigh*e;
2156 return mass - nSigma*
sigma;
2165 aSigmaHigh = 0.0012;
2168 mass = aMass + bMass*e;
2170 if (e < switchSigma){
2171 sigma = aSigmaLow + bSigmaLow*e;
2173 sigma = aSigmaHigh + bSigmaHigh*e;
2176 return mass - nSigma*
sigma;
2188 aSigmaHigh = 0.0023;
2189 bSigmaHigh = 6.7e-4;
2192 if (e < switchMass){
2193 mass = aMassLow + bMassLow*e;
2195 mass = aMassHigh + bMassHigh*e;
2198 if (e < switchSigma){
2199 sigma = aSigmaLow + bSigmaLow*e;
2201 sigma = aSigmaHigh + bSigmaHigh*e;
2204 return mass - nSigma*
sigma;
2208 return 0.005+0.004*e;
2211 return 0.004+0.004*e;
2214 return 0.006+0.004*e;
2227 switch(alphaMesonCut){
2236 fFAlphaCut =
new TF1(
"fFAlphaCut",
"[0]*tanh([1]*x)",0.,100.);
2251 fFAlphaCut =
new TF1(
"fFAlphaCut",
"[0]*tanh([1]*x)",0.,100.);
2296 fFAlphaCut =
new TF1(
"fFAlphaCut",
"[0]*tanh([1]*x)",0.,100.);
2329 cout<<
"Warning: AlphaMesonCut not defined "<<alphaMesonCut<<endl;
2339 switch(alphaMesonCut){
2347 fFAlphaCut =
new TF1(
"fFAlphaCut",
"[0]+[1]*x+[2]/(x*x*x)",0.,100.);
2357 fFAlphaCut =
new TF1(
"fFAlphaCut",
"[0]+[1]*x+[2]/(x*x*x)",0.,100.);
2367 fFAlphaCut =
new TF1(
"fFAlphaCut",
"[0]+[1]*x+[2]/(x*x*x)",0.,100.);
2377 fFAlphaCut =
new TF1(
"fFAlphaCut",
"[0]+[1]*x+[2]/(x*x*x)",0.,100.);
2387 fFAlphaCut =
new TF1(
"fFAlphaCut",
"[0]+[1]*x+[2]/(x*x*x)",0.,100.);
2397 fFAlphaCut =
new TF1(
"fFAlphaCut",
"[0]+[1]*x+[2]/(x*x*x)",0.,100.);
2407 cout<<
"Warning: AlphaMesonCut for merged clusters not defined "<<alphaMesonCut<<endl;
2416 switch(RapidityMesonCut){
2448 cout<<
"Warning: RapidityMesonCut not defined "<<RapidityMesonCut<<endl;
2458 switch(BackgroundScheme){
2478 cout <<
"no BG calculation should be done" << endl;
2597 cout<<
"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
2607 switch(DegreesForRotationMethod){
2621 cout<<
"Warning: DegreesForRotationMethod not defined "<<DegreesForRotationMethod<<endl;
2631 switch(NumberOfBGEvents){
2657 cout<<
"Warning: NumberOfBGEvents not defined "<<NumberOfBGEvents<<endl;
2673 cout<<
"Warning: Shared Electron Cut not defined "<<sharedElec<<endl;
2701 cout<<
"Warning: Shared Electron Cut not defined "<<toClose<<endl;
2711 switch(useMCPSmearing){
2774 AliError(
"Warning: UseMCPSmearing not defined");
2778 switch(useMCPSmearing){
2841 AliError(
"Warning: UseMCPSmearing not defined");
2852 switch(DCAGammaGamma){
2894 cout<<
"Warning: DCAGammaGamma not defined "<<DCAGammaGamma<<endl;
2903 switch(DCAZMesonPrimVtx){
2945 cout<<
"Warning: DCAZMesonPrimVtx not defined "<<DCAZMesonPrimVtx<<endl;
2954 switch(DCARMesonPrimVtx){
2996 cout<<
"Warning: DCARMesonPrimVtx not defined "<<DCARMesonPrimVtx<<endl;
3006 switch(minOpanMesonCut){
3017 fFMinOpanCut =
new TF1(
"fFMinOpanCut",
"[0]*exp(-[1]*x)+[2]",0.,100.);
3098 fFMinOpanCut =
new TF1(
"fFMinOpanCut",
"(exp([0]*(x+1))+[1]*(x-1)+[2]-0.05)*(x<[3])+0.017*(x>[3])",0.,100.);
3128 cout<<
"Warning:minOpanMesonCut not defined "<<minOpanMesonCut<<endl;
3138 switch(maxOpanMesonCut){
3145 fFMaxOpanCut =
new TF1(
"fFMaxOpanCut",
"[0]*exp(-[1]*x)+[2]",0.,100.);
3154 fFMaxOpanCut =
new TF1(
"fFMaxOpanCut",
"[0]*exp(-[1]*x)+[2]",0.,100.);
3163 fFMaxOpanCut =
new TF1(
"fFMaxOpanCut",
"exp([0]*(x-0.5))+[1]*(x-0.5)+[2]+0.15",0.,100.);
3171 cout<<
"Warning: maxOpanMesonCut not defined "<< maxOpanMesonCut<<endl;
3199 for(
Int_t i = 0; i<nV0s*2;i++){
3200 if(i==nV0*2)
continue;
3201 if(i==(nV0*2)+1)
continue;
3216 for(
Int_t i = 0;i<photons->GetEntries();i++){
3217 if(nV0 == i)
continue;
3223 Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
3239 if (photon==NULL)
return;
3250 if( photon->P()!=0){
3251 theta=acos( photon->Pz()/ photon->P());
3260 facPBrem =
fBrem->GetRandom();
3264 photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
3265 photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
3266 photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
3267 photon->SetE(photon->P());
3273 if (photon==NULL)
return;
3284 if( photon->P()!=0){
3285 theta=acos( photon->Pz()/ photon->P());
3294 facPBrem =
fBrem->GetRandom();
3298 photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
3299 photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
3300 photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
3317 if (phi < 0.) phi += 2. * TMath::Pi();
3319 if( particle.P()!=0){
3320 theta=acos( particle.Pz()/ particle.P());
3329 if( fPSigSmearingHalf != 0. || sqrtfPSigSmearingCteHalf!=0. ){
3330 facPSig = TMath::Sqrt(sqrtfPSigSmearingCteHalf*sqrtfPSigSmearingCteHalf+fPSigSmearingHalf*fPSigSmearingHalf*P*P)*
fRandom.Gaus(0.,1.);
3335 facPBrem =
fBrem->GetRandom();
3339 TLorentzVector SmearedParticle;
3341 SmearedParticle.SetXYZM( facPBrem* (1+facPSig)* P*sin(theta)*cos(phi) , facPBrem* (1+facPSig)* P*sin(theta)*sin(phi) ,
3342 facPBrem* (1+facPSig)* P*cos(theta) , TDatabasePDG::Instance()->GetParticle( ::
kElectron )->Mass()) ;
3348 return SmearedParticle;
3356 if (nominalRange == 0){
3361 }
else if (nominalRange == 1){
3366 }
else if (nominalRange == 2){
3371 }
else if (nominalRange == 3){
Bool_t MesonIsSelectedAODMCPiPlPiMiPiZero(AliAODMCParticle *fMCMother, TClonesArray *AODMCArray, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelNeutPion, Double_t fRapidityShift=0)
Bool_t fAcceptMesonMass
flag to distinguish rejecting and accepting meson mass window for further analysis ...
AliCaloPhotonCuts * fCaloPhotonCuts
CaloPhotonCutObject belonging to same main task.
Bool_t SetSelectionWindowMergedCut(Int_t selectionCut)
Int_t fSelectionWindowCut
selection window for merged ana in mass
Double_t fMaxOpanCutMeson
TH1F * fHistoDCARMesonPrimVtxAfter
void FillElectonLabelArray(AliAODConversionPhoton *photon, Int_t nV0)
Bool_t SetBackgroundScheme(Int_t BackgroundScheme)
Bool_t MesonIsSelectedMCPiZeroGamma(TParticle *fMCMother, AliMCEvent *mcEvent, Int_t &labelNeutPion, Int_t &labelGamma, Double_t fRapidityShift=0)
Float_t FunctionMaxMassCut(Float_t e)
Double_t fDCARMesonPrimVtxCut
cut value for the maximum distance in R between the production point of the Meson & the primary verte...
Double_t fSidebandMixingLeftHigh
Double_t fRapidityCutMeson
max value for meson rapidity
Bool_t fBackgroundUseSidebandBothSides
Bool_t SetNumberOfBGEvents(Int_t NumberOfBGEvents)
Int_t fMode
running mode of ConversionMesonCuts to select different sets of cut parameters for different running ...
Bool_t MesonIsSelectedMCChiC(TParticle *fMCMother, AliMCEvent *mcEvent, Int_t &, Int_t &, Int_t &, Double_t fRapidityShift=0.)
Bool_t MesonIsSelectedAODMC(AliAODMCParticle *MCMother, TClonesArray *AODMCArray, Double_t fRapidityShift=0.)
Bool_t RejectSharedElectronV0s(AliAODConversionPhoton *photon, Int_t nV0, Int_t nV0s)
Double_t GetConversionZ() const
void InitCutHistograms(TString name="", Bool_t additionalHists=kFALSE)
Bool_t SetAlphaMesonMergedCut(Int_t alphaMesonCut)
Double_t fSelectionHigh
higher meson inv mass window for further selection
TH1F * fHistoDCAGGMesonBefore
Bool_t MesonIsSelectedMCEtaPiPlPiMiGamma(TParticle *fMCMother, AliMCEvent *mcEvent, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelGamma, Double_t fRapidityShift=0)
Bool_t SetToCloseV0sCut(Int_t toClose)
Bool_t MesonIsSelectedAODMCPiZeroGamma(AliAODMCParticle *fMCMother, TClonesArray *AODMCArray, Int_t &labelNeutPion, Int_t &labelGamma, Double_t fRapidityShift=0)
Double_t fSidebandMixingLow
Bool_t MesonIsSelectedMCDalitz(TParticle *fMCMother, AliMCEvent *mcEvent, Int_t &labelelectron, Int_t &labelpositron, Int_t &labelgamma, Double_t fRapidityShift=0.)
TH1F * fHistoInvMassAfter
Float_t fOpeningAngle
min opening angle for meson
Bool_t fDoBG
flag to intialize BG
Bool_t MesonIsSelectedMCPiPlPiMiPiZero(TParticle *fMCMother, AliMCEvent *mcEvent, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelNeutPion, Double_t fRapidityShift=0)
virtual ~AliConversionMesonCuts()
Bool_t SetSelectionWindowCut(Int_t selectionCut)
TH1F * fHistoDCAZMesonPrimVtxBefore
Bool_t MesonIsSelectedAODMCDalitz(AliAODMCParticle *MCMother, TClonesArray *AODMCArray, Int_t &labelelectron, Int_t &labelpositron, Int_t &labelgamma, Double_t fRapidityShift=0.)
Int_t fNDegreeRotationPMForBG
Bool_t fDoJetAnalysis
switch to run a jet analysis
Float_t GetChi2perNDF() const
Bool_t SetDCAGammaGammaCut(Int_t DCAGammaGamma)
Float_t FunctionMinMassCut(Float_t e)
Bool_t fUseTrackMultiplicityForBG
flag to use track multiplicity for meson bg estimation (else V0 mult)
Bool_t fBackgroundUseLikeSign
Bool_t SetRapidityMesonCut(Int_t RapidityMesonCut)
Bool_t fDoSectorMixing
flag to enable Sectormixing for meson bg estimation
Bool_t SetAlphaMesonCut(Int_t alphaMesonCut)
Double_t fAlphaCutMeson
max value for meson alpha cut
Bool_t MesonIsSelectedAODMCPiPlPiMiEta(AliAODMCParticle *fMCMother, TClonesArray *AODMCArray, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelNeutPion, Double_t fRapidityShift=0)
Int_t GetTrackLabelNegative() const
Bool_t MesonIsSelectedMCPiPlPiMiEta(TParticle *fMCMother, AliMCEvent *mcEvent, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelNeutPion, Double_t fRapidityShift=0)
void SmearParticle(AliAODConversionPhoton *photon)
Int_t GetTrackLabelPositive() const
Bool_t RejectToCloseV0s(AliAODConversionPhoton *photon, TList *photons, Int_t nV0)
TH2F * fHistoMesonCuts
bookkeeping for meson cuts
Bool_t fUsePtmaxMethodForBG
flag to apply Ptmax method
TObjString * fCutString
cut number used for analysis
Double_t fSidebandMixingHigh
Double_t fMinPt
min pT cut
Double_t fSidebandMixingRightHigh
void SmearVirtualPhoton(AliAODConversionPhoton *photon)
Bool_t fEnableMinOpeningAngleCut
flag to enable min opening angle cut
Int_t fIsMergedClusterCut
flag for merged cluster and di cluster analysis
Bool_t fDoMinPtCut
do min pT cut
Double_t fSidebandMixingRightLow
Double_t GetOpeningAngle() const
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Bool_t MesonIsSelectedPiZeroGammaAngle(AliAODConversionMother *omega, AliAODConversionMother *pi0, AliAODConversionPhoton *gamma, Bool_t DoPiZeroAngleCut, TF1 *maxfit, Double_t lowerFactor, Double_t upperFactor)
Int_t fElectronLabelArraySize
Double_t GetConversionY() const
Float_t GetDCABetweenPhotons() const
Bool_t fEnableMassCut
flag to enable mass cut
Bool_t fUseMCPSmearing
flag
Bool_t MesonIsSelectedMC(TParticle *fMCMother, AliMCEvent *mcEvent, Double_t fRapidityShift=0.)
Bool_t fDoLightOutput
switch for running light output, kFALSE -> normal mode, kTRUE -> light mode
Float_t GetDCARMotherPrimVtx() const
static const char * fgkCutNames[kNCuts]
Bool_t fEnableOneCellDistCut
flag to enable 1 cell dist cut
Bool_t SetDCAZMesonPrimVtxCut(Int_t DCAZMesonPrimVtx)
AliConversionMesonCuts(const char *name="MesonCuts", const char *title="Meson Cuts")
void PrintCutsWithValues()
Class handling all kinds of selection cuts for Gamma Conversion analysis.
Bool_t MesonIsSelected(AliAODConversionMother *pi0, Bool_t IsSignal=kTRUE, Double_t fRapidityShift=0., Int_t leadingCellID1=0, Int_t leadingCellID2=0)
Double_t fMinOpanCutMeson
TH2F * fHistoMesonBGCuts
bookkeeping for meson bg cuts
TH1F * fHistoInvMassBefore
Bool_t MesonIsSelectedAODMCChiC(AliAODMCParticle *fMCMother, TClonesArray *AODMCArray, Int_t &, Int_t &, Int_t &, Double_t fRapidityShift=0.)
Bool_t fBackgroundUseSideband
Double_t GetAlpha() const
Int_t * fElectronLabelArray
Bool_t SetMaxOpanMesonCut(Int_t maxOpanMesonCut)
Double_t fSelectionLow
lower meson inv mass window for further selection
Bool_t fDoJetQA
switch to run a jet QA analysis
Bool_t fDCARMesonPrimVtxCutOn
cut flag for the maximum distance in R between the production point of the Meson & the primary vertex...
Bool_t fDoSectorJetMixing
flag to enable Sectormixing with jets for meson bg estimation
Bool_t SetSharedElectronCut(Int_t sharedElec)
TH2F * fHistoDCAZMesonPrimVtxAfter
TH1F * fHistoDCARMesonPrimVtxBefore
Bool_t SetMinPtCut(Int_t PtCut)
Bool_t fDCAZMesonPrimVtxCutOn
cut flag for the maximum distance in Z between the production point of the Meson & the primary vertex...
Bool_t SetNDegreesForRotationMethod(Int_t DegreesForRotationMethod)
TH1F * fHistoDCAGGMesonAfter
Bool_t fDoBGProbability
flag to use probability method for meson bg estimation
Bool_t SetMinOpanMesonCut(Int_t minOpanMesonCut)
Float_t GetDCAZMotherPrimVtx() const
Double_t fPSigSmearingCte
Bool_t MesonIsSelectedAODMCEtaPiPlPiMiGamma(AliAODMCParticle *fMCMother, TClonesArray *AODMCArray, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelGamma, Double_t fRapidityShift=0)
Bool_t MesonIsSelectedByMassCut(AliAODConversionMother *meson, Int_t nominalRange)
Bool_t fUseRotationMethodInBG
flag to apply rotation method for meson bg estimation
Double_t fAlphaMinCutMeson
min value for meson alpha cut
TLorentzVector SmearElectron(TLorentzVector particle)
TList * fHistograms
List of QA histograms.
Bool_t AreNeighbours(Int_t absCellId1, Int_t absCellId2)
Bool_t SetMesonKind(Int_t mesonKind)
Double_t fDCAGammaGammaCut
cut value for the maximum distance between the two photons [cm]
Bool_t fDCAGammaGammaCutOn
cut flag for the maximum distance between the two photons
Bool_t fDoConvCaloMixing
flag to use enable convcalo mixing in addition to caloconv mixing
Bool_t InitializeCutsFromCutString(const TString analysisCutSelection)
Double_t GetConversionX() const
Bool_t SetDCARMesonPrimVtxCut(Int_t DCARMesonPrimVtx)
Double_t fSidebandMixingLeftLow
Bool_t SetMCPSmearing(Int_t useMCPSmearing)
Bool_t SetCut(cutIds cutID, Int_t cut)
Bool_t fDoSphericityMixing
flag to enable Sphericitymixing for meson bg estimation
Double_t fDCAZMesonPrimVtxCut
cut value for the maximum distance in Z between the production point of the Meson & the primary verte...