Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ public final class SwapManager {
private ConstantsManager currConman = null;
private SchemaFactory schema = null;

private static SwapManager instance = null;

public Set<String> getDetectors() {
return this.detsToBanks.keySet();
}
Expand All @@ -68,14 +66,7 @@ public List<String> getBanks(String detectorName) {
return this.detsToBanks.get(detectorName);
}

private SwapManager() {}

public static synchronized SwapManager getInstance() {
if (instance == null) {
instance = new SwapManager();
}
return instance;
}
public SwapManager() {}

/**
* @param detectorNames
Expand Down Expand Up @@ -251,7 +242,7 @@ public static void main(String[] args) {

DefaultLogger.debug();

SwapManager man = getInstance();
SwapManager man = new SwapManager();
System.out.println(Arrays.toString(man.get(11014, "/daq/tt/bmt",3,5,320,0)));

man.initialize(Arrays.asList("DC"),"08/10/2020","10/13/2024");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.jlab.detector.geant4;

import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import org.jlab.geom.geant.Geant4Basic;
import org.jlab.geom.prim.Line3D;
import org.jlab.geom.prim.Plane3D;
import org.jlab.geom.prim.Point3D;
import org.jlab.geom.base.ConstantProvider;
import org.jlab.geom.prim.Vector3D;

Expand Down Expand Up @@ -45,15 +35,11 @@ final class DCdatabase {
private int nguardwires;

private final String dcdbpath = "/geometry/dc/";
private static DCdatabase instance = null;
private static DCdatabase instance = new DCdatabase();

private DCdatabase() {
}
private DCdatabase() {}

public static synchronized DCdatabase getInstance() {
if (instance == null) {
instance = new DCdatabase();
}
public static DCdatabase getInstance() {
return instance;
}

Expand Down Expand Up @@ -278,7 +264,7 @@ public class DCGeant4Factory {

DCdatabase dbref = DCdatabase.getInstance();
private Geant4Basic motherVolume = new Geant4Basic("root", "Box", 0);
private HashMap<String, String> properties = new HashMap<String, String>();
private HashMap<String, String> properties = new HashMap<>();

private int nsgwires;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public String getVersion() {
*
* @return the MagneticFields singleton
*/
public static synchronized MagneticFields getInstance() {
public static MagneticFields getInstance() {
if (instance == null) {
instance = new MagneticFields();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public boolean init() {
System.out.println("["+this.getName()+"] --> Setting detectors : "+this.getEngineConfigString("detectors"));
System.out.println("["+this.getName()+"] --> Modifying ADC/TDC banks!");

this.swapman = SwapManager.getInstance();
this.swapman = new SwapManager();
this.swapman.initialize(dets,previousTimestamp,currentTimestamp);

System.out.println("["+this.getName()+"] --> swaps are ready....");
Expand Down
Loading