FairRoot/PandaRoot
Classes | Typedefs | Functions
FairEvtFilterOnSingleParticleCounts.h File Reference
#include "FairEvtFilter.h"
#include "TParticle.h"
#include "TMath.h"
#include <map>
#include <vector>
#include <iostream>

Go to the source code of this file.

Classes

class  FairEvtFilterOnSingleParticleCounts
 

Typedefs

typedef std::map< Int_t,
std::vector< Int_t > > 
PdgGroupId
 
typedef std::pair< Int_t,
std::vector< Int_t > > 
PdgGroupIdPair
 
typedef std::map< Int_t,
std::vector< Int_t >
>::iterator 
PdgGroupIdIterator
 

Functions

std::ostreamoperator<< (std::ostream &os, const std::vector< Int_t > &v)
 
std::ostreamoperator<< (std::ostream &os, const std::vector< std::pair< Double_t, Double_t > > &vpair)
 
std::ostreamoperator<< (std::ostream &os, const std::vector< std::pair< Int_t, Int_t > > &vpair)
 
std::ostreamoperator<< (std::ostream &os, const std::map< Int_t, std::vector< Int_t > > &PdgGroupId)
 

Typedef Documentation

typedef std::map<Int_t, std::vector<Int_t> > PdgGroupId

FairEvtFilterOnSingleParticleCounts.h

Authors: Martin Galuska, Katja Kleeberg Martin dot J dot Galuska at physik dot uni minus giessen dot de

Purpose: This class is used for an event filter expansion of FairPrimaryGenerator. It filters events right after event generation and before transport through the detector model events will either be accepted (and further simulated) or rejected completely.

This filter class implements such decisions based on particle multiplicities in the events This filter class can count multiplicities of particles whose pdg code are in a user defined list of pdg codes (called a group ID) particles with desired electrical charge all particles Multiple constraints of the above criteria are supported in one filter.

The standard is that all particles in the event are counted. Optionally, only particles that satisfy certain constraints on momentum / angles or vertices are counted. Only one range of such constraints are supported for one filter.

The user has to specify the minimum or maximum multiplicities for each group of pdg codes / charge state / all particles to be investigated (Multiple conditions for the same PDG code are supported)

Definition at line 46 of file FairEvtFilterOnSingleParticleCounts.h.

typedef std::map<Int_t,std::vector<Int_t> >::iterator PdgGroupIdIterator

Definition at line 48 of file FairEvtFilterOnSingleParticleCounts.h.

typedef std::pair<Int_t,std::vector<Int_t> > PdgGroupIdPair

Definition at line 47 of file FairEvtFilterOnSingleParticleCounts.h.

Function Documentation

std::ostream& operator<< ( std::ostream os,
const std::vector< Int_t > &  v 
)

Definition at line 8 of file FairEvtFilterOnSingleParticleCounts.cxx.

References v.

9 {
10  os << "(";
11  Int_t lastIdx = v.size()-1;
12  if(lastIdx < 0){
13  os << ")" ;
14  return os;
15  }
16 
17  for (Int_t iVec = 0; iVec < lastIdx; ++iVec){
18  os << v[iVec] << ", ";
19  }
20  os << v[lastIdx] << ")";
21  return os;
22 }
__m128 v
Definition: P4_F32vec4.h:4
std::ostream& operator<< ( std::ostream os,
const std::vector< std::pair< Double_t, Double_t > > &  vpair 
)

Definition at line 26 of file FairEvtFilterOnSingleParticleCounts.cxx.

27 {
28  os << "( ";
29  Int_t lastIdx = vpair.size()-1;
30  if(vpair.size() == 0){
31  os << ")" ;
32  return os;
33  }
34 
35  for (Int_t iVec = 0; iVec < lastIdx; ++iVec){
36  os << "{";
37  os << vpair[iVec].first << ", ";
38  os << vpair[iVec].second;
39  os << "},";
40  }
41  os << "{";
42  os << vpair[lastIdx].first << ", ";
43  os << vpair[lastIdx].second;
44  os << "} )";
45  return os;
46 }
std::ostream& operator<< ( std::ostream os,
const std::vector< std::pair< Int_t, Int_t > > &  vpair 
)

Definition at line 49 of file FairEvtFilterOnSingleParticleCounts.cxx.

50 {
51  os << "( ";
52  Int_t lastIdx = vpair.size()-1;
53  if(vpair.size() == 0){
54  os << ")" ;
55  return os;
56  }
57 
58  for (Int_t iVec = 0; iVec < lastIdx; ++iVec){
59  os << "{";
60  os << vpair[iVec].first << ", ";
61  os << vpair[iVec].second;
62  os << "},";
63  }
64  os << "{";
65  os << vpair[lastIdx].first << ", ";
66  os << vpair[lastIdx].second;
67  os << "} )";
68  return os;
69 }
std::ostream& operator<< ( std::ostream os,
const std::map< Int_t, std::vector< Int_t > > &  PdgGroupId 
)

Definition at line 72 of file FairEvtFilterOnSingleParticleCounts.cxx.

References map.

73 {
74  if(pdgGroupId.begin() == pdgGroupId.end()){
75  os << "( , [ ] )";
76  return os;
77  }
78  for (std::map<Int_t,std::vector<Int_t> >::const_iterator iPdgGroupId = pdgGroupId.begin(); iPdgGroupId != pdgGroupId.end(); ++iPdgGroupId){
79  os << "( "<< iPdgGroupId->first << ", [";
80  os << iPdgGroupId->second;
81  os << "] )";
82  }
83  return os;
84 }
PndTransMap * map
Definition: sim_emc_apd.C:99