/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ #include #include #include #include #include #include #include #include #include "AliJetHeader.h" #include "AliJetReader.h" #include "AliJetReaderHeader.h" #include "AliFastJetFinder.h" #include "AliFastJetHeaderV1.h" #include "AliJetReaderHeader.h" #include "AliJetReader.h" #include "AliJetUnitArray.h" #include "AliFastJetInput.h" #include "AliESDEvent.h" #include "fastjet/PseudoJet.hh" #include "fastjet/ClusterSequenceArea.hh" #include "fastjet/AreaDefinition.hh" #include "fastjet/JetDefinition.hh" // get info on how fastjet was configured #include "fastjet/config.h" #ifdef ENABLE_PLUGIN_SISCONE #include "fastjet/SISConePlugin.hh" #endif #include // needed for internal io #include #include using namespace std; #include "AliJetBkg.h" ClassImp(AliJetBkg) //////////////////////////////////////////////////////////////////////// AliJetBkg::AliJetBkg(): TObject(), fReader(0), fHeader(0), fInputFJ(0) { // Default constructor } //______________________________________________________________________ AliJetBkg::AliJetBkg(const AliJetBkg& input): TObject(input), fReader(input.fReader), fHeader(input.fHeader), fInputFJ(input.fInputFJ) { // copy constructor } //______________________________________________________________________ AliJetBkg& AliJetBkg::operator=(const AliJetBkg& source){ // Assignment operator. this->~AliJetBkg(); new(this) AliJetBkg(source); return *this; } //___________________________________________________________________ Float_t AliJetBkg::BkgFastJet(){ AliFastJetHeaderV1 *header = (AliFastJetHeaderV1*)fHeader; Bool_t debug = header->GetDebug(); // debug option if(debug)cout<<"=============== AliJetBkg::BkgFastJet() =========== "< inputParticles=fInputFJ->GetInputParticles(); if(debug)cout<<"printing inputParticles for BKG "<GetRparamBkg(); //Radius for background calculation Double_t rho=CalcRho(inputParticles,rParamBkg,"All"); if(debug)cout<<"-------- rho (from all part)="<GetDebug(); // debug option if(debug)cout<<"=============== AliJetBkg::BkgChargedFastJet() =========== "< inputParticlesCharged=fInputFJ->GetInputParticlesCh(); if(debug)cout<<"printing CHARGED inputParticles for BKG "<GetRparam(); Double_t rho=CalcRho(inputParticlesCharged,rParam,"Charg"); cout<<"-------- rho (from CHARGED part)="<GetDebug(); // debug option if(debug)cout<<"==============AliJetBkg::BkgStat()============="<GetESD()->GetNumberOfTracks(); Int_t nTracks= 0; TF1 fun("fun",BkgFunction,0,800,1); Double_t enTot=fun.Eval(nTracks); Double_t accEMCal=2*0.7*110./180*TMath::Pi();//2.68 area of EMCal return enTot/accEMCal; } //////////////////////////////////////////////////////////////////////// Float_t AliJetBkg::BkgFastJetCone(TClonesArray* fAODJets) { // Cone background subtraction method applied on the fastjet: REmove the particles of the // two largest jets with the given R from the estimation of new rho. AliFastJetHeaderV1 *header = (AliFastJetHeaderV1*)fHeader; Bool_t debug = header->GetDebug(); // debug option if(debug)cout<<"==============AliJetBkg::SubtractFastJetBackgCone()============="<GetRparam(); //Hard wired Calorimeter area (get it later from the AliJetReaderHeader.h) Double_t accEMCal=2*0.7*110./180*TMath::Pi();//2.68 area of EMCal Int_t nJ=fAODJets->GetEntries(); //this must be the # of jets... if(debug)cout<<"nJets: "<GetUnitArray(); if(fUnit == 0) { cout << "Could not get the momentum array" << endl; return -99; } Int_t nIn = fUnit->GetEntries(); if(nIn == 0) { cout << "entries = 0 ; Event empty !!!" << endl ; return -99; } // Information extracted from fUnitArray // load input vectors and calculate total energy in array Float_t pt,eta,phi; Float_t jeteta = 0,jetphi = 0,jeteta1 = 0, jetphi1 = 0; Float_t rhoback=0.0; Float_t ptallback=0.0; //particles without the jet Float_t restarea=accEMCal; //initial area set Bool_t acc=0; Bool_t acc1=0; Float_t rCone=0.4; if(nJ==1) { AliAODJet *jettmp = dynamic_cast(fAODJets->At(0)); jeteta=jettmp->Eta(); jetphi=jettmp->Phi(); acc=EmcalAcceptance(jeteta,jetphi,rCone); if(acc==1)restarea= accEMCal-TMath::Pi()*rc*rc; if(debug)cout<<" acc "<=2) { AliAODJet *jettmp = dynamic_cast(fAODJets->At(0)); AliAODJet *jettmp1 = dynamic_cast(fAODJets->At(1)); jeteta=jettmp->Eta(); jetphi=jettmp->Phi(); jeteta1=jettmp1->Eta(); jetphi1=jettmp1->Phi(); acc=EmcalAcceptance(jeteta,jetphi,rCone); acc1=EmcalAcceptance(jeteta1,jetphi1,rCone); if(acc1==1 && acc==1)restarea= accEMCal-2*TMath::Pi()*rc*rc; if(acc1==1 && acc==0)restarea= accEMCal-TMath::Pi()*rc*rc; if(acc1==0 && acc==1)restarea= accEMCal-TMath::Pi()*rc*rc; if(debug)cout<<" acc1="< inputParticles,Double_t rParamBkg,TString method){ //calculate rho using the fastjet method AliFastJetHeaderV1 *header = (AliFastJetHeaderV1*)fHeader; Bool_t debug = header->GetDebug(); // debug option fastjet::Strategy strategy = header->GetStrategy(); fastjet::RecombinationScheme recombScheme = header->GetRecombScheme(); fastjet::JetAlgorithm algorithm = header->GetAlgorithm(); fastjet::JetDefinition jetDef(algorithm, rParamBkg, recombScheme, strategy); // create an object that specifies how we to define the area fastjet::AreaDefinition areaDef; double ghostEtamax = header->GetGhostEtaMax(); double ghostArea = header->GetGhostArea(); int activeAreaRepeats = header->GetActiveAreaRepeats(); // now create the object that holds info about ghosts if (method.Contains("Charg"))ghostEtamax=0.9; fastjet::GhostedAreaSpec ghost_spec(ghostEtamax, activeAreaRepeats, ghostArea); // and from that get an area definition fastjet::AreaType areaType = header->GetAreaType(); areaDef = fastjet::AreaDefinition(areaType,ghost_spec); if(debug)cout<<"rParamBkg="<SetComment(comment); if(debug){ cout << "--------------------------------------------------------" << endl; cout << comment << endl; cout << "--------------------------------------------------------" << endl; } double ptmin = header->GetPtMin(); vector inclusiveJets = clust_seq.inclusive_jets(ptmin); vector jets = sorted_by_pt(inclusiveJets); if (debug) { cout<<"# of BKG jets = "<