479 {
480
481
482
483
486 }
487 else {
488 for (
unsigned int i=0;
i != 4;
i++) energies.push_back( 0. );
489 }
490
493 {
494
495
496
497
498
499 G4VPhysicalVolume* physical =
step->GetPreStepPoint()->GetPhysicalVolume();
500 G4int copyNumber = physical->GetCopyNo();
501 G4String volumeName = physical->GetLogicalVolume()->GetName();
502
503#ifdef DEBUG_HITS
504 G4cout << "LArG4::BarrelCryostat::CalibrationCalculator::Process - "
505 << G4endl
506 << " searching for volume '"
507 << volumeName
508 << "' copyNumber="
509 << copyNumber
510 << G4endl;
511#endif
512
513 if(volumeName.find("LArMgr::") == 0) volumeName.erase(0,8);
514 if(volumeName.find("LAr::Barrel::Cryostat::Sector")==0) {
515 volumeName = "LAr::Barrel::Cryostat::Sector";
516 if(copyNumber != 7 && copyNumber !=12) copyNumber=1;
517 }else if(volumeName.find("LAr::Barrel::Cryostat::Cylinder")==0){
518 volumeName = "LAr::Barrel::Cryostat::Cylinder";
519 }else if(volumeName.find("LAr::Barrel::Cryostat::InnerWall")==0){
520 volumeName = "LAr::Barrel::Cryostat::InnerWall";
521 copyNumber = 1;
522 }
523
524
525 const auto v =
volumeMap().find( volumeName );
527 {
528
529
530
531
532
533
534
536 const auto i = identifierMap.find( copyNumber );
537
538 if ( i != identifierMap.end() )
539 {
540 const IdentifierInfo_t*
info = (*i).second;
541
542
543
544 G4StepPoint* pre_step_point =
step->GetPreStepPoint();
545 G4StepPoint* post_step_point =
step->GetPostStepPoint();
546 G4ThreeVector startPoint = pre_step_point->GetPosition();
547 G4ThreeVector endPoint = post_step_point->GetPosition();
548 G4ThreeVector
p = (startPoint + endPoint) * 0.5;
549
550
551
552
553
554 G4double
eta = fabs(
p.pseudoRapidity() );
555 G4double
phi =
p.phi();
556
557
558
560
561
562
563
564
566 const RegionInfo_t* region =
info->regionInfoArray;
567
568#ifdef DEBUG_HITS
569 G4cout << "LArG4::BarrelCryostat::CalibrationCalculator::Process - "
570 << G4endl
571 << " found volume, number of regions="
573 <<
" eta=" <<
eta <<
" phi=" <<
phi
574 << G4endl;
575#endif
576
579 {
580 if (
eta > region->etaMin &&
582 break;
583 }
584
585
586
587
588
589
591 {
592
593
594
595 G4int etaInteger = G4int( (
eta - region->etaMin) / region->deltaEta );
596 G4int phiInteger = G4int(
phi / region->deltaPhi );
597
598 if (phiInteger > 63) phiInteger = 0;
599
600#ifdef DEBUG_HITS
601 G4cout << "LArG4::BarrelCryostat::CalibrationCalculator::Process - "
602 << G4endl
603 << " found region="
604 << region->regionNumber
605 << " eta bin=" << etaInteger << " phi bin=" << phiInteger
606 << G4endl;
607#endif
608
609
610
611 G4int subDetSign = 1;
612 if (
p.z() < 0 ) subDetSign = -1;
613
614
615 if ( etaInteger >= 0 )
616 {
617
619 <<
info->subdet * subDetSign
622 << region->regionNumber
623 << etaInteger
624 << phiInteger;
625
626 }
627 }
628 }
629 }
630
631
632
633
634 if ( identifier == LArG4Identifier() )
635 {
636#if defined (DEBUG_HITS) || defined (DEBUG_VOLUMES)
637 std::cout << "LArG4::BarrelCryostat::CalibrationCalculator::Process"
638 << std::endl
639 << " volume '"
640 << volumeName
641 << "' copy# "
642 << copyNumber
643 << " not found on tables, using backup calculator"
644 << std::endl;
645#endif
647 }
648 }
649
650#ifdef DEBUG_HITS
651
652 std::cout << "LArG4::BarrelCryostat::CalibrationCalculator::Process"
653 <<
" vName " <<
step->GetPreStepPoint()->GetPhysicalVolume()->GetName()
654 << " ID=" << std::string(identifier)
655
656 << " energies=(" << energies[0]
657 << "," << energies[1]
658 << "," << energies[2]
659 << "," << energies[3] << ")"
660 << std::endl;
661#endif
662
663
664 return ( identifier != LArG4Identifier() );
665 }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
static const std::vector< std::string > regions
CaloG4::SimulationEnergies m_energyCalculator
const std::string process
std::map< G4int, const IdentifierInfo_t * > identifierMap_t