|
ATLAS Offline Software
|
#include <EvtInclusiveDecay.h>
|
| EvtInclusiveDecay (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual | ~EvtInclusiveDecay () |
|
StatusCode | initialize () |
|
StatusCode | execute () |
|
StatusCode | finalize () |
|
std::string | xmlpath (void) |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
ServiceHandle< IAthRNGSvc > | m_rndmSvc {this, "RndmSvc", "AthRNGSvc"} |
|
IntegerProperty | m_dsid {this, "Dsid", 999999} |
|
IntegerProperty | m_randomSeed {this, "RandomSeed", 1234567, "Random seed for the built-in random engine"} |
| Seed for random number engine. More...
|
|
McEventCollection * | m_mcEvtColl {} |
|
EvtInclusiveAtRndmGen * | m_evtAtRndmGen {} |
|
EvtGen * | m_myEvtGen {} |
|
std::string | m_pdtFile |
|
std::string | m_decayFile |
|
std::string | m_userDecayFile |
|
std::string | m_randomStreamName |
|
std::string | m_inputKeyName |
|
std::string | m_outputKeyName |
|
bool | m_readExisting |
|
bool | m_prohibitFinalStateDecay |
|
bool | m_prohibitReDecay |
|
bool | m_prohibitUnDecay |
|
bool | m_prohibitRemoveSelfDecay |
|
std::vector< int > | m_blackList |
|
std::set< int > | m_blackListSet |
|
bool | m_allowAllKnownDecays |
|
bool | m_allowDefaultBDecays |
|
std::vector< int > | m_whiteList |
|
std::set< int > | m_whiteListSet |
|
bool | m_printHepMCBeforeEvtGen |
|
bool | m_printHepMCAfterEvtGen |
|
bool | m_printHepMCHighlighted |
|
bool | m_printHepMCHighLightTopLevelDecays |
|
bool | m_checkDecayTree |
|
bool | m_checkDecayChannels |
|
std::map< int, long > | m_noDecayChannels |
|
int | m_nRepeatedDecays |
|
int | m_maxNRepeatedDecays |
|
bool | m_applyUserSelection |
|
bool | m_userSelRequireOppositeSignedMu |
|
double | m_userSelMu1MinPt |
|
double | m_userSelMu2MinPt |
|
double | m_userSelMu1MaxEta |
|
double | m_userSelMu2MaxEta |
|
double | m_userSelMinDimuMass |
|
double | m_userSelMaxDimuMass |
|
bool | m_isfHerwig |
|
bool | m_setVMtransversePol |
|
void | reseedRandomEngine (const std::string &streamName, const EventContext &ctx) |
|
CLHEP::HepRandomEngine * | getRandomEngine (const std::string &streamName, unsigned long int randomSeedOffset, const EventContext &ctx) const |
|
CLHEP::HepRandomEngine * | getRandomEngineDuringInitialize (const std::string &streamName, unsigned long int randomSeedOffset, unsigned int conditionsRun=1, unsigned int lbn=1) const |
|
StatusCode | traverseDecayTree (HepMC::GenParticlePtr p, bool isToBeRemoved, std::set< HepMC::GenVertexPtr > &visited, std::set< int > &toBeDecayed) |
|
void | removeDecayTree (HepMC::GenEvent *hepMC, HepMC::GenParticlePtr p) |
|
void | decayParticle (HepMC::GenEvent *hepMC, HepMC::GenParticlePtr p) |
|
void | addEvtGenDecayTree (HepMC::GenEvent *hepMC, HepMC::GenParticlePtr part, EvtParticle *evtPart, EvtVector4R treeStart, double momentumScaleFactor=1.0) |
|
bool | isToBeDecayed (HepMC::ConstGenParticlePtr p, bool doCrossChecks) |
|
bool | isDefaultB (const int pId) const |
|
bool | passesUserSelection (HepMC::GenEvent *hepMC) |
|
double | invMass (HepMC::ConstGenParticlePtr p1, HepMC::ConstGenParticlePtr p2) |
|
void | printHepMC (HepMC::GenEvent *hepMC, std::set< int > *barcodeList=nullptr) |
|
unsigned int | printTree (HepMC::GenParticlePtr p, std::set< HepMC::GenVertexPtr > &visited, int level, std::set< int > *barcodeList=0) |
|
std::string | pdgName (HepMC::ConstGenParticlePtr p, bool statusHighlighting=false, std::set< int > *barcodeList=nullptr) |
|
Definition at line 58 of file EvtInclusiveDecay.h.
◆ StoreGateSvc_t
◆ EvtInclusiveDecay()
EvtInclusiveDecay::EvtInclusiveDecay |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~EvtInclusiveDecay()
EvtInclusiveDecay::~EvtInclusiveDecay |
( |
| ) |
|
|
virtual |
◆ addEvtGenDecayTree()
void EvtInclusiveDecay::addEvtGenDecayTree |
( |
HepMC::GenEvent * |
hepMC, |
|
|
HepMC::GenParticlePtr |
part, |
|
|
EvtParticle * |
evtPart, |
|
|
EvtVector4R |
treeStart, |
|
|
double |
momentumScaleFactor = 1.0 |
|
) |
| |
|
private |
Definition at line 532 of file EvtInclusiveDecay.cxx.
534 if(evtPart->getNDaug()!=0) {
536 double ct=(evtPart->getDaug(0)->get4Pos()).
get(0)+treeStart.get(0);
537 double x=(evtPart->getDaug(0)->get4Pos()).
get(1)+treeStart.get(1);
538 double y=(evtPart->getDaug(0)->get4Pos()).
get(2)+treeStart.get(2);
539 double z=(evtPart->getDaug(0)->get4Pos()).
get(3)+treeStart.get(3);
543 hepMC->add_vertex(end_vtx);
544 end_vtx->add_particle_in(
part);
547 for(
uint it=0;
it<evtPart->getNDaug();
it++) {
548 double e=(evtPart->getDaug(
it)->getP4Lab()).
get(0) * momentumScaleFactor;
549 double px=(evtPart->getDaug(
it)->getP4Lab()).
get(1) * momentumScaleFactor;
550 double py=(evtPart->getDaug(
it)->getP4Lab()).
get(2) * momentumScaleFactor;
551 double pz=(evtPart->getDaug(
it)->getP4Lab()).
get(3) * momentumScaleFactor;
552 int id=EvtPDL::getStdHep(evtPart->getDaug(
it)->getId());
554 if(evtPart->getDaug(
it)->getNDaug() != 0)
status=2;
556 end_vtx->add_particle_out(daughter);
◆ ATLAS_NOT_CONST_THREAD_SAFE() [1/2]
HepMC::GenEvent* event GenBase::ATLAS_NOT_CONST_THREAD_SAFE |
( |
| ) |
|
|
inlineinherited |
Access the current signal event (first in the McEventCollection)
- Note
- This function will make a new McEventCollection if there is not already a valid one and MakeMcEvent=True.
Definition at line 76 of file GenBase.h.
78 ATH_MSG_ERROR(
"McEventCollection is empty during first event access");
79 return *(
events()->begin());
◆ ATLAS_NOT_CONST_THREAD_SAFE() [2/2]
◆ cmTomm()
void GenBase::cmTomm |
( |
HepMC::GenEvent * |
evt | ) |
|
|
protectedinherited |
Scale event lengths by x 10.
Definition at line 81 of file GenBase.cxx.
82 for (HepMC::GenEvent::vertex_iterator vtx =
evt->vertices_begin(); vtx !=
evt->vertices_end(); ++vtx) {
83 const HepMC::FourVector fv((*vtx)->position().x() * 10,
84 (*vtx)->position().y() * 10,
85 (*vtx)->position().z() * 10,
86 (*vtx)->position().t() * 10);
87 (*vtx)->set_position(fv);
◆ decayParticle()
Definition at line 493 of file EvtInclusiveDecay.cxx.
504 int id =
part->pdg_id();
505 EvtId evtId=EvtPDL::evtIdFromStdHep(
id);
506 double en =(
part->momentum()).
e()/1000.;
507 double px=(
part->momentum()).
px()/1000.;
508 double py=(
part->momentum()).
py()/1000.;
509 double pz=(
part->momentum()).
pz()/1000.;
511 EvtParticle* evtPart = EvtParticleFactory::particleFactory(evtId,evtP);
514 if(
m_setVMtransversePol && (
id==113 ||
id== 443 ||
id==100443 ||
id==553 ||
id==100553 ||
id==200553) )evtPart->setVectorSpinDensity();
518 double ct_s =
part->production_vertex()->position().t();
519 double x_s =
part->production_vertex()->position().x();
520 double y_s =
part->production_vertex()->position().y();
521 double z_s =
part->production_vertex()->position().z();
523 EvtVector4R treeStart(ct_s,x_s,y_s,z_s);
526 if(evtPart->getNDaug() !=0)
part->set_status(2);
527 evtPart->deleteTree();
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ event_const()
const HepMC::GenEvent* GenBase::event_const |
( |
| ) |
const |
|
inlineinherited |
Access the current signal event (const)
Definition at line 83 of file GenBase.h.
85 ATH_MSG_ERROR(
"Const McEventCollection is empty during first event access");
◆ events_const() [1/2]
◆ events_const() [2/2]
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode EvtInclusiveDecay::execute |
( |
| ) |
|
|
virtual |
Reimplemented from GenBase.
Definition at line 220 of file EvtInclusiveDecay.cxx.
223 const EventContext& ctx = Gaudi::Hive::currentContext();
247 HepMC::GenEvent* hepMC = *mcItr;
252 std::set<HepMC::GenVertexPtr> visited;
254 std::set<HepMC::GenParticlePtr> toBeDecayed;
255 for (
auto p: hepMC->particles()) {
256 if ( (!
p->production_vertex()) ||
257 (
p->production_vertex()->particles_in().size() == 0) ) {
260 return StatusCode::FAILURE;
265 msg(MSG::INFO) <<
"Printing HepMC record at " << hepMC <<
" BEFORE running EvtGen:" <<
endmsg;
272 std::set<int> toBeDecayed;
273 for (HepMC::GenEvent::particle_iterator
itp = hepMC->particles_begin();
itp != hepMC->particles_end(); ++
itp) {
275 if ( (!
p->production_vertex()) ||
276 (
p->production_vertex()->particles_in_size() == 0) ) {
279 return StatusCode::FAILURE;
284 msg(MSG::INFO) <<
"Printing HepMC record at " << hepMC <<
" BEFORE running EvtGen:" <<
endmsg;
293 bool eventPassesCuts(
false);
297 for (
auto p: toBeDecayed) {
299 msg(MSG::ERROR ) <<
"Overlapping decay tree for particle" <<
p <<
endmsg;
300 return StatusCode::FAILURE;
307 auto p = hepMC->barcode_to_particle(*itb);
309 msg(MSG::ERROR ) <<
"Overlapping decay tree encountered for barcode " << *itb <<
endmsg;
310 return StatusCode::FAILURE;
320 eventPassesCuts =
true;
329 hepMC->weight(
"nEvtGenDecayAttempts") = loopCounter;
332 hepMC->weights()[
"nEvtGenDecayAttempts"] = loopCounter;
336 msg(MSG::INFO) <<
"Printing HepMC record at " << hepMC <<
" AFTER running EvtGen:" <<
endmsg;
348 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ finalize()
StatusCode EvtInclusiveDecay::finalize |
( |
| ) |
|
Definition at line 352 of file EvtInclusiveDecay.cxx.
355 ATH_MSG_INFO(
"The following particles were checked and didn't have any decay channels:");
357 std::cout << std::endl;
358 std::cout <<
" Particle code Name from HepPDT # Occurences" << std::endl;
359 std::cout <<
"------------------------------------------------------" << std::endl;
363 std::cout << std::setw(14) <<
id
365 << std::setw(20) <<
count
368 std::cout << std::endl;
373 return StatusCode::SUCCESS;
◆ getRandomEngine()
CLHEP::HepRandomEngine * EvtInclusiveDecay::getRandomEngine |
( |
const std::string & |
streamName, |
|
|
unsigned long int |
randomSeedOffset, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
private |
◆ getRandomEngineDuringInitialize()
CLHEP::HepRandomEngine * EvtInclusiveDecay::getRandomEngineDuringInitialize |
( |
const std::string & |
streamName, |
|
|
unsigned long int |
randomSeedOffset, |
|
|
unsigned int |
conditionsRun = 1 , |
|
|
unsigned int |
lbn = 1 |
|
) |
| const |
|
private |
Definition at line 203 of file EvtInclusiveDecay.cxx.
208 ctx.setEventID (EventIDBase (conditionsRun,
209 EventIDBase::UNDEFEVT,
210 EventIDBase::UNDEFNUM,
211 EventIDBase::UNDEFNUM,
◆ GeVToMeV()
void GenBase::GeVToMeV |
( |
HepMC::GenEvent * |
evt | ) |
|
|
protectedinherited |
Scale event energies/momenta by x 1000.
- Todo:
- Add HepMC units awareness and do it differently when HepMC provides this functionality directly (and reference-based FourVector accessors)
Definition at line 61 of file GenBase.cxx.
62 for (HepMC::GenEvent::particle_iterator
p =
evt->particles_begin();
p !=
evt->particles_end(); ++
p) {
63 const HepMC::FourVector fv((*p)->momentum().px() * 1000,
64 (*p)->momentum().py() * 1000,
65 (*p)->momentum().pz() * 1000,
66 (*p)->momentum().e() * 1000);
67 (*p)->set_momentum(fv);
68 (*p)->set_generated_mass(1000 * (*p)->generated_mass());
◆ initialize()
StatusCode EvtInclusiveDecay::initialize |
( |
| ) |
|
|
virtual |
Reimplemented from GenBase.
Definition at line 119 of file EvtInclusiveDecay.cxx.
125 msg(MSG::INFO) <<
"EvtInclusiveDecay initialize" <<
endmsg;
130 msg(MSG::INFO) <<
"EvtInclusiveDecay selection parameters:" <<
endmsg;
137 msg(MSG::INFO) <<
"User selection parameters:" <<
endmsg;
149 msg(MSG::INFO) <<
"* blackList; = ";
151 msg(MSG::INFO) << (*i) <<
" ";
156 msg(MSG::INFO) <<
"* whiteList = ";
158 msg(MSG::INFO) << (*i) <<
" ";
166 EvtExternalGenList genList(
true,
xmlpath(),
"gamma");
167 EvtAbsRadCorr* radCorrEngine = genList.getPhotosModel();
168 std::list<EvtDecayBase*> extraModels = genList.getListOfModels();
181 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ invMass()
Definition at line 699 of file EvtInclusiveDecay.cxx.
700 double p1Px = p1->momentum().px();
701 double p1Py = p1->momentum().py();
702 double p1Pz = p1->momentum().pz();
703 double p1E = p1->momentum().e();
704 double p2Px = p2->momentum().px();
705 double p2Py = p2->momentum().py();
706 double p2Pz = p2->momentum().pz();
707 double p2E = p2->momentum().e();
708 double dimuE = p2E + p1E;
709 double dimuPx = p2Px + p1Px;
710 double dimuPy = p2Py + p1Py;
711 double dimuPz = p2Pz + p1Pz;
712 double invMass = std::sqrt(dimuE*dimuE - dimuPx*dimuPx - dimuPy*dimuPy - dimuPz*dimuPz);
◆ isDefaultB()
bool EvtInclusiveDecay::isDefaultB |
( |
const int |
pId | ) |
const |
|
private |
◆ isToBeDecayed()
Definition at line 570 of file EvtInclusiveDecay.cxx.
571 int id =
p->pdg_id();
573 auto v =
p->end_vertex();
574 if (
v) nDaughters =
v->particles_out_size();
577 if (
p->status() == 3)
return false;
583 double m2 =
p->momentum().m2();
590 EvtId evtId = EvtPDL::evtIdFromStdHep(
id);
593 if (evtId.getId()>=0)
595 nModes = EvtDecayTable::getInstance()->getNMode(evtId.getAlias());
598 <<
" (status = " <<
p->status()
599 <<
") -- " << nModes <<
" decay modes found");
617 for (
auto itd:
v->particles_out()) {
618 if (std::abs(itd->pdg_id()) == std::abs(
id))
return false;
621 for (HepMC::GenVertex::particle_iterator itd =
v->particles_begin(
HepMC::children);
624 if (std::abs((*itd)->pdg_id()) == std::abs(
id))
return false;
◆ MeVToGeV()
void GenBase::MeVToGeV |
( |
HepMC::GenEvent * |
evt | ) |
|
|
protectedinherited |
Scale event energies/momenta by x 1/1000.
Definition at line 71 of file GenBase.cxx.
72 for (HepMC::GenEvent::particle_iterator
p =
evt->particles_begin();
p !=
evt->particles_end(); ++
p) {
73 const HepMC::FourVector fv((*p)->momentum().px() / 1000,
74 (*p)->momentum().py() / 1000,
75 (*p)->momentum().pz() / 1000,
76 (*p)->momentum().e() / 1000);
77 (*p)->set_momentum(fv);
78 (*p)->set_generated_mass((*p)->generated_mass() / 1000);
◆ mmTocm()
void GenBase::mmTocm |
( |
HepMC::GenEvent * |
evt | ) |
|
|
protectedinherited |
Scale event lengths by x 1/10.
Definition at line 90 of file GenBase.cxx.
91 for (HepMC::GenEvent::vertex_iterator vtx =
evt->vertices_begin(); vtx !=
evt->vertices_end(); ++vtx) {
92 const HepMC::FourVector fv((*vtx)->position().x() / 10,
93 (*vtx)->position().y() / 10,
94 (*vtx)->position().z() / 10,
95 (*vtx)->position().t() / 10);
96 (*vtx)->set_position(fv);
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ particleData()
const HepPDT::ParticleData* GenBase::particleData |
( |
int |
pid | ) |
const |
|
inlineinherited |
Access an element in the particle data table.
Definition at line 126 of file GenBase.h.
◆ particleTable()
const HepPDT::ParticleDataTable& GenBase::particleTable |
( |
| ) |
const |
|
inlineinherited |
Get a particle data table.
Definition at line 118 of file GenBase.h.
◆ partPropSvc()
Access the particle property service.
Definition at line 113 of file GenBase.h.
◆ passesUserSelection()
bool EvtInclusiveDecay::passesUserSelection |
( |
HepMC::GenEvent * |
hepMC | ) |
|
|
private |
Definition at line 669 of file EvtInclusiveDecay.cxx.
671 std::vector<HepMC::GenParticlePtr> *muons =
new std::vector<HepMC::GenParticlePtr>;
673 for (
const auto&
p: *hepMC) {
674 if( std::abs(
p->pdg_id()) == 13 )
678 for (
auto muItr1 = muons->begin(); muItr1 != muons->end(); ++muItr1) {
679 for (
auto muItr2 = muItr1+1; muItr2 != muons->end(); ++muItr2) {
687 double dimuMass =
invMass((*muItr1),(*muItr2));
◆ pdgName()
std::string EvtInclusiveDecay::pdgName |
( |
HepMC::ConstGenParticlePtr |
p, |
|
|
bool |
statusHighlighting = false , |
|
|
std::set< int > * |
barcodeList = nullptr |
|
) |
| |
|
private |
Definition at line 872 of file EvtInclusiveDecay.cxx.
873 std::ostringstream
buf;
874 if (statusHighlighting) {
875 if ( ((barcodeList!=0) && (barcodeList->find(
HepMC::barcode(
p)) != barcodeList->end())) ||
887 if (statusHighlighting) {
◆ pdt()
const HepPDT::ParticleDataTable& GenBase::pdt |
( |
| ) |
const |
|
inlineinherited |
Shorter alias to get a particle data table.
Definition at line 123 of file GenBase.h.
◆ printHepMC()
void EvtInclusiveDecay::printHepMC |
( |
HepMC::GenEvent * |
hepMC, |
|
|
std::set< int > * |
barcodeList = nullptr |
|
) |
| |
|
private |
Definition at line 741 of file EvtInclusiveDecay.cxx.
742 std::set<HepMC::GenVertexPtr> visited;
743 unsigned int nParticlesFound = 0;
744 unsigned int nTreesFound = 0;
745 for (HepMC::GenEvent::particle_iterator
itp = hepMC->particles_begin();
itp != hepMC->particles_end(); ++
itp) {
747 if ( (!
p->production_vertex()) ||
748 (
p->production_vertex()->particles_in_size() == 0) ) {
750 std::cout <<
"\n Found new partial decay tree:\n" << std::endl;
751 unsigned int nParticlesVisited =
printTree(
p,visited,1,barcodeList);
752 std::cout <<
"\n " << nParticlesVisited <<
" particles in this subtree" << std::endl;
753 nParticlesFound += nParticlesVisited;
756 std::cout <<
"\n Total of " << nParticlesFound <<
" particles found in "
757 << nTreesFound <<
" decay subtrees in HepMC event record\n" << std::endl;
◆ printTree()
Definition at line 791 of file EvtInclusiveDecay.cxx.
793 unsigned int nParticlesVisited = 1;
794 for (
int i=0;
i<
level;
i++) std::cout <<
" ";
796 auto v =
p->end_vertex();
799 if (
v->particles_in().size() > 1)
800 std::cout <<
" [interaction: " <<
v->particles_in().size() <<
" particles, vertex " <<
v <<
"] --> ";
802 std::cout <<
" --> ";
803 if (visited.insert(
v).second) {
804 for (
auto itp:
v->particles_out()) {
807 std::cout << std::endl;
808 for (
auto itp:
v->particles_out()) {
809 if (
itp->end_vertex())
815 std:: cout <<
"see above" << std::endl;
817 std::cout <<
" no decay vertex\n" << std::endl;
820 if (
v->particles_in_size() > 1)
821 std::cout <<
" [interaction: " <<
v->particles_in_size() <<
" particles, vertex " <<
v <<
"] --> ";
823 std::cout <<
" --> ";
824 if (visited.insert(
v).second) {
830 std::cout << std::endl;
834 if ((*itp)->end_vertex())
840 std:: cout <<
"see above" << std::endl;
842 std::cout <<
" no decay vertex\n" << std::endl;
844 return nParticlesVisited;
◆ removeDecayTree()
Definition at line 449 of file EvtInclusiveDecay.cxx.
450 auto v =
p->end_vertex();
454 hepMC->remove_vertex(
v);
458 std::set<int> vtxBarCodesToDelete;
459 vtxBarCodesToDelete.insert(
v->barcode());
460 for (HepMC::GenVertex::vertex_iterator itv =
v->vertices_begin(HepMC::descendants);
461 itv !=
v->vertices_end(HepMC::descendants);
463 vtxBarCodesToDelete.insert((*itv)->barcode());
465 auto vdel = hepMC->barcode_to_vertex(*itb);
466 hepMC->remove_vertex(vdel);
471 <<
" decay tree with " << vtxBarCodesToDelete.size() <<
" vertices");
◆ renounce()
◆ renounceArray()
◆ reseedRandomEngine()
void EvtInclusiveDecay::reseedRandomEngine |
( |
const std::string & |
streamName, |
|
|
const EventContext & |
ctx |
|
) |
| |
|
private |
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ traverseDecayTree()
Definition at line 391 of file EvtInclusiveDecay.cxx.
397 if (!isToBeRemoved) {
400 toBeDecayed.insert(
p);
404 isToBeRemoved =
true;
414 auto v =
p->end_vertex();
417 if (visited.insert(
v).second) {
419 ATH_MSG_WARNING(
"Found particle to be decayed with vertex with >1 incoming mother particles in decay tree");
422 for (
auto itp:
v->particles_out()) {
429 if (visited.insert(
v).second) {
432 ATH_MSG_WARNING(
"Found particle to be decayed with vertex with >1 incoming mother particles in decay tree");
441 return StatusCode::SUCCESS;
◆ updateVHKA()
◆ xmlpath()
std::string EvtInclusiveDecay::xmlpath |
( |
void |
| ) |
|
Definition at line 920 of file EvtInclusiveDecay.cxx.
922 char *cmtpath =
getenv(
"CMTPATH");
923 char *cmtconfig =
getenv(
"CMTCONFIG");
925 std::string foundpath =
"";
927 if(cmtpath != 0 && cmtconfig != 0){
929 std::vector<std::string> cmtpaths;
930 local_split(cmtpaths, cmtpath,
':');
932 std::string
installPath =
"/InstallArea/" + std::string(cmtconfig) +
"/share/Pythia8/xmldoc";
934 for(std::vector<std::string>::const_iterator
path = cmtpaths.begin();
935 path != cmtpaths.end() && foundpath ==
""; ++
path){
937 std::ifstream
testFile(testPath.c_str());
938 if(
testFile.good()) foundpath = testPath;
◆ m_allowAllKnownDecays
bool EvtInclusiveDecay::m_allowAllKnownDecays |
|
private |
◆ m_allowDefaultBDecays
bool EvtInclusiveDecay::m_allowDefaultBDecays |
|
private |
◆ m_applyUserSelection
bool EvtInclusiveDecay::m_applyUserSelection |
|
private |
◆ m_blackList
std::vector<int> EvtInclusiveDecay::m_blackList |
|
private |
◆ m_blackListSet
std::set<int> EvtInclusiveDecay::m_blackListSet |
|
private |
◆ m_checkDecayChannels
bool EvtInclusiveDecay::m_checkDecayChannels |
|
private |
◆ m_checkDecayTree
bool EvtInclusiveDecay::m_checkDecayTree |
|
private |
◆ m_decayFile
std::string EvtInclusiveDecay::m_decayFile |
|
private |
◆ m_detStore
◆ m_dsid
IntegerProperty EvtInclusiveDecay::m_dsid {this, "Dsid", 999999} |
|
private |
◆ m_evtAtRndmGen
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_inputKeyName
std::string EvtInclusiveDecay::m_inputKeyName |
|
private |
◆ m_isfHerwig
bool EvtInclusiveDecay::m_isfHerwig |
|
private |
◆ m_maxNRepeatedDecays
int EvtInclusiveDecay::m_maxNRepeatedDecays |
|
private |
◆ m_mcEventKey
std::string GenBase::m_mcEventKey {} |
|
protectedinherited |
StoreGate key for the MC event collection (defaults to GEN_EVENT)
Definition at line 137 of file GenBase.h.
◆ m_mcevents_const
Const handle to the MC event collection.
Definition at line 163 of file GenBase.h.
◆ m_mcEvtColl
◆ m_mkMcEvent
BooleanProperty GenBase::m_mkMcEvent {this, "MakeMcEvent", false, "Create a new MC event collection if it doesn't exist"} |
|
protectedinherited |
Flag to determine if a new MC event collection should be made if it doesn't exist.
Definition at line 139 of file GenBase.h.
◆ m_myEvtGen
EvtGen* EvtInclusiveDecay::m_myEvtGen {} |
|
private |
◆ m_noDecayChannels
std::map<int,long> EvtInclusiveDecay::m_noDecayChannels |
|
private |
◆ m_nRepeatedDecays
int EvtInclusiveDecay::m_nRepeatedDecays |
|
private |
◆ m_outputKeyName
std::string EvtInclusiveDecay::m_outputKeyName |
|
private |
◆ m_pdtFile
std::string EvtInclusiveDecay::m_pdtFile |
|
private |
◆ m_ppSvc
ServiceHandle<IPartPropSvc> GenBase::m_ppSvc {this, "PartPropSvc", "PartPropSvc"} |
|
privateinherited |
Handle on the particle property service.
Definition at line 160 of file GenBase.h.
◆ m_printHepMCAfterEvtGen
bool EvtInclusiveDecay::m_printHepMCAfterEvtGen |
|
private |
◆ m_printHepMCBeforeEvtGen
bool EvtInclusiveDecay::m_printHepMCBeforeEvtGen |
|
private |
◆ m_printHepMCHighlighted
bool EvtInclusiveDecay::m_printHepMCHighlighted |
|
private |
◆ m_printHepMCHighLightTopLevelDecays
bool EvtInclusiveDecay::m_printHepMCHighLightTopLevelDecays |
|
private |
◆ m_prohibitFinalStateDecay
bool EvtInclusiveDecay::m_prohibitFinalStateDecay |
|
private |
◆ m_prohibitReDecay
bool EvtInclusiveDecay::m_prohibitReDecay |
|
private |
◆ m_prohibitRemoveSelfDecay
bool EvtInclusiveDecay::m_prohibitRemoveSelfDecay |
|
private |
◆ m_prohibitUnDecay
bool EvtInclusiveDecay::m_prohibitUnDecay |
|
private |
◆ m_randomSeed
IntegerProperty EvtInclusiveDecay::m_randomSeed {this, "RandomSeed", 1234567, "Random seed for the built-in random engine"} |
|
private |
◆ m_randomStreamName
std::string EvtInclusiveDecay::m_randomStreamName |
|
private |
◆ m_readExisting
bool EvtInclusiveDecay::m_readExisting |
|
private |
◆ m_rndmSvc
◆ m_setVMtransversePol
bool EvtInclusiveDecay::m_setVMtransversePol |
|
private |
◆ m_userDecayFile
std::string EvtInclusiveDecay::m_userDecayFile |
|
private |
◆ m_userSelMaxDimuMass
double EvtInclusiveDecay::m_userSelMaxDimuMass |
|
private |
◆ m_userSelMinDimuMass
double EvtInclusiveDecay::m_userSelMinDimuMass |
|
private |
◆ m_userSelMu1MaxEta
double EvtInclusiveDecay::m_userSelMu1MaxEta |
|
private |
◆ m_userSelMu1MinPt
double EvtInclusiveDecay::m_userSelMu1MinPt |
|
private |
◆ m_userSelMu2MaxEta
double EvtInclusiveDecay::m_userSelMu2MaxEta |
|
private |
◆ m_userSelMu2MinPt
double EvtInclusiveDecay::m_userSelMu2MinPt |
|
private |
◆ m_userSelRequireOppositeSignedMu
bool EvtInclusiveDecay::m_userSelRequireOppositeSignedMu |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_whiteList
std::vector<int> EvtInclusiveDecay::m_whiteList |
|
private |
◆ m_whiteListSet
std::set<int> EvtInclusiveDecay::m_whiteListSet |
|
private |
The documentation for this class was generated from the following files:
HepMC::GenVertex * GenVertexPtr
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
bool isDefaultB(const int pId) const
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
std::string m_randomStreamName
bool m_allowDefaultBDecays
std::vector< int > m_whiteList
path
python interpreter configuration --------------------------------------—
bool m_allowAllKnownDecays
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
std::vector< int > m_blackList
double m_userSelMinDimuMass
std::map< int, long > m_noDecayChannels
const McEventCollection * events_const() const
Access the current event's McEventCollection (const)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::set< int > m_blackListSet
void reseedRandomEngine(const std::string &streamName, const EventContext &ctx)
void decayParticle(HepMC::GenEvent *hepMC, HepMC::GenParticlePtr p)
GenParticle * GenParticlePtr
bool passesUserSelection(HepMC::GenEvent *hepMC)
bool m_applyUserSelection
CLHEP::HepRandomEngine * getRandomEngineDuringInitialize(const std::string &streamName, unsigned long int randomSeedOffset, unsigned int conditionsRun=1, unsigned int lbn=1) const
std::string m_userDecayFile
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool isToBeDecayed(HepMC::ConstGenParticlePtr p, bool doCrossChecks)
bool m_printHepMCHighLightTopLevelDecays
double m_userSelMu2MaxEta
bool msgLvl(const MSG::Level lvl) const
EvtInclusiveAtRndmGen * m_evtAtRndmGen
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
void line(std::ostream &os, const GenEvent &e)
bool m_printHepMCHighlighted
void fillBarcodesAttribute(GenEvent *)
CLHEP::HepRandomEngine * getEngine()
bool m_printHepMCAfterEvtGen
void addEvtGenDecayTree(HepMC::GenEvent *hepMC, HepMC::GenParticlePtr part, EvtParticle *evtPart, EvtVector4R treeStart, double momentumScaleFactor=1.0)
virtual void setOwner(IDataHandleHolder *o)=0
std::string PathResolverFindCalibDirectory(const std::string &logical_file_name)
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
bool isPhysical(const T &p)
ServiceHandle< IPartPropSvc > m_ppSvc
Handle on the particle property service.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
constexpr int EVTGENUNDECAYEDSTATUS
std::string particleName(const G4Step *theStep)
TODO.
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
(Non-const) Iterator class for DataVector/DataList.
GenVertexPtr newGenVertexPtr(const HepMC::FourVector &pos=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), const int i=0)
double invMass(HepMC::ConstGenParticlePtr p1, HepMC::ConstGenParticlePtr p2)
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, unsigned long int randomSeedOffset, const EventContext &ctx) const
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadHandleKey< McEventCollection > m_mcevents_const
Const handle to the MC event collection.
bool m_checkDecayChannels
void removeDecayTree(HepMC::GenEvent *hepMC, HepMC::GenParticlePtr p)
double m_userSelMu1MaxEta
#define CHECK(...)
Evaluate an expression and check for errors.
StatusCode traverseDecayTree(HepMC::GenParticlePtr p, bool isToBeRemoved, std::set< HepMC::GenVertexPtr > &visited, std::set< int > &toBeDecayed)
IntegerProperty m_randomSeed
Seed for random number engine.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
void printHepMC(HepMC::GenEvent *hepMC, std::set< int > *barcodeList=nullptr)
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
bool m_userSelRequireOppositeSignedMu
virtual void renounce()=0
const HepPDT::ParticleDataTable & particleTable() const
Get a particle data table.
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
unsigned int printTree(HepMC::GenParticlePtr p, std::set< HepMC::GenVertexPtr > &visited, int level, std::set< int > *barcodeList=0)
A wrapper class for event-slot-local random engines.
bool m_prohibitFinalStateDecay
std::string pdgName(HepMC::ConstGenParticlePtr p, bool statusHighlighting=false, std::set< int > *barcodeList=nullptr)
bool m_prohibitRemoveSelfDecay
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
ServiceHandle< IAthRNGSvc > m_rndmSvc
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
McEventCollection * m_mcEvtColl
DataObjIDColl m_extendedExtraObjects
bool isStable(const T &p)
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
std::string getenv(const std::string &variableName)
get an environment variable
#define ATH_MSG_WARNING(x)
std::string xmlpath(void)
bool isDecayed(const T &p)
const HepPDT::ParticleDataTable & pdt() const
Shorter alias to get a particle data table.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
void calculateSeedsMC21(long *seeds, const std::string &algName, uint64_t ev, uint64_t run, uint64_t offset=0)
Set the random seed using a string (e.g.
bool m_setVMtransversePol
bool m_printHepMCBeforeEvtGen
std::string m_outputKeyName
GenBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
double m_userSelMaxDimuMass
std::string m_inputKeyName
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
void setExtendedEventContext(EventContext &ctx, ExtendedEventContext &&ectx)
Move an extended context into a context object.
virtual StatusCode initialize() override
std::set< int > m_whiteListSet
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.