diff --git a/benchmarks/LOWQ2/analysis/LOWQ2Benchmarks.h b/benchmarks/LOWQ2/analysis/LOWQ2Benchmarks.h index 2adaef78..13ac9f4d 100755 --- a/benchmarks/LOWQ2/analysis/LOWQ2Benchmarks.h +++ b/benchmarks/LOWQ2/analysis/LOWQ2Benchmarks.h @@ -20,8 +20,6 @@ using RVecI = ROOT::VecOps::RVec; std::map,std::map,std::map>> histMap; - - //--------------------------------------------------------------------------------------------- // Create dataframe from input file(s) //--------------------------------------------------------------------------------------------- @@ -228,8 +226,7 @@ void writePlots( TString outName ){ //--------------------------------------------------------------------------------------------- // Create the benchmark plots //--------------------------------------------------------------------------------------------- -void LOWQ2Benchmarks( string inName = "/scratch/EIC/G4out/qr_18x275_new.edm4hep*.root", - TString outName = "LOWQ2QRRates.root", dd4hep::Detector& detector=dd4hep::Detector::getInstance(), double eventRate=0.0 ){ +void LOWQ2Benchmarks( string inName, TString outName, dd4hep::Detector& detector, double eventRate ){ auto node = initialise( inName ); diff --git a/benchmarks/LOWQ2/analysis/LOWQ2hits.h b/benchmarks/LOWQ2/analysis/LOWQ2hits.h index 709f8c1d..ac3a26df 100644 --- a/benchmarks/LOWQ2/analysis/LOWQ2hits.h +++ b/benchmarks/LOWQ2/analysis/LOWQ2hits.h @@ -97,9 +97,8 @@ std::tuple,std::map,std::map< .Define(yHalfChipName,"yHalfChipID[LayerFilter&&ModuleFilter]") .Define(xColumnName,"xColumnID[LayerFilter&&ModuleFilter]") .Define(layerSizeName,[](RVecI lay){return lay.size();},layerSizeInput); + - - hHists1D[moduleTag+"/"+layerTag+"/"+xHistName] = d4.Histo1D({xHistName, xHistName+";x pixel column;Rate [Hz]", xRange, xMin, xMax }, xName, "eventWeight"); hHists1D[moduleTag+"/"+layerTag+"/"+yHistName] = d4.Histo1D({yHistName, yHistName+";y pixel column;Rate [Hz]", yRange, yMin, yMax }, yName, "eventWeight"); @@ -123,7 +122,6 @@ std::tuple,std::map,std::map< } } - return {hHists1D,hHists2D,hHists3D}; } diff --git a/benchmarks/LOWQ2/analysis/RunLOWQ2.C b/benchmarks/LOWQ2/analysis/RunLOWQ2.C index 3f5bf3c4..b5c3c422 100644 --- a/benchmarks/LOWQ2/analysis/RunLOWQ2.C +++ b/benchmarks/LOWQ2/analysis/RunLOWQ2.C @@ -1,35 +1,40 @@ #include "LOWQ2Benchmarks.h" #include -void RunLOWQ2(std::string inputFileName="Brems_input.root", std::string outputFileName="plots/LOWQ2BremsRecon3.root", - double eventCrossSection=0, std::string compactName="/opt/detector/epic-nightly/share/epic/epic.xml") { +void RunLOWQ2( std::string inputFileName = "Brems_input.root", + std::string outputFileName = "plots/LOWQ2QRRecon3.root", + std::string compactName = "/opt/detector/epic-nightly/share/epic/epic.xml", + bool inputIsTimeBased = false, // true if the event sample is time-based, false if it is event-based + double timeWindow = 10.15*1e-9, //[s] + double eventCrossSection = 0.0551, // [mb] + double luminosity = 1e34, // [cm^-2 s^-1] + ) { //Set implicit multi-threading ROOT::EnableImplicitMT(); // Output script running conditions std::cout << "Running LOWQ2 benchmarks with the following parameters:" << std::endl; + std::cout << " - input file: " << inputFileName << std::endl; + std::cout << " - output file: " << outputFileName << std::endl; std::cout << " - xml file: " << compactName << std::endl; + std::cout << " - input is time-based: " << inputIsTimeBased << std::endl; + std::cout << " - time window: " << timeWindow << " s" << std::endl; + std::cout << " - event cross section: " << eventCrossSection << " mb" << std::endl; + std::cout << " - luminosity: " << luminosity << " cm^-2 s^-1" << std::endl; dd4hep::Detector& detector = dd4hep::Detector::getInstance(); detector.fromCompact(compactName); - double luminosity = 1e34; // [cm^-2 s^-1] - double eBeamEnergy = 18.0; // [GeV] - double pBeamEnergy = 275.0; // [GeV] - double eventCrossSectionQR = 0.0551; // [mb] - double eventCrossSectionBrems = 171.3; // [mb] - double bunchSpacing = 10.15*1e-9; // [s] - - double eventRateQR = luminosity * eventCrossSectionQR * 1e-27; // [Hz] - double eventRateBrems = luminosity * eventCrossSectionBrems * 1e-27; // [Hz] - double bunchRate = 1.0 / bunchSpacing; // [Hz] + // eventCrossSectionBrems = 171.3; [mb] + // eventCrossSectionQR = 0.0551; [mb] double eventRate = luminosity * eventCrossSection * 1e-27; // [Hz] - //LOWQ2Benchmarks("/scratch/EIC/ReconOut/QR_new.root","plots/LOWQ2QRRecon2.root",detector,eventRateQR); - LOWQ2Benchmarks("/scratch/EIC/ReconOut/Brems_new.root","plots/LOWQ2BremsRecon2.root",detector,eventRateBrems); - LOWQ2Benchmarks("/scratch/EIC/ReconOut/Brems_new.root","plots/LOWQ2BremsRecon3.root",detector,bunchRate); - //LOWQ2Benchmarks(inputFileName,outputFileName,detector,eventRate); + if(inputIsTimeBased){ + eventRate = 1.0 / timeWindow; // [Hz] + } + + LOWQ2Benchmarks(inputFileName,outputFileName,detector,eventRate); } \ No newline at end of file