Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
60121d3
Read from the channel mapping also the laser label
ascarpel May 13, 2022
0156ac4
Midway point commit
ascarpel Jun 2, 2022
eff349a
kickoff commit
ascarpel Jun 2, 2022
a0b69e3
Commit that compiles. TODO:add trigger time and clock period from ser…
ascarpel Jun 3, 2022
8baa277
Fixed clock services problems
ascarpel Jun 3, 2022
a62a1ff
Fixed minor problems for better performances and reading of the code
ascarpel Jun 7, 2022
811417f
Some fixes and tests for the TimingCorrectionExtraction_module.cc
ascarpel Jun 14, 2022
74c786f
Merge branch 'develop' into feature/ascarpel_laserchannelmapping
ascarpel Jun 15, 2022
ee509c7
Smarter Flash Analyzer
ascarpel Jul 6, 2022
9748444
add some CRT changes from F. Poppi
ascarpel Jul 26, 2022
78efe91
Merge branch 'develop' into feature/ascarpel_timing_pmt_crt
ascarpel Jul 27, 2022
f3350a6
Timing corrections
ascarpel Sep 4, 2022
8908d46
Moved the timing corrections to a service
ascarpel Sep 4, 2022
0d6cc45
Add implementation of the function extracting the timing corrections
ascarpel Sep 5, 2022
bf6f485
Apply time corrections
ascarpel Sep 5, 2022
ef5d4c1
Decode/BeamBits.h
ascarpel Sep 6, 2022
483c43d
Fixed small bug causing segmentation falut
ascarpel Sep 6, 2022
a3bceba
Add timing correction also for OpHit. General bug and stability tests
ascarpel Sep 7, 2022
87a3cbd
Removed unwanted files
ascarpel Sep 7, 2022
70be31c
Merge conflicts fixed
ascarpel Sep 7, 2022
f19b9e7
PMTTimingCorrectionService now automatically updates on a new run.
PetrilloAtWork Sep 8, 2022
d15ec82
PMTTimingCorrectionService interface made constant
PetrilloAtWork Sep 8, 2022
8c4ef66
PMTTimingCorrections now adheres to the service/provider model
PetrilloAtWork Sep 8, 2022
b2d9b95
PMT decoder now stores the timing correction extractor statically.
PetrilloAtWork Sep 8, 2022
9284bee
Fixed merge issue in PMT decoder
PetrilloAtWork Sep 8, 2022
b610595
PMT time corrections can't be overwritten
PetrilloAtWork Sep 12, 2022
860f241
Data product review: icarus::timing::PMTWaveformTimeCorrection
PetrilloAtWork Sep 12, 2022
9b8e4ff
PMT timing correction: enhanced error reporting
PetrilloAtWork Sep 13, 2022
c1f7625
PMT cable delay correction made optional
PetrilloAtWork Sep 13, 2022
bebdc1f
Added documentation for PMT timing corrections
PetrilloAtWork Sep 13, 2022
6e91db3
Removed spurious file
PetrilloAtWork Sep 13, 2022
9d60c7c
Indentation fixes
PetrilloAtWork Sep 13, 2022
d943594
Good coding practiced imposed to OpHitTimingCorrection module
PetrilloAtWork Sep 13, 2022
f1eb730
Timing/OpHitTimingCorrection supports art multithreading
PetrilloAtWork Sep 13, 2022
a2b3e3f
Some good practices applied to PMT timing code
PetrilloAtWork Sep 13, 2022
978b911
Merge remote-tracking branch 'upstream/develop' into feature/ascarpel…
PetrilloAtWork Sep 19, 2022
427015e
Merge remote-tracking branch 'upstream/develop' into feature/ascarpel…
PetrilloAtWork Sep 23, 2022
f02f971
The default ophit data product is now time-corrected.
PetrilloAtWork Sep 25, 2022
3610d7c
use T1 (aka T0 wrt global trigger) for CRT hit time, small fix from F…
Sep 26, 2022
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 icaruscode/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

set( IFDH_ART_DIR $ENV{IFDH_ART_DIR} )

add_subdirectory(Timing)
add_subdirectory(IcarusObj)

add_subdirectory(Analysis)
add_subdirectory(CRT)
add_subdirectory(Decode)
Expand Down
16 changes: 9 additions & 7 deletions icaruscode/CRT/CRTPMTMatchingAna_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ void icarus::crt::CRTPMTMatchingAna::analyze(art::Event const& e)
xyzt.push_back(rcrt.X());
xyzt.push_back(rcrt.Y());
xyzt.push_back(rcrt.Z());

double tcrt = double(m_gate_start_timestamp - crt->ts0_ns)/1e3;
tcrt = -tcrt+1e6;
double tcrt = crt->ts1_ns/1e3;
/*double tcrt = double(m_gate_start_timestamp - crt->ts0_ns)/1e3;
tcrt = -tcrt+1e6;*/

// double tcrt = (int32_t)crt->ts0_ns;// - fCrtDelay;
//uint64_t tcrt = crt->ts0_ns;
Expand Down Expand Up @@ -331,7 +331,7 @@ void icarus::crt::CRTPMTMatchingAna::analyze(art::Event const& e)
}

double tflash = flash->Time();//*1e3;//-fOpDelay;

//std::cout << "tflash: " << tflash << "\n";
TVector3 rflash(0,flash->YCenter(),flash->ZCenter());
TVector3 vdiff = rcrt-rflash;
//std::cout << "flash time: "<<flash->Time() << " absdiff : "<< abs(tcrt-tflash)<< std::endl;
Expand All @@ -346,8 +346,8 @@ void icarus::crt::CRTPMTMatchingAna::analyze(art::Event const& e)
xyzt.push_back(tflash);
matched = true;
matchtpc = flashList.first;

vector<art::Ptr<recob::OpHit>> hits = findManyHits.at(iflash);
std::cout << "Flash matched! tcrt: " << tcrt << ", tflash: " << tflash << ", tdiff: " << tdiff << "\n";
for(auto const& hit : hits) {
double tPmt = hit->PeakTime();//*1.e3;//-fOpDelay;
if( tPmt < flashHitT) {
Expand Down Expand Up @@ -395,10 +395,11 @@ void icarus::crt::CRTPMTMatchingAna::analyze(art::Event const& e)
double pemax = 0.;
for(auto const& hit : opHitList) {
double thit = hit->PeakTime();//*1e3-fOpDelay;

if(hit->PE()<fHitPeThresh){
continue;
}

//std::cout << "thit: " << thit << "\n";

//if(abs(tcrt-thit)<abs(tdiff)) {
if(abs(tcrt-thit)<fCoinWindow && hit->PE()>pemax) {
Expand All @@ -419,7 +420,8 @@ void icarus::crt::CRTPMTMatchingAna::analyze(art::Event const& e)
xyzt.push_back(thit);

matched = true;
std::cout << "thit: "<<thit << " , tcrt: " << tcrt << " , tdiff " << tdiff << std::endl;
std::cout << "Hit matched! tcrt: " << tcrt << ", thit: " << thit << ", tdiff: " << tdiff << "\n";
//std::cout << "thit: "<<thit << " , tcrt: " << tcrt << " , tdiff " << tdiff << std::endl;
}//if min tof
}//for OpHits
if(!matched) {
Expand Down
2 changes: 1 addition & 1 deletion icaruscode/CRT/CRTUtils/CRTHitRecoAlg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ vector<pair<sbn::crt::CRTHit, vector<int>>> CRTHitRecoAlg::CreateCRTHits(vector<
if (!CRTReset.empty()) GlobalTrigger = GetMode(CRTReset);
//Add average difference between trigger_timestamp and Global trigger
else GlobalTrigger=GlobalTrigger-trigger_offset;// In this event, the T1 Reset was probably "vetoed" by the T0 Reset
for (int i=0; i<304; i++){
for (int i=0; i<305; i++){
if (TriggerArray[i]==0) TriggerArray[i]=GlobalTrigger;
}
//std::cout<<"Global Trigger "<<GlobalTrigger<<std::endl;
Expand Down
2 changes: 2 additions & 0 deletions icaruscode/Decode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ simple_plugin(DaqDecoderICARUSPMT module
sbnobj_Common_Trigger
icaruscode_Decode_DecoderTools_Dumpers
icaruscode_Decode_DecoderTools
icaruscode_Timing
icaruscode_Timing_DataProducts
sbndaq_artdaq_core::sbndaq-artdaq-core_Overlays_Common
sbndaq_artdaq_core::sbndaq-artdaq-core_Overlays
lardataobj_RawData
Expand Down
11 changes: 9 additions & 2 deletions icaruscode/Decode/ChannelMapping/ChannelMapPostGres_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,18 @@ int ChannelMapPostGres::BuildFragmentToDigitizerChannelMap(FragmentToDigitizerCh
// Now recover the digitizer channel number
unsigned int digitizerChannelNo = getLongValue(tuple, 9, &error);
if (error) throw std::runtime_error("Encountered error when trying to recover the PMT digitizer channel number");
// Finally, get the LArsoft channel ID
// Get the LArsoft channel ID
unsigned int channelID = getLongValue(tuple, 17, &error);
if (error) throw std::runtime_error("Encountered error when trying to recover the PMT channel ID");
// Get the laserChannelNumber
char laserChannelBuffer[10];
getStringValue(tuple, 7, laserChannelBuffer, sizeof(laserChannelBuffer), &error);
if (error) throw std::runtime_error("Encountered error when trying to recover the PMT laser channel label");
std::string laserChannelLabel(laserChannelBuffer, 2, sizeof(laserChannelBuffer)); //sizeof(digitizerBuffer));
unsigned int laserChannel = std::stol(laserChannelLabel); // try-catch syntax for stol or not necessary ?

// Fill the map
fragmentToDigitizerChannelMap[fragmentID].emplace_back(digitizerChannelNo,channelID);
fragmentToDigitizerChannelMap[fragmentID].emplace_back(digitizerChannelNo,channelID,laserChannel);
releaseTuple(tuple);
}
}
Expand Down
7 changes: 6 additions & 1 deletion icaruscode/Decode/ChannelMapping/ChannelMapSQLite_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,13 @@ int buildTPCFragmentIDToReadoutIDMap_callback(void* dataIn, int argc, char**argv
unsigned int digitizerChannelNo = std::stol(argv[9]);
unsigned int channelID = std::stol(argv[17]);

// Read the laser channel
std::string laserChannelLabel = argv[7]; // format is L-<number> . <number> is int from [1-41]
unsigned int laserChannel = std::stol(laserChannelLabel.substr(2,4)); // try-catch syntax for stol or not necessary ?


// Fill the map
fragmentToDigitizerChannelMap[fragmentID].emplace_back(digitizerChannelNo,channelID);
fragmentToDigitizerChannelMap[fragmentID].emplace_back(digitizerChannelNo,channelID,laserChannel);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion icaruscode/Decode/ChannelMapping/IChannelMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace icarusDB
* and the related crate and readout information.
* Then define the function interface to fill these data structures
*/
using DigitizerChannelChannelIDPair = std::pair<size_t,size_t>;
using DigitizerChannelChannelIDPair = std::tuple<size_t,size_t,size_t>; // std::tuple<DigitizerChannel, ChannelID, LaserChannel>
using DigitizerChannelChannelIDPairVec = std::vector<DigitizerChannelChannelIDPair>;
using FragmentToDigitizerChannelMap = std::map<size_t, DigitizerChannelChannelIDPairVec>;

Expand Down
2 changes: 1 addition & 1 deletion icaruscode/Decode/ChannelMapping/IICARUSChannelMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using ReadoutIDVec = std::vector<unsigned int>;
using ChannelPlanePair = std::pair<unsigned int, unsigned int>;
using ChannelPlanePairVec = std::vector<ChannelPlanePair>;

using DigitizerChannelChannelIDPair = std::pair<size_t,size_t>;
using DigitizerChannelChannelIDPair = std::tuple<size_t,size_t, size_t>;
using DigitizerChannelChannelIDPairVec = std::vector<DigitizerChannelChannelIDPair>;

using ChannelPlanePair = std::pair<unsigned int, unsigned int>;
Expand Down
6 changes: 3 additions & 3 deletions icaruscode/Decode/ChannelMapping/PMTChannelMapDumper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ int main(int argc, char** argv) {
log
<< "[" << iFragment << "] " << std::hex << fragmentID << std::dec
<< " includes " << digitizerChannels.size()
<< " LArSoft channels between " << digitizerChannels.front().second
<< " and " << digitizerChannels.back().second
<< " LArSoft channels between " << std::get<1U>( digitizerChannels.front() )
<< " and " << std::get<1U>( digitizerChannels.back() )
<< " [board channel index in brackets]:";
constexpr unsigned int Cols = 8U;
unsigned int n = 0;
for(auto const [ digitizerChannel, channelID ]: digitizerChannels) {
for(auto const [ digitizerChannel, channelID, laserChannel ]: digitizerChannels) {
if (n-- == 0) { log << "\n "; n = Cols - 1U; }
log << " " << std::setw(3) << channelID
<< " [" << std::setw(3) << digitizerChannel << "]";
Expand Down
Loading