// %%%%%%%%%% // G4 headers // %%%%%%%%%% #include "G4UnitsTable.hh" // %%%%%%%%%%%% // gemc headers // %%%%%%%%%%%% #include "detector.h" #include "identifier.h" // %%%%%%%%%%% // C++ headers // %%%%%%%%%%% #include using namespace std; bool identifier::operator == (const identifier& I) const { if(I.name == this->name && I.rule == this->rule && I.id == this->id && fabs(I.time - this->time) <= this->TimeWindow) return true; else return false; } bool identifier::operator < (const identifier& I) const { if(this->name == I.name) if(this->id < I.id) return true; if(this->time < I.time) return true; return false; } bool identifier::operator > (const identifier& I) const { if(this->name == I.name) if(this->id > I.id) return true; if(this->time > I.time) return true; return false; } ostream &operator<<(ostream &stream, vector Iden) { for(int i=0; i vector set_IDshifts(vector maxs) { vector y; int max; for(int i=0; i SetId(vector Iden, G4VTouchable* TH, double time, double TimeWindow) { vector identity = Iden; // Look for "ncopy" flag, set to volume copy number for(int i=0; i GetHistoryDepth(); h++) { string pname = TH->GetVolume(h)->GetName(); int pcopy = TH->GetVolume(h)->GetCopyNo(); if(pname.find(identity[i].name) != string::npos) identity[i].id = pcopy; } } // Make sure id is not still zero if(identity[i].id == 0) { cout << " Something is wrong. Identity not completely set." << endl; cout << identity; cout << " Exiting. " << endl; exit(0); } identity[i].time = time; identity[i].TimeWindow = TimeWindow; } return identity; }