This routine will be called when the appropriate signal arrives.
794 iev = (*evt)()->GetEventID();
795 std::cout <<
"FP420Test:update EndOfEvent = " <<
iev << std::endl;
802 G4PrimaryParticle* thePrim =
nullptr;
805 G4int nvertex = (*evt)()->GetNumberOfPrimaryVertex();
807 std::cout <<
"FP420Test: My warning: NumberOfPrimaryVertex != 1 --> = " << nvertex << std::endl;
809 for (
int i = 0;
i < nvertex;
i++) {
810 G4PrimaryVertex* avertex = (*evt)()->GetPrimaryVertex(
i);
811 if (avertex ==
nullptr)
812 std::cout <<
"FP420Test End Of Event ERR: pointer to vertex = 0" << std::endl;
813 G4int
npart = avertex->GetNumberOfParticle();
815 std::cout <<
"FP420Test: My warning: NumberOfPrimaryPart != 1 --> = " <<
npart << std::endl;
817 std::cout <<
"FP420Test End Of Event ERR: no NumberOfParticle" << std::endl;
820 if (thePrim ==
nullptr)
821 thePrim = avertex->GetPrimary(trackID);
823 if (thePrim !=
nullptr) {
825 G4double vx = 0., vy = 0., vz = 0.;
826 vx = avertex->GetX0();
827 vy = avertex->GetY0();
828 vz = avertex->GetZ0();
840 if (thePrim !=
nullptr) {
862 G4ThreeVector mom = thePrim->GetMomentum();
864 double phi = atan2(mom.y(), mom.x());
867 double phigrad =
phi * 180. /
pi;
869 double th = mom.theta();
902 map<int, float, less<int> > themap;
903 map<int, float, less<int> > themap1;
905 map<int, float, less<int> > themapxy;
906 map<int, float, less<int> > themapz;
910 G4HCofThisEvent* allHC = (*evt)()->GetHCofThisEvent();
913 std::cout <<
"FP420Test: accessed all HC" << std::endl;
916 int CAFIid = G4SDManager::GetSDMpointer()->GetCollectionID(
"FP420SI");
924 std::cout <<
"FP420Test: theCAFI->entries = " << theCAFI->entries() << std::endl;
956 int nhits = theCAFI->entries();
959 G4ThreeVector hitPoint = aHit->
getEntry();
960 double zz = hitPoint.z();
974 int nhit11 = 0, nhit12 = 0, nhit13 = 0;
975 double totallosenergy = 0.;
981 G4ThreeVector hitPoint = aHit->
getEntry();
1016 double zz = hitPoint.z();
1021 std::cout <<
"FP420Test:zHits = " <<
zz << std::endl;
1032 themap[unitID] += losenergy;
1033 totallosenergy += losenergy;
1035 int det,
zside, sector, zmodule;
1039 if (justlayer < 1 || justlayer > 2) {
1040 std::cout <<
"FP420Test:WRONG justlayer= " << justlayer << std::endl;
1055 G4ThreeVector middle = (hitExitLocalPoint - hitEntryLocalPoint) / 2.;
1056 themapz[unitID] = hitPoint.z() + fabs(middle.z());
1058 std::cout <<
"1111111111111111111111111111111111111111111111111111111111111111111111111 " << std::endl;
1059 std::cout <<
"FP420Test: det, zside, sector, zmodule = " << det <<
zside << sector << zmodule << std::endl;
1060 std::cout <<
"FP420Test: justlayer = " << justlayer << std::endl;
1061 std::cout <<
"FP420Test: hitExitLocalPoint = " << hitExitLocalPoint << std::endl;
1062 std::cout <<
"FP420Test: hitEntryLocalPoint = " << hitEntryLocalPoint << std::endl;
1063 std::cout <<
"FP420Test: middle= " << middle << std::endl;
1064 std::cout <<
"FP420Test: hitPoint.z()-419000.= " << hitPoint.z() - 419000. << std::endl;
1066 std::cout <<
"FP420Test:zHits-419000. = " << themapz[unitID] - 419000. << std::endl;
1072 if (losenergy > 0.00003) {
1073 themap1[unitID] += 1.;
1079 if (losenergy > 0.00005) {
1080 themap1[unitID] += 1.;
1124 if (zz < z3 && zz >
z2) {
1129 if (zz < z4 && zz >
z3) {
1152 if (trackIDhit == 1) {
1161 if (zz < z3 && zz >
z2) {
1174 if (trackIDhit == 1) {
1182 if (zz < z4 && zz >
z3) {
1213 std::cout <<
"22222222222222222222222222222222222222222222222222222222222222222222222222 " << std::endl;
1216 int allplacesforsensors = 7;
1217 for (
int sector = 1; sector <
sn0; sector++) {
1218 for (
int zmodule = 1; zmodule <
pn0; zmodule++) {
1219 for (
int zsideinorder = 1; zsideinorder < allplacesforsensors; zsideinorder++) {
1222 std::cout <<
"FP420Test: sector= " << sector <<
" zmodule= " << zmodule
1223 <<
" zsideinorder= " << zsideinorder <<
" zside= " <<
zside << std::endl;
1227 if (justlayer < 1 || justlayer > 2) {
1228 std::cout <<
"FP420Test:WRONG justlayer= " << justlayer << std::endl;
1231 if (copyinlayer < 1 || copyinlayer > 3) {
1232 std::cout <<
"FP420Test:WRONG copyinlayer= " << copyinlayer << std::endl;
1235 if (orientation < 1 || orientation > 2) {
1236 std::cout <<
"FP420Test:WRONG orientation= " << orientation << std::endl;
1247 std::cout <<
"FP420Test: justlayer = " << justlayer <<
" copyinlayer = " << copyinlayer
1248 <<
" orientation = " << orientation <<
" ii= " <<
ii << std::endl;
1250 double zdiststat = 0.;
1260 double kplane = -(
pn0 - 1) / 2 - 0.5 + (zmodule - 1);
1264 std::cout <<
"FP420Test: Leftzcurrent-419000. = " << zcurrent - 419000. << std::endl;
1267 if (justlayer == 1) {
1268 if (orientation == 1)
1270 if (orientation == 2)
1273 if (justlayer == 2) {
1274 if (orientation == 1)
1276 if (orientation == 2)
1282 zcurrent = -zcurrent;
1285 std::cout <<
"FP420Test: zcurrent-419000. = " << zcurrent - 419000. << std::endl;
1294 std::cout <<
"----------------------------------------------------------------------------- " << std::endl;
1298 if (totallosenergy == 0.0) {
1299 std::cout <<
"FP420Test: number of hits = " << theCAFI->entries() << std::endl;
1303 std::cout <<
" j hits = " <<
j <<
"losenergy = " << losenergy << std::endl;
1311 double totalEnergy = 0.;
1312 int nhitsX = 0, nhitsY = 0, nsumhit = 0;
1313 for (
int sector = 1; sector < 4; sector++) {
1314 int nhitsecX = 0, nhitsecY = 0;
1315 for (
int zmodule = 1; zmodule < 11; zmodule++) {
1321 double theTotalEnergy = themap[
index];
1325 if (theTotalEnergy > 0.00003) {
1334 if (theTotalEnergy > 0.00005) {
1347 totalEnergy += themap[
index];
1351 if (nhitsecX > 10 || nhitsecY > 10) {
1380 std::cout <<
"FP420Test: END OF Event " << (*evt)()->GetEventID() << std::endl;