|
ATLAS Offline Software
|
Go to the documentation of this file.
27 m_generatorSettings(settings),
31 m_shapeRequirement(0),
32 m_settingsParsed(false) {
36 m_limits.push_back(std::make_pair(0.,0.));
44 std::vector<std::string> strVector;
54 for(;row_itr!=row_itr_end;++row_itr) {
58 if(strVector.size() == 0)
continue;
59 if(strVector.size() == 1) {
60 std::cerr <<
"A generator setting must be followed by a value" << std::endl;
66 col_itr = strVector.begin();
67 col_itr_end = strVector.end();
69 if((*col_itr) ==
"allowedPdgId") {
71 for(;col_itr!=col_itr_end;++col_itr) {
75 else if((*col_itr) ==
"shape") {
77 if((*col_itr) ==
"cylinder") {
81 std::cerr <<
"Warning: unknown shape requirement \"" << (*col_itr) <<
"\" ignored." << std::endl;
109 std::cerr <<
"Error: " << (*itr) <<
" is an un-known generator setting." << std::endl;
116 std::cerr <<
"Warning: " <<
m_limitNames[
i] <<
" was not followed by a lower or upper limit." << std::endl;
148 while(itr!=itr_end) {
149 if(beamHaloParticle->
pdgId() == (*itr))
break;
179 std::cerr <<
"Warning: m_shapeRequirement = " <<
m_shapeRequirement <<
" is an unknown requirement." << std::endl;
197 beamHaloParticle->
fourVector().theta() > 0.)
return false;
201 if(beamHaloParticle->
fourVector().perp() == 0.) {
219 double innerZ = (rmin*beamHaloParticle->
fourVector().z())/beamHaloParticle->
fourVector().perp();
222 double outerZ = (rmax*beamHaloParticle->
fourVector().z())/beamHaloParticle->
fourVector().perp();
226 if((innerZ >=
zmin && innerZ <=
zmax) ||
227 (outerZ >=
zmin && outerZ <=
zmax)) {
238 std::cerr <<
"Error: the index " <<
index <<
" is out of range." << std::endl;
251 std::cout <<
"============== BeamHaloGeneratorSettings ==============" << std::endl;
252 std::cout <<
" allowedPdfIds: ";
256 for(;pdgId_itr != pdgId_itr_end; ++pdgId_itr) {
257 std::cout << (*pdgId_itr) <<
" ";
259 std::cout << std::endl;
262 std::cout <<
"All PDG IDs are allowed." << std::endl;
265 std::cout <<
" shapeRequirement: ";
267 case(
NONE) : std::cout <<
"NONE";
break;
268 case(
CYLINDER) : std::cout <<
"CYLINDER";
break;
269 default : std::cout <<
"UNKNOWN";
break;
271 std::cout << std::endl;
276 else std::cout <<
m_limits[
i].first <<
", ";
278 else std::cout <<
m_limits[
i].second <<
"}";
279 std::cout << std::endl;
281 std::cout <<
"=======================================================" << std::endl;
JetConstituentVector::iterator iterator
A class to describe a generic beam halo particle.
bool m_settingsParsed
A flag to check if the settings have been parsed or not.
int parseSettings(void)
A function to parse the settings using the vector of strings given to the constructor of this class.
static const std::string m_limitNames[ENUM_LIMITS_SIZE]
The name of the limits.
std::vector< std::pair< bool, bool > > m_limitsEnabled
A vector of flags to signal if a limit should be used or not.
bool checkSetting(int index, double value)
A function to check if a particle is within a range.
void printSettings(void)
Print a summary of the current settings.
std::vector< std::pair< float, float > > m_limits
Minimum and maximum limits.
long pdgId() const
A function to return the PDG id of this particle.
std::vector< std::string > m_generatorSettings
A vector of strings to configure the generator settings.
int parseLimitSetting(std::vector< std::string > *commandVector)
A function to read the limit settings from the supplied vector of strings.
std::vector< long > m_allowedPdgIds
An allowed set of PDG ids where any empty vector implies all PDG ids are allowed.
HepMC::FourVector fourVector() const
A function to return the momentum fourvector of this particle.
bool checkCylinder(BeamHaloParticle *beamHaloParticle)
A function to check if a particle is within a cylinder.
bool checkParticle(BeamHaloParticle *beamHaloParticle)
Check if the supplied beam halo particle passes the generator settings.
int m_shapeRequirement
A variable to store the volume shape requirement.
BeamHaloGeneratorSettings(const std::vector< std::string > &settings)
Construct a class with a vector of string settings to filter particles.
double weight() const
A function to return the weight of this particle within the input beam background simulation file.
HepMC::FourVector positionAtScoringPlane() const
A function to return the position fourvector of this particle with respect to the scoring plane.