Skip to content
Merged
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 @@ -48,13 +48,21 @@ public double getBeamEnergy() {
protected boolean debug = false;
protected boolean outputPlots = false;
protected String outputPlotDir = "DQMOutputPlots/";

//define all of the collection strings here so the the variable names are all consistent
//makes it easier to do steering for multiple drivers.
protected String finalStateParticlesColName = "FinalStateParticles";
protected String unconstrainedV0CandidatesColName = "UnconstrainedV0Candidates";
protected String beamConV0CandidatesColName = "BeamspotConstrainedV0Candidates";
protected String targetConV0CandidatesColName = "TargetConstrainedV0Candidates";

@Override
protected void detectorChanged(Detector detector) {
BeamEnergyCollection beamEnergyCollection = this.getConditionsManager()
.getCachedConditions(BeamEnergyCollection.class, "beam_energies").getCachedData();
if (beamEnergy == null && beamEnergyCollection != null && beamEnergyCollection.size() != 0)
if (beamEnergy == null && beamEnergyCollection != null && beamEnergyCollection.size() != 0){
beamEnergy = beamEnergyCollection.get(0).getBeamEnergy();
System.out.println(this.getClass().getName()+":: setting beamEnergy = "+beamEnergy);
}
else {
LOGGER.log(Level.WARNING, "warning: beam energy not found. Using a 6.6 GeV as the default energy");
beamEnergy = 6.6;
Expand All @@ -63,16 +71,36 @@ protected void detectorChanged(Detector detector) {
is2019Run = DatabaseConditionsManager.isPhys2019Run(this.getConditionsManager().getRun());
}

public void setFinalStateParticlesColName(String fspColName){
finalStateParticlesColName=fspColName;
}

public void setUnconstrainedV0CandidatesColName(String ucV0ColName){
unconstrainedV0CandidatesColName=ucV0ColName;
}

public void setBeamConV0CandidatesColName(String bscV0ColName){
beamConV0CandidatesColName=bscV0ColName;
}

public void setTargetConV0CandidatesColName(String tcV0ColName){
targetConV0CandidatesColName=tcV0ColName;
}

String triggerType = "all";// allowed types are "" (blank) or "all", singles0, singles1, pairs0,pairs1
public boolean isGBL = false;

public boolean isKF = false;

public void setTriggerType(String type) {
this.triggerType = type;
}

public void setIsGBL(boolean isgbl) {
this.isGBL = isgbl;
}
public void setIsKF(boolean iskf) {
this.isKF = iskf;
}

public void setRecoVersion(String recoVersion) {
this.recoVersion = recoVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ public class FinalStateMonitoring extends DataQualityMonitor {

private static Logger LOGGER = Logger.getLogger(FinalStateMonitoring.class.getPackage().getName());

String finalStateParticlesColName = "FinalStateParticles";

String[] fpQuantNames = {"nEle_per_Event", "nPos_per_Event", "nPhoton_per_Event", "nUnAssociatedTracks_per_Event",
"avg_delX_at_ECal", "avg_delY_at_ECal", "avg_E_Over_P", "avg_mom_beam_elec", "sig_mom_beam_elec"};
// some counters
Expand Down Expand Up @@ -92,22 +90,20 @@ public class FinalStateMonitoring extends DataQualityMonitor {
/* number of unassocaited tracks/event */
IHistogram1D nUnAssTracksHisto;

public void setFinalStateParticlesColName(String fsp) {
this.finalStateParticlesColName = fsp;
}

@Override
protected void detectorChanged(Detector detector) {
super.detectorChanged(detector);
double maxFactor = 1.5;
double feeMomentumCut = 0.75; // this number, multiplied by the beam energy, is the actual cut
beamEnergy = 4.5;
System.out.println("Using beamEnergy = " + beamEnergy);
System.out.println(this.getClass().getName()+":: setting beamEnergy = "+beamEnergy);
LOGGER.info("Setting up the plotter");
aida.tree().cd("/");
String trkType = "SeedTrack/";
if (isGBL)
trkType = "GBLTrack/";
if (isKF)
trkType = "KFTrack/";


/* Final State Particle Quantities */
/* plot electron & positron momentum separately */
Expand Down Expand Up @@ -247,12 +243,6 @@ public void process(EventHeader event) {
if (fsCluster == null)
throw new RuntimeException("isPhoton==true but no cluster found: should never happen");
double ene = fsPart.getEnergy();
// TODO: mg-May 14, 2014....I would like to do this!!!!
// double xpos = fsCluster.getPositionAtShowerMax(false)[0];// false-->assume a photon instead of
// electron from calculating shower depth
// double ypos = fsCluster.getPositionAtShowerMax(false)[1];
// but I can't because ReconParticles don't know about HPSEcalClusters, and casting it as one doesn't
// seem to work
Hep3Vector clusterPosition = new BasicHep3Vector(fsCluster.getPosition());
double xpos = clusterPosition.x();
double ypos = clusterPosition.y();
Expand All @@ -271,9 +261,9 @@ public void process(EventHeader event) {
double ene = fsPart.getEnergy();
double eOverP = ene / mom.magnitude();
Hep3Vector clusterPosition = new BasicHep3Vector(fsCluster.getPosition());// this gets position at
// shower max assuming it's an
// electron/positron
Hep3Vector trackPosAtEcal = TrackUtils.extrapolateTrack(fsTrack, clusterPosition.z());
//get this from stored track state...don't do extrapolation by hand (commented out below)
Hep3Vector trackPosAtEcal=new BasicHep3Vector(TrackUtils.getTrackStateAtECal(fsTrack).getReferencePoint());
// Hep3Vector trackPosAtEcal = TrackUtils.extrapolateTrack(fsTrack, clusterPosition.z());
double dx = trackPosAtEcal.x() - clusterPosition.x();// remember track vs detector coords
double dy = trackPosAtEcal.y() - clusterPosition.y();// remember track vs detector coords

Expand Down
Loading