// %%%%%%%%%%%% // gemc headers // %%%%%%%%%%%% #include "BST_hitprocess.h" #include "bst_strip.h" PH_output BST_HitProcess :: ProcessHit(MHit* aHit, gemc_opts Opt) { string hd_msg = Opt.args["LOG_MSG"].args + " BST Hit Process " ; double HIT_VERBOSITY = Opt.args["HIT_VERBOSITY"].arg; PH_output out; out.identity = aHit->GetId(); HCname = "BST Hit Process"; // %%%%%%%%%%%%%%%%%%% // Raw hit information // %%%%%%%%%%%%%%%%%%% int nsteps = aHit->GetPos().size(); // Get Total Energy deposited double Etot = 0; vector Edep = aHit->GetEdep(); for(int s=0; s pos = aHit->GetPos(); vector Lpos = aHit->GetLPos(); if(Etot>0) for(int s=0; s times = aHit->GetTime(); for(int s=0; sGetE(); out.raws.push_back(Etot); out.raws.push_back(x); out.raws.push_back(y); out.raws.push_back(z); out.raws.push_back(lx); out.raws.push_back(ly); out.raws.push_back(lz); out.raws.push_back(time); out.raws.push_back((double) aHit->GetPID()); out.raws.push_back(aHit->GetVert().getX()); out.raws.push_back(aHit->GetVert().getY()); out.raws.push_back(aHit->GetVert().getZ()); out.raws.push_back(Ene); out.raws.push_back((double) aHit->GetmPID()); out.raws.push_back(aHit->GetmVert().getX()); out.raws.push_back(aHit->GetmVert().getY()); out.raws.push_back(aHit->GetmVert().getZ()); // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // Digitization // BST ID: // layer, type, sector, module, strip // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% class bst_strip bsts; bsts.fill_infos(); // double checking dimensions double CardLength = 2.0*aHit->GetDetector().dimensions[2]/mm; // length of 1 card double CardWidth = 2.0*aHit->GetDetector().dimensions[0]/mm; // width 1 card if(CardLength != bsts.CardLength || CardWidth != bsts.CardWidth) cout << hd_msg << " Warning: dimensions mismatch between card reconstruction dimensions and gemc card dimensions." << endl << endl; int layer = 2*out.identity[0].id + out.identity[1].id - 2 ; int sector = out.identity[2].id; int card = out.identity[3].id; int strip = out.identity[4].id; if(HIT_VERBOSITY>4) cout << hd_msg << " layer: " << layer << " sector: " << sector << " Card: " << card << " Strip: " << strip << " x=" << x << " y=" << y << " z=" << z << endl; out.dgtz.push_back(layer); out.dgtz.push_back(sector); out.dgtz.push_back(strip); return out; } vector BST_HitProcess :: ProcessID(vector id, G4Step* aStep, detector Detector) { vector yid = id; double x, y, z; G4ThreeVector xyz = aStep->GetPostStepPoint()->GetPosition(); x = xyz.x()/mm; y = xyz.y()/mm; z = xyz.z()/mm; class bst_strip bsts; bsts.fill_infos(); int layer = 2*yid[0].id + yid[1].id - 2 ; int sector = yid[2].id; yid[4].id = bsts.FindStrip(layer-1, sector-1, x, y, z); return yid; }