X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PWGGA%2FGammaConv%2FAliConversionCuts.cxx;h=5cc1d0a000a0941c5692f75d83b2a3ab74febcf6;hb=c92c97b507cbfa42a47db1565331a8de8fbd2e27;hp=81c17c3d9184ecf5f10d0dc0962d4173c67c1566;hpb=ca8bef15e01bc05a440614cd77a6795d1bbd98b4;p=u%2Fmrichter%2FAliRoot.git diff --git a/PWGGA/GammaConv/AliConversionCuts.cxx b/PWGGA/GammaConv/AliConversionCuts.cxx index 81c17c3d918..5cc1d0a000a 100644 --- a/PWGGA/GammaConv/AliConversionCuts.cxx +++ b/PWGGA/GammaConv/AliConversionCuts.cxx @@ -229,6 +229,7 @@ AliConversionCuts::AliConversionCuts(const char *name,const char *title) : fFitDataPi0(NULL), fFitDataEta(NULL), fFitDataK0s(NULL), + fAddedSignalPDGCode(0), fPreSelCut(kFALSE), fTriggerSelectedManually(kFALSE), fSpecialTriggerName("") @@ -385,6 +386,7 @@ AliConversionCuts::AliConversionCuts(const AliConversionCuts &ref) : fFitDataPi0(ref.fFitDataPi0), fFitDataEta(ref.fFitDataEta), fFitDataK0s(ref.fFitDataK0s), + fAddedSignalPDGCode(ref.fAddedSignalPDGCode), fPreSelCut(ref.fPreSelCut), fTriggerSelectedManually(ref.fTriggerSelectedManually), fSpecialTriggerName(ref.fSpecialTriggerName) @@ -3448,7 +3450,10 @@ Bool_t AliConversionCuts::IsTriggerSelected(AliVEvent *fInputEvent) else { if (fIsHeavyIon == 1) fOfflineTriggerMask = AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral; else if (fIsHeavyIon == 2) fOfflineTriggerMask = AliVEvent::kINT7; - else if (periodName.CompareTo("LHC11c") == 0 || periodName.CompareTo("LHC11d") == 0 || periodName.CompareTo("LHC11e") == 0 || periodName.CompareTo("LHC11f") == 0 || periodName.CompareTo("LHC11g") == 0 || periodName.CompareTo("LHC12a") == 0 || periodName.CompareTo("LHC12b") == 0 || periodName.CompareTo("LHC12c") == 0 || periodName.CompareTo("LHC12d") == 0 || periodName.CompareTo("LHC11f") == 0 || periodName.CompareTo("LHC13g") == 0 ) fOfflineTriggerMask = AliVEvent::kINT7; + else if (periodName.CompareTo("LHC11c") == 0 || periodName.CompareTo("LHC11d") == 0 || periodName.CompareTo("LHC11e") == 0 || periodName.CompareTo("LHC11f") == 0 || periodName.CompareTo("LHC11g") == 0 || periodName.CompareTo("LHC12a") == 0 || periodName.CompareTo("LHC12b") == 0 || periodName.CompareTo("LHC12c") == 0 || periodName.CompareTo("LHC12d") == 0 || periodName.CompareTo("LHC12f") == 0 || periodName.CompareTo("LHC13g") == 0 ) { + fOfflineTriggerMask = AliVEvent::kINT7; +// cout << "will take kINT7 as trigger mask" << endl; + } else fOfflineTriggerMask = AliVEvent::kMB; } } @@ -3768,53 +3773,57 @@ void AliConversionCuts::GetNotRejectedParticles(Int_t rejection, TList *HeaderLi lastindexA = lastindexA + gh->NProduced(); // cout << i << "\t" << GeneratorName.Data() << endl; for(Int_t j = 0; jGetEntries();j++){ - TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString(); - if(GeneratorName.CompareTo(GeneratorInList) == 0){ - if (GeneratorInList.CompareTo("PARAM") == 0 || GeneratorInList.CompareTo("BOX") == 0 ){ - if(fMCStack){ - if (fMCStack->Particle(firstindexA)->GetPdgCode() == 111 || fMCStack->Particle(firstindexA)->GetPdgCode() == 221 ) { -<<<<<<< HEAD - if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1c")==0 ){ -======= - if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1b")==0 ){ ->>>>>>> 014acd7... - changes for the reweighting part - if (gh->NProduced() > 10 && (fMCStack->Particle(firstindexA+10)->GetPdgCode() == 111 || fMCStack->Particle(firstindexA+10)->GetPdgCode() == 221 )){ + TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString(); + if(GeneratorName.CompareTo(GeneratorInList) == 0){ + if (GeneratorInList.CompareTo("PARAM") == 0 || GeneratorInList.CompareTo("BOX") == 0 ){ + if(fMCStack){ + if (fMCStack->Particle(firstindexA)->GetPdgCode() == fAddedSignalPDGCode ) { + if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1c")==0 ){ + if (gh->NProduced() > 10 && fMCStack->Particle(firstindexA+10)->GetPdgCode() == fAddedSignalPDGCode ){ +// cout << "cond 1: "<< fnHeaders << endl; + fnHeaders++; + continue; + } + continue; + } else { +// cout << "cond 2: " << fnHeaders << endl; fnHeaders++; continue; } - } else { - fnHeaders++; - continue; - } - } - } - if ( fMCStackAOD){ - AliAODMCParticle *aodMCParticle = static_cast(fMCStackAOD->At(firstindexA)); - if ( aodMCParticle->GetPdgCode() == 111 || aodMCParticle->GetPdgCode() == 221 ){ -<<<<<<< HEAD - if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1c")==0 ){ -======= - if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1b")==0 ){ ->>>>>>> 014acd7... - changes for the reweighting part - if (gh->NProduced() > 10 && (fMCStack->Particle(firstindexA+10)->GetPdgCode() == 111 || fMCStack->Particle(firstindexA+10)->GetPdgCode() == 221 )){ + } + } + if ( fMCStackAOD){ + AliAODMCParticle *aodMCParticle = static_cast(fMCStackAOD->At(firstindexA)); + if ( aodMCParticle->GetPdgCode() == fAddedSignalPDGCode ){ + if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1c")==0 ){ + if (gh->NProduced() > 10){ + AliAODMCParticle *aodMCParticle2 = static_cast(fMCStackAOD->At(firstindexA+10)); + if ( aodMCParticle2->GetPdgCode() == fAddedSignalPDGCode ){ +// cout << "cond 1: " << fnHeaders << endl; + fnHeaders++; + continue; + } + } + continue; + } else { +// cout << "cond 2: " << fnHeaders << endl; fnHeaders++; continue; } - } else { - fnHeaders++; - continue; - } - } + } + } + continue; } +// cout << "cond 3: "<< fnHeaders << endl; + fnHeaders++; + continue; } - fnHeaders++; - continue; - } } firstindexA = firstindexA + gh->NProduced(); } } - +// cout << "number of headers: " <GetEntries();i++){ gh = (AliGenEventHeader*)genHeaders->At(i); TString GeneratorName = gh->GetName(); lastindex = lastindex + gh->NProduced(); for(Int_t j = 0; jGetEntries();j++){ TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString(); +// cout << i << "\t" << GeneratorName.Data() << endl; if(GeneratorName.CompareTo(GeneratorInList) == 0){ if (GeneratorInList.CompareTo("PARAM") == 0 || GeneratorInList.CompareTo("BOX") == 0 ){ if(fMCStack){ - if (fMCStack->Particle(firstindex)->GetPdgCode() == 111 || fMCStack->Particle(firstindex)->GetPdgCode() == 221 ) { -<<<<<<< HEAD + if (fMCStack->Particle(firstindex)->GetPdgCode() == fAddedSignalPDGCode ) { if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1c")==0 ){ -======= - if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1b")==0 ){ ->>>>>>> 014acd7... - changes for the reweighting part - if (gh->NProduced() > 10 && (fMCStack->Particle(firstindexA+10)->GetPdgCode() == 111 || fMCStack->Particle(firstindexA+10)->GetPdgCode() == 221 )){ +// cout << "produced " << gh->NProduced() << " with box generator" << endl; + if (gh->NProduced() > 10 && fMCStack->Particle(firstindex+10)->GetPdgCode() == fAddedSignalPDGCode){ +// cout << "one of them was a pi0 or eta" << endl; fNotRejectedStart[number] = firstindex; fNotRejectedEnd[number] = lastindex; fGeneratorNames[number] = GeneratorName; number++; +// cout << "Number of particles produced for: " << i << "\t" << GeneratorName.Data() << "\t" << lastindex-firstindex+1 << endl; continue; } } else { @@ -3862,19 +3872,18 @@ void AliConversionCuts::GetNotRejectedParticles(Int_t rejection, TList *HeaderLi } if ( fMCStackAOD){ AliAODMCParticle *aodMCParticle = static_cast(fMCStackAOD->At(firstindex)); - if ( aodMCParticle->GetPdgCode() == 111 || aodMCParticle->GetPdgCode() == 221 ){ -<<<<<<< HEAD + if ( aodMCParticle->GetPdgCode() == fAddedSignalPDGCode ){ if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1c")==0 ){ -======= - if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1b")==0 ){ ->>>>>>> 014acd7... - changes for the reweighting part - if (gh->NProduced() > 10 && (fMCStack->Particle(firstindexA+10)->GetPdgCode() == 111 || fMCStack->Particle(firstindexA+10)->GetPdgCode() == 221 )){ - fNotRejectedStart[number] = firstindex; - fNotRejectedEnd[number] = lastindex; - fGeneratorNames[number] = GeneratorName; - number++; - continue; + if (gh->NProduced() > 10) { + AliAODMCParticle *aodMCParticle2 = static_cast(fMCStackAOD->At(firstindex+10)); + if ( aodMCParticle2->GetPdgCode() == fAddedSignalPDGCode ){ + fNotRejectedEnd[number] = lastindex; + fNotRejectedStart[number] = firstindex; + fGeneratorNames[number] = GeneratorName; + number++; } + continue; + } } else { fNotRejectedStart[number] = firstindex; fNotRejectedEnd[number] = lastindex; @@ -3884,19 +3893,24 @@ void AliConversionCuts::GetNotRejectedParticles(Int_t rejection, TList *HeaderLi } } } - + continue; } else { fNotRejectedStart[number] = firstindex; fNotRejectedEnd[number] = lastindex; fGeneratorNames[number] = GeneratorName; - // cout << "Number of particles produced for: " << i << "\t" << GeneratorName.Data() << "\t" << lastindex-firstindex+1 << endl; +// cout << "Number of particles produced for: " << i << "\t" << GeneratorName.Data() << "\t" << lastindex-firstindex+1 << endl; number++; continue; } + } } firstindex = firstindex + gh->NProduced(); } +// for (Int_t i = 0; i < number; i++){ +// cout << i << "\t" <IsA()==AliESDEvent::Class()){ - if( index >= MCStack->GetNprimary()){ // Secondary Particle - if( ((TParticle*)MCStack->Particle(index))->GetMother(0) < 0) return 1; // Secondary Particle without Mother?? - return IsParticleFromBGEvent(((TParticle*)MCStack->Particle(index))->GetMother(0),MCStack,InputEvent); - } - for(Int_t i = 0;i= fNotRejectedStart[i] && index <= fNotRejectedEnd[i]){ - accepted = 1; - if(i == 0) accepted = 2; // MB Header - } - } - } - else if(InputEvent->IsA()==AliAODEvent::Class()){ - TClonesArray *AODMCTrackArray = dynamic_cast(InputEvent->FindListObject(AliAODMCParticle::StdBranchName())); - AliAODMCParticle *aodMCParticle = static_cast(AODMCTrackArray->At(index)); - if(!aodMCParticle) return 1; // Photon Without a Mother ? --> Accepted - if(!aodMCParticle->IsPrimary()){ - if( aodMCParticle->GetMother() < 0) return 1;// Secondary Particle without Mother?? - return IsParticleFromBGEvent(aodMCParticle->GetMother(),MCStack,InputEvent); - } - index = abs(static_cast(AODMCTrackArray->At(index))->GetLabel()); - for(Int_t i = 0;i= fNotRejectedStart[i] && index <= fNotRejectedEnd[i]){ - accepted = 1; - if(i == 0) accepted = 2; // MB Header - } - } - } + // Not Accepted == kFALSE == 0 + // Accepted == kTRUE == 1 + // FirstHeader == kTRUE == 3 + if(index < 0) return 0; // No Particle + +// if (index == 100){ +// cout << "possible headers" << endl; +// for(Int_t i = 0;iIsA()==AliESDEvent::Class()){ + if( index >= MCStack->GetNprimary()){ // Secondary Particle + if( ((TParticle*)MCStack->Particle(index))->GetMother(0) < 0) return 1; // Secondary Particle without Mother?? + return IsParticleFromBGEvent(((TParticle*)MCStack->Particle(index))->GetMother(0),MCStack,InputEvent); + } + for(Int_t i = 0;i= fNotRejectedStart[i] && index <= fNotRejectedEnd[i]){ + accepted = 1; + if(i == 0) accepted = 2; // MB Header + } + } + } + else if(InputEvent->IsA()==AliAODEvent::Class()){ + TClonesArray *AODMCTrackArray = dynamic_cast(InputEvent->FindListObject(AliAODMCParticle::StdBranchName())); + AliAODMCParticle *aodMCParticle = static_cast(AODMCTrackArray->At(index)); + if(!aodMCParticle) return 1; // Photon Without a Mother ? --> Accepted + if(!aodMCParticle->IsPrimary()){ + if( aodMCParticle->GetMother() < 0) return 1;// Secondary Particle without Mother?? + return IsParticleFromBGEvent(aodMCParticle->GetMother(),MCStack,InputEvent); + } + index = abs(static_cast(AODMCTrackArray->At(index))->GetLabel()); + for(Int_t i = 0;i= fNotRejectedStart[i] && index <= fNotRejectedEnd[i]){ + accepted = 1; + if(i == 0) accepted = 2; // MB Header + } + } + } - return accepted; + return accepted; } //_________________________________________________________________________