From b72a171621272973d96c1a946c5e3191fb61779f Mon Sep 17 00:00:00 2001 From: morsch Date: Tue, 8 Nov 2005 14:05:04 +0000 Subject: [PATCH] Adding cut on invariant mass values in the pre-triiger decision of the AliMUONCocktail (Raphael Tieulent) --- EVGEN/AliGenMUONCocktail.cxx | 122 +++++++++++++++++++++++------------ EVGEN/AliGenMUONCocktail.h | 9 ++- 2 files changed, 87 insertions(+), 44 deletions(-) diff --git a/EVGEN/AliGenMUONCocktail.cxx b/EVGEN/AliGenMUONCocktail.cxx index e31db39ca3b..badde6d5776 100644 --- a/EVGEN/AliGenMUONCocktail.cxx +++ b/EVGEN/AliGenMUONCocktail.cxx @@ -64,6 +64,9 @@ AliGenMUONCocktail::AliGenMUONCocktail() fNumberOfCollisions = 0.; fNumberOfParticipants = 0.; fHadronicMuons = kTRUE; + fInvMassCut = kFALSE; + fInvMassMinCut = 0.; + fInvMassMaxCut = 100.; } //_________________________________________________________________________ AliGenMUONCocktail::AliGenMUONCocktail(const AliGenMUONCocktail & cocktail): @@ -84,6 +87,9 @@ AliGenMUONCocktail::AliGenMUONCocktail(const AliGenMUONCocktail & cocktail): fNumberOfCollisions = 0.; fNumberOfParticipants = 0.; fHadronicMuons = kTRUE; + fInvMassCut = kFALSE; + fInvMassMinCut = 0.; + fInvMassMaxCut = 100.; } //_________________________________________________________________________ AliGenMUONCocktail::~AliGenMUONCocktail() @@ -390,51 +396,81 @@ void AliGenMUONCocktail::Generate() // Loop on primordialTrigger Bool_t primordialTrigger = kFALSE; while(!primordialTrigger) { - //Reseting stack - AliRunLoader * runloader = gAlice->GetRunLoader(); - if (runloader) - if (runloader->Stack()) - runloader->Stack()->Reset(); - // Loop over generators and generate events - Int_t igen=0; - Int_t npart =0; - while((entry = (AliGenCocktailEntry*)next())) { - gen = entry->Generator(); - gen->SetVertex(fVertex.At(0), fVertex.At(1), fVertex.At(2)); - if ( (npart = gRandom->Poisson(entry->Rate())) >0 ) { - igen++; - if (igen ==1) entry->SetFirst(0); - else entry->SetFirst((partArray->GetEntriesFast())+1); - // if ( (fHadronicMuons == kFALSE) && ( (gen->GetName() == "Pions") || (gen->GetName() == "Kaons") ) ) - // { AliInfo(Form("This generator %s is finally not generated. This is option for hadronic muons.",gen->GetName() ) ); } - // else { - gen->SetNumberParticles(npart); - gen->Generate(); - entry->SetLast(partArray->GetEntriesFast()); - preventry = entry; - // } - } - } - next.Reset(); - // Tesitng primordial trigger : Muon pair in the MUON spectrometer acceptance and pTCut - Int_t iPart; - fNGenerated++; - Int_t numberOfMuons=0; - // printf(">>>fNGenerated is %d\n",fNGenerated); - for(iPart=0; iPartGetEntriesFast(); iPart++){ - if ( (TMath::Abs(gAlice->GetMCApp()->Particle(iPart)->GetPdgCode())==13) && - (gAlice->GetMCApp()->Particle(iPart)->Theta()*180./TMath::Pi()>fMuonThetaMinCut) && - (gAlice->GetMCApp()->Particle(iPart)->Theta()*180./TMath::Pi()GetMCApp()->Particle(iPart)->Pt()>fMuonPtCut) ) { - gAlice->GetMCApp()->Particle(iPart)->SetProductionVertex(fVertex.At(0), fVertex.At(1), fVertex.At(2), 0.); - numberOfMuons++; + //Reseting stack + AliRunLoader * runloader = gAlice->GetRunLoader(); + if (runloader) + if (runloader->Stack()) + runloader->Stack()->Reset(); + // Loop over generators and generate events + Int_t igen=0; + Int_t npart =0; + while((entry = (AliGenCocktailEntry*)next())) { + gen = entry->Generator(); + gen->SetVertex(fVertex.At(0), fVertex.At(1), fVertex.At(2)); + if ( (npart = gRandom->Poisson(entry->Rate())) >0 ) { + igen++; + if (igen == 1) entry->SetFirst(0); + else entry->SetFirst((partArray->GetEntriesFast())+1); + // if ( (fHadronicMuons == kFALSE) && ( (gen->GetName() == "Pions") || (gen->GetName() == "Kaons") ) ) + // { AliInfo(Form("This generator %s is finally not generated. This is option for hadronic muons.",gen->GetName() ) ); } + // else { + gen->SetNumberParticles(npart); + gen->Generate(); + entry->SetLast(partArray->GetEntriesFast()); + preventry = entry; + // } + } + } + next.Reset(); + // Testing primordial trigger : Muon pair in the MUON spectrometer acceptance and pTCut + Int_t iPart; + fNGenerated++; + Int_t numberOfMuons=0; + // printf(">>>fNGenerated is %d\n",fNGenerated); + + TObjArray GoodMuons; // Used in the Invariant Mass selection cut + + for(iPart=0; iPartGetEntriesFast(); iPart++){ + + if ( (TMath::Abs(gAlice->GetMCApp()->Particle(iPart)->GetPdgCode())==13) && + (gAlice->GetMCApp()->Particle(iPart)->Theta()*180./TMath::Pi()>fMuonThetaMinCut) && + (gAlice->GetMCApp()->Particle(iPart)->Theta()*180./TMath::Pi()GetMCApp()->Particle(iPart)->Pt()>fMuonPtCut) ) { + gAlice->GetMCApp()->Particle(iPart)->SetProductionVertex(fVertex.At(0), fVertex.At(1), fVertex.At(2), 0.); + GoodMuons.AddLast(gAlice->GetMCApp()->Particle(iPart)); + numberOfMuons++; + } + } + + // Test the invariant mass of each pair (if cut on Invariant mass is required) + Bool_t InvMassRangeOK = kTRUE; + if(fInvMassCut && (numberOfMuons>=2) ){ + TLorentzVector fV1, fV2, fVtot; + InvMassRangeOK = kFALSE; + for(iPart=0; iPartPx() ,mu1->Py() ,mu1->Pz() ,mu1->Energy() ); + fV2.SetPxPyPzE(mu2->Px() ,mu2->Py() ,mu2->Pz() ,mu2->Energy() ); + fVtot = fV1 + fV2; + + if(fVtot.M()>fInvMassMinCut && fVtot.M()= fMuonMultiplicity) && InvMassRangeOK ) primordialTrigger = kTRUE; } - } - // printf(">>> Number of Muons is %d \n", numberOfMuons); - if (numberOfMuons >= fMuonMultiplicity ) primordialTrigger = kTRUE; - } fNSucceded++; - + AliDebug(5,Form("Generated Events are %d and Succeeded Events are %d",fNGenerated,fNSucceded)); } diff --git a/EVGEN/AliGenMUONCocktail.h b/EVGEN/AliGenMUONCocktail.h index 695fc063de4..b1301924cc2 100644 --- a/EVGEN/AliGenMUONCocktail.h +++ b/EVGEN/AliGenMUONCocktail.h @@ -52,6 +52,10 @@ class AliGenMUONCocktail : public AliGenCocktail { fMuonThetaMinCut=ThetaMin; fMuonThetaMaxCut=ThetaMax; } void SetHadronicMuons(Bool_t HadronicMuons) { fHadronicMuons = HadronicMuons;} + void SetInvMassRange(Float_t MassMin, Float_t MassMax) + { fInvMassMinCut=MassMin; + fInvMassMaxCut=MassMax; + fInvMassCut = kTRUE; } protected: @@ -70,7 +74,10 @@ class AliGenMUONCocktail : public AliGenCocktail Float_t fAverageImpactParameter;// AVergae Impact parameter in the impact parameter range Float_t fNumberOfCollisions; // Average number of collisions in the impact parameter range Float_t fNumberOfParticipants; // Average number of participants in the impact parameter range - Bool_t fHadronicMuons; // If kTrue hadronic muons are included in the cocktail. Default is true. + Bool_t fHadronicMuons; // If kTRUE hadronic muons are included in the cocktail. Default is true. + Bool_t fInvMassCut; // If kTRUE cut on the Invariant mass is required. Default is false + Float_t fInvMassMinCut; // Minimum invariant mass cut + Float_t fInvMassMaxCut; // Maximum invariant mass cut ClassDef(AliGenMUONCocktail,1) // MUON cocktail for physics in the Alice muon spectrometer }; -- 2.39.3