Skip to content
Snippets Groups Projects
Commit bb25e184 authored by nnitika's avatar nnitika
Browse files

Update ATL

parent 95fbb34d
No related branches found
No related tags found
No related merge requests found
Pipeline #7233284 passed
......@@ -39,11 +39,17 @@ public:
void ConfigureForTrack(const G4Track *track) override final;
bool isInsideBeampipe(const G4Track*);
bool isInsideTracker(const G4Track*);
private:
G4FieldManager* fieldMgr;
double delta;
G4Track* track;
G4double bRmax;
G4double mZmax;
G4double maxAcceptedEpsilon;
G4double lowEepsMin;
G4double lowEepsMax;
......@@ -58,5 +64,12 @@ private:
G4double hiDeltaOneStep;
G4double hiDeltaChord;
G4double hiMaxStep;
G4double defaultEepsMin;
G4double defaultEepsMax;
G4double defaultDeltaIntersection;
G4double defaultDeltaOneStep;
G4double defaultDeltaChord;
G4double defaultMaxStep;
};
#endif // ATL_HH
......@@ -11,41 +11,84 @@ ATL::ATL() {
//fieldMgr->SetVerboseLevel(0);
}
ATL::~ATL() {}
//if used G4Region to access the region name then no need to ely on R and Z
bool ATL::isInsideBeampipe(const G4Track *track) {
const G4ThreeVector &pos = track->GetPosition();
const double x = pos.x();
const double y = pos.y();
const double z = pos.z();
void ATL::ConfigureForTrack(const G4Track *track) {
const G4double bRmax = 120.0, bZmax = 3545.0;
const G4double lowEepsMin= 1.0e-5, lowEepsMax= 1.0e-4; //Below energy threshold values- dummy energy threshold 2.5 MeV
const G4double hiEepsMin= 2.5e-6, hiEepsMax= 1.0e-5; //Above energy threshold values
if ((x * x + y * y < bRmax) && (std::abs(pos.z()) < bZmax)) {
G4Region *reg = track->GetVolume()->GetLogicalVolume()->GetRegion();
G4cout << "From isInsideBeampipe: Track is in the Beampipe region. \n"<< reg->GetName()<<" at X: "<<pos.x()<<" Y: "<<pos.y()<< "& Z : " <<pos.z() << G4endl;
return true;
}
else {
G4cout << "Track is NOT in the Beampipe region. X: " << pos.x() << "Y: " << pos.y() << " Z: " << pos.z() << " \n";
return false;
}
}
bool ATL::isInsideTracker(const G4Track *track) {
const G4ThreeVector &pos = track->GetPosition();
const double x = pos.x();
const double y = pos.y();
const double z = pos.z();
const G4double bRmax = 1148.0, bZmax = 3475.0;
if ((x * x + y * y < bRmax) && (std::abs(pos.z()) < bZmax)) {
G4Region *reg = track->GetVolume()->GetLogicalVolume()->GetRegion();
G4cout << "From isInsideTracker: Track is in the Tracker region. \n"<< reg->GetName()<<" at X: "<<pos.x()<<" Y: "<<pos.y()<< "& Z : " <<pos.z() << G4endl;
return true;
}
else {
G4cout << "Track is NOT in the Tracker region. X: " << pos.x() << " Y: " << pos.y() << " Z: " << pos.z() << " \n";
return false;
}
}
void ATL::ConfigureForTrack(const G4Track *track) {
isInsideBeampipe(track);
isInsideTracker(track);
//BeamPipe
const G4double lowEepsMin= 1.0e-5, lowEepsMax= 1.0e-4; //Below energy threshold values- dummy energy threshold 2.5 MeV//////low-Beampipe, hi-Tracker and default for others
const G4double lowDeltaIntersection= 0.0004, lowDeltaOneStep= 0.001;
const G4double lowDeltaChord= 0.001, lowMaxStep=200;
//Tracker
const G4double hiEepsMin= 2.5e-6, hiEepsMax= 1.0e-5; //Above energy threshold values
const G4double hiDeltaIntersection= 0.0008, hiDeltaOneStep= 0.002;
const G4double hiDeltaChord= 0.25, hiMaxStep=1000;
//Others-default
const G4double defaultEepsMin= 1.0e-5, defaultEepsMax= 1.0e-4;
const G4double defaultDeltaIntersection= 0.0004, defaultDeltaOneStep= 0.001;
const G4double defaultDeltaChord= 0.001, defaultMaxStep=200;
//Energy Threshold and position - All 4 parameters (Eps min./max. additional)
if( track->GetKineticEnergy() < 2.5 * MeV ) {
//3 energy ranges, 1. E<15MeV, 2. E>15MeV-200 MeV, 3. E>200MeV
//3 Set of Parameters according to accuracy, 1st Set goood for E>200MeV, 2nd low accuracy for E<15MeV, 3rd for medium accuracy
if( track->GetKineticEnergy() <=200.0 * MeV && isInsideBeampipe(track)) {
SetMinimumEpsilonStep( lowEepsMin );
SetMaximumEpsilonStep( lowEepsMax );
SetDeltaIntersection(lowDeltaIntersection);
SetDeltaOneStep(lowDeltaOneStep);
G4TransportationManager::GetTransportationManager()->GetPropagatorInField()->GetChordFinder()->SetDeltaChord(lowDeltaChord);
G4TransportationManager::GetTransportationManager()->GetPropagatorInField()->SetLargestAcceptableStep(lowMaxStep);
//SetDeltaChord(lowDeltaChord); //chord finder
//SetLargestAcceptableStep(lowMaxStep); //propagator
//track->GetStep()->GetTrack()->GetStep()->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetRegion()->GetNavigatorForTracking()->SetMaxAllowedStep(lowMaxStep); // propagator
/*G4ChordFinder* chordFinder = G4TransportationManager::GetTransportationManager()->GetPropagatorInField()-> GetChordFinder();
if (chordFinder) {
chordFinder->SetDeltaChord(hiDeltaChord);
} */
// For DeltaChord and StepMax parameter
} else {
}
else if (track->GetKineticEnergy() > 200.0 * MeV && isInsideTracker(track)) {
SetMinimumEpsilonStep( hiEepsMin );
SetMaximumEpsilonStep( hiEepsMax );
SetDeltaIntersection(hiDeltaIntersection);
SetDeltaOneStep(hiDeltaOneStep);
G4TransportationManager::GetTransportationManager()->GetPropagatorInField()->GetChordFinder()->SetDeltaChord(lowDeltaChord);
G4TransportationManager::GetTransportationManager()->GetPropagatorInField()->GetChordFinder()->SetDeltaChord(hiDeltaChord);
G4TransportationManager::GetTransportationManager()->GetPropagatorInField()->SetLargestAcceptableStep(hiMaxStep);
}
else {
SetMinimumEpsilonStep( defaultEepsMin );
SetMaximumEpsilonStep( defaultEepsMax );
SetDeltaIntersection( defaultDeltaIntersection);
SetDeltaOneStep(defaultDeltaOneStep);
G4TransportationManager::GetTransportationManager()->GetPropagatorInField()->GetChordFinder()->SetDeltaChord(defaultDeltaChord);
G4TransportationManager::GetTransportationManager()->GetPropagatorInField()->SetLargestAcceptableStep(defaultMaxStep);
}
G4FieldManager* fieldMgr = G4TransportationManager::GetTransportationManager()->GetFieldManager();
// G4TransportationManager::GetTransportationManager()->GetPropagatorInField()
......@@ -64,11 +107,3 @@ void ATL::print()
//fieldMgr->ConfigureForTrack(track);
//G4cout << " ATL ATL ATL ATL ATL ATL ATL ATL ATL ATL ATL ATL ATL ATL " << fieldMgr->GetDeltaIntersection() / mm << " mm" << G4endl;
}
\ No newline at end of file
/*void ATL::print(const G4Track *track) {
// ConfigureForTrack(track);
G4FieldManager* fieldMgr = G4TransportationManager::GetTransportationManager()->GetFieldManager();
// fieldMgr->ConfigureForTrack(track);
G4cout << "\n Print fxn trackkkkkkkkkkkkk: " << GetDeltaIntersection() / mm << " mm" << G4endl;
} */
\ No newline at end of file
......@@ -480,6 +480,7 @@ void FSLDetectorConstruction::ConstructSDandField()
//ATL atlobj;
//G4Track *track;
atlobj->print();
//atlobj->isInsideBeampipe(track);
// atlobj->ConfigureForTrack(track);
// atlobj->print(track);
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment