// %%%%%%%%%% // G4 headers // %%%%%%%%%% #include "G4UnitsTable.hh" // %%%%%%%%%%%%% // gemc headers // %%%%%%%%%%%%% #include "OTOF_hitprocess.h" PH_output OTOF_HitProcess :: ProcessHit(MHit* aHit, gemc_opts) { PH_output out; out.identity = aHit->GetId(); HCname = "OTOF 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 // %%%%%%%%%%%% // Get the paddle length: in TOF paddles are boxes, it's the x double length = aHit->GetDetector().dimensions[0]; // Distances from left, right double dLeft = length + lx; double dRight = length - lx; // dummy formulas for now, parameters could come from DB int ADCL = (int) (100*Etot*exp(-dLeft/length/2 )); int ADCR = (int) (100*Etot*exp(-dRight/length/2 )); // speed of light is 30 cm/s int TDCL = (int) (100*(time/ns + dLeft/cm/30.0)); int TDCR = (int) (100*(time/ns + dRight/cm/30.0)); out.dgtz.push_back(ADCL); out.dgtz.push_back(ADCR); out.dgtz.push_back(TDCL); out.dgtz.push_back(TDCR); return out; } vector OTOF_HitProcess :: ProcessID(vector id, G4Step* aStep, detector Detector) { return id; }