diff --git a/UserTools/ClusterClassifiers/ClusterClassifiers.cpp b/UserTools/ClusterClassifiers/ClusterClassifiers.cpp index 6b8fb705f..2120db005 100644 --- a/UserTools/ClusterClassifiers/ClusterClassifiers.cpp +++ b/UserTools/ClusterClassifiers/ClusterClassifiers.cpp @@ -222,8 +222,8 @@ double ClusterClassifiers::CalculateChargeBalance(std::vector cluster_hits) total_Q+= tube_charge; total_QSquared += (tube_charge * tube_charge); } - //FIXME: Need a method to have the 123 be equal to the number of operating detectors - double charge_balance = sqrt((total_QSquared)/(total_Q*total_Q) - (1./123.)); + //FIXME: Need a method to have the 1/N be equal to the number of operating detectors + double charge_balance = sqrt((total_QSquared)/(total_Q*total_Q) - (1./121.)); if(verbosity>4) std::cout << "ClusterClassifiers Tool: Calculated charge balance of " << charge_balance << std::endl; return charge_balance; } @@ -249,8 +249,8 @@ double ClusterClassifiers::CalculateChargeBalanceMC(std::vector cluster_h total_Q+= tube_charge; total_QSquared += (tube_charge * tube_charge); } - //FIXME: Need a method to have the 123 be equal to the number of operating detectors - double charge_balance = sqrt((total_QSquared)/(total_Q*total_Q) - (1./123.)); + //FIXME: Need a method to have the 1/N be equal to the number of operating detectors + double charge_balance = sqrt((total_QSquared)/(total_Q*total_Q) - (1./121.)); if(verbosity>4) std::cout << "ClusterClassifiers Tool: Calculated charge balance of " << charge_balance << std::endl; return charge_balance; } diff --git a/UserTools/ClusterFinder/ClusterFinder.cpp b/UserTools/ClusterFinder/ClusterFinder.cpp index f88ca62c6..b3f7748bc 100644 --- a/UserTools/ClusterFinder/ClusterFinder.cpp +++ b/UserTools/ClusterFinder/ClusterFinder.cpp @@ -211,39 +211,84 @@ bool ClusterFinder::Execute(){ std::vector datalike_hits; std::vector datalike_hits_charge; for (MCHit &ahit : ThisPMTHits){ - //std::cout <<"Key: "< 2000.) std::cout <<"Found hit later than 2us! Hit time : "< combine multiple photons if they are within a 10ns range - //hit times can only be recorded with 2ns precision --> possible times are 0ns, 2ns, 4ns, ... - hits_2ns_res.push_back(2*(int(ahit.GetTime())/2.)+(int(ahit.GetTime())%2)); + hits_2ns_res.push_back(ahit.GetTime()); hits_2ns_res_charge.push_back(ahit.GetCharge()); } } //Combine multiple MC hits to one pulse std::sort(hits_2ns_res.begin(),hits_2ns_res.end()); - for (int i_hit=0; i_hit < (int) hits_2ns_res.size(); i_hit++){ - double hit1 = hits_2ns_res.at(i_hit); - if (datalike_hits.size()==0) { - datalike_hits.push_back(hit1); - datalike_hits_charge.push_back(hits_2ns_res_charge.at(i_hit)); - } - else { + std::vector temp_times; + double temp_charges = 0.0; + double mid_time; + if (verbose > 0){ + std::cout << " " << std::endl; + std::cout << hits_2ns_res.size() << " total photon hits(s)" << std::endl; + } + + if (hits_2ns_res.size() > 0){ + for (int i_hit=0; i_hit < (int) hits_2ns_res.size(); i_hit++){ + double hit1 = hits_2ns_res.at(i_hit); + if (temp_times.size()==0) { + temp_times.push_back(hit1); + temp_charges += hits_2ns_res_charge.at(i_hit); + } + + else { bool new_pulse = false; - for (int j_hit=0; j_hit < (int) datalike_hits.size(); j_hit++){ - if (fabs(datalike_hits.at(j_hit)-hit1)<10.) { + if (fabs(temp_times[0]-hit1)<10.) { new_pulse=false; - datalike_hits_charge.at(j_hit)+=hits_2ns_res_charge.at(i_hit); - break; + temp_charges+=hits_2ns_res_charge.at(i_hit); + temp_times.push_back(hit1); } else new_pulse=true; - } + if (new_pulse) { - datalike_hits.push_back(hit1); //Only count as a new pulse if it was 10ns away from every other pulse - datalike_hits_charge.push_back(hits_2ns_res_charge.at(i_hit)); + // following the DigitBuilder tool --> take median photon hit time as the hit time of the "pulse" + if (temp_times.size() % 2 == 0){ + mid_time = (temp_times.at(temp_times.size()/2 - 1) + temp_times.at(temp_times.size()/2))/2; + } else{ + mid_time = temp_times.at(temp_times.size()/2); + } + + datalike_hits.push_back(mid_time); + datalike_hits_charge.push_back(temp_charges); + temp_times.clear(); + temp_charges = 0; + temp_times.push_back(hit1); + temp_charges += hits_2ns_res_charge.at(i_hit); + } } } + if (temp_times.size() % 2 == 0){ + mid_time = (temp_times.at(temp_times.size()/2 - 1) + temp_times.at(temp_times.size()/2))/2; + } else{ + mid_time = temp_times.at(temp_times.size()/2); + } + + datalike_hits.push_back(mid_time); + datalike_hits_charge.push_back(temp_charges); + + if (verbose > 0){ + std::cout << " " << std::endl; + std::cout << datalike_hits.size() << " MC pulse(s) identified from the raw photon hit(s)" << std::endl; + std::cout << "Pulse time(s):" << std::endl; + for (int ih=0; ih < (int) datalike_hits.size(); ih++){ + double junk = datalike_hits.at(ih); + std::cout << junk << " "; + } + std::cout << " " << std::endl; + std::cout << "Pulse charge(s):" << std::endl; + for (int ih=0; ih < (int) datalike_hits_charge.size(); ih++){ + double junk2 = datalike_hits_charge.at(ih); + std::cout << junk2 << " "; + } + std::cout << " " << std::endl; + } + } + for (int i_hit = 0; i_hit < (int) datalike_hits.size(); i_hit++){ //v_hittimes.push_back(ahit.GetTime()); // fill a vector with all hit times (unsorted) v_hittimes.push_back(datalike_hits.at(i_hit)); @@ -295,7 +340,7 @@ bool ClusterFinder::Execute(){ // Now sort the hit time array, fill the highest time in a new array until the old array is empty do { - double max_time = 0; + double max_time = -9999; int i_max_time = 0; for (std::vector::iterator it = v_hittimes.begin(); it != v_hittimes.end(); ++it) { if (*it > max_time) { @@ -321,12 +366,21 @@ bool ClusterFinder::Execute(){ } thiswindow_Nhits = 0; v_mini_hits.clear(); - for (double j_time = *it; j_time < *it + ClusterFindingWindow; j_time+=2){ // loops through times in the window and check if there's a hit at this time + for (double j_time = *it; j_time < *it + ClusterFindingWindow; j_time+=1){ // loops through times in the window and check if there's a hit at this time for(std::vector::iterator it2 = v_hittimes_sorted.begin(); it2 != v_hittimes_sorted.end(); ++it2) { - if (*it2 == j_time) { - thiswindow_Nhits++; - v_mini_hits.push_back(*it2); + if(HitStoreName=="MCHits"){ + if (static_cast(j_time) == static_cast(*it2)) { // accept all hit times (some may be smeared to negative values) + thiswindow_Nhits++; + v_mini_hits.push_back(*it2); + } } + if(HitStoreName=="Hits"){ + if (*it2 > 0 && static_cast(j_time) == static_cast(*it2)) { // reject hit times in the data that are 0 + thiswindow_Nhits++; + v_mini_hits.push_back(*it2); + } + } + } } if (!v_mini_hits.empty()) { diff --git a/UserTools/EventSelector/EventSelector.cpp b/UserTools/EventSelector/EventSelector.cpp index 4563381a5..580929850 100644 --- a/UserTools/EventSelector/EventSelector.cpp +++ b/UserTools/EventSelector/EventSelector.cpp @@ -14,7 +14,7 @@ bool EventSelector::Initialise(std::string configfile, DataModel &data){ fPMTMRDOffset = false; fIsMC = true; - fPMTMRDOffset = 745; + fPMTMRDOffset = 755; fRecoPDG = -1; //Get the tool configuration variables @@ -695,8 +695,15 @@ bool EventSelector::EventSelectionByPMTMRDCoinc() { for (unsigned int i_hit = 0; i_hit < Hits.size(); i_hit++){ time_temp+=Hits.at(i_hit).GetTime(); int tube = Hits.at(i_hit).GetTubeId(); - double charge_pe = Hits.at(i_hit).GetCharge()/ChannelNumToTankPMTSPEChargeMap->at(tube); - charge_temp+=charge_pe; + // check if PMT is present in the map before accessing it + auto it = ChannelNumToTankPMTSPEChargeMap->find(tube); + if (it != ChannelNumToTankPMTSPEChargeMap->end()) { + double charge_pe = Hits.at(i_hit).GetCharge() / it->second; + charge_temp += charge_pe; + } else { + std::cerr << "PMT channel with hit not found in ChannelNumToTankPMTSPEChargeMap. Skipping this hit." << std::endl; + continue; + } } if (Hits.size()>0) time_temp/=Hits.size(); vec_pmtclusters_charge->push_back(charge_temp); @@ -769,7 +776,7 @@ bool EventSelector::EventSelectionByPMTMRDCoinc() { if (verbosity > 1) std::cout <<"max_charge: "< pmtmrd_coinc_min && time_diff < pmtmrd_coinc_max && max_charge > 200 && n_hits >= 20){ + if (time_diff > pmtmrd_coinc_min && time_diff < pmtmrd_coinc_max){ coincidence = true; vector_mrd_coincidence.push_back(i_mrd); } diff --git a/UserTools/LoadGeometry/LoadGeometry.cpp b/UserTools/LoadGeometry/LoadGeometry.cpp index b93355c1b..de93f7e7b 100644 --- a/UserTools/LoadGeometry/LoadGeometry.cpp +++ b/UserTools/LoadGeometry/LoadGeometry.cpp @@ -20,6 +20,7 @@ bool LoadGeometry::Initialise(std::string configfile, DataModel &data){ m_variables.Get("FACCMRDGeoFile", fFACCMRDGeoFile); m_variables.Get("TankPMTGeoFile", fTankPMTGeoFile); m_variables.Get("TankPMTGainFile", fTankPMTGainFile); + m_variables.Get("TankPMTTimingOffsetFile", fTankPMTTimingOffsetFile); m_variables.Get("AuxiliaryChannelFile", fAuxChannelFile); m_variables.Get("LAPPDGeoFile", fLAPPDGeoFile); m_variables.Get("DetectorGeoFile", fDetectorGeoFile); @@ -58,6 +59,12 @@ bool LoadGeometry::Initialise(std::string configfile, DataModel &data){ return false; } + if(!this->FileExists(fTankPMTTimingOffsetFile)){ + Log("LoadGeometry Tool: File for Tank PMT Timing offsets does not exist!",v_error,verbosity); + if (verbosity > 0) std::cout << "Filepath was... " << fTankPMTTimingOffsetFile << std::endl; + return false; + } + if(!this->FileExists(fAuxChannelFile)){ Log("LoadGeometry Tool: File for Auxiliary Channels does not exist!",v_error,verbosity); if (verbosity > 0) std::cout << "Filepath was... " << fAuxChannelFile << std::endl; @@ -69,6 +76,7 @@ bool LoadGeometry::Initialise(std::string configfile, DataModel &data){ MRDChannelNumToCrateSpaceMap = new std::map>; TankPMTCrateSpaceToChannelNumMap = new std::map,int>; ChannelNumToTankPMTSPEChargeMap = new std::map; + ChannelNumToTankPMTTimingOffsetMap = new std::map; ChannelNumToTankPMTCrateSpaceMap = new std::map>; AuxCrateSpaceToChannelNumMap = new std::map,int>; AuxChannelNumToTypeMap = new std::map; @@ -87,6 +95,9 @@ bool LoadGeometry::Initialise(std::string configfile, DataModel &data){ //Load TankPMT charge to PE conversion this->LoadTankPMTGains(); + //Load TankPMT timing offsets + this->LoadTankPMTTimingOffsets(); + //Load auxiliary and spare channels this->LoadAuxiliaryChannels(); @@ -100,6 +111,7 @@ bool LoadGeometry::Initialise(std::string configfile, DataModel &data){ m_data->CStore.Set("TankPMTCrateSpaceToChannelNumMap",TankPMTCrateSpaceToChannelNumMap); m_data->CStore.Set("ChannelNumToTankPMTCrateSpaceMap",ChannelNumToTankPMTCrateSpaceMap); m_data->CStore.Set("ChannelNumToTankPMTSPEChargeMap",ChannelNumToTankPMTSPEChargeMap); + m_data->CStore.Set("ChannelNumToTankPMTTimingOffsetMap",ChannelNumToTankPMTTimingOffsetMap); m_data->CStore.Set("AuxCrateSpaceToChannelNumMap",AuxCrateSpaceToChannelNumMap); m_data->CStore.Set("AuxChannelNumToCrateSpaceMap",AuxChannelNumToCrateSpaceMap); m_data->CStore.Set("AuxChannelNumToTypeMap",AuxChannelNumToTypeMap); @@ -906,3 +918,23 @@ void LoadGeometry::LoadTankPMTGains(){ } return; } + +void LoadGeometry::LoadTankPMTTimingOffsets(){ + ifstream myfile(fTankPMTTimingOffsetFile.c_str()); + std::string line; + if (myfile.is_open()){ + //Loop over lines, collect all detector data (should only be one line here) + while(getline(myfile,line)){ + if(verbosity>3) std::cout << line << std::endl; //has our stuff; + if(line.find("#")!=std::string::npos) continue; + std::vector DataEntries; + boost::split(DataEntries,line, boost::is_any_of(","), boost::token_compress_on); + int channelkey = -9999; + double TimingOffset = -9999.; + channelkey = std::stoul(DataEntries.at(0)); + TimingOffset= std::stod(DataEntries.at(2)); + ChannelNumToTankPMTTimingOffsetMap->emplace(channelkey,TimingOffset); + } + } + return; +} diff --git a/UserTools/LoadGeometry/LoadGeometry.h b/UserTools/LoadGeometry/LoadGeometry.h index 9f666ed10..9f4e2210a 100644 --- a/UserTools/LoadGeometry/LoadGeometry.h +++ b/UserTools/LoadGeometry/LoadGeometry.h @@ -36,6 +36,7 @@ class LoadGeometry: public Tool { bool ParseAuxChannelDataEntry(std::vector SpecLine, std::vector AuxChannelLegendEntries); void LoadTankPMTGains(); + void LoadTankPMTTimingOffsets(); Geometry* AnnieGeometry; @@ -49,6 +50,7 @@ class LoadGeometry: public Tool { std::string fFACCMRDGeoFile; std::string fTankPMTGeoFile; std::string fTankPMTGainFile; + std::string fTankPMTTimingOffsetFile; std::string fAuxChannelFile; std::string fLAPPDGeoFile; std::string fDetectorGeoFile; @@ -66,6 +68,7 @@ class LoadGeometry: public Tool { std::map>* ChannelNumToTankPMTCrateSpaceMap; std::map>* AuxChannelNumToCrateSpaceMap; std::map* ChannelNumToTankPMTSPEChargeMap; + std::map* ChannelNumToTankPMTTimingOffsetMap; std::map* AuxChannelNumToTypeMap; std::map,int>* LAPPDCrateSpaceToChannelNumMap; diff --git a/UserTools/LoadWCSim/LoadWCSim.cpp b/UserTools/LoadWCSim/LoadWCSim.cpp index 8e5dc24ad..584092a05 100644 --- a/UserTools/LoadWCSim/LoadWCSim.cpp +++ b/UserTools/LoadWCSim/LoadWCSim.cpp @@ -418,7 +418,7 @@ bool LoadWCSim::Execute(){ int genieentry = firsttrigt->GetHeader()->GetGenieEntryNum(); if(verbosity>1) cout<<"Genie file is "<CStore.Set("GenieFile",geniefilename); - m_data->CStore.Set("GenieEntry",std::to_string(genieentry)); + m_data->CStore.Set("GenieEntry",genieentry); for(int trigi=0; trigiwcsimrootevent->GetNumberOfEvents(); trigi++){ diff --git a/UserTools/PhaseIIADCHitFinder/PhaseIIADCHitFinder.cpp b/UserTools/PhaseIIADCHitFinder/PhaseIIADCHitFinder.cpp index a7a4563ca..8be738345 100755 --- a/UserTools/PhaseIIADCHitFinder/PhaseIIADCHitFinder.cpp +++ b/UserTools/PhaseIIADCHitFinder/PhaseIIADCHitFinder.cpp @@ -71,6 +71,9 @@ bool PhaseIIADCHitFinder::Initialise(std::string config_filename, DataModel& dat // Get the Auxiliary channel types; identifies which channels are SiPM channels m_data->CStore.Get("AuxChannelNumToTypeMap",AuxChannelNumToTypeMap); + // Get the timing offsets + m_data->CStore.Get("ChannelNumToTankPMTTimingOffsetMap",ChannelKeyToTimingOffsetMap); + //Recreate maps that were deleted with ANNIEEvent->Delete() ANNIEEventBuilder tool hit_map = new std::map>; aux_hit_map = new std::map>; @@ -703,11 +706,21 @@ std::vector PhaseIIADCHitFinder::find_pulses_bywindow( // Convert the pulse integral to nC charge *= NS_PER_ADC_SAMPLE / ADC_IMPEDANCE; + // PMT Timing offsets + double timing_offset=0.0; + std::map::const_iterator it = ChannelKeyToTimingOffsetMap.find(channel_key); + if(it != ChannelKeyToTimingOffsetMap.end()){ //Timing offset is available + timing_offset = ChannelKeyToTimingOffsetMap.at(channel_key); + } else { + if(verbosity>2){ + std::cout << "Didn't find Timing offset for channel " << channel_key << std::endl; + } + } // Store the freshly made pulse in the vector of found pulses pulses.emplace_back(channel_key, - ( wmin * NS_PER_SAMPLE ), - peak_sample * NS_PER_SAMPLE, + ( wmin * NS_PER_SAMPLE )-timing_offset, + (peak_sample * NS_PER_SAMPLE)-timing_offset, calibrated_minibuffer_data.GetBaseline(), calibrated_minibuffer_data.GetSigmaBaseline(), raw_area, max_ADC, calibrated_amplitude, charge); @@ -805,10 +818,21 @@ std::vector PhaseIIADCHitFinder::find_pulses_bythreshold( // Convert the pulse integral to nC charge *= NS_PER_ADC_SAMPLE / ADC_IMPEDANCE; + // PMT Timing offsets + double timing_offset=0.0; + std::map::const_iterator it = ChannelKeyToTimingOffsetMap.find(channel_key); + if(it != ChannelKeyToTimingOffsetMap.end()){ //Timing offset is available + timing_offset = ChannelKeyToTimingOffsetMap.at(channel_key); + } else { + if(verbosity>2){ + std::cout << "Didn't find Timing offset for channel " << channel_key << std::endl; + } + } + // Store the freshly made pulse in the vector of found pulses pulses.emplace_back(channel_key, - ( pulse_start_sample * NS_PER_SAMPLE ), - peak_sample * NS_PER_SAMPLE, + ( pulse_start_sample * NS_PER_SAMPLE )-timing_offset, + (peak_sample * NS_PER_SAMPLE)-timing_offset, calibrated_minibuffer_data.GetBaseline(), calibrated_minibuffer_data.GetSigmaBaseline(), raw_area, max_ADC, calibrated_amplitude, charge); @@ -868,10 +892,60 @@ std::vector PhaseIIADCHitFinder::find_pulses_bythreshold( // very close together (i.e. if the end of one is just a few samples away // from the start of another) + // PMT Timing offsets + double timing_offset=0.0; + std::map::const_iterator it = ChannelKeyToTimingOffsetMap.find(channel_key); + if(it != ChannelKeyToTimingOffsetMap.end()){ //Timing offset is available + timing_offset = ChannelKeyToTimingOffsetMap.at(channel_key); + } else { + if(verbosity>2){ + std::cout << "Didn't find Timing offset for channel " << channel_key << std::endl; + } + } + + // New approach to hit timing to avoid 2ns bins - 50% threshold above baseline + // Look for where the ADC value crosses 50% of the maximum, assign hit time + // TODO: consider using an approach recommended by Bob: get time at 50%, get time at 20%, draw straight line in between and find time to zero threshold + const double threshold_percentage = 0.5; + unsigned short threshold_value = ((max_ADC - adc_threshold) * threshold_percentage) + adc_threshold; + double hit_time = peak_sample; + bool hit_time_found = false; + + // Find the first sample where the ADC value is above 50% + for (size_t p = peak_sample; p > pulse_start_sample; --p) { + if (raw_minibuffer_data.GetSample(p) < threshold_value) { + hit_time = p; + hit_time_found = true; + break; + } + } + + // Perform simple linear interpolation to find exact crossing point + if (hit_time_found) { + if(verbosity>4) std::cout << "Interpolating hit time..." << std::endl; + if (hit_time > pulse_start_sample && hit_time < pulse_end_sample) { + double x1 = hit_time; + double x2 = hit_time + 1.0; + unsigned short y1 = raw_minibuffer_data.GetSample(static_cast(x1)); + unsigned short y2 = raw_minibuffer_data.GetSample(static_cast(x2)); + hit_time = x1 + (threshold_value - y1) * (x2 - x1) / (y2 - y1); // linear interpolation + } + } + + if(verbosity>4) std::cout << "Hit time [ns] " << hit_time * NS_PER_ADC_SAMPLE << std::endl; + + if (hit_time < 0.0) { + // If for some reason the interpolation finds a negative time value (if the pulse is extremely early in the buffer), + // default to the peak time + std::cout << "Hit time is negative! Defaulting to peak time" << std::endl; + hit_time = peak_sample; + } + + // Store the freshly made pulse in the vector of found pulses pulses.emplace_back(channel_key, - ( pulse_start_sample * NS_PER_ADC_SAMPLE ), - peak_sample * NS_PER_ADC_SAMPLE, + ( pulse_start_sample * NS_PER_ADC_SAMPLE )-timing_offset, + (peak_sample * NS_PER_ADC_SAMPLE)-timing_offset, calibrated_minibuffer_data.GetBaseline(), calibrated_minibuffer_data.GetSigmaBaseline(), raw_area, max_ADC, calibrated_amplitude, charge); diff --git a/UserTools/PhaseIIADCHitFinder/PhaseIIADCHitFinder.h b/UserTools/PhaseIIADCHitFinder/PhaseIIADCHitFinder.h index d7af819c0..b3471d58e 100755 --- a/UserTools/PhaseIIADCHitFinder/PhaseIIADCHitFinder.h +++ b/UserTools/PhaseIIADCHitFinder/PhaseIIADCHitFinder.h @@ -59,7 +59,8 @@ class PhaseIIADCHitFinder : public Tool { std::map channel_threshold_map; std::map>> channel_window_map; bool eventbuilding_mode; - + + std::map ChannelKeyToTimingOffsetMap; std::map* AuxChannelNumToTypeMap; diff --git a/configfiles/BeamClusterAnalysis/ClusterFinderConfig b/configfiles/BeamClusterAnalysis/ClusterFinderConfig index 337d7fc2e..c13622045 100644 --- a/configfiles/BeamClusterAnalysis/ClusterFinderConfig +++ b/configfiles/BeamClusterAnalysis/ClusterFinderConfig @@ -3,9 +3,9 @@ verbosity 0 HitStore Hits #Either MCHits or Hits (accessed in ANNIEEvent store) OutputFile BeamRun_ClusterFinder_DefaultOutput #Output root prefix name for the current run -ClusterFindingWindow 100 # in ns, size of the window used to "clusterize" +ClusterFindingWindow 50 # in ns, size of the window used to "clusterize" AcqTimeWindow 70000 # in ns, size of the acquisition window -ClusterIntegrationWindow 100 # in ns, all hits with +/- 1/2 of this window are considered in the cluster +ClusterIntegrationWindow 50 # in ns, all hits with +/- 1/2 of this window are considered in the cluster MinHitsPerCluster 5 # group of hits are considered clusters above this amount of hits end_of_window_time_cut 0.95 # from o to 1, length of the window you want to loop over with respect to acq. window (1 for full window, 0.95 for 95% from the start) Plots2D 0 #Draw 2D charge-vs-time plots? diff --git a/configfiles/BeamClusterAnalysis/EventSelectorConfig b/configfiles/BeamClusterAnalysis/EventSelectorConfig index 73250c81d..a711f08bf 100644 --- a/configfiles/BeamClusterAnalysis/EventSelectorConfig +++ b/configfiles/BeamClusterAnalysis/EventSelectorConfig @@ -19,7 +19,7 @@ RecoFVCut 0 NHitCut 0 NHitmin 4 #Minimum number of hit digits PMTMRDCoincCut 0 -PMTMRDOffset 745 +PMTMRDOffset 755 PromptTrigOnly 0 TriggerWord -1 SaveStatusToStore 1 diff --git a/configfiles/BeamClusterAnalysisMC/ClusterFinderConfig b/configfiles/BeamClusterAnalysisMC/ClusterFinderConfig index 59ef4564a..db22be6ca 100644 --- a/configfiles/BeamClusterAnalysisMC/ClusterFinderConfig +++ b/configfiles/BeamClusterAnalysisMC/ClusterFinderConfig @@ -3,10 +3,9 @@ verbosity 0 HitStore MCHits #Either MCHits or Hits (accessed in ANNIEEvent store) OutputFile BeamRun_ClusterFinder_DefaultOutput #Output root prefix name for the current run -ClusterFindingWindow 100 # in ns, size of the window used to "clusterize" +ClusterFindingWindow 50 # in ns, size of the window used to "clusterize" AcqTimeWindow 70000 # in ns, size of the acquisition window -ClusterIntegrationWindow 100 # in ns, all hits with +/- 1/2 of this window are considered in the cluster +ClusterIntegrationWindow 50 # in ns, all hits with +/- 1/2 of this window are considered in the cluster MinHitsPerCluster 5 # group of hits are considered clusters above this amount of hits end_of_window_time_cut 0.95 # from o to 1, length of the window you want to loop over with respect to acq. window (1 for full window, 0.95 for 95% from the start) Plots2D 0 #Draw 2D charge-vs-time plots? -ChankeyToPMTIDMap ./configfiles/EventDisplay/Data-RecoEvent/Chankey_WCSimID.dat diff --git a/configfiles/BeamClusterAnalysisMC/DeadPMTIDs_p2v7.txt b/configfiles/BeamClusterAnalysisMC/DeadPMTIDs_p2v7.txt index a5e258dad..4ce119098 100644 --- a/configfiles/BeamClusterAnalysisMC/DeadPMTIDs_p2v7.txt +++ b/configfiles/BeamClusterAnalysisMC/DeadPMTIDs_p2v7.txt @@ -1,4 +1,5 @@ 2 +6 11 14 15 diff --git a/configfiles/BeamClusterAnalysisMC/LoadGenieEventConfig b/configfiles/BeamClusterAnalysisMC/LoadGenieEventConfig index 6e22a33ba..4bd3619c4 100644 --- a/configfiles/BeamClusterAnalysisMC/LoadGenieEventConfig +++ b/configfiles/BeamClusterAnalysisMC/LoadGenieEventConfig @@ -1,11 +1,24 @@ verbosity 2 -FluxVersion 0 # use 0 to load genie files based on bnb_annie_0000.root etc files - # use 1 to load files based on beammc_annie_0000.root etc files -#FileDir NA # specify "NA" for newer files: full path is saved in WCSim + +# Refers to format of flux file used to generate GENIE sample (bnb or gsimple) +FluxVersion 1 # use 0 to load genie files based on bnb_annie_0000.root etc files (bnb/redecay/dk2nu flux format) + # use 1 to load files based on beammc_annie_0000.root etc files (generated by Zarko, gsimple flux format) + # - All GENIE (and WCSim) files generated by James uses gsimple (1) format + +# Path to directory of GENIE files +#FileDir NA # special option to load path from associated WCSim (Not recommended) +#FileDir /pnfs/annie/persistent/simulations/genie3/G1810a0211a/standard/ FileDir /pnfs/annie/persistent/users/vfischer/genie_files/BNB_Water_10k_22-05-17 -#FileDir /pnfs/annie/persistent/users/moflaher/genie/BNB_World_10k_11-03-18_gsimpleflux -FilePattern gntp.197.ghep.root -#FilePattern LoadWCSimTool ## use this pattern to load corresponding genie info with the LoadWCSimTool - ## N.B: FileDir must still be specified for now! (WCSim files do not record their directory) -ManualFileMatching 0 -EventOffset 0 + +# Name of GENIE file to open +FilePattern gntp.99.ghep.root # gntp.[run_number].ghep.root +#FilePattern LoadWCSimTool # special option to load GENIE events corresponding to WCSim events + +# Option to match GENIE events to WCSim events without using file path saved in WCSim file +ManualFileMatching 1 # 0 (false) - no manual matching, 1 (true) - uses FileDir and info from WCSim file name to find GENIE files/events - strongly recommended to use (1)! (as of Aug 2023) + +# Number of events in the WCSim file (used for offsetting the GENIE file event when used in conjunction with ManualFileMatching) +FileEvents 1000 # 1000 for James' WCSim files, 500 for Marcus' files + +# Number to offset the first loaded GENIE event (for usage without ManualFileMatching) - 0 by default +EventOffset 0 diff --git a/configfiles/BeamClusterAnalysisMC/LoadGeometryConfig b/configfiles/BeamClusterAnalysisMC/LoadGeometryConfig index 894092ba3..c64227136 100644 --- a/configfiles/BeamClusterAnalysisMC/LoadGeometryConfig +++ b/configfiles/BeamClusterAnalysisMC/LoadGeometryConfig @@ -4,5 +4,5 @@ FACCMRDGeoFile ./configfiles/LoadGeometry/FullMRDGeometry.csv DetectorGeoFile ./configfiles/LoadGeometry/DetectorGeometrySpecs.csv LAPPDGeoFile ./configfiles/LoadGeometry/LAPPDGeometry.csv TankPMTGeoFile ./configfiles/LoadGeometry/FullTankPMTGeometry.csv -TankPMTGainFile ./configfiles/LoadGeometry/ChannelSPEGains_BeamRun20192020.csv +TankPMTGainFile ./configfiles/LoadGeometry/ChannelSPEGains2023.csv AuxiliaryChannelFile ./configfiles/LoadGeometry/AuxChannels.csv diff --git a/configfiles/BeamClusterAnalysisMC/LoadWCSimConfig b/configfiles/BeamClusterAnalysisMC/LoadWCSimConfig index defd4639b..a25d47f59 100644 --- a/configfiles/BeamClusterAnalysisMC/LoadWCSimConfig +++ b/configfiles/BeamClusterAnalysisMC/LoadWCSimConfig @@ -2,12 +2,12 @@ # all variables retrieved with m_variables.Get() must be defined here! verbose 1 -#InputFile /pnfs/annie/persistent/users/moflaher/wcsim/multipmt/tankonly/wcsim_25_04_19_ANNIEp2v6_nodigit_BNB_Water_10k_22-05-17/wcsim_0.1.9.root -#InputFile /annie/app/users/mnieslon/WCSim_build/wcsim_ambe_port5_z0_5000_0.root -InputFile /pnfs/annie/persistent/users/mnieslon/wcsim/output/tankonly/wcsim_ANNIEp2v7_beam/pmt-files/wcsim_beam_gst_1079_0_0.9000.root -#InputFile /pnfs/annie/persistent/users/mnieslon/wcsim/output/tankonly/wcsim_ANNIEp2v7_beam/pmt-files/wcsim_beam_gst_1079_9_0.9009.root -#InputFile /annie/app/users/mnieslon/WCSim_build/wcsim_michel_1000_0.root -#InputFile /pnfs/annie/persistent/users/mnieslon/wcsim/output/tankonly/wcsim_ANNIEp2v7_throughgoing/wcsim_throughgoing_muon_R2614_0.0.root +# WCSim collaboration samples using GENIE (from James): +#InputFile /pnfs/annie/persistent/simulations/wcsim/G1810a0211a/standard//pmt/wcsim_0.X.Y.root +# where X = run number for the corresponding GENIE file (gntp.X.ghep.root) +# Y = offset multiple for GENIE event number + +InputFile /pnfs/annie/persistent/users/moflaher/wcsim/multipmt/tankonly/wcsim_25_04_19_ANNIEp2v6_nodigit_BNB_Water_10k_22-05-17/wcsim_0.1.9.root WCSimVersion 3 ## should reflect the WCSim version of the files being loaded HistoricTriggeroffset 0 ## time offset of digits relative to the trigger diff --git a/configfiles/BeamClusterAnalysisMC/PhaseIITreeMakerConfig b/configfiles/BeamClusterAnalysisMC/PhaseIITreeMakerConfig index 29999cdee..138764f15 100644 --- a/configfiles/BeamClusterAnalysisMC/PhaseIITreeMakerConfig +++ b/configfiles/BeamClusterAnalysisMC/PhaseIITreeMakerConfig @@ -11,6 +11,7 @@ SiPMPulseInfo_fill 0 fillCleanEventsOnly 0 MCTruth_fill 1 Reco_fill 0 +TankReco_fill 0 RecoDebug_fill 0 muonTruthRecoDiff_fill 0 IsData 0 diff --git a/configfiles/EventBuilder/README.md b/configfiles/EventBuilder/README.md new file mode 100644 index 000000000..089e9c8a2 --- /dev/null +++ b/configfiles/EventBuilder/README.md @@ -0,0 +1,27 @@ +# EventBuilder + +*********************** +## Description +********************** + +The `EventBuilder` toolchain is used to event build for ANNIE. The toolchain reads in RAWData files, time match, and creates processed ANNIEEvents with Tank, CTC, and MRD information (currently no LAPPD information is included). This toolchain consolidated efforts to create an official event building toolchain, and should replace the `DataDecoder` toolchain which is now considered depreciated. + +Please consult the following ANNIE wiki page on how to event build: https://cdcvs.fnal.gov/redmine/projects/annie_experiment/wiki/Event_Building_with_ToolAnalysis + +************************ +## Tools +************************ + +The toolchain consists of the following tools: + +``` +LoadGeometry +LoadRawData +PMTDataDecoder +MRDDataDecoder +TriggerDataDecoder +PhaseIIADCCalibrator +PhaseIIADCHitFinder +SaveConfigInfo +ANNIEEventBuilder +``` diff --git a/configfiles/EventBuilderRaw/ANNIEEventBuilderConfig b/configfiles/EventBuilderRaw/ANNIEEventBuilderConfig new file mode 100644 index 000000000..a87912902 --- /dev/null +++ b/configfiles/EventBuilderRaw/ANNIEEventBuilderConfig @@ -0,0 +1,20 @@ +verbosity 0 + +BuildType TankAndCTC +ProcessedFilesBasename ProcessedRawData +#NumEventsPerPairing 200 +SavePath ./ + +MinNumWavesInSet 1 // 1=Just throw any waveforms into ANNIE events if you got em + +ExecutesPerBuild 10 +OrphanOldTankTimestamps 1 +OldTimestampThreshold 150 +OrphanFileBase OrphanStore +#MaxStreamMatchingTimeSeparation 60 // seconds. If one stream is ahead of the others, pause reading + +SaveRawData 1 +StoreBeamStatus 0 + +BuildStage1Data 0 +SaveSeparatePartfiles 1 diff --git a/configfiles/EventBuilderRaw/DefaultTriggerMask.txt b/configfiles/EventBuilderRaw/DefaultTriggerMask.txt new file mode 100644 index 000000000..398850355 --- /dev/null +++ b/configfiles/EventBuilderRaw/DefaultTriggerMask.txt @@ -0,0 +1,10 @@ +#Triggers are given by Jonathan; place one number per line. Values are index + 1 +#4+1: Delayed beam. 32+1: LED trigger. 34+1: AmBe and Cosmic trigger. 35+1: MRD_CR_Trigger. 30+1: LED_Start. 45+1, 46+1: Laser. 14+1: AmBe external trigger +5 +15 +36 +31 +33 +35 +46 +47 diff --git a/configfiles/EventBuilderRaw/LoadGeometryConfig b/configfiles/EventBuilderRaw/LoadGeometryConfig new file mode 100644 index 000000000..6c9e006fc --- /dev/null +++ b/configfiles/EventBuilderRaw/LoadGeometryConfig @@ -0,0 +1,9 @@ +verbosity 0 +LAPPDChannelCount 60 +FACCMRDGeoFile ./configfiles/LoadGeometry/FullMRDGeometry.csv +DetectorGeoFile ./configfiles/LoadGeometry/DetectorGeometrySpecs.csv +LAPPDGeoFile ./configfiles/LoadGeometry/LAPPDGeometry.csv +TankPMTGeoFile ./configfiles/LoadGeometry/FullTankPMTGeometry.csv +TankPMTGainFile ./configfiles/LoadGeometry/ChannelSPEGains2023.csv +TankPMTTimingOffsetFile ./configfiles/LoadGeometry/TankPMTTimingOffsets.csv +AuxiliaryChannelFile ./configfiles/LoadGeometry/AuxChannels.csv diff --git a/configfiles/EventBuilderRaw/LoadRawDataConfig b/configfiles/EventBuilderRaw/LoadRawDataConfig new file mode 100644 index 000000000..ffaf99fbd --- /dev/null +++ b/configfiles/EventBuilderRaw/LoadRawDataConfig @@ -0,0 +1,9 @@ +verbosity 0 +BuildType TankAndCTC +#BuildType CTC +Mode FileList +InputFile ./configfiles/DataDecoder/my_files.txt +DummyRunInfo 1 +StoreTrigOverlap 0 +ReadTrigOverlap 1 +StoreRawData 0 diff --git a/configfiles/EventBuilderRaw/PMTDataDecoderConfig b/configfiles/EventBuilderRaw/PMTDataDecoderConfig new file mode 100644 index 000000000..19e946601 --- /dev/null +++ b/configfiles/EventBuilderRaw/PMTDataDecoderConfig @@ -0,0 +1,5 @@ +verbosity 0 +ADCCountsToBuildWaves 0 +Mode Offline +OffsetVME03 0 +OffsetVME01 0 diff --git a/configfiles/EventBuilderRaw/PhaseIIADCCalibratorConfig b/configfiles/EventBuilderRaw/PhaseIIADCCalibratorConfig new file mode 100644 index 000000000..158dc6ed1 --- /dev/null +++ b/configfiles/EventBuilderRaw/PhaseIIADCCalibratorConfig @@ -0,0 +1,15 @@ +# PhaseIIADCCalibrator config file + +verbosity 0 + +BaselineEstimationType ze3ra_multi +NumBaselineSamples 15 +NumSubWaveforms 10 + +SamplesPerBaselineEstimate 2000 +BaselineUncertaintyTolerance 2 +PCritical 0.01 +MakeCalLEDWaveforms 0 + +EventBuilding 1 +ExecutesPerBuild 10 diff --git a/configfiles/EventBuilderRaw/PhaseIIADCHitFinderConfig b/configfiles/EventBuilderRaw/PhaseIIADCHitFinderConfig new file mode 100644 index 000000000..d183b7b27 --- /dev/null +++ b/configfiles/EventBuilderRaw/PhaseIIADCHitFinderConfig @@ -0,0 +1,10 @@ +verbosity 0 + +UseLEDWaveforms 0 + +PulseFindingApproach threshold +PulseWindowType dynamic +DefaultADCThreshold 7 +DefaultThresholdType relative + +EventBuilding 1 diff --git a/configfiles/EventBuilderRaw/README.md b/configfiles/EventBuilderRaw/README.md new file mode 100644 index 000000000..73cc63a5e --- /dev/null +++ b/configfiles/EventBuilderRaw/README.md @@ -0,0 +1,25 @@ +# EventBuilderRaw + +*********************** +## Description +********************** + +The `EventBuilderRaw` toolchain can be used to produce Processed files that contain the raw waveforms (PMTs) and store them to the ANNIEEvent booststore. This toolchain is essentially the same as the `EventBuilder` toolchain, except that raw waveforms are saved, not just the hits. + +This toolchain only builts Tank + CTC events (no MRD). Hit finding tools are typically ommitted from the toolchain but can be including to also save the hits information in parallel with the raw waveforms. + +Warning to users: When using this toolchain, enormous amounts of disk space will be used as all ~121 active PMT channels (and aux channels + CTC information) will be saved for every trigger/event. Recommended to run a part file at a time. The output Processed files will be at least x10 larger than their hits only counterparts. + +************************ +## Tools +************************ + +The toolchain typically consists of the following tools: + +``` +LoadGeometry +LoadRawData +PMTDataDecoder +TriggerDataDecoder +ANNIEEventBuilder +``` diff --git a/configfiles/EventBuilderRaw/ToolChainConfig b/configfiles/EventBuilderRaw/ToolChainConfig new file mode 100644 index 000000000..e65304c6f --- /dev/null +++ b/configfiles/EventBuilderRaw/ToolChainConfig @@ -0,0 +1,23 @@ +#ToolChain dynamic setup file + +##### Runtime Paramiters ##### +verbose 1 +error_level 0 # 0= do not exit, 1= exit on unhandeled errors only, 2= exit on unhandeled errors and handeled errors +attempt_recover 1 + +###### Logging ##### +log_mode Interactive # Interactive=cout , Remote= remote logging system "serservice_name Remote_Logging" , Local = local file log; +log_local_path ./log +log_service LogStore + +###### Service discovery ##### +service_publish_sec -1 +service_kick_sec -1 + +##### Tools To Add ##### +Tools_File ./configfiles/EventBuilderRaw/ToolsConfig + +##### Run Type ##### +Inline -1 +Interactive 0 + diff --git a/configfiles/EventBuilderRaw/ToolsConfig b/configfiles/EventBuilderRaw/ToolsConfig new file mode 100644 index 000000000..9e731b51d --- /dev/null +++ b/configfiles/EventBuilderRaw/ToolsConfig @@ -0,0 +1,7 @@ +LoadGeometry LoadGeometry ./configfiles/LoadGeometry/LoadGeometryConfig +LoadRawData LoadRawData ./configfiles/EventBuilderRaw/LoadRawDataConfig +PMTDataDecoder PMTDataDecoder ./configfiles/EventBuilderRaw/PMTDataDecoderConfig +TriggerDataDecoder TriggerDataDecoder ./configfiles/EventBuilderRaw/TriggerDataDecoderConfig +#PhaseIIADCCalibrator PhaseIIADCCalibrator ./configfiles/EventBuilderRaw/PhaseIIADCCalibratorConfig +#PhaseIIADCHitFinder PhaseIIADCHitFinder ./configfiles/EventBuilderRaw/PhaseIIADCHitFinderConfig +ANNIEEventBuilder ANNIEEventBuilder ./configfiles/EventBuilderRaw/ANNIEEventBuilderConfig diff --git a/configfiles/EventBuilderRaw/TriggerDataDecoderConfig b/configfiles/EventBuilderRaw/TriggerDataDecoderConfig new file mode 100644 index 000000000..c80c66547 --- /dev/null +++ b/configfiles/EventBuilderRaw/TriggerDataDecoderConfig @@ -0,0 +1,4 @@ +verbosity 0 +TriggerMaskFile ./configfiles/EventBuilderRaw/DefaultTriggerMask.txt +StoreTrigOverlap 0 +ReadTrigOverlap 0 diff --git a/configfiles/EventBuilderRaw/my_files.txt b/configfiles/EventBuilderRaw/my_files.txt new file mode 100644 index 000000000..de43e7839 --- /dev/null +++ b/configfiles/EventBuilderRaw/my_files.txt @@ -0,0 +1 @@ +/pnfs/annie/persistent/raw/raw/4314/RAWDataR4314S0p1 diff --git a/configfiles/LoadGeometry/LoadGeometryConfig b/configfiles/LoadGeometry/LoadGeometryConfig index 693f546d2..79efc3811 100644 --- a/configfiles/LoadGeometry/LoadGeometryConfig +++ b/configfiles/LoadGeometry/LoadGeometryConfig @@ -6,4 +6,5 @@ DetectorGeoFile ./configfiles/LoadGeometry/DetectorGeometrySpecs.csv LAPPDGeoFile ./configfiles/LoadGeometry/LAPPDGeometry.csv TankPMTGeoFile ./configfiles/LoadGeometry/FullTankPMTGeometry.csv TankPMTGainFile ./configfiles/LoadGeometry/ChannelSPEGains2023.csv +TankPMTTimingOffsetFile ./configfiles/LoadGeometry/TankPMTTimingOffsets.csv AuxiliaryChannelFile ./configfiles/LoadGeometry/AuxChannels.csv diff --git a/configfiles/LoadGeometry/TankPMTTimingOffsets.csv b/configfiles/LoadGeometry/TankPMTTimingOffsets.csv new file mode 100644 index 000000000..cdfed43c9 --- /dev/null +++ b/configfiles/LoadGeometry/TankPMTTimingOffsets.csv @@ -0,0 +1,120 @@ +##Channel,PMT_location,offset_value(ns),offset_std(ns),notes +332,Bottom,15.25,1.31,unreliable +334,Bottom,15.55,0.57,ok +335,Bottom,8.34,1.36,unreliable +336,Bottom,15.41,1.33,unreliable +338,Bottom,10.15,1.85,unreliable +339,Bottom,8.57,0.95,ok +340,Bottom,8.66,1.29,unreliable +341,Bottom,11.51,1.95,unreliable +343,Bottom,14.24,0.33,ok (low statistics) +344,Bottom,13.41,2.11,unreliable (low statistics) +347,Bottom,10.6,1.92,unreliable +348,Bottom,7.08,2.1,unreliable +350,Bottom,3.15,1.03,ok +351,Bottom,9.16,1.05,ok +353,Top,16.13,1.14,ok (low statistics) +354,Top,10.44,1.55,unreliable +355,Top,14.27,2.08,ok +356,Top,12.88,1.48,unreliable +357,Top,8.66,2.21,ok +358,Top,8.13,1.46,ok +360,Top,8.04,2.56,ok +361,Top,14.42,1.5,unreliable +362,Top,4.88,1.88,ok +363,Top,16.96,2.24,ok +364,Top,16.22,2.83,ok +365,Top,12.43,1.53,unreliable +366,Top,11.78,1.48,ok +367,Top,14.19,2.02,ok +368,Top,10.45,1.87,ok +369,Top,18.45,1.87,ok +370,Top,18.82,2.75,ok +371,Top,16.93,1.91,ok +372,Barrel,9.13,0.9,ok +373,Barrel,7.84,0.93,ok +374,Barrel,4.81,1.21,ok +375,Barrel,1.03,1.0,ok +376,Barrel,15.7,1.27,ok +377,Barrel,16.4,0.85,ok +378,Barrel,6.5,0.87,ok +379,Barrel,9.15,0.94,ok +380,Barrel,6.97,0.9,ok +381,Barrel,4.75,1.0,ok +382,Barrel,16.09,1.32,ok +383,Barrel,11.66,1.37,ok +384,Barrel,7.84,0.98,ok +385,Barrel,5.82,1.31,ok +386,Barrel,5.99,1.29,ok +387,Barrel,5.15,0.87,ok +388,Barrel,10.01,0.92,ok +389,Barrel,7.85,1.28,ok +390,Barrel,9.93,0.95,ok +391,Barrel,11.64,1.36,ok +392,Barrel,9.64,1.02,ok +393,Barrel,3.16,1.41,ok +394,Barrel,9.26,0.97,ok +395,Barrel,11.18,1.41,ok +396,Barrel,8.17,1.37,ok +397,Barrel,6.0,0.99,ok +398,Barrel,10.38,0.89,ok +399,Barrel,14.8,1.01,ok +400,Barrel,12.03,0.97,ok +401,Barrel,13.92,0.96,ok +402,Barrel,11.0,0.9,ok +403,Barrel,11.57,1.28,ok +404,Barrel,12.36,0.9,ok +405,Barrel,6.9,1.4,ok +406,Barrel,10.33,0.83,ok +407,Barrel,16.25,0.9,ok +409,Barrel,11.86,1.25,ok +410,Barrel,9.14,1.29,ok +411,Barrel,6.38,0.85,ok +412,Barrel,6.22,0.82,ok +413,Barrel,4.1,1.27,ok +414,Barrel,16.84,1.32,ok +415,Barrel,12.67,0.97,ok +417,Barrel,7.98,1.45,ok +418,Barrel,7.96,2.28,unreliable +419,Barrel,17.9,1.92,ok +420,Barrel,6.82,1.96,ok +421,Barrel,11.13,1.96,ok +422,Barrel,11.53,2.0,ok +423,Barrel,9.71,2.84,ok +424,Barrel,8.68,1.92,ok +425,Barrel,12.89,2.32,ok +426,Barrel,10.84,2.51,ok +427,Barrel,7.92,1.37,ok +428,Barrel,10.07,2.24,ok +429,Barrel,12.23,1.01,ok +430,Barrel,7.6,2.0,ok +432,Barrel,11.94,1.57,ok +433,Barrel,12.1,1.47,ok +434,Barrel,9.58,1.85,ok +435,Barrel,12.41,1.5,ok +436,Barrel,8.17,1.43,ok +437,Barrel,4.91,1.57,ok +438,Barrel,14.03,2.01,ok +439,Barrel,10.26,1.57,ok +440,Barrel,5.55,2.54,ok +441,Barrel,9.52,2.28,ok +442,Barrel,12.17,1.58,ok +443,Barrel,16.01,2.88,ok +446,Barrel,10.01,2.45,ok +447,Barrel,12.17,1.49,ok +448,Barrel,11.31,1.55,ok +449,Barrel,13.17,1.32,ok +450,Barrel,5.7,1.88,ok +451,Barrel,6.34,1.46,ok +452,Barrel,12.1,1.42,ok +453,Barrel,0.0,1.55,ok +454,Barrel,8.29,1.04,ok +455,Barrel,17.55,1.42,ok +456,Barrel,9.53,1.53,unreliable +457,Barrel,10.18,1.6,ok +458,Barrel,10.18,1.54,ok +459,Barrel,9.69,1.99,ok +460,Barrel,5.08,1.04,ok +461,Barrel,9.32,1.59,ok +462,Barrel,17.05,2.13,ok +463,Barrel,16.18,1.44,ok diff --git a/configfiles/LoadWCSim/DeadPMTIDs_p2v7.txt b/configfiles/LoadWCSim/DeadPMTIDs_p2v7.txt index a5e258dad..4ce119098 100644 --- a/configfiles/LoadWCSim/DeadPMTIDs_p2v7.txt +++ b/configfiles/LoadWCSim/DeadPMTIDs_p2v7.txt @@ -1,4 +1,5 @@ 2 +6 11 14 15 diff --git a/configfiles/LoadWCSim/LoadWCSimConfig b/configfiles/LoadWCSim/LoadWCSimConfig index c142231f6..a25d47f59 100644 --- a/configfiles/LoadWCSim/LoadWCSimConfig +++ b/configfiles/LoadWCSim/LoadWCSimConfig @@ -2,17 +2,19 @@ # all variables retrieved with m_variables.Get() must be defined here! verbose 1 -#InputFile /pnfs/annie/persistent/users/moflaher/wcsim/lappd/tankonly/wcsim_lappd_tankonly_24-09-17_BNB_Water_10k_22-05-17/wcsim_0.0.0.root -#InputFile /pnfs/annie/persistent/users/moflaher/wcsim/lappd/tankonly/wcsim_lappd_tankonly_03-05-17_rhatcher/wcsim_0.1000.root ## first of the DOE proposal files -#InputFile /pnfs/annie/persistent/users/moflaher/wcsim/multipmt/tankonly/wcsim_3-12-18_ANNIEp2v6_BNB_Water_10k_22-05-17/wcsim_0.0.0.root -#InputFile /pnfs/annie/persistent/users/moflaher/wcsim/multipmt/tankonly/wcsim_25_04_19_ANNIEp2v6_nodigit_BNB_Water_10k_22-05-17/wcsim_0.0.0.root -InputFile ./25_04_19_wcsim_0.0.0.root +# WCSim collaboration samples using GENIE (from James): +#InputFile /pnfs/annie/persistent/simulations/wcsim/G1810a0211a/standard//pmt/wcsim_0.X.Y.root +# where X = run number for the corresponding GENIE file (gntp.X.ghep.root) +# Y = offset multiple for GENIE event number + +InputFile /pnfs/annie/persistent/users/moflaher/wcsim/multipmt/tankonly/wcsim_25_04_19_ANNIEp2v6_nodigit_BNB_Water_10k_22-05-17/wcsim_0.1.9.root WCSimVersion 3 ## should reflect the WCSim version of the files being loaded HistoricTriggeroffset 0 ## time offset of digits relative to the trigger UseDigitSmearedTime 1 ## whether to use smeared digit time (T), or true time of first photon (F) -LappdNumStrips 56 ## num channels to construct from each LAPPD +LappdNumStrips 60 ## num channels to construct from each LAPPD LappdStripLength 100 ## relative x position of each LAPPD strip, for dual-sided readout [mm] LappdStripSeparation 10 ## stripline separation, for calculating relative y position of each LAPPD strip [mm] -PMTMask ./configfiles/LoadWCSim/DeadPMTIDs_p2v7.txt ## Which PMTs should be masked out? / are dead? -ChankeyToPMTIDMap ./configfiles/LoadWCSim/Chankey_WCSimID_v7.txt +PMTMask configfiles/BeamClusterAnalysisMC/DeadPMTIDs_p2v7.txt ## Which PMTs should be masked out? / are dead? +ChankeyToPMTIDMap ./configfiles/BeamClusterAnalysisMC/Chankey_WCSimID_v7.txt +SplitSubTriggers 0 # should subtriggers be loaded in separate Execute steps? diff --git a/configfiles/PrintADCData/LoadANNIEEventConfig b/configfiles/PrintADCData/LoadANNIEEventConfig new file mode 100644 index 000000000..de401a767 --- /dev/null +++ b/configfiles/PrintADCData/LoadANNIEEventConfig @@ -0,0 +1,4 @@ +verbose 4 +EventOffset 0 +FileForListOfInputs ./configfiles/PrintADCData/my_inputs.txt +GlobalEvNr 1 # If multiple files are present, introduce a global event number across files? diff --git a/configfiles/PrintADCData/PhaseIIADCCalibratorConfig b/configfiles/PrintADCData/PhaseIIADCCalibratorConfig new file mode 100644 index 000000000..e67bc4513 --- /dev/null +++ b/configfiles/PrintADCData/PhaseIIADCCalibratorConfig @@ -0,0 +1,15 @@ +# PhaseIIADCCalibrator config file + +verbosity 0 + +BaselineEstimationType ze3ra_multi +NumBaselineSamples 15 +NumSubWaveforms 10 + +SamplesPerBaselineEstimate 2000 +BaselineUncertaintyTolerance 2 +PCritical 0.01 +MakeCalLEDWaveforms 0 + +EventBuilding 0 +ExecutesPerBuild 10 diff --git a/configfiles/PrintADCData/PhaseIIADCHitFinderConfig b/configfiles/PrintADCData/PhaseIIADCHitFinderConfig new file mode 100644 index 000000000..473dd1dc7 --- /dev/null +++ b/configfiles/PrintADCData/PhaseIIADCHitFinderConfig @@ -0,0 +1,10 @@ +verbosity 0 + +UseLEDWaveforms 0 + +PulseFindingApproach threshold +PulseWindowType dynamic +DefaultADCThreshold 7 +DefaultThresholdType relative + +EventBuilding 0 diff --git a/configfiles/PrintADCData/PrintADCDataConfig b/configfiles/PrintADCData/PrintADCDataConfig new file mode 100644 index 000000000..817d22b20 --- /dev/null +++ b/configfiles/PrintADCData/PrintADCDataConfig @@ -0,0 +1,11 @@ +verbosity 5 + +UseLEDWaveforms 0 # specifies whether to show or save full waveforms from the DAQ or the LED waveform windows + +OutputFile test # Base filename given to both the ROOT and txt file that are output from the tool + +SaveWaveforms 1 # Determines whether or not to save raw waveforms in the output ROOT file + +WavesWithPulsesOnly 0 # Controls whether or not to save only waveforms that have a pulse in them (determined by the hit finding tools) + +MaxWaveforms 1000 # Controls the number of raw waveforms to be saved to the output ROOT file. Used to keep the ROOT file from exploding under the sheer number of raw waveforms saved diff --git a/configfiles/PrintADCData/README.md b/configfiles/PrintADCData/README.md new file mode 100644 index 000000000..e9a5e6b21 --- /dev/null +++ b/configfiles/PrintADCData/README.md @@ -0,0 +1,64 @@ +# PrintADCData toolchain + +*********************** +# Description +********************** + +The `PrintADCData` toolchain is used to analyze properties in an ANNIEEvent booststore's RecoADCHits vector (and the Aux information). The tool specifically looks at the raw and calibrated waveforms for Tank PMTs and Aux channels and outputs information including: +* Example raw waveforms for all PMTs channels, and aux channels (BoosterRWM, BoosterRF) +* The number of waveforms collected for each channel +* The number of pulses collected for each channel +* The number of waveforms with at least one pulse for each channel +* 2D histograms of the hit occupancy in y vs, phi space + +************************ +# Data +************************ + +Two files are producing after running this toolchain: +* ROOT file with raw waveforms and the 2D hit occupancy histograms +* .txt file with the waveform/pulse info described above + +************************ +# Configuration of PrintADCData tool +************************ +``` + +UseLEDWaveforms [int] +Specifies whether to show and save full waveforms from the DAQ, or +the LED waveform windows produced from running +PhaseIIADCCalibrator with MakeLEDWaveforms set at 1. +1=Show/save LED waveforms, +0= Show/save raw waveforms. + +verbosity [int] +controls the amount of print output (0- lowest, 5-highest) + +OutputFile [string] +Base filename given to both the ROOT and text file that are output from the tool. + + +SaveWaveforms [bool] +Determines whether or not to save raw waveforms in the output ROOT file. +1 = yes, 0 = no + +WavesWithPulsesOnly [bool] +Controls whether or not to save only waveforms that have a pulse in them. Whether +or not the wave has a pulse is determined by logic output by the PhaseIIADCHitFinder +tool. + +MaxWaveforms [int] +Controls the number of raw waveform examples saved to the output ROOT file. +Used to keep the ROOT file from exploding under the sheer number of raw +waveforms saved. + +LEDsUsed [string] +Log string saved in the output text file to record what LEDs were used for the +run being processed. Will eventually be automated when the DAQ can control +the LEDs. + +LEDSetpoints [string] +Log string saved in the output text file to record what LED setpoints were used + for the run being processed. Will eventually be automated when the DAQ +can control the LEDs. +``` diff --git a/configfiles/PrintADCData/ToolChainConfig b/configfiles/PrintADCData/ToolChainConfig new file mode 100644 index 000000000..552a4ccf3 --- /dev/null +++ b/configfiles/PrintADCData/ToolChainConfig @@ -0,0 +1,26 @@ +#ToolChain dynamic setup file + +##### Runtime Parameters ##### +verbose 1 ## Verbosity level of ToolChain +error_level 0 # 0= do not exit, 1= exit on unhandled errors only, 2= exit on unhandled errors and handled errors +attempt_recover 1 ## 1= will attempt to finalise if an execute fails +remote_port 24002 +IO_Threads 1 ## Number of threads for network traffic (~ 1/Gbps) + +###### Logging ##### +log_mode Interactive # Interactive=cout , Remote= remote logging system "serservice_name Remote_Logging" , Local = local file log; +log_local_path ./log +log_service LogStore + + +###### Service discovery ##### Ignore these settings for local analysis +service_publish_sec -1 +service_kick_sec -1 + +##### Tools To Add ##### +Tools_File configfiles/PrintADCData/ToolsConfig ## list of tools to run and their config files + +##### Run Type ##### +Inline -1 ## number of Execute steps in program, -1 infinite loop that is ended by user +Interactive 0 ## set to 1 if you want to run the code interactively + diff --git a/configfiles/PrintADCData/ToolsConfig b/configfiles/PrintADCData/ToolsConfig new file mode 100644 index 000000000..57c6ac4db --- /dev/null +++ b/configfiles/PrintADCData/ToolsConfig @@ -0,0 +1,5 @@ +myLoadGeometry LoadGeometry configfiles/LoadGeometry/LoadGeometryConfig +myLoadANNIEEvent LoadANNIEEvent configfiles/PrintADCData/LoadANNIEEventConfig +myPhaseIIADCCalibrator PhaseIIADCCalibrator ./configfiles/PrintADCData/PhaseIIADCCalibratorConfig +myPhaseIIADCHitFinder PhaseIIADCHitFinder ./configfiles/PrintADCData/PhaseIIADCHitFinderConfig +myPrintADCData PrintADCData configfiles/PrintADCData/PrintADCDataConfig diff --git a/configfiles/PrintADCData/my_inputs.txt b/configfiles/PrintADCData/my_inputs.txt new file mode 100644 index 000000000..c7a51732f --- /dev/null +++ b/configfiles/PrintADCData/my_inputs.txt @@ -0,0 +1 @@ +./ProcessedRawData_TankAndCTC_R4314S0p1