message: Make eta limits configurable
  Also some minor modernizations to make iteration of particle and track
  containers safer
diff: @@ -114,7 +114,6 @@ void AliEventTree::InitializeTree(Bool_t saveTracks)
  fTree->Branch("Event_Vertex_Z",&fBuffer_Event_Vertex_Z,"Event_Vertex_Z/F");
  fTree->Branch("Event_ID",&fBuffer_Event_ID,"Event_ID/L");
  -
  fTree->Branch("Particles_Pt",fBuffer_Particles_Pt,"Particles_Pt[Event_Number_Particles]/F");
  fTree->Branch("Particles_Eta",fBuffer_Particles_Eta,"Particles_Eta[Event_Number_Particles]/F");
  fTree->Branch("Particles_Phi",fBuffer_Particles_Phi,"Particles_Phi[Event_Number_Particles]/F");
  @@ -132,7 +131,6 @@ void AliEventTree::InitializeTree(Bool_t saveTracks)
  fTree->Branch("Tracks_Charge",fBuffer_Tracks_Charge,"Tracks_Charge[Event_Number_Tracks]/S");
  fTree->Branch("Tracks_Label",fBuffer_Tracks_Label,"Tracks_Label[Event_Number_Tracks]/I");
  fTree->Branch("Tracks_IsGlobal",fBuffer_Tracks_IsGlobal,"Tracks_IsGlobal[Event_Number_Tracks]/O");
  -
  }
  fInitialized = kTRUE;
  @@ -250,13 +248,6 @@ void AliAnalysisTaskEventExtractor::ExecOnce()
  if(!GetTrackContainer(1) && fSaveTracks)
  AliFatal(Form("Track container not valid, but demanded"));
  - GetParticleContainer(0)->SetEtaLimits(-10, 10);
  -
  - if(fSaveTracks)
  - {
  - GetTrackContainer(1)->SetEtaLimits(-2, 2);
  - }
  -
  // ### Execute shell script at startup
  if(!fCustomStartupScript.IsNull())
  {
  @@ -295,16 +286,16 @@ Bool_t AliAnalysisTaskEventExtractor::Run()
  std::vector<AliVParticle*> particles;
  std::vector<AliVTrack*> tracks;
  - GetParticleContainer(0)->ResetCurrentID();
  - while(AliVParticle *part = static_cast<AliVParticle*>(GetParticleContainer(0)->GetNextAcceptParticle()))
  + for (auto part : GetParticleContainer(0)->accepted()) {
  particles.push_back(part);
  + }
  if(GetParticleContainer(1) && fSaveTracks)
  {
  - GetParticleContainer(1)->ResetCurrentID();
  - while(AliVTrack *track = static_cast<AliVTrack*>(GetParticleContainer(1)->GetNextAcceptParticle()))
  + for (auto track : GetTrackContainer(1)->accepted()) {
  tracks.push_back(track);
  }
  + }
  fTree->AddEventToTree(eventID, vtx, particles, tracks);
  return kTRUE;
  @@ -452,6 +443,19 @@ AliAnalysisTaskEventExtractor* AliAnalysisTaskEventExtractor::AddTaskEventExtrac
  myTask->AddMCParticleContainer(particleArray);
  myTask->AddTrackContainer(trackArray);
  + // Configure the eta limits for the particle and track containers.
  + // They are configured here so we could modify them later if so desired.
  + // The default values are selected because the eta distribution at particle level
  + // is quite similar to the detector level eta distribution. However, we add some
  + // additional margin to be certain that we aren't artificially distorting the particle
  + // level distribution.
  + double etaMin = -2.0;
  + double etaMax = 2.0;
  + myTask->GetParticleContainer(0)->SetEtaLimits(1.5*etaMin, 1.5*etaMax);
  + if (myTask->GetTrackContainer(1))
  + {
  + myTask->GetTrackContainer(1)->SetEtaLimits(etaMin, etaMax);
  + }
  mgr->AddTask(myTask);
  