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