3 #include "HEPEVT_struct.h"
4 #include "PhotosParticle.h"
5 #include "PhotosBranch.h"
25 }
else if (
daughters.at(0)->getMothers().size() == 1) {
29 mothers = p->findProductionMothers();
51 if (
suppression) Log::Warning() <<
"Branching ignored due to 4-momentum non conservation" << endl;
64 0)->getBarcode() : -1)) << endl;
80 vector<PhotosParticle*> ret =
mothers;
89 if (
mothers.size() > 0)
return mothers.at(0)->checkMomentumConservation();
95 Log::Debug(700) <<
"PhotosBranch::createBranches - filtering started" << endl;
96 list<PhotosParticle*> list(particles.begin(), particles.end());
97 vector<PhotosBranch*> branches;
101 std::list<PhotosParticle*>::iterator it;
102 for (it = list.begin(); it != list.end(); it++) {
106 Log::Debug(701) <<
" Forced: " << (*it)->getPdgID() <<
" (barcode: " << (*it)->getBarcode() <<
") with forcing status= "
109 branches.push_back(branch);
113 if (forcing_local == 2) {
119 vector<PhotosParticle*> tree = p->getDecayTree();
121 std::list<PhotosParticle*>::iterator it2;
122 for (it2 = list.begin(); it2 != list.end(); it2++) {
123 for (
int i = 0; i < (int)tree.size(); i++) {
124 if (tree.at(i)->getBarcode() == (*it2)->getBarcode()) {
126 branches.push_back(b);
129 it2 = list.erase(it2);
136 }
else delete branch;
142 while (!list.empty()) {
145 if (!particle_local)
continue;
149 if (!suppression_local) branches.push_back(branch);
152 ") with suppression status= " << suppression_local << endl;
154 if (suppression_local == 2) {
160 vector<PhotosParticle*> tree = p->getDecayTree();
162 std::list<PhotosParticle*>::iterator it;
163 for (it = list.begin(); it != list.end(); it++) {
164 for (
int i = 0; i < (int)tree.size(); i++) {
165 if (tree.at(i)->getBarcode() == (*it)->getBarcode()) {
179 vector<PhotosParticle*> mothers_local = branch->
getMothers();
180 for (
int i = 0; i < (int)mothers_local.size(); i++) {
182 if (m->getBarcode() == particle_local->
getBarcode())
continue;
183 std::list<PhotosParticle*>::iterator it;
184 for (it = list.begin(); it != list.end(); it++)
185 if (m->getBarcode() == (*it)->getBarcode()) {
204 if (
mothers.size() == 0)
return 0;
205 motherID =
mothers.at(0)->getPdgID();
210 for (
int j = 0; j < (int)
daughters.size(); j++) dID.push_back(
daughters[j]->getPdgID());
212 vector< vector<int> *>& patternList = *list;
215 for (
int j = 0; j < (int)patternList.size(); j++) {
217 if (motherID != (*patternList[j])[0])
continue;
220 vector<int>& pattern = *patternList[j];
221 bool fullMatch =
true;
222 for (
int k = 1; k < (int)pattern.size() - 1; k++) {
223 bool oneMatch =
false;
224 for (
int l = 0; l < (int)dID.size(); l++)
225 if (pattern[k] == dID[l]) { oneMatch =
true;
break; }
226 if (!oneMatch) { fullMatch =
false;
break; }
236 if (pattern.size() <= 2 || fullMatch)
237 return (pattern.back() == 1) ? 2 : 1;
static void complete()
Finalize processing.
static void prepare()
Prepare particles for processing.
static void get()
Update event record with data from HEPEVT.
static int set(PhotosBranch *branch)
Convert PhotosBranch to HEPEVT.
static ostream & Debug(unsigned short int code=0, bool count=true)
Four logging entries.
static vector< PhotosBranch * > createBranches(vector< PhotosParticle * > particles)
Create branches from particles list.
bool checkMomentumConservation()
Checks momentum conservation of decaying particle.
void process()
Process single branch.
PhotosParticle * getDecayingParticle()
Return decaying particle.
int checkSuppressionLevel()
Checks if branching is suppressed by PHOTOS.
int checkList(bool forceOrSuppress)
Algorithm used for suppression/forcing check.
int checkForcingLevel()
Checks if branching is forced by PHOTOS.
vector< PhotosParticle * > getMothers()
Get list of mothers.
vector< PhotosParticle * > daughters
List of daughters.
int getForcingStatus()
Check if branch is forced.
int getSuppressionStatus()
Check if branch is suppressed.
int forcing
State of branching forcing.
PhotosParticle * particle
Decaying particle.
vector< PhotosParticle * > getParticles()
Get list of all particles used by branch.
vector< PhotosParticle * > mothers
List of mothers
int suppression
State of branching suppression.
PhotosBranch(PhotosParticle *p)
Create branch out of decaying particle.
virtual bool checkMomentumConservation()=0
check that the 4 momentum in conserved at the vertices producing and ending this particle
virtual int getBarcode()=0
Get the barcode of this particle.
virtual int getPdgID()=0
Get the PDG ID code of this particle.
static vector< vector< int > * > * supBremList
List of suppressed decays.
static vector< vector< int > * > * forceBremList
List of forced decays.
static bool isSuppressed
Is in suppressed mode.