Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8d8f314
fill CAFs with CRT-PMT Matching information
aheggest Jun 14, 2023
5bda683
hope this fixes the CRT T0 and T1 time references in CAFMaker to work…
aheggest Jun 16, 2023
1407062
Updated to TriggerV3
Jun 21, 2023
f24eba3
Updated to Trigger V3
Jun 21, 2023
515724c
Update CAFMaker to save offbeam gate count
jacoblarkin Jun 22, 2023
c0f90b5
Update Params to match Joseph's PR
jacoblarkin Jun 23, 2023
0af7a05
Check whether both numi/bnb and offbeam/onbeam are filled and print e…
jacoblarkin Jun 23, 2023
53c4446
fix flashTime var name in SRCRTPMTMatch
aheggest Jun 23, 2023
34dcb36
convert srmatch.flashGateTime from ns to us
aheggest Jun 23, 2023
0651c08
make check for multiple spill products more robust
jacoblarkin Jun 26, 2023
bc5e2a0
CAFMaker fills the source information (the better it can)
PetrilloAtWork Jun 21, 2023
bb659f3
update versions for production patch
miquelnebot Jul 11, 2023
69e370c
Merge remote-tracking branch 'origin/feature/aheggest_CRTPMTforProduc…
miquelnebot Jul 11, 2023
8685c7b
Merge remote-tracking branch 'origin/feature/aheggest_CRTTimeRefsForP…
miquelnebot Jul 11, 2023
80f0cb0
Merge remote-tracking branch 'origin/feature/Zennnamo_POT_Trigv3_fix_…
miquelnebot Jul 11, 2023
6be69ac
Merge remote-tracking branch 'origin/feature/jlarkin_offbeam_gates_pr…
miquelnebot Jul 11, 2023
4ce8a7e
Initial commit
Jul 31, 2023
0ec5402
fill Matched CRT Hit positions into SRCRTPMTMatch in CAFs
aheggest Aug 1, 2023
3f1afa5
Merge remote-tracking branch 'origin/feature/aheggest_CRTPMTfixesForP…
miquelnebot Aug 2, 2023
6eb8d10
update version for patch
miquelnebot Aug 2, 2023
b904999
Merge remote-tracking branch 'JackSmedley/feature/jsmedley_fillBaryce…
miquelnebot Aug 2, 2023
ba06fd7
update version for patch
miquelnebot Aug 2, 2023
1647fcb
Merge remote-tracking branch 'PetrilloAtWork/feature/gp_CAFsrc_SBN202…
miquelnebot Aug 2, 2023
9712afa
CAFMaker adapted for SRHeader workaround
PetrilloAtWork Aug 2, 2023
d20e4de
Merge remote-tracking branch 'PetrilloAtWork/feature/gp_CAFsrc_SBN202…
miquelnebot Aug 3, 2023
bf0972d
Fix exposure branches to be filled per subrun instead of per file and…
jacoblarkin Nov 28, 2023
61e5d39
Copy cafmaker changes to production
Nov 28, 2023
f53bdcc
Merge pull request #401 from JackSmedley/feature/jsmedley_Barycetner_…
miquelnebot Nov 30, 2023
ac417b8
Merge pull request #399 from SBNSoftware/feature/jlarkin_exposure_bugfix
miquelnebot Nov 30, 2023
f429148
Update Supera commit tag to include data fcl file fixes
francois-drielsma Nov 30, 2023
e434082
version and deps update for production patch
miquelnebot Nov 30, 2023
f807b35
Update Supera commit to revert to old art nomenclature
francois-drielsma Dec 1, 2023
c286389
Merge remote-tracking branch 'francois-drielsma/feature/drielsma_supe…
miquelnebot Dec 1, 2023
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)

find_package(cetmodules 3.20.00 REQUIRED)
project(sbncode VERSION 09.72.00.03 LANGUAGES CXX)
project(sbncode VERSION 09.72.00.06 LANGUAGES CXX)

message(STATUS "\n\n ========================== ${PROJECT_NAME} ==========================")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////////////////
// Class: EXTRetriever
// Class: BNBEXTRetriever
// Plugin Type: producer
// File: EXTRetriever_module.cc
// File: BNBEXTRetriever_module.cc
//
// Created by hand Thurs June 24th 2021 by J. Zennamo (FNAL)
//
Expand All @@ -22,7 +22,7 @@
#include "larcorealg/Geometry/Exceptions.h"

#include "artdaq-core/Data/Fragment.hh"
#include "sbndaq-artdaq-core/Overlays/ICARUS/ICARUSTriggerUDPFragment.hh"
#include "sbndaq-artdaq-core/Overlays/ICARUS/ICARUSTriggerV3Fragment.hh"

#include "lardataalg/DetectorInfo/DetectorPropertiesStandard.h"
#include "lardata/DetectorInfoServices/DetectorPropertiesService.h"
Expand All @@ -36,10 +36,10 @@
#include <time.h>

namespace sbn {
class EXTRetriever;
class BNBEXTRetriever;
}

class sbn::EXTRetriever : public art::EDProducer {
class sbn::BNBEXTRetriever : public art::EDProducer {
public:

struct Config {
Expand All @@ -57,15 +57,15 @@ class sbn::EXTRetriever : public art::EDProducer {
using Parameters = art::EDProducer::Table<Config>;


explicit EXTRetriever(Parameters const& params);
explicit BNBEXTRetriever(Parameters const& params);
// The compiler-generated destructor is fine for non-base
// classes without bare pointers or other resource use.

// Plugins should not be copied or assigned.
EXTRetriever(EXTRetriever const&) = delete;
EXTRetriever(EXTRetriever&&) = delete;
EXTRetriever& operator=(EXTRetriever const&) = delete;
EXTRetriever& operator=(EXTRetriever&&) = delete;
BNBEXTRetriever(BNBEXTRetriever const&) = delete;
BNBEXTRetriever(BNBEXTRetriever&&) = delete;
BNBEXTRetriever& operator=(BNBEXTRetriever const&) = delete;
BNBEXTRetriever& operator=(BNBEXTRetriever&&) = delete;

// Required functions.
void produce(art::Event& e) override;
Expand All @@ -82,7 +82,7 @@ class sbn::EXTRetriever : public art::EDProducer {
};


sbn::EXTRetriever::EXTRetriever(Parameters const& params)
sbn::BNBEXTRetriever::BNBEXTRetriever(Parameters const& params)
: EDProducer{params},
raw_data_label_(params().RawDataLabel())
{
Expand All @@ -91,7 +91,7 @@ sbn::EXTRetriever::EXTRetriever(Parameters const& params)
TotalEXTCounts = 0;
}

void sbn::EXTRetriever::produce(art::Event& e)
void sbn::BNBEXTRetriever::produce(art::Event& e)
{

//Here we read in the artdaq Fragments and extract three pieces of information:
Expand All @@ -100,19 +100,22 @@ void sbn::EXTRetriever::produce(art::Event& e)
// 3. the number of beam spills since the previously triggered event, number_of_gates_since_previous_event

int gate_type = 0;
auto const & raw_data = e.getProduct< std::vector<artdaq::Fragment> >({ raw_data_label_, "ICARUSTriggerUDP" });
auto const & raw_data = e.getProduct< std::vector<artdaq::Fragment> >({ raw_data_label_, "ICARUSTriggerV3" });

unsigned int number_of_gates_since_previous_event = 0;

for(auto raw_datum : raw_data){

icarus::ICARUSTriggerUDPFragment frag(raw_datum);
icarus::ICARUSTriggerV3Fragment frag(raw_datum);
std::string data = frag.GetDataString();
char *buffer = const_cast<char*>(data.c_str());
icarus::ICARUSTriggerInfo datastream_info = icarus::parse_ICARUSTriggerString(buffer);
icarus::ICARUSTriggerInfo datastream_info = icarus::parse_ICARUSTriggerV3String(buffer);
gate_type = datastream_info.gate_type;
number_of_gates_since_previous_event = frag.getDeltaGatesBNB();
number_of_gates_since_previous_event = frag.getDeltaGatesBNBOffMaj();

std::cout << "BNB OFF MAJ : " << frag.getDeltaGatesBNBOffMaj() << std::endl;
std::cout << "NuMI OFF MAJ : " << frag.getDeltaGatesNuMIOffMaj() << std::endl;

}

//We only want to process EXT gates, i.e. type 3
Expand All @@ -135,13 +138,13 @@ void sbn::EXTRetriever::produce(art::Event& e)
} //end loop over events


void sbn::EXTRetriever::beginSubRun(art::SubRun& sr)
void sbn::BNBEXTRetriever::beginSubRun(art::SubRun& sr)
{
return;
}

//____________________________________________________________________________
void sbn::EXTRetriever::endSubRun(art::SubRun& sr)
void sbn::BNBEXTRetriever::endSubRun(art::SubRun& sr)
{
// We will add all of the EXTCountInfo data-products to the
// art::SubRun so it persists
Expand All @@ -152,4 +155,4 @@ void sbn::EXTRetriever::endSubRun(art::SubRun& sr)
return;
}

DEFINE_ART_MODULE(sbn::EXTRetriever)
DEFINE_ART_MODULE(sbn::BNBEXTRetriever)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cet_build_plugin(EXTRetriever art::module
cet_build_plugin(BNBEXTRetriever art::module
LIBRARIES
art::Persistency_Common
art::Utilities canvas::canvas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "larcorealg/CoreUtils/counter.h"

#include "artdaq-core/Data/Fragment.hh"
#include "sbndaq-artdaq-core/Overlays/ICARUS/ICARUSTriggerV2Fragment.hh"
#include "sbndaq-artdaq-core/Overlays/ICARUS/ICARUSTriggerV3Fragment.hh"

#include "sbnobj/Common/POTAccounting/BNBSpillInfo.h"

Expand Down Expand Up @@ -245,23 +245,23 @@ sbn::BNBRetriever::TriggerInfo_t sbn::BNBRetriever::extractTriggerInfo(art::Even
// 2. the time of the previously triggered event, t_previous_event (NOTE: Events are non-sequential!)
// 3. the number of beam spills since the previously triggered event, number_of_gates_since_previous_event

auto const & raw_data = e.getProduct< std::vector<artdaq::Fragment> >({ raw_data_label, "ICARUSTriggerV2" });
auto const & raw_data = e.getProduct< std::vector<artdaq::Fragment> >({ raw_data_label, "ICARUSTriggerV3" });

TriggerInfo_t triggerInfo;

for(auto raw_datum : raw_data){

uint64_t artdaq_ts = raw_datum.timestamp();
icarus::ICARUSTriggerV2Fragment frag(raw_datum);
icarus::ICARUSTriggerV3Fragment frag(raw_datum);
std::string data = frag.GetDataString();
char *buffer = const_cast<char*>(data.c_str());
icarus::ICARUSTriggerInfo datastream_info = icarus::parse_ICARUSTriggerV2String(buffer);
icarus::ICARUSTriggerInfo datastream_info = icarus::parse_ICARUSTriggerV3String(buffer);
triggerInfo.gate_type = datastream_info.gate_type;
triggerInfo.number_of_gates_since_previous_event = frag.getDeltaGatesBNB();
triggerInfo.number_of_gates_since_previous_event = frag.getDeltaGatesBNBMaj();

triggerInfo.t_current_event = static_cast<double>(artdaq_ts)/(1000000000.0); //check this offset...
if(triggerInfo.gate_type == 1)
triggerInfo.t_previous_event = (static_cast<double>(frag.getLastTimestampBNB()))/(1e9);
triggerInfo.t_previous_event = (static_cast<double>(frag.getLastTimestampBNBMaj()))/(1e9);
else
triggerInfo.t_previous_event = (static_cast<double>(frag.getLastTimestampOther()))/(1000000000.0);

Expand Down
3 changes: 2 additions & 1 deletion sbncode/BeamSpillInfoRetriever/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
add_subdirectory(BNBRetriever)
add_subdirectory(NuMIRetriever)
add_subdirectory(EXTRetriever)
add_subdirectory(BNBEXTRetriever)
add_subdirectory(NuMIEXTRetriever)
add_subdirectory(job)

install_headers()
Expand Down
20 changes: 20 additions & 0 deletions sbncode/BeamSpillInfoRetriever/NuMIEXTRetriever/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

cet_build_plugin(NuMIEXTRetriever art::module
LIBRARIES
art::Persistency_Common
art::Utilities canvas::canvas
cetlib::cetlib cetlib_except::cetlib_except
messagefacility::MF_MessageLogger
sbnobj::Common_POTAccounting
sbndaq_artdaq_core::sbndaq-artdaq-core_Overlays_Common
sbndaq_artdaq_core::sbndaq-artdaq-core_Overlays
sbndaq_artdaq_core::sbndaq-artdaq-core_Overlays_ICARUS
artdaq_core::artdaq-core_Utilities
lardata::Utilities
larcore::Geometry_AuxDetGeometry_service
)

install_headers()
install_fhicl()
install_source()

Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
////////////////////////////////////////////////////////////////////////
// Class: NuMIEXTRetriever
// Plugin Type: producer
// File: NuMIEXTRetriever_module.cc
//
// Created by hand Thurs June 24th 2021 by J. Zennamo (FNAL)
//
////////////////////////////////////////////////////////////////////////

#include "art/Framework/Core/EDProducer.h"
#include "art/Framework/Core/ModuleMacros.h"
#include "art/Framework/Principal/Event.h"
#include "art/Framework/Principal/Handle.h"
#include "art/Framework/Principal/Run.h"
#include "art/Framework/Principal/SubRun.h"
#include "canvas/Utilities/InputTag.h"
#include "fhiclcpp/types/Atom.h"
#include "messagefacility/MessageLogger/MessageLogger.h"
#include "lardata/Utilities/AssociationUtil.h"
#include "lardataobj/Utilities/sparse_vector.h"
#include "larcoreobj/SimpleTypesAndConstants/RawTypes.h"
#include "larcorealg/Geometry/Exceptions.h"

#include "artdaq-core/Data/Fragment.hh"
#include "sbndaq-artdaq-core/Overlays/ICARUS/ICARUSTriggerV3Fragment.hh"

#include "lardataalg/DetectorInfo/DetectorPropertiesStandard.h"
#include "lardata/DetectorInfoServices/DetectorPropertiesService.h"
#include "sbnobj/Common/POTAccounting/EXTCountInfo.h"

#include <memory>
#include <optional>
#include <vector>
#include <stdio.h>
#include <string.h>
#include <time.h>

namespace sbn {
class NuMIEXTRetriever;
}

class sbn::NuMIEXTRetriever : public art::EDProducer {
public:

struct Config {

using Name = fhicl::Name;
using Comment = fhicl::Comment;

fhicl::Atom<std::string> RawDataLabel {
Name{ "raw_data_label" },
Comment{ "art data product instance name for trigger information (product label is 'daq')" }
};

}; // Config

using Parameters = art::EDProducer::Table<Config>;


explicit NuMIEXTRetriever(Parameters const& params);
// The compiler-generated destructor is fine for non-base
// classes without bare pointers or other resource use.

// Plugins should not be copied or assigned.
NuMIEXTRetriever(NuMIEXTRetriever const&) = delete;
NuMIEXTRetriever(NuMIEXTRetriever&&) = delete;
NuMIEXTRetriever& operator=(NuMIEXTRetriever const&) = delete;
NuMIEXTRetriever& operator=(NuMIEXTRetriever&&) = delete;

// Required functions.
void produce(art::Event& e) override;
void beginSubRun(art::SubRun& sr) override;
void endSubRun(art::SubRun& sr) override;

private:
std::vector< sbn::EXTCountInfo > fOutExtInfos;

// input labels
std::string raw_data_label_;
int TotalEXTCounts;

};


sbn::NuMIEXTRetriever::NuMIEXTRetriever(Parameters const& params)
: EDProducer{params},
raw_data_label_(params().RawDataLabel())
{

produces< std::vector< sbn::EXTCountInfo >, art::InSubRun >();
TotalEXTCounts = 0;
}

void sbn::NuMIEXTRetriever::produce(art::Event& e)
{

//Here we read in the artdaq Fragments and extract three pieces of information:
// 1. The time of the current event, t_current_event
// 2. the time of the previously triggered event, t_previous_event (NOTE: Events are non-sequential!)
// 3. the number of beam spills since the previously triggered event, number_of_gates_since_previous_event

//int gate_type = 0;
auto const & raw_data = e.getProduct< std::vector<artdaq::Fragment> >({ raw_data_label_, "ICARUSTriggerV3" });

unsigned int number_of_gates_since_previous_event = 0;

for(auto raw_datum : raw_data){

icarus::ICARUSTriggerV3Fragment frag(raw_datum);
std::string data = frag.GetDataString();
char *buffer = const_cast<char*>(data.c_str());
icarus::ICARUSTriggerInfo datastream_info = icarus::parse_ICARUSTriggerV3String(buffer);
//gate_type = datastream_info.gate_type;
number_of_gates_since_previous_event = frag.getDeltaGatesNuMIOffMaj();


}

//We only want to process EXT gates, i.e. type 3

// Keep track of the number of beam gates the DAQ thinks
// are in this file
TotalEXTCounts += number_of_gates_since_previous_event;

//Store everything in our data-product
sbn::EXTCountInfo extInfo;
extInfo.gates_since_last_trigger = number_of_gates_since_previous_event;

fOutExtInfos.push_back(extInfo);
// We do not write these to the art::Events because
// we can filter events but want to keep all the POT
// information, so we'll write it to the SubRun


} //end loop over events


void sbn::NuMIEXTRetriever::beginSubRun(art::SubRun& sr)
{
return;
}

//____________________________________________________________________________
void sbn::NuMIEXTRetriever::endSubRun(art::SubRun& sr)
{
// We will add all of the EXTCountInfo data-products to the
// art::SubRun so it persists
auto p = std::make_unique< std::vector< sbn::EXTCountInfo > >(fOutExtInfos);

sr.put(std::move(p));

return;
}

DEFINE_ART_MODULE(sbn::NuMIEXTRetriever)
Loading