Double_t dMultiplicityBin = 0.;
if(fMultiplicityIs==AliFlowCommonConstants::kRP)
{
- dMultiplicityBin = fNumberOfRPsEBE+0.5;
+ //Printf("RP multiplicity: %lf",fNumberOfRPsEBE);
+ dMultiplicityBin = fNumberOfRPsEBE+0.5;
} else if(fMultiplicityIs==AliFlowCommonConstants::kExternal)
{
+ //Printf("Reference multiplicity: %lf",fReferenceMultiplicityEBE);
dMultiplicityBin = fReferenceMultiplicityEBE+0.5;
} else if(fMultiplicityIs==AliFlowCommonConstants::kPOI)
{
dMultiplicityBin = fNumberOfRPsEBE+0.5;
} else if(fMultiplicityIs==AliFlowCommonConstants::kExternal)
{
- dMultiplicityBin = fReferenceMultiplicityEBE+0.5;
+ dMultiplicityBin = fReferenceMultiplicityEBE+0.5;
} else if(fMultiplicityIs==AliFlowCommonConstants::kPOI)
{
dMultiplicityBin = fNumberOfPOIsEBE+0.5;
#include "Riostream.h"
#include "TMath.h"
#include "TF1.h"
+#include "TH3.h"
#include "TRandom3.h"
#include "AliFlowEventSimpleMakerOnTheFly.h"
#include "AliFlowEventSimple.h"
fPhiMin2(0.),
fPhiMax2(0.),
fProbability2(0.),
-fPi(TMath::Pi())
+fPi(TMath::Pi()),
+fSimulateDetectorEffects(kFALSE),
+fNumberOfInefficientSectors(0),
+fInefficiencyFactorInPhi(1.0),
+fNumberOfDeadSectors(0),
+fEfficiencyDropNearEtaEdges(kFALSE),
+fEfficiencyMatrix(0)
{
// Constructor.
fPhiDistribution->SetParName(6,"Hexagonal Flow (v6)");
fPhiDistribution->SetParameter(6,fV6);
+ //==============Efficiency matrix==============//
+ if(fSimulateDetectorEffects) SetupEfficiencyMatrix();
+ //==============Efficiency matrix==============//
+
} // end of void AliFlowEventSimpleMakerOnTheFly::Init()
+//________________________________________________________________________
+void AliFlowEventSimpleMakerOnTheFly::SetupEfficiencyMatrix() {
+ //Setup the efficiency matrix
+ TH1F *hPt = new TH1F("hPt","",200,0.1,20.1);
+ TH1F *hEta = new TH1F("hEta","",20,-0.95,0.95);
+ TH1F *hPhi = new TH1F("hPhi","",72,0.,2.*TMath::Pi());
+ fEfficiencyMatrix = new TH3F("fEfficiencyMatrix","",
+ hEta->GetNbinsX(),
+ hEta->GetXaxis()->GetXmin(),
+ hEta->GetXaxis()->GetXmax(),
+ hPt->GetNbinsX(),
+ hPt->GetXaxis()->GetXmin(),
+ hPt->GetXaxis()->GetXmax(),
+ hPhi->GetNbinsX(),
+ hPhi->GetXaxis()->GetXmin(),
+ hPhi->GetXaxis()->GetXmax());
+
+ //Efficiency in pt
+ Double_t epsilon[20] = {0.3,0.6,0.77,0.79,0.80,0.80,0.80,0.80,0.80,0.80,0.80,0.80,0.80,0.80,0.80,0.80,0.80,0.80,0.80,0.80};
+ for(Int_t i=1;i<=20;i++) {
+ hPt->SetBinContent(i,epsilon[i-1]);
+ hPt->SetBinError(i,0.01);
+ }
+ for(Int_t i=21;i<=200;i++) {
+ hPt->SetBinContent(i,epsilon[19]);
+ hPt->SetBinError(i,0.01);
+ }
+
+ //Efficiency in eta
+ for(Int_t i=1;i<=hEta->GetNbinsX();i++) {
+ hEta->SetBinContent(i,1.0);
+ hEta->SetBinError(i,0.01);
+ }
+ if(fEfficiencyDropNearEtaEdges) {
+ hEta->SetBinContent(1,0.7); hEta->SetBinContent(2,0.8);
+ hEta->SetBinContent(3,0.9);
+ hEta->SetBinContent(18,0.9); hEta->SetBinContent(19,0.8);
+ hEta->SetBinContent(20,0.7);
+ }
+
+ //Efficiency in phi
+ for(Int_t i=1;i<=hPhi->GetNbinsX();i++) {
+ hPhi->SetBinContent(i,1.0);
+ hPhi->SetBinError(i,0.01);
+ }
+ for(Int_t i=1;i<=fNumberOfInefficientSectors;i++)
+ hPhi->SetBinContent(hPhi->FindBin(hPhi->GetRandom()),fInefficiencyFactorInPhi);
+ for(Int_t i=1;i<=fNumberOfDeadSectors;i++)
+ hPhi->SetBinContent(hPhi->FindBin(hPhi->GetRandom()),0.0);
+
+ //Fill the 3D efficiency map
+ for(Int_t iBinX = 1; iBinX<=fEfficiencyMatrix->GetXaxis()->GetNbins();iBinX++) {
+ //cout<<"==================================="<<endl;
+ for(Int_t iBinY = 1; iBinY<=fEfficiencyMatrix->GetYaxis()->GetNbins();iBinY++) {
+ //cout<<"==================================="<<endl;
+ for(Int_t iBinZ = 1; iBinZ<=fEfficiencyMatrix->GetZaxis()->GetNbins();iBinZ++) {
+ fEfficiencyMatrix->SetBinContent(iBinX,iBinY,iBinZ,hEta->GetBinContent(iBinX)*hPt->GetBinContent(iBinY)*hPhi->GetBinContent(iBinZ));
+ //cout<<"Eta: "<<hEta->GetBinCenter(iBinX)<<" - Pt: "<<hPt->GetBinCenter(iBinY)<<" - Phi: "<<hPhi->GetBinCenter(iBinZ)<<" - "<<hEta->GetBinContent(iBinX)<<" , "<<hPt->GetBinContent(iBinY)<<" , "<<hPhi->GetBinContent(iBinZ)<<" - Efficiency: "<<hEta->GetBinContent(iBinX)*hPt->GetBinContent(iBinY)*hPhi->GetBinContent(iBinZ)<<endl;
+ }
+ }
+ }
+}
+
//====================================================================================================================
Bool_t AliFlowEventSimpleMakerOnTheFly::AcceptOrNot(AliFlowTrackSimple *pTrack)
pTrack->SetCharge((gRandom->Integer(2)>0.5 ? 1 : -1));
// Check uniform acceptance:
if(!fUniformAcceptance && !AcceptOrNot(pTrack)){continue;}
+ //Detector effects
+ if(fSimulateDetectorEffects) {
+ Double_t randomNumber = gRandom->Rndm();
+ if(randomNumber > fEfficiencyMatrix->GetBinContent(fEfficiencyMatrix->FindBin(pTrack->Eta(),pTrack->Pt(),pTrack->Phi())))
+ continue;
+ }
// Checking the RP cuts:
if(cutsRP->PassesCuts(pTrack))
{
class TF1;
class TRandom3;
+class TH3F;
class AliFlowEventSimple;
class AliFlowTrackSimple;
Double_t GetSecondSectorPhiMax() const {return this->fPhiMax2;}
void SetSecondSectorProbability(Double_t dProbability2) {this->fProbability2 = dProbability2;}
Double_t GetSecondSectorProbability() const {return this->fProbability2;}
+
+ //Acceptance - simulate detector effects/inefficiencies
+ void SimulateDetectorEffects() {fSimulateDetectorEffects = kTRUE;}
+ void SetNumberOfInefficientSectorsInPhi(Int_t numberOfInefficientSectors) {
+ fNumberOfInefficientSectors = numberOfInefficientSectors;
+ fInefficiencyFactorInPhi = 0.5;}
+ void SetInefficiencyFactor(Double_t gInefficiencyFactorInPhi) {
+ fInefficiencyFactorInPhi = gInefficiencyFactorInPhi;}
+ void SetNumberOfDeadSectorsInPhi(Int_t numberOfDeadSectors) {
+ fNumberOfDeadSectors = numberOfDeadSectors;}
+ void EnableEfficiencyDropNearEtaEdges() {
+ fEfficiencyDropNearEtaEdges = kTRUE;}
+
private:
AliFlowEventSimpleMakerOnTheFly(const AliFlowEventSimpleMakerOnTheFly& anAnalysis); // copy constructor
AliFlowEventSimpleMakerOnTheFly& operator=(const AliFlowEventSimpleMakerOnTheFly& anAnalysis); // assignment operator
+
+ void SetupEfficiencyMatrix();
+
Int_t fCount; // count number of events
Int_t fMinMult; // uniformly sampled multiplicity is >= iMinMult
Int_t fMaxMult; // uniformly sampled multiplicity is < iMaxMult
Double_t fProbability2; // particles emitted in fPhiMin2 < phi < fPhiMax2 are taken with probability fProbability2
Double_t fPi; // pi
+ //Simulate detector effects
+ Bool_t fSimulateDetectorEffects;//simulate detector effects in pT
+ Int_t fNumberOfInefficientSectors;//inefficient secotrs in phi
+ Double_t fInefficiencyFactorInPhi;//efficiency factor < 1
+ Int_t fNumberOfDeadSectors;//number of dead sectors
+ Bool_t fEfficiencyDropNearEtaEdges;//efficiency drop in eta edges
+ TH3F *fEfficiencyMatrix; //efficiency matrix in eta-pt-phi
+
ClassDef(AliFlowEventSimpleMakerOnTheFly,1) // macro for rootcint
};
//fFlowEvent = new AliFlowEvent( fCutsRP, fCutsPOI );
// if (myESD)
- fFlowEvent->SetReferenceMultiplicity(fCutsEvent->GetReferenceMultiplicity(InputEvent()));
+ fFlowEvent->SetReferenceMultiplicity(fCutsEvent->GetReferenceMultiplicity(InputEvent(),mcEvent));
if (mcEvent && mcEvent->GenEventHeader()) fFlowEvent->SetMCReactionPlaneAngle(mcEvent);
}
if (sourceRP==sourcePOI)\r
{\r
//loop over tracks\r
- for (Int_t i=0; i<rpCuts->GetNumberOfInputObjects(); i++)\r
+ Int_t numberOfInputObject = rpCuts->GetNumberOfInputObjects();\r
+ for (Int_t i=0; i<numberOfInputObject; i++)\r
{\r
//get input object (particle)\r
TObject* particle = rpCuts->GetInputObject(i);\r
//here we have two different sources of particles, so we fill\r
//them independently\r
//RP\r
- for (Int_t i=0; i<rpCuts->GetNumberOfInputObjects(); i++)\r
- {\r
+ Int_t numberOfInputObject = rpCuts->GetNumberOfInputObjects();\r
+ for (Int_t i=0; i<numberOfInputObject; i++)\r
+ {\r
TObject* particle = rpCuts->GetInputObject(i);\r
Bool_t rp = rpCuts->IsSelected(particle,i);\r
if (!rp) continue;\r
fNumberOfTracks++;\r
}\r
//POI\r
- for (Int_t i=0; i<poiCuts->GetNumberOfInputObjects(); i++)\r
+ numberOfInputObject = poiCuts->GetNumberOfInputObjects();\r
+ for (Int_t i=0; i<numberOfInputObject; i++)\r
{\r
TObject* particle = poiCuts->GetInputObject(i);\r
Bool_t poi = poiCuts->IsSelected(particle,i);\r
}\r
}\r
}\r
+\r
//-----------------------------------------------------------------------\r
void AliFlowEvent::InsertTrack(AliFlowTrack *thisTrack) {\r
// adds a flow track at the end of the container\r
if (sourceRP==sourcePOI)\r
{\r
//loop over tracks\r
- for (Int_t i=0; i<rpCuts->GetNumberOfInputObjects(); i++)\r
+ Int_t numberOfInputObject = rpCuts->GetNumberOfInputObjects();\r
+ for (Int_t i=0; i<numberOfInputObject; i++)\r
{\r
//get input object (particle)\r
TObject* particle = rpCuts->GetInputObject(i);\r
//them independently\r
AliFlowTrack* pTrack = NULL;\r
//RP\r
- for (Int_t i=0; i<rpCuts->GetNumberOfInputObjects(); i++)\r
+ Int_t numberOfInputObject = rpCuts->GetNumberOfInputObjects();\r
+ for (Int_t i=0; i<numberOfInputObject; i++)\r
{\r
TObject* particle = rpCuts->GetInputObject(i);\r
Bool_t rp = rpCuts->IsSelected(particle,i);\r
AddTrack(pTrack);\r
}\r
//POI\r
- for (Int_t i=0; i<poiCuts->GetNumberOfInputObjects(); i++)\r
+ numberOfInputObject = poiCuts->GetNumberOfInputObjects();\r
+ for (Int_t i=0; i<numberOfInputObject; i++)\r
{\r
TObject* particle = poiCuts->GetInputObject(i);\r
Bool_t poi = poiCuts->IsSelected(particle,i);\r
if(fCutRefMult&&esdevent)
{
//reference multiplicity still to be defined
- Double_t refMult = RefMult(event);
+ Double_t refMult = RefMult(event,0x0);
if (refMult < fRefMultMin || refMult >= fRefMultMax )
{
pass=kFALSE;
}
//-----------------------------------------------------------------------
-Int_t AliFlowEventCuts::RefMult(AliVEvent* event)
+Int_t AliFlowEventCuts::RefMult(AliVEvent* event, AliMCEvent *mcEvent)
{
//calculate the reference multiplicity, if all fails return 0
AliESDVZERO* vzero = NULL;
}
Int_t refmult=0;
- fRefMultCuts->SetEvent(event);
- for (Int_t i=0; i<fRefMultCuts->GetNumberOfInputObjects(); i++)
- {
+ fRefMultCuts->SetEvent(event,mcEvent);
+ Int_t numberOfInputObjects = fRefMultCuts->GetNumberOfInputObjects();
+ for (Int_t i=0; i<numberOfInputObjects; i++) {
if (fRefMultCuts->IsSelected(fRefMultCuts->GetInputObject(i),i))
refmult++;
}
#include "TNamed.h"
class AliVEvent;
+class AliMCEvent;
class TBrowser;
#include "TList.h"
#include "TH1.h"
TH1* QAbefore(Int_t i) {return static_cast<TH1*>(static_cast<TList*>(fQA->At(0))->At(i));}
TH1* QAafter(Int_t i) {return static_cast<TH1*>(static_cast<TList*>(fQA->At(1))->At(i));}
- Int_t RefMult(AliVEvent* event);
+ Int_t RefMult(AliVEvent* event, AliMCEvent *mcEvent = 0x0);
//Int_t GetRefMult() {return fRefMult;}
- Int_t GetReferenceMultiplicity(AliVEvent* event) {return RefMult(event);}
+ Int_t GetReferenceMultiplicity(AliVEvent* event, AliMCEvent *mcEvent) {return RefMult(event,mcEvent);}
const char* CentrMethName(refMultMethod method) const;
void SetCentralityPercentileRange(Float_t min, Float_t max){ fCentralityPercentileMin=min;
fCentralityPercentileMax=max;
if (fParamType==kMUON) return PassesMuonCuts(vparticle); // XZhang 20120604
return PassesCuts(vparticle); // XZhang 20120604
} // XZhang 20120604
+
AliFlowTrackSimple* flowtrack = dynamic_cast<AliFlowTrackSimple*>(obj);
if (flowtrack) return PassesCuts(flowtrack);
AliMultiplicity* tracklets = dynamic_cast<AliMultiplicity*>(obj);