Skip to content
Draft
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
16 changes: 16 additions & 0 deletions src/main/java/org/jlab/clas/timeline/histograms/ChargeMon.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.jlab.clas.timeline.histograms;

import org.jlab.groot.data.TDirectory;
import org.jlab.detector.qadb.QadbBinSequence;

/**
* @author dilks
*/
public class ChargeMon {

public ChargeMon(QadbBinSequence qa_seq)
{

}

}
19 changes: 19 additions & 0 deletions src/main/java/org/jlab/clas/timeline/histograms/QadbBinData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.jlab.clas.timeline.histograms;

import java.util.LinkedHashMap;
import java.util.Map;
import org.jlab.groot.group.DataGroup;

/**
* @author dilks
*/
public class QadbBinData {

Map<String,DataGroup> mon = new LinkedHashMap<String,DataGroup>();

public String toString() {
return """FIXME
""";
}

}
62 changes: 36 additions & 26 deletions src/main/java/org/jlab/clas/timeline/run_histograms.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import java.util.*;
import java.text.SimpleDateFormat;

import org.jlab.detector.qadb.QadbBinSequence;
import org.jlab.detector.qadb.QadbBin;

import org.jlab.io.base.DataEvent;
import org.jlab.io.hipo.HipoDataSource;
import org.jlab.groot.base.GStyle;
Expand All @@ -32,32 +35,18 @@ public static void main(String[] args) {
// get the dataset which contains this run number
var dataset = RunDependentCut.findDataset(runNum);

//// instantiate histogramming classes
GeneralMon ana_mon = new GeneralMon(runNum,outputDir,EB,useTB);
DCandFTOF ana_dc_ftof = new DCandFTOF(runNum,outputDir,useTB);
CTOF ana_ctof = new CTOF(runNum,outputDir,useTB);
HTCC ana_htcc = new HTCC(runNum,outputDir);
LTCC ana_ltcc = new LTCC(runNum,outputDir,EB,useTB);
RICH ana_rich = new RICH(runNum,outputDir,EB,useTB);
CND ana_cnd = new CND(runNum,outputDir,useTB);
CVT ana_cvt = dataset != "rgl" ? new CVT() : null;
FT ana_ft = new FT(runNum,outputDir,useTB);
BAND ana_band = new BAND(runNum,outputDir,EB,useTB);
ALERT ana_alert = dataset == "rgl" ? new ALERT(runNum,outputDir,EB,useTB) : null;
helicity ana_helicity = new helicity();
trigger ana_trigger = new trigger();

List<String> toProcessFileNames = new ArrayList<String>();
// get list of input HIPO files
List<String> input_file_list = new ArrayList<String>();
File file = new File(filelist);
Scanner read;
try {
read = new Scanner(file);
do {
do {
String filename = read.next()
.replaceAll("^file:", "")
.replaceAll("^mss:", "");
if(runNum==0 || filename.contains(String.format("%d",runNum) ) ){
toProcessFileNames.add(filename);
input_file_list.add(filename);
System.out.println("adding "+filename);
}

Expand All @@ -68,22 +57,43 @@ public static void main(String[] args) {
System.exit(100);
}
int progresscount = 0;
int filetot = toProcessFileNames.size();
int filetot = input_file_list.size();
long startTime = System.currentTimeMillis();
long previousTime = System.currentTimeMillis();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");

for (String runstrg : toProcessFileNames) {
// QADB binning
QadbBinSequence<QadbBinData> qa_seq = new QadbBinSequence<>(input_file_list, 2000, (bin_num) -> new QadbBinData());

// instantiate histogramming classes
GeneralMon ana_mon = new GeneralMon(runNum,outputDir,EB,useTB);
DCandFTOF ana_dc_ftof = new DCandFTOF(runNum,outputDir,useTB);
CTOF ana_ctof = new CTOF(runNum,outputDir,useTB);
HTCC ana_htcc = new HTCC(runNum,outputDir);
LTCC ana_ltcc = new LTCC(runNum,outputDir,EB,useTB);
RICH ana_rich = new RICH(runNum,outputDir,EB,useTB);
CND ana_cnd = new CND(runNum,outputDir,useTB);
CVT ana_cvt = dataset != "rgl" ? new CVT() : null;
FT ana_ft = new FT(runNum,outputDir,useTB);
BAND ana_band = new BAND(runNum,outputDir,EB,useTB);
ALERT ana_alert = dataset == "rgl" ? new ALERT(runNum,outputDir,EB,useTB) : null;
helicity ana_helicity = new helicity();
trigger ana_trigger = new trigger();
// QADB mon histogramming
ChargeMon mon_charge = new ChargeMon(qa_seq);

// loop over input HIPO files
for (String input_file : input_file_list) {
progresscount++;
System.out.println(String.format(">>>>>>>>>>>>>>>> %s",runstrg));
File varTmpDir = new File(runstrg);
System.out.println(String.format(">>>>>>>>>>>>>>>> %s",input_file));
File varTmpDir = new File(input_file);
if(!varTmpDir.exists()) {
System.err.println(String.format("ERROR: FILE DOES NOT EXIST: '%s'",runstrg));
System.err.println(String.format("ERROR: FILE DOES NOT EXIST: '%s'",input_file));
continue;
}
System.out.println("READING NOW "+runstrg);
System.out.println("READING NOW "+input_file);
HipoDataSource reader = new HipoDataSource();
reader.open(runstrg);
reader.open(input_file);
while(reader.hasEvent()) {
DataEvent event = reader.getNextEvent();

Expand All @@ -110,7 +120,7 @@ public static void main(String[] args) {
elapsedTime = elapsedTime/1000;
totalTime = totalTime/1000;
Date date = new Date();
System.out.println(count/1000 + "k events (this is all analysis on "+runstrg+") ; time : " + dateFormat.format(date) + " , last elapsed : " + elapsedTime + "s ; total elapsed : " + totalTime + "s ; progress : "+progresscount+"/"+filetot);
System.out.println(count/1000 + "k events (this is all analysis on "+input_file+") ; time : " + dateFormat.format(date) + " , last elapsed : " + elapsedTime + "s ; total elapsed : " + totalTime + "s ; progress : "+progresscount+"/"+filetot);
previousTime = nowTime;
}
}
Expand Down
Loading