PandaRoot
PndEventRequirements.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // -------------------------------------------------------------------------
14 // ----- PndEventRequirements header file -----
15 // ----- Created 16/09/19 by T.Stockmann -----
16 // -------------------------------------------------------------------------
17 
24 #pragma once
25 
27 #include "TVector3.h"
28 #include "TVector2.h"
29 #include <iostream>
30 
32 
33  public:
36 
38  virtual ~PndEventRequirements();
39 
40  // needs to be called before first use once the FairRootManager is available (in the init of the task using it)
41  void InitRequirements();
42 
43  friend std::ostream &operator<<(std::ostream &out, PndEventRequirements &track)
44  {
45  int i = 0;
46  for (auto req : track.fTrackRequirements) {
47  out << i++ << " : " << req << std::endl;
48  }
49  return out;
50  }
51 
54  {
55  if (val.GetCheckTracking() == true)
56  fChargedTracks.push_back(fTrackRequirements.size());
57  if (val.GetCheckNeutral() == true)
58  fNeutralTracks.push_back(fTrackRequirements.size());
59  fTrackRequirements.push_back(val);
60  }
61 
62  std::vector<PndParticleRequirements> GetRequirements() { return fTrackRequirements; }
63  int GetNRequirements() const { return fTrackRequirements.size(); }
64  int GetNParticles() { return fTrackRequirements.size(); }
65  std::vector<int> GetChargedRequirements() const { return fChargedTracks; }
66  std::vector<int> GetNeutralRequirements() const { return fNeutralTracks; }
67  void ClearFound()
68  {
69  for (auto &track : fTrackRequirements)
70  track.ClearFound();
71  }
72 
73  protected:
74 
75  private:
76  std::vector<PndParticleRequirements> fTrackRequirements;
77  std::vector<int> fChargedTracks; // index to requirement of charged particle
78  std::vector<int> fNeutralTracks; // index to requirement of neutral particle
79 
80  ClassDef(PndEventRequirements, 1);
81 };
82 
std::vector< int > GetNeutralRequirements() const
unsigned int i
Definition: P4_F32vec4.h:33
void AddTrackRequirement(PndParticleRequirements val)
virtual ~PndEventRequirements()
std::vector< int > GetChargedRequirements() const
friend std::ostream & operator<<(std::ostream &out, PndEventRequirements &track)
std::vector< PndParticleRequirements > GetRequirements()