#include <TH2F.h>
#include <TH1F.h>
#include <TParticle.h>
+#include <TParticlePDG.h>
#include <AliLog.h>
#include <AliESD.h>
fSigmaVertex(0),
fEsdTrackCuts(0),
fPIDParticles(0),
- fPIDTracks(0)
+ fPIDTracks(0),
+ fSignMode(0),
+ fMultiplicityMode(0)
{
//
// Constructor. Initialization of pointers
fdNdEtaCorrectionTriggerBias[2] = new AlidNdEtaCorrection("triggerBiasDD", "triggerBiasDD");
}
-
fPIDParticles = new TH1F("pid_particles", "PID of generated primary particles", 10001, -5000.5, 5000.5);
fPIDTracks = new TH1F("pid_tracks", "MC PID of reconstructed tracks", 10001, -5000.5, 5000.5);
+
+ if (option.Contains("only-positive"))
+ {
+ AliInfo("Processing only positive particles.");
+ fSignMode = 1;
+ }
+ else if (option.Contains("only-negative"))
+ {
+ AliInfo("Processing only negative particles.");
+ fSignMode = -1;
+ }
+
+ if (option.Contains("low-multiplicity"))
+ {
+ AliInfo("Processing only events with low multiplicity.");
+ fMultiplicityMode = 1;
+ }
+ else if (option.Contains("high-multiplicity"))
+ {
+ AliInfo("Processing only events with high multiplicity.");
+ fMultiplicityMode = 2;
+ }
}
Bool_t AlidNdEtaSystematicsSelector::Process(Long64_t entry)
TObjArray* list = fEsdTrackCuts->GetAcceptedTracks(fESD);
+ if (fMultiplicityMode == 1 && list->GetEntries() > 20 ||
+ fMultiplicityMode == 2 && list->GetEntries() < 40)
+ {
+ delete list;
+ list = 0;
+ return kTRUE;
+ }
+
if (fdNdEtaCorrectionSpecies[0])
FillCorrectionMaps(list);
{
// fills the correction maps for different particle species
+ // TODO fix the use of the FillParticle* functions
+
AliStack* stack = GetStack();
AliHeader* header = GetHeader();
if (AliPWG0Helper::IsPrimaryCharged(particle, nPrim) == kFALSE)
continue;
+ if (SignOK(particle->GetPDG()) == kFALSE)
+ continue;
+
Float_t eta = particle->Eta();
Float_t pt = particle->Pt();
default: id = 3; break;
}
- if (vertexReconstructed)
+ if (vertexReconstructed && eventTriggered)
{
- fdNdEtaCorrectionSpecies[id]->FillParticle(vtxMC[2], eta, pt);
+ fdNdEtaCorrectionSpecies[id]->FillParticleVertex(vtxMC[2], eta, pt);
//if (pt < 0.1)
fPIDParticles->Fill(particle->GetPdgCode());
}
if (!mother)
continue;
+ if (SignOK(mother->GetPDG()) == kFALSE)
+ continue;
+
//printf("We continue with particle %d (pdg %d)\n", label, mother->GetPdgCode());
Int_t id = -1;
default: id = 3; break;
}
- if (vertexReconstructed)
+ if (vertexReconstructed && eventTriggered)
{
- fdNdEtaCorrectionSpecies[id]->FillParticleWhenMeasuredTrack(vtxMC[2], particle->Eta(), particle->Pt());
+ fdNdEtaCorrectionSpecies[id]->FillParticleTracked(vtxMC[2], particle->Eta(), particle->Pt());
//if (particle->Pt() < 0.1)
fPIDTracks->Fill(particle->GetPdgCode());
}
fSigmaVertex->Draw();
}
}
+
+Bool_t AlidNdEtaSystematicsSelector::SignOK(TParticlePDG* particle)
+{
+ // returns if a particle with this sign should be counted
+ // this is determined by the value of fSignMode, which should have the same sign
+ // as the charge
+ // if fSignMode is 0 all particles are counted
+
+ if (fSignMode == 0)
+ return kTRUE;
+
+ if (!particle)
+ {
+ printf("WARNING: not counting a particle that does not have a pdg particle\n");
+ return kFALSE;
+ }
+
+ Double_t charge = particle->Charge();
+
+ if (fSignMode > 0)
+ if (charge < 0)
+ return kFALSE;
+
+ if (fSignMode < 0)
+ if (charge > 0)
+ return kFALSE;
+
+ return kTRUE;
+}
class AliESDtrackCuts;
class AlidNdEtaCorrection;
+class TParticlePDG;
class TH2F;
class TH1F;
virtual void Terminate();
protected:
+ Bool_t SignOK(TParticlePDG* particle);
+
void ReadUserObjects(TTree* tree);
void FillCorrectionMaps(TObjArray* listOfTracks);
AlidNdEtaCorrection* fdNdEtaCorrectionTriggerBias[3]; // correction for trigger bias
+ Int_t fSignMode; // 1 = only positive particles are counted, -1 = only negative, 0 = both (default)
+ Int_t fMultiplicityMode; // 1 = only events with low multiplicity, 2 = high multiplicity, 0 = all (default)
private:
AlidNdEtaSystematicsSelector(const AlidNdEtaSystematicsSelector&);