Skip to content

Commit be43d72

Browse files
committed
Merge branch 'master' into iss135
2 parents 00739aa + 05ab92f commit be43d72

622 files changed

Lines changed: 198387 additions & 57961 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

analysis/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
<artifactId>maven-surefire-plugin</artifactId>
2424
<configuration>
2525
<excludes>
26-
<exclude>**/VertexAnalysisTest.java</exclude>
27-
<exclude>org/hps/analysis/MC/MCTrackerHitResidualAnalysisDriverTest.java</exclude>
26+
<exclude>**/*Test.java</exclude>
2827
</excludes>
2928
</configuration>
3029
</plugin>

analysis/src/main/java/org/hps/analysis/dataquality/DQMDatabaseDriver.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
* connection
1212
*
1313
* @author Matt Graham <mgraham@slac.stanford.edu>
14-
* cribbed heavily from {@link org.hps.conditions.ConditionsDriver}
1514
*/
1615
public class DQMDatabaseDriver extends Driver {
1716

analysis/src/main/java/org/hps/analysis/dataquality/DataQualityMonitor.java

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,22 @@
1818
import org.lcsim.util.aida.AIDA;
1919

2020
/**
21-
* sort of an interface for DQM analysis drivers creates the DQM database
22-
* manager, checks whether row exists in db etc
23-
*
24-
* @author mgraham on Apr 15, 2014 update mgraham on May 15, 2014 to include
25-
* calculateEndOfRunQuantities & printDQMData i.e. useful methods
21+
* Interface for DQM analysis drivers.
2622
*/
2723
public class DataQualityMonitor extends Driver {
2824

2925
private static final Logger LOGGER = Logger.getLogger(DataQualityMonitor.class.getPackage().getName());
3026

3127
protected Double beamEnergy;
32-
public void setBeamEnergy(double e){
33-
this.beamEnergy = e;
28+
29+
public void setBeamEnergy(double e) {
30+
this.beamEnergy = e;
3431
}
35-
public double getBeamEnergy(){
36-
return this.beamEnergy;
32+
33+
public double getBeamEnergy() {
34+
return this.beamEnergy;
3735
}
38-
36+
3937
protected AIDA aida = AIDA.defaultInstance();
4038
protected DQMDatabaseManager manager;
4139
protected String recoVersion = "v0.0";
@@ -49,20 +47,19 @@ public double getBeamEnergy(){
4947
protected String outputPlotDir = "DQMOutputPlots/";
5048

5149
@Override
52-
protected void detectorChanged(Detector detector){
53-
BeamEnergyCollection beamEnergyCollection =
54-
this.getConditionsManager().getCachedConditions(BeamEnergyCollection.class, "beam_energies").getCachedData();
55-
if(beamEnergy== null && beamEnergyCollection != null && beamEnergyCollection.size() != 0)
50+
protected void detectorChanged(Detector detector) {
51+
BeamEnergyCollection beamEnergyCollection = this.getConditionsManager()
52+
.getCachedConditions(BeamEnergyCollection.class, "beam_energies").getCachedData();
53+
if (beamEnergy == null && beamEnergyCollection != null && beamEnergyCollection.size() != 0)
5654
beamEnergy = beamEnergyCollection.get(0).getBeamEnergy();
57-
else{
55+
else {
5856
LOGGER.log(Level.WARNING, "warning: beam energy not found. Using a 6.6 GeV as the default energy");
5957
beamEnergy = 6.6;
6058
}
61-
59+
6260
}
63-
64-
65-
String triggerType = "all";//allowed types are "" (blank) or "all", singles0, singles1, pairs0,pairs1
61+
62+
String triggerType = "all";// allowed types are "" (blank) or "all", singles0, singles1, pairs0,pairs1
6663
public boolean isGBL = false;
6764

6865
public void setTriggerType(String type) {
@@ -117,7 +114,7 @@ public void endOfData() {
117114
if (connectToDB) {
118115
LOGGER.info("Connecting To Database...getting DQMDBManager");
119116
manager = DQMDatabaseManager.getInstance();
120-
//check to see if I need to make a new db entry
117+
// check to see if I need to make a new db entry
121118
boolean entryExists = false;
122119
try {
123120
entryExists = checkRowExists();
@@ -139,7 +136,7 @@ private void makeNewRow() {
139136
LOGGER.info("is the data base connected? " + manager.isConnected);
140137
if (manager.isConnected) {
141138
String ins = "insert into dqm SET runNumber=" + runNumber;
142-
// LOGGER.info(ins);
139+
// LOGGER.info(ins);
143140
manager.updateQuery(ins);
144141
ins = "update dqm SET recoVersion='" + recoVersion + "' where runNumber=" + runNumber;
145142
manager.updateQuery(ins);
@@ -150,7 +147,7 @@ private void makeNewRow() {
150147
private boolean checkRowExists() throws SQLException {
151148
String ins = "select * from dqm where " + getRunRecoString();
152149
ResultSet res = manager.selectQuery(ins);
153-
return res.next(); //this is a funny way of determining if the ResultSet has any entries
150+
return res.next(); // this is a funny way of determining if the ResultSet has any entries
154151
}
155152

156153
public boolean checkSelectionIsNULL(String var) throws SQLException {
@@ -169,13 +166,13 @@ public String getRunRecoString() {
169166
return "runNumber=" + runNumber + " and recoVersion='" + recoVersion + "'";
170167
}
171168

172-
//override this method to do something interesting
173-
//like fill some plots that you only want to fill at end of data (e.g. for occupancies)
169+
// override this method to do something interesting
170+
// like fill some plots that you only want to fill at end of data (e.g. for occupancies)
174171
public void fillEndOfRunPlots() {
175172
}
176173

177-
//override this method to do something interesting
178-
//like calculate averages etc. that can then be put in the db
174+
// override this method to do something interesting
175+
// like calculate averages etc. that can then be put in the db
179176
public void calculateEndOfRunQuantities() {
180177
}
181178

@@ -191,7 +188,7 @@ public void dumpDQMData() {
191188
}
192189
if (!overwriteDB && !isnull) {
193190
LOGGER.info("Not writing because " + name + " is already filled for this entry");
194-
continue; //entry exists and I don't want to overwrite
191+
continue; // entry exists and I don't want to overwrite
195192
}
196193
String put = "update dqm SET " + name + " = " + val + " WHERE " + getRunRecoString();
197194
LOGGER.info(put);
@@ -231,7 +228,7 @@ public boolean matchTrigger(EventHeader event) {
231228
for (GenericObject data : triggerList) {
232229
if (AbstractIntData.getTag(data) == TIData.BANK_TAG) {
233230
TIData triggerData = new TIData(data);
234-
if (!matchTriggerType(triggerData))//only process singles0 triggers...
231+
if (!matchTriggerType(triggerData))// only process singles0 triggers...
235232
{
236233
match = false;
237234
}
@@ -243,14 +240,14 @@ public boolean matchTrigger(EventHeader event) {
243240
return match;
244241
}
245242

246-
//override this method to do something interesting
247-
//like print the DQM data log file
243+
// override this method to do something interesting
244+
// like print the DQM data log file
248245
public void printDQMData() {
249246
}
250247

251-
//override this method to do something interesting
252-
//like print the DQM db variable strings in a good
253-
//format for making the db column headers
248+
// override this method to do something interesting
249+
// like print the DQM db variable strings in a good
250+
// format for making the db column headers
254251
public void printDQMStrings() {
255252
}
256253
}

0 commit comments

Comments
 (0)