|
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 56 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 528 of file EvtInclusiveDecay.cxx.
530 if(evtPart->getNDaug()!=0) {
532 double ct=(evtPart->getDaug(0)->get4Pos()).
get(0)+treeStart.get(0);
533 double x=(evtPart->getDaug(0)->get4Pos()).
get(1)+treeStart.get(1);
534 double y=(evtPart->getDaug(0)->get4Pos()).
get(2)+treeStart.get(2);
535 double z=(evtPart->getDaug(0)->get4Pos()).
get(3)+treeStart.get(3);
539 hepMC->add_vertex(end_vtx);
540 end_vtx->add_particle_in(
part);
543 for(
uint it=0;
it<evtPart->getNDaug();
it++) {
544 double e=(evtPart->getDaug(
it)->getP4Lab()).
get(0) * momentumScaleFactor;
545 double px=(evtPart->getDaug(
it)->getP4Lab()).
get(1) * momentumScaleFactor;
546 double py=(evtPart->getDaug(
it)->getP4Lab()).
get(2) * momentumScaleFactor;
547 double pz=(evtPart->getDaug(
it)->getP4Lab()).
get(3) * momentumScaleFactor;
548 int id=EvtPDL::getStdHep(evtPart->getDaug(
it)->getId());
550 if(evtPart->getDaug(
it)->getNDaug() != 0)
status=2;
552 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 78 of file GenBase.cxx.
79 for (HepMC::GenEvent::vertex_iterator vtx =
evt->vertices_begin(); vtx !=
evt->vertices_end(); ++vtx) {
80 const HepMC::FourVector fv((*vtx)->position().x() * 10,
81 (*vtx)->position().y() * 10,
82 (*vtx)->position().z() * 10,
83 (*vtx)->position().t() * 10);
84 (*vtx)->set_position(fv);
◆ decayParticle()
Definition at line 490 of file EvtInclusiveDecay.cxx.
500 int id =
part->pdg_id();
501 EvtId evtId=EvtPDL::evtIdFromStdHep(
id);
502 double en =(
part->momentum()).
e()/1000.;
503 double px=(
part->momentum()).
px()/1000.;
504 double py=(
part->momentum()).
py()/1000.;
505 double pz=(
part->momentum()).
pz()/1000.;
507 EvtParticle* evtPart = EvtParticleFactory::particleFactory(evtId,evtP);
510 if(
m_setVMtransversePol && (
id==113 ||
id== 443 ||
id==100443 ||
id==553 ||
id==100553 ||
id==200553) )evtPart->setVectorSpinDensity();
514 double ct_s =
part->production_vertex()->position().t();
515 double x_s =
part->production_vertex()->position().x();
516 double y_s =
part->production_vertex()->position().y();
517 double z_s =
part->production_vertex()->position().z();
519 EvtVector4R treeStart(ct_s,x_s,y_s,z_s);
522 if(evtPart->getNDaug() !=0)
part->set_status(2);
523 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);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ 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 217 of file EvtInclusiveDecay.cxx.
220 const EventContext& ctx = Gaudi::Hive::currentContext();
244 HepMC::GenEvent* hepMC = *mcItr;
249 std::set<HepMC::GenVertexPtr> visited;
251 std::set<HepMC::GenParticlePtr> toBeDecayed;
252 for (
auto p: hepMC->particles()) {
253 if ( (!
p->production_vertex()) ||
254 (
p->production_vertex()->particles_in().size() == 0) ) {
257 return StatusCode::FAILURE;
262 msg(MSG::INFO) <<
"Printing HepMC record at " << hepMC <<
" BEFORE running EvtGen:" <<
endmsg;
269 std::set<int> toBeDecayed;
270 for (HepMC::GenEvent::particle_iterator
itp = hepMC->particles_begin();
itp != hepMC->particles_end(); ++
itp) {
272 if ( (!
p->production_vertex()) ||
273 (
p->production_vertex()->particles_in_size() == 0) ) {
276 return StatusCode::FAILURE;
281 msg(MSG::INFO) <<
"Printing HepMC record at " << hepMC <<
" BEFORE running EvtGen:" <<
endmsg;
290 bool eventPassesCuts(
false);
294 for (
auto p: toBeDecayed) {
296 msg(MSG::ERROR ) <<
"Overlapping decay tree for particle" <<
p <<
endmsg;
297 return StatusCode::FAILURE;
304 auto p = hepMC->barcode_to_particle(*itb);
306 msg(MSG::ERROR ) <<
"Overlapping decay tree encountered for barcode " << *itb <<
endmsg;
307 return StatusCode::FAILURE;
317 eventPassesCuts =
true;
326 hepMC->weight(
"nEvtGenDecayAttempts") = loopCounter;
329 hepMC->weights()[
"nEvtGenDecayAttempts"] = loopCounter;
333 msg(MSG::INFO) <<
"Printing HepMC record at " << hepMC <<
" AFTER running EvtGen:" <<
endmsg;
345 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 349 of file EvtInclusiveDecay.cxx.
352 ATH_MSG_INFO(
"The following particles were checked and didn't have any decay channels:");
354 std::cout << std::endl;
355 std::cout <<
" Particle code Name from HepPDT # Occurences" << std::endl;
356 std::cout <<
"------------------------------------------------------" << std::endl;
360 std::cout << std::setw(14) <<
id
362 << std::setw(20) <<
count
365 std::cout << std::endl;
370 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 200 of file EvtInclusiveDecay.cxx.
205 ctx.setEventID (EventIDBase (conditionsRun,
206 EventIDBase::UNDEFEVT,
207 EventIDBase::UNDEFNUM,
208 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 58 of file GenBase.cxx.
59 for (HepMC::GenEvent::particle_iterator
p =
evt->particles_begin();
p !=
evt->particles_end(); ++
p) {
60 const HepMC::FourVector fv((*p)->momentum().px() * 1000,
61 (*p)->momentum().py() * 1000,
62 (*p)->momentum().pz() * 1000,
63 (*p)->momentum().e() * 1000);
64 (*p)->set_momentum(fv);
65 (*p)->set_generated_mass(1000 * (*p)->generated_mass());
◆ initialize()
StatusCode EvtInclusiveDecay::initialize |
( |
| ) |
|
|
virtual |
Reimplemented from GenBase.
Definition at line 118 of file EvtInclusiveDecay.cxx.
124 msg(MSG::INFO) <<
"EvtInclusiveDecay initialize" <<
endmsg;
129 msg(MSG::INFO) <<
"EvtInclusiveDecay selection parameters:" <<
endmsg;
136 msg(MSG::INFO) <<
"User selection parameters:" <<
endmsg;
148 msg(MSG::INFO) <<
"* blackList; = ";
150 msg(MSG::INFO) << (*i) <<
" ";
155 msg(MSG::INFO) <<
"* whiteList = ";
157 msg(MSG::INFO) << (*i) <<
" ";
165 EvtExternalGenList genList(
true,
xmlpath(),
"gamma");
166 EvtAbsRadCorr* radCorrEngine = genList.getPhotosModel();
167 std::list<EvtDecayBase*> extraModels = genList.getListOfModels();
178 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 695 of file EvtInclusiveDecay.cxx.
696 double p1Px =
p1->momentum().px();
697 double p1Py =
p1->momentum().py();
698 double p1Pz =
p1->momentum().pz();
699 double p1E =
p1->momentum().e();
700 double p2Px =
p2->momentum().px();
701 double p2Py =
p2->momentum().py();
702 double p2Pz =
p2->momentum().pz();
703 double p2E =
p2->momentum().e();
704 double dimuE = p2E + p1E;
705 double dimuPx = p2Px + p1Px;
706 double dimuPy = p2Py + p1Py;
707 double dimuPz = p2Pz + p1Pz;
708 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 566 of file EvtInclusiveDecay.cxx.
567 int id =
p->pdg_id();
569 auto v =
p->end_vertex();
570 if (
v) nDaughters =
v->particles_out_size();
573 if (
p->status() == 3)
return false;
579 double m2 =
p->momentum().m2();
586 EvtId evtId = EvtPDL::evtIdFromStdHep(
id);
589 if (evtId.getId()>=0)
591 nModes = EvtDecayTable::getInstance()->getNMode(evtId.getAlias());
594 <<
" (status = " <<
p->status()
595 <<
") -- " << nModes <<
" decay modes found");
613 for (
auto itd:
v->particles_out()) {
614 if (std::abs(itd->pdg_id()) == std::abs(
id))
return false;
617 for (HepMC::GenVertex::particle_iterator itd =
v->particles_begin(
HepMC::children);
620 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 68 of file GenBase.cxx.
69 for (HepMC::GenEvent::particle_iterator
p =
evt->particles_begin();
p !=
evt->particles_end(); ++
p) {
70 const HepMC::FourVector fv((*p)->momentum().px() / 1000,
71 (*p)->momentum().py() / 1000,
72 (*p)->momentum().pz() / 1000,
73 (*p)->momentum().e() / 1000);
74 (*p)->set_momentum(fv);
75 (*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 87 of file GenBase.cxx.
88 for (HepMC::GenEvent::vertex_iterator vtx =
evt->vertices_begin(); vtx !=
evt->vertices_end(); ++vtx) {
89 const HepMC::FourVector fv((*vtx)->position().x() / 10,
90 (*vtx)->position().y() / 10,
91 (*vtx)->position().z() / 10,
92 (*vtx)->position().t() / 10);
93 (*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 665 of file EvtInclusiveDecay.cxx.
667 std::vector<HepMC::GenParticlePtr> *muons =
new std::vector<HepMC::GenParticlePtr>;
669 for (
const auto&
p: *hepMC) {
670 if( std::abs(
p->pdg_id()) == 13 )
674 for (
auto muItr1 = muons->begin(); muItr1 != muons->end(); ++muItr1) {
675 for (
auto muItr2 = muItr1+1; muItr2 != muons->end(); ++muItr2) {
683 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 845 of file EvtInclusiveDecay.cxx.
846 std::ostringstream
buf;
847 if (statusHighlighting) {
848 if ( ((barcodeList!=0) && (barcodeList->find(
HepMC::barcode(
p)) != barcodeList->end())) ||
860 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 737 of file EvtInclusiveDecay.cxx.
738 std::set<HepMC::GenVertexPtr> visited;
739 unsigned int nParticlesFound = 0;
740 unsigned int nTreesFound = 0;
741 for (HepMC::GenEvent::particle_iterator
itp = hepMC->particles_begin();
itp != hepMC->particles_end(); ++
itp) {
743 if ( (!
p->production_vertex()) ||
744 (
p->production_vertex()->particles_in_size() == 0) ) {
746 std::cout <<
"\n Found new partial decay tree:\n" << std::endl;
747 unsigned int nParticlesVisited =
printTree(
p,visited,1,barcodeList);
748 std::cout <<
"\n " << nParticlesVisited <<
" particles in this subtree" << std::endl;
749 nParticlesFound += nParticlesVisited;
752 std::cout <<
"\n Total of " << nParticlesFound <<
" particles found in "
753 << nTreesFound <<
" decay subtrees in HepMC event record\n" << std::endl;
◆ printTree()
Definition at line 787 of file EvtInclusiveDecay.cxx.
789 unsigned int nParticlesVisited = 1;
790 for (
int i=0;
i<
level;
i++) std::cout <<
" ";
792 auto v =
p->end_vertex();
794 if (
v->particles_in_size() > 1)
795 std::cout <<
" [interaction: " <<
v->particles_in_size() <<
" particles, vertex " <<
v <<
"] --> ";
797 std::cout <<
" --> ";
798 if (visited.insert(
v).second) {
804 std::cout << std::endl;
808 if ((*itp)->end_vertex())
814 std:: cout <<
"see above" << std::endl;
816 std::cout <<
" no decay vertex\n" << std::endl;
817 return nParticlesVisited;
◆ removeDecayTree()
Definition at line 446 of file EvtInclusiveDecay.cxx.
447 auto v =
p->end_vertex();
451 hepMC->remove_vertex(
v);
455 std::set<int> vtxBarCodesToDelete;
456 vtxBarCodesToDelete.insert(
v->barcode());
457 for (HepMC::GenVertex::vertex_iterator itv =
v->vertices_begin(HepMC::descendants);
458 itv !=
v->vertices_end(HepMC::descendants);
460 vtxBarCodesToDelete.insert((*itv)->barcode());
462 auto vdel = hepMC->barcode_to_vertex(*itb);
463 hepMC->remove_vertex(vdel);
468 <<
" 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 388 of file EvtInclusiveDecay.cxx.
394 if (!isToBeRemoved) {
397 toBeDecayed.insert(
p);
401 isToBeRemoved =
true;
411 auto v =
p->end_vertex();
414 if (visited.insert(
v).second) {
416 ATH_MSG_WARNING(
"Found particle to be decayed with vertex with >1 incoming mother particles in decay tree");
419 for (
auto itp:
v->particles_out()) {
426 if (visited.insert(
v).second) {
429 ATH_MSG_WARNING(
"Found particle to be decayed with vertex with >1 incoming mother particles in decay tree");
438 return StatusCode::SUCCESS;
◆ updateVHKA()
◆ xmlpath()
std::string EvtInclusiveDecay::xmlpath |
( |
void |
| ) |
|
◆ 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
bool m_allowAllKnownDecays
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
const_pointer_type cptr()
Dereference the pointer.
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)
Identify if the particle is physical, i.e. is stable or decayed.
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.
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.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
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)
Identify if the particle is stable, i.e. has not decayed.
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
#define ATH_MSG_WARNING(x)
std::string xmlpath(void)
bool isDecayed(const T &p)
Identify if the particle decayed.
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.